cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/Figure.java -text
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/GrantedAuthorityImpl.java -text
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/Group.java -text
+cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/IAnnotatableEntity.java -text svneol=unset#text/plain
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/ICdmBase.java -text
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/IDefinedTerm.java -text
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/IEvent.java -text
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/IReferencedEntity.java -text
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/IRelated.java -text
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/ISourceable.java -text
+cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/IVersionableEntity.java -text svneol=unset#text/plain
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/IdentifiableEntity.java -text
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/IdentifiableSource.java -text
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/LSID.java -text
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/FeatureNode.java -text
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/FeatureTree.java -text
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/IIdentificationKey.java -text
+cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/IModifiable.java -text svneol=unset#text/plain
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/IndividualsAssociation.java -text
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/MeasurementUnit.java -text
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/MediaKey.java -text
}\r
\r
ReferenceBase sourceReference = config.getSourceReference();\r
- String message = "Start import from Source '"+ config.getSourceNameString() + "' to destination '" + config.getDestinationNameString() + "'";\r
- logger.info(message);\r
- config.updateProgress(message);\r
+ logger.info("Start import from Source '"+ config.getSourceNameString() + "' to destination '" + config.getDestinationNameString() + "'");\r
+ \r
\r
ImportStateBase state = config.getNewState();\r
state.initialize(config);\r
// \r
// }\r
\r
- message = "End import from source '" + config.getSourceNameString() \r
- + "' to destination '" + config.getDestinationNameString() + "'"+\r
- (result? "(successful)":"(with errors)");\r
- logger.info(message) ;\r
- config.updateProgress(message);\r
+ logger.info("End import from source '" + config.getSourceNameString() \r
+ + "' to destination '" + config.getDestinationNameString() + "'"+\r
+ (result? "(successful)":"(with errors)")) ;\r
return result;\r
}\r
\r
import org.springframework.transaction.support.DefaultTransactionDefinition;\r
\r
import eu.etaxonomy.cdm.api.application.CdmApplicationDefaultConfiguration;\r
+import eu.etaxonomy.cdm.common.IProgressMonitor;\r
import eu.etaxonomy.cdm.model.common.CdmBase;\r
\r
/**\r
logger.warn("No invoke for " + ioName + " (ignored)");\r
return true;\r
}else{\r
- state.getConfig().updateProgress("Invoking " + ioName);\r
+ updateProgress(state, "Invoking " + ioName);\r
return doInvoke(state);\r
}\r
}\r
}\r
}\r
\r
+ @Override\r
+ public void updateProgress(STATE state, String message) {\r
+ updateProgress(state, message, 1);\r
+ };\r
\r
-\r
+ @Override\r
+ public void updateProgress(STATE state, String message, int worked) {\r
+ if(state.getConfig().getProgressMonitor() != null){\r
+ IProgressMonitor monitor = state.getConfig().getProgressMonitor();\r
+ monitor.worked(worked);\r
+ monitor.subTask(message);\r
+ }\r
+ }\r
}\r
\r
// public boolean invoke(IoState<T> state);\r
\r
+ public void updateProgress(STATE state, String message);\r
\r
+ public void updateProgress(STATE state, String message, int worked);\r
\r
}
\ No newline at end of file
\r
import java.util.UUID;\r
\r
-import eu.etaxonomy.cdm.common.IProgressMonitor;\r
import eu.etaxonomy.cdm.database.DbSchemaValidation;\r
import eu.etaxonomy.cdm.database.ICdmDataSource;\r
import eu.etaxonomy.cdm.io.common.mapping.IInputTransformer;\r
* @return\r
*/\r
public IProgressMonitor getProgressMonitor();\r
- \r
- /**\r
- * \r
- * @param message\r
- */\r
- public void updateProgress(String message);\r
+\r
}\r
public IProgressMonitor getProgressMonitor(){\r
return this.progressMonitor;\r
}\r
- \r
- @Override\r
- public void updateProgress(String message) {\r
- if(progressMonitor != null){\r
- progressMonitor.worked(1);\r
- progressMonitor.subTask(message);\r
- }\r
- }\r
}\r
public boolean doInvoke(Abcd206ImportState state){
logger.info("INVOKE Specimen Import from ABCD2.06 XML File");
boolean result = true;
- Abcd206ImportConfigurator config = state.getConfig();
//AbcdIO test = new AbcdIO();
- String sourceName = config.getSource();
+ String sourceName = state.getConfig().getSource();
NodeList unitsList = getUnitsNodeList(sourceName);
if (unitsList != null){
String message = "nb units to insert: "+unitsList.getLength();
logger.info(message);
- config.updateProgress(message);
+ updateProgress(state, message);
Abcd206DataHolder dataHolder = new Abcd206DataHolder();
for (int i=0 ; i<unitsList.getLength() ; i++){
this.setUnitPropertiesXML((Element)unitsList.item(i), dataHolder);
- result &= this.handleSingleUnit(config, dataHolder);
+ result &= this.handleSingleUnit(state, dataHolder);
//compare the ABCD elements added in to the CDM and the unhandled ABCD elements
compareABCDtoCDM(sourceName, dataHolder.knownABCDelements, dataHolder);
/*
* Store the unit with its Gathering informations in the CDM
*/
- private boolean handleSingleUnit(Abcd206ImportConfigurator config, Abcd206DataHolder dataHolder){
+ private boolean handleSingleUnit(Abcd206ImportState state, Abcd206DataHolder dataHolder){
boolean result = true;
+ Abcd206ImportConfigurator config = state.getConfig();
+
TransactionStatus tx = startTransaction();
try {
- config.updateProgress("Importing data for unit: " + dataHolder.unitID);
+ updateProgress(state, "Importing data for unit: " + dataHolder.unitID);
// ReferenceBase sec = Database.NewInstance();
// sec.setTitleCache("XML DATA");
"annotations"
})
@MappedSuperclass
-public abstract class AnnotatableEntity extends VersionableEntity {
+public abstract class AnnotatableEntity extends VersionableEntity implements IAnnotatableEntity {
private static final long serialVersionUID = 9151211842542443102L;
@SuppressWarnings("unused")
private static final Logger logger = Logger.getLogger(AnnotatableEntity.class);
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+
+package eu.etaxonomy.cdm.model.common;
+
+import java.util.Set;
+
+/**
+ * @author n.hoffmann
+ * @created Sep 15, 2010
+ * @version 1.0
+ */
+public interface IAnnotatableEntity extends IVersionableEntity {
+
+ public Set<Annotation> getAnnotations();
+
+
+ public void addAnnotation(Annotation annotation);
+
+
+ public void removeAnnotation(Annotation annotation);
+
+
+ public Set<Marker> getMarkers();
+
+
+ public void addMarker(Marker marker);
+
+
+ public void removeMarker(Marker marker);
+
+}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+
+package eu.etaxonomy.cdm.model.common;
+
+import org.joda.time.DateTime;
+
+/**
+ * @author n.hoffmann
+ * @created Sep 15, 2010
+ * @version 1.0
+ */
+public interface IVersionableEntity extends ICdmBase {
+
+ public User getUpdatedBy();
+
+ /**
+ *
+ * @param updatedBy updatedBy
+ */
+ public void setUpdatedBy(User updatedBy);
+
+ /**
+ *
+ * @return
+ */
+ public DateTime getUpdated();
+
+ /**
+ *
+ * @param updated updated
+ */
+ public void setUpdated(DateTime updated);
+
+}
})
@XmlJavaTypeAdapter(value=DateTimeAdapter.class,type=DateTime.class)
@MappedSuperclass
-public abstract class VersionableEntity extends CdmBase {
+public abstract class VersionableEntity extends CdmBase implements IVersionableEntity{
private static final long serialVersionUID = 1409299200302758513L;
@SuppressWarnings("unused")
private static final Logger logger = Logger.getLogger(VersionableEntity.class);
* @see #getStates()
* @see #addState(State)
*/
- public void removeState(State state){
+ public void removeState(StateData state){
this.states.remove(state);
}
import eu.etaxonomy.cdm.model.common.TermVocabulary;
import eu.etaxonomy.cdm.model.media.Media;
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.taxon.Taxon;
import eu.etaxonomy.cdm.strategy.merge.Merge;
import eu.etaxonomy.cdm.strategy.merge.MergeMode;
@Entity
@Audited
@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
-public abstract class DescriptionElementBase extends AnnotatableEntity implements ISourceable<DescriptionElementSource> {
+public abstract class DescriptionElementBase extends AnnotatableEntity implements ISourceable<DescriptionElementSource>, IModifiable {
private static final long serialVersionUID = 5000910777835755905L;
@SuppressWarnings("unused")
private static final Logger logger = Logger.getLogger(DescriptionElementBase.class);
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+
+package eu.etaxonomy.cdm.model.description;
+
+import java.util.Map;
+import java.util.Set;
+
+import eu.etaxonomy.cdm.model.common.IVersionableEntity;
+import eu.etaxonomy.cdm.model.common.Language;
+import eu.etaxonomy.cdm.model.common.LanguageString;
+import eu.etaxonomy.cdm.model.common.MultilanguageText;
+import eu.etaxonomy.cdm.model.common.TermVocabulary;
+
+/**
+ * @author n.hoffmann
+ * @created Sep 15, 2010
+ * @version 1.0
+ */
+public interface IModifiable extends IVersionableEntity {
+
+ /**
+ * Returns the set of {@link Modifier modifiers} used to qualify the validity
+ * of <i>this</i> state data. This is only metainformation.
+ */
+ public Set<Modifier> getModifiers();
+
+ /**
+ * Adds a {@link Modifier modifier} to the set of {@link #getModifiers() modifiers}
+ * used to qualify the validity of <i>this</i> state data.
+ *
+ * @param modifier the modifier to be added to <i>this</i> state data
+ * @see #getModifiers()
+ */
+ public void addModifier(Modifier modifier);
+ /**
+ * Removes one element from the set of {@link #getModifiers() modifiers}
+ * used to qualify the validity of <i>this</i> state data.
+ *
+ * @param modifier the modifier which should be removed
+ * @see #getModifiers()
+ * @see #addModifier(Modifier)
+ */
+ public void removeModifier(Modifier modifier);
+}
\r
import javax.persistence.Entity;\r
import javax.persistence.FetchType;\r
-import javax.persistence.ManyToOne;\r
import javax.persistence.ManyToMany;\r
+import javax.persistence.ManyToOne;\r
import javax.persistence.OneToMany;\r
import javax.validation.constraints.NotNull;\r
import javax.xml.bind.annotation.XmlAccessType;\r
@XmlRootElement(name = "StateData")\r
@Entity\r
@Audited\r
-public class StateData extends VersionableEntity {\r
+public class StateData extends VersionableEntity implements IModifiable{\r
private static final long serialVersionUID = -4380314126624505415L;\r
@SuppressWarnings("unused")\r
private static final Logger logger = Logger.getLogger(StateData.class);\r
* @see #getModifyingText()\r
* @see #addModifyingText(LanguageString)\r
*/\r
- public void addModifyingText(String text, Language language){\r
- this.modifyingText.put(language, LanguageString.NewInstance(text, language));\r
+ public LanguageString addModifyingText(String text, Language language){\r
+ return this.modifyingText.put(language, LanguageString.NewInstance(text, language));\r
}\r
/**\r
* Adds a translated {@link LanguageString text in a particular language}\r
* @see #getModifyingText()\r
* @see #addModifyingText(String, Language)\r
*/\r
- public void addModifyingText(LanguageString text){\r
- this.modifyingText.put(text.getLanguage(),text);\r
+ public LanguageString addModifyingText(LanguageString text){\r
+ return this.modifyingText.put(text.getLanguage(),text);\r
}\r
/** \r
* Removes from the {@link MultilanguageText multilanguage text} used to qualify the validity\r
* has been formulated\r
* @see #getModifyingText()\r
*/\r
- public void removeModifyingText(Language lang){\r
- this.modifyingText.remove(lang);\r
+ public LanguageString removeModifyingText(Language lang){\r
+ return this.modifyingText.remove(lang);\r
}\r
\r
}
\ No newline at end of file
@Entity\r
@Indexed(index = "eu.etaxonomy.cdm.model.description.DescriptionElementBase")\r
@Audited\r
-public class StatisticalMeasurementValue extends VersionableEntity {\r
+public class StatisticalMeasurementValue extends VersionableEntity implements IModifiable{\r
private static final long serialVersionUID = -3576311887760351982L;\r
@SuppressWarnings("unused")\r
private static final Logger logger = Logger.getLogger(StatisticalMeasurementValue.class);\r