bugfixing for modelchanges and adaptation of import routines
authorAndreas Müller <a.mueller@bgbm.org>
Mon, 21 Sep 2009 21:49:29 +0000 (21:49 +0000)
committerAndreas Müller <a.mueller@bgbm.org>
Mon, 21 Sep 2009 21:49:29 +0000 (21:49 +0000)
13 files changed:
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/faunaEuropaea/FaunaEuropaeaRefImport.java
cdmlib-io/src/test/resources/dbscripts/001_cdm.ddl
cdmlib-io/src/test/resources/eu/etaxonomy/cdm/io/dataset.dtd
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/CdmMetaData.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/Marker.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/MarkerType.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/OriginalSourceBase.java
cdmlib-persistence/src/test/java/eu/etaxonomy/cdm/database/TestingTermInitializer.java
cdmlib-persistence/src/test/resources/dbscripts/001_cdm.ddl
cdmlib-persistence/src/test/resources/eu/etaxonomy/cdm/database/TermsDataSet-with_auditing_info.xml
cdmlib-persistence/src/test/resources/eu/etaxonomy/cdm/persistence/dao/hibernate/common/AnnotationDaoTest.xml
cdmlib-persistence/src/test/resources/eu/etaxonomy/cdm/persistence/dao/hibernate/dataset.dtd
cdmlib-services/src/test/resources/dbscripts/001_cdm.ddl

index d9d710b8c972f4a3b98210dc12a4834b872f3fdb..d56bc8662234812ee129961287d1764e80f7edb4 100644 (file)
@@ -29,7 +29,6 @@ import eu.etaxonomy.cdm.model.agent.Team;
 import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;\r
 import eu.etaxonomy.cdm.model.common.CdmBase;\r
 import eu.etaxonomy.cdm.model.common.DescriptionElementSource;\r
-import eu.etaxonomy.cdm.model.description.DescriptionElementBase;\r
 import eu.etaxonomy.cdm.model.description.Feature;\r
 import eu.etaxonomy.cdm.model.description.TaxonDescription;\r
 import eu.etaxonomy.cdm.model.description.TextData;\r
index 04bca36ddeac03e63998f52c7a5206d0a74a3fc4..5b32ef6a729d04c7b84768320d354b5f488572f8 100644 (file)
         validperiod_start varchar(255),
         validperiod_freetext varchar(30),
         iso3166_a2 varchar(2),
-        createdby_id integer,
+               isTechnical bit,
+               createdby_id integer,
         updatedby_id integer,
         kindof_id integer,
         partof_id integer,
         shape_id integer,
         type_id integer,
         iso3166_a2 varchar(2),
-        symmetric bit,
+               isTechnical bit,
+               symmetric bit,
         transitive bit,
                lsid_authority varchar(255),
         lsid_lsid varchar(255),
         uuid varchar(255),
         updated timestamp,
         flag bit not null,
-        isTechnical bit not null,
         markedObj_type varchar(255),
         markedObj_id integer not null,
         createdby_id integer,
         uuid varchar(255),
         updated timestamp,
         flag bit,
-               isTechnical bit,
-        createdby_id integer,
+               createdby_id integer,
         updatedby_id integer,
         markertype_id integer,
         primary key (id, REV)
index cf11343e9d2867dce0c74fa52af4fd80b4ed7486..bd378f3306681a728464d5c9a68858b9ef25a43a 100644 (file)
     VALIDPERIOD_FREETEXT CDATA #IMPLIED
     VALIDPERIOD_START CDATA #IMPLIED
     ISO3166_A2 CDATA #IMPLIED
+    ISTECHNICAL CDATA #IMPLIED
     CREATEDBY_ID CDATA #IMPLIED
     UPDATEDBY_ID CDATA #IMPLIED
     KINDOF_ID CDATA #IMPLIED
     ISO3166_A2 CDATA #IMPLIED
     ISO639_1 CDATA #IMPLIED
     ISO639_2 CDATA #IMPLIED
+    ISTECHNICAL CDATA #IMPLIED
     SUPPORTSCATEGORICALDATA CDATA #IMPLIED
     SUPPORTSCOMMONTAXONNAME CDATA #IMPLIED
     SUPPORTSDISTRIBUTION CDATA #IMPLIED
     UUID CDATA #IMPLIED
     UPDATED CDATA #IMPLIED
     FLAG CDATA #IMPLIED
-    ISTECHNICAL CDATA #IMPLIED
     MARKEDOBJ_TYPE CDATA #IMPLIED
     MARKEDOBJ_ID CDATA #IMPLIED
     CREATEDBY_ID CDATA #IMPLIED
     UUID CDATA #IMPLIED
     UPDATED CDATA #IMPLIED
     FLAG CDATA #IMPLIED
-    ISTECHNICAL CDATA #IMPLIED
     CREATEDBY_ID CDATA #IMPLIED
     UPDATEDBY_ID CDATA #IMPLIED
     MARKERTYPE_ID CDATA #IMPLIED
index ea24cca8b8b1fb3026dadebf0d3a64c7e42a273b..bb911baca2d45a455af49171884fdf922d24814b 100644 (file)
@@ -38,7 +38,7 @@ public class CdmMetaData extends CdmBase{
         * be handled by SCHEMA_VALIDATION.UPDATE\r
         * The last number represents the date of change.\r
         */\r
-       private static final String dbSchemaVersion = "2.1.2.0.200909211654";\r
+       private static final String dbSchemaVersion = "2.1.2.1.200909212019";\r
        \r
        public enum MetaDataPropertyName{\r
                DB_SCHEMA_VERSION\r
index 61f518944df580c3c6732b8160f29382c0676730..639067d1d691f84b6934e15c6a8487da4907fe8f 100644 (file)
@@ -65,9 +65,6 @@ public class Marker extends VersionableEntity implements Cloneable{
        @JoinColumn(name = "markedObj_id")
        @NotAudited
        private AnnotatableEntity markedObj;
-       
-    @XmlAttribute(name = "isTechnical")
-    private boolean isTechnical=false;
     
        /**
         * Factory method
@@ -142,25 +139,6 @@ public class Marker extends VersionableEntity implements Cloneable{
                return getFlag();
        }
 
-       /**
-        * A flag indicating if the marked value is user content or technical information
-        * to be used by applications only. E.g. a FeatureTree may have a marker that defines
-        * the role of this FeatureTree ("for ordering") whereas a {@link eu.etaxonomy.cdm.model.taxon.Taxon taxon}
-        * may have a user defined marker "completed" that indicates that this taxon does not
-        * need further investigation. The earlier will be flagged isTechnical=true whereas 
-        * the later will be flagged as isTechnical=false 
-        * @return the isTechnical
-        */
-       public boolean isTechnical() {
-               return isTechnical;
-       }
-
-       /**
-        * @param isTechnical the isTechnical to set
-        */
-       public void setTechnical(boolean isTechnical) {
-               this.isTechnical = isTechnical;
-       }
        
 //****************** CLONE ************************************************/
 
index e8bfe3701b3412c0c0d5363f3899b56d640fc277..2c89642fb1fbe894b10a694dd6f76ce82168f216 100644 (file)
@@ -18,6 +18,7 @@ import java.util.*;
 import javax.persistence.*;
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
 import javax.xml.bind.annotation.XmlType;
 
 /**
@@ -48,13 +49,12 @@ public class MarkerType extends DefinedTermBase<MarkerType> {
                return new MarkerType(term, label, labelAbbrev);
        }
        
-       protected static MarkerType getTermByUuid(UUID uuid){
-               if (termMap == null){
-                       DefaultTermInitializer vocabularyStore = new DefaultTermInitializer();
-                       vocabularyStore.initialize();
-               }
-               return (MarkerType)termMap.get(uuid);
-       }
+       
+       
+    @XmlAttribute(name = "isTechnical")
+    private boolean isTechnical=false;
+    
+
 
        
        /**
@@ -64,7 +64,29 @@ public class MarkerType extends DefinedTermBase<MarkerType> {
         */
        public MarkerType() {
        }
+
+       /**
+        * A flag indicating if markers of this type are user content or technical information
+        * to be used by applications only. E.g. a FeatureTree may have a marker that defines
+        * the role of this FeatureTree ("for ordering") whereas a {@link eu.etaxonomy.cdm.model.taxon.Taxon taxon}
+        * may have a user defined marker "completed" that indicates that this taxon does not
+        * need further investigation. The earlier will be flagged isTechnical=true whereas 
+        * the later will be flagged as isTechnical=false 
+        * @return the isTechnical
+        */
+       public boolean isTechnical() {
+               return isTechnical;
+       }
+
+       /**
+        * @param isTechnical the isTechnical to set
+        */
+       public void setTechnical(boolean isTechnical) {
+               this.isTechnical = isTechnical;
+       }
        
+//***************************** CONSTRUCTOR **************************************/    
+
        /**
         * Constructor
         * @param term
@@ -74,7 +96,16 @@ public class MarkerType extends DefinedTermBase<MarkerType> {
                super(term, label, labelAbbrev);
        }
 
-
+//***************************** TERMS **************************************/
+    
+       protected static MarkerType getTermByUuid(UUID uuid){
+               if (termMap == null){
+                       DefaultTermInitializer vocabularyStore = new DefaultTermInitializer();
+                       vocabularyStore.initialize();
+               }
+               return (MarkerType)termMap.get(uuid);
+       }
+       
        public static final MarkerType IMPORTED(){
                return getTermByUuid(uuidImported);
        }
index f0cd1da50d0360692fa50c6be12dd7fb5eae3f5f..8473415d98cb2984863a31792b2ddf6d76f892b9 100644 (file)
@@ -24,9 +24,20 @@ import org.hibernate.annotations.Table;
 import org.hibernate.envers.Audited;
 
 /**
+ * Abstract base class for original sources.
+ * An original source can be used in different ways.<BR>
+ * 1.) As a referencing system. The original source holds all information about the reference, 
+ * the microReference (page, figure, ...), the identifier used in for the referenced object in the 
+ * reference, a namespace that makes this identifier unique, the original name string that in 
+ * general stores the representation of the referenced object within the source (if a differing
+ * string is used in the source then for the CDM object
+ * 
+ * 
  * Other names/labels/titles (abreviated or not) for the same object (person,
  * reference, source, etc.).
- * It can also be used to store the id, namespace/tablename from an import source into CDM.
+ * 
+ * 2.) Dataprovenance: When importing data from another (database) datasource the identifier, namespace/tablename
+ *  from an import source into CDM.
  * E.g. when importing SDD data here you may store the filename and the id used in the SDD file here.
  * 
  * @author m.doering
index 9615a75554e047afca17b6f0090826f36e2bc04e..3223da19d0c43348b715468cbf63622025eb0325 100644 (file)
@@ -54,6 +54,7 @@ public class TestingTermInitializer extends PersistentTermInitializer {
                try {\r
                        connection = getConnection();\r
                        IDataSet dataSet = new FlatXmlDataSet(new InputStreamReader(termsDataSet.getInputStream()),new InputStreamReader(termsDtd.getInputStream()));\r
+                       \r
                        DatabaseOperation.CLEAN_INSERT.execute(connection, dataSet);\r
                } catch (Exception e) {\r
                        logger.error(e);\r
@@ -67,6 +68,7 @@ public class TestingTermInitializer extends PersistentTermInitializer {
                                logger.error(sqle);\r
                        }\r
                }\r
+               \r
                transactionManager.commit(txStatus);\r
                \r
                for(VocabularyEnum vocabularyType : VocabularyEnum.values()) {\r
index e500b082e7901d89fd9ab4afbcf9276a137c0c6f..9a8cdd49fb55dc77506f45c531320663396e64fa 100644 (file)
         validperiod_freetext varchar(255),
         validperiod_start varchar(255),
         iso3166_a2 varchar(2),
-        createdby_id integer,
+               isTechnical bit,
+               createdby_id integer,
         updatedby_id integer,
         kindof_id integer,
         partof_id integer,
         shape_id integer,
         type_id integer,
         iso3166_a2 varchar(2),
-        lsid_authority varchar(255),
+        isTechnical bit,
+               lsid_authority varchar(255),
         lsid_lsid varchar(255),
         lsid_namespace varchar(255),
         lsid_object varchar(255),
@@ -2013,8 +2015,7 @@ create table DefinedTermBase_MeasurementUnit (
         uuid varchar(36),
         updated timestamp,
         flag bit not null,
-               isTechnical bit not null,
-        markedObj_type varchar(255),
+               markedObj_type varchar(255),
         markedObj_id integer not null,
         createdby_id integer,
         updatedby_id integer,
@@ -2031,7 +2032,6 @@ create table DefinedTermBase_MeasurementUnit (
         uuid varchar(36),
         updated timestamp,
         flag bit,
-        isTechnical bit,
         createdby_id integer,
         updatedby_id integer,
         markertype_id integer,
index 657687672b283882ac634f2d64567a43d6066c86..9c548ddf6fcd7047f894c82c8150970edd252bde 100644 (file)
Binary files a/cdmlib-persistence/src/test/resources/eu/etaxonomy/cdm/database/TermsDataSet-with_auditing_info.xml and b/cdmlib-persistence/src/test/resources/eu/etaxonomy/cdm/database/TermsDataSet-with_auditing_info.xml differ
index 2ed6d260a7e214b3d5ea9027d8e61121b55675f9..dc4aeab07c6a52d3ce7cc7751bfe06d499cc01bb 100644 (file)
@@ -11,6 +11,6 @@
     <ANNOTATION_ANNOTATION ANNOTATION_ID="1" ANNOTATIONS_ID="5"/>
     <ANNOTATION_MARKER ANNOTATION_ID="2" MARKERS_ID="1"/>
     <ANNOTATION_MARKER ANNOTATION_ID="3" MARKERS_ID="2"/>
-    <MARKER ID="1" CREATED="2008-12-10 09:56:07.0" UUID="4a3e2cf8-64d4-4b61-8579-364780afb7cb" UPDATED="2008-12-10 09:56:07.253" FLAG="true" ISTECHNICAL="false" MARKERTYPE_ID="893" MARKEDOBJ_ID="2" MARKEDOBJ_TYPE="Annotation"/>
-    <MARKER ID="2" CREATED="2008-12-10 09:56:07.0" UUID="564c04a5-ecb8-49df-a578-1671a68a5d30" UPDATED="2008-12-10 09:56:07.253" FLAG="true" ISTECHNICAL="false" MARKERTYPE_ID="893" MARKEDOBJ_ID="3" MARKEDOBJ_TYPE="Annotation"/>
+    <MARKER ID="1" CREATED="2008-12-10 09:56:07.0" UUID="4a3e2cf8-64d4-4b61-8579-364780afb7cb" UPDATED="2008-12-10 09:56:07.253" FLAG="true" MARKERTYPE_ID="893" MARKEDOBJ_ID="2" MARKEDOBJ_TYPE="Annotation"/>
+    <MARKER ID="2" CREATED="2008-12-10 09:56:07.0" UUID="564c04a5-ecb8-49df-a578-1671a68a5d30" UPDATED="2008-12-10 09:56:07.253" FLAG="true" MARKERTYPE_ID="893" MARKEDOBJ_ID="3" MARKEDOBJ_TYPE="Annotation"/>
 </dataset>
index bc0580d418fda01437e23b1bfbc6e60cd61bff5b..c858ee212d213518dcac2d1979028fa7552172c5 100644 (file)
     VALIDPERIOD_END CDATA #IMPLIED
     VALIDPERIOD_START CDATA #IMPLIED
     ISO3166_A2 CDATA #IMPLIED
+    ISTECHNICAL CDATA #REQUIRED
     CREATEDBY_ID CDATA #IMPLIED
     UPDATEDBY_ID CDATA #IMPLIED
     KINDOF_ID CDATA #IMPLIED
     ORDERINDEX CDATA #IMPLIED
     ISO639_1 CDATA #IMPLIED
     ISO639_2 CDATA #IMPLIED
+    ISTECHNICAL CDATA #IMPLIED
     DEFAULTCOLOR CDATA #IMPLIED
     SUPPORTSCOMMONTAXONNAME CDATA #IMPLIED
     SUPPORTSDISTRIBUTION CDATA #IMPLIED
index 741f3cb1163572bb5353ae7b94a9acb178cf8871..b7bebc504c1cbab40253a8081c292d5a8ab875fa 100644 (file)
         validperiod_freetext varchar(255),
         validperiod_start varchar(255),
         iso3166_a2 varchar(2),
-        createdby_id integer,
+        isTechnical bit,
+               createdby_id integer,
         updatedby_id integer,
         kindof_id integer,
         partof_id integer,
         symmetric bit,
         transitive bit,
         iso3166_a2 varchar(2),
-        supportscategoricaldata bit,
+        isTechnical bit,
+               supportscategoricaldata bit,
         supportscommontaxonname bit,
         supportsdistribution bit,
         supportsindividualassociation bit,
         uuid varchar(36),
         updated timestamp,
         flag bit not null,
-        isTechnical bit not null,
         markedObj_type varchar(255),
         markedObj_id integer not null,
         createdby_id integer,
         uuid varchar(36),
         updated timestamp,
         flag bit,
-        isTechnical bit,
         createdby_id integer,
         updatedby_id integer,
         markertype_id integer,