]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-411: Created stubbed Vocabulary service module and corresponding build pom...
authorRichard Millet <richard.millet@berkeley.edu>
Tue, 8 Sep 2009 21:53:36 +0000 (21:53 +0000)
committerRichard Millet <richard.millet@berkeley.edu>
Tue, 8 Sep 2009 21:53:36 +0000 (21:53 +0000)
16 files changed:
services/common/src/main/java/org/collectionspace/services/common/vocabulary/IVocabManager.java [new file with mode: 0644]
services/common/src/main/java/org/collectionspace/services/common/vocabulary/VocabManager.java [new file with mode: 0644]
services/common/src/main/java/org/collectionspace/services/common/vocabulary/VocabManagerImpl.java [new file with mode: 0644]
services/pom.xml
services/query/.project
services/vocabulary/.classpath [new file with mode: 0644]
services/vocabulary/.project [new file with mode: 0644]
services/vocabulary/.settings/org.eclipse.jdt.core.prefs [new file with mode: 0644]
services/vocabulary/.settings/org.maven.ide.eclipse.prefs [new file with mode: 0644]
services/vocabulary/pom.xml [new file with mode: 0644]
services/vocabulary/service/.classpath [new file with mode: 0644]
services/vocabulary/service/.project [new file with mode: 0644]
services/vocabulary/service/.settings/org.eclipse.jdt.core.prefs [new file with mode: 0644]
services/vocabulary/service/.settings/org.maven.ide.eclipse.prefs [new file with mode: 0644]
services/vocabulary/service/pom.xml [new file with mode: 0644]
services/vocabulary/service/src/main/java/org/collectionspace/services/vocabulary/VocabResource.java [new file with mode: 0644]

diff --git a/services/common/src/main/java/org/collectionspace/services/common/vocabulary/IVocabManager.java b/services/common/src/main/java/org/collectionspace/services/common/vocabulary/IVocabManager.java
new file mode 100644 (file)
index 0000000..c39206b
--- /dev/null
@@ -0,0 +1,7 @@
+package org.collectionspace.services.common.vocabulary;\r
+\r
+public interface IVocabManager {\r
+       \r
+       public void exampleMethod(String someParam);\r
+\r
+}\r
diff --git a/services/common/src/main/java/org/collectionspace/services/common/vocabulary/VocabManager.java b/services/common/src/main/java/org/collectionspace/services/common/vocabulary/VocabManager.java
new file mode 100644 (file)
index 0000000..8495990
--- /dev/null
@@ -0,0 +1,9 @@
+package org.collectionspace.services.common.vocabulary;\r
+\r
+public class VocabManager {\r
+       static private final IVocabManager vocabManager = new VocabManagerImpl();\r
+       \r
+       static public void exampleMethod(String someParam) {\r
+               vocabManager.exampleMethod(someParam);\r
+       }\r
+}\r
diff --git a/services/common/src/main/java/org/collectionspace/services/common/vocabulary/VocabManagerImpl.java b/services/common/src/main/java/org/collectionspace/services/common/vocabulary/VocabManagerImpl.java
new file mode 100644 (file)
index 0000000..3323f07
--- /dev/null
@@ -0,0 +1,22 @@
+package org.collectionspace.services.common.vocabulary;\r
+\r
+import org.slf4j.Logger;\r
+import org.slf4j.LoggerFactory;\r
+\r
+import org.nuxeo.ecm.core.api.DocumentModel;\r
+import org.nuxeo.ecm.core.api.DocumentModelList;\r
+import org.nuxeo.ecm.core.api.repository.RepositoryInstance;\r
+import org.nuxeo.ecm.core.client.NuxeoClient;\r
+\r
+import org.collectionspace.services.nuxeo.client.java.NuxeoConnector;\r
+import org.collectionspace.services.nuxeo.client.java.RepositoryJavaClient;\r
+import org.collectionspace.services.common.query.IQueryManager;\r
+\r
+public class VocabManagerImpl implements IVocabManager {\r
+       \r
+       private final Logger logger = LoggerFactory\r
+                       .getLogger(RepositoryJavaClient.class);\r
+       \r
+       public void exampleMethod(String someParam) {\r
+       }\r
+}\r
index 1286b5faeca0fbd157656049c85c689118f6bcd1..a8de573f6854a9ee1bb55dbfcfb23b505cefdbdc 100644 (file)
@@ -20,6 +20,7 @@
         <module>authentication</module>\r
         <module>relation</module>\r
         <module>query</module>\r
+        <module>vocabulary</module>\r
         <module>id</module>\r
         <module>collectionobject</module>\r
         <module>intake</module>\r
index 0d231bad3489a60f359aa34fde2e6efe702ae975..a39a88e4f5741455eff1f5ee620fb22c43384c4c 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>\r
 <projectDescription>\r
-       <name>org.collectionspace.services.collectionobject</name>\r
+       <name>org.collectionspace.services.query</name>\r
        <comment></comment>\r
        <projects>\r
        </projects>\r
diff --git a/services/vocabulary/.classpath b/services/vocabulary/.classpath
new file mode 100644 (file)
index 0000000..0469885
--- /dev/null
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<classpath>\r
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
+       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
+       <classpathentry kind="output" path="target/classes"/>\r
+</classpath>\r
diff --git a/services/vocabulary/.project b/services/vocabulary/.project
new file mode 100644 (file)
index 0000000..3832c86
--- /dev/null
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<projectDescription>\r
+       <name>org.collectionspace.services.vocabulary</name>\r
+       <comment></comment>\r
+       <projects>\r
+       </projects>\r
+       <buildSpec>\r
+               <buildCommand>\r
+                       <name>org.eclipse.jdt.core.javabuilder</name>\r
+                       <arguments>\r
+                       </arguments>\r
+               </buildCommand>\r
+               <buildCommand>\r
+                       <name>org.maven.ide.eclipse.maven2Builder</name>\r
+                       <arguments>\r
+                       </arguments>\r
+               </buildCommand>\r
+       </buildSpec>\r
+       <natures>\r
+               <nature>org.eclipse.jdt.core.javanature</nature>\r
+               <nature>org.maven.ide.eclipse.maven2Nature</nature>\r
+       </natures>\r
+</projectDescription>\r
diff --git a/services/vocabulary/.settings/org.eclipse.jdt.core.prefs b/services/vocabulary/.settings/org.eclipse.jdt.core.prefs
new file mode 100644 (file)
index 0000000..b634d9c
--- /dev/null
@@ -0,0 +1,5 @@
+#Thu Apr 30 16:21:29 PDT 2009\r
+eclipse.preferences.version=1\r
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6\r
+org.eclipse.jdt.core.compiler.compliance=1.6\r
+org.eclipse.jdt.core.compiler.source=1.6\r
diff --git a/services/vocabulary/.settings/org.maven.ide.eclipse.prefs b/services/vocabulary/.settings/org.maven.ide.eclipse.prefs
new file mode 100644 (file)
index 0000000..86c513b
--- /dev/null
@@ -0,0 +1,8 @@
+#Thu Jul 16 13:50:16 PDT 2009\r
+activeProfiles=\r
+eclipse.preferences.version=1\r
+fullBuildGoals=process-test-resources\r
+includeModules=false\r
+resolveWorkspaceProjects=true\r
+resourceFilterGoals=process-resources resources\:testResources\r
+version=1\r
diff --git a/services/vocabulary/pom.xml b/services/vocabulary/pom.xml
new file mode 100644 (file)
index 0000000..316d79b
--- /dev/null
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<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">\r
+    <parent>\r
+        <artifactId>org.collectionspace.services.main</artifactId>\r
+        <groupId>org.collectionspace.services</groupId>\r
+        <version>1.0</version>\r
+    </parent>\r
+    <modelVersion>4.0.0</modelVersion>\r
+    <groupId>org.collectionspace.services</groupId>\r
+    <version>1.0</version>\r
+    <artifactId>org.collectionspace.services.vocabulary</artifactId>\r
+    <packaging>pom</packaging>\r
+    <name>services.vocabulary</name>\r
+\r
+    <modules>\r
+        <module>service</module>\r
+    </modules>\r
+\r
+    <build>\r
+        <pluginManagement>\r
+            <plugins>\r
+                <plugin>\r
+                    <groupId>org.apache.maven.plugins</groupId>\r
+                    <artifactId>maven-compiler-plugin</artifactId>\r
+                    <configuration>\r
+                        <source>1.5</source>\r
+                        <target>1.5</target>\r
+                    </configuration>\r
+                </plugin>\r
+                <plugin>\r
+                    <groupId>org.apache.maven.plugins</groupId>\r
+                    <artifactId>maven-site-plugin</artifactId>\r
+                    <configuration>\r
+                        <unzipCommand>/usr/bin/unzip -o &gt; err.txt</unzipCommand>\r
+                    </configuration>\r
+                </plugin>\r
+                <plugin>\r
+                    <groupId>org.apache.maven.plugins</groupId>\r
+                    <artifactId>maven-war-plugin</artifactId>\r
+                    <version>2.0.1</version>\r
+                    <configuration>\r
+                        <warSourceExcludes>WEB-INF/lib/*.jar</warSourceExcludes>\r
+                        <archive>\r
+                            <manifest>\r
+                                <addClasspath>true</addClasspath>\r
+                            </manifest>\r
+                        </archive>\r
+                    </configuration>\r
+                </plugin>\r
+            </plugins>\r
+        </pluginManagement>\r
+        <plugins>\r
+            <plugin>\r
+                <groupId>org.apache.maven.plugins</groupId>\r
+                <artifactId>maven-compiler-plugin</artifactId>\r
+                <version>2.0.2</version>\r
+                <configuration>\r
+                    <source>1.6</source>\r
+                    <target>1.6</target>\r
+                </configuration>\r
+            </plugin>\r
+        </plugins>\r
+    </build>\r
+</project>\r
+\r
diff --git a/services/vocabulary/service/.classpath b/services/vocabulary/service/.classpath
new file mode 100644 (file)
index 0000000..199bbbb
--- /dev/null
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<classpath>\r
+       <classpathentry kind="src" output="target/classes" path="src/main/java"/>\r
+       <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>\r
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
+       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
+       <classpathentry kind="output" path="target/classes"/>\r
+</classpath>\r
diff --git a/services/vocabulary/service/.project b/services/vocabulary/service/.project
new file mode 100644 (file)
index 0000000..11fb6e8
--- /dev/null
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<projectDescription>\r
+       <name>org.collectionspace.services.query.service</name>\r
+       <comment></comment>\r
+       <projects>\r
+       </projects>\r
+       <buildSpec>\r
+               <buildCommand>\r
+                       <name>org.eclipse.jdt.core.javabuilder</name>\r
+                       <arguments>\r
+                       </arguments>\r
+               </buildCommand>\r
+               <buildCommand>\r
+                       <name>org.maven.ide.eclipse.maven2Builder</name>\r
+                       <arguments>\r
+                       </arguments>\r
+               </buildCommand>\r
+       </buildSpec>\r
+       <natures>\r
+               <nature>org.eclipse.jdt.core.javanature</nature>\r
+               <nature>org.maven.ide.eclipse.maven2Nature</nature>\r
+       </natures>\r
+</projectDescription>\r
diff --git a/services/vocabulary/service/.settings/org.eclipse.jdt.core.prefs b/services/vocabulary/service/.settings/org.eclipse.jdt.core.prefs
new file mode 100644 (file)
index 0000000..02987e7
--- /dev/null
@@ -0,0 +1,12 @@
+#Thu Jul 30 17:13:26 PDT 2009\r
+eclipse.preferences.version=1\r
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled\r
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6\r
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve\r
+org.eclipse.jdt.core.compiler.compliance=1.6\r
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate\r
+org.eclipse.jdt.core.compiler.debug.localVariable=generate\r
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate\r
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error\r
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error\r
+org.eclipse.jdt.core.compiler.source=1.6\r
diff --git a/services/vocabulary/service/.settings/org.maven.ide.eclipse.prefs b/services/vocabulary/service/.settings/org.maven.ide.eclipse.prefs
new file mode 100644 (file)
index 0000000..0f12a7e
--- /dev/null
@@ -0,0 +1,8 @@
+#Mon Jun 29 14:27:15 PDT 2009\r
+activeProfiles=\r
+eclipse.preferences.version=1\r
+fullBuildGoals=process-test-resources\r
+includeModules=false\r
+resolveWorkspaceProjects=true\r
+resourceFilterGoals=process-resources resources\:testResources\r
+version=1\r
diff --git a/services/vocabulary/service/pom.xml b/services/vocabulary/service/pom.xml
new file mode 100644 (file)
index 0000000..de80035
--- /dev/null
@@ -0,0 +1,149 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<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">\r
+\r
+    <parent>\r
+        <artifactId>org.collectionspace.services.vocabulary</artifactId>\r
+        <groupId>org.collectionspace.services</groupId>\r
+        <version>1.0</version>\r
+    </parent>\r
+    \r
+    <modelVersion>4.0.0</modelVersion>\r
+    <groupId>org.collectionspace.services</groupId>\r
+    <artifactId>org.collectionspace.services.vocabulary.service</artifactId>\r
+    <packaging>jar</packaging>\r
+    <version>1.0</version>\r
+    <name>services.vocabulary.service</name>\r
+\r
+    <dependencies>\r
+        <dependency>\r
+            <groupId>org.collectionspace.services</groupId>\r
+            <artifactId>org.collectionspace.services.common</artifactId>\r
+            <version>1.0</version>\r
+        </dependency>\r
+        <dependency>\r
+            <groupId>org.slf4j</groupId>\r
+            <artifactId>slf4j-api</artifactId>\r
+        </dependency>\r
+        <dependency>\r
+            <groupId>org.slf4j</groupId>\r
+            <artifactId>slf4j-log4j12</artifactId>\r
+        </dependency>\r
+        <dependency>\r
+            <groupId>junit</groupId>\r
+            <artifactId>junit</artifactId>\r
+            <version>4.1</version>\r
+            <scope>test</scope>\r
+        </dependency>\r
+        <dependency>\r
+            <groupId>org.testng</groupId>\r
+            <artifactId>testng</artifactId>\r
+            <version>5.6</version>\r
+        </dependency>\r
+        \r
+        <!-- apache -->\r
+        <dependency>\r
+            <groupId>commons-beanutils</groupId>\r
+            <artifactId>commons-beanutils</artifactId>\r
+            <version>1.6.1</version>\r
+        </dependency>\r
+        <!-- use explict 1.1 version to prevent errors coming from Nuxeo client -->\r
+        <dependency>\r
+            <groupId>commons-logging</groupId>\r
+            <artifactId>commons-logging</artifactId>\r
+            <version>1.1</version>\r
+        </dependency>\r
+      <!-- javax -->\r
+\r
+\r
+        <dependency>\r
+            <groupId>javax.security</groupId>\r
+            <artifactId>jaas</artifactId>\r
+            <version>1.0.01</version>\r
+            <scope>provided</scope>\r
+        </dependency>\r
+\r
+        <dependency>\r
+            <groupId>dom4j</groupId>\r
+            <artifactId>dom4j</artifactId>\r
+            <version>1.6.1</version>\r
+            <scope>provided</scope>\r
+        </dependency>\r
+        \r
+        <!-- jboss -->\r
+\r
+        <dependency>\r
+            <groupId>org.jboss.resteasy</groupId>\r
+            <artifactId>resteasy-jaxrs</artifactId>\r
+            <version>1.0.2.GA</version>\r
+            <exclusions>\r
+                <exclusion>\r
+                    <groupId>tjws</groupId>\r
+                    <artifactId>webserver</artifactId>\r
+                </exclusion>\r
+            </exclusions>\r
+        </dependency>\r
+        <dependency>\r
+            <groupId>org.jboss.resteasy</groupId>\r
+            <artifactId>resteasy-jaxb-provider</artifactId>\r
+            <version>1.0.2.GA</version>\r
+        </dependency>\r
+        <dependency>\r
+            <groupId>org.jboss.resteasy</groupId>\r
+            <artifactId>resteasy-multipart-provider</artifactId>\r
+            <version>1.0.2.GA</version>\r
+        </dependency>\r
+        \r
+        <!-- nuxeo -->\r
+\r
+        <dependency>\r
+            <groupId>org.nuxeo.ecm.core</groupId>\r
+            <artifactId>nuxeo-core-api</artifactId>\r
+            <version>${nuxeo.version.1.5}</version>\r
+            <exclusions>\r
+                <exclusion>\r
+                    <artifactId>jboss-remoting</artifactId>\r
+                    <groupId>jboss</groupId>\r
+                </exclusion>\r
+            </exclusions>\r
+        </dependency>\r
+\r
+        <dependency>\r
+            <groupId>org.restlet</groupId>\r
+            <artifactId>org.restlet</artifactId>\r
+            <version>1.0.7</version>\r
+        </dependency>\r
+        <dependency>\r
+            <groupId>com.noelios.restlet</groupId>\r
+            <artifactId>com.noelios.restlet.ext.httpclient</artifactId>\r
+            <version>1.0.7</version>\r
+        </dependency>\r
+        <dependency>\r
+            <groupId>com.noelios.restlet</groupId>\r
+            <artifactId>com.noelios.restlet</artifactId>\r
+            <version>1.0.7</version>\r
+        </dependency>\r
+\r
+    </dependencies>\r
+    \r
+    <build>\r
+        <finalName>collectionspace-services-vocabulary</finalName>\r
+        <plugins>\r
+            <plugin>\r
+                <groupId>org.codehaus.mojo</groupId>\r
+                <artifactId>jboss-maven-plugin</artifactId>\r
+                <configuration>\r
+                    <jbossHome>${jboss.dir}</jbossHome>\r
+                </configuration>\r
+            </plugin>\r
+            <plugin>\r
+                <groupId>org.apache.maven.plugins</groupId>\r
+                <artifactId>maven-compiler-plugin</artifactId>\r
+                <configuration>\r
+                    <source>1.6</source>\r
+                    <target>1.6</target>\r
+                </configuration>\r
+            </plugin>\r
+        </plugins>\r
+    </build>\r
+</project>\r
+\r
diff --git a/services/vocabulary/service/src/main/java/org/collectionspace/services/vocabulary/VocabResource.java b/services/vocabulary/service/src/main/java/org/collectionspace/services/vocabulary/VocabResource.java
new file mode 100644 (file)
index 0000000..f8c8a02
--- /dev/null
@@ -0,0 +1,100 @@
+/**\r
+ *  This document is a part of the source code and related artifacts\r
+ *  for CollectionSpace, an open source collections management system\r
+ *  for museums and related institutions:\r
+\r
+ *  http://www.collectionspace.org\r
+ *  http://wiki.collectionspace.org\r
+\r
+ *  Copyright 2009 University of California at Berkeley\r
+\r
+ *  Licensed under the Educational Community License (ECL), Version 2.0.\r
+ *  You may not use this file except in compliance with this License.\r
+\r
+ *  You may obtain a copy of the ECL 2.0 License at\r
+\r
+ *  https://source.collectionspace.org/collection-space/LICENSE.txt\r
+\r
+ *  Unless required by applicable law or agreed to in writing, software\r
+ *  distributed under the License is distributed on an "AS IS" BASIS,\r
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ *  See the License for the specific language governing permissions and\r
+ *  limitations under the License.\r
+ */\r
+package org.collectionspace.services.vocabulary;\r
+\r
+import javax.ws.rs.Consumes;\r
+import javax.ws.rs.GET;\r
+import javax.ws.rs.Path;\r
+import javax.ws.rs.Produces;\r
+import javax.ws.rs.DELETE;\r
+import javax.ws.rs.POST;\r
+import javax.ws.rs.PUT;\r
+import javax.ws.rs.PathParam;\r
+import javax.ws.rs.WebApplicationException;\r
+import javax.ws.rs.core.Context;\r
+import javax.ws.rs.core.Response;\r
+import javax.ws.rs.core.UriBuilder;\r
+import javax.ws.rs.core.UriInfo;\r
+import javax.xml.bind.JAXBContext;\r
+import javax.xml.bind.Marshaller;\r
+\r
+import org.collectionspace.services.common.vocabulary.VocabManager;\r
+import org.slf4j.Logger;\r
+import org.slf4j.LoggerFactory;\r
+\r
+@Path("/vocab")\r
+@Consumes("application/xml")\r
+@Produces("application/xml")\r
+public class VocabResource {\r
+\r
+    public final static String SERVICE_NAME = "vocab";\r
+    final Logger logger = LoggerFactory.getLogger(VocabResource.class);\r
+\r
+    public VocabResource() {\r
+        // do nothing\r
+    }\r
+\r
+    @GET\r
+    @Path("{csid}")\r
+    public void getVocab(\r
+            @PathParam("csid") String csid) {\r
+        if(logger.isDebugEnabled()){\r
+            verbose("getVocab with csid=" + csid);\r
+        }\r
+        if(csid == null || "".equals(csid)){\r
+            logger.error("getVocab: missing csid!");\r
+            Response response = Response.status(Response.Status.BAD_REQUEST).entity(\r
+                    "get failed on getVocab csid=" + csid).type(\r
+                    "text/plain").build();\r
+            throw new WebApplicationException(response);\r
+        }\r
+\r
+        try {\r
+               //\r
+               // An example call to the Vocabulary manager\r
+               //\r
+               VocabManager.exampleMethod("someParam");\r
+        } catch(Exception e){\r
+            if(logger.isDebugEnabled()){\r
+                logger.debug("getVocab", e);\r
+            }\r
+            Response response = Response.status(Response.Status.NOT_FOUND).entity(\r
+                    "Get failed on vocab csid=" + csid).type(\r
+                    "text/plain").build();\r
+            throw new WebApplicationException(response);\r
+        }\r
+\r
+        // an example of how to send a failed message\r
+        if(false){\r
+            Response response = Response.status(Response.Status.NOT_FOUND).entity(\r
+                    "Get failed, the requested CSID:" + csid + ": was not found.").type(\r
+                    "text/plain").build();\r
+            throw new WebApplicationException(response);\r
+        }\r
+    }\r
+\r
+    private void verbose(String msg) {\r
+        System.out.println("VocabResource. " + msg);\r
+    }\r
+}\r