From: <rv...@us...> - 2009-09-12 17:39:03
|
Revision: 185 http://treebase.svn.sourceforge.net/treebase/?rev=185&view=rev Author: rvos Date: 2009-09-12 17:38:56 +0000 (Sat, 12 Sep 2009) Log Message: ----------- The maven2 pom.xml files now point to the new repository at http://treebase.sourceforge.net/maven2/ Modified Paths: -------------- trunk/treebase-core/pom.xml trunk/treebase-web/pom.xml Modified: trunk/treebase-core/pom.xml =================================================================== --- trunk/treebase-core/pom.xml 2009-08-14 17:58:49 UTC (rev 184) +++ trunk/treebase-core/pom.xml 2009-09-12 17:38:56 UTC (rev 185) @@ -70,7 +70,7 @@ <repository> <id>m2.remote.repos</id> <name>Maven 2 Remote Repository</name> - <url>http://8ball.sdsc.edu:9999/maven2</url> + <url>http://treebase.sourceforge.net/maven2/</url> </repository> <repository> <id>maven2</id> Modified: trunk/treebase-web/pom.xml =================================================================== --- trunk/treebase-web/pom.xml 2009-08-14 17:58:49 UTC (rev 184) +++ trunk/treebase-web/pom.xml 2009-09-12 17:38:56 UTC (rev 185) @@ -121,7 +121,7 @@ <repository> <id>m2.remote.repos</id> <name>Maven 2 Remote Repository</name> - <url>http://8ball.sdsc.edu:9999/maven2</url> + <url>http://treebase.sourceforge.net/maven2/</url> </repository> <repository> <id>maven2</id> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rsc...@us...> - 2009-10-02 13:12:24
|
Revision: 189 http://treebase.svn.sourceforge.net/treebase/?rev=189&view=rev Author: rscherle Date: 2009-10-02 13:12:17 +0000 (Fri, 02 Oct 2009) Log Message: ----------- initial Endnote citations (from TreeBASE January 2009) Added Paths: ----------- trunk/treebase-curation/ trunk/treebase-curation/studyCitations.enl Added: trunk/treebase-curation/studyCitations.enl =================================================================== (Binary files differ) Property changes on: trunk/treebase-curation/studyCitations.enl ___________________________________________________________________ Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yo...@us...> - 2009-10-12 23:12:26
|
Revision: 192 http://treebase.svn.sourceforge.net/treebase/?rev=192&view=rev Author: youjun Date: 2009-10-12 23:12:11 +0000 (Mon, 12 Oct 2009) Log Message: ----------- oai_pmh data_provider Added Paths: ----------- trunk/data_provider/ trunk/data_provider/.classpath trunk/data_provider/.project trunk/data_provider/.settings/ trunk/data_provider/.settings/org.eclipse.jdt.core.prefs trunk/data_provider/.settings/org.maven.ide.eclipse.prefs trunk/data_provider/data_provider_core/ trunk/data_provider/data_provider_core/.classpath trunk/data_provider/data_provider_core/.project trunk/data_provider/data_provider_core/.settings/ trunk/data_provider/data_provider_core/.settings/org.eclipse.jdt.core.prefs trunk/data_provider/data_provider_core/.settings/org.eclipse.wst.common.component trunk/data_provider/data_provider_core/.settings/org.eclipse.wst.common.project.facet.core.xml trunk/data_provider/data_provider_core/.settings/org.maven.ide.eclipse.prefs trunk/data_provider/data_provider_core/pom.xml trunk/data_provider/data_provider_core/src/ trunk/data_provider/data_provider_core/src/main/ trunk/data_provider/data_provider_core/src/main/java/ trunk/data_provider/data_provider_core/src/main/java/META-INF/ trunk/data_provider/data_provider_core/src/main/java/META-INF/MANIFEST.MF trunk/data_provider/data_provider_core/src/main/java/org/ trunk/data_provider/data_provider_core/src/main/java/org/treebase/ trunk/data_provider/data_provider_core/src/main/java/org/treebase/oai/ trunk/data_provider/data_provider_core/src/main/java/org/treebase/oai/App.java trunk/data_provider/data_provider_core/src/main/resources/ trunk/data_provider/data_provider_core/src/test/ trunk/data_provider/data_provider_core/src/test/java/ trunk/data_provider/data_provider_core/src/test/java/org/ trunk/data_provider/data_provider_core/src/test/java/org/treebase/ trunk/data_provider/data_provider_core/src/test/java/org/treebase/oai/ trunk/data_provider/data_provider_core/src/test/java/org/treebase/oai/AppTest.java trunk/data_provider/data_provider_core/src/test/resources/ trunk/data_provider/data_provider_core/target/ trunk/data_provider/data_provider_core/target/classes/ trunk/data_provider/data_provider_core/target/classes/META-INF/ trunk/data_provider/data_provider_core/target/classes/META-INF/MANIFEST.MF trunk/data_provider/data_provider_core/target/classes/org/ trunk/data_provider/data_provider_core/target/classes/org/treebase/ trunk/data_provider/data_provider_core/target/classes/org/treebase/oai/ trunk/data_provider/data_provider_core/target/classes/org/treebase/oai/App.class trunk/data_provider/data_provider_core/target/test-classes/ trunk/data_provider/data_provider_core/target/test-classes/org/ trunk/data_provider/data_provider_core/target/test-classes/org/treebase/ trunk/data_provider/data_provider_core/target/test-classes/org/treebase/oai/ trunk/data_provider/data_provider_core/target/test-classes/org/treebase/oai/AppTest.class trunk/data_provider/data_provider_web/ trunk/data_provider/data_provider_web/.classpath trunk/data_provider/data_provider_web/.project trunk/data_provider/data_provider_web/.settings/ trunk/data_provider/data_provider_web/.settings/.jsdtscope trunk/data_provider/data_provider_web/.settings/org.eclipse.jdt.core.prefs trunk/data_provider/data_provider_web/.settings/org.eclipse.wst.common.component trunk/data_provider/data_provider_web/.settings/org.eclipse.wst.common.project.facet.core.xml trunk/data_provider/data_provider_web/.settings/org.eclipse.wst.jsdt.ui.superType.container trunk/data_provider/data_provider_web/.settings/org.eclipse.wst.jsdt.ui.superType.name trunk/data_provider/data_provider_web/.settings/org.maven.ide.eclipse.prefs trunk/data_provider/data_provider_web/pom.xml trunk/data_provider/data_provider_web/src/ trunk/data_provider/data_provider_web/src/main/ trunk/data_provider/data_provider_web/src/main/java/ trunk/data_provider/data_provider_web/src/main/resources/ trunk/data_provider/data_provider_web/src/main/webapp/ trunk/data_provider/data_provider_web/src/main/webapp/META-INF/ trunk/data_provider/data_provider_web/src/main/webapp/META-INF/MANIFEST.MF trunk/data_provider/data_provider_web/src/main/webapp/WEB-INF/ trunk/data_provider/data_provider_web/src/main/webapp/WEB-INF/lib/ trunk/data_provider/data_provider_web/src/main/webapp/WEB-INF/web.xml trunk/data_provider/data_provider_web/src/main/webapp/index.jsp trunk/data_provider/data_provider_web/src/test/ trunk/data_provider/data_provider_web/src/test/java/ trunk/data_provider/data_provider_web/src/test/resources/ trunk/data_provider/data_provider_web/target/ trunk/data_provider/data_provider_web/target/classes/ trunk/data_provider/data_provider_web/target/test-classes/ trunk/data_provider/pom.xml trunk/data_provider/target/ trunk/data_provider/target/classes/ trunk/data_provider/target/classes/org/ trunk/data_provider/target/classes/org/treebase/ trunk/data_provider/target/classes/org/treebase/oai/ trunk/data_provider/target/classes/org/treebase/oai/data_provider/ trunk/data_provider/target/classes/org/treebase/oai/data_provider/App.class trunk/data_provider/target/test-classes/ trunk/data_provider/target/test-classes/org/ trunk/data_provider/target/test-classes/org/treebase/ trunk/data_provider/target/test-classes/org/treebase/oai/ trunk/data_provider/target/test-classes/org/treebase/oai/data_provider/ trunk/data_provider/target/test-classes/org/treebase/oai/data_provider/AppTest.class Added: trunk/data_provider/.classpath =================================================================== --- trunk/data_provider/.classpath (rev 0) +++ trunk/data_provider/.classpath 2009-10-12 23:12:11 UTC (rev 192) @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/> + <classpathentry kind="output" path="target/classes"/> +</classpath> Added: trunk/data_provider/.project =================================================================== --- trunk/data_provider/.project (rev 0) +++ trunk/data_provider/.project 2009-10-12 23:12:11 UTC (rev 192) @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>data_provider</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.maven.ide.eclipse.maven2Builder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + <nature>org.maven.ide.eclipse.maven2Nature</nature> + </natures> +</projectDescription> Added: trunk/data_provider/.settings/org.eclipse.jdt.core.prefs =================================================================== --- trunk/data_provider/.settings/org.eclipse.jdt.core.prefs (rev 0) +++ trunk/data_provider/.settings/org.eclipse.jdt.core.prefs 2009-10-12 23:12:11 UTC (rev 192) @@ -0,0 +1,5 @@ +#Mon Oct 12 12:48:37 EDT 2009 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2 +org.eclipse.jdt.core.compiler.compliance=1.4 +org.eclipse.jdt.core.compiler.source=1.3 Added: trunk/data_provider/.settings/org.maven.ide.eclipse.prefs =================================================================== --- trunk/data_provider/.settings/org.maven.ide.eclipse.prefs (rev 0) +++ trunk/data_provider/.settings/org.maven.ide.eclipse.prefs 2009-10-12 23:12:11 UTC (rev 192) @@ -0,0 +1,9 @@ +#Mon Oct 12 12:48:36 EDT 2009 +activeProfiles= +eclipse.preferences.version=1 +fullBuildGoals=process-test-resources +includeModules=false +resolveWorkspaceProjects=true +resourceFilterGoals=process-resources resources\:testResources +skipCompilerPlugin=true +version=1 Added: trunk/data_provider/data_provider_core/.classpath =================================================================== --- trunk/data_provider/data_provider_core/.classpath (rev 0) +++ trunk/data_provider/data_provider_core/.classpath 2009-10-12 23:12:11 UTC (rev 192) @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" output="target/classes" path="src/main/java"/> + <classpathentry kind="src" output="target/test-classes" path="src/test/java"/> + <classpathentry kind="src" path="src/main/resources"/> + <classpathentry kind="src" path="src/test/resources"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/> + <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/> + <classpathentry kind="output" path="target/classes"/> +</classpath> Added: trunk/data_provider/data_provider_core/.project =================================================================== --- trunk/data_provider/data_provider_core/.project (rev 0) +++ trunk/data_provider/data_provider_core/.project 2009-10-12 23:12:11 UTC (rev 192) @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>data_provider_core</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.wst.common.project.facet.core.builder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.maven.ide.eclipse.maven2Builder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.wst.validation.validationbuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jem.workbench.JavaEMFNature</nature> + <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + <nature>org.maven.ide.eclipse.maven2Nature</nature> + <nature>org.eclipse.wst.common.project.facet.core.nature</nature> + </natures> +</projectDescription> Added: trunk/data_provider/data_provider_core/.settings/org.eclipse.jdt.core.prefs =================================================================== --- trunk/data_provider/data_provider_core/.settings/org.eclipse.jdt.core.prefs (rev 0) +++ trunk/data_provider/data_provider_core/.settings/org.eclipse.jdt.core.prefs 2009-10-12 23:12:11 UTC (rev 192) @@ -0,0 +1,7 @@ +#Mon Oct 12 16:25:16 EDT 2009 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2 +org.eclipse.jdt.core.compiler.compliance=1.4 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning +org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning +org.eclipse.jdt.core.compiler.source=1.3 Added: trunk/data_provider/data_provider_core/.settings/org.eclipse.wst.common.component =================================================================== --- trunk/data_provider/data_provider_core/.settings/org.eclipse.wst.common.component (rev 0) +++ trunk/data_provider/data_provider_core/.settings/org.eclipse.wst.common.component 2009-10-12 23:12:11 UTC (rev 192) @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project-modules id="moduleCoreId" project-version="1.5.0"> + <wb-module deploy-name="data_provider_core"> + <wb-resource deploy-path="/" source-path="/src/main/java"/> + <wb-resource deploy-path="/" source-path="/src/main/resource"/> + <wb-resource deploy-path="/" source-path="/src/test/resources"/> + <wb-resource deploy-path="/" source-path="/src/main/resources"/> + </wb-module> +</project-modules> Added: trunk/data_provider/data_provider_core/.settings/org.eclipse.wst.common.project.facet.core.xml =================================================================== --- trunk/data_provider/data_provider_core/.settings/org.eclipse.wst.common.project.facet.core.xml (rev 0) +++ trunk/data_provider/data_provider_core/.settings/org.eclipse.wst.common.project.facet.core.xml 2009-10-12 23:12:11 UTC (rev 192) @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<faceted-project> + <installed facet="jst.java" version="1.4"/> + <installed facet="jst.utility" version="1.0"/> +</faceted-project> Added: trunk/data_provider/data_provider_core/.settings/org.maven.ide.eclipse.prefs =================================================================== --- trunk/data_provider/data_provider_core/.settings/org.maven.ide.eclipse.prefs (rev 0) +++ trunk/data_provider/data_provider_core/.settings/org.maven.ide.eclipse.prefs 2009-10-12 23:12:11 UTC (rev 192) @@ -0,0 +1,9 @@ +#Mon Oct 12 12:55:06 EDT 2009 +activeProfiles= +eclipse.preferences.version=1 +fullBuildGoals=process-test-resources +includeModules=false +resolveWorkspaceProjects=true +resourceFilterGoals=process-resources resources\:testResources +skipCompilerPlugin=true +version=1 Added: trunk/data_provider/data_provider_core/pom.xml =================================================================== --- trunk/data_provider/data_provider_core/pom.xml (rev 0) +++ trunk/data_provider/data_provider_core/pom.xml 2009-10-12 23:12:11 UTC (rev 192) @@ -0,0 +1,164 @@ +<?xml version="1.0" encoding="UTF-8"?><project> + <parent> + <artifactId>data_provider</artifactId> + <groupId>org.treebase.oai</groupId> + <version>0.0.1-SNAPSHOT</version> + </parent> + <modelVersion>4.0.0</modelVersion> + <groupId>org.treebase.oai</groupId> + <artifactId>data_provider_core</artifactId> + <packaging>jar</packaging> + <name>data_provider_core</name> + <version>0.0.1-SNAPSHOT</version> + <url>http://maven.apache.org</url> + + <build> + <defaultGoal>install</defaultGoal> + </build> + + <dependencies> + + <dependency> + <groupId>postgresql</groupId> + <artifactId>postgresql</artifactId> + <version>8.3-603.jdbc3</version> + </dependency> + + + <dependency> + <groupId>org.acegisecurity</groupId> + <artifactId>acegi-security</artifactId> + <version>1.0.1</version> + <exclusions> + <!-- Maven thinks 2.0 is newer than 2.1--> + <exclusion> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + </exclusion> + <!-- exclude older versions of Spring --> + <exclusion> + <groupId>org.springframework</groupId> + <artifactId>spring-remoting</artifactId> + </exclusion> + <exclusion> + <groupId>org.springframework</groupId> + <artifactId>spring-jdbc</artifactId> + </exclusion> + <exclusion> + <groupId>org.springframework</groupId> + <artifactId>spring-support</artifactId> + </exclusion> + </exclusions> + </dependency> + + <dependency> + <groupId>c3p0</groupId> + <artifactId>c3p0</artifactId> + <version>0.9.1.2</version> + </dependency> + + + <dependency> + <groupId>org.hibernate</groupId> + <artifactId>hibernate-annotations</artifactId> + <version>3.3.1.GA</version> + <exclusions> + <exclusion> + <groupId>asm</groupId> + <artifactId>asm</artifactId> + </exclusion> + <exclusion> + <groupId>asm</groupId> + <artifactId>asm-attrs</artifactId> + </exclusion> + <exclusion> + <groupId>cglib</groupId> + <artifactId>cglib</artifactId> + </exclusion> + </exclusions> + </dependency> + + <dependency> + <groupId>cglib</groupId> + <artifactId>cglib-nodep</artifactId> + <version>2.1_3</version> + </dependency> + + <dependency> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + <version>2.1</version> + </dependency> + + <dependency> + <groupId>ibm</groupId> + <artifactId>db2jcc</artifactId> + <version>2.6.80</version> + </dependency> + + + + <dependency> + <groupId>jdom</groupId> + <artifactId>jdom</artifactId> + <version>1.1</version> + </dependency> + + <dependency> + <groupId>org.apache.cxf</groupId> + <artifactId>cxf-rt-frontend-jaxws</artifactId> + <version>2.1.1</version> + <exclusions> + <exclusion> + <groupId>asm</groupId> + <artifactId>asm</artifactId> + </exclusion> + + <exclusion> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-jdk14</artifactId> + </exclusion> + </exclusions> + </dependency> + + <dependency> + <groupId>org.apache.cxf</groupId> + <artifactId>cxf-rt-transports-http</artifactId> + <version>2.1.1</version> + <exclusions> + <exclusion> + <groupId>asm</groupId> + <artifactId>asm</artifactId> + </exclusion> + + <exclusion> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-jdk14</artifactId> + </exclusion> + </exclusions> + </dependency> + + <dependency> + <groupId>org.apache.cxf</groupId> + <artifactId>cxf-rt-transports-http-jetty</artifactId> + <version>2.1.1</version> + <exclusions> + <exclusion> + <groupId>asm</groupId> + <artifactId>asm</artifactId> + </exclusion> + <exclusion> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-jdk14</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>dom4j</groupId> + <artifactId>dom4j</artifactId> + <version>1.6.1</version> + </dependency> + + </dependencies> + +</project> \ No newline at end of file Added: trunk/data_provider/data_provider_core/src/main/java/META-INF/MANIFEST.MF =================================================================== --- trunk/data_provider/data_provider_core/src/main/java/META-INF/MANIFEST.MF (rev 0) +++ trunk/data_provider/data_provider_core/src/main/java/META-INF/MANIFEST.MF 2009-10-12 23:12:11 UTC (rev 192) @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Class-Path: + Added: trunk/data_provider/data_provider_core/src/main/java/org/treebase/oai/App.java =================================================================== --- trunk/data_provider/data_provider_core/src/main/java/org/treebase/oai/App.java (rev 0) +++ trunk/data_provider/data_provider_core/src/main/java/org/treebase/oai/App.java 2009-10-12 23:12:11 UTC (rev 192) @@ -0,0 +1,13 @@ +package org.treebase.oai; + +/** + * Hello world! + * + */ +public class App +{ + public static void main( String[] args ) + { + System.out.println( "Hello World!" ); + } +} Added: trunk/data_provider/data_provider_core/src/test/java/org/treebase/oai/AppTest.java =================================================================== --- trunk/data_provider/data_provider_core/src/test/java/org/treebase/oai/AppTest.java (rev 0) +++ trunk/data_provider/data_provider_core/src/test/java/org/treebase/oai/AppTest.java 2009-10-12 23:12:11 UTC (rev 192) @@ -0,0 +1,38 @@ +package org.treebase.oai; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + */ +public class AppTest + extends TestCase +{ + /** + * Create the test case + * + * @param testName name of the test case + */ + public AppTest( String testName ) + { + super( testName ); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( AppTest.class ); + } + + /** + * Rigourous Test :-) + */ + public void testApp() + { + assertTrue( true ); + } +} Added: trunk/data_provider/data_provider_core/target/classes/META-INF/MANIFEST.MF =================================================================== --- trunk/data_provider/data_provider_core/target/classes/META-INF/MANIFEST.MF (rev 0) +++ trunk/data_provider/data_provider_core/target/classes/META-INF/MANIFEST.MF 2009-10-12 23:12:11 UTC (rev 192) @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Class-Path: + Added: trunk/data_provider/data_provider_core/target/classes/org/treebase/oai/App.class =================================================================== (Binary files differ) Property changes on: trunk/data_provider/data_provider_core/target/classes/org/treebase/oai/App.class ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/data_provider/data_provider_core/target/test-classes/org/treebase/oai/AppTest.class =================================================================== (Binary files differ) Property changes on: trunk/data_provider/data_provider_core/target/test-classes/org/treebase/oai/AppTest.class ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/data_provider/data_provider_web/.classpath =================================================================== --- trunk/data_provider/data_provider_web/.classpath (rev 0) +++ trunk/data_provider/data_provider_web/.classpath 2009-10-12 23:12:11 UTC (rev 192) @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/> + <classpathentry kind="src" path="src/main/java"/> + <classpathentry kind="src" path="src/test/java"/> + <classpathentry kind="src" path="src/test/resources"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"> + <attributes> + <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/> + </attributes> + </classpathentry> + <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/> + <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/> + <classpathentry kind="output" path="target/classes"/> +</classpath> Added: trunk/data_provider/data_provider_web/.project =================================================================== --- trunk/data_provider/data_provider_web/.project (rev 0) +++ trunk/data_provider/data_provider_web/.project 2009-10-12 23:12:11 UTC (rev 192) @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>data_provider_web</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.wst.jsdt.core.javascriptValidator</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.wst.common.project.facet.core.builder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.wst.validation.validationbuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.maven.ide.eclipse.maven2Builder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jem.workbench.JavaEMFNature</nature> + <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + <nature>org.maven.ide.eclipse.maven2Nature</nature> + <nature>org.eclipse.wst.common.project.facet.core.nature</nature> + <nature>org.eclipse.wst.jsdt.core.jsNature</nature> + </natures> +</projectDescription> Added: trunk/data_provider/data_provider_web/.settings/.jsdtscope =================================================================== --- trunk/data_provider/data_provider_web/.settings/.jsdtscope (rev 0) +++ trunk/data_provider/data_provider_web/.settings/.jsdtscope 2009-10-12 23:12:11 UTC (rev 192) @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/> + <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject"> + <attributes> + <attribute name="hide" value="true"/> + </attributes> + </classpathentry> + <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/> + <classpathentry kind="output" path=""/> +</classpath> Added: trunk/data_provider/data_provider_web/.settings/org.eclipse.jdt.core.prefs =================================================================== --- trunk/data_provider/data_provider_web/.settings/org.eclipse.jdt.core.prefs (rev 0) +++ trunk/data_provider/data_provider_web/.settings/org.eclipse.jdt.core.prefs 2009-10-12 23:12:11 UTC (rev 192) @@ -0,0 +1,7 @@ +#Mon Oct 12 12:59:49 EDT 2009 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2 +org.eclipse.jdt.core.compiler.compliance=1.4 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning +org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning +org.eclipse.jdt.core.compiler.source=1.3 Added: trunk/data_provider/data_provider_web/.settings/org.eclipse.wst.common.component =================================================================== --- trunk/data_provider/data_provider_web/.settings/org.eclipse.wst.common.component (rev 0) +++ trunk/data_provider/data_provider_web/.settings/org.eclipse.wst.common.component 2009-10-12 23:12:11 UTC (rev 192) @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project-modules id="moduleCoreId" project-version="1.5.0"> + <wb-module deploy-name="data_provider_web"> + <wb-resource deploy-path="/" source-path="/src/main/webapp"/> + <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/> + <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/> + <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/test/java"/> + <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/test/resources"/> + <dependent-module deploy-path="/WEB-INF/lib" handle="module:/resource/data_provider_core/data_provider_core"> + <dependency-type>uses</dependency-type> + </dependent-module> + <property name="context-root" value="data_provider_web"/> + <property name="java-output-path"/> + </wb-module> +</project-modules> Added: trunk/data_provider/data_provider_web/.settings/org.eclipse.wst.common.project.facet.core.xml =================================================================== --- trunk/data_provider/data_provider_web/.settings/org.eclipse.wst.common.project.facet.core.xml (rev 0) +++ trunk/data_provider/data_provider_web/.settings/org.eclipse.wst.common.project.facet.core.xml 2009-10-12 23:12:11 UTC (rev 192) @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<faceted-project> + <installed facet="jst.java" version="1.4"/> + <installed facet="jst.web" version="2.3"/> +</faceted-project> Added: trunk/data_provider/data_provider_web/.settings/org.eclipse.wst.jsdt.ui.superType.container =================================================================== --- trunk/data_provider/data_provider_web/.settings/org.eclipse.wst.jsdt.ui.superType.container (rev 0) +++ trunk/data_provider/data_provider_web/.settings/org.eclipse.wst.jsdt.ui.superType.container 2009-10-12 23:12:11 UTC (rev 192) @@ -0,0 +1 @@ +org.eclipse.wst.jsdt.launching.baseBrowserLibrary \ No newline at end of file Added: trunk/data_provider/data_provider_web/.settings/org.eclipse.wst.jsdt.ui.superType.name =================================================================== --- trunk/data_provider/data_provider_web/.settings/org.eclipse.wst.jsdt.ui.superType.name (rev 0) +++ trunk/data_provider/data_provider_web/.settings/org.eclipse.wst.jsdt.ui.superType.name 2009-10-12 23:12:11 UTC (rev 192) @@ -0,0 +1 @@ +Window \ No newline at end of file Added: trunk/data_provider/data_provider_web/.settings/org.maven.ide.eclipse.prefs =================================================================== --- trunk/data_provider/data_provider_web/.settings/org.maven.ide.eclipse.prefs (rev 0) +++ trunk/data_provider/data_provider_web/.settings/org.maven.ide.eclipse.prefs 2009-10-12 23:12:11 UTC (rev 192) @@ -0,0 +1,9 @@ +#Mon Oct 12 12:59:49 EDT 2009 +activeProfiles= +eclipse.preferences.version=1 +fullBuildGoals=process-test-resources +includeModules=false +resolveWorkspaceProjects=true +resourceFilterGoals=process-resources resources\:testResources +skipCompilerPlugin=true +version=1 Added: trunk/data_provider/data_provider_web/pom.xml =================================================================== --- trunk/data_provider/data_provider_web/pom.xml (rev 0) +++ trunk/data_provider/data_provider_web/pom.xml 2009-10-12 23:12:11 UTC (rev 192) @@ -0,0 +1,299 @@ +<?xml version="1.0" encoding="UTF-8"?><project> + <parent> + <artifactId>data_provider</artifactId> + <groupId>org.treebase.oai</groupId> + <version>0.0.1-SNAPSHOT</version> + </parent> + <modelVersion>4.0.0</modelVersion> + <groupId>org.treebase.oai</groupId> + <artifactId>data_provider_web</artifactId> + <packaging>war</packaging> + <name>data_provider_web Maven Webapp</name> + <version>0.0.1-SNAPSHOT</version> + <url>http://maven.apache.org</url> + <build> + <defaultGoal>install</defaultGoal> + <resources> + <resource> + <directory>src/main/resources</directory> + </resource> + </resources> + <finalName>data_provider_web</finalName> + <plugins> + + <!-- Ant Task plugin--> + <plugin> + <artifactId>maven-antrun-plugin</artifactId> + <executions> + + <!-- make sure jdbc.properties is copied since it's not checked in --> + <execution> + <id>copy-jdbc-properties</id> + <phase>install</phase> + <configuration> + <tasks> + <copy todir="${basedir}/src/main/resources" + failonerror="true" verbose="true" overwrite="true"> + <fileset dir="${env.JDBC_HOME}"> + <include name="jdbc.properties"/> + </fileset> + </copy> + </tasks> + </configuration> + <goals><goal>run</goal></goals> + </execution> + + </executions> + </plugin> + + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>tomcat-maven-plugin</artifactId> + <version>1.0-SNAPSHOT</version> + </plugin> + + </plugins> + </build> + + <pluginRepositories> + <pluginRepository> + <id>Maven Snapshots</id> + <url>http://snapshots.maven.codehaus.org/maven2</url> + <snapshots><enabled>true</enabled></snapshots> + <releases><enabled>false</enabled></releases> + </pluginRepository> + </pluginRepositories> + + <dependencies> + + <dependency> + <groupId>org.treebase.oai</groupId> + <artifactId>data_provider_core</artifactId> + <version>0.0.1-SNAPSHOT</version> + </dependency> + + <dependency> + <groupId>javax.servlet</groupId> + <artifactId>jstl</artifactId> + <version>1.1.2</version> + </dependency> + <dependency> + <groupId>javax.mail</groupId> + <artifactId>mail</artifactId> + <version>1.4</version> + </dependency> + <dependency> + <groupId>xalan</groupId> + <artifactId>xalan</artifactId> + <version>2.7.0</version> + </dependency> + <dependency> + <groupId>commons-beanutils</groupId> + <artifactId>commons-beanutils</artifactId> + <version>1.7.0</version> + </dependency> + <dependency> + <groupId>commons-validator</groupId> + <artifactId>commons-validator</artifactId> + <version>1.1.4</version> + </dependency> + <dependency> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + <version>1.1</version> + </dependency> + <dependency> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + <version>2.3</version> + </dependency> + <dependency> + <groupId>taglibs</groupId> + <artifactId>standard</artifactId> + <version>1.1.2</version> + </dependency> + <dependency> + <groupId>taglibs</groupId> + <artifactId>string</artifactId> + <version>1.1.0</version> + </dependency> + <dependency> + <groupId>struts</groupId> + <artifactId>struts</artifactId> + <version>1.2.9</version> + </dependency> + <dependency> + <groupId>opensymphony</groupId> + <artifactId>sitemesh</artifactId> + <version>2.3</version> + </dependency> + <dependency> + <groupId>displaytag</groupId> + <artifactId>displaytag</artifactId> + <version>1.1.1</version> + </dependency> + <dependency> + <groupId>struts-menu</groupId> + <artifactId>struts-menu</artifactId> + <version>2.3</version> + + <exclusions> + <!-- Older versions are not needed --> + <exclusion> + <groupId>taglibs</groupId> + <artifactId>string</artifactId> + </exclusion> + + + <exclusion> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + </exclusion> + + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + + <exclusion> + <groupId>javax.servlet</groupId> + <artifactId>servlet-api</artifactId> + </exclusion> + + <exclusion> + <groupId>javax.servlet</groupId> + <artifactId>jstl</artifactId> + </exclusion> + + </exclusions> + + + </dependency> + <dependency> + <groupId>org.acegisecurity</groupId> + <artifactId>acegi-security</artifactId> + <version>1.0.1</version> + <exclusions> + <!-- exclude older versions of Spring --> + <exclusion> + <groupId>org.springframework</groupId> + <artifactId>spring-remoting</artifactId> + </exclusion> + <exclusion> + <groupId>org.springframework</groupId> + <artifactId>spring-jdbc</artifactId> + </exclusion> + <exclusion> + <groupId>org.springframework</groupId> + <artifactId>spring-support</artifactId> + </exclusion> + <exclusion> + <groupId>org.springframework</groupId> + <artifactId>spring-mock</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>springmodules</groupId> + <artifactId>springmodules-validator</artifactId> + <version>0.1</version> + </dependency> + <dependency> + <groupId>commons-fileupload</groupId> + <artifactId>commons-fileupload</artifactId> + <version>1.2</version> + + <exclusions> + <exclusion> + <groupId>javax.servlet</groupId> + <artifactId>servlet-api</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>commons-io</groupId> + <artifactId>commons-io</artifactId> + <version>1.3</version> + </dependency> + <dependency> + <groupId>org.directwebremoting</groupId> + <artifactId>dwr</artifactId> + <version>2.0.rc2</version> + <exclusions> + <exclusion> + <groupId>org.springframework</groupId> + <artifactId>spring</artifactId> + </exclusion> + <exclusion> + <groupId>org.hibernate</groupId> + <artifactId>hibernate</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>jmock</groupId> + <artifactId>jmock</artifactId> + <version>1.0.1</version> + </dependency> + <dependency> + <groupId>javax.xml.soap</groupId> + <artifactId>saaj-api</artifactId> + <version>1.3</version> + <scope>runtime</scope> + </dependency> + <dependency> + <groupId>zing.z3950.org</groupId> + <artifactId>cql-java</artifactId> + <version>1.0</version> + </dependency> + <dependency> + <groupId>javax.servlet</groupId> + <artifactId>servlet-api</artifactId> + <version>2.4</version> + </dependency> + + <!-- used by Spring framework --> + <!--Older ersion not needed--> + <!-- Commented on April 23, 2008 Madhu--> + <!--dependency> + <groupId>javax.activation</groupId> + <artifactId>activation</artifactId> + <version>1.1</version> + </dependency--> + + <!-- used by Spring framework --> + + <!-- Jin 05/12/08: do we need xalan? dependency--> + + <!-- remove 05/13/08 to avoid xml parser conflicts> + <dependency> + <groupId>org.springframework.ws</groupId> + <artifactId>spring-ws-core</artifactId> + <version>1.0.2</version> + </dependency> + --> + + <!-- remove 05/13/08 to avoid xml parser conflicts.> + <dependency> + <groupId>jaxen</groupId> + <artifactId>jaxen</artifactId> + <version>1.1</version> + </dependency> + --> + + <!--commented on April 23, 2008 Madhu--> + <!--dependency> + <groupId>com.sun.xml.messaging.saaj</groupId> + <artifactId>saaj-impl</artifactId> + <version>1.3</version> + <scope>runtime</scope> + </dependency--> + + + </dependencies> + <dependencyManagement> + <dependencies> + </dependencies> + </dependencyManagement> + +</project> \ No newline at end of file Added: trunk/data_provider/data_provider_web/src/main/webapp/META-INF/MANIFEST.MF =================================================================== --- trunk/data_provider/data_provider_web/src/main/webapp/META-INF/MANIFEST.MF (rev 0) +++ trunk/data_provider/data_provider_web/src/main/webapp/META-INF/MANIFEST.MF 2009-10-12 23:12:11 UTC (rev 192) @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Class-Path: + Added: trunk/data_provider/data_provider_web/src/main/webapp/WEB-INF/web.xml =================================================================== --- trunk/data_provider/data_provider_web/src/main/webapp/WEB-INF/web.xml (rev 0) +++ trunk/data_provider/data_provider_web/src/main/webapp/WEB-INF/web.xml 2009-10-12 23:12:11 UTC (rev 192) @@ -0,0 +1,7 @@ +<!DOCTYPE web-app PUBLIC + "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" + "http://java.sun.com/dtd/web-app_2_3.dtd" > + +<web-app> + <display-name>Archetype Created Web Application</display-name> +</web-app> Added: trunk/data_provider/data_provider_web/src/main/webapp/index.jsp =================================================================== --- trunk/data_provider/data_provider_web/src/main/webapp/index.jsp (rev 0) +++ trunk/data_provider/data_provider_web/src/main/webapp/index.jsp 2009-10-12 23:12:11 UTC (rev 192) @@ -0,0 +1,5 @@ +<html> +<body> +<h2>Hello World!</h2> +</body> +</html> Added: trunk/data_provider/pom.xml =================================================================== --- trunk/data_provider/pom.xml (rev 0) +++ trunk/data_provider/pom.xml 2009-10-12 23:12:11 UTC (rev 192) @@ -0,0 +1,271 @@ +<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"> + <modelVersion>4.0.0</modelVersion> + <groupId>org.treebase.oai</groupId> + <artifactId>data_provider</artifactId> + <packaging>pom</packaging> + <version>0.0.1-SNAPSHOT</version> + <name>data_provider</name> + <url>http://maven.apache.org</url> + <!-- issueManagement> + <system>FogBugz</system> + <url>https://www.xxx.org/bugz</url> + </issueManagement--> + <!-- inceptionYear></inceptionYear--> + <!-- scm> + <connection>scm:svn:http://nladr-cvs.sdsc.edu/svn/CIPRES/treebase/trunk</connection> + <developerConnection>scm:svn:http://nladr-cvs.sdsc.edu/svn/CIPRES/treebase/trunk</developerConnection> + <url>http://nladr-cvs.sdsc.edu/svn/cipresdev/trunk</url> + </scm--> + <!-- mailingLists> + <mailingList> + <name>treebase-dev</name> + <subscribe></subscribe> + <unsubscribe></unsubscribe> + <archive></archive> + </mailingList> + </mailingLists --> + <developers> + <developer> + <id>youjun</id> + <name>Youjun Guo</name> + <email>you...@ya...</email> + <organization>Peabody.Yale</organization> + <organizationUrl>http://www.yale.edu</organizationUrl> + <roles> + <role>developer</role> + </roles> + <timezone>-7</timezone> + </developer> + </developers> + <licenses> + <license> + <name></name> + <url></url> + <distribution></distribution> + <comments/> + </license> + </licenses> + <modules> + <module>data_provider_core</module> + <module>data_provider_web</module> + </modules> +<pluginRepositories> + </pluginRepositories> + <dependencies> + + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring</artifactId> + <version>2.0.7</version> + </dependency> + + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-mock</artifactId> + <version>2.0.7</version> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.8.1</version> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + <version>1.2.13</version> + </dependency> + + </dependencies> + + <reporting> + <plugins> + <plugin> + <artifactId>maven-surefire-report-plugin</artifactId> + </plugin> + <plugin> + <artifactId>maven-clover-plugin</artifactId> + </plugin> + <!-- plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jxr-plugin</artifactId> + </plugin --> + <!-- plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-javadoc-plugin</artifactId> + <configuration> + <links> + <link>http://java.sun.com/j2se/1.4.2/docs/api</link> + <link>http://plexus.codehaus.org/ref/1.0-alpha-9/apidocs</link> + </links> + <aggregate>true</aggregate> + </configuration> + </plugin --> + <!-- plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-pmd-plugin</artifactId> + <configuration> + <targetjdk>1.5</targetjdk> + <rulesets> + <ruleset>/rulesets/basic.xml</ruleset> + <ruleset>/rulesets/imports.xml</ruleset> + <ruleset>/rulesets/unusedcode.xml</ruleset> + <ruleset>/rulesets/finalizers.xml</ruleset> + </rulesets> + <format>xml</format> + <linkXref>true</linkXref> + <sourceEncoding>utf-8</sourceEncoding> + <minimumTokens>100</minimumTokens> + </configuration> + </plugin --> + <!-- plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-checkstyle-plugin</artifactId> + <configuration> + <configLocation>config/maven_checks.xml</configLocation> + </configuration> + </plugin --> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>taglist-maven-plugin</artifactId> + <configuration> + <tags> + <tag>TODO</tag> + <tag>@todo</tag> + <tag>FIXME</tag> + <tag>XXX</tag> + </tags> + </configuration> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>cobertura-maven-plugin</artifactId> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-project-info-reports-plugin</artifactId> + </plugin> + </plugins> + </reporting> + + <dependencyManagement> + <dependencies> + <dependency> + <groupId>org.treebase.oai</groupId> + <artifactId>data_provider_core</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.treebase.oai</groupId> + <artifactId>data_provider_web</artifactId> + <version>${project.version}</version> + </dependency> + </dependencies> + </dependencyManagement> + + <organization> + <name></name> + <url></url> + </organization> + + <!-- order of repositories used to compile the project --> + <repositories> + <repository> + <id>m2.remote.repos</id> + <name>Maven 2 Remote Repository</name> + <url>http://treebase.sourceforge.net/maven2/</url> + </repository> + <repository> + <id>maven2</id> + <name>Default Maven2 Repository</name> + <url>http://repo1.maven.org/maven2</url> + </repository> + <repository> + <id>repository.jboss.org</id> + <name>JBoss Maven Repository</name> + <url>http://repository.jboss.org/maven2</url> + <layout>default</layout> + </repository> + <repository> + <id>postgresql</id> + <url>http://jdbc.postgresql.org</url> + </repository> + </repositories> + <!-- make sure java 1.5 is used for annotations support --> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <configuration> + <source>1.5</source> + <target>1.5</target> + </configuration> + </plugin> + </plugins> + </build> + + <distributionManagement> + <site> + <id>website</id> + <url></url> + </site> + </distributionManagement> + + <profiles> + + <!--profile> + <id>xxx</id> + <activation> + <property> + <name>enablexxxprofile</name> + <value>true</value> + </property> + </activation> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-pmd-plugin</artifactId> + <executions> + <execution> + <goals> + <goal>check</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>cobertura-maven-plugin</artifactId> + <configuration> + <check> + <totalLineRate>80</totalLineRate> + <totalBranchRate>100</totalBranchRate> + </check> + </configuration> + <executions> + <execution> + <id>clean</id> + <goals> + <goal>clean</goal> + </goals> + </execution> + <execution> + <id>check</id> + <goals> + <goal>check</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile--> + + </profiles> +</project> Added: trunk/data_provider/target/classes/org/treebase/oai/data_provider/App.class =================================================================== (Binary files differ) Property changes on: trunk/data_provider/target/classes/org/treebase/oai/data_provider/App.class ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/data_provider/target/test-classes/org/treebase/oai/data_provider/AppTest.class =================================================================== (Binary files differ) Property changes on: trunk/data_provider/target/test-classes/org/treebase/oai/data_provider/AppTest.class ___________________________________________________________________ Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yo...@us...> - 2009-10-14 00:09:14
|
Revision: 197 http://treebase.svn.sourceforge.net/treebase/?rev=197&view=rev Author: youjun Date: 2009-10-14 00:09:08 +0000 (Wed, 14 Oct 2009) Log Message: ----------- Added Paths: ----------- trunk/oai-pmh_data_provider/ Removed Paths: ------------- trunk/oai-pmh_data_provider/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2009-11-04 17:04:42
|
Revision: 249 http://treebase.svn.sourceforge.net/treebase/?rev=249&view=rev Author: rvos Date: 2009-11-04 17:04:34 +0000 (Wed, 04 Nov 2009) Log Message: ----------- Cleaned up maven pom.xml files Modified Paths: -------------- trunk/pom.xml trunk/treebase-core/pom.xml trunk/treebase-web/pom.xml Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2009-11-04 16:54:08 UTC (rev 248) +++ trunk/pom.xml 2009-11-04 17:04:34 UTC (rev 249) @@ -7,81 +7,69 @@ <artifactId>treebase</artifactId> <packaging>pom</packaging> <version>1.0-SNAPSHOT</version> - <url>http://www.phylo.org/treebase/index.php</url> + <url>https://sourceforge.net/projects/treebase/</url> <issueManagement> - <system>FogBugz</system> - <url>https://www.ngbw.org/ngbugz</url> + <system>SourceForge</system> + <url>https://sourceforge.net/tracker/?group_id=248804</url> </issueManagement> <inceptionYear>2005</inceptionYear> <scm> - <connection>scm:svn:http://nladr-cvs.sdsc.edu/svn/CIPRES/treebase/trunk</connection> - <developerConnection>scm:svn:http://nladr-cvs.sdsc.edu/svn/CIPRES/treebase/trunk</developerConnection> - <url>http://nladr-cvs.sdsc.edu/svn/cipresdev/trunk</url> + <connection>scm:svn:https://treebase.svn.sourceforge.net/svnroot/treebase/trunk</connection> + <developerConnection>scm:svn:https://treebase.svn.sourceforge.net/svnroot/treebase/trunk</developerConnection> + <url>http://treebase.svn.sourceforge.net/viewvc/treebase/trunk</url> </scm> - <!-- mailingLists> + <mailingLists> + <mailingList> - <name>cipres-dev</name> - <subscribe>https://lists.sdsc.edu/mailman/listinfo.cgi/cipres</subscribe> - <unsubscribe>https://lists.sdsc.edu/mailman/listinfo.cgi/cipres</unsubscribe> - <archive>https://lists.sdsc.edu/mailman/listinfo.cgi/cipres</archive> + <name>treebase-devel</name> + <subscribe>https://lists.sourceforge.net/lists/listinfo/treebase-devel</subscribe> + <unsubscribe>https://lists.sourceforge.net/lists/listinfo/treebase-devel</unsubscribe> + <archive>https://sourceforge.net/mailarchive/forum.php?forum_name=treebase-devel</archive> </mailingList> - </mailingLists --> + + <mailingList> + <name>treebase-guts</name> + <subscribe>https://lists.sourceforge.net/lists/listinfo/treebase-guts</subscribe> + <unsubscribe>https://lists.sourceforge.net/lists/listinfo/treebase-guts</unsubscribe> + <archive>https://sourceforge.net/mailarchive/forum.php?forum_name=treebase-guts</archive> + </mailingList> + + <mailingList> + <name>treebase-users</name> + <subscribe>https://lists.sourceforge.net/lists/listinfo/treebase-users</subscribe> + <unsubscribe>https://lists.sourceforge.net/lists/listinfo/treebase-users</unsubscribe> + <archive>https://sourceforge.net/mailarchive/forum.php?forum_name=treebase-users</archive> + </mailingList> + + </mailingLists> <developers> - <developer> - <id>lcchan</id> - <name>Lucie Chan</name> - <email>lc...@sd...</email> - <organization>SDSC</organization> - <organizationUrl>http://www.sdsc.edu</organizationUrl> - <roles> - <role>developer</role> - </roles> - <timezone>-7</timezone> - </developer> - <developer> - <id>jin</id> - <name>Jin Ruan</name> - <email>jr...@sd...</email> - <organization>SDSC</organization> - <roles> - <role>developer</role> - </roles> - </developer> - <developer> - <id>madhu</id> - <name>Madhusudan</name> - <email>ma...@sd...</email> - <organization>SDSC</organization> - <roles> - <role>developer</role> - </roles> - </developer> - <developer> - <id>mjd</id> - <name>Mark Jason Dominus</name> - <email>mj...@ge...</email> - <organization>Penn Genome Frontiers Institute</organization> - <organizationUrl>http://www.genomics.upenn.edu</organizationUrl> - <roles> - <role>developer</role> - </roles> - <timezone>-5</timezone> - </developer> + <developer> - <id>rvosa</id> - <name>Rutger Vos</name> - <email>rut...@gm...</email> - <organization>University of British Columbia</organization> - <organizationUrl>http://www.ubc.ca</organizationUrl> - <timezone>-7</timezone> - <roles> - <role>developer</role> - </roles> + + <id>rvosa</id> + + <name>Rutger Vos</name> + + <email>rut...@gm...</email> + + <organization>University of Reading</organization> + + <organizationUrl>http://www.reading.ac.uk</organizationUrl> + + <timezone>0</timezone> + + <roles> + + <role>developer</role> + + </roles> + </developer> + </developers> <licenses> <license> - <name>UCSD</name> + <name>BSD</name> <url>LICENSE.txt</url> <distribution>manual</distribution> <comments/> @@ -123,51 +111,15 @@ <reporting> <plugins> + <plugin> <artifactId>maven-surefire-report-plugin</artifactId> </plugin> + <plugin> <artifactId>maven-clover-plugin</artifactId> </plugin> - <!-- plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-jxr-plugin</artifactId> - </plugin --> - <!-- plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-javadoc-plugin</artifactId> - <configuration> - <links> - <link>http://java.sun.com/j2se/1.4.2/docs/api</link> - <link>http://plexus.codehaus.org/ref/1.0-alpha-9/apidocs</link> - </links> - <aggregate>true</aggregate> - </configuration> - </plugin --> - <!-- plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-pmd-plugin</artifactId> - <configuration> - <targetjdk>1.5</targetjdk> - <rulesets> - <ruleset>/rulesets/basic.xml</ruleset> - <ruleset>/rulesets/imports.xml</ruleset> - <ruleset>/rulesets/unusedcode.xml</ruleset> - <ruleset>/rulesets/finalizers.xml</ruleset> - </rulesets> - <format>xml</format> - <linkXref>true</linkXref> - <sourceEncoding>utf-8</sourceEncoding> - <minimumTokens>100</minimumTokens> - </configuration> - </plugin --> - <!-- plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-checkstyle-plugin</artifactId> - <configuration> - <configLocation>config/maven_checks.xml</configLocation> - </configuration> - </plugin --> + <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>taglist-maven-plugin</artifactId> @@ -180,56 +132,63 @@ </tags> </configuration> </plugin> + <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>cobertura-maven-plugin</artifactId> </plugin> + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-project-info-reports-plugin</artifactId> </plugin> + </plugins> </reporting> <dependencyManagement> <dependencies> - <dependency> - <groupId>org.cipres.treebase</groupId> - <artifactId>treebase-core</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>org.cipres.treebase</groupId> - <artifactId>treebase-web</artifactId> - <version>${project.version}</version> - </dependency> + + <dependency> + <groupId>org.cipres.treebase</groupId> + <artifactId>treebase-core</artifactId> + <version>${project.version}</version> + </dependency> + + <dependency> + <groupId>org.cipres.treebase</groupId> + <artifactId>treebase-web</artifactId> + <version>${project.version}</version> + </dependency> + </dependencies> </dependencyManagement> <organization> - <name>SDSC</name> - <url>http://biology.sdsc.edu</url> + <name>NESCent</name> + <url>http://www.nescent.org</url> </organization> + <!-- order of repositories used to compile the project --> <repositories> + <repository> - <id>m2.remote.repos</id> - <name>Maven 2 Remote Repository</name> - <url>http://8ball.sdsc.edu:9999/maven2</url> - </repository> - <repository> <id>maven2</id> <name>Default Maven2 Repository</name> <url>http://repo1.maven.org/maven2</url> </repository> + <repository> <id>repository.jboss.org</id> <name>JBoss Maven Repository</name> <url>http://repository.jboss.org/maven2</url> <layout>default</layout> </repository> + </repositories> + <!-- make sure java 1.5 is used for annotations support --> <build> <plugins> + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> @@ -238,16 +197,16 @@ <target>1.5</target> </configuration> </plugin> + </plugins> </build> <distributionManagement> <site> <id>website</id> - <!-- url>file:///var/www/html/sites/treebase</url --> <url>file:///var/www/html/sites/treebase</url> </site> </distributionManagement> -<profiles> + <profiles> <profile> <id>ciProfile</id> <activation> @@ -258,6 +217,7 @@ </activation> <build> <plugins> + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-pmd-plugin</artifactId> @@ -269,6 +229,7 @@ </execution> </executions> </plugin> + <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>cobertura-maven-plugin</artifactId> @@ -279,20 +240,24 @@ </check> </configuration> <executions> + <execution> <id>clean</id> <goals> <goal>clean</goal> </goals> </execution> + <execution> <id>check</id> <goals> <goal>check</goal> </goals> </execution> + </executions> </plugin> + </plugins> </build> </profile> Modified: trunk/treebase-core/pom.xml =================================================================== --- trunk/treebase-core/pom.xml 2009-11-04 16:54:08 UTC (rev 248) +++ trunk/treebase-core/pom.xml 2009-11-04 17:04:34 UTC (rev 249) @@ -1,323 +1,222 @@ -<project> - <modelVersion>4.0.0</modelVersion> - <groupId>org.cipres.treebase</groupId> - <artifactId>treebase-core</artifactId> - <packaging>jar</packaging> - <version>1.0-SNAPSHOT</version> - <name>Cipres-treebase-core</name> - <url>http://www.phylo.org</url> - <parent> - <groupId>org.cipres.treebase</groupId> - <artifactId>treebase</artifactId> - <version>1.0-SNAPSHOT</version> - </parent> +<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"> <modelVersion>4.0.0</modelVersion> + <groupId>org.cipres.treebase</groupId> + <artifactId>treebase-core</artifactId> + <packaging>jar</packaging> + <version>1.0-SNAPSHOT</version> + <name>treebase-core</name> + <url>https://sourceforge.net/projects/treebase/</url> + <parent> + <groupId>org.cipres.treebase</groupId> + <artifactId>treebase</artifactId> + <version>1.0-SNAPSHOT</version> + </parent> - <build> - <defaultGoal>install</defaultGoal> + <build> + <defaultGoal>install</defaultGoal> + </build> - <!-- the following doesn't work due to a bug in maven-install-plugin - in the latest maven 2.0.4: Cannot override read-only parameter - You'll need to install the following 2 cipres-dev jar files - from the command line so treebase-core can compile. - Refer to read.txt for more information. I leave the code - here in case maven fixes its bug in a future realease --> + <repositories> -<!-- - <plugins> + <repository> + <id>repository.jboss.org</id> + <name>JBoss Maven Repository</name> + <url>http://repository.jboss.org/maven2</url> + <layout>default</layout> + </repository> - <plugin> - <artifactId>maven-install-plugin</artifactId> - <executions> + <repository> + <id>maven2</id> + <name>Default Maven2 Repository</name> + <url>http://repo1.maven.org/maven2</url> + </repository> - <execution> - <id>copy-cipres-framework-jar</id> - <phase>install</phase> - <configuration> - <file>${env.CIPRES_ROOT}/lib/cipres/cipres_framework.jar</file> - <groupId>org.cipres</groupId> - <artifactId>framework</artifactId> - <version>1.0.1</version> - <packaging>jar</packaging> - </configuration> - <goals><goal>install</goal></goals> - </execution> + <repository> + <id>m2.remote.repos</id> + <name>Maven 2 Remote Repository</name> + <url>http://treebase.sourceforge.net/maven2/</url> + </repository> - <execution> - <id>copy-cipres-cipresapp-jar</id> - <phase>compile</phase> - <configuration> - <file>${env.CIPRES_ROOT}/lib/cipres/cipres_cipresapp.jar</file> - <groupId>org.cipres</groupId> - <artifactId>cipresapp</artifactId> - <version>1.0.1</version> - <packaging>jar</packaging> - </configuration> - <goals><goal>install</goal></goals> - </execution> - </executions> - </plugin> - </plugins> ---> - </build> + <repository> + <id>m2.nexml.repos</id> + <name>NeXML Remote Repository</name> + <url>http://nexml-dev.nescent.org/.m2/repository/</url> + </repository> -<!-- already defined in parent pom.xml --> - <repositories> - <repository> - <id>m2.nexml.repos</id> - <name>NeXML Remote Repository</name> - <url>http://nexml-dev.nescent.org/.m2/repository/</url> - </repository> - <repository> - <id>m2.remote.repos</id> - <name>Maven 2 Remote Repository</name> - <url>http://treebase.sourceforge.net/maven2/</url> - </repository> - <repository> - <id>maven2</id> - <name>Default Maven2 Repository</name> - <url>http://repo1.maven.org/maven2</url> - </repository> - <repository> - <id>repository.jboss.org</id> - <name>JBoss Maven Repository</name> - <url>http://repository.jboss.org/maven2</url> - <layout>default</layout> - </repository> - - </repositories> - + </repositories> + <dependencies> - <dependencies> - <dependency> - <groupId>org.acegisecurity</groupId> - <artifactId>acegi-security</artifactId> - <version>1.0.1</version> - <exclusions> - <!-- Maven thinks 2.0 is newer than 2.1--> - <exclusion> - <groupId>commons-lang</groupId> - <artifactId>commons-lang</artifactId> - </exclusion> - <!-- exclude older versions of Spring --> - <exclusion> - <groupId>org.springframework</groupId> - <artifactId>spring-remoting</artifactId> - </exclusion> - <exclusion> - <groupId>org.springframework</groupId> - <artifactId>spring-jdbc</artifactId> - </exclusion> - <exclusion> - <groupId>org.springframework</groupId> - <artifactId>spring-support</artifactId> - </exclusion> - </exclusions> - </dependency> + <dependency> + <groupId>org.acegisecurity</groupId> + <artifactId>acegi-security</artifactId> + <version>1.0.1</version> + <exclusions> + <!-- Maven thinks 2.0 is newer than 2.1--> + <exclusion> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + </exclusion> + <!-- exclude older versions of Spring --> + <exclusion> + <groupId>org.springframework</groupId> + <artifactId>spring-remoting</artifactId> + </exclusion> + <exclusion> + <groupId>org.springframework</groupId> + <artifactId>spring-jdbc</artifactId> + </exclusion> + <exclusion> + <groupId>org.springframework</groupId> + <artifactId>spring-support</artifactId> + </exclusion> + </exclusions> + </dependency> - <dependency> - <groupId>c3p0</groupId> - <artifactId>c3p0</artifactId> - <version>0.9.1.2</version> - </dependency> - - <dependency> - <groupId>org.nexml.model</groupId> - <artifactId>nexml</artifactId> - <version>1.5-SNAPSHOT</version> - </dependency> + <dependency> + <groupId>c3p0</groupId> + <artifactId>c3p0</artifactId> + <version>0.9.1.2</version> + </dependency> + + <dependency> + <groupId>org.nexml.model</groupId> + <artifactId>nexml</artifactId> + <version>1.5-SNAPSHOT</version> + </dependency> - <dependency> - <groupId>org.hibernate</groupId> - <artifactId>hibernate-annotations</artifactId> - <version>3.3.1.GA</version> - <exclusions> - <exclusion> - <groupId>asm</groupId> - <artifactId>asm</artifactId> - </exclusion> - <exclusion> - <groupId>asm</groupId> - <artifactId>asm-attrs</artifactId> - </exclusion> - <exclusion> - <groupId>cglib</groupId> - <artifactId>cglib</artifactId> - </exclusion> - </exclusions> - </dependency> - - <dependency> - <groupId>cglib</groupId> - <artifactId>cglib-nodep</artifactId> - <version>2.1_3</version> - </dependency> + <dependency> + <groupId>org.hibernate</groupId> + <artifactId>hibernate-annotations</artifactId> + <version>3.3.1.GA</version> + <exclusions> + <exclusion> + <groupId>asm</groupId> + <artifactId>asm</artifactId> + </exclusion> + <exclusion> + <groupId>asm</groupId> + <artifactId>asm-attrs</artifactId> + </exclusion> + <exclusion> + <groupId>cglib</groupId> + <artifactId>cglib</artifactId> + </exclusion> + </exclusions> + </dependency> - <!--dependency> // defined in hibernate - <groupId>javax.security</groupId> - <artifactId>jacc</artifactId> - <version>1.0</version> - </dependency--> - - <!-- dependency> - <groupId>javax.persistence</groupId> - <artifactId>ejb</artifactId> - <version>3.0-public-draft-20060327</version> - </dependency--> - - <dependency> - <groupId>commons-lang</groupId> - <artifactId>commons-lang</artifactId> - <version>2.1</version> - </dependency> + <dependency> + <groupId>cglib</groupId> + <artifactId>cglib-nodep</artifactId> + <version>2.1_3</version> + </dependency> -<!-- -we no longer use db2 - <dependency> - <groupId>ibm</groupId> - <artifactId>db2jcc</artifactId> - <version>2.6.80</version> - </dependency> ---> - <dependency> - <groupId>postgresql</groupId> - <artifactId>postgresql</artifactId> - <version>8.3-603.jdbc3</version> - </dependency> + <dependency> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + <version>2.1</version> + </dependency> + + <dependency> + <groupId>postgresql</groupId> + <artifactId>postgresql</artifactId> + <version>8.3-603.jdbc3</version> + </dependency> + + <dependency> + <groupId>mesquite</groupId> + <artifactId>mesquite</artifactId> + <version>2.01.tb</version> + </dependency> - <dependency> - <groupId>mesquite</groupId> - <artifactId>mesquite</artifactId> - <version>2.01.tb</version> - </dependency> + <dependency> + <groupId>org.cipres</groupId> + <artifactId>framework</artifactId> + <version>1.0.1</version> + <scope>compile</scope> + </dependency> - <dependency> - <groupId>org.cipres</groupId> - <artifactId>framework</artifactId> - <version>1.0.1</version> - <scope>compile</scope> - </dependency> - - <dependency> - <groupId>jdom</groupId> - <artifactId>jdom</artifactId> - <version>1.1</version> - </dependency> - - <dependency> - <groupId>org.apache.cxf</groupId> - <artifactId>cxf-rt-frontend-jaxws</artifactId> - <version>2.1.1</version> - <exclusions> - <exclusion> - <groupId>asm</groupId> - <artifactId>asm</artifactId> - </exclusion> - - <exclusion> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-jdk14</artifactId> - </exclusion> - </exclusions> - </dependency> - - <dependency> - <groupId>org.apache.cxf</groupId> - <artifactId>cxf-rt-transports-http</artifactId> - <version>2.1.1</version> - <exclusions> - <exclusion> - <groupId>asm</groupId> - <artifactId>asm</artifactId> - </exclusion> - - <exclusion> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-jdk14</artifactId> - </exclusion> - </exclusions> - </dependency> - - <dependency> - <groupId>org.apache.cxf</groupId> - <artifactId>cxf-rt-transports-http-jetty</artifactId> - <version>2.1.1</version> - <exclusions> - <exclusion> - <groupId>asm</groupId> - <artifactId>asm</artifactId> - </exclusion> - <exclusion> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-jdk14</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>dom4j</groupId> - <artifactId>dom4j</artifactId> - <version>1.6.1</version> - </dependency> + <dependency> + <groupId>jdom</groupId> + <artifactId>jdom</artifactId> + <version>1.1</version> + </dependency> + + <dependency> + <groupId>org.apache.cxf</groupId> + <artifactId>cxf-rt-frontend-jaxws</artifactId> + <version>2.1.1</version> + <exclusions> + <exclusion> + <groupId>asm</groupId> + <artifactId>asm</artifactId> + </exclusion> + + <exclusion> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-jdk14</artifactId> + </exclusion> + </exclusions> + </dependency> + + <dependency> + <groupId>org.apache.cxf</groupId> + <artifactId>cxf-rt-transports-http</artifactId> + <version>2.1.1</version> + <exclusions> + <exclusion> + <groupId>asm</groupId> + <artifactId>asm</artifactId> + </exclusion> + + <exclusion> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-jdk14</artifactId> + </exclusion> + </exclusions> + </dependency> + + <dependency> + <groupId>org.apache.cxf</groupId> + <artifactId>cxf-rt-transports-http-jetty</artifactId> + <version>2.1.1</version> + <exclusions> + <exclusion> + <groupId>asm</groupId> + <artifactId>asm</artifactId> + </exclusion> + <exclusion> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-jdk14</artifactId> + </exclusion> + </exclusions> + </dependency> - <dependency> - <groupId>javax.sql</groupId> - <artifactId>jdbc-stdext</artifactId> - <version>2.0</version> - </dependency> - <dependency> - <groupId>ibm</groupId> - <artifactId>db2jcc_license_cu</artifactId> - <version>2.6.80</version> - </dependency> - <dependency> - <groupId>ibm</groupId> - <artifactId>db2jcc</artifactId> - <version>2.6.80</version> - </dependency> - - <!--dependency> - <groupId>asm</groupId> - <artifactId>asm-all</artifactId> - <version>2.2.3</version> - </dependency--> - - <!--dependency> - <groupId>org.codehaus.xfire</groupId> - <artifactId>xfire-spring</artifactId> - <version>1.2.6</version> - </dependency--> - - <!--dependency> - <groupId>org.codehaus.xfire</groupId> - <artifactId>xfire-jaxws</artifactId> - <version>1.2.6</version> - <This exclusions was inserted on April 23, 2008 Madhu> - <Just to make sure that there is no XML parsing problem when was war file is created with maven> - <exclusions> - <exclusion> - <groupId>com.sun.xml.bind</groupId> - <artifactId>jaxb-xjc</artifactId> - </exclusion> - <exclusion> - <groupId>xml-apis</groupId> - <artifactId>xml-apis</artifactId> - </exclusion> - <exclusion> - <groupId>xerces</groupId> - <artifactId>xercesImpl</artifactId> - </exclusion> - </exclusions> - </dependency--> - - <!-- dependency> - <stax should be refered by xfire-core, but it does not work for some reason > - <groupId>stax</groupId> - <artifactId>stax</artifactId> - <version>1.2.0</version> - </dependency--> - - - - </dependencies> + <dependency> + <groupId>dom4j</groupId> + <artifactId>dom4j</artifactId> + <version>1.6.1</version> + </dependency> + + <dependency> + <groupId>javax.sql</groupId> + <artifactId>jdbc-stdext</artifactId> + <version>2.0</version> + </dependency> + + <dependency> + <groupId>ibm</groupId> + <artifactId>db2jcc_license_cu</artifactId> + <version>2.6.80</version> + </dependency> + + <dependency> + <groupId>ibm</groupId> + <artifactId>db2jcc</artifactId> + <version>2.6.80</version> + </dependency> + </dependencies> + </project> Modified: trunk/treebase-web/pom.xml =================================================================== --- trunk/treebase-web/pom.xml 2009-11-04 16:54:08 UTC (rev 248) +++ trunk/treebase-web/pom.xml 2009-11-04 17:04:34 UTC (rev 249) @@ -1,396 +1,312 @@ -<?xml version="1.0"?><project> - <parent> - <artifactId>treebase</artifactId> - <groupId>org.cipres.treebase</groupId> - <version>1.0-SNAPSHOT</version> - </parent> - <modelVersion>4.0.0</modelVersion> - <groupId>org.cipres.treebase</groupId> - <artifactId>treebase-web</artifactId> - <packaging>war</packaging> - <name>Cipres-treebase-web</name> - <version>1.0-SNAPSHOT</version> - <url>http://maven.apache.org</url> - <build> - <defaultGoal>install</defaultGoal> - <resources> - <resource> - <directory>src/main/resources</directory> - </resource> - </resources> - <finalName>treebase-web</finalName> - <plugins> +<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"> + <parent> + <artifactId>treebase</artifactId> + <groupId>org.cipres.treebase</groupId> + <version>1.0-SNAPSHOT</version> + </parent> + <modelVersion>4.0.0</modelVersion> + <groupId>org.cipres.treebase</groupId> + <artifactId>treebase-web</artifactId> + <packaging>war</packaging> + <name>treebase-web</name> + <version>1.0-SNAPSHOT</version> + <url>http://maven.apache.org</url> + <build> + <defaultGoal>install</defaultGoal> + <resources> + <resource> + <directory>src/main/resources</directory> + </resource> + </resources> + <finalName>treebase-web</finalName> + <plugins> - <!-- Ant Task plugin--> - <plugin> - <artifactId>maven-antrun-plugin</artifactId> - <executions> + <!-- Ant Task plugin--> + <plugin> + <artifactId>maven-antrun-plugin</artifactId> + <executions> + <!-- make sure jdbc.properties is copied since it's not checked in --> + <execution> + <id>copy-jdbc-properties</id> + <phase>install</phase> + <configuration> + <tasks> + <copy todir="${basedir}/src/main/resources" failonerror="true" + verbose="true" overwrite="true"> + <fileset dir="${env.JDBC_HOME}"> + <include name="jdbc.properties" /> + </fileset> + </copy> + </tasks> + </configuration> + <goals> + <goal>run</goal> + </goals> + </execution> + + </executions> + </plugin> + + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>tomcat-maven-plugin</artifactId> + <version>1.0-SNAPSHOT</version> + </plugin> + + </plugins> + </build> + <!-- already defined in parent pom.xml --> + <repositories> + + <repository> + <id>maven2</id> + <name>Default Maven2 Repository</name> + <url>http://repo1.maven.org/maven2</url> + </repository> + + <repository> + <id>m2.remote.repos</id> + <name>Maven 2 Remote Repository</name> + <url>http://treebase.sourceforge.net/maven2/</url> + </repository> + + <repository> + <id>m2.nexml.repos</id> + <name>NeXML Remote Repository</name> + <url>http://nexml-dev.nescent.org/.m2/repository/</url> + </repository> + + </repositories> + + <pluginRepositories> + <pluginRepository> + <id>Maven Snapshots</id> + <url>http://snapshots.maven.codehaus.org/maven2</url> + <snapshots> + <enabled>true</enabled> + </snapshots> + <releases> + <enabled>false</enabled> + </releases> + </pluginRepository> + </pluginRepositories> + + <dependencies> - <!-- make sure jdbc.properties is copied since it's not checked in --> - <execution> - <id>copy-jdbc-properties</id> - <phase>install</phase> - <configuration> - <tasks> - <copy todir="${basedir}/src/main/resources" - failonerror="true" verbose="true" overwrite="true"> - <fileset dir="${env.JDBC_HOME}"> - <include name="jdbc.properties"/> - </fileset> - </copy> - </tasks> - </configuration> - <goals><goal>run</goal></goals> - </execution> + <dependency> + <groupId>org.nexml.model</groupId> + <artifactId>nexml</artifactId> + <version>1.5-SNAPSHOT</version> + </dependency> + + <dependency> + <groupId>org.cipres.treebase</groupId> + <artifactId>treebase-core</artifactId> + <version>1.0-SNAPSHOT</version> + </dependency> - <!-- - <execution> - <id>copy-cipres-dev-resources</id> - <phase>install</phase> - <configuration> - <tasks> - <copy todir="${basedir}/src/main/resources" - failonerror="true" verbose="true" overwrite="true"> - <fileset dir="${env.CIPRES_ROOT}/resources"> - <include name="cipres_registry.xml"/> - <include name="cipres_config.properties"/> - </fileset> - </copy> - </tasks> - </configuration> - <goals><goal>run</goal></goals> - </execution> + <dependency> + <groupId>javax.servlet</groupId> + <artifactId>servlet-api</artifactId> + <version>2.4</version> + </dependency> - <execution> - <id>copy-cipres-jar</id> - <phase>install</phase> - <configuration> - <tasks> - <copy todir="${project.build.directory}/treebase-web/WEB-INF/lib"> - <copy todir="${basedir}/src/main/webapp/WEB-INF/lib"> - failonerror="true" verbose="true" overwrite="true"> - <fileset dir="${env.CIPRES_ROOT}/lib/cipres"> - <include name="cipres_cipresapp.jar"/> - <include name="cipres_framework.jar"/> - <include name="classpath.jar"/> - </fileset> - <fileset dir="${env.CIPRES_ROOT}/lib/activation/jars" includes="*.jar"/> - <fileset dir="${env.CIPRES_ROOT}/lib/axis/jars" includes="*.jar"/> - <fileset dir="${env.CIPRES_ROOT}/lib/castor/jars" includes="*.jar"/> - <fileset dir="${env.CIPRES_ROOT}/lib/commons-discovery/jars" includes="*.jar"/> - <fileset dir="${env.CIPRES_ROOT}/lib/commons-logging/jars" includes="*.jar"/> - <fileset dir="${env.CIPRES_ROOT}/lib/forester/jars" includes="*.jar"/> - <fileset dir="${env.CIPRES_ROOT}/lib/jacorb/jars" includes="*.jar"/> - <fileset dir="${env.CIPRES_ROOT}/lib/javahelp/jars" includes="*.jar"/> - <fileset dir="${env.CIPRES_ROOT}/lib/jbcl/jars" includes="*.jar"/> - <fileset dir="${env.CIPRES_ROOT}/lib/jcommon/jars" includes="*.jar"/> - <fileset dir="${env.CIPRES_ROOT}/lib/jep/jars" includes="*.jar"/> - <fileset dir="${env.CIPRES_ROOT}/lib/jfreechart/jars" includes="*.jar"/> - <fileset dir="${env.CIPRES_ROOT}/lib/junit/jars" includes="*.jar"/> - <fileset dir="${env.CIPRES_ROOT}/lib/log4j/jars" includes="*.jar"/> - <fileset dir="${env.CIPRES_ROOT}/lib/pal/jars" includes="*.jar"/> - <fileset dir="${env.CIPRES_ROOT}/lib/uddi4j/jars" includes="*.jar"/> - <fileset dir="${env.CIPRES_ROOT}/lib/wsdl4j/jars" includes="*.jar"/> - <fileset dir="${env.CIPRES_ROOT}/lib/xerces/jars" includes="*.jar"/> - <fileset dir="${env.CIPRES_ROOT}/lib/xml-apis/jars" includes="*.jar"/> - </copy> - </tasks> - </configuration> - <goals><goal>run</goal></goals> - </execution> - --> - - </executions> - </plugin> + <dependency> + <groupId>javax.servlet</groupId> + <artifactId>jstl</artifactId> + <version>1.1.2</version> + </dependency> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>tomcat-maven-plugin</artifactId> - <version>1.0-SNAPSHOT</version> - </plugin> - - </plugins> - </build> - <!-- already defined in parent pom.xml --> - <repositories> - <repository> - <id>m2.nexml.repos</id> - <name>NeXML Remote Repository</name> - <url>http://nexml-dev.nescent.org/.m2/repository/</url> - </repository> - <repository> - <id>m2.remote.repos</id> - <name>Maven 2 Remote Repository</name> - <url>http://treebase.sourceforge.net/maven2/</url> - </repository> - <repository> - <id>maven2</id> - <name>Default Maven2 Repository</name> - <url>http://repo1.maven.org/maven2</url> - </repository> - </repositories> + <!-- used by Spring framework --> + <dependency> + <groupId>javax.mail</groupId> + <artifactId>mail</artifactId> + <version>1.4</version> + </dependency> - <pluginRepositories> - <pluginRepository> - <id>Maven Snapshots</id> - <url>http://snapshots.maven.codehaus.org/maven2</url> - <snapshots><enabled>true</enabled></snapshots> - <releases><enabled>false</enabled></releases> - </pluginRepository> - </pluginRepositories> + <!-- Jin 05/12/08: do we need xalan? dependency--> + <dependency> + <groupId>xalan</groupId> + <artifactId>xalan</artifactId> + <version>2.7.0</version> + </dependency> - <dependencies> - - <dependency> - <groupId>org.nexml.model</groupId> - <artifactId>nexml</artifactId> - <version>1.5-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.cipres.treebase</groupId> - <artifactId>treebase-core</artifactId> - <version>1.0-SNAPSHOT</version> - </dependency> + <dependency> + <groupId>commons-beanutils</groupId> + <artifactId>commons-beanutils</artifactId> + <version>1.7.0</version> + </dependency> - <dependency> - <groupId>javax.servlet</groupId> - <artifactId>servlet-api</artifactId> - <version>2.4</version> - </dependency> + <dependency> + <groupId>commons-validator</groupId> + <artifactId>commons-validator</artifactId> + <version>1.1.4</version> + </dependency> - <dependency> - <groupId>javax.servlet</groupId> - <artifactId>jstl</artifactId> - <version>1.1.2</version> - </dependency> + <dependency> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + <version>1.1</version> + </dependency> - <!-- used by Spring framework --> - <!--Older ersion not needed--> - <!-- Commented on April 23, 2008 Madhu--> - <!--dependency> - <groupId>javax.activation</groupId> - <artifactId>activation</artifactId> - <version>1.1</version> - </dependency--> + <dependency> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + <version>2.3</version> + </dependency> - <!-- used by Spring framework --> - <dependency> - <groupId>javax.mail</groupId> - <artifactId>mail</artifactId> - <version>1.4</version> - </dependency> - - <!-- Jin 05/12/08: do we need xalan? dependency--> - <dependency> - <groupId>xalan</groupId> - <artifactId>xalan</artifactId> - <version>2.7.0</version> - </dependency> + <dependency> + <groupId>taglibs</groupId> + <artifactId>standard</artifactId> + <version>1.1.2</version> + </dependency> - <dependency> - <groupId>commons-beanutils</groupId> - <artifactId>commons-beanutils</artifactId> - <version>1.7.0</version> - </dependency> - - - <dependency> - <groupId>commons-validator</groupId> - <artifactId>commons-validator</artifactId> - <version>1.1.4</version> - </dependency> + <dependency> + <groupId>taglibs</groupId> + <artifactId>string</artifactId> + <version>1.1.0</version> + </dependency> - <dependency> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - <version>1.1</version> - </dependency> + <dependency> + <groupId>struts</groupId> + <artifactId>struts</artifactId> + <version>1.2.9</version> + </dependency> - <dependency> - <groupId>commons-lang</groupId> - <artifactId>commons-lang</artifactId> - <version>2.3</version> - </dependency> + <dependency> + <groupId>opensymphony</groupId> + <artifactId>sitemesh</artifactId> + <version>2.3</version> + </dependency> - <dependency> - <groupId>taglibs</groupId> - <artifactId>standard</artifactId> - <version>1.1.2</version> - </dependency> + <dependency> + <groupId>displaytag</groupId> + <artifactId>displaytag</artifactId> + <version>1.1.1</version> + </dependency> - <dependency> - <groupId>taglibs</groupId> - <artifactId>string</artifactId> - <version>1.1.0</version> - </dependency> + <dependency> + <groupId>struts-menu</groupId> + <artifactId>struts-menu</artifactId> + <version>2.3</version> - <dependency> - <groupId>struts</groupId> - <artifactId>struts</artifactId> - <version>1.2.9</version> - </dependency> + <exclusions> + <!-- Older versions are not needed --> + <exclusion> + <groupId>taglibs</groupId> + <artifactId>string</artifactId> + </exclusion> - <dependency> - <groupId>opensymphony</groupId> - <artifactId>sitemesh</artifactId> - <version>2.3</version> - </dependency> + <exclusion> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + </exclusion> - <dependency> - <groupId>displaytag</groupId> - <artifactId>displaytag</artifactId> - <version>1.1.1</version> - </dependency> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> - <dependency> - <groupId>struts-menu</groupId> - <artifactId>struts-menu</artifactId> - <version>2.3</version> - - <exclusions> - <!-- Older versions are not needed --> - <exclusion> - <groupId>taglibs</groupId> - <artifactId>string</artifactId> - </exclusion> - - - <exclusion> - <groupId>commons-lang</groupId> - <artifactId>commons-lang</artifactId> - </exclusion> - - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - - <exclusion> - <groupId>javax.servlet</groupId> - <artifactId>servlet-api</artifactId> - </exclusion> - - <exclusion> - <groupId>javax.servlet</groupId> - <artifactId>jstl</artifactId> - </exclusion> - - </exclusions> - - - </dependency> + <exclusion> + <groupId>javax.servlet</groupId> + <artifactId>servlet-api</artifactId> + </exclusion> - <dependency> - <groupId>org.acegisecurity</groupId> - <artifactId>acegi-security</artifactId> - <version>1.0.1</version> - <exclusions> - <!-- exclude older versions of Spring --> - <exclusion> - <groupId>org.springframework</groupId> - <artifactId>spring-remoting</artifactId> - </exclusion> - <exclusion> - <groupId>org.springframework</groupId> - <artifactId>spring-jdbc</artifactId> - </exclusion> - <exclusion> - <groupId>org.springframework</groupId> - <artifactId>spring-support</artifactId> - </exclusion> - <exclusion> - <groupId>org.springframework</groupId> - <artifactId>spring-mock</artifactId> - </exclusion> - </exclusions> - </dependency> + <exclusion> + <groupId>javax.servlet</groupId> + <artifactId>jstl</artifactId> + </exclusion> - <dependency> - <groupId>springmodules</groupId> - <artifactId>springmodules-validator</artifactId> - <version>0.1</version> - </dependency> - - - <dependency> - <groupId>commons-fileupload</groupId> - <artifactId>commons-fileupload</artifactId> - <version>1.2</version> - - <exclusions> - <exclusion> - <groupId>javax.servlet</groupId> - <artifactId>servlet-api</artifactId> - </exclusion> - </exclusions> - </dependency> - - <dependency> - <groupId>commons-io</groupId> - <artifactId>commons-io</artifactId> - <version>1.3</version> - </dependency> - - - <dependency> - <groupId>org.directwebremoting</groupId> - <artifactId>dwr</artifactId> - <version>2.0.rc2</version> - <exclusions> - <exclusion> - <groupId>org.springframework</groupId> - <artifactId>spring</artifactId> - </exclusion> - <exclusion> - <groupId>org.hibernate</groupId> - <artifactId>hibernate</artifactId> - </exclusion> - </exclusions> - </dependency> - - <dependency> - <groupId>jmock</groupId> - <artifactId>jmock</artifactId> - <version>1.0.1</version> - </dependency> - - <!-- remove 05/13/08 to avoid xml parser conflicts> - <dependency> - <groupId>org.springframework.ws</groupId> - <artifactId>spring-ws-core</artifactId> - <version>1.0.2</version> - </dependency> - --> - - <!-- remove 05/13/08 to avoid xml parser conflicts.> - <dependency> - <groupId>jaxen</groupId> - <artifactId>jaxen</artifactId> - <version>1.1</version> - </dependency> - --> - - <dependency> - <groupId>javax.xml.soap</groupId> - <artifactId>saaj-api</artifactId> - <version>1.3</version> - <scope>runtime</scope> - </dependency> - <dependency> - <groupId>zing.z3950.org</groupId> - <artifactId>cql-java</artifactId> - <version>1.0</version> - </dependency> + </exclusions> - <!--commented on April 23, 2008 Madhu--> - <!--dependency> - <groupId>com.sun.xml.messaging.saaj</groupId> - <artifactId>saaj-impl</artifactId> - <version>1.3</version> - <scope>runtime</scope> - </dependency--> - + </dependency> - </dependencies> + <dependency> + <groupId>org.acegisecurity</groupId> + <artifactId>acegi-security</artifactId> + <version>1.0.1</version> + <exclusions> + <!-- exclude older versions of Spring --> + <exclusion> + <groupId>org.springframework</groupId> + <artifactId>spring-remoting</artifactId> + </exclusion> + <exclusion> + <groupId>org.springframework</groupId> + <artifactId>spring-jdbc</artifactId> + </exclusion> + <exclusion> + <groupId>org.springframework</groupId> + <artifactId>spring-support</artifactId> + </exclusion> + <exclusion> + <groupId>org.springframework</groupId> + <artifactId>spring-mock</artifactId> + </exclusion> + </exclusions> + </dependency> + + <dependency> + <groupId>springmodules</groupId> + <artifactId>springmodules-validator</artifactId> + <version>0.1</version> + </dependency> + + <dependency> + <groupId>commons-fileupload</groupId> + <artifactId>commons-fileupload</artifactId> + <version>1.2</version> + + <exclusions> + <exclusion> + <groupId>javax.servlet</groupId> + <artifactId>servlet-api</artifactId> + </exclusion> + </exclusions> + </dependency> + + <dependency> + <groupId>commons-io</groupId> + <artifactId>commons-io</artifactId> + <version>1.3</version> + </dependency> + + <dependency> + <groupId>org.directwebremoting</groupId> + <artifactId>dwr</artifactId> + <version>2.0.rc2</version> + <exclusions> + <exclusion> + <groupId>org.springframework</groupId> + <artifactId>spring</artifactId> + </exclusion> + <exclusion> + <groupId>org.hibernate</groupId> + <artifactId>hibernate</artifactId> + </exclusion> + </exclusions> + </dependency> + + <dependency> + <groupId>jmock</groupId> + <artifactId>jmock</artifactId> + <version>1.0.1</version> + </dependency> + + <dependency> + <groupId>javax.xml.soap</groupId> + <artifactId>saaj-api</artifactId> + <version>1.3</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>zing.z3950.org</groupId> + <artifactId>cql-java</artifactId> + <version>1.0</version> + </dependency> + + </dependencies> </project> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2009-11-18 11:02:06
|
Revision: 278 http://treebase.svn.sourceforge.net/treebase/?rev=278&view=rev Author: rvos Date: 2009-11-18 11:01:58 +0000 (Wed, 18 Nov 2009) Log Message: ----------- jdom's maven path has changed from jdom/jdom/1.1 to org/jdom/jdom/1.1 Modified Paths: -------------- trunk/treebase-core/.classpath trunk/treebase-core/pom.xml trunk/treebase-web/.classpath Modified: trunk/treebase-core/.classpath =================================================================== --- trunk/treebase-core/.classpath 2009-11-17 21:08:07 UTC (rev 277) +++ trunk/treebase-core/.classpath 2009-11-18 11:01:58 UTC (rev 278) @@ -51,7 +51,7 @@ <classpathentry kind="var" path="M2_REPO/com/sun/xml/bind/jaxb-impl/2.1.6/jaxb-impl-2.1.6.jar"/> <classpathentry kind="var" path="M2_REPO/com/sun/xml/bind/jaxb-xjc/2.1.6/jaxb-xjc-2.1.6.jar"/> <classpathentry kind="var" path="M2_REPO/javax/sql/jdbc-stdext/2.0/jdbc-stdext-2.0.jar"/> - <classpathentry kind="var" path="M2_REPO/jdom/jdom/1.1/jdom-1.1.jar"/> + <classpathentry kind="var" path="M2_REPO/org/jdom/jdom/1.1/jdom-1.1.jar"/> <classpathentry kind="var" path="M2_REPO/org/mortbay/jetty/jetty/6.1.9/jetty-6.1.9.jar"/> <classpathentry kind="var" path="M2_REPO/org/mortbay/jetty/jetty-util/6.1.9/jetty-util-6.1.9.jar"/> <classpathentry kind="var" path="M2_REPO/jsci/jsci/mesquite/jsci-mesquite.jar"/> Modified: trunk/treebase-core/pom.xml =================================================================== --- trunk/treebase-core/pom.xml 2009-11-17 21:08:07 UTC (rev 277) +++ trunk/treebase-core/pom.xml 2009-11-18 11:01:58 UTC (rev 278) @@ -138,7 +138,7 @@ </dependency> <dependency> - <groupId>jdom</groupId> + <groupId>org.jdom</groupId> <artifactId>jdom</artifactId> <version>1.1</version> </dependency> Modified: trunk/treebase-web/.classpath =================================================================== --- trunk/treebase-web/.classpath 2009-11-17 21:08:07 UTC (rev 277) +++ trunk/treebase-web/.classpath 2009-11-18 11:01:58 UTC (rev 278) @@ -60,7 +60,7 @@ <classpathentry kind="var" path="M2_REPO/com/sun/xml/bind/jaxb-xjc/2.1.6/jaxb-xjc-2.1.6.jar"/> <classpathentry kind="var" path="M2_REPO/org/slf4j/jcl104-over-slf4j/1.4.2/jcl104-over-slf4j-1.4.2.jar"/> <classpathentry kind="var" path="M2_REPO/javax/sql/jdbc-stdext/2.0/jdbc-stdext-2.0.jar"/> - <classpathentry kind="var" path="M2_REPO/jdom/jdom/1.1/jdom-1.1.jar"/> + <classpathentry kind="var" path="M2_REPO/org/jdom/jdom/1.1/jdom-1.1.jar"/> <classpathentry kind="var" path="M2_REPO/org/mortbay/jetty/jetty/6.1.9/jetty-6.1.9.jar"/> <classpathentry kind="var" path="M2_REPO/org/mortbay/jetty/jetty-util/6.1.9/jetty-util-6.1.9.jar"/> <classpathentry kind="var" path="M2_REPO/jmock/jmock/1.0.1/jmock-1.0.1.jar"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2009-11-18 12:41:44
|
Revision: 280 http://treebase.svn.sourceforge.net/treebase/?rev=280&view=rev Author: rvos Date: 2009-11-18 12:41:37 +0000 (Wed, 18 Nov 2009) Log Message: ----------- Changed nexus file contents type from Clob (which we used under DB2) to Text (which we use under postgres), which is mapped onto a string by hibernate. Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/TreebaseUtil.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Study.java trunk/treebase-core/src/main/java/org/cipres/treebase/service/study/StudyServiceImpl.java trunk/treebase-core/src/main/java/org/cipres/treebase/util/RawNexusImporter.java trunk/treebase-core/src/main/java/org/cipres/treebase/util/RebuildNexusFiletable.java trunk/treebase-core/src/main/java/org/cipres/treebase/util/RepatriateData.java trunk/treebase-core/src/test/java/org/cipres/treebase/dao/study/StudyDAOTest.java trunk/treebase-core/src/test/java/org/cipres/treebase/service/study/StudyServiceImplTest.java trunk/treebase-core/src/test/java/org/cipres/treebase/service/study/SubmissionServiceImplTest.java trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/DownloadANexusFileController.java trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/NexusFilesController.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/TreebaseUtil.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/TreebaseUtil.java 2009-11-18 12:25:46 UTC (rev 279) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/TreebaseUtil.java 2009-11-18 12:41:37 UTC (rev 280) @@ -1,6 +1,10 @@ package org.cipres.treebase; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Arrays; @@ -136,7 +140,42 @@ return buf.toString(); } + + /** + * Reads the contents of a file into a string + * @param file + * @return file contents as string + */ + public static String readFileToString(File file) { + StringBuilder contents = new StringBuilder(); + try { + //use buffering, reading one line at a time + //FileReader always assumes default encoding is OK! + BufferedReader input = new BufferedReader(new FileReader(file)); + try { + String line = null; //not declared within while loop + /* + * readLine is a bit quirky : + * it returns the content of a line MINUS the newline. + * it returns null only for the END of the stream. + * it returns an empty String if two newlines appear in a row. + */ + while (( line = input.readLine()) != null){ + contents.append(line); + contents.append(System.getProperty("line.separator")); + } + } + finally { + input.close(); + } + } + catch (IOException ex){ + ex.printStackTrace(); + } + return contents.toString(); + } + /** * For Testing use. Output the content of the array to a string. If the all element parameter is * false, output only the first 10 elements. Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Study.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Study.java 2009-11-18 12:25:46 UTC (rev 279) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Study.java 2009-11-18 12:41:37 UTC (rev 280) @@ -1,6 +1,5 @@ package org.cipres.treebase.domain.study; -import java.sql.Clob; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -72,7 +71,7 @@ private List<Analysis> mAnalyses = new ArrayList<Analysis>(); private Set<TaxonLabelSet> mTaxonLabelSets = new HashSet<TaxonLabelSet>(); - private Map<String, Clob> mNexusFiles = new HashMap<String, Clob>(); + private Map<String, String> mNexusFiles = new HashMap<String, String>(); // transient fields private String mTransientDescription; @@ -318,14 +317,14 @@ // @Cascade(org.hibernate.annotations.CascadeType.DELETE_ORPHAN) // @Cache(usage = CacheConcurrencyStrategy.READ_WRITE, region = "studyCache") // @Transient - public Map<String, Clob> getNexusFiles() { + public Map<String, String> getNexusFiles() { return mNexusFiles; } /** * Set the NexusFiles field. */ - public void setNexusFiles(Map<String, Clob> pNewNexusFiles) { + public void setNexusFiles(Map<String, String> pNewNexusFiles) { mNexusFiles = pNewNexusFiles; } @@ -415,9 +414,9 @@ * Creation date: Feb 22, 2006 12:06:25 PM * * @param pFileName - * @param pNexusFile Clob + * @param pNexusFile */ - public void addNexusFile(String pFileName, Clob pNexusFile) { + public void addNexusFile(String pFileName, String pNexusFile) { if (TreebaseUtil.isEmpty(pFileName)) { if (pNexusFile == null) { return; Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/service/study/StudyServiceImpl.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/service/study/StudyServiceImpl.java 2009-11-18 12:25:46 UTC (rev 279) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/service/study/StudyServiceImpl.java 2009-11-18 12:41:37 UTC (rev 280) @@ -1,9 +1,11 @@ package org.cipres.treebase.service.study; +import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; +import java.io.IOException; import java.sql.Clob; import java.util.Collection; import java.util.Iterator; @@ -353,23 +355,11 @@ Study s = update(pStudy); Iterator<File> fileIter = pNexusFiles.iterator(); - try { - while (fileIter.hasNext()) { - File element = (File) fileIter.next(); - - String fileName = element.getName(); - FileReader reader; - reader = new FileReader(element); - - int fileLength = (int) (element.length()); - Clob nexus = Hibernate.createClob(reader, fileLength); - s.addNexusFile(fileName, nexus); - - } - } catch (FileNotFoundException ex) { - LOGGER.error(ex.getMessage()); + while (fileIter.hasNext()) { + File element = (File) fileIter.next(); + String fileName = element.getName(); + s.addNexusFile(fileName, TreebaseUtil.readFileToString(element)); } - } /** Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/util/RawNexusImporter.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/util/RawNexusImporter.java 2009-11-18 12:25:46 UTC (rev 279) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/util/RawNexusImporter.java 2009-11-18 12:41:37 UTC (rev 280) @@ -15,6 +15,7 @@ import java.util.Set; import org.cipres.treebase.ContextManager; +import org.cipres.treebase.TreebaseUtil; import org.cipres.treebase.domain.matrix.Matrix; import org.cipres.treebase.domain.matrix.MatrixHome; import org.cipres.treebase.domain.study.Study; @@ -121,20 +122,8 @@ return false; } - Clob clob; - try { - clob = buildClob(file); - } catch (FileNotFoundException e) { - err.println(fileName + ": file not found"); - return false; - } catch (UnsupportedEncodingException e) { - throw e; - } catch (IOException e) { - err.println(fileName + ": I/O error; skipping"); - return false; - } - - if (clob == null) return false; + String fileContents = TreebaseUtil.readFileToString(file); + if (fileContents == null) return false; Set<Study> studies = new HashSet<Study> (); studies.addAll(handleMatricesInFile(file)); @@ -142,7 +131,7 @@ for (Study s : studies) { if (liveMode()) - s.getNexusFiles().put(fileName, clob); + s.getNexusFiles().put(fileName, fileContents); verbose("Study S" + s.getId() + " now linked to nexus file " + fileName); } return true; Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/util/RebuildNexusFiletable.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/util/RebuildNexusFiletable.java 2009-11-18 12:25:46 UTC (rev 279) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/util/RebuildNexusFiletable.java 2009-11-18 12:41:37 UTC (rev 280) @@ -23,7 +23,7 @@ for (TBPersistable obj : ContextManager.getStudyHome().findAll(Study.class)) { Study s = (Study) obj; - Map<String,Clob> studyNexusFile = s.getNexusFiles(); + Map<String,String> studyNexusFile = s.getNexusFiles(); for (String fileName : studyNexusFile.keySet()) { if (nexusFileStudy.containsKey(fileName)) { nexusFileStudy.remove(fileName); Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/util/RepatriateData.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/util/RepatriateData.java 2009-11-18 12:25:46 UTC (rev 279) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/util/RepatriateData.java 2009-11-18 12:41:37 UTC (rev 280) @@ -74,8 +74,8 @@ if (m.getStudy() != s) { String nexusFileName = m.getNexusFileName(); - Map<String,Clob> nexusMap = m.getStudy().getNexusFiles(); - Clob nexusFile = nexusMap.remove(nexusFileName); + Map<String,String> nexusMap = m.getStudy().getNexusFiles(); + String nexusFile = nexusMap.remove(nexusFileName); s.getNexusFiles().put(nexusFileName, nexusFile); m.setStudy(s); } @@ -93,8 +93,8 @@ + " to study " + s.getId() + " submission " + sub.getId()); if (t.getStudy() != s) { String nexusFileName = t.getNexusFileName(); - Map<String,Clob> nexusMap = t.getStudy().getNexusFiles(); - Clob nexusFile = nexusMap.remove(nexusFileName); + Map<String,String> nexusMap = t.getStudy().getNexusFiles(); + String nexusFile = nexusMap.remove(nexusFileName); s.getNexusFiles().put(nexusFileName, nexusFile); t.setStudy(s); } Modified: trunk/treebase-core/src/test/java/org/cipres/treebase/dao/study/StudyDAOTest.java =================================================================== --- trunk/treebase-core/src/test/java/org/cipres/treebase/dao/study/StudyDAOTest.java 2009-11-18 12:25:46 UTC (rev 279) +++ trunk/treebase-core/src/test/java/org/cipres/treebase/dao/study/StudyDAOTest.java 2009-11-18 12:41:37 UTC (rev 280) @@ -243,8 +243,10 @@ + "f ctgactgctgaggagaaggctgccgtcaccgccttttggggcaaggtgaaagtggatgaagttggtggtgag gccctgggcaggctgctggttgtctacccctggactcagaggttctttgagtcctttggggacttgtccact gctgatgctgttatgaacaaccctaaggtgaaggcccatggcaagaaggtgctagattcctttagtaatggc atgaagcatctcgatgacctcaagggcacctttgctgcgctgagtgagctgcactgtgataagctgcatgtg gatcctgagaacttcaagctcctgggcaacgtgctagtggttgtgctggctcgcaattttggcaaggaattc accccggtgctgcaggctgactttcagaaggtggtggctggtgtggccaatgccctggcccacagatatcat\n" + "g ctgtccgatgcggtcaacgctgccgtcaccgccttttggggcaaggtgaaagtggatcaagttggtggtgag gccctgggcaggccgctggttgtctaccgctggactcagaggtgctatgagtcctttggagacttgtccact gctgatgctgttatgaacaaccctaaggtgaaggcccatggcaagaaggtgctagattcctttagtaatggc atgaagcatctcgatgacctcaagggcacctttgctgcgctgagtgagctgcactgtgataagctgcatgtg gatcctgagaacttcaagctcctgggcaacgtgctagtggttgtgctggctcgcaattttggcaaggaattc accccggtgctgcaggctgactttcagaaggtggtggctggtgtggccaatgccctggcccacagatatcat\n"; - Clob nexusC = Hibernate.createClob(nexus); - s.addNexusFile(fileName, nexusC); + //XXX rav 18/11/09 - we no longer use Clobs, we use text for nexus strings + //Clob nexusC = Hibernate.createClob(nexus); + //s.addNexusFile(fileName, nexusC); + s.addNexusFile(fileName, nexus); getFixture().store(s); Modified: trunk/treebase-core/src/test/java/org/cipres/treebase/service/study/StudyServiceImplTest.java =================================================================== --- trunk/treebase-core/src/test/java/org/cipres/treebase/service/study/StudyServiceImplTest.java 2009-11-18 12:25:46 UTC (rev 279) +++ trunk/treebase-core/src/test/java/org/cipres/treebase/service/study/StudyServiceImplTest.java 2009-11-18 12:41:37 UTC (rev 280) @@ -362,10 +362,10 @@ + "f ctgactgctgaggagaaggctgccgtcaccgccttttggggcaaggtgaaagtggatgaagttggtggtgag gccctgggcaggctgctggttgtctacccctggactcagaggttctttgagtcctttggggacttgtccact gctgatgctgttatgaacaaccctaaggtgaaggcccatggcaagaaggtgctagattcctttagtaatggc atgaagcatctcgatgacctcaagggcacctttgctgcgctgagtgagctgcactgtgataagctgcatgtg gatcctgagaacttcaagctcctgggcaacgtgctagtggttgtgctggctcgcaattttggcaaggaattc accccggtgctgcaggctgactttcagaaggtggtggctggtgtggccaatgccctggcccacagatatcat\n" + "g ctgtccgatgcggtcaacgctgccgtcaccgccttttggggcaaggtgaaagtggatcaagttggtggtgag gccctgggcaggccgctggttgtctaccgctggactcagaggtgctatgagtcctttggagacttgtccact gctgatgctgttatgaacaaccctaaggtgaaggcccatggcaagaaggtgctagattcctttagtaatggc atgaagcatctcgatgacctcaagggcacctttgctgcgctgagtgagctgcactgtgataagctgcatgtg gatcctgagaacttcaagctcctgggcaacgtgctagtggttgtgctggctcgcaattttggcaaggaattc accccggtgctgcaggctgactttcagaaggtggtggctggtgtggccaatgccctggcccacagatatcat\n"; - Clob nexusC = Hibernate.createClob(nexus); + //Clob nexusC = Hibernate.createClob(nexus); getStudyHome().refresh(s); - s.addNexusFile(fileName, nexusC); + s.addNexusFile(fileName, nexus); // force commit immeidately, important: setComplete(); @@ -377,14 +377,14 @@ assertTrue(countNexus == 1); startNewTransaction(); - Clob nexusClob = s.getNexusFiles().values().iterator().next(); - int clobLength = (int) nexusClob.length(); + String nexusString = s.getNexusFiles().values().iterator().next(); + int nexusLength = (int) nexusString.length(); // String clobStr = nexusClob.getSubString(0, 200); - char[] clobchars = new char[clobLength]; - nexusClob.getCharacterStream().read(clobchars); - logger.info("test clob: length=" + clobLength + "content = " + new String(clobchars)); - assertTrue(clobLength > 0); + //char[] clobchars = new char[clobLength]; + //nexusClob.getCharacterStream().read(clobchars); + logger.info("test clob: length=" + nexusLength + "content = " + nexusString); + assertTrue(nexusLength > 0); setComplete(); endTransaction(); Modified: trunk/treebase-core/src/test/java/org/cipres/treebase/service/study/SubmissionServiceImplTest.java =================================================================== --- trunk/treebase-core/src/test/java/org/cipres/treebase/service/study/SubmissionServiceImplTest.java 2009-11-18 12:25:46 UTC (rev 279) +++ trunk/treebase-core/src/test/java/org/cipres/treebase/service/study/SubmissionServiceImplTest.java 2009-11-18 12:41:37 UTC (rev 280) @@ -472,13 +472,10 @@ Study study2 = (Study) hibernateTemplate.load(Study.class, sub.getStudy().getId()); // hibernateTemplate.refresh(sub); - Clob nexusClob = study2.getNexusFiles().values().iterator().next(); - int clobLength = (int) nexusClob.length(); - char[] clobchars = new char[clobLength]; - nexusClob.getCharacterStream().read(clobchars); - String clobStr = new String(clobchars); - logger.info("test clob: length=" + clobLength + "content = " + clobStr); - assertTrue(clobLength > 0); + String nexusString = study2.getNexusFiles().values().iterator().next(); + int nexusStringLength = (int) nexusString.length(); + logger.info("test clob: length=" + nexusStringLength + "content = " + nexusString); + assertTrue(nexusStringLength > 0); // 4. delete: delete submission: // after add Nexus files, sub is outdated: @@ -569,13 +566,10 @@ // verify clob: hibernateTemplate.refresh(sub); - Clob nexusClob = sub.getStudy().getNexusFiles().values().iterator().next(); - int clobLength = (int) nexusClob.length(); - char[] clobchars = new char[clobLength]; - nexusClob.getCharacterStream().read(clobchars); - String clobStr = new String(clobchars); - logger.info("test clob: length=" + clobLength + "content = " + clobStr); - assertTrue(clobLength > 0); + String nexusString = sub.getStudy().getNexusFiles().values().iterator().next(); + int nexusStringLength = (int) nexusString.length(); + logger.info("test clob: length=" + nexusStringLength + "content = " + nexusString); + assertTrue(nexusStringLength > 0); // 4. delete: delete submission: // after add Nexus files, sub is outdated: Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/DownloadANexusFileController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/DownloadANexusFileController.java 2009-11-18 12:25:46 UTC (rev 279) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/DownloadANexusFileController.java 2009-11-18 12:41:37 UTC (rev 280) @@ -135,20 +135,11 @@ return null; } Study study = ControllerUtil.findStudy(req, mStudyService); - Map<String, Clob> nexusMap = study.getNexusFiles(); - Clob clob = nexusMap.get(nexusFileName); - String clobStr = "File Not Found. File Name is: " + nexusFileName; - if (clob != null) { - try { - int clobLength = (int) clob.length(); - char[] clobchars = new char[clobLength]; - clob.getCharacterStream().read(clobchars); - clobStr = new String(clobchars); - } catch ( Exception e ) { - e.printStackTrace(); - } - } - return clobStr; + Map<String, String> nexusMap = study.getNexusFiles(); + String nexusString = nexusMap.get(nexusFileName); + return nexusString != null + ? nexusString + : "File Not Found. File Name is: " + nexusFileName; } } Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/NexusFilesController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/NexusFilesController.java 2009-11-18 12:25:46 UTC (rev 279) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/NexusFilesController.java 2009-11-18 12:41:37 UTC (rev 280) @@ -51,7 +51,7 @@ throws Exception { Study study = ControllerUtil.findStudy(pRequest, mStudyService); - Map<String, Clob> nexusFilesMap = study.getNexusFiles(); + Map<String, String> nexusFilesMap = study.getNexusFiles(); if (LOGGER.isDebugEnabled()) { LOGGER.debug("MAP SIZE IS: " + nexusFilesMap.size()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vga...@us...> - 2010-01-13 17:04:12
|
Revision: 423 http://treebase.svn.sourceforge.net/treebase/?rev=423&view=rev Author: vgapeyev Date: 2010-01-13 17:04:03 +0000 (Wed, 13 Jan 2010) Log Message: ----------- Switching to use JNDI for the DataSource in the web app. The standalone apps still get their db credentials from jdbc.properties. Description of the new setup is at https://sourceforge.net/apps/mediawiki/treebase/index.php?title=Databases Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/core/CoreServiceLauncher.java trunk/treebase-core/src/main/resources/applicationContext-dao.xml trunk/treebase-web/src/main/webapp/WEB-INF/web.xml Added Paths: ----------- trunk/treebase-core/src/main/resources/applicationContext-db-standalone.xml trunk/treebase-core/src/main/resources/applicationContext-db-webapp.xml trunk/treebase-core/src/main/resources/jdbc.properties.example trunk/treebase-web/src/main/webapp/META-INF/context.xml.example Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/core/CoreServiceLauncher.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/core/CoreServiceLauncher.java 2010-01-12 18:28:42 UTC (rev 422) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/core/CoreServiceLauncher.java 2010-01-13 17:04:03 UTC (rev 423) @@ -18,6 +18,7 @@ private static final Logger LOGGER = Logger.getLogger(CoreServiceLauncher.class); private static final String[] SPRING_CONFIG_FILES = new String[] {// "applicationContext.xml", + "applicationContext-db-standalone.xml", // 2010-01-12 VG "applicationContext-dao.xml", "applicationContext-service.xml", "applicationContext-standalone.xml" // 20090222 MJD Modified: trunk/treebase-core/src/main/resources/applicationContext-dao.xml =================================================================== --- trunk/treebase-core/src/main/resources/applicationContext-dao.xml 2010-01-12 18:28:42 UTC (rev 422) +++ trunk/treebase-core/src/main/resources/applicationContext-dao.xml 2010-01-13 17:04:03 UTC (rev 423) @@ -22,24 +22,31 @@ </property> </bean> + +<!-- VG 2010-01-11 instead, see applicationContext-db-webapp.xml and applicationContext-db-standalone.xml <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close"> <property name="driverClass" value="${jdbc.driverClassName}" /> <property name="jdbcUrl" value="${jdbc.url}" /> <property name="user" value="${jdbc.username}" /> <property name="password" value="${jdbc.password}" /> <property name="minPoolSize" value="5" /> +--> <!-- reduce to expose connection leak problem, if any property name="maxPoolSize" value="100" /--> +<!-- <property name="maxPoolSize" value="10" /> <property name="initialPoolSize" value="6" /> <property name="maxIdleTime" value="3600" /> +--> <!--property name="maxIdleTime" value="9000" /--> +<!-- <property name="maxConnectionAge" value="18000" /> <property name="idleConnectionTestPeriod" value="300" /> <property name="maxIdleTimeExcessConnections" value="300" /> <property name="maxStatementsPerConnection" value="100" /> <property name="numHelperThreads" value="5" /> </bean> +--> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"> Added: trunk/treebase-core/src/main/resources/applicationContext-db-standalone.xml =================================================================== --- trunk/treebase-core/src/main/resources/applicationContext-db-standalone.xml (rev 0) +++ trunk/treebase-core/src/main/resources/applicationContext-db-standalone.xml 2010-01-13 17:04:03 UTC (rev 423) @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<beans xmlns="http://www.springframework.org/schema/beans" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:dwr="http://www.directwebremoting.org/schema/spring-dwr" + xsi:schemaLocation="http://www.springframework.org/schema/beans + http://www.springframework.org/schema/beans/spring-beans-2.0.xsd + http://www.directwebremoting.org/schema/spring-dwr + http://www.directwebremoting.org/schema/spring-dwr-2.0.xsd" + default-autowire="no"> + + <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close"> + <property name="driverClass" value="${jdbc.driverClassName}" /> + <property name="jdbcUrl" value="${jdbc.url}" /> + <property name="user" value="${jdbc.username}" /> + <property name="password" value="${jdbc.password}" /> + <property name="minPoolSize" value="5" /> + <!-- reduce to expose connection leak problem, if any + property name="maxPoolSize" value="100" /--> + <property name="maxPoolSize" value="10" /> + <property name="initialPoolSize" value="6" /> + <property name="maxIdleTime" value="3600" /> + <!--property name="maxIdleTime" value="9000" /--> + <property name="maxConnectionAge" value="18000" /> + <property name="idleConnectionTestPeriod" value="300" /> + <property name="maxIdleTimeExcessConnections" value="300" /> + <property name="maxStatementsPerConnection" value="100" /> + <property name="numHelperThreads" value="5" /> + </bean> + + + +</beans> + \ No newline at end of file Added: trunk/treebase-core/src/main/resources/applicationContext-db-webapp.xml =================================================================== --- trunk/treebase-core/src/main/resources/applicationContext-db-webapp.xml (rev 0) +++ trunk/treebase-core/src/main/resources/applicationContext-db-webapp.xml 2010-01-13 17:04:03 UTC (rev 423) @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<beans xmlns="http://www.springframework.org/schema/beans" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:dwr="http://www.directwebremoting.org/schema/spring-dwr" + xsi:schemaLocation="http://www.springframework.org/schema/beans + http://www.springframework.org/schema/beans/spring-beans-2.0.xsd + http://www.directwebremoting.org/schema/spring-dwr + http://www.directwebremoting.org/schema/spring-dwr-2.0.xsd" + default-autowire="no"> + + <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean"> + <property name="jndiName" value="java:comp/env/jdbc/TreebaseDB"/> + </bean> + +</beans> \ No newline at end of file Added: trunk/treebase-core/src/main/resources/jdbc.properties.example =================================================================== --- trunk/treebase-core/src/main/resources/jdbc.properties.example (rev 0) +++ trunk/treebase-core/src/main/resources/jdbc.properties.example 2010-01-13 17:04:03 UTC (rev 423) @@ -0,0 +1,27 @@ +#### VG 2010-01-12 DB credentials that are used by the web application are now in JNDI -- see /treebase-web/src/main/webapp/META-INF/context.xml +#### The credentials below are only used by tests and, possibly, by data importing classes in cipres.teebase.util +#### (see treebase-core/src/main/java/org/cipres/treebase/core/CoreServiceLauncher.java) + +jdbc.driverClassName=org.postgresql.Driver + +# Login credentials, obtain the actual values from +# other developers (or create your own on a fresh install). +jdbc.url=jdbc:postgresql://YOUR.SERVER.ORG/YOUR-DB +jdbc.username=YOUR_USERNAME +jdbc.password=YOUT_PASSWORD + + +# This tells our object-relational mapping libraries +# to use postgres-specific SQL dialect +hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect + +# for development only: +hibernate.show_sql=false +hibernate.format_sql=true +hibernate.generate_statistics=false + +# options are: validate | update | create | create-drop +hibernate.hbm2ddl.auto= + +# Mesquite installation directory +mesquite.folder_dir=/home/rvosa/applications/mesquiteHeadless/Mesquite_Folder/ Added: trunk/treebase-web/src/main/webapp/META-INF/context.xml.example =================================================================== --- trunk/treebase-web/src/main/webapp/META-INF/context.xml.example (rev 0) +++ trunk/treebase-web/src/main/webapp/META-INF/context.xml.example 2010-01-13 17:04:03 UTC (rev 423) @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- An example of META-INF/context.xml - a Tomcat-specific shorthand to specify JNDI resources during development. + See http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html + --> + +<!-- Copy this file (context.xml.example) to context.xml and replace YOUR-XXX strings with suitable credentials. + (Note that context.xml is set to be ignored by SVN, so storing passwords there is safe.) + Make sure that $CATALINA_HOME/common/lib contains a postgres JDBC driver jar. + Now, dropping treebase-web.war to $CATALINA_HOME/webapps of a vanilla Tomcat should automatically create + config file $CATALINA_HOME/conf/Catalina/localhost/treebase-web.xml, + which instructs Tomcat to provide a JNDI DataSource. + FYI: If this config is created or modified by hand, it is not affected by WAR (re-)deployments. + (I.e., server-side configuration supercedes WAR-side.) +--> + +<Context reloadable="true"> + + <Resource name="jdbc/TreebaseDB" auth="Container" + type="javax.sql.DataSource" driverClassName="org.postgresql.Driver" + url="jdbc:postgresql://YOUR-URL" + username="YOUR-NAME" password="YOUR-PASS" + maxActive="20" maxIdle="10" maxWait="-1" + /> + +</Context> + + Modified: trunk/treebase-web/src/main/webapp/WEB-INF/web.xml =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/web.xml 2010-01-12 18:28:42 UTC (rev 422) +++ trunk/treebase-web/src/main/webapp/WEB-INF/web.xml 2010-01-13 17:04:03 UTC (rev 423) @@ -18,6 +18,7 @@ <context-param> <param-name>contextConfigLocation</param-name> <param-value> + classpath*:applicationContext-db-webapp.xml, classpath*:applicationContext-dao.xml, classpath*:applicationContext-service.xml, /WEB-INF/applicationContext.xml, @@ -37,6 +38,16 @@ <param-value>en</param-value> </context-param> + + <!-- =================================================================== --> + <!-- Declarations of JNDI Resources expected from the Tomcat container --> + <!-- =================================================================== --> + <resource-ref> + <description>The JNDI DataSource of the Treebase postgres instance that should be supplied by Tomcat.</description> + <res-ref-name>jdbc/TreebaseDB</res-ref-name> + <res-type>javax.sql.DataSource</res-type> + <res-auth>Container</res-auth> + </resource-ref> <!-- ========================================================== --> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vga...@us...> - 2010-02-07 21:38:11
|
Revision: 484 http://treebase.svn.sourceforge.net/treebase/?rev=484&view=rev Author: vgapeyev Date: 2010-02-07 21:38:04 +0000 (Sun, 07 Feb 2010) Log Message: ----------- Installation location for Mesquite is now looked up via JNDI. Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/service/nexus/NexusServiceMesquite.java trunk/treebase-core/src/main/resources/applicationContext-service.xml trunk/treebase-core/src/main/resources/jdbc.properties.example trunk/treebase-web/src/main/webapp/META-INF/context.xml.example trunk/treebase-web/src/main/webapp/WEB-INF/web.xml Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/service/nexus/NexusServiceMesquite.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/service/nexus/NexusServiceMesquite.java 2010-02-04 17:46:20 UTC (rev 483) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/service/nexus/NexusServiceMesquite.java 2010-02-07 21:38:04 UTC (rev 484) @@ -5,6 +5,9 @@ import java.util.Collection; import java.util.Properties; +import javax.naming.InitialContext; +import javax.naming.NamingException; + import mesquite.lib.MesquiteModule; import org.apache.log4j.Logger; @@ -19,6 +22,7 @@ import org.cipres.treebase.domain.taxon.TaxonLabelHome; import org.cipres.treebase.event.ProgressionListener; import org.cipres.treebase.service.AbstractServiceImpl; +import org.springframework.beans.factory.InitializingBean; /** * NexusServiceMesquite.java @@ -28,7 +32,7 @@ * @author Jin Ruan * */ -public class NexusServiceMesquite extends AbstractServiceImpl implements NexusService { +public class NexusServiceMesquite extends AbstractServiceImpl implements NexusService, InitializingBean { private static final Logger LOGGER = Logger.getLogger(NexusServiceMesquite.class); private static final String MESQUITE_FOLDER_DIR_KEY = "mesquite.folder_dir"; @@ -99,7 +103,28 @@ protected DomainHome getDomainHome() { return null; // do not need persistence service. } + + /** Looks up where Mesquite is installed on the host system and informs MesquiteModule of the location. + (This is an implementation of a standard Spring bean initialization method, + which is invoked after all properties are set.) + */ + public void afterPropertiesSet() throws Exception { + String mesquiteFolderDir = null; + InitialContext ic; + try { + ic = new InitialContext(); + mesquiteFolderDir = (String) ic.lookup("java:comp/env/tb2/MesquiteFolder"); + } catch (NamingException e) { + LOGGER.fatal("Error looking up tb/MesquiteFolder via JNDI"); + } + mesquiteFolderDir = mesquiteFolderDir + "/foo"; //since the last path element is somehow dropped subsequently... VG 2010-02-07 + System.setProperty(MESQUITE_FOLDER_DIR_KEY, mesquiteFolderDir); + MesquiteModule.mesquiteDirectory = new File(mesquiteFolderDir); + MesquiteModule.mesquiteDirectoryPath = mesquiteFolderDir; + } + + /** * * @see org.cipres.treebase.domain.nexus.NexusService#parseNexus(org.cipres.treebase.domain.study.Study, java.io.File) @@ -185,18 +210,7 @@ return data; } - - /** - * Set the mesquite folder dirtory to be used inside mesquite file "MesquiteModule.java". - * - * @param pMesquiteFolderDir - */ - public void setMesquiteFolderDir(String pMesquiteFolderDir) { - System.setProperty(MESQUITE_FOLDER_DIR_KEY, pMesquiteFolderDir); - MesquiteModule.mesquiteDirectory = new File(pMesquiteFolderDir); - MesquiteModule.mesquiteDirectoryPath = pMesquiteFolderDir; - } - + @Override public Class defaultResultClass() { return null; Modified: trunk/treebase-core/src/main/resources/applicationContext-service.xml =================================================================== --- trunk/treebase-core/src/main/resources/applicationContext-service.xml 2010-02-04 17:46:20 UTC (rev 483) +++ trunk/treebase-core/src/main/resources/applicationContext-service.xml 2010-02-07 21:38:04 UTC (rev 484) @@ -142,8 +142,7 @@ <property name="matrixDataTypeHome" ref="matrixDataTypeHome"/> <property name="taxonLabelHome" ref="taxonLabelHome"/> <property name="itemDefinitionHome" ref="itemDefinitionHome"/> - <property name="mesquiteFolderDir" value="${mesquite.folder_dir}"/> - </bean> + </bean> <bean id="nexmlService" class = "org.cipres.treebase.service.nexus.NexusServiceNexml"> <!-- property name="domainHome" ref="domainHome"/ --> Modified: trunk/treebase-core/src/main/resources/jdbc.properties.example =================================================================== --- trunk/treebase-core/src/main/resources/jdbc.properties.example 2010-02-04 17:46:20 UTC (rev 483) +++ trunk/treebase-core/src/main/resources/jdbc.properties.example 2010-02-07 21:38:04 UTC (rev 484) @@ -1,16 +1,3 @@ -#### VG 2010-01-12 DB credentials that are used by the web application are now in JNDI -- see /treebase-web/src/main/webapp/META-INF/context.xml -#### The credentials below are only used by tests and, possibly, by data importing classes in cipres.teebase.util -#### (see treebase-core/src/main/java/org/cipres/treebase/core/CoreServiceLauncher.java) - -jdbc.driverClassName=org.postgresql.Driver - -# Login credentials, obtain the actual values from -# other developers (or create your own on a fresh install). -jdbc.url=jdbc:postgresql://YOUR.SERVER.ORG/YOUR-DB -jdbc.username=YOUR_USERNAME -jdbc.password=YOUT_PASSWORD - - # This tells our object-relational mapping libraries # to use postgres-specific SQL dialect hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect @@ -23,5 +10,19 @@ # options are: validate | update | create | create-drop hibernate.hbm2ddl.auto= + +#### VG 2010-02-07 Properties below are not read by the webapp anymore. +#### Instead, equivalent resources are looked up through JNDI -- see /treebase-web/src/main/webapp/META-INF/context.xml +#### These properties are only read by tests and, possibly, by data importing classes in cipres.teebase.util +#### (see treebase-core/src/main/java/org/cipres/treebase/core/CoreServiceLauncher.java) + +jdbc.driverClassName=org.postgresql.Driver + +# Login credentials, obtain the actual values from +# other developers (or create your own on a fresh install). +jdbc.url=jdbc:postgresql://YOUR.SERVER.ORG/YOUR-DB +jdbc.username=YOUR_USERNAME +jdbc.password=YOUT_PASSWORD + # Mesquite installation directory -mesquite.folder_dir=/home/rvosa/applications/mesquiteHeadless/Mesquite_Folder/ +mesquite.folder_dir=/PATH/TO/YOUR/mesquite-2.01.tb Modified: trunk/treebase-web/src/main/webapp/META-INF/context.xml.example =================================================================== --- trunk/treebase-web/src/main/webapp/META-INF/context.xml.example 2010-02-04 17:46:20 UTC (rev 483) +++ trunk/treebase-web/src/main/webapp/META-INF/context.xml.example 2010-02-07 21:38:04 UTC (rev 484) @@ -1,11 +1,11 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- An example of META-INF/context.xml - a Tomcat-specific shorthand to specify JNDI resources during development. +<!-- This is an example of META-INF/context.xml - a Tomcat-specific shorthand to specify JNDI resources during development. See http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html --> -<!-- Copy this file (context.xml.example) to context.xml and replace YOUR-XXX strings with suitable credentials. - (Note that context.xml is set to be ignored by SVN, so storing passwords there is safe.) +<!-- Copy this file (context.xml.example) to context.xml and replace YOUR-XXX strings with suitable values. + (Note that context.xml is set to be ignored by SVN, so placing passwords there is safe.) Make sure that $CATALINA_HOME/common/lib contains a postgres JDBC driver jar. Now, dropping treebase-web.war to $CATALINA_HOME/webapps of a vanilla Tomcat should automatically create config file $CATALINA_HOME/conf/Catalina/localhost/treebase-web.xml, @@ -16,13 +16,19 @@ <Context reloadable="true"> - <Resource name="jdbc/TreebaseDB" auth="Container" - type="javax.sql.DataSource" driverClassName="org.postgresql.Driver" + <Resource name="jdbc/TreebaseDB" auth="Container" + type="javax.sql.DataSource" + description="The JNDI DataSource for the Treebase postgres instance." + driverClassName="org.postgresql.Driver" url="jdbc:postgresql://YOUR-URL" username="YOUR-NAME" password="YOUR-PASS" maxActive="20" maxIdle="10" maxWait="-1" /> - + + <Environment name="tb2/MesquiteFolder" value="/PATH/TO/YOUR/mesquite-2.01.tb" + type="java.lang.String" override="false" + description="Absolute path to the directory where headless Mesquite is unpacked on the host system."/> + </Context> Modified: trunk/treebase-web/src/main/webapp/WEB-INF/web.xml =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/web.xml 2010-02-04 17:46:20 UTC (rev 483) +++ trunk/treebase-web/src/main/webapp/WEB-INF/web.xml 2010-02-07 21:38:04 UTC (rev 484) @@ -48,6 +48,12 @@ <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref> + + <env-entry> + <description>Absolute path to the directory where headless Mesquite is unpacked on the host system.</description> + <env-entry-name>tb2/MesquiteFolder</env-entry-name> + <env-entry-type>java.lang.String</env-entry-type> + </env-entry> <!-- ========================================================== --> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yo...@us...> - 2010-02-19 20:32:02
|
Revision: 515 http://treebase.svn.sourceforge.net/treebase/?rev=515&view=rev Author: youjun Date: 2010-02-19 20:31:56 +0000 (Fri, 19 Feb 2010) Log Message: ----------- add search by studyID option @ /admin/searchbysubmissionID Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/dao/study/SubmissionDAO.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/SubmissionHome.java trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SearchBySubmissionIDController.java trunk/treebase-web/src/main/webapp/WEB-INF/pages/searchBySubmissionID.jsp Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/dao/study/SubmissionDAO.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/dao/study/SubmissionDAO.java 2010-02-19 20:13:59 UTC (rev 514) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/dao/study/SubmissionDAO.java 2010-02-19 20:31:56 UTC (rev 515) @@ -193,4 +193,19 @@ return q.list(); } + public Submission findByStudyID(Long pID) { + // TODO Auto-generated method stub + Submission returnVal = null; + Query q = getSession() + .createQuery( + "select sub from Submission as sub where sub.id = :mID"); + + q.setLong("mID", pID); + Object o = q.uniqueResult(); + + returnVal = (Submission) o; + + return returnVal; + } + } Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/SubmissionHome.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/SubmissionHome.java 2010-02-19 20:13:59 UTC (rev 514) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/SubmissionHome.java 2010-02-19 20:31:56 UTC (rev 515) @@ -36,7 +36,7 @@ * @return Submission */ Submission findByStudyAccessionNumber(String pAccNumber); - + Submission findByStudyID(Long pID); /** * Find by the associated matrix. Returns null if no match is found. * Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SearchBySubmissionIDController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SearchBySubmissionIDController.java 2010-02-19 20:13:59 UTC (rev 514) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SearchBySubmissionIDController.java 2010-02-19 20:31:56 UTC (rev 515) @@ -70,9 +70,19 @@ } sub = getSubmissionHome().findByStudyAccessionNumber(studyAccession); } - else { + else if( identifierType.equals("TB2") ){ sub = getSubmissionHome().findBySubmissionNumber(studyAccession); } + else{ + Long pID; + try{ + pID=Long.parseLong(studyAccession); + sub = getSubmissionHome().findByStudyID(pID); + }catch(NumberFormatException nfe){ + sub=null; + } + + } if (sub == null) { return setAttributeAndShowForm(request, response, bindExp, "errors", "Submission accession: '" Modified: trunk/treebase-web/src/main/webapp/WEB-INF/pages/searchBySubmissionID.jsp =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/pages/searchBySubmissionID.jsp 2010-02-19 20:13:59 UTC (rev 514) +++ trunk/treebase-web/src/main/webapp/WEB-INF/pages/searchBySubmissionID.jsp 2010-02-19 20:31:56 UTC (rev 515) @@ -17,7 +17,8 @@ <th><fmt:message key="submission.accession"/>:</th> <td> <input type="radio" name="identifierType" value="TB2" checked="checked"/>TreeBASE2 Id - <input type="radio" name="identifierType" value="TB1"/>Legacy accession + <input type="radio" name="identifierType" value="TB1"/>Legacy accession + <input type="radio" name="identifierType" value="TB0"/>TreeBase2 Study ID <input type="text" name="submissionaccession" maxlength = "25"/> </td> </tr> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yo...@us...> - 2010-02-24 16:11:47
|
Revision: 517 http://treebase.svn.sourceforge.net/treebase/?rev=517&view=rev Author: youjun Date: 2010-02-24 14:53:46 +0000 (Wed, 24 Feb 2010) Log Message: ----------- add new algorithm option classes, update jsp page accordingly Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/auxdata/CommitStudy.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Algorithm.java trunk/treebase-core/src/main/resources/hibernate.cfg.xml trunk/treebase-web/src/main/java/org/cipres/treebase/web/Constants.java trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/DisplayAnalysisController.java trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SearchSummaryController.java trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SummaryController.java trunk/treebase-web/src/main/java/org/cipres/treebase/web/listeners/StartupListener.java trunk/treebase-web/src/main/java/org/cipres/treebase/web/model/AnalysisStepCommand.java trunk/treebase-web/src/main/java/org/cipres/treebase/web/util/ControllerUtil.java trunk/treebase-web/src/main/webapp/WEB-INF/pages/submissionSummaryView.jsp Added Paths: ----------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/BayesianAlgorithm.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/EvolutionAlgorithm.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/JoiningAlgorithm.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/UPGMAAlgorithm.java Removed Paths: ------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/DistanceAlgorithm.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/auxdata/CommitStudy.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/auxdata/CommitStudy.java 2010-02-19 21:50:27 UTC (rev 516) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/auxdata/CommitStudy.java 2010-02-24 14:53:46 UTC (rev 517) @@ -18,7 +18,10 @@ import org.cipres.treebase.domain.study.AnalyzedMatrix; import org.cipres.treebase.domain.study.AnalyzedTree; import org.cipres.treebase.domain.study.Citation; -import org.cipres.treebase.domain.study.DistanceAlgorithm; +import org.cipres.treebase.domain.study.BayesianAlgorithm; +import org.cipres.treebase.domain.study.EvolutionAlgorithm; +import org.cipres.treebase.domain.study.JoiningAlgorithm; +import org.cipres.treebase.domain.study.UPGMAAlgorithm; import org.cipres.treebase.domain.study.LikelihoodAlgorithm; import org.cipres.treebase.domain.study.OtherAlgorithm; import org.cipres.treebase.domain.study.ParsimonyAlgorithm; @@ -222,11 +225,16 @@ Algorithm theAlgorithm; String tb1Algorithm = an.getString("algorithm"); - if (tb1Algorithm.equalsIgnoreCase("parsimony")) { theAlgorithm = new ParsimonyAlgorithm(); - } else if (tb1Algorithm.equalsIgnoreCase("distance")) { - theAlgorithm = new DistanceAlgorithm(); + } else if (tb1Algorithm.equalsIgnoreCase("bayesian")) { + theAlgorithm = new BayesianAlgorithm(); + } else if (tb1Algorithm.equalsIgnoreCase("evolution")) { + theAlgorithm = new EvolutionAlgorithm(); + } else if (tb1Algorithm.equalsIgnoreCase("joining")) { + theAlgorithm = new JoiningAlgorithm(); + } else if (tb1Algorithm.equalsIgnoreCase("UPGMA")) { + theAlgorithm = new UPGMAAlgorithm(); } else if (tb1Algorithm.equalsIgnoreCase("likelihood")) { theAlgorithm = new LikelihoodAlgorithm(); } else { Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Algorithm.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Algorithm.java 2010-02-19 21:50:27 UTC (rev 516) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Algorithm.java 2010-02-24 14:53:46 UTC (rev 517) @@ -98,11 +98,15 @@ } /* constants returned by getAlgorithmType */ - public static final String LikelihoodAlgorithm = "maximum likelihood"; - public static final String DistanceAlgorithm = "distance"; + public static final String LikelihoodAlgorithm = "maximum likelihood"; public static final String OtherAlgorithm = "other algorithm"; public static final String ParsimonyAlgorithm = "parsimony"; + public static final String BayesianAlgorithm ="bayesian inference"; + public static final String EvolutionAlgorithm ="minimum evolution"; + public static final String JoiningAlgorithm ="neighbor joining"; + public static final String UPGMAAlgorithm = "UPGMA"; + /** * @return a string describing the algorithm type (for example, "parsimony") * @author mjd 20080723 Added: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/BayesianAlgorithm.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/BayesianAlgorithm.java (rev 0) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/BayesianAlgorithm.java 2010-02-24 14:53:46 UTC (rev 517) @@ -0,0 +1,33 @@ +package org.cipres.treebase.domain.study; + +import javax.persistence.DiscriminatorValue; +import javax.persistence.Entity; +import javax.persistence.Transient; + +/** + * UPGMAAlgorithm.java + * + * Created on Feb 23, 2010 + * + * @author Youjun Guo + * + */ +@SuppressWarnings("serial") +@Entity +@DiscriminatorValue("B") + +public class BayesianAlgorithm extends Algorithm{ + /** + * Constructor. + */ + public BayesianAlgorithm() { + super(); + } + + @Override + @Transient + public String getAlgorithmType() { + return BayesianAlgorithm; + } + +} Deleted: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/DistanceAlgorithm.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/DistanceAlgorithm.java 2010-02-19 21:50:27 UTC (rev 516) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/DistanceAlgorithm.java 2010-02-24 14:53:46 UTC (rev 517) @@ -1,33 +0,0 @@ -package org.cipres.treebase.domain.study; - -import javax.persistence.DiscriminatorValue; -import javax.persistence.Entity; -import javax.persistence.Transient; - -/** - * DistanceAlgorithm.java - * - * Created on Mar 13, 2006 - * - * @author Jin Ruan - * - */ -@SuppressWarnings("serial") -@Entity -@DiscriminatorValue("D") -public class DistanceAlgorithm extends Algorithm { - - /** - * Constructor. - */ - public DistanceAlgorithm() { - super(); - } - - @Override - @Transient - public String getAlgorithmType() { - return DistanceAlgorithm; - } - -} Added: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/EvolutionAlgorithm.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/EvolutionAlgorithm.java (rev 0) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/EvolutionAlgorithm.java 2010-02-24 14:53:46 UTC (rev 517) @@ -0,0 +1,33 @@ +package org.cipres.treebase.domain.study; + +import javax.persistence.DiscriminatorValue; +import javax.persistence.Entity; +import javax.persistence.Transient; + +/** + * UPGMAAlgorithm.java + * + * Created on Feb 23, 2010 + * + * @author Youjun Guo + * + */ +@SuppressWarnings("serial") +@Entity +@DiscriminatorValue("E") + +public class EvolutionAlgorithm extends Algorithm { + /** + * Constructor. + */ + public EvolutionAlgorithm() { + super(); + } + + @Override + @Transient + public String getAlgorithmType() { + return EvolutionAlgorithm; + } + +} Added: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/JoiningAlgorithm.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/JoiningAlgorithm.java (rev 0) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/JoiningAlgorithm.java 2010-02-24 14:53:46 UTC (rev 517) @@ -0,0 +1,33 @@ +package org.cipres.treebase.domain.study; + +import javax.persistence.DiscriminatorValue; +import javax.persistence.Entity; +import javax.persistence.Transient; + +/** + * UPGMAAlgorithm.java + * + * Created on Feb 23, 2010 + * + * @author Youjun Guo + * + */ +@SuppressWarnings("serial") +@Entity +@DiscriminatorValue("J") + +public class JoiningAlgorithm extends Algorithm { + /** + * Constructor. + */ + public JoiningAlgorithm() { + super(); + } + + @Override + @Transient + public String getAlgorithmType() { + return JoiningAlgorithm; + } + +} Copied: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/UPGMAAlgorithm.java (from rev 516, trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/DistanceAlgorithm.java) =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/UPGMAAlgorithm.java (rev 0) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/UPGMAAlgorithm.java 2010-02-24 14:53:46 UTC (rev 517) @@ -0,0 +1,33 @@ +package org.cipres.treebase.domain.study; + +import javax.persistence.DiscriminatorValue; +import javax.persistence.Entity; +import javax.persistence.Transient; + +/** + * UPGMAAlgorithm.java + * + * Created on Feb 23, 2010 + * + * @author Youjun Guo + * + */ +@SuppressWarnings("serial") +@Entity +@DiscriminatorValue("U") +public class UPGMAAlgorithm extends Algorithm { + + /** + * Constructor. + */ + public UPGMAAlgorithm() { + super(); + } + + @Override + @Transient + public String getAlgorithmType() { + return UPGMAAlgorithm; + } + +} Modified: trunk/treebase-core/src/main/resources/hibernate.cfg.xml =================================================================== --- trunk/treebase-core/src/main/resources/hibernate.cfg.xml 2010-02-19 21:50:27 UTC (rev 516) +++ trunk/treebase-core/src/main/resources/hibernate.cfg.xml 2010-02-24 14:53:46 UTC (rev 517) @@ -104,8 +104,10 @@ <mapping class="org.cipres.treebase.domain.study.BookCitation" /> <mapping class="org.cipres.treebase.domain.study.Citation" /> <mapping class="org.cipres.treebase.domain.study.CitationStatus" /> - <mapping class="org.cipres.treebase.domain.study.DistanceAlgorithm" /> + <mapping class="org.cipres.treebase.domain.study.BayesianAlgorithm" /> + <mapping class="org.cipres.treebase.domain.study.EvolutionAlgorithm" /> <mapping class="org.cipres.treebase.domain.study.InBookCitation" /> + <mapping class="org.cipres.treebase.domain.study.JoiningAlgorithm" /> <mapping class="org.cipres.treebase.domain.study.LikelihoodAlgorithm" /> <mapping class="org.cipres.treebase.domain.study.OtherAlgorithm" /> <mapping class="org.cipres.treebase.domain.study.ParsimonyAlgorithm" /> @@ -113,7 +115,8 @@ <mapping class="org.cipres.treebase.domain.study.Study" /> <mapping class="org.cipres.treebase.domain.study.StudyStatus" /> <mapping class="org.cipres.treebase.domain.study.Submission" /> - + <mapping class="org.cipres.treebase.domain.study.UPGMAAlgorithm" /> + <mapping class="org.cipres.treebase.domain.taxon.LSIDTaxonLink" /> <mapping class="org.cipres.treebase.domain.taxon.SpecimenLabel" /> <mapping class="org.cipres.treebase.domain.taxon.Taxon" /> Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/Constants.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/Constants.java 2010-02-19 21:50:27 UTC (rev 516) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/Constants.java 2010-02-24 14:53:46 UTC (rev 517) @@ -77,9 +77,13 @@ public static final String ALGORITHM_TYPES = "algorithmtypes"; public static final String ALGORITHM_LIKELIHOOD = Algorithm.LikelihoodAlgorithm; public static final String ALGORITHM_PARSIMONY = Algorithm.ParsimonyAlgorithm; - public static final String ALGORITHM_DISTANCE = Algorithm.DistanceAlgorithm; + //public static final String ALGORITHM_DISTANCE = Algorithm.DistanceAlgorithm; public static final String ALGORITHM_OTHER = Algorithm.OtherAlgorithm; - + public static final String ALGORITHM_Bayesian =Algorithm.BayesianAlgorithm; + public static final String ALGORITHM_Evolution =Algorithm.EvolutionAlgorithm; + public static final String ALGORITHM_Joining =Algorithm.JoiningAlgorithm; + public static final String ALGORITHM_UPGMA = Algorithm.UPGMAAlgorithm; + public static final String SEARCH_COMMAND = "searchCommand"; public static final String MATRIX_KEY = "matrix"; Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/DisplayAnalysisController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/DisplayAnalysisController.java 2010-02-19 21:50:27 UTC (rev 516) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/DisplayAnalysisController.java 2010-02-24 14:53:46 UTC (rev 517) @@ -19,13 +19,16 @@ import org.cipres.treebase.domain.study.AnalyzedData; import org.cipres.treebase.domain.study.AnalyzedMatrix; import org.cipres.treebase.domain.study.AnalyzedTree; -import org.cipres.treebase.domain.study.DistanceAlgorithm; +import org.cipres.treebase.domain.study.BayesianAlgorithm; +import org.cipres.treebase.domain.study.EvolutionAlgorithm; +import org.cipres.treebase.domain.study.JoiningAlgorithm; import org.cipres.treebase.domain.study.LikelihoodAlgorithm; import org.cipres.treebase.domain.study.OtherAlgorithm; import org.cipres.treebase.domain.study.ParsimonyAlgorithm; import org.cipres.treebase.domain.study.Study; import org.cipres.treebase.domain.study.StudyService; import org.cipres.treebase.domain.study.Submission; +import org.cipres.treebase.domain.study.UPGMAAlgorithm; import org.cipres.treebase.framework.ExecutionResult; import org.cipres.treebase.web.Constants; import org.cipres.treebase.web.model.AnalysisCommand; @@ -128,11 +131,17 @@ algorithmType = Constants.ALGORITHM_LIKELIHOOD; } else if (algorithm instanceof ParsimonyAlgorithm) { algorithmType = Constants.ALGORITHM_PARSIMONY; - } else if (algorithm instanceof DistanceAlgorithm) { - algorithmType = Constants.ALGORITHM_DISTANCE; - } else if (algorithm instanceof OtherAlgorithm) { + } else if (algorithm instanceof OtherAlgorithm) { algorithmType = Constants.ALGORITHM_OTHER; - } + }else if (algorithm instanceof BayesianAlgorithm) { + algorithmType = Constants.ALGORITHM_Bayesian; + } else if (algorithm instanceof EvolutionAlgorithm) { + algorithmType = Constants.ALGORITHM_Evolution; + } else if (algorithm instanceof JoiningAlgorithm) { + algorithmType = Constants.ALGORITHM_Joining; + } else if (algorithm instanceof UPGMAAlgorithm) { + algorithmType = Constants.ALGORITHM_UPGMA; + } // add algorithm type for analysisStepCommand analysisStepCommand.setAlgorithmType(algorithmType); Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SearchSummaryController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SearchSummaryController.java 2010-02-19 21:50:27 UTC (rev 516) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SearchSummaryController.java 2010-02-24 14:53:46 UTC (rev 517) @@ -27,13 +27,16 @@ import org.cipres.treebase.domain.study.AnalyzedData; import org.cipres.treebase.domain.study.AnalyzedMatrix; import org.cipres.treebase.domain.study.AnalyzedTree; -import org.cipres.treebase.domain.study.DistanceAlgorithm; +import org.cipres.treebase.domain.study.BayesianAlgorithm; +import org.cipres.treebase.domain.study.EvolutionAlgorithm; +import org.cipres.treebase.domain.study.JoiningAlgorithm; import org.cipres.treebase.domain.study.LikelihoodAlgorithm; import org.cipres.treebase.domain.study.OtherAlgorithm; import org.cipres.treebase.domain.study.ParsimonyAlgorithm; import org.cipres.treebase.domain.study.Study; import org.cipres.treebase.domain.study.StudyService; import org.cipres.treebase.domain.study.Submission; +import org.cipres.treebase.domain.study.UPGMAAlgorithm; import org.cipres.treebase.domain.taxon.Taxon; import org.cipres.treebase.domain.taxon.TaxonLabel; import org.cipres.treebase.domain.taxon.TaxonLabelService; @@ -197,11 +200,19 @@ algorithmType = Constants.ALGORITHM_LIKELIHOOD; } else if (algorithm instanceof ParsimonyAlgorithm) { algorithmType = Constants.ALGORITHM_PARSIMONY; - } else if (algorithm instanceof DistanceAlgorithm) { - algorithmType = Constants.ALGORITHM_DISTANCE; - } else if (algorithm instanceof OtherAlgorithm) { + }else if (algorithm instanceof OtherAlgorithm) { algorithmType = Constants.ALGORITHM_OTHER; - } + }else if (algorithm instanceof BayesianAlgorithm) { + algorithmType = Constants.ALGORITHM_Bayesian; + } else if (algorithm instanceof EvolutionAlgorithm) { + algorithmType = Constants.ALGORITHM_Evolution; + } else if (algorithm instanceof JoiningAlgorithm) { + algorithmType = Constants.ALGORITHM_Joining; + } else if (algorithm instanceof UPGMAAlgorithm) { + algorithmType = Constants.ALGORITHM_UPGMA; + } + + // add algorithm type for analysisStepCommand analysisStepCommand.setAlgorithmType(algorithmType); @@ -336,11 +347,18 @@ algorithmType = Constants.ALGORITHM_LIKELIHOOD; } else if (algorithm instanceof ParsimonyAlgorithm) { algorithmType = Constants.ALGORITHM_PARSIMONY; - } else if (algorithm instanceof DistanceAlgorithm) { - algorithmType = Constants.ALGORITHM_DISTANCE; - } else if (algorithm instanceof OtherAlgorithm) { + }else if (algorithm instanceof OtherAlgorithm) { algorithmType = Constants.ALGORITHM_OTHER; - } + }else if (algorithm instanceof BayesianAlgorithm) { + algorithmType = Constants.ALGORITHM_Bayesian; + }else if (algorithm instanceof EvolutionAlgorithm) { + algorithmType = Constants.ALGORITHM_Evolution; + }else if (algorithm instanceof JoiningAlgorithm) { + algorithmType = Constants.ALGORITHM_Joining; + }else if (algorithm instanceof UPGMAAlgorithm) { + algorithmType = Constants.ALGORITHM_UPGMA; + } + // add algorithm type for analysisStepCommand analysisStepCommand.setAlgorithmType(algorithmType); Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SummaryController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SummaryController.java 2010-02-19 21:50:27 UTC (rev 516) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SummaryController.java 2010-02-24 14:53:46 UTC (rev 517) @@ -26,8 +26,10 @@ import org.cipres.treebase.domain.study.AnalyzedMatrix; import org.cipres.treebase.domain.study.AnalyzedTree; import org.cipres.treebase.domain.study.ArticleCitation; +import org.cipres.treebase.domain.study.BayesianAlgorithm; import org.cipres.treebase.domain.study.Citation; -import org.cipres.treebase.domain.study.DistanceAlgorithm; +import org.cipres.treebase.domain.study.EvolutionAlgorithm; +import org.cipres.treebase.domain.study.JoiningAlgorithm; import org.cipres.treebase.domain.study.LikelihoodAlgorithm; import org.cipres.treebase.domain.study.OtherAlgorithm; import org.cipres.treebase.domain.study.ParsimonyAlgorithm; @@ -35,6 +37,7 @@ import org.cipres.treebase.domain.study.StudyService; import org.cipres.treebase.domain.study.Submission; import org.cipres.treebase.domain.study.SubmissionService; +import org.cipres.treebase.domain.study.UPGMAAlgorithm; import org.cipres.treebase.web.Constants; import org.cipres.treebase.web.model.AnalysisCommand; import org.cipres.treebase.web.model.AnalysisStepCommand; @@ -212,11 +215,18 @@ algorithmType = Constants.ALGORITHM_LIKELIHOOD; } else if (algorithm instanceof ParsimonyAlgorithm) { algorithmType = Constants.ALGORITHM_PARSIMONY; - } else if (algorithm instanceof DistanceAlgorithm) { - algorithmType = Constants.ALGORITHM_DISTANCE; } else if (algorithm instanceof OtherAlgorithm) { algorithmType = Constants.ALGORITHM_OTHER; - } + }else if (algorithm instanceof BayesianAlgorithm) { + algorithmType = Constants.ALGORITHM_Bayesian; + } else if (algorithm instanceof EvolutionAlgorithm) { + algorithmType = Constants.ALGORITHM_Evolution; + } else if (algorithm instanceof JoiningAlgorithm) { + algorithmType = Constants.ALGORITHM_Joining; + } else if (algorithm instanceof UPGMAAlgorithm) { + algorithmType = Constants.ALGORITHM_UPGMA; + } + // add algorithm type for analysisStepCommand analysisStepCommand.setAlgorithmType(algorithmType); Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/listeners/StartupListener.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/listeners/StartupListener.java 2010-02-19 21:50:27 UTC (rev 516) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/listeners/StartupListener.java 2010-02-24 14:53:46 UTC (rev 517) @@ -73,7 +73,10 @@ List algorithmTypes = new ArrayList(); algorithmTypes.add(Constants.ALGORITHM_LIKELIHOOD); algorithmTypes.add(Constants.ALGORITHM_PARSIMONY); - algorithmTypes.add(Constants.ALGORITHM_DISTANCE); + algorithmTypes.add(Constants.ALGORITHM_Bayesian); + algorithmTypes.add(Constants.ALGORITHM_Evolution); + algorithmTypes.add(Constants.ALGORITHM_Joining); + algorithmTypes.add(Constants.ALGORITHM_UPGMA); algorithmTypes.add(Constants.ALGORITHM_OTHER); context.setAttribute(Constants.ALGORITHM_TYPES, algorithmTypes); Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/model/AnalysisStepCommand.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/model/AnalysisStepCommand.java 2010-02-19 21:50:27 UTC (rev 516) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/model/AnalysisStepCommand.java 2010-02-24 14:53:46 UTC (rev 517) @@ -12,11 +12,14 @@ import org.cipres.treebase.domain.matrix.PolyTCount; import org.cipres.treebase.domain.study.Algorithm; import org.cipres.treebase.domain.study.AnalysisStep; -import org.cipres.treebase.domain.study.DistanceAlgorithm; +import org.cipres.treebase.domain.study.BayesianAlgorithm; +import org.cipres.treebase.domain.study.EvolutionAlgorithm; +import org.cipres.treebase.domain.study.JoiningAlgorithm; import org.cipres.treebase.domain.study.LikelihoodAlgorithm; import org.cipres.treebase.domain.study.OtherAlgorithm; import org.cipres.treebase.domain.study.ParsimonyAlgorithm; import org.cipres.treebase.domain.study.Software; +import org.cipres.treebase.domain.study.UPGMAAlgorithm; import org.cipres.treebase.web.Constants; /** @@ -47,7 +50,10 @@ private List<String> mUniqueAlgorithmDescriptions; public AnalysisStepCommand() { - algorithmMap.put(Constants.ALGORITHM_DISTANCE, new DistanceAlgorithm()); + algorithmMap.put(Constants.ALGORITHM_Bayesian, new BayesianAlgorithm()); + algorithmMap.put(Constants.ALGORITHM_Evolution, new EvolutionAlgorithm()); + algorithmMap.put(Constants.ALGORITHM_Joining, new JoiningAlgorithm()); + algorithmMap.put(Constants.ALGORITHM_UPGMA, new UPGMAAlgorithm()); algorithmMap.put(Constants.ALGORITHM_LIKELIHOOD, new LikelihoodAlgorithm()); algorithmMap.put(Constants.ALGORITHM_OTHER, new OtherAlgorithm()); // ParsimonyAlgorithm parsimonyAlgorithm = new ParsimonyAlgorithm(); Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/util/ControllerUtil.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/util/ControllerUtil.java 2010-02-19 21:50:27 UTC (rev 516) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/util/ControllerUtil.java 2010-02-24 14:53:46 UTC (rev 517) @@ -17,12 +17,15 @@ import org.cipres.treebase.domain.study.Algorithm; import org.cipres.treebase.domain.study.Analysis; import org.cipres.treebase.domain.study.AnalysisStep; -import org.cipres.treebase.domain.study.DistanceAlgorithm; +import org.cipres.treebase.domain.study.BayesianAlgorithm; +import org.cipres.treebase.domain.study.EvolutionAlgorithm; +import org.cipres.treebase.domain.study.JoiningAlgorithm; import org.cipres.treebase.domain.study.LikelihoodAlgorithm; import org.cipres.treebase.domain.study.OtherAlgorithm; import org.cipres.treebase.domain.study.ParsimonyAlgorithm; import org.cipres.treebase.domain.study.Study; import org.cipres.treebase.domain.study.StudyService; +import org.cipres.treebase.domain.study.UPGMAAlgorithm; import org.cipres.treebase.web.Constants; import org.cipres.treebase.web.exceptions.EmptyStudyException; @@ -246,8 +249,14 @@ type = Constants.ALGORITHM_LIKELIHOOD; } else if (algorithm instanceof ParsimonyAlgorithm) { type = Constants.ALGORITHM_PARSIMONY; - } else if (algorithm instanceof DistanceAlgorithm) { - type = Constants.ALGORITHM_DISTANCE; + } else if (algorithm instanceof BayesianAlgorithm) { + type = Constants.ALGORITHM_Bayesian; + } else if (algorithm instanceof EvolutionAlgorithm) { + type = Constants.ALGORITHM_Evolution; + } else if (algorithm instanceof JoiningAlgorithm) { + type = Constants.ALGORITHM_Joining; + } else if (algorithm instanceof UPGMAAlgorithm) { + type = Constants.ALGORITHM_UPGMA; } else if (algorithm instanceof OtherAlgorithm) { type = Constants.ALGORITHM_OTHER; } Modified: trunk/treebase-web/src/main/webapp/WEB-INF/pages/submissionSummaryView.jsp =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/pages/submissionSummaryView.jsp 2010-02-19 21:50:27 UTC (rev 516) +++ trunk/treebase-web/src/main/webapp/WEB-INF/pages/submissionSummaryView.jsp 2010-02-24 14:53:46 UTC (rev 517) @@ -11,16 +11,31 @@ </legend> Submission: <c:out value="${submissionNumber}"/>, <c:out value="${studyStatus}"/>, <a href="/treebase-web/admin/changeStudyStatus.html"> Update Status</a><br/> Submission initiated: <c:out value="${initiatedDate}"/><br/> -<a href='mailto:${submission.submitter.emailAddressString}?subject=TreeBASE Submission S${submission.id}'> - <img class="iconButton" alt="mail" src="<fmt:message key="icons.email"/>" /> - Contact Submitter -</a> -<br/> -<a href="<c:out value="${submission.study.phyloWSPath.purl}"/>?x-access-code=<c:out value="${submission.study.namespacedGUID.hashedIDString}"/>&format=html"> - <img class="iconButton" alt="link" src="<fmt:message key="icons.weblink"/>" /> - Reviewer access URL: right-click and copy -</a> +<%if(request.isUserInRole("Admin") || request.isUserInRole("Associate Editor")){%> + <a href='mailto:${submission.submitter.emailAddressString}?subject=TreeBASE Submission S${submission.id}'> + <img class="iconButton" alt="mail" src="<fmt:message key="icons.email"/>" /> + Contact Submitter + </a> + <br/> + <a href="<c:out value="${submission.study.phyloWSPath.purl}"/>?x-access-code=<c:out value="${submission.study.namespacedGUID.hashedIDString}"/>&format=html"> + <img class="iconButton" alt="link" src="<fmt:message key="icons.weblink"/>" /> + Reviewer access URL: right-click and copy + </a> +<% } %> + +<%if(request.isUserInRole("User") ){%> + <a href='mailto:he...@tr...?subject=TreeBASE Submission S${submission.id}'> + <img class="iconButton" alt="mail" src="<fmt:message key="icons.email"/>" /> + Contact TreeBASE Help + </a> + <br/> + <a href="<c:out value="http://purl.org/phylo/treebase/phylows/study/TB2:S"/><c:out value="${submission.study.id}"/>"> + <img class="iconButton" alt="link" src="<fmt:message key="icons.weblink"/>" /> + Study Accession URL: right-click and copy + </a> +<% } %> + <c:if test="${not empty citationsummary.study}"> <c:if test="${not empty citationsummary.study.name}"> Study name: <c:out value="${citationsummary.study.name}"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yo...@us...> - 2010-03-29 19:35:09
|
Revision: 659 http://treebase.svn.sourceforge.net/treebase/?rev=659&view=rev Author: youjun Date: 2010-03-29 19:34:59 +0000 (Mon, 29 Mar 2010) Log Message: ----------- fix delete matrix, fix limitedphylowidget zooming tool Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/dao/jdbc/MatrixJDBC.java trunk/treebase-core/src/main/java/org/cipres/treebase/dao/matrix/MatrixDAO.java trunk/treebase-core/src/main/java/org/cipres/treebase/dao/taxon/TaxonLabelDAO.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/CharacterMatrix.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/MatrixHome.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/TaxonLabel.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/TaxonLabelHome.java trunk/treebase-core/src/main/resources/applicationContext-dao.xml trunk/treebase-phylowidget/build.properties trunk/treebase-web/src/main/resources/ApplicationResources.properties trunk/treebase-web/src/main/webapp/test/phylowidget/PhyloWidget.jar Added Paths: ----------- trunk/treebase-phylowidget/data/menus/limited-menus.xml Removed Paths: ------------- trunk/treebase-phylowidget/data/menus/nondb-menus.xml Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/dao/jdbc/MatrixJDBC.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/dao/jdbc/MatrixJDBC.java 2010-03-27 01:02:51 UTC (rev 658) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/dao/jdbc/MatrixJDBC.java 2010-03-29 19:34:59 UTC (rev 659) @@ -124,6 +124,28 @@ } /** + * Delete all rows and associated objects using direct SQL. + * + * @param pMatrix + * @param pSession + */ + public static void deleteMatrixRowSQL(CharacterMatrix pMatrix, Session pSession) { + // delete all matrix rows by direct JDBC: + // * delete all row segments + // * delete all rows + + String query = "DELETE FROM ROWSEGMENT WHERE MATRIXROW_ID in (select row.MATRIXROW_ID from MATRIXROW row where row.MATRIX_ID = :matrixID)"; + Query q = pSession.createSQLQuery(query); + q.setParameter("matrixID", pMatrix.getId()); + q.executeUpdate(); + + query = "DELETE FROM MATRIXROW WHERE MATRIX_ID = :matrixID"; + q = pSession.createSQLQuery(query); + q.setParameter("matrixID", pMatrix.getId()); + q.executeUpdate(); + + } + /** * Delete all elements and associated objects in a matrix using direct SQL. * * @param pTree @@ -153,8 +175,8 @@ q.setParameter("matrixID", pMatrix.getId()); q.executeUpdate(); - query = "delete from matrixelement where matrixelement_id IN " - + "(select m.matrixelement_id from matrixelement m, MATRIXCOLUMN c where m.MATRIXCOLUMN_ID = c.MATRIXCOLUMN_ID and c.MATRIX_ID = :matrixID)"; + query = "DELETE FROM matrixelement WHERE matrixcolumn_id IN" + + "(SELECT c.matrixcolumn_id FROM matrixcolumn c WHERE c.matrix_id = :matrixID)"; q = pSession.createSQLQuery(query); q.setParameter("matrixID", pMatrix.getId()); q.executeUpdate(); Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/dao/matrix/MatrixDAO.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/dao/matrix/MatrixDAO.java 2010-03-27 01:02:51 UTC (rev 658) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/dao/matrix/MatrixDAO.java 2010-03-29 19:34:59 UTC (rev 659) @@ -28,6 +28,9 @@ import org.cipres.treebase.domain.study.Study; import org.cipres.treebase.domain.study.Submission; import org.cipres.treebase.domain.study.SubmissionHome; +import org.cipres.treebase.domain.taxon.TaxonLabel; +import org.cipres.treebase.domain.taxon.TaxonLabelHome; +import org.cipres.treebase.domain.taxon.TaxonLabelSet; import org.apache.log4j.Logger; import org.hibernate.Criteria; @@ -50,7 +53,8 @@ private MatrixRowHome mMatrixRowHome; private SubmissionHome mSubmissionHome; private AnalyzedDataHome mAnalyzedDataHome; - + private TaxonLabelHome mTaxonLabelHome; + /** * Constructor. */ @@ -107,6 +111,25 @@ } /** + * set the TaxonLabelHome field. + */ + public void setTaxonLabelHome(TaxonLabelHome pNewTaxonLabelHome) { + mTaxonLabelHome = pNewTaxonLabelHome; + } + + /** + * Return the TaxonLabelHome field. + * + * + * @return TaxonLabelHome mTaxonLabelHome + */ + private TaxonLabelHome getTaxonLabelHome() { + return mTaxonLabelHome; + } + + + + /** * Return the SubmissionHome field. * * @return SubmissionHome mSubmissionHome @@ -138,6 +161,35 @@ /** * + * @see org.cipres.treebase.domain.matrix.MatrixHome#cascadeDelete(org.cipres.treebase.domain.matrix.CharacterMatrix) + */ + public void cascadeDelete(CharacterMatrix pMatrix) { + + // bi-directional relationships: + // * delete submission-> matrix + // * delete analyzedData -> matrix + Submission sub = getSubmissionHome().findByMatrix(pMatrix); + if (sub != null) { + sub.removeMatrix(pMatrix); + } + + Collection<AnalyzedData> dataLink = getAnalyzedDataHome().findByMatrix(pMatrix); + for (AnalyzedData data : dataLink) { + data.getAnalysisStep().removeAnalyzedData(data); + } + + TaxonLabelSet tSet = pMatrix.getTaxa(); + List<TaxonLabel> tList = pMatrix.getAllTaxonLabels(); + + getHibernateTemplate().delete(pMatrix); + + getTaxonLabelHome().clean(tSet); + getTaxonLabelHome().clean(tList); + + } + + /** + * * @see org.cipres.treebase.domain.matrix.MatrixHome#delete(org.cipres.treebase.domain.matrix.Matrix) */ public void delete(Matrix pMatrix) { @@ -145,21 +197,8 @@ // Use double dispatch. pMatrix.cascadeDelete(this); - - // bi-directional relationships: - // * delete submission-> matrix - // * delete analyzedData -> matrix - Submission sub = getSubmissionHome().findByMatrix(pMatrix); - if (sub != null) { - sub.removeMatrix(pMatrix); - } - - Collection<AnalyzedData> dataLink = getAnalyzedDataHome().findByMatrix(pMatrix); - for (AnalyzedData data : dataLink) { - data.getAnalysisStep().removeAnalyzedData(data); - } - - getHibernateTemplate().delete(pMatrix); + + } } @@ -184,8 +223,17 @@ getMatrixRowHome().deleteRows(pRows); } + /** * + * @see org.cipres.treebase.domain.matrix.MatrixHome#cascadeDeleteRows(java.util.Collection) + */ + public void cascadeDeleteRows(CharacterMatrix pMatrix) { + MatrixJDBC.deleteMatrixRowSQL(pMatrix,getSession()); + } + + /** + * * @see org.cipres.treebase.domain.matrix.MatrixHome#cascadeDeleteAncStateSet(java.util.Set) */ public void cascadeDeleteAncStateSet(Set<AncStateSet> pAncStateSets) { Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/dao/taxon/TaxonLabelDAO.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/dao/taxon/TaxonLabelDAO.java 2010-03-27 01:02:51 UTC (rev 658) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/dao/taxon/TaxonLabelDAO.java 2010-03-29 19:34:59 UTC (rev 659) @@ -466,12 +466,12 @@ Query q = getSession() .createQuery("select count(*) from TreeBlock tb where tb.taxonLabelSet = :ts"); q.setParameter("ts", tSet); - int count=((Integer)q.iterate().next()).intValue(); + int count=((Long)q.iterate().next()).intValue(); q = getSession() .createQuery("select count(*) from Matrix m where m.taxa = :ts"); q.setParameter("ts", tSet); - count += ((Integer)q.iterate().next()).intValue(); + count += ((Long)q.iterate().next()).intValue(); if(count==0)deletePersist(tSet); } @@ -482,12 +482,12 @@ Query q = getSession() .createQuery("select count(*) from PhyloTreeNode pn where pn.taxonLabel = :tl"); q.setParameter("tl", tl); - int count=((Integer)q.iterate().next()).intValue(); + int count=((Long)q.iterate().next()).intValue(); q = getSession() .createQuery("select count(*) from MatrixRow mr where mr.taxonLabel = :tl"); q.setParameter("tl", tl); - count += ((Integer)q.iterate().next()).intValue(); + count += ((Long)q.iterate().next()).intValue(); if(count==0)deletePersist(tl); } Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/CharacterMatrix.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/CharacterMatrix.java 2010-03-27 01:02:51 UTC (rev 658) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/CharacterMatrix.java 2010-03-29 19:34:59 UTC (rev 659) @@ -83,7 +83,7 @@ * * @return CodonPositionSet */ - @OneToOne(cascade = {CascadeType.PERSIST, CascadeType.MERGE}) + @OneToOne(cascade = {CascadeType.ALL}) @JoinColumn(name = "CODONPOSITIONSET_ID", nullable = true) public CodonPositionSet getDefaultCodonPosSet() { return mDefaultCodonPosSet; @@ -111,7 +111,7 @@ * * @return CharWeightSet */ - @OneToOne(cascade = {CascadeType.PERSIST, CascadeType.MERGE}) + @OneToOne(cascade = {CascadeType.ALL}) @JoinColumn(name = "CHARWEIGHTSET_ID", nullable = true) public CharWeightSet getDefaultWeightSet() { return mDefaultWeightSet; @@ -139,7 +139,7 @@ * * @return ExcludedCharSet */ - @OneToOne(cascade = {CascadeType.PERSIST, CascadeType.MERGE}) + @OneToOne(cascade = {CascadeType.ALL}) @JoinColumn(name = "CHARSET_ID", nullable = true) public ExcludedCharSet getDefaultExcludedSet() { return mDefaultExcludedSet; @@ -167,7 +167,7 @@ * * @return TypeSet mDefaultTypeSet */ - @OneToOne(cascade = {CascadeType.PERSIST, CascadeType.MERGE}) + @OneToOne(cascade = {CascadeType.ALL}) @JoinColumn(name = "TYPESET_ID", nullable = true) public TypeSet getDefaultTypeSet() { return mDefaultTypeSet; @@ -332,7 +332,7 @@ * * @return AncStateSet */ - @OneToOne(cascade = {CascadeType.PERSIST, CascadeType.MERGE}) + @OneToOne(cascade = {CascadeType.ALL}) @JoinColumn(name = "ANCSTATESET_ID", nullable = true) public AncStateSet getDefaultAncSet() { return mDefaultAncSet; @@ -358,7 +358,7 @@ //@OneToMany(cascade = CascadeType.ALL) // no cascade merge since we do not modify a column ?? Need test. //@OneToMany(cascade = {CascadeType.PERSIST, CascadeType.REMOVE}) - @OneToMany + @OneToMany(cascade = {CascadeType.ALL}) @JoinColumn(name = "MATRIX_ID") @IndexColumn(name = "COLUMN_ORDER") @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE, region = "matrixCache") @@ -445,10 +445,10 @@ // private Set<CodonPositionSet> mCodonPosSets; // private Set<GeneticCodeSet> mCodeSets; // private Set<TypeSet> mTypeSets; - - pMatrixHome.cascadeDeleteElements(this); - pMatrixHome.cascadeDeleteRows(getRows()); - pMatrixHome.cascadeDeleteColumns(this); + pMatrixHome.cascadeDelete(this); + //pMatrixHome.cascadeDeleteElements(this); + //pMatrixHome.cascadeDeleteRows(this); + //pMatrixHome.cascadeDeleteColumns(this); // pMatrixHome.cascadeDeleteAncStateSet(getAncStateSets()); // pMatrixHome.cascadeDeleteCharWeightSet(getWeightSets()); @@ -508,7 +508,7 @@ // the one side has to be the owner side, cannot use "mappedby" // also need to duplicate specify the JoinColumn here. // @OneToMany(mappedBy = "matrix", cascade = CascadeType.ALL) - @OneToMany(cascade = {CascadeType.MERGE, CascadeType.PERSIST}) + @OneToMany(cascade = {CascadeType.ALL}) @JoinColumn(name = "MATRIX_ID") @IndexColumn(name = "ROW_ORDER") @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE, region = "matrixCache") Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/MatrixHome.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/MatrixHome.java 2010-03-27 01:02:51 UTC (rev 658) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/MatrixHome.java 2010-03-29 19:34:59 UTC (rev 659) @@ -55,14 +55,14 @@ * @param pMatrix */ void cascadeDeleteColumns(CharacterMatrix pMatrix); - + void cascadeDelete(CharacterMatrix pMatrix); /** * Delete a collection of matrix rows. * * @param pRows */ void cascadeDeleteRows(Collection<MatrixRow> pRows); - + void cascadeDeleteRows(CharacterMatrix pMatrix); /** * Delete a collection of ancestral state sets. * Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/TaxonLabel.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/TaxonLabel.java 2010-03-27 01:02:51 UTC (rev 658) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/TaxonLabel.java 2010-03-29 19:34:59 UTC (rev 659) @@ -10,6 +10,8 @@ import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.JoinColumn; +import javax.persistence.JoinTable; +import javax.persistence.ManyToMany; import javax.persistence.ManyToOne; import javax.persistence.Table; import javax.persistence.Transient; @@ -54,6 +56,7 @@ private TaxonVariant mTaxonVariant; private Study mStudy; + private Submission mSubmission; /** * Constructor. @@ -173,14 +176,28 @@ * * @return the submission * @author mjd 20080929 + * modified by Youjun */ - @Transient + @ManyToOne(cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH}) + @JoinTable(name = "sub_taxonlabel", + joinColumns = @JoinColumn(name = "taxonlabel_id"), + inverseJoinColumns = @JoinColumn(name="submission_id") + + ) public Submission getSubmission() { - Study s = getStudy(); - return s == null ? null : s.getSubmission(); + + return mSubmission; } /** + * Set the Submission field. + */ + public void setSubmission(Submission pNewSubmission) { + mSubmission = pNewSubmission; + } + + + /** * Return the taxon name if it available. */ @Transient Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/TaxonLabelHome.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/TaxonLabelHome.java 2010-03-27 01:02:51 UTC (rev 658) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/TaxonLabelHome.java 2010-03-29 19:34:59 UTC (rev 659) @@ -2,6 +2,7 @@ package org.cipres.treebase.domain.taxon; import java.util.Collection; +import java.util.List; import java.util.Set; import org.cipres.treebase.domain.DomainHome; @@ -229,4 +230,15 @@ * @return All taxonlabelsets of which this taxonlabel is a member */ Set<TaxonLabelSet> findTaxonLabelSets(TaxonLabel tl); + + /** + * clean orphan record @ TaxonLabelSet + */ + public void clean(TaxonLabelSet tSet); + + /** + * clean orphan record @ TaxonLabel + */ + public void clean(List<TaxonLabel> tList); + } Modified: trunk/treebase-core/src/main/resources/applicationContext-dao.xml =================================================================== --- trunk/treebase-core/src/main/resources/applicationContext-dao.xml 2010-03-27 01:02:51 UTC (rev 658) +++ trunk/treebase-core/src/main/resources/applicationContext-dao.xml 2010-03-29 19:34:59 UTC (rev 659) @@ -173,6 +173,7 @@ <property name="matrixRowHome" ref="matrixRowHome" /> <property name="submissionHome" ref="submissionHome" /> <property name="analyzedDataHome" ref="analyzedDataHome" /> + <property name="taxonLabelHome" ref="taxonLabelHome" /> </bean> </property> </bean> Modified: trunk/treebase-phylowidget/build.properties =================================================================== --- trunk/treebase-phylowidget/build.properties 2010-03-27 01:02:51 UTC (rev 658) +++ trunk/treebase-phylowidget/build.properties 2010-03-29 19:34:59 UTC (rev 659) @@ -49,7 +49,7 @@ # Whether or not to try and sign the jar. signjar = true # Whether or not to generate a new key. Set the value to true if it is the first time to run ant build in this machine. -signjar.genkey = false +signjar.genkey = true # Your keystore alias and password. signjar.alias = phylowidget signjar.storepass = birdman Added: trunk/treebase-phylowidget/data/menus/limited-menus.xml =================================================================== --- trunk/treebase-phylowidget/data/menus/limited-menus.xml (rev 0) +++ trunk/treebase-phylowidget/data/menus/limited-menus.xml 2010-03-29 19:34:59 UTC (rev 659) @@ -0,0 +1,81 @@ +<menuset name="PhyloWidget Menus"> + <menu type="Toolbar" fontsize="11" x="2" y="2"> + <item name="File"> + <!--item name="New Tree" action="treeNew" shortcut="control-n"/--> + <!--item name="Load Tree..." action="treeLoad"/--> + <item name="Save Tree..." action="treeSave"/> + <!--item name="Save Tree To Database" action="treeSaveToDB"/--> + <item name="Export Image"> + <item name="Large (1600x1200)" action="fileOutputBig"/> + <item name="Small (640 x 480)" action="fileOutputSmall"/> + <item name="PDF" action="fileOutputPDF"/> + </item> + </item> + <item name="View"> + <item name="Zoom to Full" action="viewZoomToFull" shortcut="control-F"/> + <item name="Renderer Type"> + <item name="Rectangular" action="viewRectangular" shortcut="control-1"/> + <item name="Diagonal" action="viewDiagonal" shortcut="control-2"/> + <item name="Circular" action="viewCircular" shortcut="control-3"/> + </item> + <item name="Show/Hide"> + <item name="Branch Lengths" type="CheckBox" property="showBranchLengths" value="false"/> + <item name="Inner Clade Labels" type="CheckBox" property="showCladeLabels" value="false"/> + </item> + <item name="Style"> + <item name="Text Angle" type="NumberScroller" property="textRotation" increment=".5" default="0" min="-45" max="45"/> + <item name="Node Size" type="NumberScroller" property="nodeSize" increment =".005" default=".2" min="0" max=".5"/> + <item name="Line Weight" type="NumberScroller" property="lineSize" increment =".001" default=".1" min="0" max=".5"/> + </item> + <item name="Render Threshold" type="NumberScroller" property="renderThreshold" increment="5" default="150" min="5" max="1000"/> + <item name="Minimum Text Size" type="NumberScroller" property="minTextSize" increment =".1" default="10" min="0" max="36"/> + <!-- <item name="Stretch Tree to Fit" type="CheckBox" property="fitTreeToWindow" /> --> + <item name="Use Branch Lengths" type="CheckBox" property="useBranchLengths" shortcut="ctrl-b" /> + </item> + <!--item name="Tree"> + <item name="Mutate Once" action="treeMutateOnce" shortcut="control-m"/> + <item name="Mutate Slow" action="treeMutateSlow"/> + <item name="Mutate Fast" action="treeMutateFast"/> + <item name="Stop Mutating" action="treeStopMutating" shortcut="control-shift-m"/> + </item> + <item name="Flip Tree" action="treeFlip" shortcut="control-R"/> + <item name="Auto-sort Tree" action="treeAutoSort" shortcut="control-L"/> + <item name="Remove Elbows" action="treeRemoveElbows" shortcut="control-E"/> + </item--> + </menu> + + <menu name="dock" type="ToolDock" width="30" rotation="left"> + <!-- the "rotation" parameter can have the values: left, right, top, bottom --> + <item name="Arrow" tool="arrow" shortcut="a" icon="dock/arrow.png"/> + <item name="Scroll" tool="scroll" shortcut="s" icon="dock/grab.png"/> + <item name="Zoom" tool="zoom" shortcut="z" icon="dock/zoom.png"/> + </menu> + + <menu name="context" type="org.phylowidget.ui.PhyloContextMenu"> + <!--item name="Tree Edit" hint="t"> + <item name="Add" hint="a"> + <item name="Child" action="nodeAddChild" hint="c"/> + <item name="Sister" action="nodeAddSister" hint="s"/> + </item> + <item name="Delete" hint="d"> + <item name="This node" action="nodeDelete" hint="t"/> + <item name="Subtree" action="nodeDeleteSubtree" hint="s"/> + </item> + </item--> + <item name="Layout" hint="a"> + <item name="Reroot" action="nodeReroot" hint="r"/> + <item name="Flip subtree" action="nodeFlipSubtree" hint="f"/> + <item name="Switch children" action="nodeSwitchChildren" hint="s"/> + </item> + <!--item name="Clipboard" hint="c"> + <item name="Cut" action="nodeCut" hint="x"/> + <item name="Copy" action="nodeCopy" hint="c"/> + <item name="Paste" action="nodePaste" hint="v"/> + <item name="Clear" action="nodeClearClipboard" hint="r"/> + </item--> + <!--item name="Node Edit" hint="e"> + <item name="Name" action="nodeEditName" hint="n"/> + <item name="Branch length" action="nodeEditBranchLength" hint="b"/> + </item--> + </menu> +</menuset> Deleted: trunk/treebase-phylowidget/data/menus/nondb-menus.xml =================================================================== --- trunk/treebase-phylowidget/data/menus/nondb-menus.xml 2010-03-27 01:02:51 UTC (rev 658) +++ trunk/treebase-phylowidget/data/menus/nondb-menus.xml 2010-03-29 19:34:59 UTC (rev 659) @@ -1,81 +0,0 @@ -<menuset name="PhyloWidget Menus"> - <menu type="Toolbar" fontsize="11" x="2" y="2"> - <item name="File"> - <!--item name="New Tree" action="treeNew" shortcut="control-n"/--> - <!--item name="Load Tree..." action="treeLoad"/--> - <item name="Save Tree..." action="treeSave"/> - <!--item name="Save Tree To Database" action="treeSaveToDB"/--> - <item name="Export Image"> - <item name="Large (1600x1200)" action="fileOutputBig"/> - <item name="Small (640 x 480)" action="fileOutputSmall"/> - <item name="PDF" action="fileOutputPDF"/> - </item> - </item> - <item name="View"> - <item name="Zoom to Full" action="viewZoomToFull" shortcut="control-F"/> - <item name="Renderer Type"> - <item name="Rectangular" action="viewRectangular" shortcut="control-1"/> - <item name="Diagonal" action="viewDiagonal" shortcut="control-2"/> - <item name="Circular" action="viewCircular" shortcut="control-3"/> - </item> - <item name="Show/Hide"> - <item name="Branch Lengths" type="CheckBox" property="showBranchLengths" value="false"/> - <item name="Inner Clade Labels" type="CheckBox" property="showCladeLabels" value="false"/> - </item> - <item name="Style"> - <item name="Text Angle" type="NumberScroller" property="textRotation" increment=".5" default="0" min="-45" max="45"/> - <item name="Node Size" type="NumberScroller" property="nodeSize" increment =".005" default=".2" min="0" max=".5"/> - <item name="Line Weight" type="NumberScroller" property="lineSize" increment =".001" default=".1" min="0" max=".5"/> - </item> - <item name="Render Threshold" type="NumberScroller" property="renderThreshold" increment="5" default="150" min="5" max="1000"/> - <item name="Minimum Text Size" type="NumberScroller" property="minTextSize" increment =".1" default="10" min="0" max="36"/> - <!-- <item name="Stretch Tree to Fit" type="CheckBox" property="fitTreeToWindow" /> --> - <item name="Use Branch Lengths" type="CheckBox" property="useBranchLengths" shortcut="ctrl-b" /> - </item> - <!--item name="Tree"> - <item name="Mutate Once" action="treeMutateOnce" shortcut="control-m"/> - <item name="Mutate Slow" action="treeMutateSlow"/> - <item name="Mutate Fast" action="treeMutateFast"/> - <item name="Stop Mutating" action="treeStopMutating" shortcut="control-shift-m"/> - </item> - <item name="Flip Tree" action="treeFlip" shortcut="control-R"/> - <item name="Auto-sort Tree" action="treeAutoSort" shortcut="control-L"/> - <item name="Remove Elbows" action="treeRemoveElbows" shortcut="control-E"/> - </item--> - </menu> - - <menu name="dock" type="ToolDock" width="30" rotation="left"> - <!-- the "rotation" parameter can have the values: left, right, top, bottom --> - <item name="Arrow" tool="arrow" shortcut="a" icon="dock/arrow.png"/> - <item name="Scroll" tool="scroll" shortcut="s" icon="dock/grab.png"/> - <item name="Zoom" tool="zoom" shortcut="z" icon="dock/zoom.png"/> - </menu> - - <menu name="context" type="org.phylowidget.ui.PhyloContextMenu"> - <!--item name="Tree Edit" hint="t"> - <item name="Add" hint="a"> - <item name="Child" action="nodeAddChild" hint="c"/> - <item name="Sister" action="nodeAddSister" hint="s"/> - </item> - <item name="Delete" hint="d"> - <item name="This node" action="nodeDelete" hint="t"/> - <item name="Subtree" action="nodeDeleteSubtree" hint="s"/> - </item> - </item--> - <item name="Layout" hint="a"> - <item name="Reroot" action="nodeReroot" hint="r"/> - <item name="Flip subtree" action="nodeFlipSubtree" hint="f"/> - <item name="Switch children" action="nodeSwitchChildren" hint="s"/> - </item> - <!--item name="Clipboard" hint="c"> - <item name="Cut" action="nodeCut" hint="x"/> - <item name="Copy" action="nodeCopy" hint="c"/> - <item name="Paste" action="nodePaste" hint="v"/> - <item name="Clear" action="nodeClearClipboard" hint="r"/> - </item--> - <!--item name="Node Edit" hint="e"> - <item name="Name" action="nodeEditName" hint="n"/> - <item name="Branch length" action="nodeEditBranchLength" hint="b"/> - </item--> - </menu> -</menuset> Modified: trunk/treebase-web/src/main/resources/ApplicationResources.properties =================================================================== --- trunk/treebase-web/src/main/resources/ApplicationResources.properties 2010-03-27 01:02:51 UTC (rev 658) +++ trunk/treebase-web/src/main/resources/ApplicationResources.properties 2010-03-29 19:34:59 UTC (rev 659) @@ -91,6 +91,7 @@ nav.references=References nav.journals=Journals + #-- top navigation menu -- nav.personalinfo = Personal Information nav.submissions=TreeBASE Submissions Modified: trunk/treebase-web/src/main/webapp/test/phylowidget/PhyloWidget.jar =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vga...@us...> - 2010-04-01 20:20:44
|
Revision: 664 http://treebase.svn.sourceforge.net/treebase/?rev=664&view=rev Author: vgapeyev Date: 2010-04-01 20:20:37 +0000 (Thu, 01 Apr 2010) Log Message: ----------- Introducing JNDI parameters (to be used in Tomcat config in treebase-web.xml) PurlBase - instead of a compile-time parameter in treebase.properties; this fixes SF#2978838 SiteUrl - as requested recently, to support redirection to phylowidget.org Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/PhyloWSPath.java trunk/treebase-core/src/main/java/org/cipres/treebase/TreebaseUtil.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/AbstractPersistedObject.java trunk/treebase-core/src/main/resources/treebase.properties trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/AbstractDownloadController.java trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/AnyObjectAsRDFController.java trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SearchResultsAsRDFController.java trunk/treebase-web/src/main/webapp/META-INF/context.xml.example trunk/treebase-web/src/main/webapp/WEB-INF/pages/journal.jsp trunk/treebase-web/src/main/webapp/WEB-INF/pages/submissionSummaryView.jsp trunk/treebase-web/src/main/webapp/WEB-INF/pages/urlAPI.jsp trunk/treebase-web/src/main/webapp/WEB-INF/web.xml Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/PhyloWSPath.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/PhyloWSPath.java 2010-03-31 18:46:29 UTC (rev 663) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/PhyloWSPath.java 2010-04-01 20:20:37 UTC (rev 664) @@ -24,13 +24,12 @@ } /** - * This method constructs a permanent url based on the - * treebase.purl.domain property (as computed by TreebaseUtil.getPurlDomain()), + * Constructs a PURL, based on the base URL of the PURL service (looked up through JNDI) * the phylows path and the namespaced GUID for the object. - * @return the permanent url for the object + * @return the PURL for the object */ public URL getPurl () { - StringBuilder sb = new StringBuilder(TreebaseUtil.getPurlDomain()); + StringBuilder sb = new StringBuilder(TreebaseUtil.getPurlBase()); sb = getPath(sb).append(mNamespacedGUID.toString()); LOGGER.info(sb); URL url = null; Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/TreebaseUtil.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/TreebaseUtil.java 2010-03-31 18:46:29 UTC (rev 663) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/TreebaseUtil.java 2010-04-01 20:20:37 UTC (rev 664) @@ -16,6 +16,9 @@ import java.util.Properties; import java.util.TimeZone; +import javax.naming.InitialContext; +import javax.naming.NamingException; + import org.apache.log4j.Logger; import org.cipres.treebase.domain.study.Citation; import org.cipres.treebase.domain.study.Study; @@ -40,7 +43,8 @@ public static final String LINESEP = System.getProperty("line.separator"); public static final int citationMaxLength = 5000; private static final Logger LOGGER = Logger.getLogger(TreebaseUtil.class); - private static String mPurlDomain; + private static String mPurlBase; + private static String mSiteUrl; private TreebaseUtil() { super(); @@ -435,7 +439,8 @@ * * @return domain name */ - public static String getPurlDomain() { + /*-- + public static String getPurlBase() { if ( null == mPurlDomain ) { Properties properties = new Properties(); try { @@ -459,8 +464,54 @@ return mPurlDomain; } } +*/ + + /** + * Returns the base URL of the PURL service associated with this Treebase instance, + * which can be used to construct full PURLs by suffixing with a PhyloWS command, e.g. "/study/TB2:S1925" + * + * @return the base URL of the PURL service + */ + public static String getPurlBase() { + if (null != mPurlBase) + return mPurlBase; + else { + try { + mPurlBase = "http://DUMMY_PURL_BASE/"; + InitialContext ic = new InitialContext(); + mPurlBase = (String) ic.lookup("java:comp/env/tb2/PurlBase"); + } catch (NamingException e) { + LOGGER.info("Failure looking up tb2/PurlBase via JNDI"); + e.printStackTrace(); + } + return mPurlBase; + } + } + /** + * Returns the base URL of this Treebase instance, by looking it up in Tomcat via JNDI. + * + * @return the base URL of of this Treebase instance + */ + public static String getSiteUrl() { + if (null != mSiteUrl) + return mSiteUrl; + else { + try { + mSiteUrl = "http://DUMMY_SITE_URL/"; + InitialContext ic = new InitialContext(); + mSiteUrl = (String) ic.lookup("java:comp/env/tb2/SiteUrl"); + } catch (NamingException e) { + LOGGER.info("Failure looking up tb2/SiteUrl via JNDI"); + e.printStackTrace(); + } + return mSiteUrl; + } + } + + + /** * This method appends header information upon formatting to the nexus file. * * @param pStudy Study is needed to extract the citation information Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/AbstractPersistedObject.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/AbstractPersistedObject.java 2010-03-31 18:46:29 UTC (rev 663) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/AbstractPersistedObject.java 2010-04-01 20:20:37 UTC (rev 664) @@ -113,7 +113,7 @@ // This is called by child classes using super.getAnnotations() // to get the common annotations out of the way List<Annotation> annotations = new ArrayList<Annotation>(); - URI uri = URI.create(TreebaseUtil.getPurlDomain()+getPhyloWSPath()); + URI uri = URI.create(TreebaseUtil.getPurlBase()+getPhyloWSPath()); annotations.add(new Annotation(Constants.OWLURI,"owl:sameAs",uri)); return annotations; } Modified: trunk/treebase-core/src/main/resources/treebase.properties =================================================================== --- trunk/treebase-core/src/main/resources/treebase.properties 2010-03-31 18:46:29 UTC (rev 663) +++ trunk/treebase-core/src/main/resources/treebase.properties 2010-04-01 20:20:37 UTC (rev 664) @@ -1,3 +1,2 @@ #options are: NexusServiceMesquite | NexusServiceNCL nexus.parser.impl=NexusServiceMesquite -treebase.purl.domain=http://purl.org/phylo/treebase/phylows/ Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/AbstractDownloadController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/AbstractDownloadController.java 2010-03-31 18:46:29 UTC (rev 663) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/AbstractDownloadController.java 2010-04-01 20:20:37 UTC (rev 664) @@ -49,7 +49,7 @@ // .append(':') // .append(request.getServerPort()) // .append("/treebase-web/phylows/"); - properties.setProperty("nexml.uri.base", TreebaseUtil.getPurlDomain()); + properties.setProperty("nexml.uri.base", TreebaseUtil.getPurlBase()); return properties; } Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/AnyObjectAsRDFController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/AnyObjectAsRDFController.java 2010-03-31 18:46:29 UTC (rev 663) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/AnyObjectAsRDFController.java 2010-04-01 20:20:37 UTC (rev 664) @@ -91,7 +91,7 @@ request.getSession().setAttribute("namespacedGUID", namespacedGUID.toString()); // <c:set var="baseURL" value="http://localhost:8080/treebase-web/PhyloWS"/> // treebase.purl.domain=http://purl.org/phylo/treebase/phylows/ - request.getSession().setAttribute("baseURL", TreebaseUtil.getPurlDomain()); + request.getSession().setAttribute("baseURL", TreebaseUtil.getPurlBase()); request.getSession().setAttribute("phyloWSPath", phyloWSPath); return new ModelAndView("anyObjectAsRDF"); } Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SearchResultsAsRDFController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SearchResultsAsRDFController.java 2010-03-31 18:46:29 UTC (rev 663) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SearchResultsAsRDFController.java 2010-04-01 20:20:37 UTC (rev 664) @@ -35,7 +35,7 @@ request.getSession().setAttribute("searchResultsThawed", searchResults); request.getSession().setAttribute("recordSchema", request.getSession().getAttribute("recordSchema")); request.getSession().setAttribute("format", "rss1"); - request.getSession().setAttribute("baseURL", TreebaseUtil.getPurlDomain()); + request.getSession().setAttribute("baseURL", TreebaseUtil.getPurlBase()); request.getSession().setAttribute("phyloWSPath", phyloWSPath); if ( null != request.getParameter("query") ) { String query = request.getParameter("query"); Modified: trunk/treebase-web/src/main/webapp/META-INF/context.xml.example =================================================================== --- trunk/treebase-web/src/main/webapp/META-INF/context.xml.example 2010-03-31 18:46:29 UTC (rev 663) +++ trunk/treebase-web/src/main/webapp/META-INF/context.xml.example 2010-04-01 20:20:37 UTC (rev 664) @@ -16,7 +16,7 @@ <Context reloadable="true"> - <Resource name="jdbc/TreebaseDB" auth="Container" + <Resource name="jdbc/TreebaseDB" auth="Container" type="javax.sql.DataSource" description="The JNDI DataSource for the Treebase postgres instance." driverClassName="org.postgresql.Driver" @@ -25,10 +25,18 @@ maxActive="20" maxIdle="10" maxWait="-1" /> - <Environment name="tb2/MesquiteFolder" value="/PATH/TO/YOUR/mesquite-2.01.tb" + <Environment name="tb2/MesquiteFolder" value="/PATH/TO/YOUR/mesquite-2.01.tb" type="java.lang.String" override="false" description="Absolute path to the directory where headless Mesquite is unpacked on the host system."/> + <Environment name="tb2/SiteUrl" value="http://YOUR-HOST/treebase-web/" + type="java.lang.String" override="false" + description="The base URL from which this Treebase instance is served."/> + + <Environment name="tb2/PurlBase" value="http://purl.org/YOUR/PURL/DOMAIN/phylows/" + type="java.lang.String" override="false" + description="The base URL of a PURL service that redirects to this Treebase instance."/> + </Context> Modified: trunk/treebase-web/src/main/webapp/WEB-INF/pages/journal.jsp =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/pages/journal.jsp 2010-03-31 18:46:29 UTC (rev 663) +++ trunk/treebase-web/src/main/webapp/WEB-INF/pages/journal.jsp 2010-04-01 20:20:37 UTC (rev 664) @@ -1,3 +1,6 @@ +<%@page import="org.cipres.treebase.TreebaseUtil"%> +<% String purlBase = TreebaseUtil.getPurlBase(); %> + <div class="gutter"> <h1>Journals</h1> <p>In addition to providing a digital library, TreeBASE serves the @@ -34,9 +37,9 @@ </td> <td> <p><a - href="http://purl.org/phylo/treebase/phylows/study/find?query=prism.publicationName%3D%3DEvolution" + href="<%=purlBase%>study/find?query=prism.publicationName%3D%3DEvolution" title="Find records in TreeBASE for articles published in Evolution"> - http://purl.org/phylo/treebase/phylows/study/find?query=prism.publicationName%3D%3DEvolution + <%=purlBase%>study/find?query=prism.publicationName%3D%3DEvolution </a></p> </td> </tr> @@ -52,9 +55,9 @@ </td> <td> <p><a - href="http://purl.org/phylo/treebase/phylows/study/find?query=prism.publicationName%3D%3D%22Evolutionary+Applications%22" + href="<%=purlBase%>study/find?query=prism.publicationName%3D%3D%22Evolutionary+Applications%22" title="Find records in TreeBASE for articles published in Evolutionary Applications"> - http://purl.org/phylo/treebase/phylows/study/find?query=prism.publicationName%3D%3D%22Evolutionary+Applications%22 + <%=purlBase%>study/find?query=prism.publicationName%3D%3D%22Evolutionary+Applications%22 </a></p> </td> </tr> @@ -70,9 +73,9 @@ </td> <td> <p><a - href="http://purl.org/phylo/treebase/phylows/study/find?query=prism.publicationName%3D%3D%22Fungal+Biology%22" + href="<%=purlBase%>study/find?query=prism.publicationName%3D%3D%22Fungal+Biology%22" title="Find records in TreeBASE for articles published in Fungal Biology"> - http://purl.org/phylo/treebase/phylows/study/find?query=prism.publicationName%3D%3D%22Fungal+Biology%22 + <%=purlBase%>study/find?query=prism.publicationName%3D%3D%22Fungal+Biology%22 </a></p> </td> </tr> @@ -88,9 +91,9 @@ </td> <td> <p><a - href="http://purl.org/phylo/treebase/phylows/study/find?query=prism.publicationName%3D%3D%22Invertebrate+Systematics%22" + href="<%=purlBase%>study/find?query=prism.publicationName%3D%3D%22Invertebrate+Systematics%22" title="Find records in TreeBASE for articles published in Invertebrate Systematics"> - http://purl.org/phylo/treebase/phylows/study/find?query=prism.publicationName%3D%3D%22Invertebrate+Systematics%22 + <%=purlBase%>study/find?query=prism.publicationName%3D%3D%22Invertebrate+Systematics%22 </a></p> </td> </tr> @@ -101,9 +104,9 @@ </td> <td> <p><a - href="http://purl.org/phylo/treebase/phylows/study/find?query=prism.publicationName%3D%3DMycologia" + href="<%=purlBase%>study/find?query=prism.publicationName%3D%3DMycologia" title="Find records in TreeBASE for articles published in Mycologia"> - http://purl.org/phylo/treebase/phylows/study/find?query=prism.publicationName%3D%3DMycologia</a> + <%=purlBase%>study/find?query=prism.publicationName%3D%3DMycologia</a> </p> </td> </tr> @@ -116,9 +119,9 @@ </td> <td> <p><a - href="http://purl.org/phylo/treebase/phylows/study/find?query=prism.publicationName%3D%3D%22Mycologial+Progress%22" + href="<%=purlBase%>study/find?query=prism.publicationName%3D%3D%22Mycologial+Progress%22" title="Find records in TreeBASE for articles published in Mycologial Progress"> - http://purl.org/phylo/treebase/phylows/study/find?query=prism.publicationName%3D%3D%22Mycologial+Progress%22</a> + <%=purlBase%>study/find?query=prism.publicationName%3D%3D%22Mycologial+Progress%22</a> </p> </td> </tr> @@ -132,9 +135,9 @@ </td> <td> <p><a - href="http://purl.org/phylo/treebase/phylows/study/find?query=prism.publicationName%3D%3D%22Mycologial+Research%22" + href="<%=purlBase%>study/find?query=prism.publicationName%3D%3D%22Mycologial+Research%22" title="Find records in TreeBASE for articles published in Mycologial Research"> - http://purl.org/phylo/treebase/phylows/study/find?query=prism.publicationName%3D%3D%22Mycologial+Research%22</a></p> + <%=purlBase%>study/find?query=prism.publicationName%3D%3D%22Mycologial+Research%22</a></p> </td> </tr> <tr> @@ -146,9 +149,9 @@ </td> <td> <p><a - href="http://purl.org/phylo/treebase/phylows/study/find?query=prism.publicationName%3D%3DMycoscience" + href="<%=purlBase%>study/find?query=prism.publicationName%3D%3DMycoscience" title="Find records in TreeBASE for articles published in Mycoscience"> - http://purl.org/phylo/treebase/phylows/study/find?query=prism.publicationName%3D%3DMycoscience</a></p> + <%=purlBase%>study/find?query=prism.publicationName%3D%3DMycoscience</a></p> </td> </tr> <tr> @@ -158,9 +161,9 @@ </td> <td> <p><a - href="http://purl.org/phylo/treebase/phylows/study/find?query=prism.publicationName%3D%3DMycosphere" + href="<%=purlBase%>study/find?query=prism.publicationName%3D%3DMycosphere" title="Find records in TreeBASE for articles published in Mycosphere"> - http://purl.org/phylo/treebase/phylows/study/find?query=prism.publicationName%3D%3DMycosphere</a></p> + <%=purlBase%>study/find?query=prism.publicationName%3D%3DMycosphere</a></p> </td> </tr> <tr> @@ -173,9 +176,9 @@ </td> <td> <p><a - href="http://purl.org/phylo/treebase/phylows/study/find?query=prism.publicationName%3D%3D%22Organisms+Diversity+&+Evolution%22" + href="<%=purlBase%>study/find?query=prism.publicationName%3D%3D%22Organisms+Diversity+&+Evolution%22" title="Find records in TreeBASE for articles published in Organisms Diversity & Evolution"> - http://purl.org/phylo/treebase/phylows/study/find?query=prism.publicationName%3D%3D%22Organisms+Diversity+&+Evolution%22</a></p> + <%=purlBase%>study/find?query=prism.publicationName%3D%3D%22Organisms+Diversity+&+Evolution%22</a></p> </td> </tr> <tr> @@ -185,9 +188,9 @@ </td> <td> <p><a - href="http://purl.org/phylo/treebase/phylows/study/find?query=prism.publicationName%3D%3DPersoonia" + href="<%=purlBase%>study/find?query=prism.publicationName%3D%3DPersoonia" title="Find records in TreeBASE for articles published in Persoonia"> - http://purl.org/phylo/treebase/phylows/study/find?query=prism.publicationName%3D%3DPersoonia</a></p> + <%=purlBase%>study/find?query=prism.publicationName%3D%3DPersoonia</a></p> </td> </tr> <tr> @@ -203,9 +206,9 @@ </td> <td> <p><a - href="http://purl.org/phylo/treebase/phylows/study/find?query=prism.publicationName%3D%3DPhytopahology" + href="<%=purlBase%>study/find?query=prism.publicationName%3D%3DPhytopahology" title="Find records in TreeBASE for articles published in Phytopahology"> - http://purl.org/phylo/treebase/phylows/study/find?query=prism.publicationName%3D%3DPhytopahology</a></p> + <%=purlBase%>study/find?query=prism.publicationName%3D%3DPhytopahology</a></p> </td> </tr> <tr> @@ -216,9 +219,9 @@ </td> <td> <p><a - href="http://purl.org/phylo/treebase/phylows/study/find?query=prism.publicationName%3D%3D%22Plant+Disease%22" + href="<%=purlBase%>study/find?query=prism.publicationName%3D%3D%22Plant+Disease%22" title="Find records in TreeBASE for articles published in Plant Disease"> - http://purl.org/phylo/treebase/phylows/study/find?query=prism.publicationName%3D%3D%22Plant+Disease%22</a></p> + <%=purlBase%>study/find?query=prism.publicationName%3D%3D%22Plant+Disease%22</a></p> </td> </tr> <tr> @@ -229,9 +232,9 @@ </td> <td> <p><a - href="http://purl.org/phylo/treebase/phylows/study/find?query=prism.publicationName%3D%3DRhodora" + href="<%=purlBase%>study/find?query=prism.publicationName%3D%3DRhodora" title="Find records in TreeBASE for articles published in Rhodora"> - http://purl.org/phylo/treebase/phylows/study/find?query=prism.publicationName%3D%3DRhodora</a></p> + <%=purlBase%>study/find?query=prism.publicationName%3D%3DRhodora</a></p> </td> </tr> <tr> @@ -243,9 +246,9 @@ </td> <td> <p><a - href="http://purl.org/phylo/treebase/phylows/study/find?query=prism.publicationName%3D%3DMuelleria" + href="<%=purlBase%>study/find?query=prism.publicationName%3D%3DMuelleria" title="Find records in TreeBASE for articles published in Muelleria"> - http://purl.org/phylo/treebase/phylows/study/find?query=prism.publicationName%3D%3DMuelleria</a></p> + <%=purlBase%>study/find?query=prism.publicationName%3D%3DMuelleria</a></p> </td> </tr> <tr> @@ -256,9 +259,9 @@ </td> <td> <p><a - href="http://purl.org/phylo/treebase/phylows/study/find?query=prism.publicationName%3D%3D%22Studies+in+Mycology%22" + href="<%=purlBase%>study/find?query=prism.publicationName%3D%3D%22Studies+in+Mycology%22" title="Find records in TreeBASE for articles published in Studies in Mycology"> - http://purl.org/phylo/treebase/phylows/study/find?query=prism.publicationName%3D%3D%22Studies+in+Mycology%22</a></p> + <%=purlBase%>study/find?query=prism.publicationName%3D%3D%22Studies+in+Mycology%22</a></p> </td> </tr> <tr> @@ -269,9 +272,9 @@ </td> <td> <p><a - href="http://purl.org/phylo/treebase/phylows/study/find?query=prism.publicationName%3D%3D%22Systematic+Biology%22" + href="<%=purlBase%>study/find?query=prism.publicationName%3D%3D%22Systematic+Biology%22" title="Find records in TreeBASE for articles published in Systematic Biology"> - http://purl.org/phylo/treebase/phylows/study/find?query=prism.publicationName%3D%3D%22Systematic+Biology%22</a></p> + <%=purlBase%>study/find?query=prism.publicationName%3D%3D%22Systematic+Biology%22</a></p> </td> </tr> <tr> @@ -282,9 +285,9 @@ </td> <td> <p><a - href="http://purl.org/phylo/treebase/phylows/study/find?query=prism.publicationName%3D%3D%22Systematic+Botany%22" + href="<%=purlBase%>study/find?query=prism.publicationName%3D%3D%22Systematic+Botany%22" title="Find records in TreeBASE for articles published in Systematic Botany"> - http://purl.org/phylo/treebase/phylows/study/find?query=prism.publicationName%3D%3D%22Systematic+Botany%22</a></p> + <%=purlBase%>study/find?query=prism.publicationName%3D%3D%22Systematic+Botany%22</a></p> </td> </tr> <tr> @@ -295,56 +298,56 @@ </td> <td> <p><a - href="http://purl.org/phylo/treebase/phylows/study/find?query=prism.publicationName%3D%3D%22Tropical+Bryology%22" + href="<%=purlBase%>study/find?query=prism.publicationName%3D%3D%22Tropical+Bryology%22" title="Find records in TreeBASE for articles published in Tropical Bryology"> - http://purl.org/phylo/treebase/phylows/study/find?query=prism.publicationName%3D%3D%22Tropical+Bryology%22</a></p> + <%=purlBase%>study/find?query=prism.publicationName%3D%3D%22Tropical+Bryology%22</a></p> </td> </tr> </table> <p><b>Other Journals with a Significant Presence in TreeBASE</b>: <a - href="http://purl.org/phylo/treebase/phylows/study/find?query=prism.publicationName%3D%3D%2American+Journal+of+Botany%22" + href="<%=purlBase%>study/find?query=prism.publicationName%3D%3D%2American+Journal+of+Botany%22" title="American Journal of Botany">American Journal of Botany</a>; <a - href="http://purl.org/phylo/treebase/phylows/study/find?query=prism.publicationName%3D%3D%22Annals+of+the+Missouri+Botanical+Garden%22" + href="<%=purlBase%>study/find?query=prism.publicationName%3D%3D%22Annals+of+the+Missouri+Botanical+Garden%22" title="Annals of the Missouri Botanical Garden">Annals of the Missouri Botanical Garden</a>; <a - href="http://purl.org/phylo/treebase/phylows/study/find?query=prism.publicationName%3D%3D%22Biological+Journal+of+the+Linnean+Society%22" + href="<%=purlBase%>study/find?query=prism.publicationName%3D%3D%22Biological+Journal+of+the+Linnean+Society%22" title="Biological Journal of the Linnean Society">Biological Journal of the Linnean Society</a>; <a - href="http://purl.org/phylo/treebase/phylows/study/find?query=prism.publicationName%3D%3D%22BMC+Evolutionary+Biology%22" + href="<%=purlBase%>study/find?query=prism.publicationName%3D%3D%22BMC+Evolutionary+Biology%22" title="BMC Evolutionary Biology">BMC Evolutionary Biology</a>; <a - href="http://purl.org/phylo/treebase/phylows/study/find?query=prism.publicationName%3D%3D%22Canadian+Journal+of+Botany%22" + href="<%=purlBase%>study/find?query=prism.publicationName%3D%3D%22Canadian+Journal+of+Botany%22" title="Canadian Journal of Botany">Canadian Journal of Botany</a>; <a - href="http://purl.org/phylo/treebase/phylows/study/find?query=prism.publicationName%3D%3DCladistics" + href="<%=purlBase%>study/find?query=prism.publicationName%3D%3DCladistics" title="Cladistics">Cladistics</a>; <a - href="http://purl.org/phylo/treebase/phylows/study/find?query=prism.publicationName%3D%3D%22Fungal+Diversity%22" + href="<%=purlBase%>study/find?query=prism.publicationName%3D%3D%22Fungal+Diversity%22" title="Fungal Diversity">Fungal Diversity</a>; <a - href="http://purl.org/phylo/treebase/phylows/study/find?query=prism.publicationName%3D%3D%22International+Journal+of+Plant+Sciences%22" + href="<%=purlBase%>study/find?query=prism.publicationName%3D%3D%22International+Journal+of+Plant+Sciences%22" title="International Journal of Plant Sciences">International Journal of Plant Sciences</a>; <a - href="http://purl.org/phylo/treebase/phylows/study/find?query=prism.publicationName%3D%3D%22Journal+of+Phycology%22" + href="<%=purlBase%>study/find?query=prism.publicationName%3D%3D%22Journal+of+Phycology%22" title="Journal of Phycology">Journal of Phycology</a>; <a - href="http://purl.org/phylo/treebase/phylows/study/find?query=prism.publicationName%3D%3D%22Molecular+Biology+and+Evolution%22" + href="<%=purlBase%>study/find?query=prism.publicationName%3D%3D%22Molecular+Biology+and+Evolution%22" title="Molecular Biology and Evolution">Molecular Biology and Evolution</a>; <a - href="http://purl.org/phylo/treebase/phylows/study/find?query=prism.publicationName%3D%3D%22Molecular+Ecology%22" + href="<%=purlBase%>study/find?query=prism.publicationName%3D%3D%22Molecular+Ecology%22" title="Molecular Ecology">Molecular Ecology</a>; <a - href="http://purl.org/phylo/treebase/phylows/study/find?query=prism.publicationName%3D%3D%22Molecular+Phylogenetics+and+Evolution%22" + href="<%=purlBase%>study/find?query=prism.publicationName%3D%3D%22Molecular+Phylogenetics+and+Evolution%22" title="Molecular Phylogenetics and Evolution">Molecular Phylogenetics and Evolution</a>; <a - href="http://purl.org/phylo/treebase/phylows/study/find?query=prism.publicationName%3D%3D%22Plant+Systematics+and+Evolution%22" + href="<%=purlBase%>study/find?query=prism.publicationName%3D%3D%22Plant+Systematics+and+Evolution%22" title="Plant Systematics and Evolution">Plant Systematics and Evolution</a>; <a - href="http://purl.org/phylo/treebase/phylows/study/find?query=prism.publicationName%3D%3D%22Proceeding+of+the+National+Academy+of+Sciences+of+the+United+States+of+America%22" + href="<%=purlBase%>study/find?query=prism.publicationName%3D%3D%22Proceeding+of+the+National+Academy+of+Sciences+of+the+United+States+of+America%22" title="Proceeding of the National Academy of Sciences of the United States of America"> Proceeding of the National Academy of Sciences of the United States of America</a>; <a - href="http://purl.org/phylo/treebase/phylows/study/find?query=prism.publicationName%3D%3D%22Proceedings+of+the+Royal+Society+B%22" + href="<%=purlBase%>study/find?query=prism.publicationName%3D%3D%22Proceedings+of+the+Royal+Society+B%22" title="Proceedings of the Royal Society B">Proceedings of the Royal Society B</a>; <a - href="http://purl.org/phylo/treebase/phylows/study/find?query=prism.publicationName%3D%3DTaxon" + href="<%=purlBase%>study/find?query=prism.publicationName%3D%3DTaxon" title="Taxon">Taxon</a>; <a - href="http://purl.org/phylo/treebase/phylows/study/find?query=prism.publicationName%3D%3DZootaxa" + href="<%=purlBase%>study/find?query=prism.publicationName%3D%3DZootaxa" title="Zootaxa">Zootaxa</a></p> </div> \ No newline at end of file Modified: trunk/treebase-web/src/main/webapp/WEB-INF/pages/submissionSummaryView.jsp =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/pages/submissionSummaryView.jsp 2010-03-31 18:46:29 UTC (rev 663) +++ trunk/treebase-web/src/main/webapp/WEB-INF/pages/submissionSummaryView.jsp 2010-04-01 20:20:37 UTC (rev 664) @@ -1,4 +1,7 @@ +<%@page import="org.cipres.treebase.TreebaseUtil"%> +<% String purlBase = TreebaseUtil.getPurlBase(); %> <%@ include file="/common/taglibs.jsp"%> + <head> <title>Summary Information</title> <content tag="heading">Summary for current study</content> @@ -28,10 +31,10 @@ </a> <br/> <br/> -<a href="<c:out value="http://purl.org/phylo/treebase/phylows/study/TB2:S"/><c:out value="${submission.study.id}"/>"> +<a href="<c:out value="${submission.study.phyloWSPath.purl}"/>"> <img class="iconButton" alt="link" src="<fmt:message key="icons.weblink"/>" /> Study Accession URL:<br/> - <c:out value="http://purl.org/phylo/treebase/phylows/study/TB2:S"/><c:out value="${submission.study.id}"/> + <c:out value="${submission.study.phyloWSPath.purl}"/> </a> <div><strong>You can cite this URL in your manuscript. It will become the permanent and resolvable resource locator after your submission has been approved and the data are made public.</strong></div> <br/> Modified: trunk/treebase-web/src/main/webapp/WEB-INF/pages/urlAPI.jsp =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/pages/urlAPI.jsp 2010-03-31 18:46:29 UTC (rev 663) +++ trunk/treebase-web/src/main/webapp/WEB-INF/pages/urlAPI.jsp 2010-04-01 20:20:37 UTC (rev 664) @@ -1,3 +1,6 @@ +<%@page import="org.cipres.treebase.TreebaseUtil"%> +<% String purlBase = TreebaseUtil.getPurlBase(); %> + <div class="gutter"> <h1>Data Access</h1> <h2>Web Browser User Interface</h2> @@ -41,11 +44,11 @@ </p> <dl> <dt>URI to a study</dt> - <dd>http://purl.org/phylo/treebase/phylows/study/TB2:S1925</dd> + <dd><%=purlBase%>study/TB2:S1925</dd> <dt>URI to a matrix</dt> - <dd>http://purl.org/phylo/treebase/phylows/matrix/TB2:M2610</dd> + <dd><%=purlBase%>matrix/TB2:M2610</dd> <dt>URI to a tree</dt> - <dd>http://purl.org/phylo/treebase/phylows/tree/TB2:Tr2026</dd> + <dd><%=purlBase%>tree/TB2:Tr2026</dd> </dl> <h2>RSS Feeds</h2> <p> Modified: trunk/treebase-web/src/main/webapp/WEB-INF/web.xml =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/web.xml 2010-03-31 18:46:29 UTC (rev 663) +++ trunk/treebase-web/src/main/webapp/WEB-INF/web.xml 2010-04-01 20:20:37 UTC (rev 664) @@ -54,8 +54,26 @@ <env-entry-name>tb2/MesquiteFolder</env-entry-name> <env-entry-type>java.lang.String</env-entry-type> </env-entry> - + + <env-entry> + <description>The base URL from which this Treebase instance is served. + Most likely, it has the form "http://your.server.xxx/treebase-web/". + Trailing slash is required.</description> + <env-entry-name>tb2/SiteUrl</env-entry-name> + <env-entry-type>java.lang.String</env-entry-type> + </env-entry> + + <env-entry> + <description>The base URL of a PURL service that redirects to this Treebase instance. + The PURL service should resolve tb2/PurlBase value into something + like "http://your.server.xxx/..../treebase-web/phylows/", + which must be the valid PhyloWS URL of this Treebase instance. + Trailing slash is required.</description> + <env-entry-name>tb2/PurlBase</env-entry-name> + <env-entry-type>java.lang.String</env-entry-type> + </env-entry> + <!-- ========================================================== --> <!-- List of Filters --> <!-- ========================================================== --> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vga...@us...> - 2010-04-15 20:09:16
|
Revision: 689 http://treebase.svn.sourceforge.net/treebase/?rev=689&view=rev Author: vgapeyev Date: 2010-04-15 20:09:08 +0000 (Thu, 15 Apr 2010) Log Message: ----------- Added JNDI parameter tb2/SmtpHost. This fixes SF#2977860 Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/TreebaseUtil.java trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PasswordFormController.java trunk/treebase-web/src/main/webapp/META-INF/context.xml.example trunk/treebase-web/src/main/webapp/WEB-INF/web.xml Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/TreebaseUtil.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/TreebaseUtil.java 2010-04-15 19:39:53 UTC (rev 688) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/TreebaseUtil.java 2010-04-15 20:09:08 UTC (rev 689) @@ -45,6 +45,7 @@ private static final Logger LOGGER = Logger.getLogger(TreebaseUtil.class); private static String mPurlBase; private static String mSiteUrl; + private static String mSmtpHost; private TreebaseUtil() { super(); @@ -431,41 +432,25 @@ return date + " GMT"; } + - /** - * This method returns the domain name (possibly with port number) - * which can be used to construct URLs by prefixing with "http://" - * and suffixing with the full path (e.g. "/treebase-web") + /** Looks up a JNDI Environment parameter that carries a string value. * - * @return domain name */ - /*-- - public static String getPurlBase() { - if ( null == mPurlDomain ) { - Properties properties = new Properties(); - try { - properties.load( - TreebaseUtil.class - .getClassLoader() - .getResourceAsStream("treebase.properties")); - LOGGER.info("properties loaded successfully"); - mPurlDomain = properties.getProperty("treebase.purl.domain"); - LOGGER.info("domain name: "+mPurlDomain); - } catch (FileNotFoundException e) { - LOGGER.warn("FileNotFoundException: " + e.getMessage()); - e.printStackTrace(); - } catch (IOException e) { - LOGGER.warn("IOException: "+e.getMessage()); - e.printStackTrace(); - } - return mPurlDomain; + private static String lookupJndiEnvironmentString(String name, String fallback) { + String result = fallback; + try { + InitialContext ic = new InitialContext(); + result = (String) ic.lookup("java:comp/env/" + name); + } catch (NamingException e) { + LOGGER.info("Failure looking up " + name + " via JNDI"); + e.printStackTrace(); } - else { - return mPurlDomain; - } + return result; } -*/ + + /** * Returns the base URL of the PURL service associated with this Treebase instance, * which can be used to construct full PURLs by suffixing with a PhyloWS command, e.g. "/study/TB2:S1925" @@ -473,21 +458,10 @@ * @return the base URL of the PURL service */ public static String getPurlBase() { - if (null != mPurlBase) - return mPurlBase; - else { - try { - mPurlBase = "http://DUMMY_PURL_BASE/"; - InitialContext ic = new InitialContext(); - mPurlBase = (String) ic.lookup("java:comp/env/tb2/PurlBase"); - } catch (NamingException e) { - LOGGER.info("Failure looking up tb2/PurlBase via JNDI"); - e.printStackTrace(); - } - return mPurlBase; - } + if (null == mPurlBase) + mPurlBase = lookupJndiEnvironmentString("tb2/PurlBase", "http://DUMMY_PURL_BASE/"); + return mPurlBase; } - /** * Returns the base URL of this Treebase instance, by looking it up in Tomcat via JNDI. @@ -495,22 +469,23 @@ * @return the base URL of of this Treebase instance */ public static String getSiteUrl() { - if (null != mSiteUrl) - return mSiteUrl; - else { - try { - mSiteUrl = "http://DUMMY_SITE_URL/"; - InitialContext ic = new InitialContext(); - mSiteUrl = (String) ic.lookup("java:comp/env/tb2/SiteUrl"); - } catch (NamingException e) { - LOGGER.info("Failure looking up tb2/SiteUrl via JNDI"); - e.printStackTrace(); - } - return mSiteUrl; - } + if (null == mSiteUrl) + mSiteUrl = lookupJndiEnvironmentString("tb2/SiteUrl", "http://DUMMY.SITE.COM/"); + return mSiteUrl; } + + /** + * + * @return the SMTP host to use for automated email + */ + public static String getSmtpHost() { + if (null == mSmtpHost) + mSmtpHost = lookupJndiEnvironmentString("tb2/SmtpHost", "smtp.DUMMY.HOST"); + return mSmtpHost; + } + /** * This method appends header information upon formatting to the nexus file. * Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PasswordFormController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PasswordFormController.java 2010-04-15 19:39:53 UTC (rev 688) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PasswordFormController.java 2010-04-15 20:09:08 UTC (rev 689) @@ -107,7 +107,7 @@ // create mail session Properties props = new Properties(); - props.put("mail.smtp.host", "smtp.ucsd.edu"); + props.put("mail.smtp.host", TreebaseUtil.getSmtpHost()); Session mailSession = Session.getDefaultInstance(props,null); // create email message header information Modified: trunk/treebase-web/src/main/webapp/META-INF/context.xml.example =================================================================== --- trunk/treebase-web/src/main/webapp/META-INF/context.xml.example 2010-04-15 19:39:53 UTC (rev 688) +++ trunk/treebase-web/src/main/webapp/META-INF/context.xml.example 2010-04-15 20:09:08 UTC (rev 689) @@ -37,6 +37,10 @@ type="java.lang.String" override="false" description="The base URL of a PURL service that redirects to this Treebase instance."/> + <Environment name="tb2/SmtpHost" value="smtp.YOUR.SERVER.ORG" + type="java.lang.String" override="false" + description="Host name of an SMTP server that your instance can use without authentication."/> + </Context> Modified: trunk/treebase-web/src/main/webapp/WEB-INF/web.xml =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/web.xml 2010-04-15 19:39:53 UTC (rev 688) +++ trunk/treebase-web/src/main/webapp/WEB-INF/web.xml 2010-04-15 20:09:08 UTC (rev 689) @@ -73,6 +73,11 @@ <env-entry-type>java.lang.String</env-entry-type> </env-entry> + <env-entry> + <description>Host name of an SMTP server that your instance can use without authentication.</description> + <env-entry-name>tb2/SmtpHost</env-entry-name> + <env-entry-type>java.lang.String</env-entry-type> + </env-entry> <!-- ========================================================== --> <!-- List of Filters --> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2010-06-15 17:24:29
|
Revision: 720 http://treebase.svn.sourceforge.net/treebase/?rev=720&view=rev Author: rvos Date: 2010-06-15 17:24:23 +0000 (Tue, 15 Jun 2010) Log Message: ----------- Adding functionality to fix bug 3014899. This commit makes it possible to: * attach TreeBASE1 matrix ids to NeXML (and RDF) serializations. This involves an addition to NexmlMatrixConverter (to add the annotation during serialization) and to treebase.owl (to add the identifier.matrix.tb1 predicate to the treebase terms vocabulary). * allow searching on TreeBASE1 matrix ids by the core. This involves extending the MatrixService and MatrixHome interfaces, and implementing in MatrixServiceImpl which dispatches to the specified MatrixHome implementation, i.e. MatrixDAO, which does the actual searching. * using identifier.matrix.tb1 as a CQL search predicate. This involves some modification to the predicate handling in the MatrixSearchController so that the right search method is dispatched. Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/dao/matrix/MatrixDAO.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/MatrixHome.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/MatrixService.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlMatrixConverter.java trunk/treebase-core/src/main/java/org/cipres/treebase/service/matrix/MatrixServiceImpl.java trunk/treebase-core/src/main/resources/treebase.owl trunk/treebase-core/src/test/java/org/cipres/treebase/auxdata/AuxDataTest.java trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/MatrixSearchController.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/dao/matrix/MatrixDAO.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/dao/matrix/MatrixDAO.java 2010-06-15 16:05:56 UTC (rev 719) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/dao/matrix/MatrixDAO.java 2010-06-15 17:24:23 UTC (rev 720) @@ -28,6 +28,7 @@ import org.cipres.treebase.domain.study.Study; import org.cipres.treebase.domain.study.Submission; import org.cipres.treebase.domain.study.SubmissionHome; +import org.cipres.treebase.domain.taxon.Taxon; import org.cipres.treebase.domain.taxon.TaxonLabel; import org.cipres.treebase.domain.taxon.TaxonLabelHome; import org.cipres.treebase.domain.taxon.TaxonLabelSet; @@ -36,6 +37,7 @@ import org.hibernate.Criteria; import org.hibernate.Hibernate; import org.hibernate.Query; +import org.hibernate.criterion.Expression; /** * MatrixDAO.java @@ -614,4 +616,14 @@ returnVal = (MatrixKind) c.uniqueResult(); return returnVal; } + + /* + * (non-Javadoc) + * @see org.cipres.treebase.domain.matrix.MatrixHome#findByTB1StudyID(java.lang.String) + */ + public Matrix findByTB1StudyID(String pTB1MatrixID) { + Criteria c = getSession().createCriteria(Matrix.class); + c.add(Expression.eq("TB_MatrixID", pTB1MatrixID)); + return (Matrix) c.uniqueResult(); + } } Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/MatrixHome.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/MatrixHome.java 2010-06-15 16:05:56 UTC (rev 719) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/MatrixHome.java 2010-06-15 17:24:23 UTC (rev 720) @@ -168,5 +168,14 @@ * @return MatrixKind */ MatrixKind findKindByDescription(String pDescription); + + /** + * Return a Matrix object by its legacy TreeBASE1 id. The Matrix object is fully inflated + * with colum, row and elements data + * + * @param pTB1MatrixID + * @return + */ + Matrix findByTB1StudyID(String pTB1MatrixID); } Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/MatrixService.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/MatrixService.java 2010-06-15 16:05:56 UTC (rev 719) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/MatrixService.java 2010-06-15 17:24:23 UTC (rev 720) @@ -26,6 +26,15 @@ * @return */ Matrix findByID(Long pMatrixID); + + /** + * Return a Matrix object by its legacy TreeBASE1 id. The Matrix object is fully inflated + * with colum, row and elements data + * + * @param pTB1MatrixID + * @return + */ + Matrix findByTB1StudyID(String pTB1MatrixID); /** * Delete a matrix and its assoicated objects. Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlMatrixConverter.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlMatrixConverter.java 2010-06-15 16:05:56 UTC (rev 719) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlMatrixConverter.java 2010-06-15 17:24:23 UTC (rev 720) @@ -276,6 +276,10 @@ } xmlMatrix.setLabel(tbMatrix.getTitle()); attachTreeBaseID((Annotatable)xmlMatrix, tbMatrix,Matrix.class); + String tb1MatrixID = tbMatrix.getTB1MatrixID(); + if ( null != tb1MatrixID ) { + ((Annotatable)xmlMatrix).addAnnotationValue("tb:identifier.matrix.tb1", Constants.TBTermsURI, tb1MatrixID); + } return xmlMatrix; } Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/service/matrix/MatrixServiceImpl.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/service/matrix/MatrixServiceImpl.java 2010-06-15 16:05:56 UTC (rev 719) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/service/matrix/MatrixServiceImpl.java 2010-06-15 17:24:23 UTC (rev 720) @@ -145,4 +145,8 @@ public Class defaultResultClass() { return Matrix.class; } + + public Matrix findByTB1StudyID(String pTB1MatrixID) { + return getMatrixHome().findByTB1StudyID(pTB1MatrixID); + } } Modified: trunk/treebase-core/src/main/resources/treebase.owl =================================================================== --- trunk/treebase-core/src/main/resources/treebase.owl 2010-06-15 16:05:56 UTC (rev 719) +++ trunk/treebase-core/src/main/resources/treebase.owl 2010-06-15 17:24:23 UTC (rev 720) @@ -68,6 +68,14 @@ + <!-- http://purl.org/phylo/treebase/2.0/terms#identifier.matrix.tb1 --> + + <owl:ObjectProperty rdf:about="identifier.matrix.tb1"> + <rdfs:subPropertyOf rdf:resource="http://purl.org/dc/elements/1.1/identifier"/> + </owl:ObjectProperty> + + + <!-- http://purl.org/phylo/treebase/2.0/terms#identifier.ncbi --> <owl:ObjectProperty rdf:about="identifier.ncbi"> Modified: trunk/treebase-core/src/test/java/org/cipres/treebase/auxdata/AuxDataTest.java =================================================================== --- trunk/treebase-core/src/test/java/org/cipres/treebase/auxdata/AuxDataTest.java 2010-06-15 16:05:56 UTC (rev 719) +++ trunk/treebase-core/src/test/java/org/cipres/treebase/auxdata/AuxDataTest.java 2010-06-15 17:24:23 UTC (rev 720) @@ -212,6 +212,11 @@ Boolean caseSensitive) { // TODO Auto-generated method stub return null; + } + + public Matrix findByTB1StudyID(String pTB1MatrixID) { + // TODO Auto-generated method stub + return null; } } Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/MatrixSearchController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/MatrixSearchController.java 2010-06-15 16:05:56 UTC (rev 719) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/MatrixSearchController.java 2010-06-15 17:24:23 UTC (rev 720) @@ -56,6 +56,7 @@ byType, byNTAX, byNCHAR, + byTB1ID } protected ModelAndView onSubmit( @@ -153,8 +154,10 @@ String index = term.getIndex(); if ( index.startsWith("tb.title") ) { results.addAll(doSearch(request, response, SearchType.byTitle, errors, term.getTerm())); - } else if ( index.startsWith("tb.identifier") ) { + } else if ( index.equals("tb.identifier.matrix") ) { results.addAll(doSearch(request, response, SearchType.byID, errors, term.getTerm())); + } else if ( index.equals("tb.identifier.matrix.tb1") ) { + results.addAll(doSearch(request, response, SearchType.byTB1ID, errors, term.getTerm())); } else if ( index.startsWith("tb.type") ) { results.addAll(doSearch(request, response, SearchType.byType, errors, term.getTerm())); } else if ( index.startsWith("tb.ntax") ) { @@ -185,7 +188,12 @@ case byID: matches = (Collection<Matrix>) doSearchByIDString(request, matrixService, Matrix.class, searchTerm); break; - + + case byTB1ID: + matches = new HashSet<Matrix>(); + matches.add(matrixService.findByTB1StudyID(searchTerm)); + break; + case byTitle: matches = matrixService .findSomethingBySubstring(Matrix.class, "title", searchTerm); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2010-06-16 15:01:24
|
Revision: 722 http://treebase.svn.sourceforge.net/treebase/?rev=722&view=rev Author: rvos Date: 2010-06-16 15:01:17 +0000 (Wed, 16 Jun 2010) Log Message: ----------- Fixes for issue 2960840: * we want more information in the "description" elements of search RSS. To this end, a @Transient getDescription() method has been added to the NexmlWritable interface, and a default implementation (which returns an empty string) has been added to AbstractPersistedObject. For the Study object, this method is overridden to return the associated Article's abstract (if available). Some classes already have getDescription() methods based on table columns. To these an @Override annotation has been added. * because there are troublesome characters in some abstracts and titles, a method to deal with these has been added to TreebaseUtil ("removeTroublesomeCharacters"), which is invoked by the Study class to process the abstract and title strings that are returned. * the issue with Safari not displaying RSS seems to have to do with the way the view was previously returned, using new ModelAndView(new RedirectView("templateName"));. It seems that this redirecting doesn't play well with Safari's feed:// pseudoprotocol. By instead just returning new ModelAndView("templateName") this issue seems to be fixed. Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/TreebaseUtil.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/AbstractPersistedObject.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/NexmlWritable.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/DiscreteCharState.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/GapMode.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/ItemDefinition.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/Matrix.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/MatrixDataType.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/MatrixKind.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/PhyloChar.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/PolyTCount.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/StateFormat.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Algorithm.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/CitationStatus.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Software.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Study.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/StudyStatus.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/Taxon.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/TaxonAuthority.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/TreeKind.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/TreeQuality.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/TreeType.java trunk/treebase-core/src/test/java/org/cipres/treebase/TBMockObject.java trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SearchController.java trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SearchResultsAsRDFController.java trunk/treebase-web/src/main/webapp/WEB-INF/pages/searchResultsAsRDF.jsp Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/TreebaseUtil.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/TreebaseUtil.java 2010-06-15 17:56:12 UTC (rev 721) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/TreebaseUtil.java 2010-06-16 15:01:17 UTC (rev 722) @@ -6,6 +6,11 @@ import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.CharBuffer; +import java.nio.charset.Charset; +import java.nio.charset.CharsetDecoder; +import java.nio.charset.CodingErrorAction; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Arrays; @@ -151,6 +156,25 @@ return buf.toString(); } + public static String removeTroublesomeCharacters(String inString) { + if ( inString == null ) { + return null; + } + StringBuilder newString = new StringBuilder(); + for (int i = 0; i < inString.length(); i++) { + char ch = inString.charAt(i); + // remove any characters outside the valid UTF-8 range as well as all control characters + // except tabs and new lines + if ((ch < 0x00FD && ch > 0x001F) || ch == '\t' || ch == '\n' || ch == '\r') { + newString.append(ch); + } + } + return newString.toString(); + + } + + + /** * Reads the contents of a file into a string * @param file Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/AbstractPersistedObject.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/AbstractPersistedObject.java 2010-06-15 17:56:12 UTC (rev 721) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/AbstractPersistedObject.java 2010-06-16 15:01:17 UTC (rev 722) @@ -145,4 +145,13 @@ return null; } + /* + * (non-Javadoc) + * @see org.cipres.treebase.domain.NexmlWritable#getDescription() + */ + @Transient + public String getDescription() { + return this.getNamespacedGUID().toString(); + } + } Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/NexmlWritable.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/NexmlWritable.java 2010-06-15 17:56:12 UTC (rev 721) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/NexmlWritable.java 2010-06-16 15:01:17 UTC (rev 722) @@ -5,4 +5,5 @@ public interface NexmlWritable { public List<Annotation> getAnnotations (); public String getLabel(); + public String getDescription(); } Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/DiscreteCharState.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/DiscreteCharState.java 2010-06-15 17:56:12 UTC (rev 721) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/DiscreteCharState.java 2010-06-16 15:01:17 UTC (rev 722) @@ -92,6 +92,7 @@ * * @return String */ + @Override @Column(name = "Description", nullable = true, length = TBPersistable.COLUMN_LENGTH_STRING) public String getDescription() { return mDescription; Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/GapMode.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/GapMode.java 2010-06-15 17:56:12 UTC (rev 721) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/GapMode.java 2010-06-16 15:01:17 UTC (rev 722) @@ -41,6 +41,7 @@ * * @return String mDescription */ + @Override @Column(name = "Description", length = TBPersistable.COLUMN_LENGTH_STRING) public String getDescription() { return mDescription; Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/ItemDefinition.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/ItemDefinition.java 2010-06-15 17:56:12 UTC (rev 721) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/ItemDefinition.java 2010-06-16 15:01:17 UTC (rev 722) @@ -40,6 +40,7 @@ * * @return String mDescription */ + @Override @Column(name = "Description", length = TBPersistable.COLUMN_LENGTH_STRING) public String getDescription() { return mDescription; Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/Matrix.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/Matrix.java 2010-06-15 17:56:12 UTC (rev 721) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/Matrix.java 2010-06-16 15:01:17 UTC (rev 722) @@ -83,6 +83,7 @@ * * @return String */ + @Override @Column(name = "Description", length = TBPersistable.COLUMN_LENGTH_STRING_NOTES) public String getDescription() { return mDescription; Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/MatrixDataType.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/MatrixDataType.java 2010-06-15 17:56:12 UTC (rev 721) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/MatrixDataType.java 2010-06-16 15:01:17 UTC (rev 722) @@ -57,6 +57,7 @@ * * @return String mDescription */ + @Override @Column(name = "Description", length = TBPersistable.COLUMN_LENGTH_STRING) public String getDescription() { return mDescription; Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/MatrixKind.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/MatrixKind.java 2010-06-15 17:56:12 UTC (rev 721) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/MatrixKind.java 2010-06-16 15:01:17 UTC (rev 722) @@ -58,6 +58,7 @@ * * @return String */ + @Override @Column(name = "Description", length = TBPersistable.COLUMN_LENGTH_100) public String getDescription() { return mDescription; Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/PhyloChar.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/PhyloChar.java 2010-06-15 17:56:12 UTC (rev 721) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/PhyloChar.java 2010-06-16 15:01:17 UTC (rev 722) @@ -53,6 +53,7 @@ * * @return String mDescription */ + @Override @Column(name = "Description", length = TBPersistable.COLUMN_LENGTH_STRING) public String getDescription() { return mDescription; Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/PolyTCount.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/PolyTCount.java 2010-06-15 17:56:12 UTC (rev 721) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/PolyTCount.java 2010-06-16 15:01:17 UTC (rev 722) @@ -40,6 +40,7 @@ * * @return String mDescription */ + @Override @Column(name = "Description", length = TBPersistable.COLUMN_LENGTH_STRING) public String getDescription() { return mDescription; Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/StateFormat.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/StateFormat.java 2010-06-15 17:56:12 UTC (rev 721) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/StateFormat.java 2010-06-16 15:01:17 UTC (rev 722) @@ -40,6 +40,7 @@ * * @return String mDescription */ + @Override @Column(name = "Description", length = TBPersistable.COLUMN_LENGTH_STRING) public String getDescription() { return mDescription; Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Algorithm.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Algorithm.java 2010-06-15 17:56:12 UTC (rev 721) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Algorithm.java 2010-06-16 15:01:17 UTC (rev 722) @@ -51,6 +51,7 @@ * * @return String mDescription */ + @Override @Column(name = "Description", length = TBPersistable.COLUMN_LENGTH_STRING_NOTES) public String getDescription() { return mDescription; Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/CitationStatus.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/CitationStatus.java 2010-06-15 17:56:12 UTC (rev 721) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/CitationStatus.java 2010-06-16 15:01:17 UTC (rev 722) @@ -71,6 +71,7 @@ * * @return String */ + @Override @Column(name = "Description", length = TBPersistable.COLUMN_LENGTH_50) public String getDescription() { return mDescription; Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Software.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Software.java 2010-06-15 17:56:12 UTC (rev 721) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Software.java 2010-06-16 15:01:17 UTC (rev 722) @@ -45,6 +45,7 @@ * * @return String */ + @Override @Column(name = "Description", length = TBPersistable.COLUMN_LENGTH_STRING_NOTES) public String getDescription() { return mDescription; Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Study.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Study.java 2010-06-15 17:56:12 UTC (rev 721) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Study.java 2010-06-16 15:01:17 UTC (rev 722) @@ -694,11 +694,20 @@ @Override @Transient + public String getDescription() { + if ( null != getCitation() ) { + return TreebaseUtil.removeTroublesomeCharacters(getCitation().getAbstract()); + } + return ""; + } + + @Override + @Transient public String getLabel() { if ( null != getCitation() ) { - return getCitation().getTitle(); + return TreebaseUtil.removeTroublesomeCharacters(getCitation().getTitle()); } - return getName(); + return TreebaseUtil.removeTroublesomeCharacters(getName()); } @Transient Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/StudyStatus.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/StudyStatus.java 2010-06-15 17:56:12 UTC (rev 721) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/StudyStatus.java 2010-06-16 15:01:17 UTC (rev 722) @@ -47,6 +47,7 @@ * * @return String */ + @Override @Column(name = "Description", length = TBPersistable.COLUMN_LENGTH_STRING) public String getDescription() { return mDescription; Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/Taxon.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/Taxon.java 2010-06-15 17:56:12 UTC (rev 721) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/Taxon.java 2010-06-16 15:01:17 UTC (rev 722) @@ -72,6 +72,7 @@ * * @return String */ + @Override @Column(name = "Description", nullable = true, length = TBPersistable.COLUMN_LENGTH_STRING_NOTES) public String getDescription() { return mDescription; Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/TaxonAuthority.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/TaxonAuthority.java 2010-06-15 17:56:12 UTC (rev 721) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/TaxonAuthority.java 2010-06-16 15:01:17 UTC (rev 722) @@ -55,6 +55,7 @@ * * @return String */ + @Override @Column(name = "Description", nullable = true, length = TBPersistable.COLUMN_LENGTH_STRING_NOTES) public String getDescription() { return mDescription; Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/TreeKind.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/TreeKind.java 2010-06-15 17:56:12 UTC (rev 721) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/TreeKind.java 2010-06-16 15:01:17 UTC (rev 722) @@ -47,6 +47,7 @@ * * @return String */ + @Override @Column(name = "Description", length = TBPersistable.COLUMN_LENGTH_100) public String getDescription() { return mDescription; Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/TreeQuality.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/TreeQuality.java 2010-06-15 17:56:12 UTC (rev 721) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/TreeQuality.java 2010-06-16 15:01:17 UTC (rev 722) @@ -62,6 +62,7 @@ * * @return String */ + @Override @Column(name = "Description", length = TBPersistable.COLUMN_LENGTH_STRING) public String getDescription() { return mDescription; Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/TreeType.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/TreeType.java 2010-06-15 17:56:12 UTC (rev 721) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/TreeType.java 2010-06-16 15:01:17 UTC (rev 722) @@ -59,6 +59,7 @@ * * @return String */ + @Override @Column(name = "Description", length = TBPersistable.COLUMN_LENGTH_STRING) public String getDescription() { return mDescription; Modified: trunk/treebase-core/src/test/java/org/cipres/treebase/TBMockObject.java =================================================================== --- trunk/treebase-core/src/test/java/org/cipres/treebase/TBMockObject.java 2010-06-15 17:56:12 UTC (rev 721) +++ trunk/treebase-core/src/test/java/org/cipres/treebase/TBMockObject.java 2010-06-16 15:01:17 UTC (rev 722) @@ -80,4 +80,9 @@ return null; } + public String getDescription() { + // TODO Auto-generated method stub + return null; + } + } Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SearchController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SearchController.java 2010-06-15 17:56:12 UTC (rev 721) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SearchController.java 2010-06-16 15:01:17 UTC (rev 722) @@ -163,7 +163,7 @@ if ( null != root ) { request.getSession().setAttribute("normalizedCQLQuery", URLEncoder.encode(root.toCQL(),"UTF-8")); } - return new ModelAndView(new RedirectView("searchResultsAsRDF.rdf")); + return new ModelAndView("searchResultsAsRDF"); } protected <E extends TBPersistable> SearchResults<E> intersectSearchResults( Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SearchResultsAsRDFController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SearchResultsAsRDFController.java 2010-06-15 17:56:12 UTC (rev 721) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SearchResultsAsRDFController.java 2010-06-16 15:01:17 UTC (rev 722) @@ -5,16 +5,9 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.cipres.treebase.NamespacedGUID; -import org.cipres.treebase.PhyloWSPath; -import org.cipres.treebase.TreebaseIDString; import org.cipres.treebase.TreebaseUtil; -import org.cipres.treebase.domain.matrix.Matrix; import org.cipres.treebase.domain.search.SearchResults; import org.cipres.treebase.domain.search.SearchResultsFrozen; -import org.cipres.treebase.domain.search.SearchResultsType; -import org.cipres.treebase.domain.study.Study; -import org.cipres.treebase.domain.tree.PhyloTree; import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.mvc.Controller; import org.z3950.zing.cql.CQLNode; Modified: trunk/treebase-web/src/main/webapp/WEB-INF/pages/searchResultsAsRDF.jsp =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/pages/searchResultsAsRDF.jsp 2010-06-15 17:56:12 UTC (rev 721) +++ trunk/treebase-web/src/main/webapp/WEB-INF/pages/searchResultsAsRDF.jsp 2010-06-16 15:01:17 UTC (rev 722) @@ -26,9 +26,9 @@ </image--%> <c:forEach var="result" items="${searchResultsThawed.results}" varStatus="status"> <item rdf:about="${baseURL}<c:out value="${result.phyloWSPath}"/>"> - <title><c:out value="${result.label}"/></title> + <title><![CDATA[<c:out value="${result.label}"/>]]></title> <link>${baseURL}<c:out value="${result.phyloWSPath}"/></link> - <description><c:out value="${result.namespacedGUID}"/></description> + <description><![CDATA[<c:out value="${result.description}"/>]]></description> <c:forEach var="anno" items="${result.annotations}" varStatus="annoStatus"> <<c:out value="${anno.property}"/> xmlns:<c:out value="${anno.prefix}"/>="<c:out value="${anno.URI}"/>"><c:out value="${anno.value}" escapeXml="true"/></<c:out value="${anno.property}"/>> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vga...@us...> - 2010-09-15 18:35:55
|
Revision: 749 http://treebase.svn.sourceforge.net/treebase/?rev=749&view=rev Author: vgapeyev Date: 2010-09-15 18:35:46 +0000 (Wed, 15 Sep 2010) Log Message: ----------- Dropped trailing slash on some repository URLs -- seems to reduce verbiage during maven builds Modified Paths: -------------- trunk/oai-pmh_data_provider/data_provider_web/pom.xml trunk/treebase-core/pom.xml trunk/treebase-web/pom.xml Modified: trunk/oai-pmh_data_provider/data_provider_web/pom.xml =================================================================== --- trunk/oai-pmh_data_provider/data_provider_web/pom.xml 2010-07-22 16:04:41 UTC (rev 748) +++ trunk/oai-pmh_data_provider/data_provider_web/pom.xml 2010-09-15 18:35:46 UTC (rev 749) @@ -49,7 +49,7 @@ <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>tomcat-maven-plugin</artifactId> - <version>1.0-SNAPSHOT</version> + <version>1.0</version> </plugin> </plugins> Modified: trunk/treebase-core/pom.xml =================================================================== --- trunk/treebase-core/pom.xml 2010-07-22 16:04:41 UTC (rev 748) +++ trunk/treebase-core/pom.xml 2010-09-15 18:35:46 UTC (rev 749) @@ -35,13 +35,13 @@ <repository> <id>m2.remote.repos</id> <name>Maven 2 Remote Repository</name> - <url>http://treebase.sourceforge.net/maven2/</url> + <url>http://treebase.sourceforge.net/maven2</url> </repository> <repository> <id>m2.nexml.repos</id> <name>NeXML Remote Repository</name> - <url>http://nexml-dev.nescent.org/.m2/repository/</url> + <url>http://nexml-dev.nescent.org/.m2/repository</url> </repository> </repositories> Modified: trunk/treebase-web/pom.xml =================================================================== --- trunk/treebase-web/pom.xml 2010-07-22 16:04:41 UTC (rev 748) +++ trunk/treebase-web/pom.xml 2010-09-15 18:35:46 UTC (rev 749) @@ -55,7 +55,7 @@ <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>tomcat-maven-plugin</artifactId> - <version>1.0-SNAPSHOT</version> + <version>1.0</version> </plugin> </plugins> @@ -72,17 +72,17 @@ <repository> <id>m2.remote.repos</id> <name>Maven 2 Remote Repository</name> - <url>http://treebase.sourceforge.net/maven2/</url> + <url>http://treebase.sourceforge.net/maven2</url> </repository> <repository> <id>m2.nexml.repos</id> <name>NeXML Remote Repository</name> - <url>http://nexml-dev.nescent.org/.m2/repository/</url> + <url>http://nexml-dev.nescent.org/.m2/repository</url> </repository> <repository> <id>org.tuckey.urlrewritefilter</id> - <url>http://repository.jboss.org/maven2/org/tuckey/urlrewritefilter/</url> + <url>http://repository.jboss.org/maven2/org/tuckey/urlrewritefilter</url> </repository> <repository> <id>java.net</id> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hs...@us...> - 2011-01-25 14:43:54
|
Revision: 772 http://treebase.svn.sourceforge.net/treebase/?rev=772&view=rev Author: hshyket Date: 2011-01-25 14:43:48 +0000 (Tue, 25 Jan 2011) Log Message: ----------- Changing the OAI-PMH date search. Using the last modified date (Study table) instead of the created date (Submission table) for the results. Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/dao/study/SubmissionDAO.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/SubmissionHome.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/SubmissionService.java trunk/treebase-core/src/main/java/org/cipres/treebase/service/study/SubmissionServiceImpl.java trunk/treebase-core/src/test/java/org/cipres/treebase/dao/study/SubmissionDAOTest.java trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/OAIPMHController.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/dao/study/SubmissionDAO.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/dao/study/SubmissionDAO.java 2011-01-19 19:59:02 UTC (rev 771) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/dao/study/SubmissionDAO.java 2011-01-25 14:43:48 UTC (rev 772) @@ -192,7 +192,17 @@ q.setDate("end", until); return q.list(); } + + public Collection<Submission> findByLastModifiedDateRange(Date from, Date until) { + Query q = getSession().createQuery( + "from Submission sub where sub.study.lastModifiedDate between :begin and :end"); + q.setDate("begin", from); + q.setDate("end", until); + return q.list(); + + } + public Submission findByStudyID(Long pID) { // TODO Auto-generated method stub Submission returnVal = null; Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/SubmissionHome.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/SubmissionHome.java 2011-01-19 19:59:02 UTC (rev 771) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/SubmissionHome.java 2011-01-25 14:43:48 UTC (rev 772) @@ -72,4 +72,5 @@ Collection<Submission> findByInProgressState(); Collection<Submission> findByCreateDateRange(Date from, Date until); + Collection<Submission> findByLastModifiedDateRange(Date from, Date until); } Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/SubmissionService.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/SubmissionService.java 2011-01-19 19:59:02 UTC (rev 771) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/SubmissionService.java 2011-01-25 14:43:48 UTC (rev 772) @@ -42,6 +42,8 @@ Collection<Submission> findPublishedSubmissions(); Collection<Submission> findSubmissionByCreateDateRange(Date from, Date until); + + Collection<Submission> findSubmissionByLastModifiedDateRange(Date from, Date until); /** * Create a submission, which associates with a new study. A submitter is required. * Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/service/study/SubmissionServiceImpl.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/service/study/SubmissionServiceImpl.java 2011-01-19 19:59:02 UTC (rev 771) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/service/study/SubmissionServiceImpl.java 2011-01-25 14:43:48 UTC (rev 772) @@ -934,7 +934,13 @@ return getSubmissionHome().findByCreateDateRange(from, until); } + + public Collection<Submission> findSubmissionByLastModifiedDateRange(Date from, Date until) { + + return getSubmissionHome().findByLastModifiedDateRange(from, until); + } + @Override Modified: trunk/treebase-core/src/test/java/org/cipres/treebase/dao/study/SubmissionDAOTest.java =================================================================== --- trunk/treebase-core/src/test/java/org/cipres/treebase/dao/study/SubmissionDAOTest.java 2011-01-19 19:59:02 UTC (rev 771) +++ trunk/treebase-core/src/test/java/org/cipres/treebase/dao/study/SubmissionDAOTest.java 2011-01-25 14:43:48 UTC (rev 772) @@ -184,6 +184,24 @@ } } + public void testFindByLastModifiedDateRange() { + String testName = "testFindByLastModifiedDateRange"; + if (logger.isInfoEnabled()) { + logger.info("\n\t\tRunning Test: " + testName); + } + + Date from = (new GregorianCalendar(2011,1,1)).getTime(); + Date until = (new GregorianCalendar(2011,3,1)).getTime(); + + Collection<Submission> s = getFixture().findByLastModifiedDateRange(from, until); + + + + assertTrue(s.size() > 0); + if (logger.isInfoEnabled()) { + logger.info("\n\t\tRunning Test: found " + s.size()); + } + } } Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/OAIPMHController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/OAIPMHController.java 2011-01-19 19:59:02 UTC (rev 771) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/OAIPMHController.java 2011-01-25 14:43:48 UTC (rev 772) @@ -122,7 +122,7 @@ List<Submission> list=null; try { - list = (List)submissionService.findSubmissionByCreateDateRange(IdentifyUtil.parseGranularity(identify.getGranularityPattern(),params.getModifiedFrom()), + list = (List)submissionService.findSubmissionByLastModifiedDateRange(IdentifyUtil.parseGranularity(identify.getGranularityPattern(),params.getModifiedFrom()), IdentifyUtil.parseGranularity(identify.getGranularityPattern(),params.getModifiedUntil())); } catch (ParseException e) { model.put("error_code", "badArgument"); @@ -139,7 +139,7 @@ List<Submission> list=null; try { - list = (List)submissionService.findSubmissionByCreateDateRange(IdentifyUtil.parseGranularity(identify.getGranularityPattern(),params.getModifiedFrom()), + list = (List)submissionService.findSubmissionByLastModifiedDateRange(IdentifyUtil.parseGranularity(identify.getGranularityPattern(),params.getModifiedFrom()), IdentifyUtil.parseGranularity(identify.getGranularityPattern(), params.getModifiedUntil())); } catch (ParseException e) { model.put("error_code", "badArgument"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sfr...@us...> - 2011-03-25 16:27:00
|
Revision: 779 http://treebase.svn.sourceforge.net/treebase/?rev=779&view=rev Author: sfrgpiel Date: 2011-03-25 16:26:54 +0000 (Fri, 25 Mar 2011) Log Message: ----------- adding a directory for derivative projects Added Paths: ----------- trunk/treebase-derivatives/ trunk/treebase-derivatives/LICENSE.txt trunk/treebase-derivatives/vToL/ trunk/treebase-derivatives/vToL/LICENSE.txt trunk/treebase-derivatives/vToL/db/ trunk/treebase-derivatives/vToL/src/ Added: trunk/treebase-derivatives/LICENSE.txt =================================================================== --- trunk/treebase-derivatives/LICENSE.txt (rev 0) +++ trunk/treebase-derivatives/LICENSE.txt 2011-03-25 16:26:54 UTC (rev 779) @@ -0,0 +1,27 @@ +Copyright (c) 2009, Phyloinformatics Research Foundation +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +* Neither the name of the Phyloinformatics Research Foundation nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file Added: trunk/treebase-derivatives/vToL/LICENSE.txt =================================================================== --- trunk/treebase-derivatives/vToL/LICENSE.txt (rev 0) +++ trunk/treebase-derivatives/vToL/LICENSE.txt 2011-03-25 16:26:54 UTC (rev 779) @@ -0,0 +1,27 @@ +Copyright (c) 2009, Phyloinformatics Research Foundation +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +* Neither the name of the Phyloinformatics Research Foundation nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hs...@us...> - 2011-04-12 20:16:54
|
Revision: 783 http://treebase.svn.sourceforge.net/treebase/?rev=783&view=rev Author: hshyket Date: 2011-04-12 20:16:48 +0000 (Tue, 12 Apr 2011) Log Message: ----------- When Dryad data is imported the authors are removed from the citation and placed as a string in the Notes field Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Citation.java trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/ProcessUserController.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Citation.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Citation.java 2011-04-11 19:01:05 UTC (rev 782) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Citation.java 2011-04-12 20:16:48 UTC (rev 783) @@ -470,7 +470,31 @@ getDetailedPublicationInformation(authorsCitationStyle, true); return authorsCitationStyle.toString(); } + + @Transient + public String getAuthorsDryadNotes() { + StringBuilder authorsDryad = new StringBuilder(); + List<Person> authors = getAuthors(); + int size = authors.size(); + + if (size > 0) { + + for (int i = 0; i < size; i++) { + authorsDryad.append(authors.get(i).getLastName()); + authorsDryad.append(", "); + authorsDryad.append(authors.get(i).getFirstName()); + + if (size > 1) { + authorsDryad.append("\n"); + } + } + + } + + return authorsDryad.toString(); + } + @Transient public String getAuthorsCitationStyleWithoutHtml() { Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/ProcessUserController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/ProcessUserController.java 2011-04-11 19:01:05 UTC (rev 782) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/ProcessUserController.java 2011-04-12 20:16:48 UTC (rev 783) @@ -91,9 +91,17 @@ Citation citation = cparser.getCitation(); Study study = new Study(); study.setName(bagitPath.getName()); - study.setCitation(citation); - citation.setStudy(study); + study.setCitation(citation); + citation.setStudy(study); + + study.setNotes("Please enter these author names into the TreeBASE citation " + + "by clicking on the highlighted \"Authors\" item in the Tool Box." + + "\n\n" + citation.getAuthorsDryadNotes()); + + citation.setAuthors(null); + Submission submission = mSubmissionService.createSubmission(user, study); + long unixTime = System.currentTimeMillis() / 1000L; List<File> files = DryadUtil.getDataFiles(dataPath); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hs...@us...> - 2011-05-03 19:21:31
|
Revision: 826 http://treebase.svn.sourceforge.net/treebase/?rev=826&view=rev Author: hshyket Date: 2011-05-03 19:21:24 +0000 (Tue, 03 May 2011) Log Message: ----------- Fixing issue where Specimen Labels for Latitude and Longitude were not displaying properly. Also adding in Google Maps link to table with row segment data. Adding in functionality to download all row segment metadata if any row segment data exists. Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/SpecimenLabel.java trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/study/matrix.jsp trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/study/rowSegments.jsp trunk/treebase-web/src/main/webapp/WEB-INF/treebase-servlet.xml Added Paths: ----------- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/DownloadRowSegmentDataController.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/SpecimenLabel.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/SpecimenLabel.java 2011-05-01 00:57:43 UTC (rev 825) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/SpecimenLabel.java 2011-05-03 19:21:24 UTC (rev 826) @@ -217,7 +217,7 @@ @Transient public String getLongitudeString() { if (mLongitude == null) return ""; - else return abs(mLongitude) + mLongitude < 0 ? "S" : "N"; + else return abs(mLongitude) + (mLongitude < 0 ? "S" : "N"); } /** @@ -245,7 +245,7 @@ @Transient public String getLatitudeString() { if (mLatitude == null) return ""; - else return abs(mLatitude) + mLatitude < 0 ? "W" : "E"; + else return abs(mLatitude) + (mLatitude < 0 ? "W" : "E"); } /** Added: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/DownloadRowSegmentDataController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/DownloadRowSegmentDataController.java (rev 0) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/DownloadRowSegmentDataController.java 2011-05-03 19:21:24 UTC (rev 826) @@ -0,0 +1,104 @@ + + + +package org.cipres.treebase.web.controllers; + +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.util.Map; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.web.servlet.ModelAndView; +import org.springframework.web.servlet.mvc.Controller; + +import org.cipres.treebase.TreebaseUtil; +import org.cipres.treebase.domain.matrix.RowSegmentService; +import org.cipres.treebase.web.util.WebUtil; + + +/** + * + * @author Madhu + * + * Created on May 15, 2008 + * + * For exporting the tab delimited row segment data for a particular matrix. + * + */ +public class DownloadRowSegmentDataController implements Controller { + + private RowSegmentService mRowSegmentService; + + /** + * @return the rowSegmentService + */ + public RowSegmentService getRowSegmentService() { + return mRowSegmentService; + } + + /** + * @param pRowSegmentService the rowSegmentService to set + */ + public void setRowSegmentService(RowSegmentService pRowSegmentService) { + mRowSegmentService = pRowSegmentService; + } + + public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) + throws Exception { + + Map<String,String []> param = request.getParameterMap(); + + + //String matrixId = (String) request.getSession().getAttribute("MATRIX_ID"); + String matrixId = param.get("matrixid")[0]; + String data = null; + if (!TreebaseUtil.isEmpty(matrixId)) { + data = getRowSegmentService().generateRowSegmentTextTSV(Long.parseLong(matrixId)); + } + + String downloadDir = request.getSession().getServletContext().getRealPath( + TreebaseUtil.FILESEP + "RowSegmentDownload") + + TreebaseUtil.FILESEP + "temp_rowsegment"; + + String fileName = "RowSegmentData_" + matrixId + ".tsv"; + + File dirPath = new File(downloadDir); + if (!dirPath.exists()) { + dirPath.mkdirs(); + } + + String rowsegmentFile = downloadDir + TreebaseUtil.FILESEP + fileName; + + try { + + File file = new File(rowsegmentFile); + FileWriter out = new FileWriter(file); + + out.write(data); + + out.close(); + // File did not exist and was created + // } else { + // File already exists + // } + + } catch (IOException e) { + e.printStackTrace(); + } + + WebUtil.downloadFile(response, downloadDir, fileName); + + File rowFile = new File(rowsegmentFile); + + if (rowFile.exists()) { + rowFile.delete(); + } + + // TODO Auto-generated method stub + return null; + } + +} Modified: trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/study/matrix.jsp =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/study/matrix.jsp 2011-05-01 00:57:43 UTC (rev 825) +++ trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/study/matrix.jsp 2011-05-03 19:21:24 UTC (rev 826) @@ -10,9 +10,10 @@ </c:url> <c:url var="matricesURL" value="matrices.html"> <c:param name="id" value="${study.id}"/> +</c:url> +<c:url var="rowSegmentsTSV" value="rowSegmentsTSV.html"> + <c:param name="matrixid" value="${matrix.id}" /> </c:url> - - <title>Matrix ${matrix.id} of study ${study.id}</title> <body id="s-matrix"/> @@ -23,7 +24,19 @@ <c:if test="${ not empty matrix.description }"> <p><strong>Description</strong>: ${matrix.description}</p> -</c:if> +</c:if> + +<c:set var="rowSegmentCount" value="false" /> + +<c:forEach var="row" items="${matrix.rowsReadOnly}" varStatus="status"> + <c:if test="${fn:length(row.segmentsReadOnly) gt 0}"> + <c:set var="rowSegmentCount" value="true" /> + </c:if> +</c:forEach> + +<c:if test="${rowSegmentCount}"> + <a href="${rowSegmentsTSV}">Download all Row Segment Metadata</a> +</c:if> <h2>Rows</h2> Modified: trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/study/rowSegments.jsp =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/study/rowSegments.jsp 2011-05-01 00:57:43 UTC (rev 825) +++ trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/study/rowSegments.jsp 2011-05-03 19:21:24 UTC (rev 826) @@ -19,6 +19,7 @@ <c:param name="id" value="${study.id}" /> <c:param name="matrixid" value="${matrix.id}" /> </c:url> + <c:forEach var="row" items="${matrix.rowsReadOnly}" varStatus="status"> <c:if test="${row.id == matrixrow.id}"> <c:set var="rownum" value="${status.count}"/> @@ -61,7 +62,28 @@ sortable="true" style="text-align:left; font-family:Courier; width:20%;"> ${seg.specimenInfo} - </display:column> + </display:column> + + <display:column title="Google Map" + style="text-align:left; font-family:Courier; width:20%;"> + <c:if test="${not empty(seg.specimenLabel.latitude) && not empty(seg.specimenLabel.longitude)}"> + <c:url var="googleMapURL" value="http://www.google.com/maps"> + <c:param name="f" value="q" /> + <c:param name="source" value="s_q" /> + <c:param name="hl" value="en" /> + <c:param name="geocode" value="" /> + <c:param name="q" value="${seg.specimenLabel.latitude},${seg.specimenLabel.longitude}" /> + <c:param name="sll" value="${seg.specimenLabel.latitude},${seg.specimenLabel.longitude}" /> + <c:param name="aq" value="" /> + <c:param name="sspn" value="0.199959,0.445976" /> + <c:param name="ie" value="UTF8" /> + <c:param name="z" value="16" /> + </c:url> + <a href='<c:out value="${googleMapURL}"/>' target="_blank">View Map</a> + </c:if> + </display:column> + + <%-- <display:column title="Segment data" property="segmentData" sortable="false" Modified: trunk/treebase-web/src/main/webapp/WEB-INF/treebase-servlet.xml =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/treebase-servlet.xml 2011-05-01 00:57:43 UTC (rev 825) +++ trunk/treebase-web/src/main/webapp/WEB-INF/treebase-servlet.xml 2011-05-03 19:21:24 UTC (rev 826) @@ -254,6 +254,10 @@ <property name="phyloTreeService"><ref bean="phyloTreeService"></ref></property> <property name="analysisService"><ref bean="analysisService"></ref></property> <property name="taxonLabelService"><ref bean="taxonLabelService"></ref></property> + </bean> + + <bean id="downloadRowSegmentDataController" class="org.cipres.treebase.web.controllers.DownloadRowSegmentDataController"> + <property name="rowSegmentService"><ref bean="rowSegmentService"></ref></property> </bean> <!-- MultiActionController to display sumbissions by different criteria --> @@ -1023,7 +1027,8 @@ <prop key="/search/study/matrix.html">searchSummaryController</prop> <prop key="/search/study/analysis.html">searchSummaryController</prop> <prop key="/search/study/taxa.html">searchSummaryController</prop> - <prop key="/search/study/rowSegments.html">searchSummaryController</prop> + <prop key="/search/study/rowSegments.html">searchSummaryController</prop> + <prop key="/search/study/rowSegmentsTSV.html">downloadRowSegmentDataController</prop> <prop key="/search/study/anyObjectAsRDF.rdf">anyObjectAsRDFController</prop> <prop key="/search/searchResultsAsRDF.rdf">searchResultsAsRDFController</prop> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hs...@us...> - 2011-11-01 16:29:06
|
Revision: 978 http://treebase.svn.sourceforge.net/treebase/?rev=978&view=rev Author: hshyket Date: 2011-11-01 16:29:00 +0000 (Tue, 01 Nov 2011) Log Message: ----------- Removing translation table from trees Nexus file Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/TreeBlock.java trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SearchController.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/TreeBlock.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/TreeBlock.java 2011-10-29 13:29:35 UTC (rev 977) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/TreeBlock.java 2011-11-01 16:29:00 UTC (rev 978) @@ -2,6 +2,7 @@ import java.util.ArrayList; import java.util.Collection; +import java.util.HashMap; import java.util.Iterator; import java.util.List; @@ -260,7 +261,52 @@ // } } + + @Transient + public void generateAFileDynamicallyNoTranslate(StringBuilder pBuilder) { + TaxonLabelSet tlSet = getTaxonLabelSet(); + List<TaxonLabel> txnlbllist = tlSet.getTaxonLabelsReadOnly(); + int numoftxnlbls = getTaxonNumber(); + + String title = getTitle(); + if (TreebaseUtil.isEmpty(title)) { + //use the default title: + //title = "List of Uploaded Tree Block"; + } + pBuilder.append("BEGIN TREES;\n"); + pBuilder.append(" TITLE " + StringUtil.tokenize(getTitle()) + ";\n"); + pBuilder.append(" LINK TAXA = " + StringUtil.tokenize(tlSet.getTitle().replaceAll("Input|Output", "")) + ";\n"); + + + for (PhyloTree atree : getTreeList()) { + pBuilder.append(" TREE " + StringUtil.tokenize(atree.getLabel()) + " = "); + + if (atree.getRootedTree() != null) { + if (atree.getRootedTree().booleanValue()) { + pBuilder.append("[&R] "); + } else { + pBuilder.append("[&U] "); + } + + } + String newick = atree.getNewickString(); + for (int z = 0; z < numoftxnlbls; z++) { + newick.concat(StringUtil.tokenize(txnlbllist.get(z).getTaxonLabel())); + } + // out.append(atree.getNewickString()); + pBuilder.append(newick); + pBuilder.append("\n"); + } + pBuilder.append("\n\n\nEND;\n"); + + // File did not exist and was created + // } else { + // File already exists + // } + + } + @Transient public String getTaxonLabelSetTitle() { return getTaxonLabelSet().getTitle(); Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SearchController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SearchController.java 2011-10-29 13:29:35 UTC (rev 977) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SearchController.java 2011-11-01 16:29:00 UTC (rev 978) @@ -190,11 +190,14 @@ Set<PhyloTree> trees = treeResults.getResults(); TreeBlock treeBlock = new TreeBlock(); TaxonLabelSet taxonLabelSet = new TaxonLabelSet(); + List<String> taxonLabels = new ArrayList<String>(); + for (PhyloTree pTree : trees) { for (TaxonLabel pTaxLabel : pTree.getTreeBlock().getTaxonLabelList()) { - if (! taxonLabelSet.getTaxonLabelsReadOnly().contains(pTaxLabel)) { - taxonLabelSet.addPhyloTaxonLabel(pTaxLabel); + if (! taxonLabels.contains(pTaxLabel.getTaxonLabel())) { + taxonLabelSet.addPhyloTaxonLabel(pTaxLabel); + taxonLabels.add(pTaxLabel.getTaxonLabel()); } } treeBlock.addPhyloTree(pTree); @@ -208,7 +211,7 @@ taxonLabelSet.buildNexusBlockTaxa(builder, true, false); - treeBlock.generateAFileDynamically(builder); + treeBlock.generateAFileDynamicallyNoTranslate(builder); fileName += ".nex"; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hs...@us...> - 2011-11-28 15:43:26
|
Revision: 989 http://treebase.svn.sourceforge.net/treebase/?rev=989&view=rev Author: hshyket Date: 2011-11-28 15:43:15 +0000 (Mon, 28 Nov 2011) Log Message: ----------- Adding a read timeout when uBio takes too long to respond Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/TaxonLabelService.java trunk/treebase-core/src/main/java/org/cipres/treebase/service/taxon/TaxonLabelServiceImpl.java trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/ListTaxaController.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/TaxonLabelService.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/TaxonLabelService.java 2011-11-23 21:43:54 UTC (rev 988) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/TaxonLabelService.java 2011-11-28 15:43:15 UTC (rev 989) @@ -372,4 +372,6 @@ */ Set<TaxonVariant> findTaxonVariantByName(String s); + boolean getuBioTimeOutError(); + } Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/service/taxon/TaxonLabelServiceImpl.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/service/taxon/TaxonLabelServiceImpl.java 2011-11-23 21:43:54 UTC (rev 988) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/service/taxon/TaxonLabelServiceImpl.java 2011-11-28 15:43:15 UTC (rev 989) @@ -6,6 +6,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; +import java.io.InterruptedIOException; import java.net.MalformedURLException; import java.net.URL; import java.net.URLConnection; @@ -52,18 +53,22 @@ private static final String NMBKID = "namebankID"; private static final String NAMESTR = "nameString"; private static final int TIMEOUT = 10000; + private static final int READTIMEOUT = 30000; private static final String VALUETAG = "value"; private static final String DETAILSSERVICEURLPART = "http://www.ubio.org/browser/details.php?namebankID="; private TaxonLabelHome mTaxonLabelHome; private PhyloTreeHome mPhyloTreeHome; private TaxonHome mTaxonHome; + + private boolean muBioTimeOutError; /** * constructor. */ public TaxonLabelServiceImpl() { super(); + setuBioTimeOutError(false); } /** @@ -459,7 +464,7 @@ booleanplaceholder bph = new booleanplaceholder(); longplaceholder lph = new longplaceholder(); TaxonVariant firstVariant = null; - + // XXX 1. Turn label into tri- or binomial, no var./ex./etc. testString = normalizeLabelString(pTaxonLabel.getTaxonLabel()); @@ -468,6 +473,9 @@ String result = getStringFromURL(taxonFinderFullURL, null, null); // XXX 3. Process TaxonFinder result + if (getuBioTimeOutError()) { + return null; + } if (result == null || result.indexOf(NMBKID) < 0 || result.indexOf(testString) < 0 || result.indexOf(NAMESTR) < 0) { LOGGER.warn("Problem: uBio result is garbled or doesn't contain our testString"); return null; @@ -755,6 +763,7 @@ URL url = new URL(urlString); URLConnection urlconn = url.openConnection(); urlconn.setConnectTimeout(TIMEOUT); + urlconn.setReadTimeout(READTIMEOUT); BufferedReader in = new BufferedReader(new InputStreamReader(urlconn.getInputStream())); StringBuilder results = new StringBuilder(); String str; @@ -780,7 +789,11 @@ return results.toString(); } catch (MalformedURLException mfe) { mfe.printStackTrace(); - } catch (IOException ioe) { + } catch (InterruptedIOException iioe) { + iioe.printStackTrace(); + setuBioTimeOutError(true); + } + catch (IOException ioe) { ioe.printStackTrace(); } return null; @@ -808,6 +821,14 @@ } return result.substring(start + 1, end); } + + public boolean getuBioTimeOutError() { + return muBioTimeOutError; + } + + public void setuBioTimeOutError(Boolean pTimeOutError) { + muBioTimeOutError = pTimeOutError; + } /** * @return the taxonHome @@ -1019,5 +1040,5 @@ @Override public Class defaultResultClass() { return TaxonLabel.class; - } + } } Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/ListTaxaController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/ListTaxaController.java 2011-11-23 21:43:54 UTC (rev 988) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/ListTaxaController.java 2011-11-28 15:43:15 UTC (rev 989) @@ -148,11 +148,20 @@ // no variants were found by uBio if ( variant == null ) { - ubioResultMessages.add(taxonlabel.getTaxonLabel() + " is **UNRECOGNIZED**."); - ubioResultErrors.add(taxonlabel.getTaxonLabel() - + " is **UNRECOGNIZED** try <a href=" + UBIOSEARCHTAXONLABEL - + taxonlabel.getTaxonLabel().replace(EMPTYSPACE, "%20") - + " target=_blank>UBIO</a> site."); + if (getTaxonLabelService().getuBioTimeOutError()) { + ubioResultMessages.add("uBio service was unavailable when checking " + taxonlabel.getTaxonLabel() + "."); + ubioResultErrors.add("uBio service was unavailable when checking " + taxonlabel.getTaxonLabel() + + " try <a href=" + UBIOSEARCHTAXONLABEL + + taxonlabel.getTaxonLabel().replace(EMPTYSPACE, "%20") + + " target=_blank>UBIO</a> site."); + } + else { + ubioResultMessages.add(taxonlabel.getTaxonLabel() + " is **UNRECOGNIZED**."); + ubioResultErrors.add(taxonlabel.getTaxonLabel() + + " is **UNRECOGNIZED** try <a href=" + UBIOSEARCHTAXONLABEL + + taxonlabel.getTaxonLabel().replace(EMPTYSPACE, "%20") + + " target=_blank>UBIO</a> site."); + } } // variants stored by uBio,TODO now check for homonyms This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hs...@us...> - 2012-01-11 16:59:59
|
Revision: 1012 http://treebase.svn.sourceforge.net/treebase/?rev=1012&view=rev Author: hshyket Date: 2012-01-11 16:59:50 +0000 (Wed, 11 Jan 2012) Log Message: ----------- Adding feed2js PHP application Added Paths: ----------- trunk/treebase_feed/ trunk/treebase_feed/.htaccess trunk/treebase_feed/build.php trunk/treebase_feed/feed2js.php trunk/treebase_feed/feed2js_config.php trunk/treebase_feed/feed2php.inc trunk/treebase_feed/footer trunk/treebase_feed/magpie/ trunk/treebase_feed/magpie/cache/ trunk/treebase_feed/magpie/cache_utf8/ trunk/treebase_feed/magpie/extlib/ trunk/treebase_feed/magpie/extlib/Snoopy.class.inc trunk/treebase_feed/magpie/rss_cache.inc trunk/treebase_feed/magpie/rss_fetch.inc trunk/treebase_feed/magpie/rss_parse.inc trunk/treebase_feed/magpie/rss_utils.inc trunk/treebase_feed/magpie_debug.php trunk/treebase_feed/magpie_simple.php trunk/treebase_feed/nosource.php trunk/treebase_feed/popup.js trunk/treebase_feed/preview.php trunk/treebase_feed/style/ trunk/treebase_feed/style/.css trunk/treebase_feed/style/basic1.css trunk/treebase_feed/style/bbc_style.css trunk/treebase_feed/style/blackbox.css trunk/treebase_feed/style/css_classes.gif trunk/treebase_feed/style/dog.css trunk/treebase_feed/style/dog.jpg trunk/treebase_feed/style/essc.css trunk/treebase_feed/style/feed2js.jpg trunk/treebase_feed/style/greenbars.css trunk/treebase_feed/style/kp.css trunk/treebase_feed/style/main.css trunk/treebase_feed/style/marooned2.css trunk/treebase_feed/style/nobullets.css trunk/treebase_feed/style/none.css trunk/treebase_feed/style/outlive.css trunk/treebase_feed/style/play-button.jpg trunk/treebase_feed/style/plum.css trunk/treebase_feed/style/rss.css trunk/treebase_feed/style/sekodeng.css trunk/treebase_feed/style/style_pile.php trunk/treebase_feed/style/zanestate.css trunk/treebase_feed/style.php trunk/treebase_feed/style_preview.php Property changes on: trunk/treebase_feed ___________________________________________________________________ Added: bugtraq:number + true Added: trunk/treebase_feed/.htaccess =================================================================== --- trunk/treebase_feed/.htaccess (rev 0) +++ trunk/treebase_feed/.htaccess 2012-01-11 16:59:50 UTC (rev 1012) @@ -0,0 +1,4 @@ +Options +FollowSymlinks +RewriteEngine on +RewriteCond $1 !^(feed2js\.php) +RewriteRule ^(.*)$ /treebase-feed/feed2js.php/$1 [L] \ No newline at end of file Added: trunk/treebase_feed/build.php =================================================================== --- trunk/treebase_feed/build.php (rev 0) +++ trunk/treebase_feed/build.php 2012-01-11 16:59:50 UTC (rev 1012) @@ -0,0 +1,223 @@ +<?php +/* Feed2JS : RSS feed to JavaScript + build.php + + ABOUT + This script can be used to create a form that is useful + for creating the JavaScript strings and testing the output + + Developed by Alan Levine + http://cogdogblog.com/ + + MORE: + Part of the Feed2JS package + See http://feed2js.org/ + +*/ + + + +// GET VARIABLES --------------------------------------------- +// Get variables from input form and set default values + + + + $src = (isset($_GET['src'])) ? $_GET['src'] : ''; + $chan = (isset($_GET['chan'])) ? $_GET['chan'] : 'y'; + $num = (isset($_GET['num'])) ? $_GET['num'] : 0; + $desc = (isset($_GET['desc'])) ? $_GET['desc'] : 1; + $auth = (isset($_GET['au'])) ? $_GET['au'] : 'n'; + $date = (isset($_GET['date'])) ? $_GET['date'] : 'n'; + $tz = (isset($_GET['tz'])) ? $_GET['tz'] : 'feed'; + $targ = (isset($_GET['targ'])) ? $_GET['targ'] : 'n'; + $html = (isset($_GET['html'])) ? $_GET['html'] : 'n'; + $utf = (isset($_GET['utf'])) ? $_GET['utf'] : 'y'; + $rss_box_id = (isset($_GET['rss_box_id'])) ? $_GET['rss_box_id'] : ''; + $pc = (isset($_GET['pc'])) ? $_GET['pc'] : 'n'; + + +// test for malicious use of script tages +if (strpos($src, '<script>')) { + $src = preg_replace("/(\<script)(.*?)(script>)/si", "SCRIPT DELETED", "$src"); + die("Warning! Attempt to inject javascript detected. Aborted and tracking log updated."); +} + + +// check for status of submit buttons + $generate = (isset($_GET['generate'])) ? $_GET['generate'] : ''; + if (isset($generate)) $generate = $_GET['generate']; + +// update to full descriptions for html turned on + if ($html=='a') $desc = 0; + +// build parameter string for the feed2js url + $options = ''; + if ($chan != 'n') $options .= "&chan=$chan"; + if ($num != 0) $options .= "&num=$num"; + if ($desc != 0) $options .= "&desc=$desc"; + if ($auth != 'n') $options .= "&au=$auth"; + if ($date != 'n') $options .= "&date=$date"; + if ($tz != 'feed') $options .= "&tz=$tz"; + if ($targ != 'n') $options .= "&targ=$targ"; + if ($html != 'n') $html_options = "&html=$html"; + if ($utf == 'y') { + $options .= '&utf=y'; + $utf_str = ' charset="UTF-8"'; // extra param for embed code + } else { + $utf_str = ''; + } + if ($rss_box_id != '') $options .= "&css=$rss_box_id"; + if ($pc == 'y') $options .= '&pc=y'; + + + +if ($generate) { + // URLs for a preview or a generated feed link + + $my_dir = 'http://' . $_SERVER['SERVER_NAME'] . dirname($_SERVER['PHP_SELF']); + + $rss_str = "$my_dir/feed2js.php?src=" . urlencode($src) . $options . $html_options; + + $noscript_rss_str = "$my_dir/feed2js.php?src=" . urlencode($src) . $options . '&html=y'; + +} + +?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + +<html> +<head> + <title>Build a Feed with Feed2JS</title> + <link rel="stylesheet" href="style/main.css" media="all" /> +<script type="text/javascript" language="Javascript"> +<!-- +function query_str(form) { + + // builds a proper query string by extracting Javascript form variables + // so we can open a preview in a new window + options = encodeURIComponent(form.src.value); + + if (form.chan[2].checked) { + options += '&chan=n'; + } else if (form.chan[1].checked) { + options += '&chan=title'; + } + + if (form.num.value != 0) options += '&num=' + form.num.value; + if (form.desc.value != 1 && !form.html[0].checked) options += '&desc=' + form.desc.value; + + if (form.date[0].checked) options += '&date=y'; + if (form.tz.value != 'feed') options += '&tz=' + form.tz.value; + + if (form.html[0].checked) { + options += '&html=a'; + } else if (form.html[2].checked) { + options += '&html=p'; + } + + + options += '&targ=' + form.targ.value; + + if (form.utf.checked) options += '&utf=y'; + options += '&css=' + form.rss_box_id.value; + + if (form.pc[0].checked) options += '&pc=y'; + + if (form.au[0].checked) options += '&au=y'; + + return(options); + + +} +//--> +</script> + + <script src="popup.js" type="text/javascript" language="Javascript"> +</script> + +</head> +<body> +<div id="content"> +<h1>Feed2JS Build JavaScript and Preview</h1> +<p class="first">The tool below will help you format a feed's display with the information you want to use on your web site. All you need to enter is the URL for the RSS source, and select the desired options below. </p> + +<p>First, be sure to <strong>preview</strong> the feed to verify the content and format. Once the content is displayed how you like, just use the <strong>generate javascript</strong> button to get your code. Once the content looks okay, move on to our <a href="style.php">style tool</a> to make it pretty.</p> + +<?php if ($generate):?> + + +<h2>Get Your Code Here</h2> +<p class="first">Below is the code you need to copy and paste to your own web page to include this RSS feed. The NOSCRIPT tag provides a link to a HTML display of the feed for users who may not have JavaScript enabled. </p> +<form> +<span class="caption">cut and paste javascript:</span><br><textarea name="t" rows="8" cols="70"> +<script language="JavaScript" src="<?php echo htmlentities($rss_str)?>" <?php echo $utf_str?> type="text/javascript"></script> + +<noscript> +<a href="<?php echo htmlentities($noscript_rss_str)?>">View RSS feed</a> +</noscript> +</textarea> +</form> + + +<?php endif?> + +<form method="get" action="build.php" name="builder"> + +<p><strong>URL</strong> Enter the web address of the RSS Feed (must be in http:// format, not feed://)<br> + +<input type="text" name="src" size="50" value="<?php echo $src?>"> <br> +<span style="font-size:x-small">Note: Please verify the URL of your feed (make sure it presents raw RSS) and <a href="http://feedvalidator.org/" onClick="window.open('http://feedvalidator.org/check.cgi?url=' + encodeURIComponent(document.builder.src.value), 'check'); return false;">check that it is valid</a> before using this form.</span> +</p> + +<div id="badge" style="width:250px; padding:0;"> +<h3 class="badge-header">Show n' Tell!</h3> + <div align="center"> + <input type="button" name="preview" value="Preview Feed" onClick="pr=window.open('preview.php?src=' + query_str(document.builder), 'prev', 'scrollbars,resizable,left=20,screenX=20,top=40,screenY=40,height=580,width=700'); pr.focus();" + /> <br /> + <input type="submit" name="generate" value="Generate JavaScript" /> + </div> +</div> + + +<p><strong>Show channel?</strong> (yes/no/title) Display information about the publisher of the feed (yes=show the title and description; title= display title only, no=do not display anything) <br> +<input type="radio" name="chan" value="y" <?php if ($chan=='y') echo 'checked="checked"'?> /> yes <input type="radio" name="chan" value="title" <?php if ($chan=='title') echo 'checked="checked"'?>/> title <input type="radio" name="chan" value="n" <?php if ($chan=='n') echo 'checked="checked"'?>/> no</p> + +<p><strong>Number of items to display.</strong> Enter the number of items to be displayed (enter 0 to show all available)<br> +<input type="text" name="num" size="10" value="<?php echo $num?>"></p> + +<p><strong>Show/Hide item descriptions? How much?</strong> (0=no descriptions; 1=show full description text; n>1 = display first n characters of description; n=-1 do not link item title, just display item contents)<br> +<input type="text" name="desc" size="10" value="<?php echo $desc?>"></p> + +<p><strong>Show item author?</strong> (yes/no) Display the name of an item's author (yes=show the title and description; no=do not display anything) <br> +<input type="radio" name="au" value="y" <?php if ($auth=='y') echo 'checked="checked"'?> /> yes <input type="radio" name="au" value="n" <?php if ($auth=='n') echo 'checked="checked"'?>/> no</p> + +<p><strong>Use HTML in item display? </strong> ("yes" = use HTML from feed and the full item descriptions will be used, ignoring any character limit set above; "no" = output is text-only formatted by CSS; "preserve paragraphs" = no HTML but convert all RETURN/linefeeds to <br> to preserve paragraph breaks)<br> +<input type="radio" name="html" value="a" <?php if ($html=='a') echo 'checked="checked"'?>/> yes <input type="radio" name="html" value="n" <?php if ($html=='n') echo 'checked="checked"'?> /> no <input type="radio" name="html" value="p" <?php if ($html=='p') echo 'checked="checked"'?> /> preserve paragraphs only</p> + +<p><strong>Show item posting date?</strong> (yes/no) Display the time and date for each item.<br> +<input type="radio" name="date" value="y" <?php if ($date=='y') echo 'checked="checked"'?>/> yes <input type="radio" name="date" value="n" <?php if ($date!='y') echo 'checked="checked"'?> /> no</p> + +<p><strong>Time Zone Offset</strong> (+n/-n/'feed') Date and timer are converted to GMT time; to have display in local time, you must enter an offset from your current local time to <strong><?php echo gmdate("r")?> (GMT)</strong>. If your local time is 5 hours before GMT, enter <code>-5</code>. If your local time is 8 hours past GMT, enter <code>+8</code>. Fractional offsets such as +10:30 must be entered as decimal <code>+10.5</code>. If you prefer to just display the date is recorded in the RSS, use a value = <code>feed</code><br> +<input type="text" name="tz" size="10" value="<?php echo $tz?>"></p> + +<p><strong>Target links in the new window?</strong> (n="no, links open the same page", y="yes, open links in a new window", "xxxx" = open links in a frame named 'xxxx', 'popup' = use a <a href="popup.js">JavaScript function</a> <code>popupfeed()</code> to open in new window) <br> +<input type="text" name="targ" size="10" value="<?php echo $targ?>"></p> + +<p><strong>UTF-8 Character Encoding</strong><br> Required for many non-western language web pages and also may help if you see strange characters replacing quotes in your output (see <a href="http://feed2js.org/index.php?s=help#chars">help pages</a> for more information).<br /> +<input type="checkbox" name="utf" value="y" <?php if ($utf=='y') echo 'checked="checked"'?> /> use UTF-8 character encoding +</p> + +<p><strong>Podcast enclosures</strong><br> For RSS 2.0 feeds with enclosures, display link to media files<br /> +<input type="radio" name="pc" value="y" <?php if ($pc=='y') echo 'checked="checked"'?> /> yes +<input type="radio" name="pc" value="n" <?php if ($pc!='y') echo 'checked="checked"'?> /> no +</p> + +<p><strong>Custom CSS Class (advanced users)</strong> <br> Use to create different styles for multiple feeds per page. Specify class for content as <code>rss-box-XXXX</code> where XXXX is the value entered below. Style sheets must be created in accordance with <a href="style.php#2style">Feed2JS guidelines</a>.<br> +<input type="text" name="rss_box_id" size="10" value="<?php echo $rss_box_id?>"></p> + +</form> +</div> + +<?php include 'footer'?> + +</body> +</html> Added: trunk/treebase_feed/feed2js.php =================================================================== --- trunk/treebase_feed/feed2js.php (rev 0) +++ trunk/treebase_feed/feed2js.php 2012-01-11 16:59:50 UTC (rev 1012) @@ -0,0 +1,392 @@ +<?php +/* Feed2JS : RSS feed to JavaScript src file + + VERSION 2.3 (2011 jun 9) + + ABOUT + This PHP script will take an RSS feed as a value of src="...." + and return a JavaScript file that can be linked + remotely from any other web page. Output includes + site title, link, and description as well as item site, link, and + description with these outouts contolled by extra parameters. + + Developed by Alan Levine initially released 13.may.2004 + http://cogdogblog.com/ + + PRIMARY SITE: + http://feed2js.org/ + + CODE: + http://code.google.com/p/feed2js/ + + Feed2JS makes use of the Magpie RSS parser from + http://magpierss.sourceforge.net/ + + ------------- small print --------------------------------------- + GNU General Public License + Copyright (C) 2004-2010 Alan Levine + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details + http://www.gnu.org/licenses/gpl.html + ------------- small print --------------------------------------- + +*/ + +// ERROR CHECKING FOR NO SOURCE ------------------------------- + +$script_msg = ''; +$src = (isset($_GET['src'])) ? $_GET['src'] : ''; + +// trap for missing src param for the feed, use a dummy one so it gets displayed. +if (!$src or strpos($src, 'http://')!=0) $src= 'http://' . $_SERVER['SERVER_NAME'] . dirname($_SERVER['PHP_SELF']) . '/nosource.php'; + +// test for malicious use of script tages +if (strpos($src, '<script>')) { + $src = preg_replace("/(\<script)(.*?)(script>)/si", "SCRIPT DELETED", "$src"); + die("Warning! Attempt to inject javascript detected. Aborted and tracking log updated."); +} + +// MAGPIE SETUP ---------------------------------------------------- +// access configuration settings +require_once('feed2js_config.php'); + +if (!in_array(urldecode($_GET["src"]), $allowedFeeds)) { + die("Not Allowed"); +} + +// check for utf encoding type +$utf = (isset($_GET['utf'])) ? $_GET['utf'] : 'n'; + +if ($utf == 'y') { + define('MAGPIE_CACHE_DIR', MAGPIE_DIR . 'cache_utf8/'); + // chacrater encoding + define('MAGPIE_OUTPUT_ENCODING', 'UTF-8'); + + +} else { + define('MAGPIE_CACHE_DIR', MAGPIE_DIR . 'cache/'); + define('MAGPIE_OUTPUT_ENCODING', 'ISO-8859-1'); +} + +// GET VARIABLES --------------------------------------------- +// retrieve values from posted variables + +// flag to show channel info +$chan = (isset($_GET['chan'])) ? $_GET['chan'] : 'n'; + +// variable to limit number of displayed items; default = 0 (show all, 100 is a safe bet to list a big list of feeds) + +$num = (isset($_GET['num'])) ? $_GET['num'] : 0; +if ($num==0) $num = 100; + +// indicator to show item description, 0 = no; 1=all; n>1 = characters to display +// values of -1 indicate to displa item without the title as a link +// (default=0) +$desc = (isset($_GET['desc'])) ? $_GET['desc'] : 0; + +// flag to show author of items, values: no/yes (default=no) +$auth = (isset($_GET['au'])) ? 'y' : 'n'; + +// flag to show date of items, values: no/yes (default=no) +$date = (isset($_GET['date'])) ? $_GET['date'] : 'n'; + +// time zone offset for making local time, +// e.g. +7, =-10.5; 'feed' = print the time string in the RSS w/o conversion +$tz = (isset($_GET['tz'])) ? $_GET['tz'] : 'feed'; + + +// flag to open target window in new window; n = same window, y = new window, +// other = targeted window, 'popup' = call JavaScript function popupfeed() to display +// in new window (default is n) + +$targ = (isset($_GET['targ'])) ? $_GET['targ'] : 'n'; +if ($targ == 'n') { + $target_window = ' target="_self"'; +} elseif ($targ == 'y' ) { + $target_window = ' target="_blank"'; +} elseif ($targ == 'popup') { + $target_window = ' onClick="popupfeed(this.href);return false"'; +} else { + $target_window = ' target="' . $targ . '"'; +} + +// flag to show feed as full html output rather than JavaScript, used for alternative +// views for JavaScript-less users. +// y = display html only for non js browsers (NO LONGER USED) +// n = default (JavaScript view) +// a = display javascript output but allow HTML +// p = display text only items but convert linefeeds to BR tags + +// default setting for no conversion of linebreaks +$html = (isset($_GET['html'])) ? $_GET['html'] : 'n'; + +$br = ' '; +if ($html == 'a') { + $desc = 1; +} elseif ($html == 'p') { + $br = '<br />'; +} + +// optional parameter to use different class for the CSS container +$rss_box_id = (isset($_GET['css'])) ? '-' . $_GET['css'] : ''; + +// optional parameter to use different class for the CSS container +$play_podcast = (isset($_GET['pc'])) ? $_GET['pc'] : 'n'; + + +// PARSE FEED and GENERATE OUTPUT ------------------------------- +// This is where it all happens! + + +// check if site has a setting to restrict to a url +if (isset($restrict_url)) { + $src_host = substr($src, 7); + $src_pos = strpos($src_host,"/"); + if ($src_pos) { + $src_host = substr($src_host,0, $src_pos); + } +} +if (isset($restrict_url) && substr($src_host, strlen($src_host)-strlen($restrict_url)) != $restrict_url) { + $str.= "document.write('<div class=\"rss-box" . $rss_box_id . + "\"><p class=\"rss-item\"><em>Error:</em> on feed <strong>" . + $src . "</strong>. " . + "Feeds are allowed only from URLs from the site http://*" . + $restrict_url . "</p></div>');\n"; + +} else { + + + $rss = @fetch_rss( $src ); + + // begin javascript output string for channel info + $str= "document.write('<div class=\"rss-box" . $rss_box_id . "\">');\n"; + + + // no feed found by magpie, return error statement + if (!$rss) { + $str.= "document.write('<p class=\"rss-item\">$script_msg<em>Error:</em> Feed failed! Causes may be (1) No data found for RSS feed $src; (2) There are no items are available for this feed; (3) The RSS feed does not validate.<br /><br /> Please verify that the URL <a href=\"$src\">$src</a> works first in your browser and that the feed passes a <a href=\"http://feedvalidator.org/check.cgi?url=" . urlencode($src) . "\">validator test</a>.</p></div>');\n"; + + + } else { + + + // Create CONNECTION CONFIRM + // create output string for local javascript variable to let + // browser know that the server has been contacted + $feedcheck_str = "feed2js_ck = true;\n\n"; + + // we have a feed, so let's process + if ($chan == 'y') { + + // output channel title and description + $str.= "document.write('<p class=\"rss-title\"><a class=\"rss-title\" href=\"" . trim($rss->channel['link']) . '"' . $target_window . ">" . addslashes(strip_returns($rss->channel['title'])) . "</a><br /><span class=\"rss-item\">" . addslashes(strip_returns(strip_tags($rss->channel['description']))) . "</span></p>');\n"; + + } elseif ($chan == 'title') { + // output title only + $str.= "document.write('<p class=\"rss-title\"><a class=\"rss-title\" href=\"" . trim($rss->channel['link']) . '"' . $target_window . ">" . addslashes(strip_returns($rss->channel['title'])) . "</a></p>');\n"; + + } + + // begin item listing + $str.= "document.write('<ul class=\"rss-items\">');\n"; + + // Walk the items and process each one + $all_items = array_slice($rss->items, 0, $num); + + foreach ( $all_items as $item ) { + + // set defaults thanks RPFK + if (!isset($item['summary'])) $item['summary'] = ''; + $more_link = ''; + + // create output for item author + + + $author_str = ''; + if ($auth == 'y') { + if (isset($item['dc']['creator'])) { + $author_str = ' <span class="rss-item-auth">(' . addslashes(strip_tags($item['dc']['creator'])) . ')</span>'; + + } else { + if (isset($item['author_name'])) { + $author_str = ' <span class="rss-item-auth">(' . addslashes(strip_tags($item['author_name'])) . ')</span>'; + } + } + + } + + + + if ($item['link']) { + // link url + $my_url = addslashes($item['link']); + } elseif ($item['guid']) { + // feeds lacking item -> link + $my_url = ($item['guid']); + } + + + if ($desc < 0) { + $str.= "document.write('<li class=\"rss-item\">');\n"; + + } elseif ($item['title']) { + // format item title + $my_title = addslashes(strip_returns($item['title'])); + + + + // write the title strng + $str.= "document.write('<li class=\"rss-item\"><a class=\"rss-item\" href=\"" . trim($my_url) . "\"" . $target_window . '>' . $my_title . '</a>' . $author_str . "<br />');\n"; + + + } else { + // if no title, build a link to tag on the description + $str.= "document.write('<li class=\"rss-item\">');\n"; + $more_link = " <a class=\"rss-item\" href=\"" . trim($my_url) . '"' . $target_window . ">«details»</a>"; + } + + // print out date if option indicated + + if ($date == 'y') { + + if ($tz == 'feed') { + // echo the date/time stamp reported in the feed + + if ($item['pubdate'] != '') { + // RSS 2.0 is already formatted, so just use it + //$pretty_date = $item['pubdate']; + $pretty_date = date($date_format, strtotime($item['pubdate'])); + } elseif ($item['published'] != "") { + // ATOM 1.0 format, remove the "T" and "Z" and the time zone offset + $pretty_date = str_replace("T", " ", $item['published']); + $pretty_date= str_replace("Z", " ", $pretty_date); + + } elseif ($item['issued'] != "") { + // ATOM 0.3 format, remove the "T" and "Z" and the time zone offset + $pretty_date = str_replace("T", " ", $item['issued']); + $pretty_date= str_replace("Z", " ", $pretty_date); + } elseif ( $item['dc']['date'] != "") { + // RSS 1.0, remove the "T" and the time zone offset + $pretty_date = str_replace("T", " ", $item['dc']['date']); + $pretty_date = substr($pretty_date, 0,-6); + } else { + + // no time/date stamp, + $pretty_date = 'n/a'; + } + + + } else { + // convert to local time via conversion to GMT + offset + + // adjust local server time to GMT and then adjust time according to user + // entered offset. + + // let's see what kind of timestamps we can pull... + if ($item['date_timestamp'] != "") { + $ts = $item['date_timestamp']; + } elseif ($item['published'] != "") { + $ts = strtotime($item['published']); + } elseif ($item['issued'] != "") { + $ts = strtotime($item['issued']); + } elseif ( $item['dc']['date'] != "") { + $ts = strtotime($item['dc']['date']); + } else { + $ts = time(); + } + + $pretty_date = date($date_format, $ts - $tz_offset + $tz * 3600); + + } + + $str.= "document.write('<span class=\"rss-date\">$pretty_date</span><br />');\n"; + } + + // link to podcast media if availavle + + if ($play_podcast == 'y' and is_array($item['enclosure'])) { + $str.= "document.write('<div class=\"pod-play-box\">');\n"; + for ($i = 0; $i < count($item['enclosure']); $i++) { + + // display only if enclosure is a valid URL + //if (strpos($item['enclosure'][$i]['url'], 'http://')!=0) { + $str.= "document.write('<a class=\"pod-play\" href=\"" . trim($item['enclosure'][$i]['url']) . "\" title=\"Play Now\" target=\"_blank\"><em>Play</em> <span> " . substr(trim($item['enclosure'][$i]['url']), -3) . "</span></a> ');\n"; + //} + + } + + $str.= "document.write('</div>');\n"; + + } + + + // output description of item if desired + if ($desc) { + + if ($item['atom_content']) { + // Atom content - note that wordpress.com feeds return bad data here "A" + // so revert to description if this is the case. + $my_blurb = ($item['atom_content'] == "A") ? $item['description'] : html_entity_decode ( $item['atom_content'], ENT_NOQUOTES, MAGPIE_OUTPUT_ENCODING); + + } else if ($item['content']) { + + + + // Atom/encocded content support (thanks David Carter-Tod) + + $my_blurb = html_entity_decode ( $item['content'], ENT_NOQUOTES, MAGPIE_OUTPUT_ENCODING); + + + } else { + $my_blurb = $item['summary']; + } + + // strip html + if ($html != 'a') $my_blurb = strip_tags($my_blurb); + + // trim descriptions + if ($desc > 1) { + + // display specified substring numbers of chars; + // html is stripped to prevent cut off tags + // make sure we dont chop UTF-8 characters + + + if ($utf == 'y') { + $my_blurb = mb_substr($my_blurb, 0, $desc, 'UTF-8') . '...'; + } else { + $my_blurb = substr($my_blurb, 0, $desc) . '...'; + } + + } + + + $str.= "document.write('" . addslashes(strip_returns($my_blurb, $br)) . "');\n"; + + } + + $str.= "document.write('$more_link</li>');\n"; + } + + + $str .= "document.write('</ul></div>');\n"; + } // end restrict_url +} + +// Render as JavaScript +// START OUTPUT +// headers to tell browser this is a JS file +if ($rss) header("Content-type: application/x-javascript"); + +// Spit out the results as the series of JS statements +echo $feedcheck_str . $str; + + +?> Added: trunk/treebase_feed/feed2js_config.php =================================================================== --- trunk/treebase_feed/feed2js_config.php (rev 0) +++ trunk/treebase_feed/feed2js_config.php 2012-01-11 16:59:50 UTC (rev 1012) @@ -0,0 +1,84 @@ +<?php +/* Feed2JS : RSS feed to JavaScript Configuration include + + Use this include to establish server specific paths + and other common functions used by the feed2js.php + + See main script for all the gory details or the Google Code site + http://code.google.com/p/feed2js/ + + created 10.sep.2004 +*/ + + +/* Check to make sure that only the allowed URLs are accepted */ +define('TREEBASE_RSS_FEED', 'http://pipes.yahoo.com/pipes/pipe.run?_id=41dc2d1544150c1b8e69367059f26950&_render=rss'); +$allowedFeeds = array(TREEBASE_RSS_FEED); + +// MAGPIE SETUP ---------------------------------------------------- +// Define path to Magpie files and load library +// The easiest setup is to put the 4 Magpie include +// files in the same directory: +// define('MAGPIE_DIR', './') + +// Otherwise, provide a full valid file path to the directory +// where magpie sites + +define('MAGPIE_DIR', './magpie/'); + +// access magpie libraries +require_once(MAGPIE_DIR.'rss_fetch.inc'); +require_once(MAGPIE_DIR.'rss_utils.inc'); + +// value of 2 optionally show lots of debugging info but breaks JavaScript +// This should be set to 0 unless debugging +define('MAGPIE_DEBUG', 0); + +// Define cache age in seconds. +define('MAGPIE_CACHE_AGE', 60*60); + +// OTHER SETTIINGS ---------------------------------------------- +// Output spec for item date string if used +// see http://www.php.net/manual/en/function.date.php +//$date_format = "F d, Y h:i:s a"; +$date_format = "F d, Y"; + + +// server time zone offset from GMT +// If this line generates errors (common on Windoze servers, +// then figure out your time zone offset from GMT and enter +// manually, e.g. $tz_offset = -7; + +$tz_offset = gmmktime(0,0,0,1,1,1970) - mktime(0,0,0,1,1,1970); + +// ERROR Handling ------------------------------------------------ + +// Report all errors except E_NOTICE +// This is the default value set in php.ini for Apache but often not Windows +// We recommend changing the value to 0 once your scripts are working +ini_set('display_errors', 1); +ini_set('error_reporting', E_ALL^ E_NOTICE); + + +// Restrict RSS url to domain +// Example: www.example.org => allows www.example.org and mywww.example.org +// Example: .example.org => allows www.example.org and other.example.org + +// remove the comment here to activate url restriction +//$restrict_url = "pipes.yahoo.com"; + +// comment out this line to activate url restriction +//unset($restrict_url); + + +// Utility to remove return characters from strings that might +// pollute JavaScript commands. While we are at it, substitute +// valid single quotes as well and get rid of any escaped quote +// characters +function strip_returns ($text, $linefeed=" ") { + $subquotes = trim( preg_replace( '/\s+/', ' ', $text ) ); + return preg_replace("(\r\n|\n|\r)", $linefeed, $subquotes); +} + + +?> \ No newline at end of file Added: trunk/treebase_feed/feed2php.inc =================================================================== --- trunk/treebase_feed/feed2php.inc (rev 0) +++ trunk/treebase_feed/feed2php.inc 2012-01-11 16:59:50 UTC (rev 1012) @@ -0,0 +1,346 @@ +<?php +/* Feed2inc : RSS feed to PHP include file + + ABOUT + This PHP code can be used as an include to provide the + same functionality of our Feed2JS concept, but without + the need to generate content via JavaScript + + Developed by Alan Levine + http://cogdogblog.com/ + + This is a modified version of Fee22JS and merely replaces + the output of Javascript to that for a PHP. See the original + feed2js.php for change history. + + USAGE: + See http://feed2js.org/index.php?s=php + + CODE: + http://code.google.com/p/feed2js/ + + + This makes use of the Magpie RSS parser from + http://magpierss.sourceforge.net/ + + ------------- small print --------------------------------------- + GNU General Public License + Copyright (C) 2004-2010 Alan Levine + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details + http://www.gnu.org/licenses/gpl.html + ------------- small print --------------------------------------- + +*/ + +require_once('feed2js_config.php'); + +/// trap for missing src param for the feed, use a dummy one so it gets displayed. + +if (!$src or strpos($src, 'http://')!=0) $src= 'http://' . $_SERVER['SERVER_NAME'] . dirname($_SERVER['PHP_SELF']) . '/nosource.php'; + +// check for utf encoding type +if (!isset($utf)) $utf = 'n'; + +if ($utf == 'y') { + define('MAGPIE_CACHE_DIR', MAGPIE_DIR . 'cache_utf8/'); + // character encoding + define('MAGPIE_OUTPUT_ENCODING', 'UTF-8'); + +} else { + define('MAGPIE_CACHE_DIR', MAGPIE_DIR . 'cache/'); + define('MAGPIE_OUTPUT_ENCODING', 'ISO-8859-1'); + +} + + +// GET VARIABLES --------------------------------------------- +// retrieve values from posted variables + +// flag to show channel info +if (!isset($chan)) $chan = 'n'; + +// variable to limit number of displayed items; default = 0 (show all, 20 is a safe bet to list a big list of feeds) + +if (!isset($num)) $num = 0; +if ($num==0) $num = 100; + +// indicator to show item description, 0 = no; 1=all; n>1 = characters to display +// values of -1 indicate to display item without the title as a link +// (default=0) +if (!isset($desc)) $desc = 0; + + +// flag to show author of items, values: no/yes (default=no) +$auth = (isset($_GET['au'])) ? 'y' : 'n'; + + +// flag to show date of posts, values: no/yes (default=no) +$date = (isset($date)) ? $date : 'n'; + +// time zone offset for making local time, +// e.g. +7, =-10.5; 'feed' = print the time string in the RSS w/o conversion +$tz = (isset($tz)) ? $tz : 'feed'; + +// flag to open target window in new window; n = same window, y = new window, +// other = targeted window, 'popup' = call JavaScript function popupfeed to display +// in new window +// (default is n) + +if (!isset($targ)) $targ = 'n'; + +if ($targ == 'n') { + $target_window = ' target="_self"'; +} elseif ($targ == 'y' ) { + $target_window = ' target="_blank"'; +} elseif ($targ == 'popup') { + $target_window = ' onClick="popupfeed(this.href);return false"'; +} else { + $target_window = ' target="' . $targ . '"'; +} + +// flag to show feed as full html output rather than JavaScript, used for alternative +// views for JavaScript-less users. +// y = display html only for non js browsers +// n = default (JavaScript view) +// a = display javascript output but allow HTML +// p = display text only items but convert linefeeds to BR tags + +// default setting for no conversion of linebreaks +if (!isset($html)) $html = 'n'; + +$br = ' '; +if ($html == 'a') { + $desc = 1; +} elseif ($html == 'p') { + $br = '<br />'; +} + +// optional parameter to use different class for the CSS container +if (isset($css)) { + $rss_box_id = '-' . $css; +} else { + $rss_box_id = ''; +} + +if (isset($pc)) { + $play_podcast = $pc; +} else { + $play_podcast = 'n'; +} + + +// PARSE FEED and GENERATE OUTPUT ------------------------------- +// This is where it all happens! + +// Fetch the data, thanks Magpie +$rss = @fetch_rss( $src ); + +// begin javascript output string for channel info +$str = "<div class=\"rss-box" . $rss_box_id . "\">\n"; + +// no feed found by magpie, return error statement +if (!$rss) { + // error, nothing grabbed + $str.= "<p class=\"rss-item\"><em>Error:</em> Feed failed! Causes may be (1) No data found for RSS feed $src; (2) There are no items are available for this feed; (3) The RSS feed does not validate.<br /><br /> Please verify that the URL <a href=\"$src\">$src</a> works first in your browser and that the feed passes a <a href=\"http://feedvalidator.org/check.cgi?url=" . urlencode($src) . "\">validator test</a>.</p>\n"; +} else { + + if ($chan == 'y') { + + // output channel title and description + $str.= "<p class=\"rss-title\"><a class=\"rss-title\" href=\"" . trim($rss->channel['link']) . '"' . $target_window . ">" . strip_returns($rss->channel['title']) . "</a><br /><span class=\"rss-item\">" . strip_returns(strip_tags($rss->channel['description'])) . "</span></p>\n"; + + } elseif ($chan == 'title') { + // output title only + $str.= "<p class=\"rss-title\"><a class=\"rss-title\" href=\"" . trim($rss->channel['link']) . '"' . $target_window . ">" . strip_returns($rss->channel['title']) . "</a></p>\n"; + + } + + + // begin item listing + $str.= "<ul class=\"rss-items\">\n"; + + + // Walk the items and process each one + $all_items = array_slice($rss->items, 0, $num); + + foreach ( $all_items as $item ) { + + + // create output for item author + $author_str = ''; + if ($auth == 'y') { + if (isset($item['dc']['creator'])) { + $author_str = ' <span class="rss-item-auth">(' . addslashes(strip_tags($item['dc']['creator'])) . ')</span>'; + + } else { + if (isset($item['author_name'])) { + $author_str = ' <span class="rss-item-auth">(' . addslashes(strip_tags($item['author_name'])) . ')</span>'; + } + } + + } + + + + if ($item['link']) { + // link url + $my_url = $item['link']; + } elseif ($item['guid']) { + // feeds lacking item -> link + $my_url = ($item['guid']); + } + + + if ($desc < 0) { + $str.= "<li class=\"rss-item\">\n"; + + } elseif ($item['title']) { + // format item title + $my_title = strip_returns($item['title']); + + // create a title attribute. thanks Seb! + $title_str = substr(strip_returns(htmlspecialchars(strip_tags($item['summary']))), 0, 60) . '...'; + + // write the item with a title attribute + $str.= "<li class=\"rss-item\"><a class=\"rss-item\" href=\"" . trim($my_url) . "\" title=\"$title_str\"" . $target_window . ">" . $my_title . '</a> ' . $author_str . "<br />\n"; + + + } else { + // if no title, build a link to tag on the description + $str.= "<li class=\"rss-item\">\n"; + $more_link = " <a class=\"rss-item\" href=\"" .trim($my_url) . '"' . $target_window . ">«details»</a>"; + } + + + // print out date if option indicated and feed returns a value. + // Use the new date_timestamp function in Magpie 0.71 + if ($tz == 'feed') { + // echo the date/time stamp reported in the feed + + if ($item['pubdate'] != '') { + // RSS 2.0 is already formatted, so just use it + $pretty_date = $item['pubdate']; + } elseif ($item['published'] != "") { + // ATOM 1.0 format, remove the "T" and "Z" and the time zone offset + $pretty_date = str_replace("T", " ", $item['published']); + $pretty_date= str_replace("Z", " ", $pretty_date); + + } elseif ($item['issued'] != "") { + // ATOM 0.3 format, remove the "T" and "Z" and the time zone offset + $pretty_date = str_replace("T", " ", $item['issued']); + $pretty_date= str_replace("Z", " ", $pretty_date); + } elseif ( $item['dc']['date'] != "") { + // RSS 1.0, remove the "T" and the time zone offset + $pretty_date = str_replace("T", " ", $item['dc']['date']); + $pretty_date = substr($pretty_date, 0,-6); + } else { + + // no time/date stamp, + $pretty_date = 'n/a'; + } + + } else { + // convert to local time via conversion to GMT + offset + + // adjust local server time to GMT and then adjust time according to user + // entered offset. + + // let's see what kind of timestamps we can pull... + if ($item['date_timestamp'] != "") { + $ts = $item['date_timestamp']; + } elseif ($item['published'] != "") { + $ts = strtotime($item['published']); + } elseif ($item['issued'] != "") { + $ts = strtotime($item['issued']); + } elseif ( $item['dc']['date'] != "") { + $ts = strtotime($item['dc']['date']); + } else { + $ts = time(); + } + + $pretty_date = date($date_format, $ts - $tz_offset + $tz * 3600); + + } + + + $str.= "<span class=\"rss-date\">$pretty_date</span><br />\n"; + } + + // link to podcast media if available + + if ($play_podcast == 'y' and is_array($item['enclosure'])) { + $str.= "<div class=\"pod-play-box\">Media: "; + + for ($i = 0; $i < count($item['enclosure']); $i++) { + + // display only if enclosure is a valid URL + //if (strpos($item['enclosure'][$i]['url'], 'http://')!=0) { + $str.= "<a class=\"pod-play\"><a href=\"" . trim($item['enclosure'][$i]['url']) . "\" title=\"Play Now\" target=\"_blank\"><em>Play</em> <span>" . substr(trim($item['enclosure'][$i]['url']), -3) . "</span></a> "; + //} + + } + $str.= "</div>"; + + } + + + + + // output description of item if desired + if ($desc) { + + if ($item['atom_content']) { + // Atom content - note that wordpress.com feeds return bad data here "A" + // so revert to description if this is the case. + $my_blurb = ($item['atom_content'] == "A") ? $item['description'] : html_entity_decode ( $item['atom_content'], ENT_NOQUOTES, MAGPIE_OUTPUT_ENCODING); + + } else if ($item['content']) { + + + + // Atom/encocded content support (thanks David Carter-Tod) + + $my_blurb = html_entity_decode ( $item['content'], ENT_NOQUOTES, MAGPIE_OUTPUT_ENCODING); + + + } else { + $my_blurb = $item['summary']; + } + + + + // strip html + if ($html != 'a') $my_blurb = strip_tags($my_blurb); + + // trim descriptions + if ($desc > 1) { + + // display specified substring numbers of chars; + // html is stripped to prevent cut off tags + // make sure we dont chop UTF-8 characters + if ($utf == 'y') { + $my_blurb = mb_substr($my_blurb, 0, $desc, 'UTF-8') . '...'; + } else { + $my_blurb = substr($my_blurb, 0, $desc) . '...'; + } + } + + $str.= strip_returns($my_blurb, $br) . "\n"; + } + + $str.= "$more_link</li>\n"; + } +} + +$str .= "</ul></div>\n"; +echo $str; + +?> Added: trunk/treebase_feed/footer =================================================================== --- trunk/treebase_feed/footer (rev 0) +++ trunk/treebase_feed/footer 2012-01-11 16:59:50 UTC (rev 1012) @@ -0,0 +1,9 @@ +<div id="footer"> +<p class="smallprint"> +<strong>Feed2JS v1.93</strong><br> +http://<?php echo $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF']?><br><br> +Feed2JS code is Copyright (C) 2004-<?php echo date("Y")?> Created by <a href="http://cogdogblog.com/">Alan Levine</a>. It is available as both a free service at <a href="http://feed2js.org/">http://feed2js.org/</a> and open source code from <a href="https://eduforge.org/projects/feed2js/">eduforge</a>. <br><br> +This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.<br><br> + +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details <a href="http://www.gnu.org/licenses/gpl.html">http://www.gnu.org/licenses/gpl.html</a></p> +</div> Property changes on: trunk/treebase_feed/magpie ___________________________________________________________________ Added: bugtraq:number + true Property changes on: trunk/treebase_feed/magpie/cache ___________________________________________________________________ Added: bugtraq:number + true Property changes on: trunk/treebase_feed/magpie/cache_utf8 ___________________________________________________________________ Added: bugtraq:number + true Property changes on: trunk/treebase_feed/magpie/extlib ___________________________________________________________________ Added: bugtraq:number + true Added: trunk/treebase_feed/magpie/extlib/Snoopy.class.inc =================================================================== --- trunk/treebase_feed/magpie/extlib/Snoopy.class.inc (rev 0) +++ trunk/treebase_feed/magpie/extlib/Snoopy.class.inc 2012-01-11 16:59:50 UTC (rev 1012) @@ -0,0 +1,900 @@ +<?php + +/************************************************* + +Snoopy - the PHP net client +Author: Monte Ohrt <mo...@is...> +Copyright (c): 1999-2000 ispi, all rights reserved +Version: 1.0 + + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +You may contact the author of Snoopy by e-mail at: +m...@is... + +Or, write to: +Monte Ohrt +CTO, ispi +237 S. 70th suite 220 +Lincoln, NE 68510 + +The latest version of Snoopy can be obtained from: +http://snoopy.sourceforge.com + +*************************************************/ + +class Snoopy +{ + /**** Public variables ****/ + + /* user definable vars */ + + var $host = "www.php.net"; // host name we are connecting to + var $port = 80; // port we are connecting to + var $proxy_host = ""; // proxy host to use + var $proxy_port = ""; // proxy port to use + var $agent = "Snoopy v1.0"; // agent we masquerade as + var $referer = ""; // referer info to pass + var $cookies = array(); // array of cookies to pass + // $cookies["username"]="joe"; + var $rawheaders = array(); // array of raw headers to send + // $rawheaders["Content-type"]="text/html"; + + var $maxredirs = 5; // http redirection depth maximum. 0 = disallow + var $lastredirectaddr = ""; // contains address of last redirected address + var $offsiteok = true; // allows redirection off-site + var $maxframes = 0; // frame content depth maximum. 0 = disallow + var $expandlinks = true; // expand links to fully qualified URLs. + // this only applies to fetchlinks() + // or submitlinks() + var $passcookies = true; // pass set cookies back through redirects + // NOTE: this currently does not respect + // dates, domains or paths. + + var $user = ""; // user for http authentication + var $pass = ""; // password for http authentication + + // http accept types + var $accept = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*"; + + var $results = ""; // where the content is put + + var $error = ""; // error messages sent here + var $response_code = ""; // response code returned from server + var $headers = array(); // headers returned from server sent here + var $maxlength = 500000; // max return data length (body) + var $read_timeout = 0; // timeout on read operations, in seconds + // supported only since PHP 4 Beta 4 + // set to 0 to disallow timeouts + var $timed_out = false; // if a read operation timed out + var $status = 0; // http request status + + var $curl_path = "/usr/bin/curl"; + // Snoopy will use cURL for fetching + // SSL content if a full system path to + // the cURL binary is supplied here. + // set to false if you do not have + // cURL installed. See http://curl.haxx.se + // for details on installing cURL. + // Snoopy does *not* use the cURL + // library functions built into php, + // as these functions are not stable + // as of this Snoopy release. + + // send Accept-encoding: gzip? + var $use_gzip = true; + + /**** Private variables ****/ + + var $_maxlinelen = 4096; // max line length (headers) + + var $_httpmethod = "GET"; // default http request method + var $_httpversion = "HTTP/1.0"; // default http request version + var $_submit_method = "POST"; // default submit method + var $_submit_type = "application/x-www-form-urlencoded"; // default submit type + var $_mime_boundary = ""; // MIME boundary for multipart/form-data submit type + var $_redirectaddr = false; // will be set if page fetched is a redirect + var $_redirectdepth = 0; // increments on an http redirect + var $_frameurls = array(); // frame src urls + var $_framedepth = 0; // increments on frame depth + + var $_isproxy = false; // set if using a proxy server + var $_fp_timeout = 30; // timeout for socket connection + +/*======================================================================*\ + Function: fetch + Purpose: fetch the contents of a web page + (and possibly other protocols in the + future like ftp, nntp, gopher, etc.) + Input: $URI the location of the page to fetch + Output: $this->results the output text from the fetch +\*======================================================================*/ + + function fetch($URI) + { + + //preg_match("|^([^:]+)://([^:/]+)(:[\d]+)*(.*)|",$URI,$URI_PARTS); + $URI_PARTS = parse_url($URI); + if (!empty($URI_PARTS["user"])) + $this->user = $URI_PARTS["user"]; + if (!empty($URI_PARTS["pass"])) + $this->pass = $URI_PARTS["pass"]; + + switch($URI_PARTS["scheme"]) + { + case "http": + $this->host = $URI_PARTS["host"]; + if(!empty($URI_PARTS["port"])) + $this->port = $URI_PARTS["port"]; + if($this->_connect($fp)) + { + if($this->_isproxy) + { + // using proxy, send entire URI + $this->_httprequest($URI,$fp,$URI,$this->_httpmethod); + } + else + { + $path = $URI_PARTS["path"].(isset($URI_PARTS["query"]) ? "?".$URI_PARTS["query"] : ""); + // no proxy, send only the path + $this->_httprequest($path, $fp, $URI, $this->_httpmethod); + } + + $this->_disconnect($fp); + + if($this->_redirectaddr) + { + /* url was redirected, check if we've hit the max depth */ + if($this->maxredirs > $this->_redirectdepth) + { + // only follow redirect if it's on this site, or offsiteok is true + if(preg_match("|^http://".preg_quote($this->host)."|i",$this->_redirectaddr) || $this->offsiteok) + { + /* follow the redirect */ + $this->_redirectdepth++; + $this->lastredirectaddr=$this->_redirectaddr; + $this->fetch($this->_redirectaddr); + } + } + } + + if($this->_framedepth < $this->maxframes && count($this->_frameurls) > 0) + { + $frameurls = $this->_frameurls; + $this->_frameurls = array(); + + while(list(,$frameurl) = each($frameurls)) + { + if($this->_framedepth < $this->maxframes) + { + $this->fetch($frameurl); + $this->_framedepth++; + } + else + break; + } + } + } + else + { + return false; + } + return true; + break; + case "https": + if(!$this->curl_path || (!is_executable($this->curl_path))) { + $this->error = "Bad curl ($this->curl_path), can't fetch HTTPS \n"; + return false; + } + $this->host = $URI_PARTS["host"]; + if(!empty($URI_PARTS["port"])) + $this->port = $URI_PARTS["port"]; + if($this->_isproxy) + { + // using proxy, send entire URI + $this->_httpsrequest($URI,$URI,$this->_httpmethod); + } + else + { + $path = $URI_PARTS["path"].($URI_PARTS["query"] ? "?".$URI_PARTS["query"] : ""); + // no proxy, send only the path + $this->_httpsrequest($path, $URI, $this->_httpmethod); + } + + if($this->_redirectaddr) + { + /* url was redirected, check if we've hit the max depth */ + if($this->maxredirs > $this->_redirectdepth) + { + // only follow redirect if it's on this site, or offsiteok is true + if(preg_match("|^http://".preg_quote($this->host)."|i",$this->_redirectaddr) || $this->offsiteok) + { + /* follow the redirect */ + $this->_redirectdepth++; + $this->lastredirectaddr=$this->_redirectaddr; + $this->fetch($this->_redirectaddr); + } + } + } + + if($this->_framedepth < $this->maxframes && count($this->_frameurls) > 0) + { + $frameurls = $this->_frameurls; + $this->_frameurls = array(); + + while(list(,$frameurl) = each($frameurls)) + { + if($this->_framedepth < $this->maxframes) + { + $this->fetch($frameurl); + $this->_framedepth++; + } + else + break; + } + } + return true; + break; + default: + // not a valid protocol + $this->error = 'Invalid protocol "'.$URI_PARTS["scheme"].'"\n'; + return false; + break; + } + return true; + } + + + +/*======================================================================*\ + Private functions +\*======================================================================*/ + + +/*======================================================================*\ + Function: _striplinks + Purpose: strip the hyperlinks from an html document + Input: $document document to strip. + Output: $match an array of the links +\*======================================================================*/ + + function _striplinks($document) + { + preg_match_all("'<\s*a\s+.*href\s*=\s* # find <a href= + ([\"\'])? # find single or double quote + (?(1) (.*?)\\1 | ([^\s\>]+)) # if quote found, match up to next matching + # quote, otherwise match up to next space + 'isx",$document,$links); + + + // catenate the non-empty matches from the conditional subpattern + + while(list($key,$val) = each($links[2])) + { + if(!empty($val)) + $match[] = $val; + } + + while(list($key,$val) = each($links[3])) + { + if(!empty($val)) + $match[] = $val; + } + + // return the links + return $match; + } + +/*======================================================================*\ + Function: _stripform + Purpose: strip the form elements from an html document + Input: $document document to strip. + Output: $match an array of the links +\*======================================================================*/ + + function _stripform($document) + { + preg_match_all("'<\/?(FORM|INPUT|SELECT|TEXTAREA|(OPTION))[^<>]*>(?(2)(.*(?=<\/?(option|select)[^<>]*>[\r\n]*)|(?=[\r\n]*))|(?=[\r\n]*))'Usi",$document,$elements); + + // catenate the matches + $match = implode("\r\n",$elements[0]); + + // return the links + return $match; + } + + + +/*======================================================================*\ + Function: _striptext + Purpose: strip the text from an html document + Input: $document document to strip. + Output: $text the resulting text +\*======================================================================*/ + + function _striptext($document) + { + + // I didn't use preg eval (//e) since that is only available in PHP 4.0. + // so, list your entities one by one here. I included some of the + // more common ones. + + $search = array("'<script[^>]*?>.*?</script>'si", // strip out javascript + "'<[\/\!]*?[^<>]*?>'si", // strip out html tags + "'([\r\n])[\s]+'", // strip out white space + "'&(quote|#34);'i", // replace html entities + "'&(amp|#38);'i", + "'&(lt|#60);'i", + "'&(gt|#62);'i", + "'&(nbsp|#160);'i", + "'&(iexcl|#161);'i", + "'&(cent|#162);'i", + "'&(pound|#163);'i", + "'&(copy|#169);'i" + ); + $replace = array( "", + "", + "\\1", + "\"", + "&", + "<", + ">", + " ", + chr(161), + chr(162), + chr(163), + chr(169)); + + $text = preg_replace($search,$replace,$document); + + return $text; + } + +/*======================================================================*\ + Function: _expandlinks + Purpose: expand each link into a fully qualified URL + Input: $links the links to qualify + $URI the full URI to get the base from + Output: $expandedLinks the expanded links +\*======================================================================*/ + + function _expandlinks($links,$URI) + { + + preg_match("/^[^\?]+/",$URI,$match); + + $match = preg_replace("|/[^\/\.]+\.[^\/\.]+$|","",$match[0]); + + $search = array( "|^http://".preg_quote($this->host)."|i", + "|^(?!http://)(\/)?(?!mailto:)|i", + "|/\./|", + "|/[^\/]+/\.\./|" + ); + + $replace = array( "", + $match."/", + "/", + "/" + ); + + $expandedLinks = preg_replace($search,$replace,$links); + + return $expandedLinks; + } + +/*======================================================================*\ + Function: _httprequest + Purpose: go get the http data from the server + Input: $url the url to fetch + $fp the current open file pointer + $URI the full URI + $body body contents to send if any (POST) + Output: +\*======================================================================*/ + + function _httprequest($url,$fp,$URI,$http_method,$content_type="",$body="") + { + if($this->passcookies && $this->_redirectaddr) + $this->setcookies(); + + $URI_PARTS = parse_url($URI); + if(empty($url)) + $url = "/"; + $headers = $http_method." ".$url." ".$this->_httpversion."\r\n"; + if(!empty($this->agent)) + $headers .= "User-Agent: ".$this->agent."\r\n"; + if(!empty($this->host) && !isset($this->rawheaders['Host'])) + $headers .= "Host: ".$this->host."\r\n"; + if(!empty($this->accept)) + $headers .= "Accept: ".$this->accept."\r\n"; + + if($this->use_gzip) { + // make sure PHP was built with --with-zlib + // and we can handle gzipp'ed data + if ( function_exists(gzinflate) ) { + $headers .= "Accept-encoding: gzip\r\n"; + } + else { + trigger_error( + "use_gzip is on, but PHP was built without zlib support.". + " Requesting file(s) without gzip encoding.", + E_USER_NOTICE); + } + } + + if(!empty($this->referer)) + $headers .= "Referer: ".$this->referer."\r\n"; + if(!empty($this->cookies)) + { + if(!is_array($this->cookies)) + $this->cookies = (array)$this->cookies; + + reset($this->cookies); + if ( count($this->cookies) > 0 ) { + $cookie_headers .= 'Cookie: '; + foreach ( $this->cookies as $cookieKey => $cookieVal ) { + $cookie_headers .= $cookieKey."=".urlencode($cookieVal)."; "; + } + $headers .= substr($cookie_headers,0,-2) . "\r\n"; + } + } + if(!empty($this->rawheaders)) + { + if(!is_array($this->rawheaders)) + $this->rawheaders = (array)$this->rawheaders; + while(list($headerKey,$headerVal) = each($this->rawheaders)) + $headers .= $headerKey.": ".$headerVal."\r\n"; + } + if(!empty($content_type)) { + $headers .= "Content-type: $content_type"; + if ($content_type == "multipart/form-data") + $headers .= "; boundary=".$this->_mime_boundary; + $headers .= "\r\n"; + } + if(!empty($body)) + $headers .= "Content-length: ".strlen($body)."\r\n"; + if(!empty($this->user) || !empty($this->pass)) + $headers .= "Authorization: BASIC ".base64_encode($this->user.":".$this->pass)."\r\n"; + + $headers .= "\r\n"; + + // set the read timeout if needed + if ($this->read_timeout > 0) + socket_set_timeout($fp, $this->read_timeout); + $this->timed_out = false; + + fwrite($fp,$headers.$body,strlen($headers.$body)); + + $this->_redirectaddr = false; + unset($this->headers); + + // content was returned gzip encoded? + $is_gzipped = false; + + while($currentHeader = fgets($fp,$this->_maxlinelen)) + { + if ($this->read_timeout > 0 && $this->_check_timeout($fp)) + { + $this->status=-100; + return false; + } + + // if($currentHeader == "\r\n") + if(preg_match("/^\r?\n$/", $currentHeader) ) + break; + + // if a header begins with Location: or URI:, set the redirect + if(preg_match("/^(Location:|URI:)/i",$currentHeader)) + { + // get URL portion of the redirect + preg_match("/^(Location:|URI:)\s+(.*)/",chop($currentHeader),$matches); + // look for :// in the Location header to see if hostname is included + if(!preg_match("|\:\/\/|",$matches[2])) + { + // no host in the path, so pre... [truncated message content] |
From: <hs...@us...> - 2012-06-15 15:19:22
|
Revision: 1095 http://treebase.svn.sourceforge.net/treebase/?rev=1095&view=rev Author: hshyket Date: 2012-06-15 15:19:11 +0000 (Fri, 15 Jun 2012) Log Message: ----------- Updating PostgreSQL dependency to 8.4. Excluding geronimo-servlet and servlet-api from dependecies. Modified Paths: -------------- trunk/treebase-core/pom.xml trunk/treebase-web/pom.xml Modified: trunk/treebase-core/pom.xml =================================================================== --- trunk/treebase-core/pom.xml 2012-06-11 18:10:38 UTC (rev 1094) +++ trunk/treebase-core/pom.xml 2012-06-15 15:19:11 UTC (rev 1095) @@ -127,7 +127,7 @@ <dependency> <groupId>postgresql</groupId> <artifactId>postgresql</artifactId> - <version>8.3-603.jdbc3</version> + <version>8.4-702.jdbc3</version> </dependency> <dependency> @@ -171,6 +171,8 @@ <groupId>org.slf4j</groupId> <artifactId>slf4j-jdk14</artifactId> </exclusion> + + </exclusions> </dependency> <dependency> @@ -186,6 +188,10 @@ <groupId>org.slf4j</groupId> <artifactId>slf4j-jdk14</artifactId> </exclusion> + <exclusion> + <groupId>org.apache.geronimo.specs</groupId> + <artifactId>geronimo-servlet_2.5_spec</artifactId> + </exclusion> </exclusions> </dependency> <dependency> Modified: trunk/treebase-web/pom.xml =================================================================== --- trunk/treebase-web/pom.xml 2012-06-11 18:10:38 UTC (rev 1094) +++ trunk/treebase-web/pom.xml 2012-06-15 15:19:11 UTC (rev 1095) @@ -115,12 +115,6 @@ <dependency> <groupId>javax.servlet</groupId> - <artifactId>servlet-api</artifactId> - <version>2.4</version> - </dependency> - - <dependency> - <groupId>javax.servlet</groupId> <artifactId>jstl</artifactId> <version>1.1.2</version> </dependency> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |