Project

General

Profile

« Previous | Next » 

Revision f1a25720

Added by Katja Luther over 6 years ago

  • ID f1a25720755daa96e8838a617a660dfced7b9f31
  • Parent 23e50194

first implementation for change from joda time to java8 time

View differences:

cdmlib-db/bin/.gitignore
1
/target/
cdmlib-db/bin/LICENSE.TXT
1
The contents of this file are subject to the Mozilla Public License
2
Version 1.1 (the "License"); you may not use this file except in
3
compliance with the License. You may obtain a copy of the License at
4
http://www.mozilla.org/MPL/
5

  
6
Software distributed under the License is distributed on an "AS IS"
7
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
8
License for the specific language governing rights and limitations
9
under the License.
cdmlib-db/bin/README.TXT
1
The project uses Maven3.
2

  
3
Please see http://dev.e-taxonomy.eu/trac/wiki/CdmLibrary for details on installation and usage
cdmlib-db/bin/pom.xml
1
<?xml version="1.0" encoding="UTF-8"?>
2
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3
  <parent>
4
    <groupId>eu.etaxonomy</groupId>
5
    <artifactId>cdmlib-parent</artifactId>
6
    <version>4.10.0-SNAPSHOT</version>
7
    <relativePath>../pom.xml</relativePath>
8
  </parent>
9

  
10
  <modelVersion>4.0.0</modelVersion>
11
  <artifactId>cdmlib-db</artifactId>
12
  <name>CDM Database Connectivity</name>
13
  <description>EDIT CDM database connectivity. Dependencies for database drivers and other database related libraries</description>
14
  <scm>
15
    <connection>scm:svn:http://dev.e-taxonomy.eu/svn/trunk/cdmlib/cdmlib-db/</connection>
16
    <developerConnection>scm:svn:http://dev.e-taxonomy.eu/svn/trunk/cdmlib/cdmlib-db/</developerConnection>
17
    <url>http://dev.e-taxonomy.eu/trac/browser/trunk/cdmlib/cdmlib-db/</url>
18
  </scm>
19
  <build>
20
    <plugins>
21
     </plugins>
22
  </build>
23
  <dependencies>
24
 
25
   <dependency>
26
      <groupId>com.mchange</groupId>
27
      <artifactId>c3p0</artifactId>
28
<!--       <version>0.9.5.2</version> -->
29
    </dependency>
30

  
31
    <dependency>
32
        <groupId>com.mchange</groupId>
33
        <artifactId>mchange-commons-java</artifactId>
34
        <!-- mchange-commons-java needs to match the version as defined in the c3p0/pom.xml -->
35
        <version>0.2.11</version>
36
    </dependency>
37
    
38

  
39

  
40
    <!-- ******* DATABASES DRIVER ******* -->
41
      <!-- 
42
            IMPORTANT:
43
            Any driver dependency listed here must be excluded from the 
44
            cdmlib-remote depedency in cdmlib-remote-webapp
45
       -->
46

  
47
    <!-- For using cdmlib-db in testing only, currently not in use -->
48
    <dependency>
49
      <groupId>org.hsqldb</groupId>
50
      <artifactId>hsqldb</artifactId>
51
<!--       <version>2.3.3</version> -->
52
      <scope>compile</scope>
53
    </dependency>
54
    
55
    <!-- Database drivers -->
56

  
57
    <dependency>
58
      <groupId>mysql</groupId>
59
      <artifactId>mysql-connector-java</artifactId>
60
<!-- 	  <version>5.1.38</version> -->
61
    </dependency>
62
    <dependency>
63
      <groupId>org.postgresql</groupId>
64
      <artifactId>postgresql</artifactId>
65
<!-- 	  <version>9.4-1206-jdbc4</version> -->
66
    </dependency>
67
    <dependency>
68
      <groupId>com.h2database</groupId>
69
      <artifactId>h2</artifactId>
70
<!--       <version>1.4.190</version> -->
71
    </dependency>
72
    <!--for sqlserver2008 and sqlserver2005 and probably higher-->
73
    <dependency>
74
      <groupId>com.microsoft.sqlserver</groupId>
75
      <artifactId>jdbc4</artifactId>
76
<!--       <version>2.0</version> -->
77
    </dependency>
78
    
79
    <!-- SQL Server and Sybase -->
80
    <dependency>
81
      <groupId>net.sourceforge.jtds</groupId>
82
      <artifactId>jtds</artifactId>
83
<!-- 	  <version>1.3.1</version> -->
84
    </dependency>
85
    
86
    <!-- Oracle -->	
87
<!--     <dependency> -->
88
<!--       <groupId>oracle</groupId> -->
89
<!--       <artifactId>ojdbc14</artifactId> -->
90
<!--       <version>10.2.0.4.0</version> -->
91
<!--     </dependency> -->
92
    <!-- <dependency>
93
		<groupId>ojdbc</groupId>
94
		<artifactId>ojdbc</artifactId>
95
		<version>14</version>
96
	</dependency>   -->
97

  
98
  </dependencies>
99
  
100
</project>
cdmlib-ext/bin/LICENSE.TXT
1
The contents of this file are subject to the Mozilla Public License
2
Version 1.1 (the "License"); you may not use this file except in
3
compliance with the License. You may obtain a copy of the License at
4
http://www.mozilla.org/MPL/
5

  
6
Software distributed under the License is distributed on an "AS IS"
7
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
8
License for the specific language governing rights and limitations
9
under the License.
cdmlib-ext/bin/README.TXT
1
The project uses Maven2 and AspectJ.
2

  
3
Please see http://dev.e-taxonomy.eu/trac/wiki/CdmLibrary for details on installation and usage
cdmlib-ext/bin/pom.xml
1
<?xml version="1.0" encoding="UTF-8"?>
2
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3
  <!--
4
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
5
   -->
6
	<parent>
7
	    <groupId>eu.etaxonomy</groupId>
8
	    <artifactId>cdmlib-parent</artifactId>
9
	    <version>4.10.0-SNAPSHOT</version>
10
	    <relativePath>../pom.xml</relativePath>
11
	</parent>
12

  
13
  <modelVersion>4.0.0</modelVersion>
14
  <artifactId>cdmlib-ext</artifactId>
15
  <name>CDM External</name>
16
  <description>EDIT CDM library external services. Module for handling requests to non CDM library services like the EDIT geoservice.</description>
17
  <scm>
18
    <connection>scm:svn:http://dev.e-taxonomy.eu/svn/trunk/cdmlib/cdmlib-extern/</connection>
19
    <developerConnection>scm:svn:http://dev.e-taxonomy.eu/svn/trunk/cdmlib/cdmlib-extern/</developerConnection>
20
    <url>http://dev.e-taxonomy.eu/trac/browser/trunk/cdmlib/cdmlib-extern/</url>
21
  </scm>
22

  
23
  <dependencies>
24
 	<dependency>
25
  		<groupId>eu.etaxonomy</groupId>
26
  		<artifactId>cdmlib-services</artifactId>
27
  	</dependency>
28
    <dependency>
29
        <groupId>eu.etaxonomy</groupId>
30
        <artifactId>cdmlib-test</artifactId>
31
        <scope>test</scope>
32
        <version>${project.version}</version>
33
    </dependency>
34
<!--   	<dependency> -->
35
<!--   		<groupId>eu.etaxonomy</groupId> -->
36
<!--   		<artifactId>cdmlib-persistence</artifactId> -->
37
<!--   		<type>test-jar</type> -->
38
<!--   		<scope>test</scope> -->
39
<!--   		<version>${project.version}</version> -->
40
<!--     </dependency> -->
41
<!--     <dependency> -->
42
<!--       <groupId>org.unitils</groupId> -->
43
<!--       <artifactId>unitils-core</artifactId> -->
44
<!--       <scope>test</scope> -->
45
<!--     </dependency> -->
46
<!--     probably most unitils dependencies can be deleted from here -->
47
<!--     <dependency> -->
48
<!--       <groupId>org.unitils</groupId> -->
49
<!--       <artifactId>unitils-database</artifactId> -->
50
<!--       <exclusions> -->
51
<!--       	<exclusion> -->
52
<!--       		<groupId>commons-dbcp</groupId> -->
53
<!--       		<artifactId>commons-dbcp</artifactId> -->
54
<!--       	</exclusion> -->
55
<!--       </exclusions> -->
56
<!--       <scope>test</scope> -->
57
<!--     </dependency> -->
58
<!--     <dependency> -->
59
<!--       <groupId>org.unitils</groupId> -->
60
<!--       <artifactId>unitils-dbmaintainer</artifactId> -->
61
<!--       <scope>test</scope> -->
62
<!--     </dependency> -->
63
<!--     <dependency> -->
64
<!--       <groupId>org.unitils</groupId> -->
65
<!--       <artifactId>unitils-dbunit</artifactId> -->
66
<!--       <scope>test</scope> -->
67
<!--     </dependency> -->
68
<!--      <dependency> -->
69
<!--       <groupId>org.unitils</groupId> -->
70
<!--       <artifactId>unitils-easymock</artifactId> -->
71
<!--       <scope>test</scope> -->
72
<!--     </dependency> -->
73
<!--     <dependency> -->
74
<!--       <groupId>org.unitils</groupId> -->
75
<!--       <artifactId>unitils-mock</artifactId> -->
76
<!--       <scope>test</scope> -->
77
<!--     </dependency> -->
78
<!--     <dependency> -->
79
<!--       <groupId>org.unitils</groupId> -->
80
<!--       <artifactId>unitils-inject</artifactId> -->
81
<!--       <scope>test</scope> -->
82
<!--     </dependency> -->
83
<!--      <dependency> -->
84
<!--       <groupId>org.unitils</groupId> -->
85
<!--       <artifactId>unitils-spring</artifactId> -->
86
<!--       <scope>test</scope> -->
87
<!--     </dependency> -->
88
<!--     <dependency> -->
89
<!--       <groupId>org.dbunit</groupId> -->
90
<!--       <artifactId>dbunit</artifactId> -->
91
<!--     </dependency>  -->
92
<!--     <dependency> -->
93
<!--       <groupId>xmlunit</groupId> -->
94
<!--       <artifactId>xmlunit</artifactId> -->
95
<!--   	</dependency> -->
96

  
97
    <dependency>
98
	    <groupId>org.apache.httpcomponents</groupId>
99
	    <artifactId>httpclient</artifactId>
100
	</dependency>
101
	<dependency>
102
        <groupId>net.sf.json-lib</groupId>
103
        <artifactId>json-lib</artifactId>
104
		<classifier>jdk15</classifier>
105
    </dependency>
106
    <dependency>
107
        <groupId>com.fasterxml.jackson.core</groupId>
108
        <artifactId>jackson-databind</artifactId>
109
    </dependency>
110
	<dependency>
111
        <groupId>net.sf.ezmorph</groupId>
112
        <artifactId>ezmorph</artifactId>
113
    </dependency>
114
    <dependency>
115
        <groupId>commons-io</groupId>
116
        <artifactId>commons-io</artifactId>
117
    </dependency>
118
  </dependencies>
119
</project>
120

  
cdmlib-ext/bin/src/main/resources/eu/etaxonomy/cdm/ext/geo/mapServices_v10.xsd
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!-- Mit XMLSpy v2011 sp1 (http://www.altova.com) von Andreas Müller (BGBM) bearbeitet -->
3
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
4
	<xs:element name="mapService">
5
		<xs:annotation>
6
			<xs:documentation>Map service. If type is wms the uri attribute is required and points to the wms service to use. If type is editMapService the uri should be the uri of the edit map services (optional).</xs:documentation>
7
		</xs:annotation>
8
		<xs:complexType>
9
			<xs:sequence>
10
				<xs:element name="area" maxOccurs="unbounded">
11
					<xs:complexType>
12
						<xs:sequence>
13
							<xs:element name="layer"/>
14
							<xs:element name="field"/>
15
							<xs:element name="value" maxOccurs="unbounded"/>
16
						</xs:sequence>
17
					</xs:complexType>
18
				</xs:element>
19
			</xs:sequence>
20
			<xs:attribute name="type" use="required">
21
				<xs:simpleType>
22
					<xs:restriction base="xs:string">
23
						<xs:enumeration value="editMapService"/>
24
						<xs:enumeration value="wms"/>
25
					</xs:restriction>
26
				</xs:simpleType>
27
			</xs:attribute>
28
			<xs:attribute name="uri"/>
29
		</xs:complexType>
30
	</xs:element>
31
</xs:schema>
cdmlib-ext/bin/src/main/resources/eu/etaxonomy/cdm/httpInvokerExtServices.xml
1
<?xml version="1.0" encoding="UTF-8"?>
2
<beans xmlns="http://www.springframework.org/schema/beans"
3
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
4
  xmlns:tx="http://www.springframework.org/schema/tx"
5
  xsi:schemaLocation="http://www.springframework.org/schema/beans 
6
    http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
7
    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
8
    http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
9
    ">
10

  
11
  <!-- The beans for the implementation classes are declared with the @Service 
12
    annotation. See EditGeoService for an example. -->
13

  
14
  <bean id="httpEditGeoService"
15
    class="org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter">
16
    <property name="service">
17
      <ref bean="editGeoService" />
18
    </property>
19
    <property name="serviceInterface">
20
      <value>eu.etaxonomy.cdm.ext.geo.IEditGeoService</value>
21
    </property>
22
  </bean>
23
  
24
</beans>
cdmlib-ext/bin/src/test/resources/eu/etaxonomy/cdm/applicationContext-test.xml
1
<?xml version="1.0" encoding="UTF-8"?>
2
<beans xmlns="http://www.springframework.org/schema/beans"
3
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
	xmlns:context="http://www.springframework.org/schema/context"
5
	xsi:schemaLocation="http://www.springframework.org/schema/beans
6
    http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
7
    http://www.springframework.org/schema/context
8
    http://www.springframework.org/schema/context/spring-context-4.0.xsd">
9

  
10
    <!-- This application can definetly still be adapted to the new structure.
11
    However currently it is only used the EditGeoServiceTest and works, so for now
12
    we don't touch it -->
13
    
14
    <import resource="classpath:/eu/etaxonomy/cdm/defaultApplicationContext.xml"/>
15

  
16
	<context:component-scan base-package="eu/etaxonomy/cdm/ext"/>
17

  
18
    <bean id="dataSource" class="org.unitils.database.UnitilsDataSourceFactoryBean"/>
19

  
20
    <!--
21
    <bean id="testingTermInitializer" class="eu.etaxonomy.cdm.database.TestingTermInitializer">
22
            TermsDataSet-with_auditing_info.cdmlib-services.xml has different IDs than TermsDataSet-with_auditing_info.xml
23
            which is used in persistence !!
24
        <property name="termsDataSet" value="classpath:/eu/etaxonomy/cdm/database/TermsDataSet-with_auditing_info.cdmlib-services.xml"/>
25
        <property name="termsDtd" value="classpath:/eu/etaxonomy/cdm/persistence/dao/hibernate/dataset.dtd"/>
26
        <property name="omit" value="false"/>
27
    </bean>
28
    <bean id="persistentTermInitializer" class="eu.etaxonomy.cdm.database.PersistentTermInitializer">
29
        <property name="omit" value="true"/>
30
    </bean>
31
    -->
32

  
33
     <bean id="hibernateProperties"
34
            class="org.springframework.beans.factory.config.PropertiesFactoryBean">
35
            <property name="properties">
36
                <props>
37
                    <prop key="hibernate.cache.region.factory_class">org.hibernate.cache.internal.NoCachingRegionFactory</prop>
38
                    <prop key="hibernate.show_sql">false</prop>
39
                    <prop key="hibernate.format_sql">false</prop>
40
                    <prop key="hibernate.search.default.directory_provider">org.hibernate.search.store.impl.FSDirectoryProvider</prop>
41
                    <!-- TODO trying to use a managed session context
42
                    <prop key="hibernate.current_session_context_class">managed</prop>
43
                    -->
44
                    <prop key="hibernate.search.default.indexBase">./target/index</prop>
45
                    <!--  hibernate.search.default.exclusive_index_use=false
46
                          locks must not only be released after application shutdown in test environment -->
47
                    <prop key="hibernate.search.default.exclusive_index_use">false</prop>
48
                    <!-- hsqldb v. <1.9 has a bug (http://sourceforge.net/tracker/?func=detail&atid=378131&aid=1407528&group_id=23316)
49
                        due to which it is not possible to use batch updates, so we need to disable
50
                        hibernate batching when using hsqldb in the app context: -->
51
                    <prop key="hibernate.jdbc.batch_size">0</prop>
52
                </props>
53
            </property>
54
    </bean>
55

  
56
</beans>
cdmlib-ext/bin/src/test/resources/eu/etaxonomy/cdm/ext/geo/EditGeoServiceTest.getDistributionServiceRequestParameterString.xml
1
<?xml version='1.0' encoding='UTF-8'?>
2
<dataset>
3
  <TAXONBASE DTYPE="Taxon" ID="10" CREATED="2015-12-18 09:29:42.0" UUID="7598f5d4-1cf2-4269-ae99-2adb79ae167c" UPDATED="[null]" LSID_AUTHORITY="[null]" LSID_LSID="[null]" LSID_NAMESPACE="[null]" LSID_OBJECT="[null]" LSID_REVISION="[null]" PROTECTEDTITLECACHE="true" TITLECACHE="Dummy taxon" APPENDEDPHRASE="[null]" DOUBTFUL="false" PUBLISH="true" USENAMECACHE="false" TAXONSTATUSUNKNOWN="false" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]" NAME_ID="[null]" SEC_ID="[null]"/>
4
  <DESCRIPTIONBASE DTYPE="TaxonDescription" ID="10" CREATED="2015-12-18 09:29:42.0" UUID="9c362630-08ef-4e2f-95d8-57b1cebd1197" UPDATED="[null]" LSID_AUTHORITY="[null]" LSID_LSID="[null]" LSID_NAMESPACE="[null]" LSID_OBJECT="[null]" LSID_REVISION="[null]" PROTECTEDTITLECACHE="false" TITLECACHE="Taxon description for Dummy taxon" IMAGEGALLERY="false" ISDEFAULT="false" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]" SPECIMEN_ID="[null]" TAXON_ID="10" TAXONNAME_ID="[null]"/>
5
  <DESCRIPTIONELEMENTBASE DTYPE="Distribution" ID="10" CREATED="2015-12-18 09:29:42.0" UUID="43b69cdb-ef08-41b2-9f25-32dce86e260d" UPDATED="[null]" NAME="[null]" TIMEPERIOD_START="[null]" TIMEPERIOD_END="[null]" TIMEPERIOD_FREETEXT="[null]" ORDERRELEVANT="[null]" UNKNOWNDATA="[null]" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]" FEATURE_ID="986" INDESCRIPTION_ID="10" AREA_ID="572" LANGUAGE_ID="[null]" STATUS_ID="[null]" ASSOCIATEDSPECIMENOROBSERVATION_ID="[null]" UNIT_ID="[null]" TAXON2_ID="[null]" FORMAT_ID="[null]"/>
6
  <DESCRIPTIONELEMENTBASE DTYPE="Distribution" ID="11" CREATED="2015-12-18 09:29:42.0" UUID="285562d2-0fd3-4e6e-a83c-c65bb2eb9085" UPDATED="[null]" NAME="[null]" TIMEPERIOD_START="[null]" TIMEPERIOD_END="[null]" TIMEPERIOD_FREETEXT="[null]" ORDERRELEVANT="[null]" UNKNOWNDATA="[null]" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]" FEATURE_ID="986" INDESCRIPTION_ID="10" AREA_ID="537" LANGUAGE_ID="[null]" STATUS_ID="[null]" ASSOCIATEDSPECIMENOROBSERVATION_ID="[null]" UNIT_ID="[null]" TAXON2_ID="[null]" FORMAT_ID="[null]"/>
7
  <HIBERNATE_SEQUENCES SEQUENCE_NAME="CdmMetaData" NEXT_VAL="30"/>
8
  <HIBERNATE_SEQUENCES SEQUENCE_NAME="DefinedTermBase" NEXT_VAL="2190"/>
9
  <HIBERNATE_SEQUENCES SEQUENCE_NAME="DescriptionBase" NEXT_VAL="30"/>
10
  <HIBERNATE_SEQUENCES SEQUENCE_NAME="DescriptionElementBase" NEXT_VAL="30"/>
11
  <HIBERNATE_SEQUENCES SEQUENCE_NAME="GrantedAuthorityImpl" NEXT_VAL="40"/>
12
  <HIBERNATE_SEQUENCES SEQUENCE_NAME="PermissionGroup" NEXT_VAL="30"/>
13
  <HIBERNATE_SEQUENCES SEQUENCE_NAME="Representation" NEXT_VAL="2290"/>
14
  <HIBERNATE_SEQUENCES SEQUENCE_NAME="TaxonBase" NEXT_VAL="30"/>
15
  <HIBERNATE_SEQUENCES SEQUENCE_NAME="TermVocabulary" NEXT_VAL="70"/>
16
  <HIBERNATE_SEQUENCES SEQUENCE_NAME="UserAccount" NEXT_VAL="30"/>
17
</dataset>
cdmlib-ext/bin/src/test/resources/eu/etaxonomy/cdm/ext/geo/cyprusdivs.csv
1
bdcode,bddescript,bdarea
2
                  1,cyprus_zone_1,                  0
3
                  2,cyprus_zone_2,                  0
4
                  3,cyprus_zone_3,                  0
5
                  4,cyprus_zone_4,                  0
6
                  5,cyprus_zone_5,                  0
7
                  6,cyprus_zone_6,                  0
8
                  7,cyprus_zone_7,                  0
9
                  8,cyprus_zone_8,                  0
cdmlib-ext/bin/src/test/resources/log4j.properties
1
### ************ APPENDER ***********************************###
2

  
3
### direct log messages to stdout ###
4
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
5
log4j.appender.stdout.Target=System.out
6
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
7
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
8

  
9
### direct messages to file hibernate.log ###
10
log4j.appender.file=org.apache.log4j.FileAppender
11
log4j.appender.file.File=hibernate.log
12
log4j.appender.file.layout=org.apache.log4j.PatternLayout
13
log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
14

  
15

  
16
### ************* LOG LEVELS *********************************###
17

  
18
### set log levels - for more verbose logging change 'info' to 'debug' ###
19

  
20
log4j.rootLogger=warn, stdout, file
21

  
22
### *** CDM *** ###
23
log4j.logger.eu.etaxonomy.cdm = info
24
log4j.logger.eu.etaxonomy.cdm.database.init = warn
25
#
26
log4j.logger.eu.etaxonomy.cdm.model.common.init = warn
27
#
28
log4j.logger.eu.etaxonomy.cdm.test.integration = info
29
log4j.logger.eu.etaxonomy.cdm.api.application = warn
30
log4j.logger.eu.etaxonomy.cdm.api.service = info
31
#log4j.logger.eu.etaxonomy.cdm.database.VocabularyStoreImpl = warn
32
log4j.logger.eu.etaxonomy.cdm.database = warn
33
log4j.logger.eu.etaxonomy.cdm.persistence.dao.hibernate.common = warn
34
log4j.logger.eu.etaxonomy.cdm.ext = info
35

  
36

  
37

  
38
### *** SPRING ************ ###
39
log4j.logger.org.springframework.transaction = warn
40
log4j.logger.org.hibernate.engine.LoadContexts = warn
41
log4j.logger.org.springframework.orm.hibernate5.SessionFactoryUtils = warn
42
log4j.logger.org.springframework.orm.hibernate5 = warn
43
log4j.logger.org.springframework.FileSystemXmlApplicationContext = warn;
44
log4j.logger.org.springframework.core.io.support = warn
45

  
46

  
47
### ***HIBERNATE ************ ###
48
log4j.logger.org.hibernate=warn
49
log4j.logger.org.hibernate.orm.deprecation = error
50

  
51
### No warnings as thrown by SQLServer
52
###log4j.logger.org.hibernate.cfg = warn
53

  
54
### No warnings as thrown by SQLServer
55
log4j.logger.org.hibernate.util.JDBCExceptionReporter = error
56

  
57
### log HQL query parser activity
58
#log4j.logger.org.hibernate.hql.ast.AST=debug
59

  
60
### log just the SQL
61
log4j.logger.org.hibernate.SQL=warn
62

  
63
### log JDBC bind parameters ###
64
log4j.logger.org.hibernate.type=warn
65

  
66
### log schema export/update ###
67
log4j.logger.org.hibernate.tool.hbm2ddl=warn
68

  
69
### log HQL parse trees
70
log4j.logger.org.hibernate.hql=warn
71
log4j.logger.org.hibernate.hql.ast=warn
72

  
73
### log cache activity ###
74
#log4j.logger.org.hibernate.cache=debug
75

  
76
### log transaction activity
77
#log4j.logger.org.hibernate.transaction=debug
78

  
79
### log JDBC resource acquisition
80
log4j.logger.org.hibernate.jdbc=info
81

  
82
### avoid warnings about inappropriate Annotations ###
83
# TODO remove the below two line after updating to hibernate 4.x
84
log4j.logger.org.hibernate.search.engine.DocumentBuilderContainedEntity=error
85
log4j.logger.org.hibernate.search.impl.SearchFactoryImpl=error
86

  
87
### enable the following line if you want to track down connection ###
88
### leakages when using DriverManagerConnectionProvider ###
89
#log4j.logger.org.hibernate.connection.DriverManagerConnectionProvider=trace
90

  
91
### log dbUnit data loading
92
log4j.appender.org.unitils=info
93
#log4j.appender.org.unitils.dbunit=debug
94
log4j.appender.org.dbunit=info
95
#log4j.appender.org.dbunit.database.statement=debug
96
#log4j.appender.org.dbunit.database.DatabaseConfig=trace
97

  
98

  
99
   ### *** Profiling Logger ************ ###
100

  
101
#log4j.logger.org.springframework.aop.interceptor.PerformanceMonitorInterceptor=TRACE, profiling
102
### Profiling output
103
#log4j.appender.profiling=org.apache.log4j.RollingFileAppender
104
#log4j.appender.profiling.File=profiling.log
105
#log4j.appender.profiling.MaxFileSize=1024KB
106
#log4j.appender.profiling.MaxBackupIndex=1
107
#log4j.appender.profiling.layout=org.apache.log4j.PatternLayout
108
#log4j.appender.profiling.layout.conversionPattern=%d,%p,%m%n
109

  
cdmlib-io/.gitignore
1
/bin/
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/common/ImportConfiguratorBase.java
10 10
package eu.etaxonomy.cdm.io.common;
11 11

  
12 12
import java.lang.reflect.Method;
13
import java.time.ZonedDateTime;
14
import java.time.format.DateTimeFormatter;
13 15
import java.util.HashMap;
14 16
import java.util.List;
15 17
import java.util.Map;
16 18
import java.util.UUID;
17 19

  
18
import org.joda.time.DateTime;
19
import org.joda.time.format.DateTimeFormat;
20
import org.joda.time.format.DateTimeFormatter;
21 20
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
22 21
import org.springframework.stereotype.Component;
23 22

  
......
419 418
    }
420 419

  
421 420

  
422
    private static final DateTimeFormatter formatter = DateTimeFormat.forPattern("YYYY-MM-dd");
421
    private static final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("YYYY-MM-dd");
423 422

  
424 423
    protected String getDateString(){
425
        return formatter.print(new DateTime());
424
        return ZonedDateTime.now().format(formatter);
425

  
426 426
    }
427 427

  
428 428
    /**
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/common/PartitionerProfiler.java
1 1
/**
2 2
* Copyright (C) 2007 EDIT
3
* European Distributed Institute of Taxonomy 
3
* European Distributed Institute of Taxonomy
4 4
* http://www.e-taxonomy.eu
5
* 
5
*
6 6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7 7
* See LICENSE.TXT at the top of this package for the full license terms.
8 8
*/
9 9

  
10 10
package eu.etaxonomy.cdm.io.common;
11 11

  
12
import java.time.Duration;
13
import java.time.ZonedDateTime;
14

  
12 15
import org.apache.log4j.Logger;
13
import org.joda.time.DateTime;
14
import org.joda.time.Duration;
15
import org.joda.time.ReadableDuration;
16

  
16 17

  
17 18

  
18 19
/**
......
22 23
 */
23 24
public class PartitionerProfiler {
24 25
	private static final Logger logger = Logger.getLogger(PartitionerProfiler.class);
25
	
26

  
26 27
	ResultSetPartitioner partitioner;
27
	
28
	DateTime startTx = new DateTime();
29
	DateTime startRs = new DateTime();
30
	DateTime startRelObjects = new DateTime();
31
	DateTime startRS2 = new DateTime();
32
	DateTime startDoPartition = new DateTime();
33
	DateTime startDoSave = new DateTime();
34
	DateTime startDoCommit = new DateTime();
35
	DateTime end = new DateTime();
36

  
37
	private Duration durTxStartAll = new Duration(0, 0);
38
	private Duration durPartitionRs1All= new Duration(0, 0);
39
	private Duration durRelObjectsAll = new Duration(0, 0);
40
	private Duration durPartitionRs2All =new Duration(0, 0);
41
	private Duration durPartitionAll = new Duration(0, 0);
42
	private Duration durTxCommitAll = new Duration(0, 0);
43
	private Duration durSaveAll = new Duration(0, 0);
44

  
45
	
46
	private ReadableDuration durTxStartSingle;
47
	private ReadableDuration durPartitionRs1Single;
48
	private ReadableDuration durRelObjectsSingle;
49
	private ReadableDuration durPartitionRs2Single;
50
	private ReadableDuration durPartitionSingle;
51
	private ReadableDuration durSaveSingle;
52
	private ReadableDuration durTxCommitSingle;
28

  
29
	ZonedDateTime startTx = ZonedDateTime.now();
30
	ZonedDateTime startRs = ZonedDateTime.now();
31
	ZonedDateTime startRelObjects = ZonedDateTime.now();
32
	ZonedDateTime startRS2 = ZonedDateTime.now();
33
	ZonedDateTime startDoPartition = ZonedDateTime.now();
34
	ZonedDateTime startDoSave = ZonedDateTime.now();
35
	ZonedDateTime startDoCommit = ZonedDateTime.now();
36
	ZonedDateTime end = ZonedDateTime.now();
37

  
38
	private Duration durTxStartAll =Duration.ofMinutes(0);
39
	private Duration durPartitionRs1All= Duration.ofMinutes(0);
40
	private Duration durRelObjectsAll = Duration.ofMinutes(0);
41
	private Duration durPartitionRs2All =Duration.ofMinutes(0);
42
	private Duration durPartitionAll = Duration.ofMinutes(0);
43
	private Duration durTxCommitAll = Duration.ofMinutes(0);
44
	private Duration durSaveAll = Duration.ofMinutes(0);
45

  
46

  
47
	private Duration durTxStartSingle;
48
	private Duration durPartitionRs1Single;
49
	private Duration durRelObjectsSingle;
50
	private Duration durPartitionRs2Single;
51
	private Duration durPartitionSingle;
52
	private Duration durSaveSingle;
53
	private Duration durTxCommitSingle;
53 54

  
54 55
	public void startTx(){
55
		startTx = new DateTime();
56
		startTx = ZonedDateTime.now();
56 57

  
57 58
	}
58
	
59

  
59 60
	public void startRs(){
60
		startRs = new DateTime();
61
		durTxStartSingle = new Duration(startTx, startRs);
62
		durTxStartAll = durTxStartAll.withDurationAdded(durTxStartSingle, 1);
61
		startRs = ZonedDateTime.now();
62

  
63
		durTxStartSingle = Duration.between(startTx, startRs);
64
		durTxStartAll = durTxStartAll.plus(durTxStartSingle);
63 65
	}
64 66

  
65 67
	public void startRelObjects(){
66
		startRelObjects = new DateTime();
67
		durPartitionRs1Single = new Duration(startRs, startRelObjects);
68
		durPartitionRs1All= durPartitionRs1All.withDurationAdded(durPartitionRs1Single, 1);
68
		startRelObjects =ZonedDateTime.now();
69
		durPartitionRs1Single = Duration.between(startRs, startRelObjects);
70
		durPartitionRs1All= durPartitionRs1All.plus(durPartitionRs1Single);
69 71
	}
70 72

  
71 73
	public void startRs2(){
72
		startRS2 = new DateTime();
73
		durRelObjectsSingle = new Duration(startRelObjects, startRS2);
74
		durRelObjectsAll = durRelObjectsAll.withDurationAdded(durRelObjectsSingle, 1);
74
		startRS2 = ZonedDateTime.now();
75
		durRelObjectsSingle = Duration.between(startRelObjects, startRS2);
76
		durRelObjectsAll = durRelObjectsAll.plus(durRelObjectsSingle);
75 77
	}
76 78

  
77 79
	public void startDoPartition(){
78
		startDoPartition = new DateTime();
79
		startDoSave = new DateTime();
80
		durPartitionRs2Single = new Duration(startRS2, startDoPartition);
81
		durPartitionRs2All = durPartitionRs2All.withDurationAdded(durPartitionRs2Single, 1);
80
		startDoPartition = ZonedDateTime.now();
81
		startDoSave = ZonedDateTime.now();
82
		durPartitionRs2Single = Duration.between(startRS2, startDoPartition);
83
		durPartitionRs2All = durPartitionRs2All.plus(durPartitionRs2Single);
82 84
	}
83
	
85

  
84 86
	public void startDoSave(){
85
		startDoSave = new DateTime();
87
		startDoSave = ZonedDateTime.now();
86 88
		//durSaveSingle = new Duration(startRS2, startSave);
87 89
		//durPartitionRs2All = durPartitionRs2All.withDurationAdded(durPartitionRs2Single, 1);
88 90
	}
89 91

  
90 92
	public void startDoCommit(){
91
		startDoCommit = new DateTime();
92
		durPartitionSingle = new Duration(startDoPartition, startDoCommit);
93
		durPartitionAll = durPartitionAll.withDurationAdded(durPartitionSingle, 1);
94
		durSaveSingle = new Duration(startDoSave, startDoCommit);
95
		durSaveAll = durSaveAll.withDurationAdded(durSaveSingle, 1);
93
		startDoCommit = ZonedDateTime.now();
94
		durPartitionSingle = Duration.between(startDoPartition, startDoCommit);
95
		durPartitionAll = durPartitionAll.plus(durPartitionSingle);
96
		durSaveSingle = Duration.between(startDoSave, startDoCommit);
97
		durSaveAll = durSaveAll.plus(durSaveSingle);
96 98
	}
97
	
99

  
98 100
	public void end(){
99
		end = new DateTime();
100
		durTxCommitSingle = new Duration(startDoCommit, end);
101
		durTxCommitAll = durTxCommitAll.withDurationAdded(durTxCommitSingle, 1);
101
		end = ZonedDateTime.now();
102
		durTxCommitSingle = Duration.between(startDoCommit, end);
103
		durTxCommitAll = durTxCommitAll.plus(durTxCommitSingle);
102 104
	}
103 105

  
104 106
	public void print(){
105 107
		if (logger.isDebugEnabled()){
106 108
			System.out.println("Durations: " +
107
					"Start Transaction: " + durTxStartSingle.getMillis() + "/" + durTxStartAll.getMillis() +   
108
					"; partitionRS1: " + durPartitionRs1Single.getMillis() + "/" + durPartitionRs1All.getMillis() +
109
					"; getRelatedObjects: " + durRelObjectsSingle.getMillis() + "/" + durRelObjectsAll.getMillis() +
110
					"; partitionRS2 " + durPartitionRs2Single.getMillis() + "/" + durPartitionRs2All.getMillis() +
111
					"; doPartition " + durPartitionSingle.getMillis() + "/" + durPartitionAll.getMillis() +
112
					"; doSave " + durSaveSingle.getMillis() + "/" + durSaveAll.getMillis() +
113
					"; commit " + durTxCommitSingle.getMillis() + "/" + durTxCommitAll.getMillis() 
109
					"Start Transaction: " + durTxStartSingle.getNano() + "/" + durTxStartAll.getNano() +
110
					"; partitionRS1: " + durPartitionRs1Single.getNano() + "/" + durPartitionRs1All.getNano()+
111
					"; getRelatedObjects: " + durRelObjectsSingle.getNano() + "/" + durRelObjectsAll.getNano() +
112
					"; partitionRS2 " + durPartitionRs2Single.getNano() + "/" + durPartitionRs2All.getNano() +
113
					"; doPartition " + durPartitionSingle.getNano() + "/" + durPartitionAll.getNano() +
114
					"; doSave " + durSaveSingle.getNano() + "/" + durSaveAll.getNano() +
115
					"; commit " + durTxCommitSingle.getNano() + "/" + durTxCommitAll.getNano()
114 116
			);
115 117
		}
116 118
	}
117
	
119

  
118 120
}
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/common/mapping/out/DbDateMapper.java
10 10
package eu.etaxonomy.cdm.io.common.mapping.out;
11 11

  
12 12
import java.sql.Types;
13
import java.time.ZonedDateTime;
13 14

  
14 15
import org.apache.log4j.Logger;
15
import org.joda.time.DateTime;
16

  
16 17

  
17 18
/**
18 19
 * @author a.mueller
......
27 28
		return new DbDateMapper(cdmAttributeString, dbAttributeString, null);
28 29
	}
29 30

  
30
	public static DbDateMapper NewInstance(String cdmAttributeString, String dbAttributeString, DateTime defaultValue){
31
	public static DbDateMapper NewInstance(String cdmAttributeString, String dbAttributeString, ZonedDateTime defaultValue){
31 32
		return new DbDateMapper(cdmAttributeString, dbAttributeString, defaultValue);
32 33
	}
33 34

  
......
35 36
	 * @param dbAttributeString
36 37
	 * @param cdmAttributeString
37 38
	 */
38
	private DbDateMapper(String cdmAttributeString, String dbAttributeString, DateTime defaultValue) {
39
	private DbDateMapper(String cdmAttributeString, String dbAttributeString, ZonedDateTime defaultValue) {
39 40
		super(cdmAttributeString, dbAttributeString, defaultValue);
40 41
	}
41 42

  
......
88 89
	 */
89 90
	@Override
90 91
	public Class<?> getTypeClass() {
91
		return DateTime.class;
92
		return ZonedDateTime.class;
92 93
	}
93 94

  
94 95

  
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/common/mapping/out/DbLastActionMapper.java
10 10
package eu.etaxonomy.cdm.io.common.mapping.out;
11 11

  
12 12
import java.sql.Types;
13
import java.time.ZonedDateTime;
13 14
import java.util.UUID;
14 15

  
15 16
import org.apache.log4j.Logger;
16
import org.joda.time.DateTime;
17 17

  
18 18
import eu.etaxonomy.cdm.io.common.DbExportStateBase;
19 19
import eu.etaxonomy.cdm.model.common.AnnotatableEntity;
......
110 110
	 */
111 111
	@Override
112 112
	public Class<?> getTypeClass() {
113
		return DateTime.class;
113
		return ZonedDateTime.class;
114 114
	}
115 115

  
116 116
}
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/common/mapping/out/DbSingleAttributeExportMapperBase.java
13 13
import java.sql.ResultSet;
14 14
import java.sql.SQLException;
15 15
import java.sql.Types;
16
import java.time.LocalDateTime;
17
import java.time.ZonedDateTime;
16 18

  
17 19
import org.apache.log4j.Logger;
18
import org.joda.time.DateTime;
19 20

  
20 21
import eu.etaxonomy.cdm.common.CdmUtils;
21 22
import eu.etaxonomy.cdm.io.common.DbExportStateBase;
......
121 122
				}else if (sqlType == Types.BOOLEAN){
122 123
					getPreparedStatement().setBoolean(getIndex(), (Boolean)value);
123 124
				}else if (sqlType == Types.DATE){
124
					java.util.Date date = ((DateTime)value).toDate();
125
					long t = date.getTime();
126
					java.sql.Timestamp sqlTimestamp = new java.sql.Timestamp(t);
125
					LocalDateTime date = ((ZonedDateTime)value).toLocalDateTime();
126
					java.sql.Timestamp sqlTimestamp = java.sql.Timestamp.valueOf(date);
127 127
					getPreparedStatement().setTimestamp(getIndex(), sqlTimestamp);
128 128
				}else{
129 129
					throw new IllegalArgumentException("SqlType not yet supported yet: " + sqlType);
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/common/mapping/out/MethodMapper.java
1 1
/**
2 2
* Copyright (C) 2007 EDIT
3
* European Distributed Institute of Taxonomy 
3
* European Distributed Institute of Taxonomy
4 4
* http://www.e-taxonomy.eu
5
* 
5
*
6 6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7 7
* See LICENSE.TXT at the top of this package for the full license terms.
8 8
*/
......
12 12
import java.lang.reflect.InvocationTargetException;
13 13
import java.lang.reflect.Method;
14 14
import java.sql.Types;
15
import java.time.ZonedDateTime;
15 16

  
16 17
import org.apache.log4j.Logger;
17
import org.joda.time.DateTime;
18 18

  
19 19
import eu.etaxonomy.cdm.io.common.DbExportBase;
20 20
import eu.etaxonomy.cdm.io.common.DbExportStateBase;
......
27 27
 */
28 28
public class MethodMapper extends DbSingleAttributeExportMapperBase<DbExportStateBase<?, IExportTransformer>> implements IDbExportMapper<DbExportStateBase<?, IExportTransformer>, IExportTransformer> {
29 29
	private static final Logger logger = Logger.getLogger(MethodMapper.class);
30
	
30

  
31 31
	private Method method;
32 32
	private Class<?>[] parameterTypes;
33
	
33

  
34 34
	public static <T extends DbExportBase> MethodMapper NewInstance(String dbAttributeString, DbExportBase exportBase){
35 35
		String methodName = "get" + dbAttributeString;
36 36
		return NewInstance(dbAttributeString, exportBase, methodName);
37 37
	}
38
	
38

  
39 39
	public static <T extends DbExportBase> MethodMapper NewInstance(String dbAttributeString, DbExportBase exportBase, Class<?>... parameterTypes){
40 40
		String methodName = "get" + dbAttributeString;
41 41
		return new MethodMapper(dbAttributeString, exportBase.getClass(), methodName, parameterTypes);
42 42
	}
43
	
43

  
44 44
	public static <T extends DbExportBase> MethodMapper NewInstance(String dbAttributeString, DbExportBase exportBase, String methodName){
45 45
		Class<?> parameterTypes = exportBase.getStandardMethodParameter();
46 46
		MethodMapper result = new MethodMapper(dbAttributeString, exportBase.getClass(), methodName, parameterTypes);
......
51 51
		MethodMapper result = new MethodMapper(dbAttributeString, clazz, methodName, parameterTypes);
52 52
		return result;
53 53
	}
54
	
54

  
55 55
	public static <T extends DbExportBase> MethodMapper NewInstance(String dbAttributeString, Class<?> clazz, String methodName, Class<?> parameterType1, Class<?> parameterType2){
56 56
		MethodMapper result = new MethodMapper(dbAttributeString, clazz, methodName, parameterType1,parameterType2);
57 57
		return result;
58 58
	}
59
	
59

  
60 60
	/**
61
	 * @param parameterTypes 
61
	 * @param parameterTypes
62 62
	 * @param dbIdAttributString
63 63
	 */
64 64
	protected MethodMapper(String dbAttributeString, Class<?> clazz, String methodName, Class<?>... parameterTypes) {
......
73 73
			logger.error("NoSuchMethodException", e);
74 74
		}
75 75
	}
76
	
76

  
77 77
	@Override
78 78
	public Class<?> getTypeClass() {
79 79
		return method.getReturnType();
80 80
	}
81
	
81

  
82 82
	@Override
83 83
	protected Object getValue(CdmBase cdmBase) {
84
		try{	
84
		try{
85 85
			if (this.parameterTypes.length > 1 && DbExportStateBase.class.isAssignableFrom(parameterTypes[1])){
86 86
				return method.invoke(null, cdmBase, getState());
87 87
			}else{
88 88
				return method.invoke(null, cdmBase);
89 89
			}
90
			
90

  
91 91
		} catch (IllegalAccessException e) {
92 92
			logger.error("IllegalAccessException: " + e.getMessage() + " when invoking MethodMapper " +  this.toString());
93 93
			return false;
......
99 99
			throw new RuntimeException(e);
100 100
		}
101 101
	}
102
	
102

  
103 103
	@Override
104 104
	protected int getSqlType() {
105 105
		Class<?> returnType = method.getReturnType();
......
109 109
			return Types.VARCHAR;
110 110
		}else if (returnType == Boolean.class){
111 111
			return Types.BOOLEAN;
112
		}else if (returnType == DateTime.class){
112
		}else if (returnType == ZonedDateTime.class){
113 113
			return Types.DATE;
114 114
		}else{
115 115
			logger.warn("Return type not supported yet: " + returnType.getSimpleName());
116 116
			throw new IllegalArgumentException("Return type not supported yet: " + returnType.getSimpleName());
117 117
		}
118 118
	}
119
	
119

  
120 120
}
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/csv/redlist/demo/CsvDemoRecordBase.java
11 11
import java.io.PrintWriter;
12 12
import java.net.URI;
13 13
import java.net.URISyntaxException;
14
import java.time.ZonedDateTime;
15
import java.time.temporal.Temporal;
14 16
import java.util.ArrayList;
15 17
import java.util.HashMap;
16 18
import java.util.HashSet;
......
20 22

  
21 23
import org.apache.commons.lang.StringUtils;
22 24
import org.apache.log4j.Logger;
23
import org.joda.time.DateTime;
24
import org.joda.time.Partial;
25 25

  
26 26
import eu.etaxonomy.cdm.common.CdmUtils;
27 27
import eu.etaxonomy.cdm.io.dwca.TermUri;
......
293 293
		}
294 294
	}
295 295

  
296
	protected String getDate(DateTime date) {
296
	protected String getDate(ZonedDateTime date) {
297 297
		if (date == null){
298 298
			return "";
299 299
		}else{
......
424 424
		if (period == null){
425 425
			return "";
426 426
		}else{
427
			Partial date = useEnd? period.getEnd(): period.getStart();
427
			Temporal date = useEnd? period.getEnd(): period.getStart();
428 428
			if (date == null){
429 429
				return "";
430 430
			}else{
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/csv/redlist/out/CsvRecordBaseRedlist.java
1 1
/**
2 2
* Copyright (C) 2009 EDIT
3
* European Distributed Institute of Taxonomy 
3
* European Distributed Institute of Taxonomy
4 4
* http://www.e-taxonomy.eu
5
* 
5
*
6 6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7 7
* See LICENSE.TXT at the top of this package for the full license terms.
8 8
*/
......
11 11
import java.io.PrintWriter;
12 12
import java.net.URI;
13 13
import java.net.URISyntaxException;
14
import java.time.ZonedDateTime;
15
import java.time.temporal.Temporal;
14 16
import java.util.ArrayList;
15 17
import java.util.HashMap;
16 18
import java.util.HashSet;
......
20 22

  
21 23
import org.apache.commons.lang.StringUtils;
22 24
import org.apache.log4j.Logger;
23
import org.joda.time.DateTime;
24
import org.joda.time.Partial;
25 25

  
26 26
import eu.etaxonomy.cdm.common.CdmUtils;
27 27
import eu.etaxonomy.cdm.io.dwca.TermUri;
......
61 61
	protected static final boolean IS_FIRST = false;
62 62
	protected static final boolean IS_NOT_FIRST = true;
63 63
//	protected static final String SEP = ",";
64
	
64

  
65 65
	protected Map<String, URI> knownFields = new HashMap<String, URI>();
66 66
	protected Set<TermUri> knownTermFields = new HashSet<TermUri>();
67
	
67

  
68 68
	public abstract void write(PrintWriter writer);
69 69
	protected abstract void registerKnownFields();
70
	
70

  
71 71
	protected int count;
72 72
	private CsvMetaDataRecordRedlist metaDataRecord;
73 73
	protected CsvTaxExportConfiguratorRedlist config;
......
75 75
	private Integer id;
76 76
	private UUID uuid;
77 77

  
78
	
78

  
79 79
	protected CsvRecordBaseRedlist(CsvMetaDataRecordRedlist metaDataRecord, CsvTaxExportConfiguratorRedlist config){
80 80
		this.metaDataRecord = metaDataRecord;
81 81
		this.count = metaDataRecord.inc();
82 82
		this.config = config;
83 83
	}
84
	
85
	
84

  
85

  
86 86
	public void setId(Integer id) {
87 87
		this.id = id;
88 88
	}
......
107 107
		String value = null;
108 108
		print(value, writer, addSeparator, fieldKey);
109 109
	}
110
	
110

  
111 111
//	protected void print(Object object, PrintWriter writer, boolean addSeparator, TermUri fieldKey) {
112 112
//		print(object == null ? null : object.toString(), writer, addSeparator, fieldKey);
113 113
//	}
......
124 124
		print(agent == null ? null : getAgent(agent), writer, addSeparator, fieldKey);
125 125
	}
126 126

  
127
	
127

  
128 128
	protected void print(Language language, PrintWriter writer, boolean addSeparator, TermUri fieldKey) {
129 129
		print(language, writer, addSeparator, fieldKey.getUriString());
130 130
	}
......
137 137
	protected void print(LSID lsid, PrintWriter writer, boolean addSeparator, String fieldKey) {
138 138
		print(lsid == null ? null : String.valueOf(lsid.toString()), writer, addSeparator, fieldKey);
139 139
	}
140
	
140

  
141 141
	protected void print(Set<Rights> rights, PrintWriter writer, boolean addSeparator, TermUri fieldKey) {
142 142
		print(rights, writer, addSeparator, fieldKey.getUriString());
143 143
	}
......
151 151
	protected void print(URI uri, PrintWriter writer, boolean addSeparator, String fieldKey) {
152 152
		print(uri == null ? null : String.valueOf(uri), writer, addSeparator, fieldKey);
153 153
	}
154
	
154

  
155 155
	protected void print(Point point, PrintWriter writer, boolean addSeparator, TermUri latitudeKey, TermUri longitudeKey) {
156 156
		print(point, writer, addSeparator, latitudeKey.getUriString(), longitudeKey.getUriString());
157 157
	}
158
	
158

  
159 159
	protected void print(Point point, PrintWriter writer, boolean addSeparator, String latitudeKey, String longitudeKey) {
160 160
		if (point == null){
161 161
			String toPrint = null;
......
170 170
	}
171 171
	protected void print(Boolean boolValue, PrintWriter writer, boolean addSeparator, TermUri fieldKey) {
172 172
		print(boolValue, writer, addSeparator, fieldKey.getUriString());
173
	}	
173
	}
174 174
	protected void print(Boolean boolValue, PrintWriter writer, boolean addSeparator, String fieldKey) {
175 175
		print(boolValue == null ? null : String.valueOf(boolValue), writer, addSeparator, fieldKey);
176 176
	}
......
181 181
	protected void print(Integer intValue, PrintWriter writer, boolean addSeparator, String fieldKey) {
182 182
		print(intValue == null ? null : String.valueOf(intValue), writer, addSeparator, fieldKey);
183 183
	}
184
	
184

  
185 185
	protected void printId(Integer intValue, PrintWriter writer, boolean addSeparator, String fieldKey) {
186 186
		print(intValue == null ? null : String.valueOf(intValue), writer, addSeparator, fieldKey);
187 187
	}
......
196 196
	protected void print(String value, PrintWriter writer, boolean addSeparator, TermUri fieldKey, String defaultValue) {
197 197
		print(value, writer, addSeparator, fieldKey.getUriString(), defaultValue);
198 198
	}
199
	
199

  
200 200
	protected void print(String value, PrintWriter writer, boolean addSeparator, String fieldKey) {
201 201
		print(value, writer, addSeparator, fieldKey, null);
202 202
	}
203
	
203

  
204 204
	protected void print(String value, PrintWriter writer, boolean addSeparator, String fieldKey, String defaultValue) {
205 205
		if (count == 1 && addSeparator == IS_NOT_FIRST){
206 206
			registerFieldKey(URI.create(fieldKey), defaultValue);
......
210 210
			if (StringUtils.isNotBlank(value)){
211 211
				//Replace quotes by double quotes
212 212
				value = value.replace("\"", "\"\"");
213
				
213

  
214 214
				value = value.replace(config.getLinesTerminatedBy(), "\\r");
215
				
215

  
216 216
				//replace all line brakes according to best practices: http://code.google.com/p/gbif-ecat/wiki/BestPractices
217 217
				value = value.replace("\r\n", "\\r");
218 218
				value = value.replace("\r", "\\r");
219 219
				value = value.replace("\n", "\\r");
220
				
220

  
221 221
				strToPrint += config.getFieldsEnclosedBy() + value + config.getFieldsEnclosedBy();
222 222
			}
223 223
			writer.print(strToPrint);
224 224
		}
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff