--- /dev/null
+<?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="src" output="target/test-classes" path="src/test/java"/>\r
+ <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>\r
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>\r
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
+ <classpathentry kind="output" path="target/classes"/>\r
+</classpath>\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>javaee-addressbook-client</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>
--- /dev/null
+#Thu Feb 26 16:32:51 PST 2009\r
+eclipse.preferences.version=1\r
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5\r
+org.eclipse.jdt.core.compiler.compliance=1.5\r
+org.eclipse.jdt.core.compiler.source=1.5\r
--- /dev/null
+#Thu Feb 26 16:30:28 PST 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
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<project-shared-configuration>\r
+ <!--
+This file contains additional configuration written by modules in the NetBeans IDE.
+The configuration is intended to be shared among all the users of project and
+therefore it is assumed to be part of version control checkout.
+Without this configuration present, some functionality in the IDE may be limited or fail altogether.
+-->\r
+ <properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">\r
+ <!--
+Properties that influence various parts of the IDE, especially code formatting and the like.
+You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
+That way multiple projects can share the same settings (useful for formatting rules for example).
+Any value defined here will override the pom.xml file value but is only applicable to the current project.
+-->\r
+ <org-netbeans-modules-editor-indent.CodeStyle.usedProfile>default</org-netbeans-modules-editor-indent.CodeStyle.usedProfile>\r
+ <org-netbeans-modules-editor-indent.CodeStyle.project.tab-size>8</org-netbeans-modules-editor-indent.CodeStyle.project.tab-size>\r
+ <org-netbeans-modules-editor-indent.CodeStyle.project.text-limit-width>80</org-netbeans-modules-editor-indent.CodeStyle.project.text-limit-width>\r
+ </properties>\r
+</project-shared-configuration>\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<actions>\r
+ <action>\r
+ <actionName>rebuild</actionName>\r
+ <packagings>\r
+ <packaging>*</packaging>\r
+ </packagings>\r
+ <goals>\r
+ <goal>clean</goal>\r
+ <goal>install</goal>\r
+ </goals>\r
+ <properties>\r
+ <maven.test.skip>true</maven.test.skip>\r
+ </properties>\r
+ </action>\r
+ </actions>\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<project>\r
+ <parent>\r
+ <artifactId>helloworld</artifactId>\r
+ <groupId>org.collectionspace.hello.services</groupId>\r
+ <version>0.1</version>\r
+ </parent>\r
+ <modelVersion>4.0.0</modelVersion>\r
+ <groupId>org.collectionspace.services.hello</groupId>\r
+ <artifactId>helloworld-client</artifactId>\r
+ <packaging>jar</packaging>\r
+ <version>0.1</version>\r
+ <name>Helloworld Client</name>\r
+ <dependencies>\r
+ <dependency>\r
+ <groupId>org.collectionspace.services.hello</groupId>\r
+ <artifactId>helloworld-jaxb</artifactId>\r
+ <version>0.1</version>\r
+ </dependency>\r
+ <dependency>\r
+ <groupId>org.testng</groupId>\r
+ <artifactId>testng</artifactId>\r
+ <version>5.6</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>org.jboss.resteasy</groupId>\r
+ <artifactId>resteasy-jaxrs</artifactId>\r
+ <version>1.0.2.GA</version>\r
+ <!-- filter out unwanted jars -->\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>commons-httpclient</groupId>\r
+ <artifactId>commons-httpclient</artifactId>\r
+ </dependency>\r
+ </dependencies>\r
+ <build>\r
+ <plugins>\r
+ <plugin>\r
+ <artifactId>maven-compiler-plugin</artifactId>\r
+ <version>2.0.2</version>\r
+ <configuration>\r
+ <source>1.5</source>\r
+ <target>1.5</target>\r
+ </configuration>\r
+ </plugin>\r
+ </plugins>\r
+ </build>\r
+</project>\r
--- /dev/null
+
+package org.collectionspace.hello.client;
+
+import javax.ws.rs.core.Response;
+
+import org.jboss.resteasy.client.ProxyFactory;
+import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
+import org.jboss.resteasy.client.ClientResponse;
+import org.jboss.resteasy.spi.ResteasyProviderFactory;
+
+/**
+ * A PersonClient.
+
+ * @version $Revision:$
+ */
+public class PersonClient
+{
+
+ /**
+ *
+ */
+ private static final PersonClient instance = new PersonClient();
+
+ /**
+ *
+ */
+ private PersonProxy personProxy;
+
+ /**
+ *
+ * Create a new PersonClient.
+ *
+ */
+ private PersonClient()
+ {
+ ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
+ RegisterBuiltin.register(factory);
+ personProxy = ProxyFactory.create(PersonProxy.class, "http://localhost:8080/helloworld/cspace");
+ }
+
+ /**
+ * FIXME Comment this
+ *
+ * @return
+ */
+ public static PersonClient getInstance()
+ {
+ return instance;
+ }
+
+
+
+ /**
+ * @param id
+ * @return
+ * @see org.collectionspace.hello.client.PersonProxy#getPerson(java.lang.Long)
+ */
+ public ClientResponse<Person> getPerson(Long id)
+ {
+ return personProxy.getPerson(id);
+ }
+
+ /**
+ * @param person
+ * @return
+ * @see org.collectionspace.hello.client.PersonProxy#createPerson(org.collectionspace.hello.client.entity.Person)
+ */
+ public ClientResponse<Response> createPerson(Person person)
+ {
+ return personProxy.createPerson(person);
+ }
+
+
+ /**
+ * @param id
+ * @param person
+ * @return
+ * @see org.collectionspace.hello.client.PersonProxy#updatePerson(java.lang.Long, org.collectionspace.hello.client.entity.Person)
+ */
+ public ClientResponse<Person> updatePerson(Long id, Person person)
+ {
+ return personProxy.updatePerson(id, person);
+ }
+
+
+}
--- /dev/null
+package org.collectionspace.hello.client;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Response;
+
+import org.jboss.resteasy.client.ClientResponse;
+
+/**
+ * @version $Revision:$
+ */
+@Path("/persons/")
+@Produces({"application/xml"})
+@Consumes({"application/xml"})
+public interface PersonProxy {
+
+ /**
+ *
+ *
+ * @param id
+ * @return
+ */
+ @GET
+ @Path("/{id}")
+ ClientResponse<Person> getPerson(@PathParam("id") Long id);
+
+ @POST
+ ClientResponse<Response> createPerson(Person so);
+
+ @PUT
+ @Path("/{id}")
+ ClientResponse<Person> updatePerson(@PathParam("id") Long id, Person so);
+}
\ No newline at end of file
--- /dev/null
+package org.collectionspace.hello.client;
+
+import java.util.ArrayList;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.core.Response;
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.Marshaller;
+import javax.xml.namespace.QName;
+import org.collectionspace.hello.client.*;
+import org.jboss.resteasy.client.ClientResponse;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/**
+ * A PersonServiceTest.
+ *
+ * @version $Revision:$
+ */
+public class PersonServiceTest {
+
+ private PersonClient personClient = PersonClient.getInstance();
+ private Long id = 0L;
+
+ @Test
+ public void createPerson() {
+ Person person = new Person();
+ person.setFirstName("Chris");
+ person.setLastName("Hoffman");
+ person.setStreet("2195 Hearst Ave.");
+ person.setCity("Berkeley");
+ person.setState("CA");
+ person.setZip("94704");
+ person.setCountry("US");
+ ClientResponse<Response> res = personClient.createPerson(person);
+ Assert.assertEquals(res.getStatus(), Response.Status.CREATED.getStatusCode());
+ id = extractId(res);
+ }
+
+ @Test(dependsOnMethods = {"createPerson"})
+ public void updatePerson() {
+ Person me = personClient.getPerson(id).getEntity();
+ verbose("received with get", me);
+ me.setFirstName("Richard");
+ me.setLastName("Millet");
+ int initialVersion = me.getVersion();
+ Person updated = personClient.updatePerson(id, me).getEntity();
+ verbose("updated", updated);
+ Assert.assertNotSame(updated.getVersion(), initialVersion);
+ Assert.assertEquals(updated.getFirstName(), "Richard");
+ }
+
+ private Long extractId(ClientResponse<Response> res) {
+ MultivaluedMap mvm = res.getMetadata();
+ String uri = (String) ((ArrayList) mvm.get("Location")).get(0);
+ String[] segments = uri.split("/");
+ System.out.println("id=" + segments[segments.length - 1]);
+ return Long.valueOf(segments[segments.length - 1]);
+ }
+
+ private void verbose(String msg, Person p) {
+ try {
+ System.out.println(msg);
+ JAXBContext jc = JAXBContext.newInstance(Person.class);
+ Marshaller m = jc.createMarshaller();
+ m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,
+ Boolean.TRUE);
+ m.marshal(new JAXBElement(new QName("uri", "local"), Person.class, p), System.out);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+
+ <appender name="console" class="org.apache.log4j.ConsoleAppender">
+ <param name="Target" value="System.out" />
+ <layout class="org.apache.log4j.TTCCLayout">
+ <param name="DateFormat" value="ISO8601" />
+ </layout>
+ </appender>
+
+
+ <appender name="unit-tests"
+ class="org.apache.log4j.RollingFileAppender">
+ <param name="File" value="./target/unit-tests.log" />
+ <param name="MaxFileSize" value="10240KB" />
+ <param name="MaxBackupIndex" value="6" />
+ <layout class="org.apache.log4j.TTCCLayout">
+ <param name="DateFormat" value="ISO8601" />
+ </layout>
+ </appender>
+
+ <logger name="org.apache.commons.httpclient" additivity="false">
+ <level value="warn" />
+ <appender-ref ref="console" />
+ <appender-ref ref="unit-tests" />
+ </logger>
+
+ <logger name="httpclient.wire" additivity="false">
+ <level value="info" />
+ <appender-ref ref="console" />
+ <appender-ref ref="unit-tests" />
+ </logger>
+
+ <root>
+ <priority value="debug" />
+ <appender-ref ref="console" />
+ <appender-ref ref="unit-tests" />
+ </root>
+
+</log4j:configuration>
+
+
+
+
--- /dev/null
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite name="javaee-addressbook-client">
+ <test verbose="2" name="org.jboss.resteasy.examples.addressbook.client.AddressBookTest" annotations="JDK">
+ <classes>
+ <class name="org.jboss.resteasy.examples.addressbook.client.AddressBookTest"/>
+ </classes>
+ </test>
+</suite>
--- /dev/null
+<?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="src" output="target/test-classes" path="src/test/java"/>\r
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>\r
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
+ <classpathentry kind="output" path="target/classes"/>\r
+</classpath>\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>javaee-addressbook-jaxb</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>
--- /dev/null
+#Thu Feb 26 16:32:52 PST 2009\r
+eclipse.preferences.version=1\r
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5\r
+org.eclipse.jdt.core.compiler.compliance=1.5\r
+org.eclipse.jdt.core.compiler.source=1.5\r
--- /dev/null
+#Thu Feb 26 16:30:28 PST 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
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<project-shared-configuration>\r
+ <!--
+This file contains additional configuration written by modules in the NetBeans IDE.
+The configuration is intended to be shared among all the users of project and
+therefore it is assumed to be part of version control checkout.
+Without this configuration present, some functionality in the IDE may be limited or fail altogether.
+-->\r
+ <properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">\r
+ <!--
+Properties that influence various parts of the IDE, especially code formatting and the like.
+You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
+That way multiple projects can share the same settings (useful for formatting rules for example).
+Any value defined here will override the pom.xml file value but is only applicable to the current project.
+-->\r
+ <org-netbeans-modules-editor-indent.CodeStyle.usedProfile>default</org-netbeans-modules-editor-indent.CodeStyle.usedProfile>\r
+ <org-netbeans-modules-editor-indent.CodeStyle.project.tab-size>8</org-netbeans-modules-editor-indent.CodeStyle.project.tab-size>\r
+ <org-netbeans-modules-editor-indent.CodeStyle.project.text-limit-width>80</org-netbeans-modules-editor-indent.CodeStyle.project.text-limit-width>\r
+ </properties>\r
+</project-shared-configuration>\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+ <parent>
+ <artifactId>helloworld</artifactId>
+ <groupId>org.collectionspace.hello.services</groupId>
+ <version>0.1</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.collectionspace.services.hello</groupId>
+ <artifactId>helloworld-jaxb</artifactId>
+ <name>Helloworld Client JAXB</name>
+ <version>0.1</version>
+ <dependencies>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ <version>2.0.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jvnet.jaxb2-commons</groupId>
+ <artifactId>property-listener-injector</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jvnet.jaxb2_commons</groupId>
+ <artifactId>runtime</artifactId>
+ <version>0.4.1.4</version>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jvnet.jaxb2.maven2</groupId>
+ <artifactId>maven-jaxb2-plugin</artifactId>
+ <dependencies>
+ <!-- javax.activation.DataSource provider is required by spec -->
+ <dependency>
+ <groupId>javax.activation</groupId>
+ <artifactId>activation</artifactId>
+ <version>1.1</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ <version>2.1.2</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.0.2</version>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<xs:schema version="1.0"
+ xmlns:re="http://www.collectionspace.org/services/hello"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema">
+
+ <xs:element name="person" type="person" />
+
+ <xs:complexType name="person">
+
+ <xs:sequence>
+ <xs:element name="firstName" type="xs:string"
+ minOccurs="1" />
+ <xs:element name="lastName" type="xs:string"
+ minOccurs="1" />
+ <xs:element name="street" type="xs:string"
+ minOccurs="1" />
+ <xs:element name="city" type="xs:string"
+ minOccurs="1" />
+ <xs:element name="state" type="xs:string"
+ minOccurs="1" />
+ <xs:element name="zip" type="xs:string"
+ minOccurs="1" />
+ <xs:element name="country" type="xs:string"
+ minOccurs="1" />
+ </xs:sequence>
+ <xs:attribute name="id" type="xs:long" />
+ <xs:attribute name="version" type="xs:int" />
+
+ </xs:complexType>
+
+</xs:schema>
+
--- /dev/null
+
+This project is a simple example showing usage of @Path, @GET, PUT, POST, and @PathParam. It uses pure streaming
+output as well.
+
+System Requirements:
+====================
+- Maven 2.0.9 or higher
+
+Building the project:
+====================
+1. In root directoy
+
+mvn clean install
+
+This will build a WAR and run it with embedded Jetty
\ No newline at end of file
--- /dev/null
+jboss.dir=C:/dev/jboss-4.2.3.GA
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<project-shared-configuration>\r
+ <!--
+This file contains additional configuration written by modules in the NetBeans IDE.
+The configuration is intended to be shared among all the users of project and
+therefore it is assumed to be part of version control checkout.
+Without this configuration present, some functionality in the IDE may be limited or fail altogether.
+-->\r
+ <properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">\r
+ <!--
+Properties that influence various parts of the IDE, especially code formatting and the like.
+You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
+That way multiple projects can share the same settings (useful for formatting rules for example).
+Any value defined here will override the pom.xml file value but is only applicable to the current project.
+-->\r
+ <org-netbeans-modules-editor-indent.CodeStyle.usedProfile>default</org-netbeans-modules-editor-indent.CodeStyle.usedProfile>\r
+ <org-netbeans-modules-editor-indent.CodeStyle.project.tab-size>8</org-netbeans-modules-editor-indent.CodeStyle.project.tab-size>\r
+ <org-netbeans-modules-editor-indent.CodeStyle.project.text-limit-width>80</org-netbeans-modules-editor-indent.CodeStyle.project.text-limit-width>\r
+ <netbeans.hint.useExternalMaven>false</netbeans.hint.useExternalMaven>\r
+ </properties>\r
+</project-shared-configuration>\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<actions>\r
+ <action>\r
+ <actionName>test</actionName>\r
+ <packagings>\r
+ <packaging>*</packaging>\r
+ </packagings>\r
+ <goals>\r
+ <goal>test</goal>\r
+ </goals>\r
+ </action>\r
+ <action>\r
+ <actionName>build</actionName>\r
+ <packagings>\r
+ <packaging>*</packaging>\r
+ </packagings>\r
+ <goals>\r
+ <goal>install</goal>\r
+ </goals>\r
+ </action>\r
+ <action>\r
+ <actionName>clean</actionName>\r
+ <packagings>\r
+ <packaging>*</packaging>\r
+ </packagings>\r
+ <goals>\r
+ <goal>clean</goal>\r
+ </goals>\r
+ </action>\r
+ <action>\r
+ <actionName>rebuild</actionName>\r
+ <packagings>\r
+ <packaging>*</packaging>\r
+ </packagings>\r
+ <goals>\r
+ <goal>clean</goal>\r
+ <goal>install</goal>\r
+ </goals>\r
+ </action>\r
+ <action>\r
+ <actionName>run</actionName>\r
+ <packagings>\r
+ <packaging>war</packaging>\r
+ <packaging>ear</packaging>\r
+ <packaging>ejb</packaging>\r
+ </packagings>\r
+ <goals>\r
+ <goal>package</goal>\r
+ </goals>\r
+ <properties>\r
+ \r
+ <netbeans.deploy>true</netbeans.deploy>\r
+ </properties>\r
+ </action>\r
+ <action>\r
+ <actionName>debug</actionName>\r
+ <packagings>\r
+ <packaging>war</packaging>\r
+ <packaging>ear</packaging>\r
+ <packaging>ejb</packaging>\r
+ </packagings>\r
+ <goals>\r
+ <goal>package</goal>\r
+ </goals>\r
+ <properties>\r
+ \r
+ <netbeans.deploy>true</netbeans.deploy>\r
+ <netbeans.deploy.debugmode>true</netbeans.deploy.debugmode>\r
+ </properties>\r
+ </action>\r
+ </actions>\r
--- /dev/null
+<?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>helloworld</artifactId>\r
+ <groupId>org.collectionspace.hello.services</groupId>\r
+ <version>0.1</version>\r
+ </parent>\r
+ <modelVersion>4.0.0</modelVersion>\r
+ <groupId>org.collectionspace.prototype</groupId>\r
+ <artifactId>helloworld-service</artifactId>\r
+ <packaging>war</packaging>\r
+ <version>0.1</version>\r
+ <name>Helloworld Service</name>\r
+\r
+ <repositories>\r
+ <repository>\r
+ <id>java.net</id>\r
+ <url>http://download.java.net/maven/1</url>\r
+ <layout>legacy</layout>\r
+ </repository>\r
+ <repository>\r
+ <id>maven repo</id>\r
+ <name>maven repo</name>\r
+ <url>http://repo1.maven.org/maven2/</url>\r
+ </repository>\r
+ <!-- For resteasy -->\r
+ <repository>\r
+ <id>jboss</id>\r
+ <name>jboss repo</name>\r
+ <url>http://repository.jboss.org/maven2</url>\r
+ </repository>\r
+ <repository>\r
+ <id>mojo</id>\r
+ <name>mojo repo</name>\r
+ <url>http://svn.codehaus.org/mojo/trunk/mojo/jboss-maven-plugin</url>\r
+ </repository>\r
+ </repositories>\r
+\r
+ <dependencies>\r
+ <dependency>\r
+ <groupId>org.jboss.resteasy</groupId>\r
+ <artifactId>resteasy-jaxrs</artifactId>\r
+ <version>1.0.2.GA</version>\r
+ <!-- filter out unwanted jars -->\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>junit</groupId>\r
+ <artifactId>junit</artifactId>\r
+ <version>4.1</version>\r
+ <scope>test</scope>\r
+ </dependency>\r
+ </dependencies>\r
+ \r
+ <build>\r
+ <finalName>helloworld</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
+ <executions>\r
+ <execution>\r
+ <id>jboss-undeploy</id>\r
+ <phase>pre-integration-test</phase>\r
+ <goals>\r
+ <goal>undeploy</goal>\r
+ </goals>\r
+ <configuration>\r
+ <fileName>${basedir}/target/helloworld.war</fileName>\r
+ </configuration>\r
+ </execution>\r
+ <execution>\r
+ <id>jboss-deploy</id>\r
+ <phase>pre-integration-test</phase>\r
+ <goals>\r
+ <goal>deploy</goal>\r
+ </goals>\r
+ <configuration>\r
+ <fileName>${basedir}/target/helloworld.war</fileName>\r
+ </configuration>\r
+ </execution>\r
+\r
+ </executions>\r
+ </plugin>\r
+ <!--\r
+ <plugin>\r
+ <groupId>org.mortbay.jetty</groupId>\r
+ <artifactId>maven-jetty-plugin</artifactId>\r
+ <version>6.1.10</version>\r
+ <configuration>\r
+ \r
+ <contextPath>/</contextPath>\r
+ <scanIntervalSeconds>2</scanIntervalSeconds>\r
+ <stopKey>foo</stopKey>\r
+ <stopPort>9999</stopPort>\r
+ <connectors>\r
+ <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">\r
+ <port>9095</port>\r
+ <maxIdleTime>60000</maxIdleTime>\r
+ </connector>\r
+ </connectors>\r
+ </configuration>\r
+ <executions>\r
+ <execution>\r
+ <id>start-jetty</id>\r
+ <phase>pre-integration-test</phase>\r
+ <goals>\r
+ <goal>run</goal>\r
+ </goals>\r
+ <configuration>\r
+ <scanIntervalSeconds>0</scanIntervalSeconds>\r
+ <daemon>true</daemon>\r
+ </configuration>\r
+ </execution>\r
+ <execution>\r
+ <id>stop-jetty</id>\r
+ <phase>post-integration-test</phase>\r
+ <goals>\r
+ <goal>stop</goal>\r
+ </goals>\r
+ </execution>\r
+ </executions>\r
+ </plugin>\r
+ -->\r
+\r
+ <plugin>\r
+ <groupId>org.apache.maven.plugins</groupId>\r
+ <artifactId>maven-surefire-plugin</artifactId>\r
+ <configuration>\r
+ <skip>true</skip>\r
+ </configuration>\r
+ <executions>\r
+ <execution>\r
+ <id>surefire-it</id>\r
+ <phase>integration-test</phase>\r
+ <goals>\r
+ <goal>test</goal>\r
+ </goals>\r
+ <configuration>\r
+ <skip>false</skip>\r
+ </configuration>\r
+ </execution>\r
+ </executions>\r
+ </plugin>\r
+ <plugin>\r
+ <groupId>org.apache.maven.plugins</groupId>\r
+ <artifactId>maven-war-plugin</artifactId>\r
+ <version>2.0</version>\r
+ </plugin>\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
+ </plugins>\r
+ </build>\r
+</project>\r
--- /dev/null
+package org.collectionspace.hello.entity;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.bind.Unmarshaller.Listener;
+import javax.xml.bind.annotation.XmlElement;
+
+@XmlRootElement
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "person", propOrder = {
+ "firstName",
+ "lastName",
+ "street",
+ "city",
+ "state",
+ "zip",
+ "country"
+})
+public class Person extends Listener {
+
+ @XmlAttribute
+ private int id;
+ @XmlAttribute
+ private int version = 1;
+ private String firstName;
+ private String lastName;
+ private String street;
+ private String city;
+ private String state;
+ private String zip;
+ private String country;
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ /**
+ * @return the version
+ */
+ public int getVersion() {
+ return version;
+ }
+
+ /**
+ * @param version the version to set
+ */
+ public void setVersion(int version) {
+ this.version = version;
+ }
+
+ public String getFirstName() {
+ return firstName;
+ }
+
+ public void setFirstName(String firstName) {
+ this.firstName = firstName;
+ }
+
+ public String getLastName() {
+ return lastName;
+ }
+
+ public void setLastName(String lastName) {
+ this.lastName = lastName;
+ }
+
+ public String getStreet() {
+ return street;
+ }
+
+ public void setStreet(String street) {
+ this.street = street;
+ }
+
+ public String getCity() {
+ return city;
+ }
+
+ public void setCity(String city) {
+ this.city = city;
+ }
+
+ public String getState() {
+ return state;
+ }
+
+ public void setState(String state) {
+ this.state = state;
+ }
+
+ public String getZip() {
+ return zip;
+ }
+
+ public void setZip(String zip) {
+ this.zip = zip;
+ }
+
+ public String getCountry() {
+ return country;
+ }
+
+ public void setCountry(String country) {
+ this.country = country;
+ }
+
+ /**
+ * JAXB Callback method used to reassociate the item with the owning contact.
+ * JAXB doesn't seem to read this method from a super class and it must
+ * therefore be placed on any subclass.
+ *
+ * @param unmarshaller the JAXB {@link Unmarshaller}.
+ * @param parent the owning {@link Contact} instance.
+ */
+ public void afterUnmarshal(Unmarshaller unmarshaller, Object parent) {
+ super.afterUnmarshal(unmarshaller, parent);
+ }
+}
--- /dev/null
+package org.collectionspace.hello.services;
+
+import javax.ws.rs.core.Application;
+import java.util.HashSet;
+import java.util.Set;
+
+public class HelloworldApplication extends Application {
+ private Set<Object> singletons = new HashSet<Object>();
+ private Set<Class<?>> empty = new HashSet<Class<?>>();
+
+ public HelloworldApplication() {
+ singletons.add(new PersonResource());
+ }
+
+ @Override
+ public Set<Class<?>> getClasses() {
+ return empty;
+ }
+
+ @Override
+ public Set<Object> getSingletons() {
+ return singletons;
+ }
+}
--- /dev/null
+package org.collectionspace.hello.services;
+
+import org.collectionspace.hello.entity.Person;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.Response;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.atomic.AtomicInteger;
+import javax.ws.rs.core.UriBuilder;
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.Marshaller;
+
+@Path("/persons")
+@Consumes("application/xml")
+@Produces("application/xml")
+public class PersonResource {
+
+ private Map<Integer, Person> personDB = new ConcurrentHashMap<Integer, Person>();
+ private AtomicInteger idCounter = new AtomicInteger();
+
+ public PersonResource() {
+ }
+
+ @POST
+ public Response createPerson(Person p) {
+ p.setId(idCounter.incrementAndGet());
+ p.setVersion(1);
+ personDB.put(p.getId(), p);
+ verbose("create person", p);
+ UriBuilder path = UriBuilder.fromResource(PersonResource.class);
+ path.path("" + p.getId());
+ Response response = Response.created(path.build()).build();
+ return response;
+ }
+
+ @GET
+ @Path("{id}")
+ public Person getPerson(@PathParam("id") int id) {
+ Person p = personDB.get(id);
+ if (p == null) {
+ Response response = Response.status(Response.Status.NOT_FOUND).entity(
+ "The requested ID was not found.").type("text/plain").build();
+ throw new WebApplicationException(response);
+ }
+ verbose("get person", p);
+ return p;
+ }
+
+ @PUT
+ @Path("{id}")
+ public Person updatePerson(@PathParam("id") int id, Person update) {
+ Person current = personDB.get(id);
+ if (current == null) {
+ throw new WebApplicationException(Response.Status.NOT_FOUND);
+ }
+ verbose("received person", update);
+ //todo: intelligent merge needed
+ current.setFirstName(update.getFirstName());
+ current.setLastName(update.getLastName());
+ current.setStreet(update.getStreet());
+ current.setState(update.getState());
+ current.setZip(update.getZip());
+ current.setCountry(update.getCountry());
+ current.setVersion(current.getVersion() + 1);
+ verbose("updated person", current);
+ return current;
+ }
+
+ private void verbose(String msg, Person p) {
+ try {
+ System.out.println(msg);
+ JAXBContext jc = JAXBContext.newInstance(Person.class);
+ Marshaller m = jc.createMarshaller();
+ m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,
+ Boolean.TRUE);
+ m.marshal(p, System.out);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+// @POST
+// @Consumes("application/xml")
+// public Response createPerson(InputStream is) {
+// Person p = readPerson(is);
+// p.setId(idCounter.incrementAndGet());
+// p.setVersion(1);
+// personDB.put(p.getId(), p);
+// try {
+// System.out.println("Created Person " + p.getId());
+// outputPerson(System.out, p);
+// } catch (IOException ioe) {
+// throw new WebApplicationException(Response.Status.INTERNAL_SERVER_ERROR);
+// }
+// return Response.created(URI.create("/persons/" + p.getId())).build();
+//
+// }
+//
+// @GET
+// @Path("{id}")
+// @Produces("application/xml")
+// public StreamingOutput getPerson(@PathParam("id") int id) {
+// final Person p = personDB.get(id);
+// if (p == null) {
+// throw new WebApplicationException(Response.Status.NOT_FOUND);
+// }
+// return new StreamingOutput() {
+//
+// public void write(OutputStream outputStream) throws IOException, WebApplicationException {
+// outputPerson(outputStream, p);
+// }
+// };
+// }
+//
+// @PUT
+// @Path("{id}")
+// @Consumes("application/xml")
+// @Produces("application/xml")
+// public StreamingOutput updatePerson(@PathParam("id") int id, InputStream is) {
+// Person update = readPerson(is);
+// Person current = personDB.get(id);
+// if (current == null) {
+// throw new WebApplicationException(Response.Status.NOT_FOUND);
+// }
+//
+// current.setFirstName(update.getFirstName());
+// current.setLastName(update.getLastName());
+// current.setStreet(update.getStreet());
+// current.setState(update.getState());
+// current.setZip(update.getZip());
+// current.setCountry(update.getCountry());
+// current.setVersion(current.getVersion() + 1);
+// final Person scurrent = current;
+// return new StreamingOutput() {
+//
+// public void write(OutputStream outputStream) throws IOException, WebApplicationException {
+// outputPerson(outputStream, scurrent);
+// }
+// };
+// }
+//
+// protected void outputPerson(OutputStream os, Person p) throws IOException {
+// PrintStream writer = new PrintStream(os);
+// writer.println("<Person id=\"" + p.getId() + "\" version=\"" + p.getVersion() + "\">");
+// writer.println(" <first-name>" + p.getFirstName() + "</first-name>");
+// writer.println(" <last-name>" + p.getLastName() + "</last-name>");
+// writer.println(" <street>" + p.getStreet() + "</street>");
+// writer.println(" <city>" + p.getCity() + "</city>");
+// writer.println(" <state>" + p.getState() + "</state>");
+// writer.println(" <zip>" + p.getZip() + "</zip>");
+// writer.println(" <country>" + p.getCountry() + "</country>");
+// writer.println("</Person>");
+// }
+//
+// protected Person readPerson(InputStream is) {
+// try {
+// DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+// Document doc = builder.parse(is);
+// Element root = doc.getDocumentElement();
+// Person p = new Person();
+// if (root.getAttribute("id") != null && !root.getAttribute("id").trim().equals("")) {
+// p.setId(Integer.valueOf(root.getAttribute("id")));
+// }
+// if (root.getAttribute("version") != null && !root.getAttribute("version").trim().equals("")) {
+// p.setVersion(Integer.valueOf(root.getAttribute("version")));
+// }
+// NodeList nodes = root.getChildNodes();
+// for (int i = 0; i < nodes.getLength(); i++) {
+// Element element = (Element) nodes.item(i);
+// if (element.getTagName().equals("first-name")) {
+// p.setFirstName(element.getTextContent());
+// } else if (element.getTagName().equals("last-name")) {
+// p.setLastName(element.getTextContent());
+// } else if (element.getTagName().equals("street")) {
+// p.setStreet(element.getTextContent());
+// } else if (element.getTagName().equals("city")) {
+// p.setCity(element.getTextContent());
+// } else if (element.getTagName().equals("state")) {
+// p.setState(element.getTextContent());
+// } else if (element.getTagName().equals("zip")) {
+// p.setZip(element.getTextContent());
+// } else if (element.getTagName().equals("country")) {
+// p.setCountry(element.getTextContent());
+// }
+// }
+// return p;
+// } catch (Exception e) {
+// throw new WebApplicationException(e, Response.Status.BAD_REQUEST);
+// }
+// }
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">\r
+<web-app>\r
+ <display-name>Helloworld</display-name>\r
+\r
+ <context-param>\r
+ <param-name>javax.ws.rs.Application</param-name>\r
+ <param-value>org.collectionspace.hello.services.HelloworldApplication</param-value>\r
+ </context-param>\r
+\r
+ <context-param>\r
+ <param-name>resteasy.servlet.mapping.prefix</param-name>\r
+ <param-value>/cspace</param-value>\r
+ </context-param>\r
+\r
+ <listener>\r
+ <listener-class>\r
+ org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap\r
+ </listener-class>\r
+ </listener>\r
+\r
+ <servlet>\r
+ <servlet-name>Resteasy</servlet-name>\r
+ <servlet-class>\r
+ org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher\r
+ </servlet-class>\r
+ </servlet>\r
+\r
+ <servlet-mapping>\r
+ <servlet-name>Resteasy</servlet-name>\r
+ <url-pattern>/cspace/*</url-pattern>\r
+ </servlet-mapping>\r
+\r
+</web-app>\r
--- /dev/null
+package org.collectionspace.hello.test;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.apache.commons.httpclient.HttpMethodBase;
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.methods.EntityEnclosingMethod;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.net.HttpURLConnection;
+import java.net.URL;
+
+
+/**
+ * @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
+ * @version $Revision: 1 $
+ */
+public class PersonResourceTest
+{
+ @Test
+ public void testPersonResource() throws Exception
+ {
+ System.out.println("*** Create a new Person ***");
+ // Create a new object
+ String newPerson = "<person>"
+ + "<firstName>John</firstName>"
+ + "<lastName>Doe</lastName>"
+ + "<street>2195 Hearst Ave</street>"
+ + "<city>Berkeley</city>"
+ + "<state>CA</state>"
+ + "<zip>94504</zip>"
+ + "<country>USA</country>"
+ + "</person>";
+
+ URL postUrl = new URL("http://localhost:8080/helloworld/cspace/persons");
+ HttpURLConnection connection = (HttpURLConnection) postUrl.openConnection();
+ connection.setDoOutput(true);
+ connection.setInstanceFollowRedirects(false);
+ connection.setRequestMethod("POST");
+ connection.setRequestProperty("Content-Type", "application/xml");
+ OutputStream os = connection.getOutputStream();
+ os.write(newPerson.getBytes());
+ os.flush();
+ Assert.assertEquals(HttpURLConnection.HTTP_CREATED, connection.getResponseCode());
+ String createdUrl = connection.getHeaderField("Location");
+ System.out.println("Location: " + createdUrl);
+ connection.disconnect();
+
+
+ // Get the new object
+ System.out.println("*** GET Created Person **");
+ URL getUrl = new URL(createdUrl);
+ connection = (HttpURLConnection) getUrl.openConnection();
+ connection.setRequestMethod("GET");
+ System.out.println("Content-Type: " + connection.getContentType());
+
+ BufferedReader reader = new BufferedReader(new
+ InputStreamReader(connection.getInputStream()));
+
+ String line = reader.readLine();
+ while (line != null)
+ {
+ System.out.println(line);
+ line = reader.readLine();
+ }
+ Assert.assertEquals(HttpURLConnection.HTTP_OK, connection.getResponseCode());
+ connection.disconnect();
+
+ String updatePerson = "<person>"
+ + "<firstName>Jane</firstName>"
+ + "<lastName>Doe</lastName>"
+ + "<street>1 University Ave</street>"
+ + "<city>Berkeley</city>"
+ + "<state>CA</state>"
+ + "<zip>94504</zip>"
+ + "<country>USA</country>"
+ + "</person>";
+ connection = (HttpURLConnection) getUrl.openConnection();
+ connection.setDoOutput(true);
+ connection.setRequestMethod("PUT");
+ connection.setRequestProperty("Content-Type", "application/xml");
+ os = connection.getOutputStream();
+ os.write(updatePerson.getBytes());
+ os.flush();
+ Assert.assertEquals(HttpURLConnection.HTTP_OK, connection.getResponseCode());
+ connection.disconnect();
+
+ // Show the update
+ System.out.println("**** After Update ***");
+ connection = (HttpURLConnection) getUrl.openConnection();
+ connection.setRequestMethod("GET");
+
+ System.out.println("Content-Type: " + connection.getContentType());
+ reader = new BufferedReader(new
+ InputStreamReader(connection.getInputStream()));
+
+ line = reader.readLine();
+ while (line != null)
+ {
+ System.out.println(line);
+ line = reader.readLine();
+ }
+ Assert.assertEquals(HttpURLConnection.HTTP_OK, connection.getResponseCode());
+ connection.disconnect();
+ }
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<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.collectionspace.hello.services</groupId>
+ <version>0.1</version>
+ <artifactId>helloworld</artifactId>
+ <packaging>pom</packaging>
+ <name>HelloWorld</name>
+ <modules>
+ <module>HelloWorldService</module>
+ <module>HelloWorldJaxb</module>
+ <module>HelloWorldClient</module>
+ </modules>
+ <repositories>
+ <repository>
+ <id>jboss</id>
+ <url>http://repository.jboss.org/maven2</url>
+ </repository>
+ <repository>
+ <id>sun</id>
+ <url>http://download.java.net/maven/2</url>
+ </repository>
+ <repository>
+ <id>java.net</id>
+ <name>java.net Maven Repository</name>
+ <url>
+ https://maven-repository.dev.java.net/nonav/repository
+ </url>
+ <layout>legacy</layout>
+ </repository>
+ <repository>
+ <id>maven2-repository.dev.java.net</id>
+ <name>Java.net Maven 2 Repository</name>
+ <url>http://download.java.net/maven/2</url>
+ </repository>
+ </repositories>
+ <pluginRepositories>
+
+ <pluginRepository>
+ <id>java.net</id>
+ <name>java.net Maven Repository</name>
+ <url>
+ https://maven-repository.dev.java.net/nonav/repository
+ </url>
+ <layout>legacy</layout>
+ </pluginRepository>
+ <pluginRepository>
+ <id>maven2-repository.dev.java.net</id>
+ <name>Java.net Maven 2 Repository</name>
+ <url>http://download.java.net/maven/2</url>
+ </pluginRepository>
+ </pluginRepositories>
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-site-plugin</artifactId>
+ <configuration>
+ <unzipCommand>
+ /usr/bin/unzip -o > err.txt
+ </unzipCommand>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <version>2.0.1</version>
+ <configuration>
+
+ <warSourceExcludes>
+ WEB-INF/lib/*.jar
+ </warSourceExcludes>
+ <archive>
+ <manifest>
+ <addClasspath>true</addClasspath>
+
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.jvnet.jaxb2.maven2</groupId>
+ <artifactId>maven-jaxb2-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <args>
+ <arg>-XtoString</arg>
+ <arg>-Xinject-listener-code</arg>
+
+ <!-- <arg>-Xcollection-setter-injector</arg>
+ <arg>-Xfluent-api</arg> -->
+ </args>
+ <plugins>
+ <plugin>
+ <groupId>
+ org.jvnet.jaxb2_commons
+ </groupId>
+ <artifactId>basic</artifactId>
+ <version>0.4.1</version>
+ </plugin>
+ <plugin>
+ <groupId>
+ org.jvnet.jaxb2-commons
+ </groupId>
+ <artifactId>
+ property-listener-injector
+ </artifactId>
+ <version>1.0</version>
+ </plugin>
+ <!--
+ <plugin>
+ <groupId>
+ net.java.dev.jaxb2-commons
+ </groupId>
+ <artifactId>jaxb-fluent-api</artifactId>
+ <version>2.0.1</version>
+ </plugin>
+ -->
+ </plugins>
+ <generatePackage>
+ org.collectionspace.hello.client
+ </generatePackage>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>net.java.dev.jaxb2-commons</groupId>
+ <artifactId>jaxb-fluent-api</artifactId>
+ <version>2.0.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <version>5.6</version>
+ <scope>test</scope>
+ <classifier>jdk15</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>jaxrs-api</artifactId>
+ <version>1.0.2.GA</version>
+ </dependency>
+ <dependency>
+ <groupId>net.java.dev.jaxb2-commons</groupId>
+ <artifactId>jaxb-fluent-api</artifactId>
+ <version>2.0.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jvnet.jaxb2-commons</groupId>
+ <artifactId>property-listener-injector</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jvnet.jaxb2_commons</groupId>
+ <artifactId>runtime</artifactId>
+ <version>0.4.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>resteasy-jaxrs</artifactId>
+ <version>1.0.2.GA</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ <version>3.1</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ <version>2.1.7</version>
+ </dependency>
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <version>5.6</version>
+ <scope>test</scope>
+ <classifier>jdk15</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.5.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>1.5.2</version>
+ </dependency>
+ <dependency>
+ <groupId>mysql</groupId>
+ <artifactId>mysql-connector-java</artifactId>
+ <version>5.1.5</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.jgoodies</groupId>
+ <artifactId>binding</artifactId>
+ <version>2.0.2</version>
+ </dependency>
+ <dependency>
+ <groupId>com.jgoodies</groupId>
+ <artifactId>forms</artifactId>
+ <version>1.2.0</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+</project>