Project

General

Profile

« Previous | Next » 

Revision 717551c8

Added by Andreas Kohlbecker about 12 years ago

deleting it

View differences:

.gitattributes
1331 1331
cdm-pesi/src/main/resources/log4j.properties -text
1332 1332
cdm-pesi/src/test/java/eu/etaxonomy/cdm/io/common/TestConnection.java -text
1333 1333
cdm-pesi/src/test/java/eu/etaxonomy/cdm/io/erms/ermsErrors.txt -text
1334
vibrant-webapp/LICENSE.TXT -text
1335
vibrant-webapp/README.TXT -text
1336
vibrant-webapp/ide/eclipse/cdmlib-remote[!!-~]-[!!-~]remote[!!-~]debug.launch -text svneol=unset#application/xml
1337
vibrant-webapp/ide/eclipse/cdmserver[!!-~]-[!!-~]profile.launch -text
1338
vibrant-webapp/ide/eclipse/cdmserver[!!-~]-[!!-~]run.launch -text svneol=unset#application/xml
1339
vibrant-webapp/pom.xml -text
1340
vibrant-webapp/src/main/java/eu/etaxonomy/cdm/remote/config/AbstractWebApplicationConfigurer.java -text
1341
vibrant-webapp/src/main/java/eu/etaxonomy/cdm/remote/config/DataSourceConfigurer.java -text
1342
vibrant-webapp/src/main/java/eu/etaxonomy/cdm/remote/config/LoggingConfigurer.java -text
1343
vibrant-webapp/src/main/resources/log4j.properties -text
1344
vibrant-webapp/src/main/webapp/WEB-INF/applicationContext.views.xml -text
1345
vibrant-webapp/src/main/webapp/WEB-INF/applicationContext.xml -text
1346
vibrant-webapp/src/main/webapp/WEB-INF/cdmlib-remote-servlet.xml -text
1347
vibrant-webapp/src/main/webapp/WEB-INF/datasources/configurable.xml -text
1348
vibrant-webapp/src/main/webapp/WEB-INF/datasources/datasources-local.xml -text
1349
vibrant-webapp/src/main/webapp/WEB-INF/datasources/empty-default-datasource.xml -text
1350
vibrant-webapp/src/main/webapp/WEB-INF/datasources/p6spy.xml -text
1351
vibrant-webapp/src/main/webapp/WEB-INF/datasources/routing-datasource.xml -text
1352
vibrant-webapp/src/main/webapp/WEB-INF/json-views.xml -text
1353
vibrant-webapp/src/main/webapp/WEB-INF/jsp/index.jsp -text
1354
vibrant-webapp/src/main/webapp/WEB-INF/oai-views.xml -text
1355
vibrant-webapp/src/main/webapp/WEB-INF/web.xml -text
1356
vibrant-webapp/src/main/webapp/WEB-INF/xml-views.xml -text
1357
vibrant-webapp/src/main/webapp/human.xsl -text
1358
vibrant-webapp/src/main/webapp/oai2.xsl -text
1359
vibrant-webapp/src/test/java/eu/etaxonomy/AppTest.java -text
1360
vibrant-webapp/src/test/resources/log4j.properties -text
.gitignore
47 47
/eu.etaxonomy.cdm.model.name.TaxonNameBase
48 48
/eu.etaxonomy.cdm.model.taxon.TaxonBase
49 49
/target
50
vibrant-webapp/.classpath
51
vibrant-webapp/.project
52
vibrant-webapp/.settings
53
vibrant-webapp/target
vibrant-webapp/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.
vibrant-webapp/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
4

  
5
***Deploying to Application Server***
6
The POM contains deployment plugins for TOMCAT and also JETTY.
7

  
8
- Production mode: TOMCAT
9
  Install tomcat,  configure and run it (with bin/startup.sh) 
10
  Configuration: Deployment information is in web.xml and server info in your personal settings.xml (referenced form pom)
11
  Deploy: mvn tomcat:deploy  
12
  Undeploy: mvn tomcat:undeploy  
13
  Debugging: http://www.mojavelinux.com/blog/archives/2007/03/remote_debugging_with_jetty/
14
  
15
- Development mode: JETTY 
16
  Configuration: in pom.xml the jetty plugin. Configured for port 8080
17
  Start: In the project folder simply execute "mvn jetty:run"  
18
  Stop: Ctrl-C  
19
  Debugging: http://www.mojavelinux.com/blog/archives/2007/03/remote_debugging_with_jetty/
vibrant-webapp/ide/eclipse/cdmlib-remote - remote debug.launch
1
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
<launchConfiguration type="org.eclipse.jdt.launching.remoteJavaApplication">
3
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
4
<listEntry value="/cdmlib-remote"/>
5
</listAttribute>
6
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
7
<listEntry value="4"/>
8
</listAttribute>
9
<stringAttribute key="org.eclipse.debug.core.source_locator_id" value="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector"/>
10
<stringAttribute key="org.eclipse.debug.core.source_locator_memento" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;sourceLookupDirector&gt;&#10;&lt;sourceContainers duplicates=&quot;false&quot;&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;classpathVariable path=&amp;quot;M2_REPO/org/springframework/org.springframework.web.servlet/3.0.4.RELEASE/org.springframework.web.servlet-3.0.4.RELEASE-sources.jar&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.classpathVariable&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;javaProject name=&amp;quot;cdmlib-commons&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;javaProject name=&amp;quot;cdmlib-model&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;javaProject name=&amp;quot;cdmlib-persistence&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;javaProject name=&amp;quot;cdmlib-remote&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;javaProject name=&amp;quot;cdmlib-services&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;classpathVariable path=&amp;quot;M2_REPO/org/springframework/org.springframework.beans/3.0.4.RELEASE/org.springframework.beans-3.0.4.RELEASE-sources.jar&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.classpathVariable&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;default/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.debug.core.containerType.default&quot;/&gt;&#10;&lt;/sourceContainers&gt;&#10;&lt;/sourceLookupDirector&gt;&#10;"/>
11
<booleanAttribute key="org.eclipse.jdt.launching.ALLOW_TERMINATE" value="true"/>
12
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.maven.ide.eclipse.launchconfig.classpathProvider"/>
13
<mapAttribute key="org.eclipse.jdt.launching.CONNECT_MAP">
14
<mapEntry key="hostname" value="localhost"/>
15
<mapEntry key="port" value="8000"/>
16
<mapEntry key="timeout" value="20000"/>
17
</mapAttribute>
18
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="cdmlib-remote"/>
19
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.maven.ide.eclipse.launchconfig.sourcepathProvider"/>
20
<stringAttribute key="org.eclipse.jdt.launching.VM_CONNECTOR_ID" value="org.eclipse.jdt.launching.socketAttachConnector"/>
21
</launchConfiguration>
vibrant-webapp/ide/eclipse/cdmserver - profile.launch
1
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
<launchConfiguration type="RunJettyRunWebApp">
3
<stringAttribute key="bad_container_name" value="\cdmlib-remote\ide\eclipse\c"/>
4
<stringAttribute key="org.eclipse.debug.core.source_locator_id" value="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector"/>
5
<stringAttribute key="org.eclipse.debug.core.source_locator_memento" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;sourceLookupDirector&gt;&#13;&#10;&lt;sourceContainers duplicates=&quot;false&quot;&gt;&#13;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;directory nest=&amp;quot;false&amp;quot; path=&amp;quot;D:\_lib\java\jdk1.6_b3.src\j2se\src\share\classes&amp;quot;/&amp;gt;&amp;#13;&amp;#10;&quot; typeId=&quot;org.eclipse.debug.core.containerType.directory&quot;/&gt;&#13;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;directory nest=&amp;quot;false&amp;quot; path=&amp;quot;D:\_lib\java\jdk1.6_b3.src\j2se\src\windows\classes&amp;quot;/&amp;gt;&amp;#13;&amp;#10;&quot; typeId=&quot;org.eclipse.debug.core.containerType.directory&quot;/&gt;&#13;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;default/&amp;gt;&amp;#13;&amp;#10;&quot; typeId=&quot;org.eclipse.debug.core.containerType.default&quot;/&gt;&#13;&#10;&lt;/sourceContainers&gt;&#13;&#10;&lt;/sourceLookupDirector&gt;&#13;&#10;"/>
6
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
7
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
8
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
9
</listAttribute>
10
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="RunJettyRunWebAppClassPathProvider"/>
11
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="runjettyrun.Bootstrap"/>
12
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="cdmlib-remote-webapp"/>
13
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx1024M&#13;&#10;-Dlog4j.configDebug=true&#13;&#10;-agentlib:yjpagent&#13;&#10;-Dcdm.datasource=cyprus"/>
14
<stringAttribute key="run_jetty_run.CONTEXT_ATTR" value="/"/>
15
<booleanAttribute key="run_jetty_run.ENABLE_JNDI_ATTR" value="false"/>
16
<booleanAttribute key="run_jetty_run.ENABLE_NEED_CLIENT_AUTH_ATTR" value="false"/>
17
<booleanAttribute key="run_jetty_run.ENABLE_PARENT_LOADER_PRIORITY_ATTR" value="true"/>
18
<booleanAttribute key="run_jetty_run.ENABLE_SCANNER_ATTR" value="true"/>
19
<booleanAttribute key="run_jetty_run.ENABLE_SCANNER_SCAN_WEBINF_ATTR" value="true"/>
20
<booleanAttribute key="run_jetty_run.ENABLE_SSL_ATTR" value="false"/>
21
<stringAttribute key="run_jetty_run.EXCLUDE_CLASSPATH_ATTR" value=""/>
22
<stringAttribute key="run_jetty_run.KEYSTORE_ATTR" value=""/>
23
<stringAttribute key="run_jetty_run.KEY_PWD_ATTR" value=""/>
24
<stringAttribute key="run_jetty_run.PORT_ATTR" value="8080"/>
25
<stringAttribute key="run_jetty_run.PWD_ATTR" value=""/>
26
<stringAttribute key="run_jetty_run.SCANINTERVALSECONDS_ATTR" value=""/>
27
<booleanAttribute key="run_jetty_run.SHOW_ADVANCE_ATTR" value="false"/>
28
<stringAttribute key="run_jetty_run.SSL_PORT_ATTR" value=""/>
29
<stringAttribute key="run_jetty_run.WEBAPPDIR_ATTR" value="src/main/webapp"/>
30
</launchConfiguration>
vibrant-webapp/ide/eclipse/cdmserver - run.launch
1
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
<launchConfiguration type="RunJettyRunWebApp">
3
<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="false"/>
4
<stringAttribute key="org.eclipse.debug.core.source_locator_id" value="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector"/>
5
<stringAttribute key="org.eclipse.debug.core.source_locator_memento" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;sourceLookupDirector&gt;&#10;&lt;sourceContainers duplicates=&quot;false&quot;&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;archive detectRoot=&amp;quot;true&amp;quot; path=&amp;quot;C:\Programme\Java\jdk1.6.0_11\src.zip&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.debug.core.containerType.externalArchive&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;directory nest=&amp;quot;false&amp;quot; path=&amp;quot;/Applications/eclipse-helios/Eclipse.app/Contents/MacOS/D:\_lib\java\jdk1.6_b3.src\j2se\src\share\classes&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.debug.core.containerType.directory&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;directory nest=&amp;quot;false&amp;quot; path=&amp;quot;/Applications/eclipse-helios/Eclipse.app/Contents/MacOS/D:\_lib\java\jdk1.6_b3.src\j2se\src\windows\classes&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.debug.core.containerType.directory&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;classpathVariable path=&amp;quot;M2_REPO/org/mortbay/jetty/jetty/6.1.16/jetty-6.1.16-sources.jar&amp;quot;/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.classpathVariable&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;default/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.debug.core.containerType.default&quot;/&gt;&#10;&lt;/sourceContainers&gt;&#10;&lt;/sourceLookupDirector&gt;&#10;"/>
6
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
7
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
8
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
9
</listAttribute>
10
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="RunJettyRunWebAppClassPathProvider"/>
11
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="runjettyrun.Bootstrap"/>
12
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="cdmlib-remote-webapp"/>
13
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx1024M&#13;&#10;-Dlog4j.configDebug=false&#13;&#10;-Dcdm.datasource=cichorieae&#10;-Dorg.mortbay.jetty.webapp.parentLoaderPriority=true"/>
14
<stringAttribute key="run_jetty_run.CONTEXT_ATTR" value="/"/>
15
<booleanAttribute key="run_jetty_run.ENABLE_JNDI_ATTR" value="false"/>
16
<booleanAttribute key="run_jetty_run.ENABLE_MAVEN_TEST_CLASSES_ATTR" value="true"/>
17
<booleanAttribute key="run_jetty_run.ENABLE_NEED_CLIENT_AUTH_ATTR" value="false"/>
18
<booleanAttribute key="run_jetty_run.ENABLE_PARENT_LOADER_PRIORITY_ATTR" value="true"/>
19
<booleanAttribute key="run_jetty_run.ENABLE_SCANNER_ATTR" value="false"/>
20
<booleanAttribute key="run_jetty_run.ENABLE_SCANNER_SCAN_WEBINF_ATTR" value="true"/>
21
<booleanAttribute key="run_jetty_run.ENABLE_SSL_ATTR" value="false"/>
22
<stringAttribute key="run_jetty_run.EXCLUDE_CLASSPATH_ATTR" value=""/>
23
<stringAttribute key="run_jetty_run.KEYSTORE_ATTR" value=""/>
24
<stringAttribute key="run_jetty_run.KEY_PWD_ATTR" value=""/>
25
<stringAttribute key="run_jetty_run.PORT_ATTR" value="8080"/>
26
<stringAttribute key="run_jetty_run.PWD_ATTR" value=""/>
27
<stringAttribute key="run_jetty_run.SCANINTERVALSECONDS_ATTR" value=""/>
28
<booleanAttribute key="run_jetty_run.SHOW_ADVANCE_ATTR" value="false"/>
29
<stringAttribute key="run_jetty_run.SSL_PORT_ATTR" value=""/>
30
<stringAttribute key="run_jetty_run.WEBAPPDIR_ATTR" value="src/main/webapp"/>
31
</launchConfiguration>
vibrant-webapp/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/xsd/maven-4.0.0.xsd">
3
  <modelVersion>4.0.0</modelVersion>
4
  <parent>
5
    <artifactId>cdmlib-parent</artifactId>
6
    <groupId>eu.etaxonomy</groupId>
7
    <version>3.0.10-SNAPSHOT</version>
8
	<relativePath>../pom.xml</relativePath>
9
  </parent>
10
  
11
  <groupId>eu.etaxonomy</groupId>
12
  <artifactId>cdmlib-remote-webapp</artifactId>
13
  <name>CDM Remote Webapp</name>
14
  <packaging>war</packaging>
15
  
16
  <scm>
17
    <connection>
18
      scm:svn:http://dev.e-taxonomy.eu/svn/trunk/cdmlib/cdmlib-remote/
19
    </connection>
20
    <developerConnection>
21
      scm:svn:https://dev.e-taxonomy.eu/svn/trunk/cdmlib/cdmlib-remote/
22
    </developerConnection>
23
    <url>
24
      http://dev.e-taxonomy.eu/trac/browser/trunk/cdmlib/cdmlib-remote/
25
    </url>
26
  </scm>
27
  
28
  <dependencies>
29
      <dependency>
30
        <groupId>eu.etaxonomy</groupId>
31
        <artifactId>cdmlib-ext</artifactId>
32
      </dependency>
33
      <dependency>
34
        <groupId>eu.etaxonomy</groupId>
35
        <artifactId>cdmlib-persistence</artifactId>
36
      </dependency>
37
      <dependency>
38
        <groupId>eu.etaxonomy</groupId>
39
        <artifactId>cdmlib-model</artifactId>
40
      </dependency>
41
      <dependency>
42
        <groupId>eu.etaxonomy</groupId>
43
        <artifactId>cdmlib-services</artifactId>
44
      </dependency>
45
      <dependency>
46
        <groupId>eu.etaxonomy</groupId>
47
        <artifactId>cdmlib-io</artifactId>
48
      </dependency>
49
    <dependency>
50
      <groupId>eu.etaxonomy</groupId>
51
      <artifactId>cdmlib-remote</artifactId>
52
    </dependency>
53
      <dependency>
54
        <groupId>javax.servlet</groupId>
55
        <artifactId>servlet-api</artifactId>
56
        <scope>provided</scope>
57
      </dependency>
58
      <dependency>
59
        <groupId>org.springframework</groupId>
60
        <artifactId>org.springframework.web</artifactId>
61
      </dependency>
62
      <dependency>
63
        <groupId>org.springframework</groupId>
64
        <artifactId>org.springframework.context.support</artifactId>
65
      </dependency>
66
      <dependency>
67
        <groupId>org.springframework</groupId>
68
        <artifactId>org.springframework.web.servlet</artifactId>
69
      </dependency>
70
      <dependency>
71
        <groupId>org.springmodules</groupId>
72
        <artifactId>spring-modules-cache</artifactId>
73
        <version>0.7</version>
74
        <exclusions>
75
          <exclusion>
76
            <groupId>org.springframework</groupId>
77
            <artifactId>spring</artifactId>
78
          </exclusion>
79
          <exclusion>
80
            <groupId>org.springframework</groupId>
81
            <artifactId>spring-mock</artifactId>
82
          </exclusion>
83
        </exclusions>
84
      </dependency>
85
      <dependency>
86
        <groupId>com.ibm.lsid</groupId>
87
        <artifactId>lsid-server</artifactId>
88
      </dependency>
89
      <dependency>
90
        <groupId>com.ibm.lsid</groupId>
91
        <artifactId>lsid-client</artifactId>
92
      </dependency>
93
      <dependency>
94
        <groupId>org.easymock</groupId>
95
        <artifactId>easymock</artifactId>
96
      </dependency>
97
      <dependency>
98
        <groupId>xmlunit</groupId>
99
        <artifactId>xmlunit</artifactId>
100
      </dependency>
101
      <dependency>
102
        <groupId>org.springframework</groupId>
103
        <artifactId>org.springframework.test</artifactId>
104
      </dependency>
105
      <dependency>
106
        <groupId>net.sf.dozer</groupId>
107
        <artifactId>dozer</artifactId>
108
      </dependency>
109
      <dependency>
110
        <groupId>joda-time</groupId>
111
        <artifactId>joda-time</artifactId>    
112
      </dependency>
113
      <dependency>
114
        <groupId>org.hibernate</groupId>
115
        <artifactId>hibernate-cglib-repack</artifactId>
116
      </dependency>
117
      <dependency>
118
        <groupId>org.hibernate</groupId>
119
        <artifactId>hibernate-core</artifactId>
120
      </dependency>
121
      <dependency>
122
        <groupId>org.hibernate</groupId>
123
        <artifactId>hibernate-ehcache</artifactId>
124
      </dependency>
125
      <dependency>
126
        <groupId>commons-io</groupId>
127
        <artifactId>commons-io</artifactId>
128
      </dependency>
129
      <!-- JsonView -->
130
      <dependency>
131
        <groupId>net.sf.json-lib</groupId>
132
        <artifactId>json-lib</artifactId>
133
        <version>2.2.3</version>
134
        <classifier>jdk15</classifier>   
135
      </dependency>
136
      <dependency>
137
        <groupId>org.springframework</groupId>
138
        <artifactId>org.springframework.oxm</artifactId>
139
        <version>${spring.version}</version>
140
      </dependency>
141
      
142
      <!-- XmlView -->
143
      <dependency>
144
        <groupId>com.thoughtworks.xstream</groupId>
145
        <artifactId>xstream</artifactId>
146
      </dependency>
147
      <dependency>
148
        <groupId>xpp3</groupId>
149
        <artifactId>xpp3</artifactId>
150
      </dependency>
151
      <dependency>
152
        <groupId>stax</groupId>
153
        <artifactId>stax</artifactId>
154
      </dependency>
155
      
156
      <!-- JSP TAG LIBS -->
157
      <dependency>
158
        <groupId>taglibs</groupId>
159
        <artifactId>standard</artifactId>
160
        <version>1.1.2</version>
161
      </dependency>
162
      <dependency>
163
        <groupId>taglibs</groupId>
164
        <artifactId>x</artifactId>
165
        <version>1.1.2</version>
166
        <type>tld</type>
167
      </dependency>
168
      <!--  Connection Pooling  -->
169
      <dependency> 
170
        <groupId>org.hibernate</groupId> 
171
        <artifactId>hibernate-c3p0</artifactId>         
172
      </dependency>
173
      
174
      <!--  SQL Profiling  -->
175
      <dependency>
176
        <groupId>p6spy</groupId>
177
        <artifactId>p6spy</artifactId>
178
        <version>1.3</version>
179
      </dependency>
180
    
181
    <dependency>
182
      <groupId>junit</groupId>
183
      <artifactId>junit</artifactId>
184
      <version>3.8.1</version>
185
      <scope>test</scope>
186
    </dependency>
187
  
188
  </dependencies>
189
  
190
  <properties>
191
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
192
  </properties>
193
    
194
    <build>
195
      <!-- Configure the webapp -->
196
      <finalName>cdmserver</finalName> 
197
      <plugins>
198
        <plugin>
199
          <groupId>org.apache.maven.plugins</groupId>
200
          <artifactId>maven-war-plugin</artifactId>
201
          <version>2.1-beta-1</version>
202
        </plugin>
203
      </plugins>
204
    </build>
205
</project>
vibrant-webapp/src/main/java/eu/etaxonomy/cdm/remote/config/AbstractWebApplicationConfigurer.java
1
// $Id$
2
/**
3
 * Copyright (C) 2009 EDIT
4
 * European Distributed Institute of Taxonomy 
5
 * http://www.e-taxonomy.eu
6
 * 
7
 * The contents of this file are subject to the Mozilla Public License Version 1.1
8
 * See LICENSE.TXT at the top of this package for the full license terms.
9
 */
10
package eu.etaxonomy.cdm.remote.config;
11

  
12
import java.util.ArrayList;
13
import java.util.List;
14

  
15
import org.apache.log4j.Logger;
16
import org.springframework.beans.factory.annotation.Autowired;
17
import org.springframework.context.ApplicationContext;
18
import org.springframework.web.context.WebApplicationContext;
19

  
20
/**
21
 * @author a.kohlbecker
22
 * @date 20.07.2010
23
 *
24
 */
25
public abstract class AbstractWebApplicationConfigurer {
26

  
27
    private static final String ATTRIBUTE_ERROR_MESSAGES = "cdm.errorMessages";
28

  
29
	public static final Logger logger = Logger.getLogger(AbstractWebApplicationConfigurer.class);
30
	
31
	WebApplicationContext webApplicationContext;
32

  
33
	
34
	@Autowired
35
	public void setApplicationContext(ApplicationContext applicationContext){
36

  
37
		if(WebApplicationContext.class.isAssignableFrom(applicationContext.getClass())) {
38
			this.webApplicationContext = (WebApplicationContext)applicationContext;
39
		} else {
40
			logger.error("The " + this.getClass().getSimpleName() + " only can be used within a WebApplicationContext");
41
		}
42
	}
43

  
44
	/**
45
	 * Find a property in the ServletContext if not found search in a second
46
	 * step in the environment variables of the OS
47
	 * 
48
	 * @param property
49
	 * @param required
50
	 * @return
51
	 */
52
	protected String findProperty(String property, boolean required) {
53
		// 1. look for the property in the ServletContext
54
		Object obj = webApplicationContext.getServletContext().getAttribute(property);
55
		String value = (String)obj;
56
		// 2. look for the property in environment variables of the OS
57
		if(value == null){
58
			value = System.getProperty(property);
59
		}
60
		if(value == null && required){
61
			logger.error("property {" + property + "} not found.");
62
			logger.error("--> This property can be set in two ways:");
63
			logger.error("--> 		1. as attribute to the ServletContext");
64
			logger.error("--> 		2. as system property e.g. -D" + property);
65
			logger.error("Stopping application ...");
66
			System.exit(-1);
67
		}
68
		return value;
69
	}
70

  
71
	protected void addErrorMessageToServletContextAttributes(String errorMessage) {
72
		Object o = webApplicationContext.getServletContext().getAttribute(ATTRIBUTE_ERROR_MESSAGES);
73
		List<String> messages;
74
		if(o != null  && o instanceof List<?>){
75
			messages = (List<String>) o;
76
		} else {
77
			messages = new ArrayList<String>();
78
		}
79
		messages.add(errorMessage);
80
		webApplicationContext.getServletContext().setAttribute(ATTRIBUTE_ERROR_MESSAGES, messages);
81
	}
82
	
83
   
84

  
85
}
vibrant-webapp/src/main/java/eu/etaxonomy/cdm/remote/config/DataSourceConfigurer.java
1
// $Id$
2
/**
3
 * Copyright (C) 2009 EDIT
4
 * European Distributed Institute of Taxonomy
5
 * http://www.e-taxonomy.eu
6
 *
7
 * The contents of this file are subject to the Mozilla Public License Version 1.1
8
 * See LICENSE.TXT at the top of this package for the full license terms.
9
 */
10

  
11
package eu.etaxonomy.cdm.remote.config;
12

  
13
import java.io.File;
14
import java.lang.reflect.InvocationTargetException;
15
import java.lang.reflect.Method;
16
import java.sql.Connection;
17
import java.sql.ResultSet;
18
import java.sql.SQLException;
19
import java.util.Properties;
20

  
21
import javax.naming.NamingException;
22
import javax.sql.DataSource;
23

  
24
import org.apache.log4j.Logger;
25
import org.springframework.beans.factory.xml.XmlBeanFactory;
26
import org.springframework.context.annotation.Bean;
27
import org.springframework.context.annotation.Configuration;
28
import org.springframework.core.io.FileSystemResource;
29
import org.springframework.jndi.JndiObjectFactoryBean;
30

  
31
import com.mchange.v2.c3p0.ComboPooledDataSource;
32

  
33
import eu.etaxonomy.cdm.common.CdmUtils;
34
import eu.etaxonomy.cdm.model.common.CdmMetaData;
35
import eu.etaxonomy.cdm.model.common.CdmMetaData.MetaDataPropertyName;
36

  
37
/**
38
 * The <code>DataSourceConfigurer</code> can be used as a replacement for a xml configuration in the application context.
39
 * Enter the following in your application context configuration in order to enable the <code>DataSourceConfigurer</code>:
40
 *
41
<pre>
42
&lt;!-- enable processing of annotations such as @Autowired and @Configuration --&gt;
43
&lt;context:annotation-config/&gt;
44

  
45
&lt;bean class="eu.etaxonomy.cdm.remote.config.DataSourceConfigurer" &gt;
46
&lt;/bean&gt;
47
</pre>
48
 * The <code>DataSourceConfigurer</code> allows alternative ways to specify a data source:
49
 *
50
 * <ol>
51
 * <li>Specify the data source bean to use in the Java environment properties:
52
 * <code>-Dcdm.datasource={dataSourceName}</code> ({@link #ATTRIBUTE_DATASOURCE_NAME}).
53
 * The data source bean with the given name will then be loaded from the <code>cdm.beanDefinitionFile</code>
54
 * ({@link #CDM_BEAN_DEFINITION_FILE}), which must be a valid Spring bean definition file.
55
 * </li>
56
 * <li>
57
 * Use a JDBC data source which is bound into the JNDI context. In this case the JNDI name is specified
58
 * via the {@link #ATTRIBUTE_JDBC_JNDI_NAME} as attribute to the ServletContext.
59
 * This scenario usually being used by the cdm-server application.
60
 * </li>
61
 * </ol>
62
 * The attributes used in (1) and (2) are in a first step being searched in the ServletContext
63
 * if not found search in a second step in the environment variables of the OS, see:{@link #findProperty(String, boolean)}.
64
 *
65
 * @author a.kohlbecker
66
 * @date 04.02.2011
67
 *
68
 */
69
@Configuration
70
public class DataSourceConfigurer extends AbstractWebApplicationConfigurer {
71

  
72
    public static final Logger logger = Logger.getLogger(DataSourceConfigurer.class);
73

  
74
    private static final String ATTRIBUTE_JDBC_JNDI_NAME = "cdm.jdbcJndiName";
75
    private static final String HIBERNATE_DIALECT = "hibernate.dialect";
76
    private static final String HIBERNATE_SEARCH_DEFAULT_INDEX_BASE = "hibernate.search.default.indexBase";
77
    private static final String CDM_BEAN_DEFINITION_FILE = "cdm.beanDefinitionFile";
78
    private static final String ATTRIBUTE_DATASOURCE_NAME = "cdm.datasource";
79

  
80
    private static final String DATASOURCE_BEANDEF_DEFAULT = CdmUtils.getCdmHomeDir().getPath() + File.separator + "datasources.xml";
81

  
82
    private static String beanDefinitionFile = DATASOURCE_BEANDEF_DEFAULT;
83

  
84
    public void setBeanDefinitionFile(String filename){
85
        beanDefinitionFile = filename;
86
    }
87

  
88

  
89
    private DataSource dataSource;
90

  
91
    private Properties getHibernateProperties() {
92
        Properties hibernateProperties = webApplicationContext.getBean("jndiHibernateProperties", Properties.class);
93
        return hibernateProperties;
94
    }
95

  
96

  
97

  
98
    @Bean
99
    public DataSource dataSource() {
100

  
101
        String beanName = findProperty(ATTRIBUTE_DATASOURCE_NAME, true);
102
        String jndiName = null;
103
        if(this.dataSource == null){
104
            jndiName = findProperty(ATTRIBUTE_JDBC_JNDI_NAME, false);
105

  
106
            if(jndiName != null){
107
                dataSource = useJndiDataSource(jndiName);
108
            } else {
109
                dataSource = loadDataSourceBean(beanName);
110
            }
111
        }
112

  
113
        if(dataSource == null){
114
            return null;
115
        }
116

  
117
        // validate correct schema version
118
        try {
119

  
120
            Connection connection = dataSource.getConnection();
121

  
122
            ResultSet resultSet = connection.createStatement().executeQuery(MetaDataPropertyName.DB_SCHEMA_VERSION.getSqlQuery());
123
            String version = null;
124
            if(resultSet.next()){
125
                version = resultSet.getString(1);
126
            } else {
127
                throw new RuntimeException("Unable to retrieve version info from data source " + dataSource.toString());
128
            }
129

  
130
            connection.close();
131

  
132
            if(!CdmMetaData.isDbSchemaVersionCompatible(version)){
133
                /*
134
                 * any exception thrown here would be nested into a spring
135
                 * BeanException which can not be caught in the servlet
136
                 * container, so we post the information into the
137
                 * ServletContext
138
                 */
139
                String errorMessage = "Incompatible version [" + (beanName != null ? beanName : jndiName) + "] expected version: " + CdmMetaData.getDbSchemaVersion() + ",  data base version  " + version;
140
                addErrorMessageToServletContextAttributes(errorMessage);
141
            }
142

  
143

  
144
        } catch (SQLException e) {
145
            RuntimeException re =   new RuntimeException("Unable to connect or to retrieve version info from data source " + dataSource.toString() , e);
146
            addErrorMessageToServletContextAttributes(re.getMessage());
147
            throw re;
148

  
149
        }
150
        return dataSource;
151
    }
152

  
153

  
154
    private DataSource useJndiDataSource(String jndiName) {
155
        logger.info("using jndi datasource '" + jndiName + "'");
156

  
157
        JndiObjectFactoryBean jndiFactory = new JndiObjectFactoryBean();
158
        /*
159
        JndiTemplate jndiTemplate = new JndiTemplate();
160
        jndiFactory.setJndiTemplate(jndiTemplate); no need to use a JndiTemplate
161
        if I try using JndiTemplate I get an org.hibernate.AnnotationException: "Unknown Id.generator: system-increment"
162
        when running multiple intances via the Bootloader
163
        */
164
        jndiFactory.setResourceRef(true);
165
        jndiFactory.setJndiName(jndiName);
166
        try {
167
            jndiFactory.afterPropertiesSet();
168
        } catch (IllegalArgumentException e) {
169
            logger.error(e);
170
        } catch (NamingException e) {
171
            logger.error(e);
172
        }
173
        Object obj = jndiFactory.getObject();
174
        return (DataSource)obj;
175
    }
176

  
177
    private DataSource loadDataSourceBean(String beanName) {
178

  
179
        String beanDefinitionFileFromProperty = findProperty(CDM_BEAN_DEFINITION_FILE, false);
180
        String path = (beanDefinitionFileFromProperty != null ? beanDefinitionFileFromProperty : beanDefinitionFile);
181
        logger.info("loading DataSourceBean '" + beanName + "' from: " + path);
182
        FileSystemResource file = new FileSystemResource(path);
183
        XmlBeanFactory beanFactory  = new XmlBeanFactory(file);
184
        DataSource dataSource = beanFactory.getBean(beanName, DataSource.class);
185
        if(dataSource instanceof ComboPooledDataSource){
186
            logger.info("DataSourceBean '" + beanName + "' is a ComboPooledDataSource [URL:" + ((ComboPooledDataSource)dataSource).getJdbcUrl()+ "]");
187
        } else {
188
            logger.error("DataSourceBean '" + beanName + "' IS NOT a ComboPooledDataSource");
189
        }
190
        return dataSource;
191
    }
192

  
193
    @Bean
194
    public Properties hibernateProperties(){
195
        Properties props = getHibernateProperties();
196
        props.setProperty(HIBERNATE_DIALECT, inferHibernateDialectName());
197
        props.setProperty(HIBERNATE_SEARCH_DEFAULT_INDEX_BASE, CdmUtils.getCdmHomeDir().getPath() + "/remote-webapp/index/".replace("/", File.separator) + findProperty(ATTRIBUTE_DATASOURCE_NAME, true));
198
        logger.debug("hibernateProperties: " + props.toString());
199
        return props;
200
    }
201

  
202
    public String inferHibernateDialectName() {
203
        DataSource ds = dataSource();
204
        String url = "<SEE PRIOR REFLECTION ERROR>";
205
        Method m = null;
206
        try {
207
            m = ds.getClass().getMethod("getUrl");
208
        } catch (SecurityException e) {
209
            logger.error(e);
210
        } catch (NoSuchMethodException e) {
211
            try {
212
                m = ds.getClass().getMethod("getJdbcUrl");
213
            } catch (SecurityException e2) {
214
                logger.error(e2);
215
            } catch (NoSuchMethodException e2) {
216
                logger.error(e2);
217
            }
218
        }
219
        try {
220
            url = (String)m.invoke(ds);
221
        } catch (IllegalArgumentException e) {
222
            logger.error(e);
223
        } catch (IllegalAccessException e) {
224
            logger.error(e);
225
        } catch (InvocationTargetException e) {
226
            logger.error(e);
227
        } catch (SecurityException e) {
228
            logger.error(e);
229
        }
230

  
231
        if(url != null && url.contains("mysql")){
232
            return "org.hibernate.dialect.MySQLDialect";
233
        }
234

  
235
        logger.error("hibernate dialect mapping for "+url+ " not jet implemented or unavailable");
236
        return null;
237
    }
238

  
239
}
vibrant-webapp/src/main/java/eu/etaxonomy/cdm/remote/config/LoggingConfigurer.java
1
// $Id$
2
/**
3
 * Copyright (C) 2009 EDIT
4
 * European Distributed Institute of Taxonomy 
5
 * http://www.e-taxonomy.eu
6
 * 
7
 * The contents of this file are subject to the Mozilla Public License Version 1.1
8
 * See LICENSE.TXT at the top of this package for the full license terms.
9
 */
10
package eu.etaxonomy.cdm.remote.config;
11

  
12
import java.io.IOException;
13

  
14
import org.apache.log4j.Logger;
15
import org.apache.log4j.PatternLayout;
16
import org.apache.log4j.RollingFileAppender;
17
import org.springframework.beans.factory.InitializingBean;
18
import org.springframework.context.annotation.Configuration;
19

  
20
/**
21
 * @author a.kohlbecker
22
 * @date 20.07.2010
23
 * 
24
 */
25
@Configuration
26
public class LoggingConfigurer extends AbstractWebApplicationConfigurer implements InitializingBean  {
27

  
28
	/**
29
	 * 
30
	 */
31
	private static final String ROLLING_FILE_APPENDER = "rollingFileAppender";
32
	private static final String CDM_LOGFILE = "cdm.logfile";
33

  
34
	protected void configureLogFile() {
35
		PatternLayout layout = new PatternLayout("%d %p [%c] - %m%n");
36
		String logFile = findProperty(CDM_LOGFILE, false);
37
		if (logFile == null) {
38
			logger.info("No logfile specified, runing without.");
39
			return;
40
		}
41
		try {
42
			RollingFileAppender appender = new RollingFileAppender(layout, logFile);
43
			appender.setName(ROLLING_FILE_APPENDER);
44
			appender.setMaxBackupIndex(3);
45
			appender.setMaxFileSize("2MB");
46
			Logger.getRootLogger().addAppender(appender);
47
			logger.info("logging to :" + logFile);
48
		} catch (IOException e) {
49
			logger.error("Creating RollingFileAppender failed:", e);
50
		}
51
	}
52

  
53
	/* (non-Javadoc)
54
	 * @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet()
55
	 */
56
	@Override
57
	public void afterPropertiesSet() throws Exception {
58
		configureLogFile();
59
	}
60
	
61
	
62

  
63
}
vibrant-webapp/src/main/resources/log4j.properties
1
#
2
#
3
# If you are having problems with logging you may debug Log4J initialization,
4
# start the application with a system property log4j.configDebug set to "true".
5
# E.g.:
6
#
7
#     java -Dlog4j.configDebug=true
8
#
9

  
10
log4j.rootLogger=WARN, stdout
11

  
12

  
13
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
14
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
15
log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - %m%n
16

  
17
##
18
## NOTICE !!!!
19
## no need to configure a FileAppender here
20
## use eu.etaxonomy.cdm.remote.config.LoggingConfigurer instead
21
##
22

  
23
###
24
# cdm
25
###
26
log4j.logger.eu.etaxonomy.cdm = INFO
27
# 	  avoid vast amount of "getCitation not yet implemented" & "getProblems not yet implemented" messages
28
log4j.logger.eu.etaxonomy.cdm.model.name.TaxonNameBase = ERROR
29
log4j.logger.eu.etaxonomy.cdm.database.UpdatableRoutingDataSource = INFO
30
log4j.logger.eu.etaxonomy.cdm.persistence.dao.AbstractBeanInitializer = ERROR
31
log4j.logger.eu.etaxonomy.cdm.remote.controller = INFO
32
log4j.logger.eu.etaxonomy.cdm.remote.controller.interceptor = WARN
33
#log4j.logger.eu.etaxonomy.cdm.remote.json.processor.AbstractCdmBeanProcessor  = DEBUG
34
#     prevent CdmExceptionResolver from logging errors
35
log4j.logger.eu.etaxonomy.cdm.remote.exception.CdmExceptionResolver = ERROR
36

  
37
###
38
# springframework
39
###
40
log4j.logger.org.springframework = warn
41
log4j.logger.org.springframework.web.servlet.DispatcherServlet = WARN
42
log4j.logger.org.springframework.web.servlet.mvc.annotation = WARN
43
#log4j.category.org.springframework.web.servlet.mvc.support=DEBUG, stdout
44
log4j.logger.org.springframework.web.servlet.view = WARN
45

  
46
###
47
# json-lib
48
###
49
log4j.logger.net.sf.json.JSONObject = ERROR
50

  
51
###
52
# Hibernate
53
###
54
log4j.logger.org.hibernate=WARN
55
#     log just the SQL
56
log4j.logger.org.hibernate.SQL=WARN
57
log4j.logger.org.hibernate.search = ERROR
58
#     log JDBC bind parameters
59
log4j.logger.org.hibernate.type=WARN
60
#     log schema export/update
61
log4j.logger.org.hibernate.tool.hbm2ddl=WARN
62
# This overcomes the proxy narrow log of hibernate
63
log4j.logger.org.hibernate.engine.StatefulPersistenceContext.ProxyWarnLog=ERROR
64

  
65
### log transaction binding
66
#log4j.logger.org.hibernate.transaction=debug
67
#log4j.logger.org.springframework.transaction.support.TransactionSynchronizationManager=trace
vibrant-webapp/src/main/webapp/WEB-INF/applicationContext.views.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:tx="http://www.springframework.org/schema/tx"
5
    xmlns:context="http://www.springframework.org/schema/context"
6
    xsi:schemaLocation="http://www.springframework.org/schema/beans   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
  <!--
12
    - Accepts a configuration file.
13
    - The default configuration file is /WEB-INF/views.xml
14
    <bean  name="viewResolver" class="org.springframework.web.servlet.view.XmlViewResolver">
15
     <!- -
16
     FOR DEBUGING ONLY !!!!
17
     <property name="cache" value="false"/>
18
      - ->
19
    </bean>
20
  -->
21

  
22
  <import resource="classpath:eu/etaxonomy/cdm/remote/json/jsonConfigurations.xml"/>
23

  
24
  <!--
25
    A TaxonNodeComparator with substitutionRules to allow correct sorted
26
    taxon nodes e.g. in a taxonomic tree browser
27
  -->
28
    <bean  name="taxonNodeByNameComparator" class="eu.etaxonomy.cdm.model.taxon.TaxonNodeByNameComparator">
29
      <property name="substitutionRules">
30
        <map>
31
          <entry key=".*?( sp\.| ssp\.| spp\.| n\.|Nomina dubia|Incertae sedis|Nomina excludenda).*" value="_" />
32
        </map>
33
      </property>
34
    </bean>
35

  
36
</beans>
vibrant-webapp/src/main/webapp/WEB-INF/applicationContext.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:tx="http://www.springframework.org/schema/tx"
5
    xmlns:context="http://www.springframework.org/schema/context"
6
    xsi:schemaLocation="http://www.springframework.org/schema/beans   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
   <!-- include default application context and customization -->
12
    <import resource="classpath:/eu/etaxonomy/cdm/defaultApplicationContext.xml"/>
13
    <bean id="persistentTermInitializer" class="eu.etaxonomy.cdm.database.PersistentTermInitializer">
14
       <property name="omit" value="false" />
15
    </bean>
16
   <context:component-scan base-package="eu/etaxonomy/cdm/ext" />
17

  
18
   <import resource="classpath:/eu/etaxonomy/cdm/remote.xml"/>
19

  
20
    <context:component-scan base-package="eu/etaxonomy/cdm/io">
21
        <context:exclude-filter type="regex" expression="eu\.etaxonomy\.cdm\.io\.pesi.*" />
22
        <context:exclude-filter type="regex" expression="eu\.etaxonomy\.cdm\.io\.faunaEuropaea.*" />
23
        <context:exclude-filter type="regex" expression="eu\.etaxonomy\.cdm\.io\.erms.*" />
24
        <context:exclude-filter type="regex" expression="eu\.etaxonomy\.cdm\.io\.eflora.*" />
25
        <context:exclude-filter type="regex" expression="eu\.etaxonomy\.cdm\.io\.berlinModel.*" />
26
    </context:component-scan>
27

  
28
    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
29
    <property name="properties">
30
      <props>
31
          <prop key="eu.etaxonomy.cdm.base.path">${user.home}/.cdmLibrary/</prop>
32
          <prop key="eu.etaxonomy.cdm.search.index.path">${user.home}/.cdmLibrary/index/</prop>
33
      </props>
34
        </property>
35
  </bean>
36

  
37
    <!-- enable the configuration of transactional behavior based on annotations -->
38
    <tx:annotation-driven transaction-manager="transactionManager"/>
39

  
40
    <!-- import additional beans into the root context -->
41
    <import resource="applicationContext.views.xml"/>
42

  
43
    <!-- CONFIGURE WEB APPLICATION HERE -->
44
    <import resource="datasources/configurable.xml" />
45

  
46
    <context:annotation-config/>
47
    <bean class="eu.etaxonomy.cdm.remote.config.LoggingConfigurer">
48
    </bean>
49

  
50
     <!-- OAI-PMH TODO externalize? -->
51
     <bean name="taxonOaiPmhController" class="eu.etaxonomy.cdm.remote.controller.oaipmh.TaxonOaiPmhController">
52
     <property name="cachingModel" ref="taxonOaiPmhCacheMapping"/>
53
   </bean>
54

  
55
  <bean name="taxonOaiPmhCacheMapping" class="org.springmodules.cache.provider.ehcache.EhCacheCachingModel">
56
          <property name="cacheName" value="eu.etaxonomy.cdm.remote.controller.TaxonOaiPmhController.resumptionToken"/>
57
  </bean>
58
  <bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
59
    <property name="configLocation" value="classpath:/eu/etaxonomy/cdm/remote/ehcache.xml" />
60
        <property name="shared" value="true"/>
61
    </bean>
62

  
63
  <bean id="serializableFactory" class="org.springmodules.cache.serializable.XStreamSerializableFactory"/>
64

  
65
  <bean id="cacheProviderFacade" class="org.springmodules.cache.provider.ehcache.EhCacheFacade">
66
      <property name="cacheManager" ref="cacheManager" />
67
      <property name="serializableFactory" ref="serializableFactory"/>
68
  </bean>
69

  
70
</beans>
vibrant-webapp/src/main/webapp/WEB-INF/cdmlib-remote-servlet.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
  <context:component-scan base-package="eu/etaxonomy/cdm/remote" />
11

  
12

  
13
  <!--
14
    ======= HandlerMappings =======
15
    -->
16
  <!--
17
    first we try to find the controller using the simpleurlmapping, then
18
    the classname this follows the principal of "convention over
19
    configuration"
20
  -->
21
  <bean
22
    class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping">
23
    <property name="order" value="1" />
24
    <property name="interceptors">
25
      <list>
26
        <!--<ref bean="contentNegociationHandlerInterceptor" /> -->
27
        <ref bean="localeContextHandlerInterceptor" />
28
      </list>
29
    </property>
30
    <property name="pathMatcher">
31
      <!--  must match the pathMatcher as set in AnnotationMethodHandlerAdapter -->
32
      <bean class="eu.etaxonomy.cdm.remote.controller.util.CdmAntPathMatcher" />
33
    </property>
34
  </bean>
35

  
36
    <!--
37
   -->
38
  <bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
39
    <property name="order" value="0" />
40
    <property name="mappings">
41
      <props>
42
        <prop key="/index.do">urlFilenameViewController</prop>
43
        <prop key="/">welcomeFileViewController</prop>
44
      </props>
45
    </property>
46
  </bean>
47

  
48
  <!--
49
  ======= HandlerAdapters =======
50
  -->
51
  <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
52
     <property name="pathMatcher">
53
          <!--  must match the pathMatcher as set in DefaultAnnotationHandlerMapping -->
54
            <bean class="eu.etaxonomy.cdm.remote.controller.util.CdmAntPathMatcher" />
55
       </property>
56
  </bean>
57

  
58
  <!-- needed when using SimpleUrlHandlerMapping 	-->
59
  <bean
60
    class="org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter" />
61

  
62

  
63
  <!--
64
  ======= HandlerInterceptors =======
65
  -->
66
  <!--
67
  <bean id="datasourceContextHandlerInterceptor"
68
    class="eu.etaxonomy.cdm.remote.controller.interceptor.DatasourceContextHandlerInterceptor" /> -->
69
  <bean id="localeContextHandlerInterceptor"
70
    class="eu.etaxonomy.cdm.remote.controller.interceptor.LocaleContextHandlerInterceptor" />
71
  <!--
72
     === no longer needed, replaced by ContentNegotiatingViewResolver ==
73
  <bean id="contentNegociationHandlerInterceptor"
74
    class="eu.etaxonomy.cdm.remote.controller.interceptor.ContentNegociationHandlerInterceptor">
75
    <property name="mapping">
76
      <map>
77
        <entry key="text/json" value="json" />
78
        <entry key="application/json" value="json" />
79
        <entry key="application/xml" value="xml" />
80
      </map>
81
    </property>
82
    <property name="defaultExtension" value="xml" />
83
  </bean>
84
   -->
85

  
86
  <!--
87
   ======= ViewControllers =======
88
   -->
89
  <bean id="urlFilenameViewController" class="org.springframework.web.servlet.mvc.UrlFilenameViewController">
90
  </bean>
91
  <!--
92
    The welcome-file-list in the web.xml will is ignored since the
93
    cdmserver servlet is mapped to the root path [/] So the welcome file
94
    list is being replaced by a SimpleUrlHandlerMapping on the root path
95
    [/] which is mapped via this ViewController to the [index] view
96
  -->
97
  <bean id="welcomeFileViewController"
98
    class="org.springframework.web.servlet.mvc.UrlFilenameViewController">
99
    <property name="suffix">
100
      <value>index</value>
101
    </property>
102
  </bean>
103

  
104

  
105
  <!--
106
    ======= ViewResolver =======
107
    -->
108

  
109
    <bean id="viewResolverJsp"
110
        class="org.springframework.web.servlet.view.InternalResourceViewResolver">
111
        <property name="order" value="0" />
112
        <property name="prefix" value="/WEB-INF/jsp/" />
113
        <property name="suffix" value=".jsp" />
114
        <property name="viewNames">
115
            <!--
116
                view names (or name patterns) that can be handled
117
            -->
118
            <list>
119
                <value>index</value>
120
            </list>
121
        </property>
122
    </bean>
123

  
124
  <bean id="oaiViewResolver" class="org.springframework.web.servlet.view.XmlViewResolver">
125
        <property name="order" value="1"/>
126
        <property name="location" value="/WEB-INF/oai-views.xml"/>
127
        <!-- FOR DEBUGING ONLY !!!!
128
        <property name="cache" value="false"/>
129
         -->
130
    </bean>
131

  
132
    <bean id="contentNegotiatingViewResolver" class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver">
133
        <property name="order" value="2" />
134
        <property name="mediaTypes">
135
           <map>
136
          <entry key="xml" value="application/xml" />
137
        <entry key="dc" value="application/xml" />
138
        <entry key="rdf" value="application/xml" />
139
        <entry key="json" value="application/json" />
140
           </map>
141
        </property>
142
        <property name="viewResolvers">
143
            <list>
144
          <bean id="xmlTypeViewResolver" class="eu.etaxonomy.cdm.remote.view.PatternViewResolver">
145
              <property name="location" value="/WEB-INF/xml-views.xml"/>
146
              <!--
147
                  turn caching off FOR DEBUGING ONLY !!!!
148
              <property name="cache" value="false"/>
149
              -->
150
          </bean>
151
          <bean id="jsonTypeViewResolver" class="eu.etaxonomy.cdm.remote.view.PatternViewResolver">
152
              <property name="location" value="/WEB-INF/json-views.xml"/>
153
              <!--
154
                turn caching off FOR DEBUGING ONLY !!!!
155
              <property name="cache" value="false"/>
156
              -->
157
          </bean>
158
            </list>
159
        </property>
160
  </bean>
161

  
162
  <!--
163
  ======= Exception Handling =======
164
  -->
165
  <bean id="exceptionResolver" class="eu.etaxonomy.cdm.remote.exception.CdmExceptionResolver">
166
  </bean>
167

  
168
  <!--
169
    ======= Security =======
170
    -->
171
<!--    <bean id="basicProcessingFilter" class="org.springframework.security.ui.basicauth.BasicProcessingFilter">-->
172
<!--		<property name="authenticationManager"><ref bean="authenticationManager"/></property>-->
173
<!--		<property name="authenticationEntryPoint"><ref bean="authenticationEntryPoint"/></property>-->
174
<!--	</bean>-->
175
<!--	<bean id="authenticationEntryPoint" class="org.springframework.security.ui.basicauth.BasicProcessingFilterEntryPoint">-->
176
<!--		<property name="realmName"><value>Name Of Your Realm</value></property>-->
177
<!--	</bean>-->
178

  
179
</beans>
vibrant-webapp/src/main/webapp/WEB-INF/datasources/configurable.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-2.5.xsd
7
    http://www.springframework.org/schema/context
8
    http://www.springframework.org/schema/context/spring-context-2.5.xsd">
9

  
10
    <!-- enable processing of annotations such as @Autowired and @Configuration -->
11
    <context:annotation-config/>
12

  
13
    <bean class="eu.etaxonomy.cdm.remote.config.DataSourceConfigurer" >
14
    </bean>
15

  
16
    <bean id="jndiHibernateProperties" class="org.springframework.beans.factory.config.PropertiesFactoryBean">
17
        <property name="properties"><!-- This configures default hibernate properties -->
18
            <props>
19
              <!--
20
                the hibernate.dialect will be set by the JndiDataSourceConfig accorging to the
21
                according WebAppContext attributes or to the environment variable
22
              -->
23
              <prop key="hibernate.hbm2ddl.auto">validate</prop><!-- !!! must never be set to 'update' !!! -->
24
              <prop key="hibernate.cache.provider_class">org.hibernate.cache.NoCacheProvider</prop>
25
              <prop key="hibernate.show_sql">false</prop>
26
              <prop key="hibernate.format_sql">false</prop>
27
              <prop key="hibernate.search.default.directory_provider">org.hibernate.search.store.FSDirectoryProvider</prop>
28
              <prop key="hibernate.search.default.indexBase">${eu.etaxonomy.cdm.search.index.path}</prop><!-- set in applicationContext.xml -->
29
            </props>
30
        </property>
31
    </bean>
32
</beans>
vibrant-webapp/src/main/webapp/WEB-INF/datasources/datasources-local.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-2.5.xsd
7
    http://www.springframework.org/schema/context
8
    http://www.springframework.org/schema/context/spring-context-2.5.xsd">
9

  
10
    <bean id="dataSource"  lazy-init="true" class="eu.etaxonomy.cdm.database.UpdatableRoutingDataSource">
11
    	<property name="targetDataSources">
12
	      <map key-type="java.lang.String">
13
	         <entry key="cichorieae" value-ref="cichorieaeDataSource"/>
14
	         <entry key="palmae" value-ref="palmaeDataSource"/>
15
	         <entry key="diptera" value-ref="dipteraDataSource"/>
16
	      </map>
17
   		</property>
18
   		<property name="defaultTargetDataSource" ref="cichorieaeDataSource"/>
19
   </bean>
20

  
21
    <bean id="cichorieaeDataSource"  lazy-init="true" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
22
        <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
23
        <property name="username" value="${local.usr}"/>
24
        <property name="password" value="${local.pwd}"/>
25
        <property name="url" value="jdbc:mysql://${local.host}/cdm_local_cichorieae"/>
26
    </bean>
27
    <bean id="palmaeDataSource"  lazy-init="true" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
28
        <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
29
        <property name="username" value="${local.usr}"/>
30
        <property name="password" value="${local.pwd}"/>
31
        <property name="url" value="jdbc:mysql://${local.host}/cdm_local_palmae"/>
32
    </bean>
33

  
34
    <bean id="dipteraDataSource"  lazy-init="true" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
35
        <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
36
        <property name="username" value="${local.usr}"/>
37
        <property name="password" value="${local.pwd}"/>
38
        <property name="url" value="jdbc:mysql://${local.host}/cdm_local_diptera"/>
39
    </bean>
40
    
41
    <!-- This configures default properties, which can overridden with the file specified by the location property -->
42
    <bean id="hibernateProperties" 
43
        class="org.springframework.beans.factory.config.PropertiesFactoryBean">
44
        <property name="properties">
45
            <props>
46
                <prop key="hibernate.hbm2ddl.auto">validate</prop>
47
                <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
48
                <prop key="hibernate.cache.provider_class">org.hibernate.cache.NoCacheProvider</prop>
49
                <prop key="hibernate.show_sql">true</prop>
50
                <prop key="hibernate.format_sql">false</prop>
51
            </props>
52
        </property>
53
    </bean>
54

  
55
</beans>
vibrant-webapp/src/main/webapp/WEB-INF/datasources/empty-default-datasource.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-2.5.xsd
7
    http://www.springframework.org/schema/context
8
    http://www.springframework.org/schema/context/spring-context-2.5.xsd">
9

  
10
    <bean id="dataSource"  lazy-init="true" class="eu.etaxonomy.cdm.database.UpdatableRoutingDataSource">
11
    	<property name="targetDataSources">
12
	      <map key-type="java.lang.String">
13
	         <entry key="empty_default" value-ref="empty_defaultDataSource"/>
14
	      </map>
15
   		</property>
16
   		<property name="defaultTargetDataSource" ref="empty_defaultDataSource"/>
17
   </bean>
18

  
19
    <bean id="empty_defaultDataSource"  lazy-init="true" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
20
        <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
21
        <property name="username" value="${local.usr}"/>
22
        <property name="password" value="${local.pwd}"/>
23
        <property name="url" value="jdbc:mysql://${local.host}/cdm_empty_default"/>
24
    </bean>
25
    
26
    <!-- This configures default properties, which can overridden with the file specified by the location property -->
27
    <bean id="hibernateProperties" 
28
        class="org.springframework.beans.factory.config.PropertiesFactoryBean">
29
        <property name="properties">
30
            <props>
31
                <prop key="hibernate.hbm2ddl.auto">validate</prop>
32
                <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
33
                <prop key="hibernate.cache.provider_class">org.hibernate.cache.NoCacheProvider</prop>
34
                <prop key="hibernate.show_sql">false</prop>
35
                <prop key="hibernate.format_sql">false</prop>
36
            </props>
37
        </property>
38
    </bean>
39

  
40
</beans>
vibrant-webapp/src/main/webapp/WEB-INF/datasources/p6spy.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:tx="http://www.springframework.org/schema/tx"
5
    xmlns:context="http://www.springframework.org/schema/context"
6
    xsi:schemaLocation="http://www.springframework.org/schema/beans   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
    <!-- 
12
		see also /cdmlib-remote/src/main/resources/spy.properties in which P6Spy is configured 
13
		important properities are:
14
			realdriver=com.mysql.jdbc.Driver
15
			log4j.logger.p6spy=INFO,STDOUT
16
			log4j.logger.p6spy=INFO, SQLPROFILER_CLIENT
17
			log4j.appender.SQLPROFILER_CLIENT.RemoteHost = 
18
			
19
		you can use sqlprofiler as SQLPROFILER_CLIENT
20
	-->
21
    <bean id="dataSource"  lazy-init="true" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
22
        <property name="driverClassName" value="com.p6spy.engine.spy.P6SpyDriver"/>
23
    	<property name="username" value="${local.usr}"/>
24
        <property name="password" value="${local.pwd}"/>
25
        <property name="url" value="jdbc:mysql://${local.host}/cdm_local_cichorieae"/>
26
    </bean>
27
    
28
 
29
    <!-- This configures default properties, which can overridden with the file specified by the location property -->
30
    <bean id="hibernateProperties" 
31
        class="org.springframework.beans.factory.config.PropertiesFactoryBean">
32
        <property name="properties">
33
            <props>
34
                <prop key="hibernate.hbm2ddl.auto">validate</prop>
35
                <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
36
                <prop key="hibernate.cache.provider_class">org.hibernate.cache.NoCacheProvider</prop>
37
                <prop key="hibernate.show_sql">false</prop>
38
                <prop key="hibernate.format_sql">false</prop>
39
            </props>
40
        </property>
41
    </bean>
42

  
43

  
44
</beans>
vibrant-webapp/src/main/webapp/WEB-INF/datasources/routing-datasource.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-2.5.xsd
7
    http://www.springframework.org/schema/context
8
    http://www.springframework.org/schema/context/spring-context-2.5.xsd">
9
    
10
    
11
    <bean id="dataSource"  lazy-init="true" class="eu.etaxonomy.cdm.database.SelectableDataSource">
12
    	<!--  The property beanDefinitionFile defaults to "datasources.xml" in {USER_HOME}./cdmLibrary 
13
    	
14
    	WARNING !!!
15
    	The beanDefinitionFile now mus be configured in 
16
    	eu.etaxonomy.cdm.database.DataSourceBeanLoader
17
    	
18
    	-->
19
    	<!--  The property defaultDatasourceName defaults to "default" 
20
    	<property name="beanDefinitionFile" value="datasources-p6spy.xml" />
21
    	<property name="defaultDatasourceName" value="cichorieae" />
22
    	-->
23
    </bean>
24
    
25
    <!-- This configures default properties, which can overridden with the file specified by the location property -->
26
    <bean id="hibernateProperties" class="org.springframework.beans.factory.config.PropertiesFactoryBean">
27
        <property name="properties">
28
            <props>
29
             <!-- 
30
                  Configuring the C3P0ConnectionProvider
31
                  ========================================
32
                  see http://www.mchange.com/projects/c3p0/index.html#hibernate-specific
33
                  and also org.springframework.orm.hibernate3.AbstractSessionFactoryBean.setDataSource(DataSource dataSource)
34
                  
35
                  IMPORTANT: 
36
                  Because of the constraint (1) the org.hibernate.connection.C3P0ConnectionProvider anc not be used 
37
                  for the cdm library because it requires the dataSource bean in some cases. 
38
                  
39
				          (1)
40
				          Do NOT specify the dataSource in the sessionFactory for example in the 
41
				          org.springframework.orm.hibernate3.LocalSessionFactoryBean
42
				          !!!==> If *dataSource* is set, this will override corresponding settings in Hibernate properties.!!!
43
 						  If this is set, the Hibernate settings should not define a connection provider to 
44
 					      avoid meaningless double configuration.
45
				          (2)
46
				          Hibernate uses the hibernate.c3p0.max_size property to determine if c3p0
47
                          is begin used.  Therefore the max_size property MUST be set. - maybe not need in hibernate 3.4 +
48
                          (3) If you are using Hibernate's C3P0ConnectionProvider you must set the following properties 
49
                          in your hibernate configuration, using hibernate-specific configuration keys. 
50
                          All other properties must be defined as usual in a c3p0.properties file. 
51
                          This is confusing, and will hopefully be simplified some time in the future, but for now... 
52
                          
53
                          	hibernate.c3p0.acquire_increment
54
							hibernate.c3p0.idle_test_period
55
							hibernate.c3p0.timeout
56
							hibernate.c3p0.max_size
57
							hibernate.c3p0.max_statements
58
							hibernate.c3p0.min_size
59
							hibernate.c3p0.validate 
60
				      -->
61
              <prop key="hibernate.hbm2ddl.auto">update</prop>
62
              <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
63
              <prop key="hibernate.cache.provider_class">org.hibernate.cache.NoCacheProvider</prop>
64
              <prop key="hibernate.show_sql">false</prop>
65
              <prop key="hibernate.format_sql">false</prop>
66
              <prop key="hibernate.search.default.indexBase">${user.home}/.cdmLibrary/</prop>
67
            </props>
68
        </property>
69
    </bean>
70

  
71
</beans>
vibrant-webapp/src/main/webapp/WEB-INF/json-views.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
    xsi:schemaLocation="http://www.springframework.org/schema/beans
5
    http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
6

  
7
    <!--
8
        ===============================================================
9
        This is the configuration file for the
10
        eu.etaxonomy.cdm.remote.view.PatternViewResolver
11
        ===============================================================
12

  
13
      - bean names are ant style patterns
14
      - the eu.etaxonomy.cdm.remote.view.PatternViewResolver
15
        must be used to resolve patterns used as bean names
16
    -->
17

  
18
    <!-- entity services -->
19
    <bean name="**/*" class="eu.etaxonomy.cdm.remote.view.JsonView">
20
      <property name="jsonConfig" ref="jsonConfig" />
21
    </bean>
22

  
23
    <!-- taxonomy service -->
24
    <bean name="**/classification **/classification/* **/classification/**/*" class="eu.etaxonomy.cdm.remote.view.JsonView">
25
        <property name="jsonConfig" ref="jsonConfigClassification" />
26
    </bean>
27

  
28
    <!-- portal service -->
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff