\r
package eu.etaxonomy.cdm.io.common.mapping.out;\r
\r
+import java.util.UUID;\r
+\r
import org.apache.log4j.Logger;\r
import org.hsqldb.Types;\r
import org.joda.time.DateTime;\r
\r
import eu.etaxonomy.cdm.io.common.DbExportStateBase;\r
+import eu.etaxonomy.cdm.model.common.AnnotatableEntity;\r
import eu.etaxonomy.cdm.model.common.CdmBase;\r
+import eu.etaxonomy.cdm.model.common.IAnnotatableEntity;\r
+import eu.etaxonomy.cdm.model.common.Marker;\r
import eu.etaxonomy.cdm.model.common.VersionableEntity;\r
\r
/**\r
@SuppressWarnings("unused")\r
private static final Logger logger = Logger.getLogger(DbLastActionMapper.class);\r
\r
+ public static final UUID uuidMarkerTypeHasNoLastAction = UUID.fromString("99652d5a-bc92-4251-b57d-0fec4d258ab7");\r
boolean isActionType;\r
\r
public static DbLastActionMapper NewInstance(String dbAttributeString, boolean isActionType){\r
@Override\r
protected Object getValue(CdmBase cdmBase) {\r
if (cdmBase.isInstanceOf(VersionableEntity.class)){\r
+ //exclude objects marked as 'hasNoM\r
+ if (cdmBase.isInstanceOf(AnnotatableEntity.class)){\r
+ IAnnotatableEntity annoEnti = cdmBase.deproxy(cdmBase, AnnotatableEntity.class);\r
+ if (annoEnti.hasMarker(uuidMarkerTypeHasNoLastAction, true)){\r
+ return null;\r
+ }\r
+ }\r
+ //return updated or created \r
VersionableEntity versionable = CdmBase.deproxy(cdmBase, VersionableEntity.class);\r
if (versionable.getUpdated() != null){\r
- if (isActionType){\r
- return "changed";\r
- }else{\r
- return versionable.getUpdated();\r
- }\r
+ return makeChanged(versionable);\r
+ }else{\r
+ return makeCreated(cdmBase);\r
}\r
+ }else{\r
+ //return created\r
+ return makeCreated(cdmBase);\r
+ }\r
+ }\r
+\r
+ private Object makeChanged(VersionableEntity versionable) {\r
+ if (isActionType){\r
+ return "changed";\r
+ }else{\r
+ return versionable.getUpdated();\r
}\r
+ }\r
+\r
+ private Object makeCreated(CdmBase cdmBase) {\r
if (isActionType){\r
return "created";\r
}else{\r