From: Sanjay Dalal Date: Fri, 21 Aug 2009 21:55:15 +0000 (+0000) Subject: CSPACE-383 moved sandbox from services/trunk to top-level root as per agreement withi... X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=51bcaaa67dc6f51a2e9e329286dad8eb54fc0a71;p=tmp%2Fjakarta-migration.git CSPACE-383 moved sandbox from services/trunk to top-level root as per agreement within the services team. A + sandbox D services/trunk/sandbox --- diff --git a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldClient/.classpath b/sandbox/aron/HelloWorld-CollectionObject/HelloWorldClient/.classpath deleted file mode 100644 index f42fb64cf..000000000 --- a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldClient/.classpath +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldClient/.project b/sandbox/aron/HelloWorld-CollectionObject/HelloWorldClient/.project deleted file mode 100644 index f44220ec1..000000000 --- a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldClient/.project +++ /dev/null @@ -1,23 +0,0 @@ - - - javaee-addressbook-client - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.maven.ide.eclipse.maven2Builder - - - - - - org.eclipse.jdt.core.javanature - org.maven.ide.eclipse.maven2Nature - - diff --git a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldClient/.settings/org.eclipse.jdt.core.prefs b/sandbox/aron/HelloWorld-CollectionObject/HelloWorldClient/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 02ba2fa25..000000000 --- a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldClient/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,5 +0,0 @@ -#Thu Feb 26 16:32:51 PST 2009 -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 -org.eclipse.jdt.core.compiler.compliance=1.5 -org.eclipse.jdt.core.compiler.source=1.5 diff --git a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldClient/.settings/org.maven.ide.eclipse.prefs b/sandbox/aron/HelloWorld-CollectionObject/HelloWorldClient/.settings/org.maven.ide.eclipse.prefs deleted file mode 100644 index 669df21c2..000000000 --- a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldClient/.settings/org.maven.ide.eclipse.prefs +++ /dev/null @@ -1,8 +0,0 @@ -#Thu Feb 26 16:30:28 PST 2009 -activeProfiles= -eclipse.preferences.version=1 -fullBuildGoals=process-test-resources -includeModules=false -resolveWorkspaceProjects=true -resourceFilterGoals=process-resources resources\:testResources -version=1 diff --git a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldClient/nb-configuration.xml b/sandbox/aron/HelloWorld-CollectionObject/HelloWorldClient/nb-configuration.xml deleted file mode 100644 index 6c3fe600b..000000000 --- a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldClient/nb-configuration.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - default - 8 - 80 - - diff --git a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldClient/nbactions.xml b/sandbox/aron/HelloWorld-CollectionObject/HelloWorldClient/nbactions.xml deleted file mode 100644 index fffbf0fe6..000000000 --- a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldClient/nbactions.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - rebuild - - * - - - clean - install - - - true - - - diff --git a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldClient/pom.xml b/sandbox/aron/HelloWorld-CollectionObject/HelloWorldClient/pom.xml deleted file mode 100644 index 92a507301..000000000 --- a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldClient/pom.xml +++ /dev/null @@ -1,67 +0,0 @@ - - - - helloworld - org.collectionspace.hello.services - 0.1 - - 4.0.0 - org.collectionspace.hello.services - helloworld-client - jar - 0.1 - Helloworld Client - - - org.collectionspace.hello.services - helloworld-jaxb - 0.1 - - - org.testng - testng - 5.6 - - - org.slf4j - slf4j-api - - - org.slf4j - slf4j-log4j12 - - - org.jboss.resteasy - resteasy-jaxrs - 1.0.2.GA - - - - tjws - webserver - - - - - org.jboss.resteasy - resteasy-jaxb-provider - 1.0.2.GA - - - commons-httpclient - commons-httpclient - - - - - - maven-compiler-plugin - 2.0.2 - - 1.5 - 1.5 - - - - - diff --git a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldClient/src/main/java/org/collectionspace/hello/client/CollectionObjectClient.java b/sandbox/aron/HelloWorld-CollectionObject/HelloWorldClient/src/main/java/org/collectionspace/hello/client/CollectionObjectClient.java deleted file mode 100644 index 6a20afb94..000000000 --- a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldClient/src/main/java/org/collectionspace/hello/client/CollectionObjectClient.java +++ /dev/null @@ -1,94 +0,0 @@ -package org.collectionspace.hello.client; - -import javax.ws.rs.core.Response; - -import org.collectionspace.hello.CollectionObject; -import org.collectionspace.hello.CollectionObjectList; -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 CollectionObjectClient. - - * @version $Revision:$ - */ -public class CollectionObjectClient { - - /** - * - */ - private static final CollectionObjectClient instance = new CollectionObjectClient(); - /** - * - */ - private CollectionObjectProxy CollectionObjectProxy; - - /** - * - * Create a new CollectionObjectClient. - * - */ - private CollectionObjectClient() { - ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance(); - RegisterBuiltin.register(factory); - CollectionObjectProxy = - ProxyFactory.create(CollectionObjectProxy.class, "http://localhost:8080/helloworld/cspace"); - } - - /** - * FIXME Comment this - * - * @return - */ - public static CollectionObjectClient getInstance() { - return instance; - } - - /** - * @param id - * @return - * @see org.collectionspace.hello.client.CollectionObjectProxy#getCollectionObject() - */ - public ClientResponse getCollectionObjectList() { - return CollectionObjectProxy.getCollectionObjectList(); - } - - /** - * @param id - * @return - * @see org.collectionspace.hello.client.CollectionObjectProxy#getCollectionObject(java.lang.String) - */ - public ClientResponse getCollectionObject(String id) { - return CollectionObjectProxy.getCollectionObject(id); - } - - /** - * @param CollectionObject - * @return - * @see org.collectionspace.hello.client.CollectionObjectProxy#createCollectionObject(org.collectionspace.hello.client.entity.CollectionObject) - */ - public ClientResponse createCollectionObject(CollectionObject CollectionObject) { - return CollectionObjectProxy.createCollectionObject(CollectionObject); - } - - /** - * @param id - * @param CollectionObject - * @return - * @see org.collectionspace.hello.client.CollectionObjectProxy#updateCollectionObject(java.lang.String, org.collectionspace.hello.client.entity.CollectionObject) - */ - public ClientResponse updateCollectionObject(String id, CollectionObject CollectionObject) { - return CollectionObjectProxy.updateCollectionObject(id, CollectionObject); - } - - /** - * @param id - * @return - * @see org.collectionspace.hello.client.CollectionObjectProxy#deleteCollectionObject(java.lang.String) - */ - public ClientResponse deleteCollectionObject(String id) { - return CollectionObjectProxy.deleteCollectionObject(id); - } -} diff --git a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldClient/src/main/java/org/collectionspace/hello/client/CollectionObjectProxy.java b/sandbox/aron/HelloWorld-CollectionObject/HelloWorldClient/src/main/java/org/collectionspace/hello/client/CollectionObjectProxy.java deleted file mode 100644 index fcaefa050..000000000 --- a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldClient/src/main/java/org/collectionspace/hello/client/CollectionObjectProxy.java +++ /dev/null @@ -1,44 +0,0 @@ -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.collectionspace.hello.CollectionObject; -import org.collectionspace.hello.CollectionObjectList; -import org.jboss.resteasy.client.ClientResponse; - -/** - * @version $Revision:$ - */ -@Path("/collectionobjects/") -@Produces({"application/xml"}) -@Consumes({"application/xml"}) -public interface CollectionObjectProxy { - - @GET - @Path("/{id}") - ClientResponse getCollectionObject(@PathParam("id") String id); - - // List - @GET - ClientResponse getCollectionObjectList(); - - @POST - ClientResponse createCollectionObject(CollectionObject co); - - @PUT - @Path("/{id}") - ClientResponse - updateCollectionObject(@PathParam("id") String id, CollectionObject co); - - @DELETE - @Path("/{id}") - ClientResponse deleteCollectionObject(@PathParam("id") String id); -} \ No newline at end of file diff --git a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldClient/src/main/java/org/collectionspace/hello/client/IdentifierClient.java b/sandbox/aron/HelloWorld-CollectionObject/HelloWorldClient/src/main/java/org/collectionspace/hello/client/IdentifierClient.java deleted file mode 100644 index a7b12f967..000000000 --- a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldClient/src/main/java/org/collectionspace/hello/client/IdentifierClient.java +++ /dev/null @@ -1,64 +0,0 @@ -package org.collectionspace.hello.client; - -import javax.ws.rs.core.Response; - -import org.collectionspace.hello.Identifier; -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 IdentifierClient. - - * @version $Revision:$ - */ -public class IdentifierClient { - - /** - * - */ - private static final IdentifierClient instance = new IdentifierClient(); - /** - * - */ - private IdentifierProxy identifierProxy; - - /** - * - * Create a new IdentifierClient. - * - */ - private IdentifierClient() { - ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance(); - RegisterBuiltin.register(factory); - identifierProxy = ProxyFactory.create(IdentifierProxy.class, "http://localhost:8080/helloworld/cspace"); - } - - /** - * FIXME Comment this - * - * @return - */ - public static IdentifierClient getInstance() { - return instance; - } - - /** - * @param id - * @return - * @see org.collectionspace.hello.client.IdentifierProxy#getIdentifier(java.lang.Long) - */ - public ClientResponse getIdentifier(Long id) { - return identifierProxy.getIdentifier(id); - } - - /** - * @param identifier - * @return - * @see org.collectionspace.hello.client.IdentifierProxy#createIdentifier(org.collectionspace.hello.client.entity.Identifier) - */ - public ClientResponse createIdentifier(Identifier identifier) { - return identifierProxy.createIdentifier(identifier); - } -} diff --git a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldClient/src/main/java/org/collectionspace/hello/client/IdentifierProxy.java b/sandbox/aron/HelloWorld-CollectionObject/HelloWorldClient/src/main/java/org/collectionspace/hello/client/IdentifierProxy.java deleted file mode 100644 index 125aab47d..000000000 --- a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldClient/src/main/java/org/collectionspace/hello/client/IdentifierProxy.java +++ /dev/null @@ -1,32 +0,0 @@ -package org.collectionspace.hello.client; - -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.core.Response; - -import org.collectionspace.hello.Identifier; -import org.jboss.resteasy.client.ClientResponse; - -/** - * @version $Revision:$ - */ -@Path("/identifiers/") -@Produces({"application/xml"}) -@Consumes({"application/xml"}) -public interface IdentifierProxy { - - /** - * @param id - * @return - */ - @GET - @Path("/{id}") - ClientResponse getIdentifier(@PathParam("id") Long id); - - @POST - ClientResponse createIdentifier(Identifier so); -} \ No newline at end of file diff --git a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldClient/src/main/java/org/collectionspace/hello/client/PersonClient.java b/sandbox/aron/HelloWorld-CollectionObject/HelloWorldClient/src/main/java/org/collectionspace/hello/client/PersonClient.java deleted file mode 100644 index e5de8f6e6..000000000 --- a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldClient/src/main/java/org/collectionspace/hello/client/PersonClient.java +++ /dev/null @@ -1,93 +0,0 @@ -package org.collectionspace.hello.client; - -import javax.ws.rs.core.Response; - -import org.collectionspace.hello.Person; -import org.collectionspace.hello.Persons; -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() - */ - public ClientResponse getPersons() { - return personProxy.getPersons(); - } - - /** - * @param id - * @return - * @see org.collectionspace.hello.client.PersonProxy#getPerson(java.lang.Long) - */ - public ClientResponse 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 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 updatePerson(Long id, Person person) { - return personProxy.updatePerson(id, person); - } - - /** - * @param id - * @return - * @see org.collectionspace.hello.client.PersonProxy#deletePerson(java.lang.Long) - */ - public ClientResponse deletePerson(Long id) { - return personProxy.deletePerson(id); - } -} diff --git a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldClient/src/main/java/org/collectionspace/hello/client/PersonProxy.java b/sandbox/aron/HelloWorld-CollectionObject/HelloWorldClient/src/main/java/org/collectionspace/hello/client/PersonProxy.java deleted file mode 100644 index 2b6f2370b..000000000 --- a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldClient/src/main/java/org/collectionspace/hello/client/PersonProxy.java +++ /dev/null @@ -1,42 +0,0 @@ -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.collectionspace.hello.Person; -import org.collectionspace.hello.Persons; -import org.jboss.resteasy.client.ClientResponse; - -/** - * @version $Revision:$ - */ -@Path("/persons/") -@Produces({"application/xml"}) -@Consumes({"application/xml"}) -public interface PersonProxy { - - @GET - ClientResponse getPersons(); - - @GET - @Path("/{id}") - ClientResponse getPerson(@PathParam("id") Long id); - - @POST - ClientResponse createPerson(Person so); - - @PUT - @Path("/{id}") - ClientResponse updatePerson(@PathParam("id") Long id, Person so); - - @DELETE - @Path("/{id}") - ClientResponse deletePerson(@PathParam("id") Long id); -} \ No newline at end of file diff --git a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldClient/src/test/java/org/collectionspace/hello/client/test/CollectionObjectTest.java b/sandbox/aron/HelloWorld-CollectionObject/HelloWorldClient/src/test/java/org/collectionspace/hello/client/test/CollectionObjectTest.java deleted file mode 100644 index b5aa197aa..000000000 --- a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldClient/src/test/java/org/collectionspace/hello/client/test/CollectionObjectTest.java +++ /dev/null @@ -1,192 +0,0 @@ -package org.collectionspace.hello.client.test; - -import java.util.ArrayList; -import java.util.List; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.core.Response; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.Marshaller; -import org.collectionspace.hello.CollectionObject; -import org.collectionspace.hello.CollectionObjectList; -import org.collectionspace.hello.CollectionObjectListItem; -import org.collectionspace.hello.DefaultCollectionObject; -import org.collectionspace.hello.client.CollectionObjectClient; -import org.jboss.resteasy.client.ClientResponse; -import org.testng.Assert; -import org.testng.annotations.Test; - -/** - * A CollectionObjectTest. - * - * @version $Revision:$ - */ -public class CollectionObjectTest { - - private CollectionObjectClient client = CollectionObjectClient.getInstance(); - - private String updateId = "1"; - private String nonexistentId = "foo"; - - - @Test - public void createCollectionObject() { - CollectionObject co = - createCollectionObject("1984.021.0049", "Radio News, vol. 10, no. 2, August 1928"); - ClientResponse res = client.createCollectionObject(co); - verbose("created status=" + Response.Status.CREATED.getStatusCode()); - verbose("response status=" + Response.Status.CREATED.getStatusCode()); - Assert.assertEquals(res.getStatus(), Response.Status.CREATED.getStatusCode()); - //store updateId locally - updateId = extractId(res); - } - - @Test - public void createCollectionObjectList() { - CollectionObject co = - createCollectionObject("1997.005.0437", "Toy, Gotham City Police Helicopter, 1992"); - ClientResponse res = client.createCollectionObject(co); - Assert.assertEquals(res.getStatus(), Response.Status.CREATED.getStatusCode()); - co = createCollectionObject( - "1984.052.0001", " Pathescope Model 9061 28mm motion picture projector, 1914"); - res = client.createCollectionObject(co); - Assert.assertEquals(res.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test(dependsOnMethods = {"createCollectionObject"}) - public void updateCollectionObject() { - CollectionObject touCollectionObject = - client.getCollectionObject(updateId).getEntity(); - verbose("got CollectionObject to update", touCollectionObject, CollectionObject.class); - if ( touCollectionObject.getDefaultCollectionObject() == null ) { - touCollectionObject.setDefaultCollectionObject( new DefaultCollectionObject() ); - } - String updatedObjNum = "1981.297.0049"; - touCollectionObject.getDefaultCollectionObject().setObjectNumber(updatedObjNum); - touCollectionObject.getDefaultCollectionObject().setObjectName( - "Preview slide, It's the Old Army Game, 1926"); - // int initialVersion = touCollectionObject.getVersion(); - CollectionObject uCollectionObject = - client.updateCollectionObject(updateId, touCollectionObject).getEntity(); - verbose("updated CollectionObject", uCollectionObject, CollectionObject.class); - // Assert.assertNotSame(uCollectionObject.getVersion(), initialVersion); - Assert.assertEquals( - uCollectionObject.getDefaultCollectionObject().getObjectNumber(), updatedObjNum); - } - - @Test(dependsOnMethods = {"createCollectionObject"}) - public void getCollectionObjectList() { - //the resource method is expected to return at least an empty list - CollectionObjectList coList = client.getCollectionObjectList().getEntity(); - List list = coList.getCollectionObjectListItem(); - int i = 0; - for (CollectionObjectListItem pli : list) { - verbose("getCollectionObjectList: list-item[" + i + "] objectNumber=" + pli.getObjectNumber()); - verbose("getCollectionObjectList: list-item[" + i + "] objectName=" + pli.getObjectName()); - verbose("getCollectionObjectList: list-item[" + i + "] uri=" + pli.getUri()); - i++; - } - } - - - @Test - public void getNonExistingCollectionObject() { - ClientResponse res = client.getCollectionObject(nonexistentId); - - Response.Status status = res.getResponseStatus(); - verbose(this.getClass().getName() + ": " + - "getNonExistingCollectionObject: Status: code=" + status.getStatusCode() + - " message=" + status.toString()); - verbose("getNonExistingCollectionObject: Metadata:"); - verboseMap(res.getMetadata()); - verbose("getNonExistingCollectionObject: Headers:"); - verboseMap(res.getHeaders()); - if (status.equals(Response.Status.NOT_FOUND)) { - String msg = res.getEntity(String.class, String.class); - verbose("getNonExistingCollectionObject: error message=" + msg); - } - } - - @Test(dependsOnMethods = {"updateCollectionObject"}) - public void updateWrongCollectionObject() { - CollectionObject touCollectionObject = - client.getCollectionObject(updateId).getEntity(); - verbose("updateWrongCollectionObject: got CollectionObject to update", touCollectionObject, CollectionObject.class); - if ( touCollectionObject.getDefaultCollectionObject() == null ) { - touCollectionObject.setDefaultCollectionObject( new DefaultCollectionObject() ); - } - String updatedObjNum = "1981.297.0049"; - touCollectionObject.getDefaultCollectionObject().setObjectNumber(updatedObjNum); - touCollectionObject.getDefaultCollectionObject().setObjectName( - "Preview slide, It's the Old Army Game, 1926"); - //use non existing CollectionObject to update - ClientResponse res = - client.updateCollectionObject(nonexistentId, touCollectionObject); - if (res.getResponseStatus().equals(Response.Status.NOT_FOUND)) { - verbose("updateWrongCollectionObject: Status=" + res.getResponseStatus().toString()); - String msg = res.getEntity(String.class, String.class); - verbose("updateWrongCollectionObject: application error message=" + msg); - } - } - - - @Test(dependsOnMethods = {"updateWrongCollectionObject"}) - public void deleteCollectionObject() { - ClientResponse res = client.deleteCollectionObject(updateId); - verbose("deleteCollectionObject: id=" + updateId); - verbose("deleteCollectionObject: status = " + res.getStatus()); - Assert.assertEquals(res.getStatus(), Response.Status.NO_CONTENT.getStatusCode()); - } - - // ################################################################################### - // Utility methods used by tests above - // ################################################################################### - - private CollectionObject createCollectionObject(String objectNumber, String objectName) { - verbose("objectNumber=" + objectNumber); - verbose("objectName=" + objectName); - verbose("Before new CollectionObject() ..."); - CollectionObject co = new CollectionObject(); - verbose("Before co.getDefaultCollectionObject().setObjectNumber ..."); - co.setDefaultCollectionObject( new DefaultCollectionObject() ); - co.getDefaultCollectionObject().setObjectNumber(objectNumber); - co.getDefaultCollectionObject().setObjectName(objectName); - return co; - } - - private String extractId(ClientResponse res) { - MultivaluedMap mvm = res.getMetadata(); - String uri = (String) ((ArrayList) mvm.get("Location")).get(0); - String[] segments = uri.split("/"); - String id = segments[segments.length - 1]; - verbose("id=" + id); - return id; - } - - - private void verbose(String msg) { - System.out.println("CollectionObjectServiceTest : " + msg); - } - - private void verbose(String msg, Object o, Class clazz) { - try { - verbose(msg); - JAXBContext jc = JAXBContext.newInstance(clazz); - Marshaller m = jc.createMarshaller(); - m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, - Boolean.TRUE); - m.marshal(o, System.out); - //m.marshal(new JAXBElement(new QName("uri", "local"), CollectionObject.class, p), System.out); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void verboseMap(MultivaluedMap map) { - for (Object entry : map.entrySet()) { - MultivaluedMap.Entry mentry = (MultivaluedMap.Entry) entry; - verbose(" name=" + mentry.getKey() + " value=" + mentry.getValue()); - } - } - - -} diff --git a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldClient/src/test/java/org/collectionspace/hello/client/test/IdentifierServiceTest.java b/sandbox/aron/HelloWorld-CollectionObject/HelloWorldClient/src/test/java/org/collectionspace/hello/client/test/IdentifierServiceTest.java deleted file mode 100644 index 05bc199b5..000000000 --- a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldClient/src/test/java/org/collectionspace/hello/client/test/IdentifierServiceTest.java +++ /dev/null @@ -1,64 +0,0 @@ -package org.collectionspace.hello.client.test; - -import 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.Marshaller; -import org.collectionspace.hello.Identifier; -import org.jboss.resteasy.client.ClientResponse; -import org.testng.Assert; -import org.testng.annotations.Test; - -/** - * A IdentifierServiceTest. - * - * @version $Revision:$ - */ -public class IdentifierServiceTest { - - private IdentifierClient identifierClient = IdentifierClient.getInstance(); - private Long id = 0L; - - @Test - public void createIdentifier() { - Identifier identifier = new Identifier(); - identifier.setNamespace("org.bnhm"); - ClientResponse res = identifierClient.createIdentifier(identifier); - Assert.assertEquals(res.getStatus(), Response.Status.CREATED.getStatusCode()); - id = extractId(res); - } - - @Test(dependsOnMethods = {"createIdentifier"}) - public void getIdentifier() { - Identifier i = identifierClient.getIdentifier(id).getEntity(); - verbose("got Identifier", i); - } - - private Long extractId(ClientResponse res) { - MultivaluedMap mvm = res.getMetadata(); - String uri = (String) ((ArrayList) mvm.get("Location")).get(0); - String[] segments = uri.split("/"); - verbose("id=" + segments[segments.length - 1]); - return Long.valueOf(segments[segments.length - 1]); - } - - private void verbose(String msg) { - System.out.println("IdentifierServiceTest : " + msg); - } - - private void verbose(String msg, Identifier p) { - try { - verbose(msg); - JAXBContext jc = JAXBContext.newInstance(Identifier.class); - Marshaller m = jc.createMarshaller(); - m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, - Boolean.TRUE); - m.marshal(p, System.out); - //m.marshal(new JAXBElement(new QName("uri", "local"), Identifier.class, p), System.out); - } catch (Exception e) { - e.printStackTrace(); - } - } -} diff --git a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldClient/src/test/java/org/collectionspace/hello/client/test/PersonServiceTest.java b/sandbox/aron/HelloWorld-CollectionObject/HelloWorldClient/src/test/java/org/collectionspace/hello/client/test/PersonServiceTest.java deleted file mode 100644 index cf60e22bf..000000000 --- a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldClient/src/test/java/org/collectionspace/hello/client/test/PersonServiceTest.java +++ /dev/null @@ -1,159 +0,0 @@ -package org.collectionspace.hello.client.test; - -import java.util.ArrayList; -import java.util.List; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.core.Response; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.Marshaller; -import org.collectionspace.hello.Person; -import org.collectionspace.hello.Persons; -import org.collectionspace.hello.client.PersonClient; -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 updateId = 0L; - - @Test - public void createPerson() { - Person person = createPerson("Chris", "Hoffman"); - ClientResponse res = personClient.createPerson(person); - Assert.assertEquals(res.getStatus(), Response.Status.CREATED.getStatusCode()); - //store updateId locally - updateId = extractId(res); - } - - @Test - public void createPersons() { - Person person = createPerson("Aron", "Roberts"); - ClientResponse res = personClient.createPerson(person); - Assert.assertEquals(res.getStatus(), Response.Status.CREATED.getStatusCode()); - person = createPerson("Dan", "Sheppard"); - res = personClient.createPerson(person); - Assert.assertEquals(res.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test(dependsOnMethods = {"createPerson"}) - public void updatePerson() { - Person touPerson = personClient.getPerson(updateId).getEntity(); - verbose("got person to update", touPerson, Person.class); - touPerson.setFirstName("Richard"); - touPerson.setLastName("Millet"); - int initialVersion = touPerson.getVersion(); - Person uPerson = personClient.updatePerson(updateId, touPerson).getEntity(); - verbose("updated person", uPerson, Person.class); - Assert.assertNotSame(uPerson.getVersion(), initialVersion); - Assert.assertEquals(uPerson.getFirstName(), "Richard"); - } - - @Test(dependsOnMethods = {"createPerson"}) - public void getPersons() { - //the resource method is expected to return at least an empty list - Persons persons = personClient.getPersons().getEntity(); - List list = persons.getPersonListItem(); - int i = 0; - for (Persons.PersonListItem pli : list) { - verbose("getPersons: list-item[" + i + "] firstName=" + pli.getFirstName()); - verbose("getPersons: list-item[" + i + "] lastName=" + pli.getLastName()); - verbose("getPersons: list-item[" + i + "] uri=" + pli.getUri()); - i++; - } - } - - - @Test - public void getNonExistingPerson() { - ClientResponse res = personClient.getPerson(999L); - - Response.Status status = res.getResponseStatus(); - verbose(this.getClass().getName() + ": " + - "getNonExistingPerson: Status: code=" + status.getStatusCode() + - " message=" + status.toString()); - verbose("getNonExistingPerson: Metadata:"); - verboseMap(res.getMetadata()); - verbose("getNonExistingPerson: Headers:"); - verboseMap(res.getHeaders()); - if (status.equals(Response.Status.NOT_FOUND)) { - String msg = res.getEntity(String.class, String.class); - verbose("getNonExistingPerson: error message=" + msg); - } - } - - @Test(dependsOnMethods = {"updatePerson"}) - public void updateWrongPerson() { - Person touPerson = personClient.getPerson(updateId).getEntity(); - verbose("updateWrongPerson: got person to update", touPerson, Person.class); - touPerson.setFirstName("Richard"); - touPerson.setLastName("Millet"); - //use non existing person to update - ClientResponse res = personClient.updatePerson(9999L, touPerson); - if (res.getResponseStatus().equals(Response.Status.NOT_FOUND)) { - verbose("updateWrongPerson: Status=" + res.getResponseStatus().toString()); - String msg = res.getEntity(String.class, String.class); - verbose("updateWrongPerson: application error message=" + msg); - } - } - - - @Test(dependsOnMethods = {"updateWrongPerson"}) - public void deletePerson() { - ClientResponse res = personClient.deletePerson(updateId); - verbose("deletePerson: id=" + updateId); - verbose("deletePerson: status = " + res.getStatus()); - Assert.assertEquals(res.getStatus(), Response.Status.NO_CONTENT.getStatusCode()); - } - - private Person createPerson(String firstName, String lastName) { - Person person = new Person(); - person.setFirstName(firstName); - person.setLastName(lastName); - person.setStreet("2195 Hearst Ave."); - person.setCity("Berkeley"); - person.setState("CA"); - person.setZip("94704"); - person.setCountry("US"); - return person; - } - - private Long extractId(ClientResponse res) { - MultivaluedMap mvm = res.getMetadata(); - String uri = (String) ((ArrayList) mvm.get("Location")).get(0); - String[] segments = uri.split("/"); - verbose("id=" + segments[segments.length - 1]); - return Long.valueOf(segments[segments.length - 1]); - } - - private void verbose(String msg) { - System.out.println("PersonServiceTest : " + msg); - } - - private void verbose(String msg, Object o, Class clazz) { - try { - verbose(msg); - JAXBContext jc = JAXBContext.newInstance(clazz); - Marshaller m = jc.createMarshaller(); - m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, - Boolean.TRUE); - m.marshal(o, System.out); - //m.marshal(new JAXBElement(new QName("uri", "local"), Person.class, p), System.out); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void verboseMap(MultivaluedMap map) { - for (Object entry : map.entrySet()) { - MultivaluedMap.Entry mentry = (MultivaluedMap.Entry) entry; - verbose(" name=" + mentry.getKey() + " value=" + mentry.getValue()); - } - } -} diff --git a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldClient/src/test/resources/log4j.xml b/sandbox/aron/HelloWorld-CollectionObject/HelloWorldClient/src/test/resources/log4j.xml deleted file mode 100644 index 52121cb83..000000000 --- a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldClient/src/test/resources/log4j.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldClient/temp-testng-customsuite.xml b/sandbox/aron/HelloWorld-CollectionObject/HelloWorldClient/temp-testng-customsuite.xml deleted file mode 100644 index 9f2480621..000000000 --- a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldClient/temp-testng-customsuite.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldJaxb/.classpath b/sandbox/aron/HelloWorld-CollectionObject/HelloWorldJaxb/.classpath deleted file mode 100644 index cb112c7d0..000000000 --- a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldJaxb/.classpath +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldJaxb/.project b/sandbox/aron/HelloWorld-CollectionObject/HelloWorldJaxb/.project deleted file mode 100644 index db1c789f7..000000000 --- a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldJaxb/.project +++ /dev/null @@ -1,23 +0,0 @@ - - - javaee-addressbook-jaxb - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.maven.ide.eclipse.maven2Builder - - - - - - org.eclipse.jdt.core.javanature - org.maven.ide.eclipse.maven2Nature - - diff --git a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldJaxb/.settings/org.eclipse.jdt.core.prefs b/sandbox/aron/HelloWorld-CollectionObject/HelloWorldJaxb/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 6e9989ded..000000000 --- a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldJaxb/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,5 +0,0 @@ -#Thu Feb 26 16:32:52 PST 2009 -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 -org.eclipse.jdt.core.compiler.compliance=1.5 -org.eclipse.jdt.core.compiler.source=1.5 diff --git a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldJaxb/.settings/org.maven.ide.eclipse.prefs b/sandbox/aron/HelloWorld-CollectionObject/HelloWorldJaxb/.settings/org.maven.ide.eclipse.prefs deleted file mode 100644 index 669df21c2..000000000 --- a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldJaxb/.settings/org.maven.ide.eclipse.prefs +++ /dev/null @@ -1,8 +0,0 @@ -#Thu Feb 26 16:30:28 PST 2009 -activeProfiles= -eclipse.preferences.version=1 -fullBuildGoals=process-test-resources -includeModules=false -resolveWorkspaceProjects=true -resourceFilterGoals=process-resources resources\:testResources -version=1 diff --git a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldJaxb/nb-configuration.xml b/sandbox/aron/HelloWorld-CollectionObject/HelloWorldJaxb/nb-configuration.xml deleted file mode 100644 index 6c3fe600b..000000000 --- a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldJaxb/nb-configuration.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - default - 8 - 80 - - diff --git a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldJaxb/pom.xml b/sandbox/aron/HelloWorld-CollectionObject/HelloWorldJaxb/pom.xml deleted file mode 100644 index 8f0e2a102..000000000 --- a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldJaxb/pom.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - helloworld - org.collectionspace.hello.services - 0.1 - - 4.0.0 - org.collectionspace.hello.services - helloworld-jaxb - 0.1 - Helloworld Client JAXB - - - com.sun.xml.bind - jaxb-impl - 2.0.2 - - - org.jvnet.jaxb2-commons - property-listener-injector - 1.0 - - - org.jvnet.jaxb2_commons - runtime - 0.4.1.4 - - - - - - org.jvnet.jaxb2.maven2 - maven-jaxb2-plugin - - - - javax.activation - activation - 1.1 - - - com.sun.xml.bind - jaxb-impl - 2.1.2 - - - - - maven-compiler-plugin - 2.0.2 - - 1.5 - 1.5 - - - - - diff --git a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldJaxb/src/main/resources/hello.xsd b/sandbox/aron/HelloWorld-CollectionObject/HelloWorldJaxb/src/main/resources/hello.xsd deleted file mode 100644 index f9a7e360c..000000000 --- a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldJaxb/src/main/resources/hello.xsd +++ /dev/null @@ -1,254 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldService/README.txt b/sandbox/aron/HelloWorld-CollectionObject/HelloWorldService/README.txt deleted file mode 100644 index bd38e834c..000000000 --- a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldService/README.txt +++ /dev/null @@ -1,15 +0,0 @@ - -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 diff --git a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldService/build.properties b/sandbox/aron/HelloWorld-CollectionObject/HelloWorldService/build.properties deleted file mode 100644 index e390d9d25..000000000 --- a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldService/build.properties +++ /dev/null @@ -1 +0,0 @@ -jboss.dir=/usr/local/jboss \ No newline at end of file diff --git a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldService/build.xml b/sandbox/aron/HelloWorld-CollectionObject/HelloWorldService/build.xml deleted file mode 100644 index 87c30a55a..000000000 --- a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldService/build.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - Copying WAR file ... - - - - - - - - - - - - - diff --git a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldService/nb-configuration.xml b/sandbox/aron/HelloWorld-CollectionObject/HelloWorldService/nb-configuration.xml deleted file mode 100644 index 3e5cd988f..000000000 --- a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldService/nb-configuration.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - default - 8 - 80 - false - - diff --git a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldService/nbactions.xml b/sandbox/aron/HelloWorld-CollectionObject/HelloWorldService/nbactions.xml deleted file mode 100644 index ce9718100..000000000 --- a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldService/nbactions.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - - test - - * - - - test - - - - build - - * - - - install - - - - clean - - * - - - clean - - - - rebuild - - * - - - clean - install - - - true - - - - run - - war - ear - ejb - - - package - - - - true - - - - debug - - war - ear - ejb - - - package - - - - true - true - - - diff --git a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldService/pom.xml b/sandbox/aron/HelloWorld-CollectionObject/HelloWorldService/pom.xml deleted file mode 100644 index dd8c68f88..000000000 --- a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldService/pom.xml +++ /dev/null @@ -1,177 +0,0 @@ - - - - helloworld - org.collectionspace.hello.services - 0.1 - - 4.0.0 - org.collectionspace.hello.services - helloworld-service - war - 0.1 - Helloworld Service - - - - java.net - http://download.java.net/maven/1 - legacy - - - maven repo - maven repo - http://repo1.maven.org/maven2/ - - - - jboss - jboss repo - http://repository.jboss.org/maven2 - - - mojo - mojo repo - http://svn.codehaus.org/mojo/trunk/mojo/jboss-maven-plugin - - - - - - org.collectionspace.hello.services - helloworld-jaxb - 0.1 - - - org.jboss.resteasy - resteasy-jaxrs - 1.0.2.GA - - - - tjws - webserver - - - - - org.jboss.resteasy - resteasy-jaxb-provider - 1.0.2.GA - - - junit - junit - 4.1 - test - - - - - helloworld - - - org.codehaus.mojo - jboss-maven-plugin - - ${jboss.dir} - - - - jboss-undeploy - pre-integration-test - - undeploy - - - ${basedir}/target/helloworld.war - - - - jboss-deploy - pre-integration-test - - deploy - - - ${basedir}/target/helloworld.war - - - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - - - surefire-it - integration-test - - test - - - false - - - - - - org.apache.maven.plugins - maven-war-plugin - 2.0 - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.5 - 1.5 - - - - - diff --git a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldService/src/main/java/org/collectionspace/hello/services/CollectionObjectResource.java b/sandbox/aron/HelloWorld-CollectionObject/HelloWorldService/src/main/java/org/collectionspace/hello/services/CollectionObjectResource.java deleted file mode 100644 index 1197cc7cf..000000000 --- a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldService/src/main/java/org/collectionspace/hello/services/CollectionObjectResource.java +++ /dev/null @@ -1,262 +0,0 @@ -package org.collectionspace.hello.services; - -import java.net.URI; -import java.util.List; -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.AtomicLong; -import javax.ws.rs.DELETE; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.UriBuilder; -import javax.ws.rs.core.UriInfo; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.Marshaller; -import org.collectionspace.hello.CollectionObject; -import org.collectionspace.hello.CollectionObjectList; -import org.collectionspace.hello.CollectionObjectListItem; -import org.collectionspace.hello.DefaultCollectionObject; -import org.collectionspace.hello.ServiceMetadata; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@Path("/collectionobjects") -@Consumes("application/xml") -@Produces("application/xml") -public class CollectionObjectResource { - - final Logger logger = LoggerFactory.getLogger(CollectionObjectResource.class); - private Map CollectionObjectDB = - new ConcurrentHashMap(); - private AtomicLong idCounter = new AtomicLong(); - - public CollectionObjectResource() { - } - - @POST - public Response createCollectionObject(CollectionObject c) { - if (c == null) { - Response response = Response.status(Response.Status.BAD_REQUEST).entity( - "Add failed, the CollectionObject provided was empty.").type("text/plain").build(); - throw new WebApplicationException(response); - } - Long id = idCounter.incrementAndGet(); - // c.getServiceMetadata().setCollectionSpaceId(id.toString()); - c.setServiceMetadata( new ServiceMetadata() ); - c.getServiceMetadata().setCollectionSpaceId("100"); - // c.setVersion(1); - CollectionObjectDB.put(c.getServiceMetadata().getCollectionSpaceId(), c); - verbose("created CollectionObject", c); - UriBuilder path = UriBuilder.fromResource(CollectionObjectResource.class); - path.path("" + c.getServiceMetadata().getCollectionSpaceId()); - Response response = Response.created(path.build()).build(); - return response; - } - - @GET - @Path("{id}") - public CollectionObject getCollectionObject(@PathParam("id") String id) { - CollectionObject c = CollectionObjectDB.get(id); - if (c == null) { - Response response = Response.status(Response.Status.NOT_FOUND).entity( - "Get failed, the requested CollectionObject ID:" + id + ": was not found.").type("text/plain").build(); - throw new WebApplicationException(response); - } - verbose("get CollectionObject", c); - return c; - } - - @PUT - @Path("{id}") - public CollectionObject updateCollectionObject(@PathParam("id") String id, CollectionObject update) { - CollectionObject current = CollectionObjectDB.get(id); - if (current == null) { - Response response = Response.status(Response.Status.NOT_FOUND).entity( - "Update failed, the CollectionObject ID:" + id + ": was not found.").type("text/plain").build(); - throw new WebApplicationException(response); - } - verbose("update CollectionObject input", update); - //todo: intelligent merge needed - // current.getServiceMetadata().setLastUpdated( [current date/time here] ); - current.getDefaultCollectionObject().setObjectNumber( - update.getDefaultCollectionObject().getObjectNumber()); - current.getDefaultCollectionObject().setOtherNumber( - update.getDefaultCollectionObject().getOtherNumber()); - current.getDefaultCollectionObject().setBriefDescription( - update.getDefaultCollectionObject().getBriefDescription()); - current.getDefaultCollectionObject().setComments( - update.getDefaultCollectionObject().getComments()); - current.getDefaultCollectionObject().setDistinguishingFeatures( - update.getDefaultCollectionObject().getDistinguishingFeatures()); - current.getDefaultCollectionObject().setObjectName( - update.getDefaultCollectionObject().getObjectName()); - current.getDefaultCollectionObject().setResponsibleDepartment( - update.getDefaultCollectionObject().getResponsibleDepartment()); - verbose("update CollectionObject output", current); - return current; - } - - // Get a list - @GET - public CollectionObjectList getCollectionObjectList(@Context UriInfo ui) { - CollectionObjectList CollectionObjectList = new CollectionObjectList(); - // The auto-generated method called here has a potentially misleading name; it returns a List. - List list = - CollectionObjectList.getCollectionObjectListItem(); - // builder starts with current URI and has appended path of getCollectionObject method - UriBuilder ub = ui.getAbsolutePathBuilder().path(this.getClass(), "getCollectionObject"); - for (CollectionObject c : CollectionObjectDB.values()) { - CollectionObjectListItem cli = new CollectionObjectListItem(); - cli.setCollectionSpaceId(c.getServiceMetadata().getCollectionSpaceId()); - cli.setObjectNumber(c.getDefaultCollectionObject().getObjectNumber()); - cli.setObjectName(c.getDefaultCollectionObject().getObjectName()); - // builder has {id} variable that must be filled in for each customer - URI uri = ub.build(c.getServiceMetadata().getCollectionSpaceId()); - cli.setUri(uri.toString()); - list.add(cli); - } - return CollectionObjectList; - } - - @DELETE - @Path("{id}") - public void deleteCollectionObject(@PathParam("id") String id) { - CollectionObject removed = CollectionObjectDB.remove(id); - if (removed == null) { - Response response = Response.status(Response.Status.NOT_FOUND).entity( - "Delete failed, the CollectionObject ID:" + id + ": was not found.").type("text/plain").build(); - throw new WebApplicationException(response); - } - verbose("deleted CollectionObject", removed); - } - - private void verbose(String msg, CollectionObject c) { - try { - System.out.println("CollectionObjectResource : " + msg); - JAXBContext jc = JAXBContext.newInstance(CollectionObject.class); - Marshaller m = jc.createMarshaller(); - m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); - m.marshal(c, System.out); - } catch (Exception e) { - e.printStackTrace(); - } - } - -// @POST -// @Consumes("application/xml") -// public Response createCollectionObject(InputStream is) { -// CollectionObject c = readCollectionObject(is); -// c.setId(idCounter.incrementAndGet()); -// c.setVersion(1); -// CollectionObjectDB.put(c.getId(), c); -// try { -// System.out.println("Created CollectionObject " + c.getId()); -// outputCollectionObject(System.out, c); -// } catch (IOException ioe) { -// throw new WebApplicationException(Response.Status.INTERNAL_SERVER_ERROR); -// } -// return Response.created(URI.create("/CollectionObjects/" + c.getId())).build(); -// -// } -// -// @GET -// @Path("{id}") -// @Produces("application/xml") -// public StreamingOutput getCollectionObject(@PathParam("id") int id) { -// final CollectionObject c = CollectionObjectDB.get(id); -// if (c == null) { -// throw new WebApplicationException(Response.Status.NOT_FOUND); -// } -// return new StreamingOutput() { -// -// public void write(OutputStream outputStream) throws IOException, WebApplicationException { -// outputCollectionObject(outputStream, c); -// } -// }; -// } -// -// @PUT -// @Path("{id}") -// @Consumes("application/xml") -// @Produces("application/xml") -// public StreamingOutput updateCollectionObject(@PathParam("id") int id, InputStream is) { -// CollectionObject update = readCollectionObject(is); -// CollectionObject current = CollectionObjectDB.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 CollectionObject scurrent = current; -// return new StreamingOutput() { -// -// public void write(OutputStream outputStream) throws IOException, WebApplicationException { -// outputCollectionObject(outputStream, scurrent); -// } -// }; -// } -// -// protected void outputCollectionObject(OutputStream os, CollectionObject c) throws IOException { -// PrintStream writer = new PrintStream(os); -// writer.println(""); -// writer.println(" " + c.getFirstName() + ""); -// writer.println(" " + c.getLastName() + ""); -// writer.println(" " + c.getStreet() + ""); -// writer.println(" " + c.getCity() + ""); -// writer.println(" " + c.getState() + ""); -// writer.println(" " + c.getZip() + ""); -// writer.println(" " + c.getCountry() + ""); -// writer.println(""); -// } -// -// protected CollectionObject readCollectionObject(InputStream is) { -// try { -// DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); -// Document doc = builder.parse(is); -// Element root = doc.getDocumentElement(); -// CollectionObject c = new CollectionObject(); -// if (root.getAttribute("id") != null && !root.getAttribute("id").trim().equals("")) { -// c.setId(Integer.valueOf(root.getAttribute("id"))); -// } -// if (root.getAttribute("version") != null && !root.getAttribute("version").trim().equals("")) { -// c.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")) { -// c.setFirstName(element.getTextContent()); -// } else if (element.getTagName().equals("last-name")) { -// c.setLastName(element.getTextContent()); -// } else if (element.getTagName().equals("street")) { -// c.setStreet(element.getTextContent()); -// } else if (element.getTagName().equals("city")) { -// c.setCity(element.getTextContent()); -// } else if (element.getTagName().equals("state")) { -// c.setState(element.getTextContent()); -// } else if (element.getTagName().equals("zip")) { -// c.setZip(element.getTextContent()); -// } else if (element.getTagName().equals("country")) { -// c.setCountry(element.getTextContent()); -// } -// } -// return c; -// } catch (Exception e) { -// throw new WebApplicationException(e, Response.Status.BAD_REQUEST); -// } -// } -} diff --git a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldService/src/main/java/org/collectionspace/hello/services/HelloworldApplication.java b/sandbox/aron/HelloWorld-CollectionObject/HelloWorldService/src/main/java/org/collectionspace/hello/services/HelloworldApplication.java deleted file mode 100644 index 572066a3b..000000000 --- a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldService/src/main/java/org/collectionspace/hello/services/HelloworldApplication.java +++ /dev/null @@ -1,27 +0,0 @@ -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 singletons = new HashSet(); - private Set> empty = new HashSet>(); - - public HelloworldApplication() { - singletons.add(new CollectionObjectResource()); - singletons.add(new PersonResource()); - singletons.add(new IdentifierResource()); - } - - @Override - public Set> getClasses() { - return empty; - } - - @Override - public Set getSingletons() { - return singletons; - } -} diff --git a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldService/src/main/java/org/collectionspace/hello/services/IdentifierResource.java b/sandbox/aron/HelloWorld-CollectionObject/HelloWorldService/src/main/java/org/collectionspace/hello/services/IdentifierResource.java deleted file mode 100644 index 4c4104890..000000000 --- a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldService/src/main/java/org/collectionspace/hello/services/IdentifierResource.java +++ /dev/null @@ -1,77 +0,0 @@ -package org.collectionspace.hello.services; - -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -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.UUID; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.atomic.AtomicLong; -import javax.ws.rs.core.UriBuilder; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.Marshaller; -import org.collectionspace.hello.Identifier; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@Path("/identifiers") -@Consumes("application/xml") -@Produces("application/xml") -public class IdentifierResource { - - final Logger logger = LoggerFactory.getLogger(IdentifierResource.class); - private Map idDB = new ConcurrentHashMap(); - private AtomicLong idCounter = new AtomicLong(); - - public IdentifierResource() { - } - - @POST - public Response createIdentifier(Identifier id) { - if (id.getNamespace() == null) { - id.setNamespace("edu.berkeley"); - } - id.setId(idCounter.incrementAndGet()); - id.setVersion(1); - UUID uuid = UUID.nameUUIDFromBytes(id.getNamespace().getBytes()); - id.setValue(uuid.toString()); - idDB.put(id.getId(), id); - verbose("created Id", id); - UriBuilder path = UriBuilder.fromResource(IdentifierResource.class); - path.path("" + id.getId()); - Response response = Response.created(path.build()).build(); - return response; - } - - @GET - @Path("{id}") - public Identifier getIdentifier(@PathParam("id") Long id) { - Identifier i = idDB.get(id); - if (i == 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 Id", i); - return i; - } - - private void verbose(String msg, Identifier id) { - try { - System.out.println("IdentifierResource : " + msg); - JAXBContext jc = JAXBContext.newInstance(Identifier.class); - Marshaller m = jc.createMarshaller(); - m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, - Boolean.TRUE); - m.marshal(id, System.out); - - } catch (Exception e) { - e.printStackTrace(); - } - } -} diff --git a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldService/src/main/java/org/collectionspace/hello/services/PersonResource.java b/sandbox/aron/HelloWorld-CollectionObject/HelloWorldService/src/main/java/org/collectionspace/hello/services/PersonResource.java deleted file mode 100644 index b8c06b852..000000000 --- a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldService/src/main/java/org/collectionspace/hello/services/PersonResource.java +++ /dev/null @@ -1,241 +0,0 @@ -package org.collectionspace.hello.services; - -import java.net.URI; -import java.util.List; -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.AtomicLong; -import javax.ws.rs.DELETE; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.UriBuilder; -import javax.ws.rs.core.UriInfo; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.Marshaller; -import org.collectionspace.hello.Person; -import org.collectionspace.hello.Persons.PersonListItem; -import org.collectionspace.hello.Persons; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@Path("/persons") -@Consumes("application/xml") -@Produces("application/xml") -public class PersonResource { - - final Logger logger = LoggerFactory.getLogger(PersonResource.class); - private Map personDB = new ConcurrentHashMap(); - private AtomicLong idCounter = new AtomicLong(); - - public PersonResource() { - } - - @POST - public Response createPerson(Person p) { - p.setId(idCounter.incrementAndGet()); - p.setVersion(1); - personDB.put(p.getId(), p); - verbose("created 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") Long id) { - Person p = personDB.get(id); - if (p == null) { - Response response = Response.status(Response.Status.NOT_FOUND).entity( - "Get failed, the requested person ID:" + 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") Long id, Person update) { - Person current = personDB.get(id); - if (current == null) { - Response response = Response.status(Response.Status.NOT_FOUND).entity( - "Update failed, the person ID:" + id + ": was not found.").type("text/plain").build(); - throw new WebApplicationException(response); - } - verbose("update person input", 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("update person output", current); - return current; - } - - @GET - public Persons getPersons(@Context UriInfo ui) { - Persons persons = new Persons(); - List list = persons.getPersonListItem(); - // builder starts with current URI and has appended path of getPerson method - UriBuilder ub = ui.getAbsolutePathBuilder().path(this.getClass(), "getPerson"); - for (Person p : personDB.values()) { - PersonListItem pli = new PersonListItem(); - pli.setFirstName(p.getFirstName()); - pli.setLastName(p.getLastName()); - pli.setId(p.getId()); - // builder has {id} variable that must be filled in for each customer - URI uri = ub.build(p.getId()); - pli.setUri(uri.toString()); - list.add(pli); - } - return persons; - } - - @DELETE - @Path("{id}") - public void deletePerson(@PathParam("id") Long id) { - Person removed = personDB.remove(id); - if (removed == null) { - Response response = Response.status(Response.Status.NOT_FOUND).entity( - "Delete failed, the person ID:" + id + ": was not found.").type("text/plain").build(); - throw new WebApplicationException(response); - } - verbose("deleted person", removed); - } - - private void verbose(String msg, Person p) { - try { - System.out.println("PersonResource : " + 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(""); -// writer.println(" " + p.getFirstName() + ""); -// writer.println(" " + p.getLastName() + ""); -// writer.println(" " + p.getStreet() + ""); -// writer.println(" " + p.getCity() + ""); -// writer.println(" " + p.getState() + ""); -// writer.println(" " + p.getZip() + ""); -// writer.println(" " + p.getCountry() + ""); -// writer.println(""); -// } -// -// 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); -// } -// } -} diff --git a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldService/src/main/webapp/WEB-INF/web.xml b/sandbox/aron/HelloWorld-CollectionObject/HelloWorldService/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index 9fa743481..000000000 --- a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldService/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - Helloworld - - - javax.ws.rs.Application - org.collectionspace.hello.services.HelloworldApplication - - - - resteasy.servlet.mapping.prefix - /cspace - - - - - org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap - - - - - Resteasy - - org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher - - - - - Resteasy - /cspace/* - - - diff --git a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldService/src/test/java/org/collectionspace/hello/test/CollectionObjectServiceRawXmlTest.java b/sandbox/aron/HelloWorld-CollectionObject/HelloWorldService/src/test/java/org/collectionspace/hello/test/CollectionObjectServiceRawXmlTest.java deleted file mode 100644 index 174994aba..000000000 --- a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldService/src/test/java/org/collectionspace/hello/test/CollectionObjectServiceRawXmlTest.java +++ /dev/null @@ -1,107 +0,0 @@ -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; - -/** - * @version $Revision: 1 $ - */ -public class CollectionObjectServiceRawXmlTest { - - @Test - public void testCollectionObjectResource() throws Exception { - verbose("create a new CollectionObject"); - // Create a new object - String newCollectionObject = - "" + - "" + - "" + - "1984.021.0049" + - "Radio News, vol. 10, no. 2, August 1928" + - "" + - ""; - verbose("new object: " + newCollectionObject); - URL postUrl = new URL("http://localhost:8080/helloworld/cspace/collectionobjects"); - 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(newCollectionObject.getBytes()); - os.flush(); - verbose("response: " + connection.getResponseMessage()); - Assert.assertEquals(HttpURLConnection.HTTP_CREATED, connection.getResponseCode()); - String createdUrl = connection.getHeaderField("Location"); - verbose("Location: " + createdUrl); - connection.disconnect(); - - - // Get the new object - verbose("get created CollectionObject"); - URL getUrl = new URL(createdUrl); - connection = (HttpURLConnection) getUrl.openConnection(); - connection.setRequestMethod("GET"); - verbose("Content-Type: " + connection.getContentType()); - - BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream())); - - String line = reader.readLine(); - while (line != null) { - verbose(line); - line = reader.readLine(); - } - Assert.assertEquals(HttpURLConnection.HTTP_OK, connection.getResponseCode()); - connection.disconnect(); - - String updateCollectionObject = - "" + - "" + - "" + - "1997.005.0437" + - "Toy, Gotham City Police Helicopter, 1992" + - "" + - ""; - - connection = (HttpURLConnection) getUrl.openConnection(); - connection.setDoOutput(true); - connection.setRequestMethod("PUT"); - connection.setRequestProperty("Content-Type", "application/xml"); - os = connection.getOutputStream(); - os.write(updateCollectionObject.getBytes()); - os.flush(); - verbose("response: " + connection.getResponseMessage()); - Assert.assertEquals(HttpURLConnection.HTTP_OK, connection.getResponseCode()); - connection.disconnect(); - - // Show the update - verbose("updated CollectionObject"); - connection = (HttpURLConnection) getUrl.openConnection(); - connection.setRequestMethod("GET"); - - verbose("Content-Type: " + connection.getContentType()); - reader = new BufferedReader(new InputStreamReader(connection.getInputStream())); - - line = reader.readLine(); - while (line != null) { - verbose(line); - line = reader.readLine(); - } - Assert.assertEquals(HttpURLConnection.HTTP_OK, connection.getResponseCode()); - connection.disconnect(); - - } - - private void verbose(String msg) { - System.out.println("CollectionObjectServiceRawXmlTest : " + msg); - } -} diff --git a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldService/src/test/java/org/collectionspace/hello/test/IdentifierServiceRawXmlTest.java b/sandbox/aron/HelloWorld-CollectionObject/HelloWorldService/src/test/java/org/collectionspace/hello/test/IdentifierServiceRawXmlTest.java deleted file mode 100644 index e9893fecc..000000000 --- a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldService/src/test/java/org/collectionspace/hello/test/IdentifierServiceRawXmlTest.java +++ /dev/null @@ -1,62 +0,0 @@ -package org.collectionspace.hello.test; - -import org.junit.Assert; -import org.junit.Test; - -import java.io.BufferedReader; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.net.HttpURLConnection; -import java.net.URL; - -/** - * @version $Revision: 1 $ - */ -public class IdentifierServiceRawXmlTest { - - @Test - public void testIdentifierResource() throws Exception { - verbose("create a new Identifier"); - // Create a new object - String newIdentifier = "" + - "edu.stanford" + - ""; - - URL postUrl = new URL("http://localhost:8080/helloworld/cspace/identifiers"); - 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(newIdentifier.getBytes()); - os.flush(); - Assert.assertEquals(HttpURLConnection.HTTP_CREATED, connection.getResponseCode()); - String createdUrl = connection.getHeaderField("Location"); - verbose("Location: " + createdUrl); - connection.disconnect(); - - - // Get the new object - verbose("get created Identifier"); - URL getUrl = new URL(createdUrl); - connection = (HttpURLConnection) getUrl.openConnection(); - connection.setRequestMethod("GET"); - verbose("Content-Type: " + connection.getContentType()); - - BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream())); - - String line = reader.readLine(); - while (line != null) { - verbose(line); - line = reader.readLine(); - } - Assert.assertEquals(HttpURLConnection.HTTP_OK, connection.getResponseCode()); - connection.disconnect(); - - } - - private void verbose(String msg) { - System.out.println("IdentifierServiceRawXmlTest : " + msg); - } -} diff --git a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldService/src/test/java/org/collectionspace/hello/test/PersonServiceRawXmlTest.java b/sandbox/aron/HelloWorld-CollectionObject/HelloWorldService/src/test/java/org/collectionspace/hello/test/PersonServiceRawXmlTest.java deleted file mode 100644 index b455b2f01..000000000 --- a/sandbox/aron/HelloWorld-CollectionObject/HelloWorldService/src/test/java/org/collectionspace/hello/test/PersonServiceRawXmlTest.java +++ /dev/null @@ -1,89 +0,0 @@ -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; - -/** - * @version $Revision: 1 $ - */ -public class PersonServiceRawXmlTest { - - @Test - public void testPersonResource() throws Exception { - verbose("create a new Person"); - // Create a new object - String newPerson = "" + "John" + "Doe" + "2195 Hearst Ave" + "Berkeley" + "CA" + "94504" + "USA" + ""; - - 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"); - verbose("Location: " + createdUrl); - connection.disconnect(); - - - // Get the new object - verbose("get created Person"); - URL getUrl = new URL(createdUrl); - connection = (HttpURLConnection) getUrl.openConnection(); - connection.setRequestMethod("GET"); - verbose("Content-Type: " + connection.getContentType()); - - BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream())); - - String line = reader.readLine(); - while (line != null) { - verbose(line); - line = reader.readLine(); - } - Assert.assertEquals(HttpURLConnection.HTTP_OK, connection.getResponseCode()); - connection.disconnect(); - - String updatePerson = "" + "Jane" + "Doe" + "1 University Ave" + "Berkeley" + "CA" + "94504" + "USA" + ""; - 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 - verbose("updated Person"); - connection = (HttpURLConnection) getUrl.openConnection(); - connection.setRequestMethod("GET"); - - verbose("Content-Type: " + connection.getContentType()); - reader = new BufferedReader(new InputStreamReader(connection.getInputStream())); - - line = reader.readLine(); - while (line != null) { - verbose(line); - line = reader.readLine(); - } - Assert.assertEquals(HttpURLConnection.HTTP_OK, connection.getResponseCode()); - connection.disconnect(); - } - - private void verbose(String msg) { - System.out.println("PersonServiceRawXmlTest : " + msg); - } -} diff --git a/sandbox/aron/HelloWorld-CollectionObject/pom.xml b/sandbox/aron/HelloWorld-CollectionObject/pom.xml deleted file mode 100644 index a058af929..000000000 --- a/sandbox/aron/HelloWorld-CollectionObject/pom.xml +++ /dev/null @@ -1,231 +0,0 @@ - - - - 4.0.0 - org.collectionspace.hello.services - 0.1 - helloworld - pom - HelloWorld - - HelloWorldJaxb - HelloWorldService - HelloWorldClient - - - - jboss - http://repository.jboss.org/maven2 - - - sun - http://download.java.net/maven/2 - - - java.net - java.net Maven Repository - - https://maven-repository.dev.java.net/nonav/repository - - legacy - - - maven2-repository.dev.java.net - Java.net Maven 2 Repository - http://download.java.net/maven/2 - - - - - - java.net - java.net Maven Repository - - https://maven-repository.dev.java.net/nonav/repository - - legacy - - - maven2-repository.dev.java.net - Java.net Maven 2 Repository - http://download.java.net/maven/2 - - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.5 - 1.5 - - - - org.apache.maven.plugins - maven-site-plugin - - - /usr/bin/unzip -o > err.txt - - - - - org.apache.maven.plugins - maven-war-plugin - 2.0.1 - - - - WEB-INF/lib/*.jar - - - - true - - - - - - - org.jvnet.jaxb2.maven2 - maven-jaxb2-plugin - - - - generate - - - - - - -XtoString - -Xinject-listener-code - - - - - - - org.jvnet.jaxb2_commons - - basic - 0.4.1 - - - - org.jvnet.jaxb2-commons - - - property-listener-injector - - 1.0 - - - - - org.collectionspace.hello - - - - - - - - - - net.java.dev.jaxb2-commons - jaxb-fluent-api - 2.0.1 - - - org.testng - testng - 5.6 - test - jdk15 - - - org.jboss.resteasy - jaxrs-api - 1.0.2.GA - - - net.java.dev.jaxb2-commons - jaxb-fluent-api - 2.0.1 - - - org.jvnet.jaxb2-commons - property-listener-injector - 1.0 - - - org.jvnet.jaxb2_commons - runtime - 0.4.1 - - - org.jboss.resteasy - resteasy-jaxrs - 1.0.2.GA - - - commons-httpclient - commons-httpclient - 3.1 - - - com.sun.xml.bind - jaxb-impl - 2.1.7 - - - org.testng - testng - 5.6 - test - jdk15 - - - org.slf4j - slf4j-api - 1.5.2 - - - org.slf4j - slf4j-log4j12 - 1.5.2 - - - mysql - mysql-connector-java - 5.1.5 - test - - - com.jgoodies - binding - 2.0.2 - - - com.jgoodies - forms - 1.2.0 - - - - diff --git a/sandbox/aron/id/pom.xml b/sandbox/aron/id/pom.xml deleted file mode 100644 index 1fde68d0c..000000000 --- a/sandbox/aron/id/pom.xml +++ /dev/null @@ -1,34 +0,0 @@ - - 4.0.0 - org.collectionspace.services - id - jar - 0.1-SNAPSHOT - id - http://maven.apache.org - - - UTF-8 - - - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.5 - 1.5 - - - - - - - junit - junit - 3.8.1 - test - - - diff --git a/sandbox/aron/id/src/main/java/org/collectionspace/services/id/AlphabeticIDGenerator.java b/sandbox/aron/id/src/main/java/org/collectionspace/services/id/AlphabeticIDGenerator.java deleted file mode 100644 index 21f268cc7..000000000 --- a/sandbox/aron/id/src/main/java/org/collectionspace/services/id/AlphabeticIDGenerator.java +++ /dev/null @@ -1,319 +0,0 @@ -/* - * AlphabeticIDGenerator - * - *

An identifier generator that generates an incrementing alphabetic ID - * from any sequence of characters, as a String object.

- * - * Copyright 2009 Regents of the University of California - * - * Licensed under the Educational Community License (ECL), Version 2.0. - * You may not use this file except in compliance with this License. - * - * You may obtain a copy of the ECL 2.0 License at - * https://source.collectionspace.org/collection-space/LICENSE.txt - * - * @author $Author: aron $ - * @version $Revision: 267 $ - * $Date: 2009-06-19 19:03:38 -0700 (Fri, 19 Jun 2009) $ - */ - -// @TODO: Add Javadoc comments - -// @TODO: When auto expanding, we'll need to set a maximum length to which the -// generated IDs can grow, likely as an additional parameter to be -// passed to a constructor, with a default value hard-coded in the class. - -// @TODO: Consider handling escaped characters or sequences which represent Unicode -// code points, both in the start and end characters of the sequence, and in the initial value. -// (Example: '\u0072' for the USASCII 'r' character; see -// http://www.fileformat.info/info/unicode/char/0072/index.htm) -// -// Ideally, we should read these in free-text patterns, alongside unescaped characters, -// but in practice we may wish to require some structured form for arguments -// containing such characters. -// -// Some initial research on this: -// http://www.velocityreviews.com/forums/t367758-unescaping-unicode-code-points-in-a-java-string.html -// We might also look into the (protected) source code for java.util.Properties.load() -// which reads escaped Unicode values. -// -// Note also that, if the goal is to cycle through a sequence of alphabetic identifiers, -// such as the sequence of characters used in a particular human language, it may or may not -// be the case that any contiguous Unicode code point sequence reflects such a character sequence. - -// NOTE: This class currently hard-codes the assumption that the values in -// alphabetic identifiers are ordered in significance from left-to-right; -// that is, the most significant value appears in the left-most position. - -package org.collectionspace.services.id; - -import java.util.Collections; -import java.util.Vector; - -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -public class AlphabeticIDGenerator implements IDGenerator { - - private static final char NULL_CHAR = '\u0000'; - - private static final String DEFAULT_START_CHAR = "a"; - private static final String DEFAULT_END_CHAR = "z"; - private static final String DEFAULT_INITIAL_VALUE = "a"; - - private char startChar = NULL_CHAR; - private char endChar = NULL_CHAR; - - private Vector initialValue = new Vector(); - private Vector currentValue = new Vector(); - - // Constructor using defaults for character sequence and initial value. - // - // If no start and end characters are provided for the alphabetic character - // sequence, default to an 'a-z' sequence, representing the lowercase alphabetic - // characters in the USASCII character set (within Java's internal - // Unicode UTF-16 representation). - // - // Additionally defaults to an initial value of "a". - public AlphabeticIDGenerator() throws IllegalArgumentException { - - this(DEFAULT_START_CHAR, DEFAULT_END_CHAR, DEFAULT_INITIAL_VALUE); - - } - - // Constructor using defaults for character sequence. - // - // If no start and end characters are provided for the alphabetic character - // sequence, default to an 'a-z' sequence, representing the lowercase alphabetic - // characters in the USASCII character set (within Java's internal - // Unicode UTF-16 representation). - public AlphabeticIDGenerator(String initial) throws IllegalArgumentException { - - this(DEFAULT_START_CHAR, DEFAULT_END_CHAR, initial); - - } - - // Constructor. - public AlphabeticIDGenerator(String sequenceStart, String sequenceEnd, String initial) - throws IllegalArgumentException { - - // Validate and store the start character in the character sequence. - - if (sequenceStart == null || sequenceStart.equals("")) { - throw new IllegalArgumentException( - "Start character in the character sequence must not be null or empty"); - } - - if (sequenceStart.length() == 1) { - this.startChar = sequenceStart.charAt(0); - } else if (false) { - // Handle representations of Unicode code points here - } else { - throw new IllegalArgumentException( - "Start character must be one character in length"); - // "Start character must be one character in length or a Unicode value such as '\u0000'"); - } - - // Validate and store the end character in the character sequence. - - if (sequenceEnd == null || sequenceEnd.equals("")) { - throw new IllegalArgumentException( - "End character in the character sequence must not be null or empty"); - } - - if (sequenceEnd.length() == 1) { - this.endChar = sequenceEnd.charAt(0); - } else if (false) { - // Handle representations of Unicode code points here - } else { - throw new IllegalArgumentException( - "End character must be one character in length"); - // "End character must be one character in length or a Unicode value such as '\u0000'"); - } - - if (this.endChar <= this.startChar) { - throw new IllegalArgumentException( - "End (last) character in the character sequence must be greater than the start character"); - } - - // Validate and store the initial value of this identifier. - - if (initial == null || initial.equals("")) { - throw new IllegalArgumentException("Initial value must not be null or empty"); - } - - // @TODO: Add a check for maximum length of the initial value here. - - // Store the chars in the initial value as Characters in a Vector, - // validating each character to identify whether it falls within - // the provided sequence. - // - // (Since we're performing casts from char to Character, we can't just - // use Arrays.asList() to copy the initial array to a Vector.) - char[] chars = initial.toCharArray(); - char ch; - for (int i = 0; i < chars.length; i++) { - - // If the character falls within the provided sequence, copy it to the Vector. - ch = chars[i]; - if (ch >= this.startChar && ch <= this.endChar) { - this.initialValue.add(new Character(ch)); - // Otherwise, we've detected a character not in the sequence. - } else { - throw new IllegalArgumentException("character " + "\'" + ch + "\'" + " is not valid"); - } - - } - - // Initialize the current value from the initial value. - this.currentValue = new Vector(this.initialValue); - - } - - // Returns the initial value. - public synchronized String getInitialID() { - return getIDString(this.initialValue); - } - - // Returns the current value. - public synchronized String getCurrentID() { - return getIDString(this.currentValue); - } - - // Sets the current value. - public synchronized void setCurrentID(String value) throws IllegalArgumentException { - - // @TODO Much of this code is copied from the main constructor, - // and may be ripe for refactoring. - - if (value == null || value.equals("")) { - throw new IllegalArgumentException("Initial value must not be null or empty"); - } - - // @TODO: Add a check for maximum length of the value here. - - // Store the chars in the value as Characters in a Vector, - // validating each character to identify whether it falls within - // the provided sequence. - // - // (Since we're performing casts from char to Character, we can't just - // use Arrays.asList() to copy the initial array to a Vector.) - char[] chars = value.toCharArray(); - char ch; - Vector v = new Vector(); - for (int i = 0; i < chars.length; i++) { - - // If the character falls within the range bounded by the start and end - // characters, copy it to the Vector. - ch = chars[i]; - if (ch >= this.startChar && ch <= this.endChar) { - v.add(new Character(ch)); - // Otherwise, we've detected a character not in the sequence. - } else { - throw new IllegalArgumentException("character " + "\'" + ch + "\'" + " is not valid"); - } - - } - - // Set the current value. - this.currentValue = new Vector(v); - - } - - // Reset the current value to the initial value. - public synchronized void resetID() { - Collections.copy(this.currentValue, this.initialValue); - } - - - // Returns the next alphabetic ID in the sequence. - // - // Currently, the number of characters auto-expands as the - // value of the most significant character rolls over. - // E.g. a call to getNextID(), where the current ID is "z", - // auto-expands to "aa", and "ZZ" auto-expands to "AAA". - // - // See the TODOs at the top of this class for additional - // functionality that needs to be implemented. - public synchronized String nextID() { - - // Get next values for each character, from right to left - // (least significant to most significant). - boolean expandIdentifier = false; - int size = this.currentValue.size(); - char ch; - for (int i = (size - 1); i >= 0; i--) { - - ch = this.currentValue.get(i).charValue(); - - // When we reach the maximum value for any character, - // 'roll over' to the minimum value in our character range. - if (ch == this.endChar) { - this.currentValue.set(i, Character.valueOf(this.startChar)); - // If this rollover occurs in the most significant value, - // set a flag to later expand the size of the identifier. - // - // @TODO: Set another flag to enable or disable this behavior, - // as well as a mechanism for setting the maximum expansion permitted. - if (i == 0) { - expandIdentifier = true; - } - // When we reach the most significant character whose value - // doesn't roll over, increment that character and exit the loop. - } else { - ch++; - this.currentValue.set(i, Character.valueOf(ch)); - i = -1; - break; - } - - } - - // If we are expanding the size of the identifier, insert a new - // value at the most significant (leftmost) character position, - // sliding other values to the right. - if (expandIdentifier) { - this.currentValue.add(0, Character.valueOf(this.startChar)); - } - - return getIDString(this.currentValue); - - } - - // Returns a String representation of the ID, by appending - // the String values of each character. - public synchronized String getIDString(Vector v) { - StringBuffer sb = new StringBuffer(); - for ( Character ch : v ) { - sb.append(ch.toString()); - } - return sb.toString(); - } - - public synchronized boolean isValidID(String value) throws IllegalArgumentException { - - if ( value == null || value == "") { - throw new IllegalArgumentException("ID to validate must not be null or empty"); - } - - Pattern pattern = Pattern.compile(getRegex()); - Matcher matcher = pattern.matcher(value); - if (matcher.matches()) { - return true; - } else { - return false; - } - - } - - public synchronized String getRegex() { - // @TODO: May need to constrain the number of alphabetic characters based - // on a maximum value, TBA. Currently, this regex simply matches sequences - // of one or more characters. - String regex = - "(" + "[" + - String.valueOf(this.startChar) + "-" + String.valueOf(this.endChar) + - "]+" + ")"; - return regex; - } -} diff --git a/sandbox/aron/id/src/main/java/org/collectionspace/services/id/AlphabeticIDPart.java b/sandbox/aron/id/src/main/java/org/collectionspace/services/id/AlphabeticIDPart.java deleted file mode 100644 index 61cd834bc..000000000 --- a/sandbox/aron/id/src/main/java/org/collectionspace/services/id/AlphabeticIDPart.java +++ /dev/null @@ -1,37 +0,0 @@ - /* - * AlphabeticIDPart - * - * Models a part of an identifier (ID) whose values are an alphabetic series. - * - * Copyright 2009 Regents of the University of California - * - * Licensed under the Educational Community License (ECL), Version 2.0. - * You may not use this file except in compliance with this License. - * - * You may obtain a copy of the ECL 2.0 License at - * https://source.collectionspace.org/collection-space/LICENSE.txt - * - * @author $Author: aron $ - * @version $Revision: 267 $ - * $Date: 2009-06-19 19:03:38 -0700 (Fri, 19 Jun 2009) $ - */ - -// @TODO: Add Javadoc comments - -package org.collectionspace.services.id; - -public class AlphabeticIDPart extends IDPart { - - public AlphabeticIDPart() { - super(new AlphabeticIDGenerator()); - }; - - public AlphabeticIDPart(String baseVal) { - super(new AlphabeticIDGenerator(baseVal)); - }; - - public AlphabeticIDPart(String startVal, String endVal, String baseVal) { - super(new AlphabeticIDGenerator(startVal, endVal, baseVal)); - }; - -} diff --git a/sandbox/aron/id/src/main/java/org/collectionspace/services/id/IDGenerator.java b/sandbox/aron/id/src/main/java/org/collectionspace/services/id/IDGenerator.java deleted file mode 100644 index 0963894ee..000000000 --- a/sandbox/aron/id/src/main/java/org/collectionspace/services/id/IDGenerator.java +++ /dev/null @@ -1,50 +0,0 @@ - /* - * IDGenerator - * - * Interface for a generator class that returns IDs. - * - * Copyright 2009 Regents of the University of California - * - * Licensed under the Educational Community License (ECL), Version 2.0. - * You may not use this file except in compliance with this License. - * - * You may obtain a copy of the ECL 2.0 License at - * https://source.collectionspace.org/collection-space/LICENSE.txt - * - * @author $Author: aron $ - * @version $Revision: 267 $ - * $Date: 2009-06-19 19:03:38 -0700 (Fri, 19 Jun 2009) $ - */ - -// @TODO: Consider making this class, or a class that implements -// this interface, abstract, in part because we're duplicating code -// in isValidID() in multiple Generator subclasses. - -package org.collectionspace.services.id; - -public interface IDGenerator { - - // Returns the initial value of the ID. - public String getInitialID(); - - // Gets the current value of an ID. - public String getCurrentID(); - - // Sets the current value of an ID. - public void setCurrentID(String value); - - // Resets an ID to its initial value. - public void resetID(); - - // Returns the next ID in the sequence, and sets - // the current value to that ID. - public String nextID(); - - // Validates an ID against a pattern of generated IDs. - public boolean isValidID(String value); - - // Returns a String representation of the regular expression ("regex") - // pattern used to validate instance values of generated IDs. - public String getRegex(); - -} diff --git a/sandbox/aron/id/src/main/java/org/collectionspace/services/id/IDPart.java b/sandbox/aron/id/src/main/java/org/collectionspace/services/id/IDPart.java deleted file mode 100644 index a108c33d8..000000000 --- a/sandbox/aron/id/src/main/java/org/collectionspace/services/id/IDPart.java +++ /dev/null @@ -1,85 +0,0 @@ - /* - * IDPart - * - *

Models a part of an identifier (ID).

- * - *

Some representative examples of data that can be - * managed within IDParts include:

- * - *
    - *
  • Incrementing numeric or alphabetic values
  • - *
  • Date values
  • - *
  • Static separators
  • - *
- * - * Copyright 2009 Regents of the University of California - * - * Licensed under the Educational Community License (ECL), Version 2.0. - * You may not use this file except in compliance with this License. - * - * You may obtain a copy of the ECL 2.0 License at - * https://source.collectionspace.org/collection-space/LICENSE.txt - * - * @author $Author$ - * @version $Revision$ - * $Date$ - */ - -// @TODO: Add Javadoc comments - -package org.collectionspace.services.id; - -public abstract class IDPart { - - // A generator for the types of IDs that are generated by this part. - // This generator is passed in at construction time. - protected IDGenerator generator; - - // Constructor - public IDPart(IDGenerator idGenerator) throws IllegalArgumentException { - this.generator = idGenerator; - } - - // Returns the initial value of the ID associated with this IDPart. - public synchronized String getInitialID() { - return generator.getInitialID(); - } - - // Returns the current value of the ID associated with this IDPart. - public synchronized String getCurrentID() { - return generator.getCurrentID(); - } - - // Sets the current value of the ID associated with this IDPart. - public synchronized void setCurrentID(String value) { - generator.setCurrentID(value); - } - - // Resets the ID associated with this IDPart to its initial value. - public synchronized void resetID() { - generator.resetID(); - } - - // Returns the next ID in the sequence, and sets the current value - // of the ID associated with this IDPart to that next ID. - public synchronized String nextID() throws IllegalStateException { - return generator.nextID(); - } - - // Validates a supplied ID against the pattern of this IDPart. - // - // Some IDParts may offer generic validation, - // while others may offer per-instance valiadation - // based on the values, series, etc. that are - // stored within those parts. - public synchronized boolean isValidID(String value) throws IllegalArgumentException { - return generator.isValidID(value); - } - - // Returns a String representation of the regular expression ("regex") - // pattern used to validate instance values of this IDPart. - public synchronized String getRegex() { - return generator.getRegex(); - } - -} diff --git a/sandbox/aron/id/src/main/java/org/collectionspace/services/id/IDPattern.java b/sandbox/aron/id/src/main/java/org/collectionspace/services/id/IDPattern.java deleted file mode 100644 index 7b848c1e7..000000000 --- a/sandbox/aron/id/src/main/java/org/collectionspace/services/id/IDPattern.java +++ /dev/null @@ -1,261 +0,0 @@ - /* - * IDPattern - * - *

Models an identifier (ID), which consists of multiple IDParts.

- * - * Copyright 2009 Regents of the University of California - * - * Licensed under the Educational Community License (ECL), Version 2.0. - * You may not use this file except in compliance with this License. - * - * You may obtain a copy of the ECL 2.0 License at - * https://source.collectionspace.org/collection-space/LICENSE.txt - * - * @author $Author: aron $ - * @version $Revision: 267 $ - * $Date: 2009-06-19 19:03:38 -0700 (Fri, 19 Jun 2009) $ - */ - -// @TODO: Add Javadoc comments - -// @TODO: Catch Exceptions thrown by IDPart, then -// reflect this in the corresponding IDPatternTest class. - -package org.collectionspace.services.id; - -import java.util.Vector; - -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -public class IDPattern { - - final static int MAX_ID_LENGTH = 50; - - private Vector parts = new Vector(); - - // Constructor - public IDPattern() { - } - - // Constructor - public IDPattern(Vector partsList) { - if (partsList != null) { - this.parts = partsList; - } - } - - public void add(IDPart part) { - if (part != null) { - this.parts.add(part); - } - } - - // Returns the current value of this ID. - public synchronized String getCurrentID() { - StringBuffer sb = new StringBuffer(MAX_ID_LENGTH); - for (IDPart part : this.parts) { - sb.append(part.getCurrentID()); - } - return sb.toString(); - } - - // Returns the current value of this ID, given a - // supplied ID that partly matches the pattern. - // - // If the supplied ID fully matches the pattern, - // will return the supplied ID. - // - // However, if the supplied ID is a partial ID, which - // partly "stem-matches" the pattern but does not - // ully match the pattern, will return the partial ID with - // its next ID component appended. The next ID component - // will be set to its initial value. - // - // Examples: - // * 2009.5." becomes "2009.5.1", in a case where the - // next ID component is an incrementing numeric IDPart. - // * "E55-" becomes "E55-a", where the next ID component - // is an incrementing alphabetic IDPart. - public synchronized String getCurrentID(String value) - throws IllegalArgumentException { - - if (value == null) return value; - - // Try ever-larger stem matches against the supplied value, - // by incrementally appending each part's regex, until no - // (more) matches are found. - // - // In so doing, build a subset of this IDPattern's regex - // that fully matches the supplied value. - Pattern pattern = null; - Matcher matcher = null; - int matchedParts = 0; - StringBuffer regexToTry = new StringBuffer(); - StringBuffer regex = new StringBuffer(); - for (IDPart partToTryMatching : this.parts) { - regexToTry.append(partToTryMatching.getRegex()); - pattern = Pattern.compile(regexToTry.toString()); - matcher = pattern.matcher(value); - // If a stem match was found on the current regex, - // store a count of matched IDParts and the regex pattern - // that has matched to this point. - if (matcher.lookingAt()) { - matchedParts++; - regex.append(partToTryMatching.getRegex()); - // Otherwise, exit the loop. - } else { - break; - } - } - - // If the supplied ID doesn't partly match the pattern, - // throw an Exception. - if (matchedParts == 0) { - throw new IllegalArgumentException("Supplied ID does not match this ID pattern."); - } - - pattern = Pattern.compile(regex.toString()); - matcher = pattern.matcher(value); - - // If the supplied ID doesn't match the pattern built above, - // throw an Exception. (This error condition should likely - // never be reached, but it's here as a guard.) - if (! matcher.matches()) { - throw new IllegalArgumentException("Supplied ID does not match this ID pattern."); - } - - // Otherwise, if the supplied ID matches the pattern, - // split the ID into its components and store those - // values in each of the pattern's IDParts. - IDPart currentPart; - for (int i = 1; i <= matchedParts; i++) { - currentPart = this.parts.get(i - 1); - currentPart.setCurrentID(matcher.group(i)); - } - - // Obtain the initial value of the next IDPart, and - // set the current value of that part to its initial value. - // - // If the supplied ID fully matches the pattern, there will - // be no 'next' IDPart, and we must catch that Exception below. - int nextPartNum = matchedParts; - try { - String initial = this.parts.get(nextPartNum).getInitialID(); - this.parts.get(nextPartNum).setCurrentID(initial); - // Increment the number of matched parts to reflect the - // addition of this next IDPart. - matchedParts++; - } catch (ArrayIndexOutOfBoundsException e ) { - // Do nothing here; we simply won't increment - // the number of matched parts, used in the loop below. - } - - // Call the getCurrentID() method on each of the - // supplied IDParts, as well as on the added IDPart - // whose initial value was just obtained, if any. - StringBuffer sb = new StringBuffer(); - for (int i = 1; i <= matchedParts; i++) { - sb.append(this.parts.get(i - 1).getCurrentID()); - } - - return sb.toString(); - - } - - // Returns the next value of this ID, and sets the current value to that ID. - public synchronized String nextID() throws IllegalStateException { - - // Obtain the last (least significant) IDPart, - // and call its nextID() method, which will - // concurrently set the current value of that ID - // to the next ID. - int lastPartNum = this.parts.size() - 1; - this.parts.get(lastPartNum).nextID(); - - // Then call the getCurrentID() method on all of the IDParts - StringBuffer sb = new StringBuffer(MAX_ID_LENGTH); - for (IDPart part : this.parts) { - sb.append(part.getCurrentID()); - } - - return sb.toString(); - - } - - // Returns the next value of this ID, given a - // supplied ID that entirely matches the pattern, - // and sets the current value to that ID. - public synchronized String nextID(String value) - throws IllegalStateException, IllegalArgumentException { - - if (value == null) { - throw new IllegalArgumentException("Supplied ID cannot be null."); - } - - Pattern pattern = Pattern.compile(getRegex()); - Matcher matcher = pattern.matcher(value); - - // If the supplied ID doesn't entirely match the pattern, - // throw an Exception. - if (! matcher.matches()) { - throw new IllegalArgumentException("Supplied ID does not match this ID pattern."); - } - - // Otherwise, if the supplied ID entirely matches the pattern, - // split the ID into its components and store those values in - // each of the pattern's IDParts. - IDPart currentPart; - for (int i = 1; i <= (matcher.groupCount() - 1); i++) { - currentPart = this.parts.get(i - 1); - currentPart.setCurrentID(matcher.group(i)); - } - - // Obtain the last (least significant) IDPart, - // and call its nextID() method, which will - // concurrently set the current value of that ID - // to the next ID. - // - // @TODO: This code is duplicated in nextID(), above, - // and thus we may want to refactor this. - int lastPartNum = this.parts.size() - 1; - this.parts.get(lastPartNum).nextID(); - - // Then call the getCurrentID() method on all of the IDParts - StringBuffer sb = new StringBuffer(); - for (IDPart part : this.parts) { - sb.append(part.getCurrentID()); - } - - return sb.toString(); - - } - - // Validates a provided ID against the pattern. - // - // @TODO May potentially throw at least one pattern-related exception; - // we'll need to catch and handle this. - public synchronized boolean isValidID(String value) { - - if (value == null) return false; - - Pattern pattern = Pattern.compile(getRegex()); - Matcher matcher = pattern.matcher(value); - if (matcher.matches()) { - return true; - } else { - return false; - } - - } - - // Returns a regular expression to validate this ID. - public synchronized String getRegex() { - StringBuffer sb = new StringBuffer(); - for (IDPart part : this.parts) { - sb.append(part.getRegex()); - } - return sb.toString(); - } - -} diff --git a/sandbox/aron/id/src/main/java/org/collectionspace/services/id/NumericIDGenerator.java b/sandbox/aron/id/src/main/java/org/collectionspace/services/id/NumericIDGenerator.java deleted file mode 100644 index 4d4f7206b..000000000 --- a/sandbox/aron/id/src/main/java/org/collectionspace/services/id/NumericIDGenerator.java +++ /dev/null @@ -1,139 +0,0 @@ -/* - * NumericIDGenerator - * - *

An identifier generator that generates an incrementing ID as a - * series of numeric values, beginning from an initial value.

- * - * Copyright 2009 Regents of the University of California - * - * Licensed under the Educational Community License (ECL), Version 2.0. - * You may not use this file except in compliance with this License. - * - * You may obtain a copy of the ECL 2.0 License at - * https://source.collectionspace.org/collection-space/LICENSE.txt - * - * @author $Author: aron $ - * @version $Revision: 267 $ - * $Date: 2009-06-19 19:03:38 -0700 (Fri, 19 Jun 2009) $ - */ - -// @TODO: Add Javadoc comments - -// @TODO: Need to set and enforce maximum value. - -package org.collectionspace.services.id; - -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -public class NumericIDGenerator implements IDGenerator { - - final static private int DEFAULT_MAX_LENGTH = 6; - private int maxLength = DEFAULT_MAX_LENGTH; - - final static private int DEFAULT_INITIAL_VALUE = 1; - private long initialValue = DEFAULT_INITIAL_VALUE; - private long currentValue = DEFAULT_INITIAL_VALUE; - - // Constructor using defaults for initial value and maximum length. - public NumericIDGenerator() throws IllegalArgumentException { - this(Integer.toString(DEFAULT_INITIAL_VALUE), Integer.toString(DEFAULT_MAX_LENGTH)); - } - - // Constructor using default maximum length. - public NumericIDGenerator(String initialValue) throws IllegalArgumentException { - this(initialValue, Integer.toString(DEFAULT_MAX_LENGTH)); - } - - // Constructor. - public NumericIDGenerator(String initialValue, String maxLength) - throws IllegalArgumentException { - - try { - long l = Long.parseLong(initialValue.trim()); - if ( l < 0 ) { - throw new IllegalArgumentException("Initial ID value should be zero (0) or greater"); - } - this.currentValue = l; - this.initialValue = l; - } catch (NullPointerException e) { - throw new IllegalArgumentException("Initial ID value should not be null"); - } catch (NumberFormatException e) { - throw new IllegalArgumentException("Initial ID value must be parseable as a number"); - } - - try { - this.maxLength = Integer.parseInt(maxLength); - } catch (NumberFormatException e) { - throw new IllegalArgumentException("Maximum ID length must be parseable as a number"); - } - - } - - public synchronized String getInitialID() { - return Long.toString(this.initialValue); - } - - public synchronized String getCurrentID() { - return Long.toString(this.currentValue); - } - - // Sets the current value of the ID. - public synchronized void setCurrentID(String value) throws IllegalArgumentException { - - // @TODO Much of this code is copied from the main constructor, - // and may be ripe for refactoring. - try { - long l = Long.parseLong(value.trim()); - if ( l < 0 ) { - throw new IllegalArgumentException("Initial ID value should be zero (0) or greater"); - } - this.currentValue = l; - this.initialValue = l; - } catch (NullPointerException e) { - throw new IllegalArgumentException("ID value should not be null"); - } catch (NumberFormatException e) { - throw new IllegalArgumentException("ID value must be parseable as a number"); - } - - // @TODO An expedient; we may need to check the String length of the - // provided ID and calculate a maximum length here. - this.maxLength = DEFAULT_MAX_LENGTH; - } - - public synchronized void resetID() { - this.currentValue = this.initialValue; - } - - // Returns the next ID in the sequence, and sets the current value to that ID. - public synchronized String nextID() throws IllegalStateException { - this.currentValue++; - String nextID = Long.toString(this.currentValue); - if (nextID.length() > this.maxLength) { - throw new IllegalStateException("Next ID cannot exceed maximum length"); - } - return nextID; - } - - public synchronized boolean isValidID(String value) { - - if ( value == null || value == "") { - return false; - } - - Pattern pattern = Pattern.compile(getRegex()); - Matcher matcher = pattern.matcher(value); - if (matcher.matches()) { - return true; - } else { - return false; - } - - } - - public synchronized String getRegex() { - String regex = "(" + "\\d" + "{1," + Integer.toString(this.maxLength) + "}" + ")"; - return regex; - } - -} diff --git a/sandbox/aron/id/src/main/java/org/collectionspace/services/id/NumericIDPart.java b/sandbox/aron/id/src/main/java/org/collectionspace/services/id/NumericIDPart.java deleted file mode 100644 index 78977e85f..000000000 --- a/sandbox/aron/id/src/main/java/org/collectionspace/services/id/NumericIDPart.java +++ /dev/null @@ -1,42 +0,0 @@ - /* - * NumericIDPart - * - * Models a part of an identifier (ID) whose values come from an - * incrementing numeric series, with those values represented as - * String objects. - * - * Copyright 2009 Regents of the University of California - * - * Licensed under the Educational Community License (ECL), Version 2.0. - * You may not use this file except in compliance with this License. - * - * You may obtain a copy of the ECL 2.0 License at - * https://source.collectionspace.org/collection-space/LICENSE.txt - * - * @author $Author: aron $ - * @version $Revision: 267 $ - * $Date: 2009-06-19 19:03:38 -0700 (Fri, 19 Jun 2009) $ - */ - -// @TODO: Add Javadoc comments - -package org.collectionspace.services.id; - -public class NumericIDPart extends IDPart { - - public NumericIDPart() throws IllegalArgumentException { - super(new NumericIDGenerator()); - }; - - // Store the appropriate Numeric ID generator and the base value for this part. - public NumericIDPart(String baseVal) throws IllegalArgumentException { - super(new NumericIDGenerator(baseVal)); - }; - - // Store the appropriate Numeric ID generator, and the base value - // and maximum length for this part. - public NumericIDPart(String baseVal, String maxLength) throws IllegalArgumentException { - super(new NumericIDGenerator(baseVal, maxLength)); - }; - -} diff --git a/sandbox/aron/id/src/main/java/org/collectionspace/services/id/StringIDGenerator.java b/sandbox/aron/id/src/main/java/org/collectionspace/services/id/StringIDGenerator.java deleted file mode 100644 index e2c2a391e..000000000 --- a/sandbox/aron/id/src/main/java/org/collectionspace/services/id/StringIDGenerator.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * StringIDGenerator - * - *

An identifier generator that stores and returns a static String.

- * - * Copyright 2009 Regents of the University of California - * - * Licensed under the Educational Community License (ECL), Version 2.0. - * You may not use this file except in compliance with this License. - * - * You may obtain a copy of the ECL 2.0 License at - * https://source.collectionspace.org/collection-space/LICENSE.txt - * - * @author $Author: aron $ - * @version $Revision: 267 $ - * $Date: 2009-06-19 19:03:38 -0700 (Fri, 19 Jun 2009) $ - */ - -// @TODO: Add Javadoc comments - -// @TODO: Need to set and enforce maximum String length. - -package org.collectionspace.services.id; - -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import java.util.regex.PatternSyntaxException; - -public class StringIDGenerator implements IDGenerator { - - private String initialValue = null; - private String currentValue = null; - - public StringIDGenerator(String initialValue) throws IllegalArgumentException { - - if ( initialValue == null || initialValue == "") { - throw new IllegalArgumentException("Initial ID value must not be null or empty"); - } - - this.initialValue = initialValue; - this.currentValue = initialValue; - - } - - public synchronized String getInitialID() { - return this.initialValue; - } - - public synchronized String getCurrentID() { - return this.currentValue; - } - - public synchronized void setCurrentID(String value) throws IllegalArgumentException { - if ( initialValue == null || initialValue == "") { - throw new IllegalArgumentException("ID value must not be null or empty"); - } - this.currentValue = value; - } - - public synchronized void resetID() { - // Do nothing - } - - public synchronized String nextID() { - return this.currentValue; - } - - public synchronized boolean isValidID(String value) throws IllegalArgumentException { - - if ( value == null || value == "") { - throw new IllegalArgumentException("ID to validate must not be null or empty"); - } - - Pattern pattern = Pattern.compile(getRegex()); - Matcher matcher = pattern.matcher(value); - if (matcher.matches()) { - return true; - } else { - return false; - } - - } - - public synchronized String getRegex() { - - String initial = this.initialValue; - - // Escape or otherwise modify various characters that have - // significance in regular expressions. - // - // @TODO Test these thoroughly, add processing of more - // special characters as needed. - - // Escape un-escaped period/full stop characters. - Pattern pattern = Pattern.compile("([^\\\\]{0,1})\\."); - Matcher matcher = pattern.matcher(initial); - String escapedInitial = matcher.replaceAll("$1\\\\."); - - String regex = "(" + escapedInitial + ")"; - return regex; - } - -} diff --git a/sandbox/aron/id/src/main/java/org/collectionspace/services/id/StringIDPart.java b/sandbox/aron/id/src/main/java/org/collectionspace/services/id/StringIDPart.java deleted file mode 100644 index 16ae17420..000000000 --- a/sandbox/aron/id/src/main/java/org/collectionspace/services/id/StringIDPart.java +++ /dev/null @@ -1,29 +0,0 @@ - /* - * StringIDGenerator - * - * Models a part of an identifier (ID) whose values are an alphabetic series. - * - * Copyright 2009 Regents of the University of California - * - * Licensed under the Educational Community License (ECL), Version 2.0. - * You may not use this file except in compliance with this License. - * - * You may obtain a copy of the ECL 2.0 License at - * https://source.collectionspace.org/collection-space/LICENSE.txt - * - * @author $Author: aron $ - * @version $Revision: 267 $ - * $Date: 2009-06-19 19:03:38 -0700 (Fri, 19 Jun 2009) $ - */ - -// @TODO: Add Javadoc comments - -package org.collectionspace.services.id; - -public class StringIDPart extends IDPart { - - public StringIDPart(String baseVal) { - super(new StringIDGenerator(baseVal)); - }; - -} diff --git a/sandbox/aron/id/src/main/java/org/collectionspace/services/id/YearIDGenerator.java b/sandbox/aron/id/src/main/java/org/collectionspace/services/id/YearIDGenerator.java deleted file mode 100644 index 915783511..000000000 --- a/sandbox/aron/id/src/main/java/org/collectionspace/services/id/YearIDGenerator.java +++ /dev/null @@ -1,141 +0,0 @@ -/* - * YearIDGenerator - * - *

An identifier generator that stores and returns the current year - * as a String object.

- * - * Copyright 2009 Regents of the University of California - * - * Licensed under the Educational Community License (ECL), Version 2.0. - * You may not use this file except in compliance with this License. - * - * You may obtain a copy of the ECL 2.0 License at - * https://source.collectionspace.org/collection-space/LICENSE.txt - * - * @author $Author: aron $ - * @version $Revision: 267 $ - * $Date: 2009-06-19 19:03:38 -0700 (Fri, 19 Jun 2009) $ - */ - -// @TODO: Add Javadoc comments - -// @TODO: Need to understand and reflect time zone issues; -// what happens when a year rollover occurs: -// - In the time zone of the end user. -// - In the time zone of the museum or other institution. -// - In the time zone of the physical server where the code is hosted. - -// NOTE: This class currently hard-codes the assumption that the -// Gregorian Calendar system is in use. -// -// We may wish to use the Joda-Time framework if handling of -// additional calendar systems is needed, or additional treatment -// of time zones is warranted: -// http://joda-time.sourceforge.net/ -// -// There may also be a need to have a structured set of date-time -// classes related to identifier generation. - -package org.collectionspace.services.id; - -import java.util.Calendar; -import java.util.GregorianCalendar; - -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -public class YearIDGenerator implements IDGenerator { - - private String initialValue = null; - private String currentValue = null; - - public YearIDGenerator() throws IllegalArgumentException { - - String currentYear = getCurrentYear(); - this.initialValue = currentYear; - this.currentValue = currentYear; - - } - - public YearIDGenerator(String initialValue) throws IllegalArgumentException { - - if ( initialValue == null || initialValue == "") { - throw new IllegalArgumentException("Initial ID value must not be null or empty"); - } - - // @TODO: Add regex-based validation here, by calling isValidID(). - // Consider implications for Internationalization when doing so. - - this.initialValue = initialValue; - this.currentValue = initialValue; - - } - - public synchronized String getInitialID() { - return this.initialValue; - } - - public synchronized String getCurrentID() { - return this.currentValue; - } - - // Sets the current value. - public synchronized void setCurrentID(String value) throws IllegalArgumentException { - - // @TODO This code is copied from the main constructor, - // and thus there may be an opportunity for refactoring. - - if ( value == null || value == "") { - throw new IllegalArgumentException("ID value must not be null or empty"); - } - - // @TODO: Add regex-based validation here, by calling isValidID(). - // Consider implications for Internationalization when doing so. - - this.currentValue = value; - - } - - public synchronized void resetID() { - this.currentValue = this.initialValue; - } - - // @TODO: We'll need to decide what a "next" ID means in the context of: - // - An initially supplied value. - // - A year value that has not changed from its previous value. - // - A year value that has changed, as a result of a rollover - // to a new instant in time. - public synchronized String nextID() { - return this.currentValue; - } - - public String getCurrentYear() { - Calendar cal = GregorianCalendar.getInstance(); - int y = cal.get(Calendar.YEAR); - return Integer.toString(y); - } - - public synchronized boolean isValidID(String value) throws IllegalArgumentException { - - if ( value == null || value == "") { - throw new IllegalArgumentException("ID to validate must not be null or empty"); - } - - Pattern pattern = Pattern.compile(getRegex()); - Matcher matcher = pattern.matcher(value); - if (matcher.matches()) { - return true; - } else { - return false; - } - - } - - public synchronized String getRegex() { - // NOTE: Currently hard-coded to accept only a range of - // four-digit Gregorian Calendar year dates. - String regex = "(\\d{4})"; - return regex; - } - -} diff --git a/sandbox/aron/id/src/main/java/org/collectionspace/services/id/YearIDPart.java b/sandbox/aron/id/src/main/java/org/collectionspace/services/id/YearIDPart.java deleted file mode 100644 index f0d7ede9d..000000000 --- a/sandbox/aron/id/src/main/java/org/collectionspace/services/id/YearIDPart.java +++ /dev/null @@ -1,34 +0,0 @@ - /* - * YearIDGenerator - * - * Models a part of an identifier (ID) whose value is the current year - * or a supplied year. - * - * Copyright 2009 Regents of the University of California - * - * Licensed under the Educational Community License (ECL), Version 2.0. - * You may not use this file except in compliance with this License. - * - * You may obtain a copy of the ECL 2.0 License at - * https://source.collectionspace.org/collection-space/LICENSE.txt - * - * @author $Author: aron $ - * @version $Revision: 267 $ - * $Date: 2009-06-19 19:03:38 -0700 (Fri, 19 Jun 2009) $ - */ - -// @TODO: Add Javadoc comments - -package org.collectionspace.services.id; - -public class YearIDPart extends IDPart { - - public YearIDPart() { - super(new YearIDGenerator()); - }; - - public YearIDPart(String baseVal) { - super(new YearIDGenerator(baseVal)); - }; - -} diff --git a/sandbox/aron/id/src/test/java/org/collectionspace/services/id/AlphabeticIDPartTest.java b/sandbox/aron/id/src/test/java/org/collectionspace/services/id/AlphabeticIDPartTest.java deleted file mode 100644 index 5b85ad55a..000000000 --- a/sandbox/aron/id/src/test/java/org/collectionspace/services/id/AlphabeticIDPartTest.java +++ /dev/null @@ -1,248 +0,0 @@ -/* - * AlphabeticIDPartTest - * - * Test class for AlphabeticIDPart. - * - * Copyright 2009 Regents of the University of California - * - * Licensed under the Educational Community License (ECL), Version 2.0. - * You may not use this file except in compliance with this License. - * - * You may obtain a copy of the ECL 2.0 License at - * https://source.collectionspace.org/collection-space/LICENSE.txt - * - * @author $Author: aron $ - * @version $Revision: 267 $ - * $Date: 2009-06-19 19:03:38 -0700 (Fri, 19 Jun 2009) $ - */ - -package org.collectionspace.services.id; - -import static org.junit.Assert.fail; -import junit.framework.TestCase; - -public class AlphabeticIDPartTest extends TestCase { - - IDPart part; - - public void testnextIDLowercase() { - - part = new AlphabeticIDPart("a"); - assertEquals("b", part.nextID()); - assertEquals("c", part.nextID()); - - part = new AlphabeticIDPart("x"); - assertEquals("y", part.nextID()); - assertEquals("z", part.nextID()); - -} - - public void testnextIDLowercase2Chars() { - - part = new AlphabeticIDPart("aa"); - assertEquals("ab", part.nextID()); - assertEquals("ac", part.nextID()); - - part = new AlphabeticIDPart("zx"); - assertEquals("zy", part.nextID()); - assertEquals("zz", part.nextID()); - - } - - public void testnextIDLowercase2CharsRolloverFirst() { - - part = new AlphabeticIDPart("ay"); - assertEquals("az", part.nextID()); - assertEquals("ba", part.nextID()); - assertEquals("bb", part.nextID()); - - } - - public void testnextIDUppercase() { - - part = new AlphabeticIDPart("A", "Z", "A"); - assertEquals("B", part.nextID()); - assertEquals("C", part.nextID()); - - part = new AlphabeticIDPart("A", "Z", "X"); - assertEquals("Y", part.nextID()); - assertEquals("Z", part.nextID()); - -} - - public void testnextIDUppercase2Chars() { - - part = new AlphabeticIDPart("A", "Z", "AA"); - assertEquals("AB", part.nextID()); - assertEquals("AC", part.nextID()); - - part = new AlphabeticIDPart("A", "Z", "ZX"); - assertEquals("ZY", part.nextID()); - assertEquals("ZZ", part.nextID()); - - } - - public void testnextIDUppercase2CharsRolloverFirst() { - - part = new AlphabeticIDPart("A", "Z", "AY"); - assertEquals("AZ", part.nextID()); - assertEquals("BA", part.nextID()); - assertEquals("BB", part.nextID()); - - } - - public void testresetIDLowercase() { - - part = new AlphabeticIDPart("zx"); - assertEquals("zy", part.nextID()); - assertEquals("zz", part.nextID()); - part.resetID(); - assertEquals("zx", part.getCurrentID()); - - } - - public void testresetIDUppercase() { - - part = new AlphabeticIDPart("A", "Z", "RA"); - assertEquals("RB", part.nextID()); - assertEquals("RC", part.nextID()); - part.resetID(); - assertEquals("RB", part.nextID()); - - } - - public void testInitialLowercase() { - - part = new AlphabeticIDPart("aaa"); - assertEquals("aaa", part.getInitialID()); - - } - - public void testInitialUppercase() { - - part = new AlphabeticIDPart("A", "Z", "AZ"); - assertEquals("AZ", part.getInitialID()); - - } - - public void testCurrentLowercase() { - - part = new AlphabeticIDPart("aaa"); - assertEquals("aaa", part.getCurrentID()); - assertEquals("aab", part.nextID()); - assertEquals("aac", part.nextID()); - assertEquals("aac", part.getCurrentID()); - assertEquals("aad", part.nextID()); - - } - - public void testCurrentUppercase() { - - part = new AlphabeticIDPart("A", "Z", "A"); - assertEquals("A", part.getCurrentID()); - assertEquals("B", part.nextID()); - assertEquals("C", part.nextID()); - assertEquals("C", part.getCurrentID()); - assertEquals("D", part.nextID()); - - } - - public void testOverflowLowercase() { - - part = new AlphabeticIDPart("zx"); - assertEquals("zy", part.nextID()); - assertEquals("zz", part.nextID()); - assertEquals("aaa", part.nextID()); - - } - - public void testOverflowUppercase() { - - part = new AlphabeticIDPart("A", "Z", "X"); - assertEquals("Y", part.nextID()); - assertEquals("Z", part.nextID()); - assertEquals("AA", part.nextID()); - - } - - public void testNonAlphabeticInitialValue() { - try { - part = new AlphabeticIDPart("&*432"); - fail("Should have thrown IllegalArgumentException here"); - } catch (IllegalArgumentException expected) { - // This Exception should be thrown, and thus the test should pass. - } - } - - public void testNullInitialValue() { - try { - part = new AlphabeticIDPart(null); - fail("Should have thrown IllegalArgumentException here"); - } catch (IllegalArgumentException expected) { - // This Exception should be thrown, and thus the test should pass. - } - } - - public void testEmptyStringInitialValue() { - try { - part = new AlphabeticIDPart(""); - fail("Should have thrown IllegalArgumentException here"); - } catch (IllegalArgumentException expected) { - // This Exception should be thrown, and thus the test should pass. - } - } - - public void testAllSpaceCharsInitialValue() { - try { - part = new AlphabeticIDPart(" "); - fail("Should have thrown IllegalArgumentException here"); - } catch (IllegalArgumentException expected) { - // This Exception should be thrown, and thus the test should pass. - } - } - - public void testIsValidIDDefaultSeries() { - - part = new AlphabeticIDPart(); - - assertTrue(part.isValidID("a")); - assertTrue(part.isValidID("z")); - - assertFalse(part.isValidID("A")); - assertFalse(part.isValidID("123")); - - } - - public void testIsValidIDConstrainedLowerCaseSeries() { - - part = new AlphabeticIDPart("a", "f", "a"); - - assertTrue(part.isValidID("a")); - assertTrue(part.isValidID("b")); - assertTrue(part.isValidID("f")); - - assertFalse(part.isValidID("g")); - assertFalse(part.isValidID("z")); - assertFalse(part.isValidID("A")); - assertFalse(part.isValidID("123")); - - } - - public void testIsValidIDConstrainedUppercaseSeries() { - - part = new AlphabeticIDPart("A", "F", "A"); - - assertTrue(part.isValidID("A")); - assertTrue(part.isValidID("B")); - assertTrue(part.isValidID("F")); - - assertFalse(part.isValidID("G")); - assertFalse(part.isValidID("Z")); - assertFalse(part.isValidID("a")); - assertFalse(part.isValidID("123")); - - } - - // @TODO: Add more tests of boundary conditions, exceptions ... - -} diff --git a/sandbox/aron/id/src/test/java/org/collectionspace/services/id/IDPatternTest.java b/sandbox/aron/id/src/test/java/org/collectionspace/services/id/IDPatternTest.java deleted file mode 100644 index e89653522..000000000 --- a/sandbox/aron/id/src/test/java/org/collectionspace/services/id/IDPatternTest.java +++ /dev/null @@ -1,250 +0,0 @@ -/* - * IDPatternTest - * - * Test class for IDPattern. - * - * Copyright 2009 Regents of the University of California - * - * Licensed under the Educational Community License (ECL), Version 2.0. - * You may not use this file except in compliance with this License. - * - * You may obtain a copy of the ECL 2.0 License at - * https://source.collectionspace.org/collection-space/LICENSE.txt - * - * @author $Author: aron $ - * @version $Revision: 267 $ - * $Date: 2009-06-19 19:03:38 -0700 (Fri, 19 Jun 2009) $ - */ - -package org.collectionspace.services.id; - -import static org.junit.Assert.fail; -import java.util.Vector; -import junit.framework.TestCase; - -public class IDPatternTest extends TestCase { - - IDPattern pattern; - IDPart part; - - // Note: tests may fail with IllegalArgumentException - // if any initialization of new IDParts fails - // due to invalid arguments passed to their constructors. - - public void testCurrentIDViaVector() { - - Vector parts = new Vector(); - parts.add(new YearIDPart("2009")); - parts.add(new StringIDPart(".")); - parts.add(new NumericIDPart("1")); - parts.add(new StringIDPart("-")); - parts.add(new AlphabeticIDPart("a")); - pattern = new IDPattern(parts); - assertEquals("2009.1-a", pattern.getCurrentID()); - - } - - public void testCurrentIDViaAdd() { - - pattern = new IDPattern(); - pattern.add(new YearIDPart("2009")); - pattern.add(new StringIDPart(".")); - pattern.add(new NumericIDPart("1")); - pattern.add(new StringIDPart("-")); - pattern.add(new AlphabeticIDPart("a")); - assertEquals("2009.1-a", pattern.getCurrentID()); - - } - - public void testCurrentIDWithPartialSuppliedID() { - - // @TODO: Temporary for testing: ascertain regex patterns - - pattern = new IDPattern(); - pattern.add(new StringIDPart("E")); - pattern.add(new NumericIDPart("1")); - assertEquals("E1", pattern.getCurrentID("E")); - assertEquals("E2", pattern.nextID()); - - pattern = new IDPattern(); - pattern.add(new YearIDPart()); - pattern.add(new StringIDPart(".")); - assertEquals("2009.", pattern.getCurrentID("2009")); - assertEquals("2009.", pattern.nextID()); - assertEquals("2010.", pattern.getCurrentID("2010")); - assertEquals("2010.", pattern.nextID()); - - pattern = new IDPattern(); - pattern.add(new YearIDPart()); - pattern.add(new StringIDPart(".")); - pattern.add(new NumericIDPart("1")); - assertEquals("2009.1", pattern.getCurrentID("2009.")); - assertEquals("2009.2", pattern.nextID()); - - pattern = new IDPattern(); - pattern.add(new YearIDPart()); - pattern.add(new StringIDPart(".")); - pattern.add(new NumericIDPart("55")); - assertEquals("2010.55", pattern.getCurrentID("2010.")); - assertEquals("2010.56", pattern.nextID()); - - pattern = new IDPattern(); - pattern.add(new YearIDPart("2009")); - pattern.add(new StringIDPart(".")); - pattern.add(new NumericIDPart()); - assertEquals("2009.1", pattern.getCurrentID("2009.")); - assertEquals("2009.2", pattern.nextID()); - // Test a repeat of the last two operations. - assertEquals("2009.1", pattern.getCurrentID("2009.")); - assertEquals("2009.2", pattern.nextID()); - - pattern = new IDPattern(); - pattern.add(new YearIDPart("2009")); - pattern.add(new StringIDPart(".")); - pattern.add(new NumericIDPart("1")); - pattern.add(new StringIDPart("-")); - pattern.add(new AlphabeticIDPart("a")); - assertEquals("2009.1-a", pattern.getCurrentID("2009.1-")); - assertEquals("2009.1-b", pattern.nextID()); - assertEquals("2009.3-a", pattern.getCurrentID("2009.3-")); - - } - - public void testCurrentIDWithFullSuppliedID() { - - pattern = new IDPattern(); - pattern.add(new YearIDPart("2009")); - pattern.add(new StringIDPart(".")); - pattern.add(new NumericIDPart("55")); - assertEquals("2009.55", pattern.getCurrentID("2009.55")); - assertEquals("2009.56", pattern.nextID()); - - pattern = new IDPattern(); - pattern.add(new YearIDPart("2009")); - pattern.add(new StringIDPart(".")); - pattern.add(new NumericIDPart("1")); - pattern.add(new StringIDPart("-")); - pattern.add(new AlphabeticIDPart("a")); - assertEquals("2009.1-a", pattern.getCurrentID("2009.1-a")); - assertEquals("2009.1-b", pattern.nextID()); - - } - - public void testNextID() { - - pattern = new IDPattern(); - pattern.add(new YearIDPart("2009")); - pattern.add(new StringIDPart(".")); - pattern.add(new NumericIDPart("1")); - assertEquals("2009.2", pattern.nextID()); - assertEquals("2009.3", pattern.nextID()); - - pattern = new IDPattern(); - pattern.add(new YearIDPart("2009")); - pattern.add(new StringIDPart(".")); - pattern.add(new NumericIDPart("1")); - pattern.add(new StringIDPart("-")); - pattern.add(new AlphabeticIDPart("a")); - assertEquals("2009.1-b", pattern.nextID()); - assertEquals("2009.1-c", pattern.nextID()); - - pattern = new IDPattern(); - pattern.add(new StringIDPart("T")); - pattern.add(new NumericIDPart("1005")); - assertEquals("T1006", pattern.nextID()); - assertEquals("T1007", pattern.nextID()); - - } - - public void testNextIDWithConstantStringID() { - - pattern = new IDPattern(); - pattern.add(new YearIDPart("2009")); - pattern.add(new StringIDPart(".")); - pattern.add(new NumericIDPart("1")); - pattern.add(new StringIDPart("-")); - assertEquals("2009.1-", pattern.nextID()); - assertEquals("2009.1-", pattern.nextID()); - - } - - public void testNextIDWithSuppliedID() { - - pattern = new IDPattern(); - pattern.add(new YearIDPart("2009")); - pattern.add(new StringIDPart(".")); - pattern.add(new NumericIDPart("1")); - assertEquals("2009.2", pattern.nextID("2009.1")); - assertEquals("2009.3", pattern.nextID("2009.2")); - - pattern = new IDPattern(); - pattern.add(new YearIDPart("2009")); - pattern.add(new StringIDPart(".")); - pattern.add(new NumericIDPart("1")); - pattern.add(new StringIDPart("-")); - pattern.add(new AlphabeticIDPart("a")); - assertEquals("2009.1-b", pattern.nextID("2009.1-a")); - assertEquals("2009.3-c", pattern.nextID("2009.3-b")); - - } - - public void testEmptyPartsListCurrentID() { - - pattern = new IDPattern(); - assertEquals("", pattern.getCurrentID()); - - } - - public void testIsValidIDYearPattern() { - - pattern = new IDPattern(); - pattern.add(new YearIDPart("2009")); - - assertTrue(pattern.isValidID("2009")); - assertTrue(pattern.isValidID("5555")); - - assertFalse(pattern.isValidID("456")); - assertFalse(pattern.isValidID("10000")); - - } - - - public void testGetRegex() { - - pattern = new IDPattern(); - pattern.add(new YearIDPart("2009")); - pattern.add(new StringIDPart(".")); - pattern.add(new NumericIDPart("1")); - assertEquals("(\\d{4})(\\.)(\\d{1,6})", pattern.getRegex()); - - } - - public void testIsValidIDYearSeparatorItemPattern() { - - pattern = new IDPattern(); - pattern.add(new YearIDPart("2009")); - pattern.add(new StringIDPart(".")); - pattern.add(new NumericIDPart("1")); - - assertTrue(pattern.isValidID("2009.1")); - assertTrue(pattern.isValidID("5555.55")); - - assertFalse(pattern.isValidID("456.1")); - assertFalse(pattern.isValidID("2009-1")); - assertFalse(pattern.isValidID("2009.a")); - assertFalse(pattern.isValidID("2009-a")); - assertFalse(pattern.isValidID("non-pattern conforming text")); - - pattern = new IDPattern(); - pattern.add(new YearIDPart("2009")); - pattern.add(new StringIDPart("ZZ.AND.")); - pattern.add(new NumericIDPart("1")); - - assertTrue(pattern.isValidID("2009ZZ.AND.1")); - assertFalse(pattern.isValidID("2009ZZ-AND-1")); - - } - - // @TODO: Add more tests of boundary conditions, exceptions ... - -} diff --git a/sandbox/aron/id/src/test/java/org/collectionspace/services/id/NumericIDPartTest.java b/sandbox/aron/id/src/test/java/org/collectionspace/services/id/NumericIDPartTest.java deleted file mode 100644 index 0708300bb..000000000 --- a/sandbox/aron/id/src/test/java/org/collectionspace/services/id/NumericIDPartTest.java +++ /dev/null @@ -1,165 +0,0 @@ -/* - * NumericIDPartTest - * - * Test class for NumericIDPart. - * - * Copyright 2009 Regents of the University of California - * - * Licensed under the Educational Community License (ECL), Version 2.0. - * You may not use this file except in compliance with this License. - * - * You may obtain a copy of the ECL 2.0 License at - * https://source.collectionspace.org/collection-space/LICENSE.txt - * - * @author $Author: aron $ - * @version $Revision: 267 $ - * $Date: 2009-06-19 19:03:38 -0700 (Fri, 19 Jun 2009) $ - */ - -package org.collectionspace.services.id; - -import static org.junit.Assert.fail; -import junit.framework.TestCase; - -public class NumericIDPartTest extends TestCase { - - IDPart part; - - public void testNextID() { - - part = new NumericIDPart("0"); - assertEquals("1", part.nextID()); - assertEquals("2", part.nextID()); - assertEquals("3", part.nextID()); - - part = new NumericIDPart("25"); - assertEquals("26", part.nextID()); - assertEquals("27", part.nextID()); - assertEquals("28", part.nextID()); - - } - - public void testNextIDOverflow() { - - try { - part = new NumericIDPart("997", "3"); - assertEquals("998", part.nextID()); - assertEquals("999", part.nextID()); - assertEquals("1000", part.nextID()); - fail("Should have thrown IllegalStateException here"); - } catch (IllegalStateException expected) { - // This Exception should be thrown, and thus the test should pass. - } - - // Tests default MAX_LENGTH value of 6 decimal places - try { - part = new NumericIDPart("999997"); - assertEquals("999998", part.nextID()); - assertEquals("999999", part.nextID()); - assertEquals("1000000", part.nextID()); - fail("Should have thrown IllegalStateException here"); - } catch (IllegalStateException expected) { - // This Exception should be thrown, and thus the test should pass. - } - - } - - public void testresetID() { - - part = new NumericIDPart("25"); - assertEquals("26", part.nextID()); - assertEquals("27", part.nextID()); - assertEquals("28", part.nextID()); - part.resetID(); - assertEquals("26", part.nextID()); - - } - - public void testInitialID() { - - part = new NumericIDPart("0"); - assertEquals("0", part.getInitialID()); - - part = new NumericIDPart("25"); - assertEquals("25", part.getInitialID()); - - } - - public void testCurrentID() { - - part = new NumericIDPart("0"); - assertEquals("0", part.getCurrentID()); - assertEquals("1", part.nextID()); - assertEquals("2", part.nextID()); - assertEquals("2", part.getCurrentID()); - assertEquals("3", part.nextID()); - - part = new NumericIDPart("25"); - assertEquals("25", part.getCurrentID()); - - } - - public void testNullInitialValue() { - - try { - part = new NumericIDPart(null); - fail("Should have thrown IllegalArgumentException here"); - } catch (IllegalArgumentException expected) { - // This Exception should be thrown, and thus the test should pass. - } - - } - - public void testNonLongParseableInitialValue() { - - try { - part = new NumericIDPart("not a long parseable value"); - fail("Should have thrown IllegalArgumentException here"); - } catch (IllegalArgumentException expected) { - // This Exception should be thrown, and thus the test should pass. - } - - } - - public void testNonLongParseableMaxLength() { - - try { - part = new NumericIDPart("1", "not an int parseable value"); - fail("Should have thrown IllegalArgumentException here"); - } catch (IllegalArgumentException expected) { - // This Exception should be thrown, and thus the test should pass. - } - - } - - public void testIsValidID() { - - part = new NumericIDPart("1"); - assertTrue(part.isValidID("1")); - - part = new NumericIDPart("1"); - assertTrue(part.isValidID("123")); - - part = new NumericIDPart("1"); - assertTrue(part.isValidID("123456")); - - part = new NumericIDPart("1"); - assertFalse(part.isValidID("1234567")); - - part = new NumericIDPart("1", "3"); - assertTrue(part.isValidID("123")); - - part = new NumericIDPart("1", "3"); - assertFalse(part.isValidID("1234")); - - part = new NumericIDPart("1"); - assertFalse(part.isValidID("not a parseable long")); - - part = new NumericIDPart("1", "3"); - assertFalse(part.isValidID("not a parseable long")); - - } - - // @TODO: Add more tests of boundary conditions, exceptions ... - -} diff --git a/sandbox/aron/id/src/test/java/org/collectionspace/services/id/StringIDPartTest.java b/sandbox/aron/id/src/test/java/org/collectionspace/services/id/StringIDPartTest.java deleted file mode 100644 index dd3a7a928..000000000 --- a/sandbox/aron/id/src/test/java/org/collectionspace/services/id/StringIDPartTest.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * StringIDPartTest - * - * Test class for StringIDPart. - * - * Copyright 2009 Regents of the University of California - * - * Licensed under the Educational Community License (ECL), Version 2.0. - * You may not use this file except in compliance with this License. - * - * You may obtain a copy of the ECL 2.0 License at - * https://source.collectionspace.org/collection-space/LICENSE.txt - * - * @author $Author: aron $ - * @version $Revision: 267 $ - * $Date: 2009-06-19 19:03:38 -0700 (Fri, 19 Jun 2009) $ - */ - -package org.collectionspace.services.id; - -import static org.junit.Assert.fail; -import junit.framework.TestCase; - -public class StringIDPartTest extends TestCase { - - IDPart part; - - public void testNextID() { - part = new StringIDPart("XYZ"); - assertEquals("XYZ", part.nextID()); - } - - public void testresetID() { - - part = new StringIDPart("."); - assertEquals(".", part.nextID()); - part.resetID(); - assertEquals(".", part.nextID()); - - } - - public void testInitialID() { - part = new StringIDPart("-"); - assertEquals("-", part.getInitialID()); - } - - public void testCurrentID() { - part = new StringIDPart("- -"); - assertEquals("- -", part.getCurrentID()); - } - - public void testNullInitialValue() { - - try { - part = new StringIDPart(null); - fail("Should have thrown IllegalArgumentException here"); - } catch (IllegalArgumentException expected) { - // This Exception should be thrown, and thus the test should pass. - } - - } - - public void testEmptyInitialValue() { - - try { - part = new StringIDPart(""); - fail("Should have thrown IllegalArgumentException here"); - } catch (IllegalArgumentException expected) { - // This Exception should be thrown, and thus the test should pass. - } - - } - - public void testIsValidID() { - - part = new StringIDPart("-"); - assertTrue(part.isValidID("-")); - - part = new StringIDPart("-"); - assertFalse(part.isValidID("--")); - - // Test chars with special meaning in regexes. - part = new StringIDPart("."); - assertTrue(part.isValidID(".")); - - part = new StringIDPart("TE"); - assertTrue(part.isValidID("TE")); - - part = new StringIDPart("TE"); - assertFalse(part.isValidID("T")); - - part = new StringIDPart("T"); - assertFalse(part.isValidID("TE")); - - } - - public void testNullValidationValue() { - - try { - part = new StringIDPart("-"); - assertFalse(part.isValidID(null)); - fail("Should have thrown IllegalArgumentException here"); - } catch (IllegalArgumentException expected) { - // This Exception should be thrown, and thus the test should pass. - } - - } - // @TODO: Add more tests of boundary conditions, exceptions ... - -} diff --git a/sandbox/aron/id/src/test/java/org/collectionspace/services/id/YearIDPartTest.java b/sandbox/aron/id/src/test/java/org/collectionspace/services/id/YearIDPartTest.java deleted file mode 100644 index 12b5d85f3..000000000 --- a/sandbox/aron/id/src/test/java/org/collectionspace/services/id/YearIDPartTest.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * YearIDPartTest - * - * Test class for YearIDPart. - * - * Copyright 2009 Regents of the University of California - * - * Licensed under the Educational Community License (ECL), Version 2.0. - * You may not use this file except in compliance with this License. - * - * You may obtain a copy of the ECL 2.0 License at - * https://source.collectionspace.org/collection-space/LICENSE.txt - * - * @author $Author: aron $ - * @version $Revision: 267 $ - * $Date: 2009-06-19 19:03:38 -0700 (Fri, 19 Jun 2009) $ - */ - -package org.collectionspace.services.id; - -import static org.junit.Assert.fail; -import java.util.Calendar; -import java.util.GregorianCalendar; -import junit.framework.TestCase; - -public class YearIDPartTest extends TestCase { - - IDPart part; - String year = "1999"; - - public String getCurrentYear() { - Calendar cal = GregorianCalendar.getInstance(); - int y = cal.get(Calendar.YEAR); - return Integer.toString(y); - } - - public void testCurrentID() { - - part = new YearIDPart(); - assertEquals(getCurrentYear(), part.getCurrentID()); - - part = new YearIDPart(year); - assertEquals(year, part.getCurrentID()); - - } - - -/* - public void testNextID() { - part = new YearIDPart("XYZ"); - assertEquals("XYZ", part.nextID()); - } - - public void testresetID() { - - part = new YearIDPart("."); - assertEquals(".", part.nextID()); - part.resetID(); - assertEquals(".", part.nextID()); - - } - - public void testInitialID() { - part = new YearIDPart("-"); - assertEquals("-", part.getInitialID()); - } - -*/ - - public void testNullInitialValue() { - - try { - part = new YearIDPart(null); - fail("Should have thrown IllegalArgumentException here"); - } catch (IllegalArgumentException expected) { - // This Exception should be thrown, and thus the test should pass. - } - - } - - public void testEmptyInitialValue() { - - try { - part = new YearIDPart(""); - fail("Should have thrown IllegalArgumentException here"); - } catch (IllegalArgumentException expected) { - // This Exception should be thrown, and thus the test should pass. - } - - } - - public void testIsValidID() { - - part = new YearIDPart(); - assertTrue(part.isValidID("2009")); - - part = new YearIDPart(); - assertFalse(part.isValidID("839")); - - part = new YearIDPart(); - assertFalse(part.isValidID("10100")); - - part = new YearIDPart(); - assertFalse(part.isValidID("non-numeric value")); - - } - - public void testNullValidationValue() { - - try { - part = new YearIDPart(); - assertFalse(part.isValidID(null)); - fail("Should have thrown IllegalArgumentException here"); - } catch (IllegalArgumentException expected) { - // This Exception should be thrown, and thus the test should pass. - } - - } - // @TODO: Add more tests of boundary conditions, exceptions ... - -} diff --git a/sandbox/aron/schema-previous-2009-02-27/CollectionObject.xml b/sandbox/aron/schema-previous-2009-02-27/CollectionObject.xml deleted file mode 100644 index 974b96da2..000000000 --- a/sandbox/aron/schema-previous-2009-02-27/CollectionObject.xml +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - - - - - - - - - - - 170594 - - - - - - - - - - 2-68479 - - - - - - - Conical shape, made of willow warp and weft. - - - - In very poor condition, flattened and broken. - - - - Diagonal twining. - - - - Basket - - - - - - - - - - - - diff --git a/sandbox/aron/schema-previous-2009-02-27/CollectionObject2.xml b/sandbox/aron/schema-previous-2009-02-27/CollectionObject2.xml deleted file mode 100644 index 803afa6b8..000000000 --- a/sandbox/aron/schema-previous-2009-02-27/CollectionObject2.xml +++ /dev/null @@ -1,135 +0,0 @@ - - - - - - - - - - - - - - - - 170594 - - - - - - - - - - - - - - 2-68479 - - - - - - - Conical shape, made of willow warp and weft. - - - - In very poor condition, flattened and broken. - - - - Diagonal twining. - - - - Basket - - - - - - - - - - - - - - - - Room 231, Shelf 5, Box 18 - - - - - - - - diff --git a/sandbox/aron/schema-previous-2009-02-27/collectionObject-as-entity.rng b/sandbox/aron/schema-previous-2009-02-27/collectionObject-as-entity.rng deleted file mode 100644 index ed6a35ca6..000000000 --- a/sandbox/aron/schema-previous-2009-02-27/collectionObject-as-entity.rng +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - diff --git a/sandbox/aron/schema-previous-2009-02-27/entity.rng b/sandbox/aron/schema-previous-2009-02-27/entity.rng deleted file mode 100644 index 1cc36eed1..000000000 --- a/sandbox/aron/schema-previous-2009-02-27/entity.rng +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sandbox/aron/schema-previous-2009-02-27/entityCoreFields.rng b/sandbox/aron/schema-previous-2009-02-27/entityCoreFields.rng deleted file mode 100644 index 7bf5d4771..000000000 --- a/sandbox/aron/schema-previous-2009-02-27/entityCoreFields.rng +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sandbox/aron/schema-previous-2009-02-27/entityField.rng b/sandbox/aron/schema-previous-2009-02-27/entityField.rng deleted file mode 100644 index 5a151efdd..000000000 --- a/sandbox/aron/schema-previous-2009-02-27/entityField.rng +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - false - - - - - - - - - - - - - - - - - - - diff --git a/sandbox/aron/schema-previous-2009-02-27/entityFieldAttributes.rng b/sandbox/aron/schema-previous-2009-02-27/entityFieldAttributes.rng deleted file mode 100644 index e4fcb2666..000000000 --- a/sandbox/aron/schema-previous-2009-02-27/entityFieldAttributes.rng +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sandbox/aron/schema-previous-2009-02-27/serviceResponse.rng b/sandbox/aron/schema-previous-2009-02-27/serviceResponse.rng deleted file mode 100644 index c4d759dea..000000000 --- a/sandbox/aron/schema-previous-2009-02-27/serviceResponse.rng +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sandbox/aron/schema-previous-2009-02-27/serviceResponse.xml b/sandbox/aron/schema-previous-2009-02-27/serviceResponse.xml deleted file mode 100644 index daeed3da3..000000000 --- a/sandbox/aron/schema-previous-2009-02-27/serviceResponse.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - 1005 - - - - foo - diff --git a/sandbox/aron/schema-previous-2009-02-27/tools/jing.jar b/sandbox/aron/schema-previous-2009-02-27/tools/jing.jar deleted file mode 100644 index e5a33755a..000000000 Binary files a/sandbox/aron/schema-previous-2009-02-27/tools/jing.jar and /dev/null differ diff --git a/sandbox/aron/schema-previous-2009-02-27/tools/trang.jar b/sandbox/aron/schema-previous-2009-02-27/tools/trang.jar deleted file mode 100644 index 672d65c45..000000000 Binary files a/sandbox/aron/schema-previous-2009-02-27/tools/trang.jar and /dev/null differ diff --git a/sandbox/aron/schema-previous-2009-03-16/collectionObject-full-ns.rng b/sandbox/aron/schema-previous-2009-03-16/collectionObject-full-ns.rng deleted file mode 100644 index 90bb33583..000000000 --- a/sandbox/aron/schema-previous-2009-03-16/collectionObject-full-ns.rng +++ /dev/null @@ -1,277 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sandbox/aron/schema-previous-2009-03-16/collectionObject-full.rng b/sandbox/aron/schema-previous-2009-03-16/collectionObject-full.rng deleted file mode 100644 index 2c59821ab..000000000 --- a/sandbox/aron/schema-previous-2009-03-16/collectionObject-full.rng +++ /dev/null @@ -1,270 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sandbox/aron/schema-previous-2009-03-16/collectionObject-ns-no-prefix.xsd b/sandbox/aron/schema-previous-2009-03-16/collectionObject-ns-no-prefix.xsd deleted file mode 100644 index afeeac6c2..000000000 --- a/sandbox/aron/schema-previous-2009-03-16/collectionObject-ns-no-prefix.xsd +++ /dev/null @@ -1,166 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sandbox/aron/schema-previous-2009-03-16/collectionObject-ns.xml b/sandbox/aron/schema-previous-2009-03-16/collectionObject-ns.xml deleted file mode 100644 index 4fdd9d488..000000000 --- a/sandbox/aron/schema-previous-2009-03-16/collectionObject-ns.xml +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - org.collectionspace.797220effa5fa160 - - - - - - - - - - 1984.021.0049 - - Radio News, vol. 10, no. 2, August 1928 - - - Radio News, August 1928. The cover of this issue features an -illustration of a man and woman watching an early "radio movie." Text on -the cover reads, "Radio's Greatest Magazine / Radio News / August 25 -Cents / Over 200 illustrations / Edited by Hugo Gernsback / Radio Movies -and Television for the Home / Experimenter Publishing Company, 230 Fifth -Avenue, New York." - -In addition to articles about radios and radio technology, the magazine -also contains several articles about developments in the field of -television. The issue begins with an editorial about the future of -television by the magazine's editor, Hugo Gernsback, which is followed -by an article about the radio movie receiver system invented by C. -Francis Jenkins. The article includes drawings illustrating the layout -of the sytem. - - - - - - - diff --git a/sandbox/aron/schema-previous-2009-03-16/collectionObject-ns.xsd b/sandbox/aron/schema-previous-2009-03-16/collectionObject-ns.xsd deleted file mode 100644 index 49c10ee86..000000000 --- a/sandbox/aron/schema-previous-2009-03-16/collectionObject-ns.xsd +++ /dev/null @@ -1,165 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sandbox/aron/schema-previous-2009-03-16/collectionObject.rng b/sandbox/aron/schema-previous-2009-03-16/collectionObject.rng deleted file mode 100644 index 69491cd8c..000000000 --- a/sandbox/aron/schema-previous-2009-03-16/collectionObject.rng +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/sandbox/aron/schema-previous-2009-03-16/collectionObject.xml b/sandbox/aron/schema-previous-2009-03-16/collectionObject.xml deleted file mode 100644 index 97615c0c0..000000000 --- a/sandbox/aron/schema-previous-2009-03-16/collectionObject.xml +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - org.collectionspace.797220effa5fa160 - - - - - - - - - - 1984.021.0049 - - Radio News, vol. 10, no. 2, August 1928 - - - Radio News, August 1928. The cover of this issue features an -illustration of a man and woman watching an early "radio movie." Text on -the cover reads, "Radio's Greatest Magazine / Radio News / August 25 -Cents / Over 200 illustrations / Edited by Hugo Gernsback / Radio Movies -and Television for the Home / Experimenter Publishing Company, 230 Fifth -Avenue, New York." - -In addition to articles about radios and radio technology, the magazine -also contains several articles about developments in the field of -television. The issue begins with an editorial about the future of -television by the magazine's editor, Hugo Gernsback, which is followed -by an article about the radio movie receiver system invented by C. -Francis Jenkins. The article includes drawings illustrating the layout -of the sytem. - - - - - - - Books, literature, and periodicals - - Magazine - - Paper - - - 11.75 - 8.75 - in - - - - - - diff --git a/sandbox/aron/schema-previous-2009-03-16/collectionObject.xsd b/sandbox/aron/schema-previous-2009-03-16/collectionObject.xsd deleted file mode 100644 index 1d8bbe89b..000000000 --- a/sandbox/aron/schema-previous-2009-03-16/collectionObject.xsd +++ /dev/null @@ -1,165 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sandbox/aron/schema-previous-2009-03-16/collectionObjects.rng b/sandbox/aron/schema-previous-2009-03-16/collectionObjects.rng deleted file mode 100644 index 4e84991b8..000000000 --- a/sandbox/aron/schema-previous-2009-03-16/collectionObjects.rng +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - diff --git a/sandbox/aron/schema-previous-2009-03-16/collectionObjects.xml b/sandbox/aron/schema-previous-2009-03-16/collectionObjects.xml deleted file mode 100644 index abd74ef35..000000000 --- a/sandbox/aron/schema-previous-2009-03-16/collectionObjects.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - org.collectionspace.797220effa5fa160 - 1984.021.0049 - Radio News, vol. 10, no. 2, August 1928 - /collectionObjects/1984.021.0049 - - - - org.collectionspace.68ac7dc8f9e743 - 1997.005.0437 - Toy, Gotham City Police Helicopter, 1992 - /collectionObjects/1997.005.0437 - - - diff --git a/sandbox/aron/schema-previous-2009-03-16/collectionObjects.xsd b/sandbox/aron/schema-previous-2009-03-16/collectionObjects.xsd deleted file mode 100644 index a0b5bbf9d..000000000 --- a/sandbox/aron/schema-previous-2009-03-16/collectionObjects.xsd +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sandbox/aron/schema-previous-2009-03-16/defaultCollectionObject.rng b/sandbox/aron/schema-previous-2009-03-16/defaultCollectionObject.rng deleted file mode 100644 index 368279864..000000000 --- a/sandbox/aron/schema-previous-2009-03-16/defaultCollectionObject.rng +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sandbox/aron/schema-previous-2009-03-16/hello.xsd b/sandbox/aron/schema-previous-2009-03-16/hello.xsd deleted file mode 100644 index fd1313985..000000000 --- a/sandbox/aron/schema-previous-2009-03-16/hello.xsd +++ /dev/null @@ -1,215 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sandbox/aron/schema-previous-2009-03-16/rng-to-xsd.sh b/sandbox/aron/schema-previous-2009-03-16/rng-to-xsd.sh deleted file mode 100644 index 053b369bc..000000000 --- a/sandbox/aron/schema-previous-2009-03-16/rng-to-xsd.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -# -# rng-to-xsd.sh -# -# Simple bash shell script to generate a W3C XML Schema (XSD) document -# from a RELAX NG schema document. -# -# Requires two arguments: -# - Filename of the RELAX NG schema document. -# (Or the full path to this document, if it is not in the current directory.) -# - Filename of the new W3C XML Schema document to be created. -# (Or the full path to this document, if it is not in the current directory.) -# -# $Author: aron $ -# $Revision: 57 $ -# $Date: 2009-03-05 16:06:06 -0800 (Thu, 05 Mar 2009) $ - -java -jar tools/trang.jar -I rng -O xsd $1 $2 \ No newline at end of file diff --git a/sandbox/aron/schema-previous-2009-03-16/sampleMmiCollectionObject.rng b/sandbox/aron/schema-previous-2009-03-16/sampleMmiCollectionObject.rng deleted file mode 100644 index 383054185..000000000 --- a/sandbox/aron/schema-previous-2009-03-16/sampleMmiCollectionObject.rng +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - in - mm - - - - - - - - - diff --git a/sandbox/aron/schema-previous-2009-03-16/serviceErrorResponse.rng b/sandbox/aron/schema-previous-2009-03-16/serviceErrorResponse.rng deleted file mode 100644 index 0e8fe88a2..000000000 --- a/sandbox/aron/schema-previous-2009-03-16/serviceErrorResponse.rng +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - 1 - - - - - - - - - - - - diff --git a/sandbox/aron/schema-previous-2009-03-16/serviceErrorResponse.xml b/sandbox/aron/schema-previous-2009-03-16/serviceErrorResponse.xml deleted file mode 100644 index 8d619181f..000000000 --- a/sandbox/aron/schema-previous-2009-03-16/serviceErrorResponse.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - 1005 - - diff --git a/sandbox/aron/schema-previous-2009-03-16/serviceErrorResponse.xsd b/sandbox/aron/schema-previous-2009-03-16/serviceErrorResponse.xsd deleted file mode 100644 index f08153723..000000000 --- a/sandbox/aron/schema-previous-2009-03-16/serviceErrorResponse.xsd +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sandbox/aron/schema-previous-2009-03-16/serviceMetadata.rng b/sandbox/aron/schema-previous-2009-03-16/serviceMetadata.rng deleted file mode 100644 index b6f1ae85d..000000000 --- a/sandbox/aron/schema-previous-2009-03-16/serviceMetadata.rng +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sandbox/aron/schema-previous-2009-03-16/tools/jing.jar b/sandbox/aron/schema-previous-2009-03-16/tools/jing.jar deleted file mode 100644 index e5a33755a..000000000 Binary files a/sandbox/aron/schema-previous-2009-03-16/tools/jing.jar and /dev/null differ diff --git a/sandbox/aron/schema-previous-2009-03-16/tools/trang.jar b/sandbox/aron/schema-previous-2009-03-16/tools/trang.jar deleted file mode 100644 index 672d65c45..000000000 Binary files a/sandbox/aron/schema-previous-2009-03-16/tools/trang.jar and /dev/null differ diff --git a/sandbox/aron/schema-previous-2009-03-16/validate-rng.sh b/sandbox/aron/schema-previous-2009-03-16/validate-rng.sh deleted file mode 100644 index 5cc51a9bf..000000000 --- a/sandbox/aron/schema-previous-2009-03-16/validate-rng.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -# -# Simple bash shell script to validate an XML instance document -# against a RELAX NG schema. -# -# Requires two arguments: -# - Filename of the RELAX NG schema document. -# (Or the full path to this document, if it is not in the current directory.) -# - Filename of the XML instance document. -# (Or the full path to this document, if it is not in the current directory.) -# -# $Author: aron $ -# $Revision: 57 $ -# $Date: 2009-03-05 16:06:06 -0800 (Thu, 05 Mar 2009) $ - -java -jar tools/jing.jar $1 $2 \ No newline at end of file diff --git a/sandbox/aron/schema/collectionObject-concise.xml b/sandbox/aron/schema/collectionObject-concise.xml deleted file mode 100644 index d4683441d..000000000 --- a/sandbox/aron/schema/collectionObject-concise.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - -1984.021.0049 - -Radio News, vol. 10, no. 2, August 1928 - - diff --git a/sandbox/aron/schema/collectionObject.rng b/sandbox/aron/schema/collectionObject.rng deleted file mode 100644 index c20542fa3..000000000 --- a/sandbox/aron/schema/collectionObject.rng +++ /dev/null @@ -1,251 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sandbox/aron/schema/collectionObject.xml b/sandbox/aron/schema/collectionObject.xml deleted file mode 100644 index d266608e5..000000000 --- a/sandbox/aron/schema/collectionObject.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - - - - - org.collectionspace.797220effa5fa160 - - - - - - - - - 1984.021.0049 - - Radio News, vol. 10, no. 2, August 1928 - - - Radio News, August 1928. The cover of this issue features an -illustration of a man and woman watching an early "radio movie." Text on -the cover reads, "Radio's Greatest Magazine / Radio News / August 25 -Cents / Over 200 illustrations / Edited by Hugo Gernsback / Radio Movies -and Television for the Home / Experimenter Publishing Company, 230 Fifth -Avenue, New York." - -In addition to articles about radios and radio technology, the magazine -also contains several articles about developments in the field of -television. The issue begins with an editorial about the future of -television by the magazine's editor, Hugo Gernsback, which is followed -by an article about the radio movie receiver system invented by C. -Francis Jenkins. The article includes drawings illustrating the layout -of the sytem. - - - - - - - - - - diff --git a/sandbox/aron/schema/collectionObject.xsd b/sandbox/aron/schema/collectionObject.xsd deleted file mode 100644 index 4fb5a415c..000000000 --- a/sandbox/aron/schema/collectionObject.xsd +++ /dev/null @@ -1,165 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sandbox/aron/schema/collectionObjectList.rng b/sandbox/aron/schema/collectionObjectList.rng deleted file mode 100644 index a9491766a..000000000 --- a/sandbox/aron/schema/collectionObjectList.rng +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - diff --git a/sandbox/aron/schema/collectionObjectList.xml b/sandbox/aron/schema/collectionObjectList.xml deleted file mode 100644 index a006b5ba8..000000000 --- a/sandbox/aron/schema/collectionObjectList.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - org.collectionspace:797220effa5fa160 - 1984.021.0049 - Radio News, vol. 10, no. 2, August 1928 - /collectionObjects/1984.021.0049 - - - - org.collectionspace:68ac7dc8f9e743 - 1997.005.0437 - Toy, Gotham City Police Helicopter, 1992 - /collectionObjects/1997.005.0437 - - - diff --git a/sandbox/aron/schema/collectionObjectList.xsd b/sandbox/aron/schema/collectionObjectList.xsd deleted file mode 100644 index 5034a912c..000000000 --- a/sandbox/aron/schema/collectionObjectList.xsd +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sandbox/aron/schema/hello.xsd b/sandbox/aron/schema/hello.xsd deleted file mode 100644 index 0e213c86a..000000000 --- a/sandbox/aron/schema/hello.xsd +++ /dev/null @@ -1,215 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sandbox/aron/schema/rng-to-xsd.sh b/sandbox/aron/schema/rng-to-xsd.sh deleted file mode 100644 index 1d71264d7..000000000 --- a/sandbox/aron/schema/rng-to-xsd.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh -# -# rng-to-xsd.sh -# -# Simple bash shell script to generate a W3C XML Schema (XSD) document -# from a RELAX NG schema document. -# -# Uses James Clark's Trang utility, http://www.thaiopensource.com/relaxng/trang.html -# -# Assumes Trang's 'trang.jar' file is located in a 'tools' subdirectory of the current directory. -# -# Requires two arguments: -# - Filename of the RELAX NG schema document. -# (Or the full path to this document, if it is not in the current directory.) -# - Filename of the new W3C XML Schema document to be created. -# (Or the full path to this document, if it is not in the current directory.) -# -# $Author: aron $ -# $Revision: 57 $ -# $Date: 2009-03-05 16:06:06 -0800 (Thu, 05 Mar 2009) $ - -java -jar tools/trang.jar -I rng -O xsd $1 $2 \ No newline at end of file diff --git a/sandbox/aron/schema/serviceErrorResponse.rng b/sandbox/aron/schema/serviceErrorResponse.rng deleted file mode 100644 index f3f4dc4a1..000000000 --- a/sandbox/aron/schema/serviceErrorResponse.rng +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - 1 - - - - - - - - - - - - diff --git a/sandbox/aron/schema/serviceErrorResponse.xml b/sandbox/aron/schema/serviceErrorResponse.xml deleted file mode 100644 index f07d50b9c..000000000 --- a/sandbox/aron/schema/serviceErrorResponse.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - 1005 - - diff --git a/sandbox/aron/schema/serviceErrorResponse.xsd b/sandbox/aron/schema/serviceErrorResponse.xsd deleted file mode 100644 index f08153723..000000000 --- a/sandbox/aron/schema/serviceErrorResponse.xsd +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sandbox/aron/schema/tools/jing.jar b/sandbox/aron/schema/tools/jing.jar deleted file mode 100644 index e5a33755a..000000000 Binary files a/sandbox/aron/schema/tools/jing.jar and /dev/null differ diff --git a/sandbox/aron/schema/tools/trang.jar b/sandbox/aron/schema/tools/trang.jar deleted file mode 100644 index 672d65c45..000000000 Binary files a/sandbox/aron/schema/tools/trang.jar and /dev/null differ diff --git a/sandbox/aron/schema/validate-rng.sh b/sandbox/aron/schema/validate-rng.sh deleted file mode 100644 index 517b9d62c..000000000 --- a/sandbox/aron/schema/validate-rng.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh -# -# Simple bash shell script to validate an XML instance document -# against a RELAX NG schema. -# -# Uses James Clark's Jing utility, http://www.thaiopensource.com/relaxng/jing.html -# -# Assumes Jing's 'jing.jar' file is located in a 'tools' subdirectory of the current directory. -# -# Requires two arguments: -# - Filename of the RELAX NG schema document. -# (Or the full path to this document, if it is not in the current directory.) -# - Filename of the XML instance document. -# (Or the full path to this document, if it is not in the current directory.) -# -# $Author: aron $ -# $Revision: 57 $ -# $Date: 2009-03-05 16:06:06 -0800 (Thu, 05 Mar 2009) $ - -java -jar tools/jing.jar $1 $2 \ No newline at end of file diff --git a/sandbox/aron/schema/validate-xsd.sh b/sandbox/aron/schema/validate-xsd.sh deleted file mode 100644 index 3e9da9dc4..000000000 --- a/sandbox/aron/schema/validate-xsd.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh -# -# Simple bash shell script to validate an XML instance document -# against a W3C XML Schema. -# -# Uses the XMLStarlet utility, http://xmlstar.sourceforge.net/ -# -# Assumes the 'xmlstarlet' executable is located within the shell's executable path. -# -# Note that XMLStarlet's support for XML Schema is "not yet fully supported", due to -# incomplete support in a dependency, the XML C toolkit for Gnome (http://xmlsoft.org/). -# -# Requires two arguments: -# - Filename of the W3C XML Schema document. -# (Or the full path to this document, if it is not in the current directory.) -# - Filename of the XML instance document. -# (Or the full path to this document, if it is not in the current directory.) -# -# $Author: aron $ -# $Revision: 57 $ -# $Date: 2009-03-05 16:06:06 -0800 (Thu, 05 Mar 2009) $ - -xmlstarlet val --err --xsd $1 $2 \ No newline at end of file diff --git a/sandbox/aron/wadl/samples/yahoo-news.html b/sandbox/aron/wadl/samples/yahoo-news.html deleted file mode 100644 index 9816c961b..000000000 --- a/sandbox/aron/wadl/samples/yahoo-news.html +++ /dev/null @@ -1,73 +0,0 @@ - - -My Web Application

My Web Application

Resources

/newsSearch?appid&query&type&results&start&sort&language

Methods

GET

request query parameters
parametervaluedescription

appid

string (required)

query

string (required)

type

One of:

  • all (default)
  • any
  • phrase

results

int

Default: 10

start

int

Default: 1

sort

One of:

  • rank (default)
  • date

language

string

available response representations:

potential faults:

Representations

application/xml (yn:ResultSet)

XML Schema

Source:

Faults

Status Code 400 - application/xml (ya:Error)

XML Schema

Source:

diff --git a/sandbox/aron/wadl/samples/yahoo-news.wadl b/sandbox/aron/wadl/samples/yahoo-news.wadl deleted file mode 100644 index 06c5d908d..000000000 --- a/sandbox/aron/wadl/samples/yahoo-news.wadl +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sandbox/aron/wadl/schema/wadl20061109.rnc b/sandbox/aron/wadl/schema/wadl20061109.rnc deleted file mode 100644 index 0387e4ef3..000000000 --- a/sandbox/aron/wadl/schema/wadl20061109.rnc +++ /dev/null @@ -1,172 +0,0 @@ -namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0" -namespace local = "" -namespace wadl = "http://research.sun.com/wadl/2006/10" - -start = - element wadl:application { - doc*, - grammars?, - resources?, - ( resource_type | method | representation | fault )*, - foreign-attribute, - foreign-element - } -doc = - element wadl:doc { - attribute xml:lang { languageTag }?, - attribute title { text }?, - ( text | foreign-element )*, - foreign-attribute - } -grammars = - element wadl:grammars { - doc*, - incl*, - foreign-element - } -incl = - element wadl:include { - doc*, - attribute href { xsd:anyURI }, - foreign-attribute - } -resources = - element wadl:resources { - doc*, - resource+, - attribute base { xsd:anyURI }, - foreign-attribute, - foreign-element - } -resource_type = - element wadl:resource_type { - doc*, - param*, - method*, - attribute id { xsd:token }?, - foreign-element, - foreign-attribute - } -resource = - element wadl:resource { - doc*, - param*, - (method | resource)*, - attribute type { list {xsd:anyURI} } ?, - attribute path { text }?, - attribute id { xsd:token }?, - attribute queryType { text }?, - foreign-element, - foreign-attribute - } -method = - element wadl:method { - ( - ( - attribute href { xsd:anyURI } - ) | ( - doc*, - request?, - response?, - attribute id { xsd:token }?, - attribute name { - "DELETE" | "GET" | "HEAD" | "POST" | "PUT" | xsd:token - } - ) - ), - foreign-element, - foreign-attribute - } -request = - element wadl:request { - doc*, - param*, - representation*, - foreign-attribute, - foreign-element - } -response = - element wadl:response { - doc*, - param*, - (representation | fault)*, - foreign-attribute, - foreign-element - } -representation_type = - ( - ( - attribute href { xsd:anyURI } - ) | ( - doc*, - param*, - attribute id { xsd:token }?, - attribute element { xsd:QName }?, - attribute mediaType { text }?, - attribute profile { list { xsd:anyURI} }?, - attribute status { list { xsd:int+ } }? - ) - ) -representation = - element wadl:representation { - representation_type, - foreign-attribute, - foreign-element - } -fault = - element wadl:fault { - representation_type, - foreign-attribute, - foreign-element - } -param = - element wadl:param { - doc*, - option*, - link?, - attribute name {xsd:token }, - attribute style { - "plain" | "query" | "matrix" | "header" | "template" - }, - attribute id { xsd:token }?, - attribute type { text }?, - attribute default { text }?, - attribute path { text }?, - attribute required { xsd:boolean }?, - attribute repeating { xsd:boolean }?, - attribute fixed { text }?, - foreign-element, - foreign-attribute - } -option = - element wadl:option { - doc*, - attribute value { xsd:string }, - foreign-element, - foreign-attribute - } -link = - element wadl:link { - doc*, - attribute resource_type { xsd:anyURI }?, - attribute rel { xsd:token }?, - attribute rev { xsd:token }?, - foreign-element, - foreign-attribute - } -foreign-attribute = attribute * - (wadl:* | local:* | xml:*) { text }* -foreign-element = - element * - (wadl:* | local:*) { - (attribute * { text } - | text - | any-element)* - }* -any-element = - element * { - (attribute * { text } - | text - | any-element)* - }* -languageTag = xsd:string { - pattern = "[A-Za-z]{1,8}(-[A-Za-z0-9]{1,8})*" -} diff --git a/sandbox/aron/wadl/spec/wadl20061109.pdf b/sandbox/aron/wadl/spec/wadl20061109.pdf deleted file mode 100644 index 73471fd58..000000000 Binary files a/sandbox/aron/wadl/spec/wadl20061109.pdf and /dev/null differ diff --git a/sandbox/aron/wadl/stylesheets/wadl_documentation.xsl b/sandbox/aron/wadl/stylesheets/wadl_documentation.xsl deleted file mode 100644 index 2733c2508..000000000 --- a/sandbox/aron/wadl/stylesheets/wadl_documentation.xsl +++ /dev/null @@ -1,863 +0,0 @@ - - - - - - - - - - http://research.sun.com/wadl/2006/10 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <xsl:choose> - <xsl:when test="wadl:doc[@title]"> - <xsl:value-of select="wadl:doc[@title][1]/@title"/> - </xsl:when> - <xsl:otherwise>My Web Application</xsl:otherwise> - </xsl:choose> - - - - - -

- - - - - - My Web Application - -

- - -

Resources

- - -

Representations

- -

Faults

- -
- - -
- - - - - - - - - - - - - -
    - - - -
-
- - - - - - / -
  • - -
      - - - - -
    -
    -
  • -
    - - - - - - - - -
  • - - - -
  • -
    -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - / - - ;=... - - - -
    -

    - - - - - - - - - - & - ? - - - - - - - - & - ? - - - - - - - - - - -

    - - - resource-wide - - template - - - resource-wide - matrix - -
    Methods
    -
    - - -
    -
    - - - -
    -
    -
    - - - - -
    -

    - - - -
    -
    - - - - request - query - - - request - - header - - -

    acceptable request representations:

    -
      - -
    -
    - -
    - - - - response - header - - -

    available response representations:

    - -
      - -
    -
    - -

    potential faults:

    -
      - - -
    -
    -
    - - - -
  • - - - - -
  • -
    - - - - - - - - - - - - - -

    - -

    - - - -
    - -
    XML Schema
    - - - - - -
    - - plain - - - header - -
    -
    -
    - -
    -
    - - - - - -
    parameters
    - - - - - - - - -
    parametervaluedescription
    - -
    -
    - - - - -

    - - -

    - - - (required) - (repeating) -

    - - - -

    One of:

    -
      - -
    -
    - -

    Default:

    -

    Fixed:

    - -
    -
    - - - - -
    - -
    - -
    - -
      -
    • XPath to value:
    • - -
    -
    - - - -
    - - -
  • - Link: -
  • -
    - - - -
  • - - (default) -
  • -
    - - -
    - - - (default) -
    -
    - -
    -
    - - - - 0 - - - -

    - -

    -
    - - - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Source:

    -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - { - - } - - - - - - - - - - - - - - - - ( - Status Code - - - - - - - - - - ) - - - Status Code - - - - - ( - - ) - - - - - - - - < - - - - > - - </> - - - - /> - - - - - - ="" - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    diff --git a/sandbox/kss/wiki_to_java/.classpath b/sandbox/kss/wiki_to_java/.classpath deleted file mode 100644 index 269c23b24..000000000 --- a/sandbox/kss/wiki_to_java/.classpath +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/sandbox/kss/wiki_to_java/.factorypath b/sandbox/kss/wiki_to_java/.factorypath deleted file mode 100644 index 610dea5ff..000000000 --- a/sandbox/kss/wiki_to_java/.factorypath +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/sandbox/kss/wiki_to_java/.project b/sandbox/kss/wiki_to_java/.project deleted file mode 100644 index f4169a602..000000000 --- a/sandbox/kss/wiki_to_java/.project +++ /dev/null @@ -1,23 +0,0 @@ - - - maven-kscontract-plugin - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.maven.ide.eclipse.maven2Builder - - - - - - org.eclipse.jdt.core.javanature - org.maven.ide.eclipse.maven2Nature - - diff --git a/sandbox/kss/wiki_to_java/.settings/org.eclipse.jdt.apt.core.prefs b/sandbox/kss/wiki_to_java/.settings/org.eclipse.jdt.apt.core.prefs deleted file mode 100644 index ba8a488a8..000000000 --- a/sandbox/kss/wiki_to_java/.settings/org.eclipse.jdt.apt.core.prefs +++ /dev/null @@ -1,5 +0,0 @@ -#Mon Jan 26 12:10:34 PST 2009 -eclipse.preferences.version=1 -org.eclipse.jdt.apt.aptEnabled=true -org.eclipse.jdt.apt.genSrcDir=.apt_generated -org.eclipse.jdt.apt.reconcileEnabled=true diff --git a/sandbox/kss/wiki_to_java/.settings/org.eclipse.jdt.core.prefs b/sandbox/kss/wiki_to_java/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 92af791ed..000000000 --- a/sandbox/kss/wiki_to_java/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,88 +0,0 @@ -#Mon Jan 26 12:11:37 PST 2009 -eclipse.preferences.version=1 -org.eclipse.jdt.core.builder.cleanOutputFolder=ignore -org.eclipse.jdt.core.builder.duplicateResourceTask=warning -org.eclipse.jdt.core.builder.invalidClasspath=abort -org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder=ignore -org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch -org.eclipse.jdt.core.circularClasspath=error -org.eclipse.jdt.core.classpath.exclusionPatterns=enabled -org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled -org.eclipse.jdt.core.compiler.doc.comment.support=enabled -org.eclipse.jdt.core.compiler.maxProblemPerUnit=100 -org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning -org.eclipse.jdt.core.compiler.problem.autoboxing=ignore -org.eclipse.jdt.core.compiler.problem.deprecation=warning -org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled -org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled -org.eclipse.jdt.core.compiler.problem.discouragedReference=warning -org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore -org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore -org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled -org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore -org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning -org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning -org.eclipse.jdt.core.compiler.problem.forbiddenReference=error -org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning -org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning -org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore -org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore -org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore -org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=disabled -org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled -org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=disabled -org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=public -org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore -org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning -org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore -org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore -org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled -org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public -org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag -org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore -org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled -org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore -org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning -org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning -org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore -org.eclipse.jdt.core.compiler.problem.nullReference=warning -org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning -org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore -org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore -org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore -org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning -org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore -org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore -org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled -org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning -org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled -org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore -org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning -org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning -org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore -org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning -org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore -org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore -org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled -org.eclipse.jdt.core.compiler.problem.unusedImport=warning -org.eclipse.jdt.core.compiler.problem.unusedLabel=warning -org.eclipse.jdt.core.compiler.problem.unusedLocal=warning -org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore -org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled -org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning -org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning -org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.processAnnotations=enabled -org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled -org.eclipse.jdt.core.compiler.taskPriorities=NORMAL,HIGH,NORMAL -org.eclipse.jdt.core.compiler.taskTags=TODO,FIXME,XXX -org.eclipse.jdt.core.incompatibleJDKLevel=ignore -org.eclipse.jdt.core.incompleteClasspath=error diff --git a/sandbox/kss/wiki_to_java/.settings/org.eclipse.jdt.ui.prefs b/sandbox/kss/wiki_to_java/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 4918a426b..000000000 --- a/sandbox/kss/wiki_to_java/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,4 +0,0 @@ -#Mon Jan 26 12:10:31 PST 2009 -eclipse.preferences.version=1 -internal.default.compliance=user -org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/sandbox/kss/wiki_to_java/.settings/org.maven.ide.eclipse.prefs b/sandbox/kss/wiki_to_java/.settings/org.maven.ide.eclipse.prefs deleted file mode 100644 index db1a996d4..000000000 --- a/sandbox/kss/wiki_to_java/.settings/org.maven.ide.eclipse.prefs +++ /dev/null @@ -1,10 +0,0 @@ -#Mon Jan 26 12:05:24 PST 2009 -activeProfiles= -eclipse.preferences.version=1 -filterResources=false -fullBuildGoals=process-test-resources -includeModules=false -resolveWorkspaceProjects=true -resourceFilterGoals=process-resources resources\:testResources -useMavenFolders=true -version=1 diff --git a/sandbox/kss/wiki_to_java/contracts/New Text Document.xml b/sandbox/kss/wiki_to_java/contracts/New Text Document.xml deleted file mode 100644 index 626ceb1d8..000000000 --- a/sandbox/kss/wiki_to_java/contracts/New Text Document.xml +++ /dev/null @@ -1,295 +0,0 @@ - - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfindFactTypes
    DescriptionRetrieves the list of Facts Types known by this service.
    ParametersNoneNoneNo parameters
    ReturnfactTypeInfoListList of Fact type information Do we want to switch this to just keys due to amount of information?
    ErrorsOPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfetchFactType
    DescriptionRetrieves information about a type of Fact, listing all the keys required for its computation.
    ParametersfactTypeKeyfactTypeKeyIdentifier for the Fact type.
    ReturnfactTypeInfoInformation about the specified type of Fact
    ErrorsOPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    Read

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfindFact
    Descriptionretrieves the result of computation of the Fact by the service
    ParametersfactTypeKeyfactTypeKeyFact type idenfifier
    factStructurefactStructureFact Structure containing Fact type and values for the keys required for fact computation.
    ReturnfactResultsvalues for the fact that will be used in the rules - differentiated from normal search results, due to potential differing needs (ex. inclusion of the resultType in expanded form, etc.) Probably need to discuss
    ErrorsOPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    - - - - - - - - - - - - - - -
    -
    -

    Labels

    - Edit - -
    - -
    -
    -
    - kss-rules kss-rules - Delete -
    -
    - - kss-svcs kss-svcs - Delete -
    -
    - kss-service kss-service - Delete - -
    -
    - kss-svb2 kss-svb2 - Delete -
    -
    - - -
    - -
    - - -
    Enter labels to add to this page:
    - - - - - -
    - Please wait  - -
    -
    -
    -
    - Looking for a label? Just start typing. -
    - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - -

    - Add Comment -

    -
    - - - - - - - - - - - - -
    diff --git a/sandbox/kss/wiki_to_java/contracts/To Print/cspace/getCommMediaTypesForUsageType.html.xml b/sandbox/kss/wiki_to_java/contracts/To Print/cspace/getCommMediaTypesForUsageType.html.xml deleted file mode 100644 index 083cf2401..000000000 --- a/sandbox/kss/wiki_to_java/contracts/To Print/cspace/getCommMediaTypesForUsageType.html.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodgetCommMediaTypesForUsageType
    DescriptionRetrieves the list of communication media types that are supported for a given usage type.
    ParameterscommUsageTypeKeycommUsageTypeKeyusage type identifier
    ReturncommMediaTypeInfoListlist of communication media type information
    ErrorsDOES_NOT_EXISTcommUsageTypeKey not found
    INVALID_PARAMETERinvalid commUsageTypeKey
    MISSING_PARAMETERmissing commUsageTypeKey
    OPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    diff --git a/sandbox/kss/wiki_to_java/contracts/To Print/cspace/old/getCommMediaTypesForUsageType.html.xml b/sandbox/kss/wiki_to_java/contracts/To Print/cspace/old/getCommMediaTypesForUsageType.html.xml deleted file mode 100644 index 4705a14f6..000000000 --- a/sandbox/kss/wiki_to_java/contracts/To Print/cspace/old/getCommMediaTypesForUsageType.html.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodgetCommMediaTypesForUsageType
    DescriptionRetrieves the list of communication media types that are supported for a given usage type.
    ParameterscommUsageTypeKeycommUsageTypeKeyusage type identifier
    ReturncommMediaTypeInfoListlist of communication media type information
    ErrorsDOES_NOT_EXISTcommUsageTypeKey not found
    INVALID_PARAMETERinvalid commUsageTypeKey
    MISSING_PARAMETERmissing commUsageTypeKey
    OPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    diff --git a/sandbox/kss/wiki_to_java/contracts/To Print/cspace/old/getCommMediaTypesForUsageType.trimmed.xml b/sandbox/kss/wiki_to_java/contracts/To Print/cspace/old/getCommMediaTypesForUsageType.trimmed.xml deleted file mode 100644 index 3c8c0e3f1..000000000 --- a/sandbox/kss/wiki_to_java/contracts/To Print/cspace/old/getCommMediaTypesForUsageType.trimmed.xml +++ /dev/null @@ -1 +0,0 @@ -
    MethodgetCommMediaTypesForUsageType
    DescriptionRetrieves the list of communication media types that are supported for a given usage type.
    Parameters[commUsageTypeKey]commUsageTypeKeyusage type identifier
    Return[commMediaTypeInfoList]list of communication media type information
    ErrorsDOES_NOT_EXISTcommUsageTypeKey not found
    INVALID_PARAMETERinvalid commUsageTypeKey
    MISSING_PARAMETERmissing commUsageTypeKey
    OPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    diff --git a/sandbox/kss/wiki_to_java/contracts/To Print/cspace/v1.getCommMediaTypesForUsageType.trimmed.xml b/sandbox/kss/wiki_to_java/contracts/To Print/cspace/v1.getCommMediaTypesForUsageType.trimmed.xml deleted file mode 100644 index 811acf241..000000000 --- a/sandbox/kss/wiki_to_java/contracts/To Print/cspace/v1.getCommMediaTypesForUsageType.trimmed.xml +++ /dev/null @@ -1,99 +0,0 @@ - -


    Back to Operations -

    -


    Back to Operations

    -

    -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodgetCommMediaTypesForUsageType
    DescriptionRetrieves the list of communication media types that are supported for a given usage type.
    ParameterscommUsageTypeKeycommUsageTypeKeyusage type identifier
    ReturncommMediaTypeInfoListlist of communication media type information
    ErrorsDOES_NOT_EXISTcommUsageTypeKey not found
    INVALID_PARAMETERinvalid commUsageTypeKey
    MISSING_PARAMETERmissing commUsageTypeKey
    OPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    - -

    -Back to Operations -

    - -

    - -Read -

    - -

    Back to Operations

    -

    - -Search -

    - -

    Back to Operations

    -

    - -Maintenance -

    - -


    Back to Operations

    -


    Back to Operations

    -


    Back to Operations

    -


    Back to Operations

    -


    Back to Operations

    -

    - -

    Capabilities

    -

    diff --git a/sandbox/kss/wiki_to_java/contracts/To Print/cspace/v2.getCommMediaTypesForUsageType.trimmed.xml b/sandbox/kss/wiki_to_java/contracts/To Print/cspace/v2.getCommMediaTypesForUsageType.trimmed.xml deleted file mode 100644 index c83402ce5..000000000 --- a/sandbox/kss/wiki_to_java/contracts/To Print/cspace/v2.getCommMediaTypesForUsageType.trimmed.xml +++ /dev/null @@ -1 +0,0 @@ -


    Back to Operations


    Back to Operations

    MethodgetCommMediaTypesForUsageType
    DescriptionRetrieves the list of communication media types that are supported for a given usage type.
    ParameterscommUsageTypeKeycommUsageTypeKeyusage type identifier
    ReturncommMediaTypeInfoListlist of communication media type information
    ErrorsDOES_NOT_EXISTcommUsageTypeKey not found
    INVALID_PARAMETERinvalid commUsageTypeKey
    MISSING_PARAMETERmissing commUsageTypeKey
    OPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback

    Back to Operations

    Read

    Back to Operations

    Search

    Back to Operations

    Maintenance


    Back to Operations


    Back to Operations


    Back to Operations


    Back to Operations


    Back to Operations

    diff --git a/sandbox/kss/wiki_to_java/contracts/To Print/kss/getCommMediaTypesForUsageType.html.xml b/sandbox/kss/wiki_to_java/contracts/To Print/kss/getCommMediaTypesForUsageType.html.xml deleted file mode 100644 index 8e1fdbef3..000000000 --- a/sandbox/kss/wiki_to_java/contracts/To Print/kss/getCommMediaTypesForUsageType.html.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodgetCommMediaTypesForUsageType
    DescriptionRetrieves the list of communication media types that are supported for a given usage type.
    ParameterscommUsageTypeKeycommUsageTypeKeyusage type identifier
    ReturncommMediaTypeInfoListlist of communication media type information
    ErrorsDOES_NOT_EXISTcommUsageTypeKey not found
    INVALID_PARAMETERinvalid commUsageTypeKey
    MISSING_PARAMETERmissing commUsageTypeKey
    OPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    diff --git a/sandbox/kss/wiki_to_java/contracts/To Print/kss/getCommMediaTypesForUsageType.trimmed.xml b/sandbox/kss/wiki_to_java/contracts/To Print/kss/getCommMediaTypesForUsageType.trimmed.xml deleted file mode 100644 index 67582ce7e..000000000 --- a/sandbox/kss/wiki_to_java/contracts/To Print/kss/getCommMediaTypesForUsageType.trimmed.xml +++ /dev/null @@ -1,27 +0,0 @@ -
    MethodgetCommMediaTypesForUsageType
    DescriptionRetrieves the list -of communication media types that are supported for a given usage -type.
    ParameterscommUsageTypeKeycommUsageTypeKeyusage -type identifier
    ReturncommMediaTypeInfoListlist of communication media type -information
    ErrorsDOES_NOT_EXISTcommUsageTypeKey not found
    INVALID_PARAMETERinvalid commUsageTypeKey
    MISSING_PARAMETERmissing commUsageTypeKey
    OPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    diff --git a/sandbox/kss/wiki_to_java/contracts/To Print/kss/getCommMediaTypesForUsageType.trimmed.xml.bak b/sandbox/kss/wiki_to_java/contracts/To Print/kss/getCommMediaTypesForUsageType.trimmed.xml.bak deleted file mode 100644 index 3bfa96a57..000000000 --- a/sandbox/kss/wiki_to_java/contracts/To Print/kss/getCommMediaTypesForUsageType.trimmed.xml.bak +++ /dev/null @@ -1 +0,0 @@ -
    MethodgetCommMediaTypesForUsageType
    DescriptionRetrieves the list of communication media types that are supported for a given usage type.
    ParameterscommUsageTypeKeycommUsageTypeKeyusage type identifier
    ReturncommMediaTypeInfoListlist of communication media type information
    ErrorsDOES_NOT_EXISTcommUsageTypeKey not found
    INVALID_PARAMETERinvalid commUsageTypeKey
    MISSING_PARAMETERmissing commUsageTypeKey
    OPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    diff --git a/sandbox/kss/wiki_to_java/contracts/To Print/kss/kss_communication_service.html.xml b/sandbox/kss/wiki_to_java/contracts/To Print/kss/kss_communication_service.html.xml deleted file mode 100644 index e69de29bb..000000000 diff --git a/sandbox/kss/wiki_to_java/contracts/comservice.trimmed.html.xml b/sandbox/kss/wiki_to_java/contracts/comservice.trimmed.html.xml deleted file mode 100644 index 8397ccea4..000000000 --- a/sandbox/kss/wiki_to_java/contracts/comservice.trimmed.html.xml +++ /dev/null @@ -1 +0,0 @@ -

    MethodgetCommMediaTypes
    DescriptionRetrieves the list of communication media types that this service knows of.
    ParametersNoneNoneNo parameters
    ReturncommMediaTypeInfoListlist of communication media type information
    ErrorsOPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback

    Back to Operations

    MethodgetCommUsageTypes
    DescriptionRetrieves the list of communication usage types that this service knows of.
    ParametersNoneNoneNo parameters
    ReturncommUsageTypeInfoListlist of communication usage type information
    ErrorsOPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback

    Back to Operations

    MethodgetCommMediaTypesForUsageType
    DescriptionRetrieves the list of communication media types that are supported for a given usage type.
    ParameterscommUsageTypeKeycommUsageTypeKeyusage type identifier
    ReturncommMediaTypeInfoListlist of communication media type information
    ErrorsDOES_NOT_EXISTcommUsageTypeKey not found
    INVALID_PARAMETERinvalid commUsageTypeKey
    MISSING_PARAMETERmissing commUsageTypeKey
    OPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback

    Back to Operations

    Read

    Back to Operations

    Search

    Back to Operations

    Maintenance

    MethodsendMessageToPeople
    DescriptionSends a message to a list of people for a particular media and usage type
    ParameterspersonIdListpersonIdListlist of person identifiers
    commMediaTypeKeycommMediaTypeKeymedia type identifier
    commUsageTypeKeycommUsageTypeKeyusage type identifier
    stringsubjectsubject of the message
    stringmessagemessage to send
    Returnstatusstatus of the operation
    ErrorsDISABLED_IDENTIFIERpersonId found, but has been retired
    DOES_NOT_EXISTpersonId, commMediaTypeKey, commUsageTypeKey not found
    INVALID_PARAMETERinvalid personId, commMediaTypeKey, commUsageTypeKey, subject, message
    MISSING_PARAMETERmissing personId, commMediaTypeKey, commUsageTypeKey, subject, message
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    UNSUPPORTED_ACTIONcommMediaTypeKey is not supported for the commUsageTypeKey
    Capabilities
    Use Cases
    Comments/Feedback

    Back to Operations

    MethodsendMessageToPeopleByUsageType
    DescriptionSends a message to a list of people for a particular usage type
    ParameterspersonIdListpersonIdListlist of person identifiers
    commUsageTypeKeycommUsageTypeKeyusage type identifier
    stringsubjectsubject of the message
    stringmessagemessage to send
    Returnstatusstatus of the operation
    ErrorsDISABLED_IDENTIFIERpersonId found, but has been retired
    DOES_NOT_EXISTpersonId, commUsageTypeKey not found
    INVALID_PARAMETERinvalid personId, commUsageTypeKey, subject, message
    MISSING_PARAMETERmissing personId, commUsageTypeKey, subject, message
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback

    Back to Operations

    MethodsendMessageToPeopleByMediaType
    DescriptionSends a message to a list of people for a particular media type
    ParameterspersonIdListpersonIdListlist of person identifiers
    commMediaTypeKeycommMediaTypeKeymedia type identifier
    stringsubjectsubject of the message
    stringmessagemessage to send
    Returnstatusstatus of the operation
    ErrorsDISABLED_IDENTIFIERpersonId found, but has been retired
    DOES_NOT_EXISTpersonId, commMediaTypeKey not found
    INVALID_PARAMETERinvalid personIdList, commMediaTypeKey, subject, message
    MISSING_PARAMETERmissing personIdList, commMediaTypeKey, subject, message
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback

    Back to Operations

    MethodsendMessageToOrg
    DescriptionSends a message to an organization for a particular media and usage type
    ParametersorgIdListorgIdListlist of organization identifiers
    commMediaTypeKeycommMediaTypeKeymedia type identifier
    commUsageTypeKeycommUsageTypeKeyusage type identifier
    stringsubjectsubject of the message
    stringmessagemessage to send
    Returnstatusstatus of the operation
    ErrorsDOES_NOT_EXISTorgId, commMediaTypeKey, commUsageTypeKey not found
    INVALID_PARAMETERinvalid orgIdList, commMediaTypeKey, commUsageTypeKey, subject, message
    MISSING_PARAMETERmissing orgIdList, commMediaTypeKey, commUsageTypeKey, subject, message
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    UNSUPPORTED_ACTIONcommMediaTypeKey is not supported for the commUsageTypeKey
    Capabilities
    Use Cases
    Comments/Feedback

    Back to Operations

    MethodsendMessageToOrgByUsageType
    DescriptionSends a message to an organization for a particular usage type
    ParametersorgIdListorgIdListlist of organization identifier
    commUsageTypeKeycommUsageTypeKeyusage type identifier
    stringsubjectsubject of the message
    stringmessagemessage to send
    Returnstatusstatus of the operation
    ErrorsDOES_NOT_EXISTorgId, commUsageTypeKey not found
    INVALID_PARAMETERinvalid orgIdList, commUsageTypeKey, subject, message
    MISSING_PARAMETERmissing orgIdList, commUsageTypeKey, subject, message
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback

    Back to Operations

    diff --git a/sandbox/kss/wiki_to_java/contracts/ffservice b/sandbox/kss/wiki_to_java/contracts/ffservice deleted file mode 100644 index 8e5061b9b..000000000 --- a/sandbox/kss/wiki_to_java/contracts/ffservice +++ /dev/null @@ -1,930 +0,0 @@ - - - - Fact Finder Service - KS Workspace - Confluence - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    - - - Fact Finder Service - -

    - - - - - - - - - - - - - - - - - -
    - - - - - - - -
    - -

    Fact Finder Service

    - - - - - - - - - - - - -
    NameFactFinderService
    VersionDevRelease Notes/History
    - - - - - - - -
    References Operations Capabilities
    - -

    References

    - -

    Fact Finder Service Description and Assumptions
    -Business Rules Management Service Description and Assumptions
    -BRMS Entity Diagram - diagram used in the creation of BRMS
    - -BRMS Core Technical Entity Diagram
    -BRMS Design Specification
    -BRMS stack describes the relationship between the BRMS and the run-time rules engine (Drools)
    -BRMS Structures

    - -

    Operations

    - - - -
    -
    -Setup -
    - - -
    - -
    Read
    - -

    - -

    Setup

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfindFactTypes
    DescriptionRetrieves the list of Facts Types known by this service.
    ParametersNoneNoneNo parameters
    ReturnfactTypeInfoListList of Fact type information Do we want to switch this to just keys due to amount of information?
    ErrorsOPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfetchFactType
    DescriptionRetrieves information about a type of Fact, listing all the keys required for its computation.
    ParametersfactTypeKeyfactTypeKeyIdentifier for the Fact type.
    ReturnfactTypeInfoInformation about the specified type of Fact
    ErrorsOPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    Read

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfindFact
    Descriptionretrieves the result of computation of the Fact by the service
    ParametersfactTypeKeyfactTypeKeyFact type idenfifier
    factStructurefactStructureFact Structure containing Fact type and values for the keys required for fact computation.
    ReturnfactResultsvalues for the fact that will be used in the rules - differentiated from normal search results, due to potential differing needs (ex. inclusion of the resultType in expanded form, etc.) Probably need to discuss
    ErrorsOPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    - -

    Capabilities

    -
    - - - - - - - - - - - - - -
    -
    -

    Labels

    - Edit - -
    - -
    -
    -
    - kss-rules kss-rules - Delete -
    -
    - - kss-svcs kss-svcs - Delete -
    -
    - kss-service kss-service - Delete - -
    -
    - kss-svb2 kss-svb2 - Delete -
    -
    - - -
    - -
    - - -
    Enter labels to add to this page:
    - - - - - -
    - Please wait  - -
    -
    -
    -
    - Looking for a label? Just start typing. -
    - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - -

    - Add Comment -

    -
    - - - - -
    -
    - - - - - - diff --git a/sandbox/kss/wiki_to_java/contracts/ffservice.bak b/sandbox/kss/wiki_to_java/contracts/ffservice.bak deleted file mode 100644 index e22f43358..000000000 --- a/sandbox/kss/wiki_to_java/contracts/ffservice.bak +++ /dev/null @@ -1,921 +0,0 @@ - - - - Fact Finder Service - KS Workspace - Confluence - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    - - - Fact Finder Service - -

    - - - - - - - - - - - - - - - - - -
    - - - - - - - -
    - -

    Fact Finder Service

    - - - - - - - - - - - - -
    NameFactFinderService
    VersionDevRelease Notes/History
    - - - - - - - -
    References Operations Capabilities
    - -

    References

    - -

    Fact Finder Service Description and Assumptions
    -Business Rules Management Service Description and Assumptions
    -BRMS Entity Diagram - diagram used in the creation of BRMS
    - -BRMS Core Technical Entity Diagram
    -BRMS Design Specification
    -BRMS stack describes the relationship between the BRMS and the run-time rules engine (Drools)
    -BRMS Structures

    - -

    Operations

    - - - - - -
    Read
    - -

    - -

    Setup

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfindFactTypes
    DescriptionRetrieves the list of Facts Types known by this service.
    ParametersNoneNoneNo parameters
    ReturnfactTypeInfoListList of Fact type information Do we want to switch this to just keys due to amount of information?
    ErrorsOPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfetchFactType
    DescriptionRetrieves information about a type of Fact, listing all the keys required for its computation.
    ParametersfactTypeKeyfactTypeKeyIdentifier for the Fact type.
    ReturnfactTypeInfoInformation about the specified type of Fact
    ErrorsOPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    Read

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfindFact
    Descriptionretrieves the result of computation of the Fact by the service
    ParametersfactTypeKeyfactTypeKeyFact type idenfifier
    factStructurefactStructureFact Structure containing Fact type and values for the keys required for fact computation.
    ReturnfactResultsvalues for the fact that will be used in the rules - differentiated from normal search results, due to potential differing needs (ex. inclusion of the resultType in expanded form, etc.) Probably need to discuss
    ErrorsOPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    -
    - - - - - - - - - - - - - -
    -
    -

    Labels

    - Edit - -
    - -
    -
    -
    - kss-rules kss-rules - Delete -
    -
    - - kss-svcs kss-svcs - Delete -
    -
    - kss-service kss-service - Delete - -
    -
    - kss-svb2 kss-svb2 - Delete -
    -
    - - -
    - -
    - - -
    Enter labels to add to this page:
    - - - - - -
    - Please wait  - -
    -
    -
    -
    - Looking for a label? Just start typing. -
    - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - -

    - Add Comment -

    -
    - - - - -
    -
    - - - - - - diff --git a/sandbox/kss/wiki_to_java/contracts/kss.trimmed.xml b/sandbox/kss/wiki_to_java/contracts/kss.trimmed.xml deleted file mode 100644 index 308b3fc40..000000000 --- a/sandbox/kss/wiki_to_java/contracts/kss.trimmed.xml +++ /dev/null @@ -1 +0,0 @@ -

    MethodfindObjectTypes
    DescriptionRetrieves the list of object type identifiers known by this service. Example: cluInfo.
    ParametersNoneNoneNo parameters
    ReturnobjectTypeKeyListlist of object type identifiers
    ErrorsOPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    Back to Operations

    MethodfetchObjectStructure
    DescriptionRetrieves the basic dictionary information about a particular object structure. Including all variations based on a certain type and state. Example: Given that a CLU is of type "Course" and in the state of "Proposed," tell which fields are read only, mandatory, not applicable, have enumerations available, etc.
    ParametersobjectTypeKeyobjectTypeKeyidentifier of the object type
    ReturnobjectStructuredescribes the fields for the input object type
    ErrorsDOES_NOT_EXISTspecified objectTypeKey not found
    INVALID_PARAMETERinvalid objectTypeKey
    MISSING_PARAMETERmissing objectTypeKey
    OPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    Back to Operations

    MethodfetchEnumeration
    DescriptionRetrieves the list of enumeration values for a particular enumeration with a certain context for a particular date. The values returned should be those where the supplied date is between the effective and expiration dates. Certain enumerations may not support this functionality.
    ParametersenumerationKeyenumerationKeyidentifier of the enumeration
    enumContextKeycontextTypeidentifier of the enumeration context type
    stringcontextValuevalue of the enumeration context
    dateTimecontextDatedate and time to get the enumeration for
    ReturnenumeratedValueListlist of enumerated codes and values
    ErrorsDOES_NOT_EXISTenumerationKey not found
    INVALID_PARAMETERinvalid enumerationKey, contextType, contextValue, contextDate
    MISSING_PARAMETERmissing enumerationKey, contextType, contextValue, contextDate
    OPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    Back to Operations

    MethodfindSearchTypes
    DescriptionRetrieves the list of search types known by this service.
    ParametersNoneNoneNo Parameters
    ReturnsearchTypeInfoListlist of search type information
    ErrorsOPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    Back to Operations

    MethodfetchSearchType
    DescriptionRetrieves information about a particular search type.
    ParameterssearchTypeKeysearchTypeKeyidentifier of the search type
    ReturnsearchTypeInfoinformation on the search type
    ErrorsDOES_NOT_EXISTspecified searchTypeKey not found
    INVALID_PARAMETERinvalid searchTypeKey
    MISSING_PARAMETERsearchTypeKey not specified
    OPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    Back to Operations

    MethodfindSearchTypesByResult
    DescriptionRetrieves the list of search types which return results in the specified format.
    ParameterssearchResultTypeKeysearchResultTypeKeyidentifier of the search result type
    ReturnsearchTypeInfoListlist of search type information
    ErrorsDOES_NOT_EXISTspecified searchResultTypeKey not found
    INVALID_PARAMETERinvalid searchResultTypeKey
    MISSING_PARAMETERsearchResultTypeKey not specified
    OPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    Back to Operations

    MethodfindSearchTypesByCriteria
    DescriptionRetrieves the list of search types which use criteria in the specified format.
    ParameterssearchCriteriaTypeKeysearchCriteriaTypeKeyidentifier of the search criteria
    ReturnsearchTypeInfoListlist of search type information
    ErrorsDOES_NOT_EXISTspecified searchCriteriaTypeKey not found
    INVALID_PARAMETERinvalid searchCriteriaTypeKey
    MISSING_PARAMETERsearchCriteriaTypeKey not specified
    OPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    Back to Operations

    MethodfindSearchResultTypes
    DescriptionRetrieves the list of search result types known by this service. Search result types describe the return structure for a search.
    ParametersNoneNoneNo Parameters
    ReturnsearchResultTypeInfoListlist of search result type information
    ErrorsOPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    Back to Operations

    MethodfetchSearchResultType
    DescriptionRetrieves information about a particular search result type. Search result types describe the return structure for a search.
    ParameterssearchResultTypeKeysearchResultTypeKeyidentifier of the search result type
    ReturnsearchResultTypeInfoinformation on the search result type
    ErrorsDOES_NOT_EXISTspecified searchResultTypeKey not found
    INVALID_PARAMETERinvalid searchResultTypeKey
    MISSING_PARAMETERsearchResultTypeKey not specified
    OPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    Back to Operations

    MethodfindSearchCriteriaTypes
    DescriptionRetrieves the list of search criteria types known by this service.
    ParametersNoneNoneNo parameters
    ReturnsearchCriteriaTypeInfoListlist of search criteria type information
    ErrorsOPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    Back to Operations

    MethodfetchSearchCriteriaType
    DescriptionRetrieves information about a particular search criteria type.
    ParameterssearchCriteriaTypeKeysearchCriteriaTypeKeyidentifier of the search criteria type
    ReturnsearchCriteriaTypeInfoinformation on the search criteria type
    ErrorsDOES_NOT_EXISTspecified searchCriteriaTypeKey not found
    INVALID_PARAMETERinvalid searchCriteriaTypeKey
    MISSING_PARAMETERsearchCriteriaTypeKey not specified
    OPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    Back to Operations

    MethodfindAuthenticationTypes
    DescriptionRetrieve the list of authentication types known by this service
    ParametersNoneNoneNo parameters
    ReturnauthenticationTypeListlist of authentication types
    ErrorsOPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    Back to Operations

    Read

    MethodfindPrincipalIdsByPerson
    DescriptionRetrieves a list of Principals for a given Person
    ParameterspersonIdpersonIdperson identifier
    ReturnprincipalIdListlist of principal ids for the specified person
    ErrorsDISABLED_IDENTIFIERpersonId found but has been retired
    DOES_NOT_EXISTpersonId not found
    INVALID_PARAMETERinvalid personId
    MISSING_PARAMETERmissing personId
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback
    Back to Operations

    MethodfindPrincipalIdsBySystem
    DescriptionRetrieves a list of Principals for a given System
    ParameterssystemIdsystemIdsystem identifier
    ReturnprincipalIdListlist of principal ids for the given system
    ErrorsDISABLED_IDENTIFIERsystemId found but has been retired
    DOES_NOT_EXISTsystemId not found
    INVALID_PARAMETERinvalid systemId
    MISSING_PARAMETERmissing systemId
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback
    Back to Operations

    MethodfetchPersonIdByPrincipal
    DescriptionRetrieves a Person for a given Principal
    ParametersprincipalIdprincipalIdprincipal identifier
    ReturnpersonIdperson identifier that matches the supplied criteria
    ErrorsDISABLED_IDENTIFIERprincipalId found but has been retired
    DOES_NOT_EXISTprincipalId not found
    INVALID_PARAMETERinvalid principalId
    MISSING_PARAMETERmissing principalId
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback
    Back to Operations

    MethodfetchSystemByPrincipal
    DescriptionRetrieves a System for a given Principal
    ParametersprincipalIdprincipalIdprincipal identifier
    ReturnsystemIdsystem identifier that matches the supplied criteria
    ErrorsDISABLED_IDENTIFIERsystemId found but has been retired
    DOES_NOT_EXISTsystemId not found
    INVALID_PARAMETERinvalid principalId
    MISSING_PARAMETERmissing principalId
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback
    Back to Operations

    MethodfetchPrincipalTypeForPrincipal
    DescriptionRetrieves a Principal Type for a given Principal
    ParametersprincipalIdprincipalIdprincipal identifier
    ReturnprincipalTypeprincipal type that matches the supplied criteria
    ErrorsDISABLED_IDENTIFIERprincipalId found but has been retired
    DOES_NOT_EXISTprincipalId not found
    INVALID_PARAMETERinvalid principalId
    MISSING_PARAMETERmissing principalId
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback
    Back to Operations

    MethodfindPrincipalTypesByPrincipalIdList
    DescriptionRetrieves a list of Principal Types for a given list of Principal Ids
    ParametersprincipalIdListprincipalIdListlist of principal identifiers
    ReturnprincipalTypeListList of principal types that match the supplied criteria
    ErrorsDISABLED_IDENTIFIEROne or more principalIds found but have been retired
    DOES_NOT_EXISTOne or more principalIds not found
    INVALID_PARAMETERinvalid principalIdList
    MISSING_PARAMETERmissing principalId
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback
    Back to Operations

    Search

    MethodsearchForResults
    DescriptionRetrieves results in tabular form for the specified parameters.
    Parameters[searchTypeKey]searchTypeKeysearch identifier
    [queryParamValueList]queryParamValueslist of values for search parameters
    Return[resultList]list of results from the query
    ErrorsDOES_NOT_EXISTspecified search type not found
    INVALID_PARAMETERinvalid searchTypeKey, queryParamValueList
    MISSING_PARAMETERsearchTypeKey, queryParamValueList not specified
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback
    Back to Operations

    Maintenance

    MethodassignPrincipalToPerson
    DescriptionAssigns a Principal to a Person
    ParametersprincipalIdprincipalIdprincipal identifier
    personIdpersonIdperson identifier
    Returnstatusstatus of the operation
    ErrorsALREADY_EXISTSassociation already exists
    DISABLED_IDENTIFIERpersonId or principalId found but has been retired
    DOES_NOT_EXISTpersonId, principalId does not exist
    INVALID_PARAMETERinvalid personId, principalId
    MISSING_PARAMETERmissing personId, principalId
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback
    Back to Operations

    MethodassignPrincipalToSystem
    DescriptionAssigns a Principal to a System
    ParametersprincipalIdprincipalIdprincipal identifier
    systemIdsystemIdsystem identifier
    Returnstatusstatus of the operation
    ErrorsALREADY_EXISTSassociation already exists
    DISABLED_IDENTIFIERprincipalId, systemId found but has been retired
    DOES_NOT_EXISTprincipalId, systemId does not exist
    INVALID_PARAMETERinvalid principalId, systemId
    MISSING_PARAMETERmissing principalId, systemId
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback
    Back to Operations

    MethodremovePrincipalFromPerson
    DescriptionRemove a Principal from a Person
    ParametersprincipalIdprincipalIdprincipal identifier
    personIdpersonIdperson identifier
    Returnstatusstatus of the operation
    ErrorsDISABLED_IDENTIFIERpersonId or principalId found but has been retired
    DOES_NOT_EXISTpersonId, principalId, association does not exist
    INVALID_PARAMETERinvalid personId, principalId
    MISSING_PARAMETERmissing personId, principalId
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback
    Back to Operations

    MethodremovePrincipalFromSystem
    DescriptionRemove a Principal from a System
    ParametersprincipalIdprincipalIdprincipal identifier
    systemIdsystemIdsystem identifier
    Returnstatusstatus of the operation
    ErrorsDISABLED_IDENTIFIERprincipalId, systemId found but has been retired
    DOES_NOT_EXISTprincipalId, systemId, association does not exist
    INVALID_PARAMETERinvalid principalId, systemId
    MISSING_PARAMETERmissing principalId, systemId
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback
    Back to Operations

    \ No newline at end of file diff --git a/sandbox/kss/wiki_to_java/contracts/servicetemplate b/sandbox/kss/wiki_to_java/contracts/servicetemplate deleted file mode 100644 index 5321d4e1e..000000000 --- a/sandbox/kss/wiki_to_java/contracts/servicetemplate +++ /dev/null @@ -1,1281 +0,0 @@ -

    - -

    Setup

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfindObjectTypes
    DescriptionRetrieves the list of object type identifiers known by this service. Example: cluInfo.
    ParametersNoneNoneNo parameters
    ReturnobjectTypeKeyListlist of object type identifiers
    ErrorsOPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfetchObjectStructure
    DescriptionRetrieves the basic dictionary information about a particular object structure. Including all variations based on a certain type and state. Example: Given that a CLU is of type "Course" and in the state of "Proposed," tell which fields are read only, mandatory, not applicable, have enumerations available, etc.
    ParametersobjectTypeKeyobjectTypeKeyidentifier of the object type
    ReturnobjectStructuredescribes the fields for the input object type
    ErrorsDOES_NOT_EXISTspecified objectTypeKey not found
    INVALID_PARAMETERinvalid objectTypeKey
    MISSING_PARAMETERmissing objectTypeKey
    OPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfetchEnumeration
    DescriptionRetrieves the list of enumeration values for a particular enumeration with a certain context for a particular date. The values returned should be those where the supplied date is between the effective and expiration dates. Certain enumerations may not support this functionality.
    ParametersenumerationKeyenumerationKeyidentifier of the enumeration
    enumContextKeycontextTypeidentifier of the enumeration context type
    stringcontextValuevalue of the enumeration context
    dateTimecontextDatedate and time to get the enumeration for
    ReturnenumeratedValueListlist of enumerated codes and values
    ErrorsDOES_NOT_EXISTenumerationKey not found
    INVALID_PARAMETERinvalid enumerationKey, contextType, contextValue, contextDate
    MISSING_PARAMETERmissing enumerationKey, contextType, contextValue, contextDate
    OPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfindSearchTypes
    DescriptionRetrieves the list of search types known by this service.
    ParametersNoneNoneNo Parameters
    ReturnsearchTypeInfoListlist of search type information
    ErrorsOPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfetchSearchType
    DescriptionRetrieves information about a particular search type.
    ParameterssearchTypeKeysearchTypeKeyidentifier of the search type
    ReturnsearchTypeInfoinformation on the search type
    ErrorsDOES_NOT_EXISTspecified searchTypeKey not found
    INVALID_PARAMETERinvalid searchTypeKey
    MISSING_PARAMETERsearchTypeKey not specified
    OPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfindSearchTypesByResult
    DescriptionRetrieves the list of search types which return results in the specified format.
    ParameterssearchResultTypeKeysearchResultTypeKeyidentifier of the search result type
    ReturnsearchTypeInfoListlist of search type information
    ErrorsDOES_NOT_EXISTspecified searchResultTypeKey not found
    INVALID_PARAMETERinvalid searchResultTypeKey
    MISSING_PARAMETERsearchResultTypeKey not specified
    OPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    - -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfindSearchTypesByCriteria
    DescriptionRetrieves the list of search types which use criteria in the specified format.
    ParameterssearchCriteriaTypeKeysearchCriteriaTypeKeyidentifier of the search criteria
    ReturnsearchTypeInfoListlist of search type information
    ErrorsDOES_NOT_EXISTspecified searchCriteriaTypeKey not found
    INVALID_PARAMETERinvalid searchCriteriaTypeKey
    MISSING_PARAMETERsearchCriteriaTypeKey not specified
    OPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfindSearchResultTypes
    DescriptionRetrieves the list of search result types known by this service. Search result types describe the return structure for a search.
    ParametersNoneNoneNo Parameters
    ReturnsearchResultTypeInfoListlist of search result type information
    ErrorsOPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfetchSearchResultType
    DescriptionRetrieves information about a particular search result type. Search result types describe the return structure for a search.
    ParameterssearchResultTypeKeysearchResultTypeKeyidentifier of the search result type
    ReturnsearchResultTypeInfoinformation on the search result type
    ErrorsDOES_NOT_EXISTspecified searchResultTypeKey not found
    INVALID_PARAMETERinvalid searchResultTypeKey
    MISSING_PARAMETERsearchResultTypeKey not specified
    OPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfindSearchCriteriaTypes
    DescriptionRetrieves the list of search criteria types known by this service.
    ParametersNoneNoneNo parameters
    ReturnsearchCriteriaTypeInfoListlist of search criteria type information
    ErrorsOPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfetchSearchCriteriaType
    DescriptionRetrieves information about a particular search criteria type.
    ParameterssearchCriteriaTypeKeysearchCriteriaTypeKeyidentifier of the search criteria type
    ReturnsearchCriteriaTypeInfoinformation on the search criteria type
    ErrorsDOES_NOT_EXISTspecified searchCriteriaTypeKey not found
    INVALID_PARAMETERinvalid searchCriteriaTypeKey
    MISSING_PARAMETERsearchCriteriaTypeKey not specified
    OPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    - -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfindAuthenticationTypes
    DescriptionRetrieve the list of authentication types known by this service
    ParametersNoneNoneNo parameters
    ReturnauthenticationTypeListlist of authentication types
    ErrorsOPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    Read

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfindPrincipalIdsByPerson
    DescriptionRetrieves a list of Principals for a given Person
    ParameterspersonIdpersonIdperson identifier
    ReturnprincipalIdListlist of principal ids for the specified person
    ErrorsDISABLED_IDENTIFIERpersonId found but has been retired
    DOES_NOT_EXISTpersonId not found
    INVALID_PARAMETERinvalid personId
    MISSING_PARAMETERmissing personId
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfindPrincipalIdsBySystem
    DescriptionRetrieves a list of Principals for a given System
    ParameterssystemIdsystemIdsystem identifier
    ReturnprincipalIdListlist of principal ids for the given system
    ErrorsDISABLED_IDENTIFIERsystemId found but has been retired
    DOES_NOT_EXISTsystemId not found
    INVALID_PARAMETERinvalid systemId
    MISSING_PARAMETERmissing systemId
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfetchPersonIdByPrincipal
    DescriptionRetrieves a Person for a given Principal
    ParametersprincipalIdprincipalIdprincipal identifier
    ReturnpersonIdperson identifier that matches the supplied criteria
    ErrorsDISABLED_IDENTIFIERprincipalId found but has been retired
    DOES_NOT_EXISTprincipalId not found
    INVALID_PARAMETERinvalid principalId
    MISSING_PARAMETERmissing principalId
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfetchSystemByPrincipal
    DescriptionRetrieves a System for a given Principal
    ParametersprincipalIdprincipalIdprincipal identifier
    ReturnsystemIdsystem identifier that matches the supplied criteria
    ErrorsDISABLED_IDENTIFIERsystemId found but has been retired
    DOES_NOT_EXISTsystemId not found
    INVALID_PARAMETERinvalid principalId
    MISSING_PARAMETERmissing principalId
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfetchPrincipalTypeForPrincipal
    DescriptionRetrieves a Principal Type for a given Principal
    ParametersprincipalIdprincipalIdprincipal identifier
    ReturnprincipalTypeprincipal type that matches the supplied criteria
    ErrorsDISABLED_IDENTIFIERprincipalId found but has been retired
    DOES_NOT_EXISTprincipalId not found
    INVALID_PARAMETERinvalid principalId
    MISSING_PARAMETERmissing principalId
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfindPrincipalTypesByPrincipalIdList
    DescriptionRetrieves a list of Principal Types for a given list of Principal Ids
    ParametersprincipalIdListprincipalIdListlist of principal identifiers
    ReturnprincipalTypeListList of principal types that match the supplied criteria
    ErrorsDISABLED_IDENTIFIEROne or more principalIds found but have been retired
    DOES_NOT_EXISTOne or more principalIds not found
    INVALID_PARAMETERinvalid principalIdList
    MISSING_PARAMETERmissing principalId
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    Search

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodsearchForResults
    DescriptionRetrieves results in tabular form for the specified parameters.
    ParameterssearchTypeKeysearchTypeKeysearch identifier
    queryParamValueListqueryParamValueslist of values for search parameters
    ReturnresultListlist of results from the query
    ErrorsDOES_NOT_EXISTspecified search type not found
    INVALID_PARAMETERinvalid searchTypeKey, queryParamValueList
    MISSING_PARAMETERsearchTypeKey, queryParamValueList not specified
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    Maintenance

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodassignPrincipalToPerson
    DescriptionAssigns a Principal to a Person
    ParametersprincipalIdprincipalIdprincipal identifier
    personIdpersonIdperson identifier
    Returnstatusstatus of the operation
    ErrorsALREADY_EXISTSassociation already exists
    DISABLED_IDENTIFIERpersonId or principalId found but has been retired
    DOES_NOT_EXISTpersonId, principalId does not exist
    INVALID_PARAMETERinvalid personId, principalId
    MISSING_PARAMETERmissing personId, principalId
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodassignPrincipalToSystem
    DescriptionAssigns a Principal to a System
    ParametersprincipalIdprincipalIdprincipal identifier
    systemIdsystemIdsystem identifier
    Returnstatusstatus of the operation
    ErrorsALREADY_EXISTSassociation already exists
    DISABLED_IDENTIFIERprincipalId, systemId found but has been retired
    DOES_NOT_EXISTprincipalId, systemId does not exist
    INVALID_PARAMETERinvalid principalId, systemId
    MISSING_PARAMETERmissing principalId, systemId
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodremovePrincipalFromPerson
    DescriptionRemove a Principal from a Person
    ParametersprincipalIdprincipalIdprincipal identifier
    personIdpersonIdperson identifier
    Returnstatusstatus of the operation
    ErrorsDISABLED_IDENTIFIERpersonId or principalId found but has been retired
    DOES_NOT_EXISTpersonId, principalId, association does not exist
    INVALID_PARAMETERinvalid personId, principalId
    MISSING_PARAMETERmissing personId, principalId
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodremovePrincipalFromSystem
    DescriptionRemove a Principal from a System
    ParametersprincipalIdprincipalIdprincipal identifier
    systemIdsystemIdsystem identifier
    Returnstatusstatus of the operation
    ErrorsDISABLED_IDENTIFIERprincipalId, systemId found but has been retired
    DOES_NOT_EXISTprincipalId, systemId, association does not exist
    INVALID_PARAMETERinvalid principalId, systemId
    MISSING_PARAMETERmissing principalId, systemId
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback
    - -

    Back to Operations

    - -

    - -

    Capabilities

    - - - - - - - - - - - - - - -
    -
    -

    Labels

    - - Edit - -
    - -
    -
    -
    - - kss-svcs kss-svcs - Delete -
    -
    - kss-pi kss-pi - Delete - -
    -
    - kss-service kss-service - Delete -
    -
    - kss-svb1 kss-svb1 - - Delete -
    -
    - - -
    -
    - - -
    Enter labels to add to this page:
    - - - - -
    - Please wait  - - -
    -
    -
    -
    - Looking for a label? Just start typing. -
    -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - -

    - Add Comment -

    -
    - - - - - - - - - - - - \ No newline at end of file diff --git a/sandbox/kss/wiki_to_java/contracts/servicetemplate.bak b/sandbox/kss/wiki_to_java/contracts/servicetemplate.bak deleted file mode 100644 index 5b0ab97c3..000000000 --- a/sandbox/kss/wiki_to_java/contracts/servicetemplate.bak +++ /dev/null @@ -1,1965 +0,0 @@ - - - - Authentication Service - KS Workspace - Confluence - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    - - - Authentication Service - -

    - - - - - - - - - - - - - - - - - -
    - - - - - - - -
    - -

    Authentication Service

    - - - - - - - - - - - - -
    NameAuthenticationService
    VersionDevRelease Notes/History
    - - - - - - - -
    References Operations Capabilities
    - -


    -
    Authentication Service Description and Assumptions
    -This service establishes identity only. It may also provide a mapping from the identity "Principal" to the Person_Id. -
    - -
    Notes
    - -
    - -

    References

    - -

    Authentication Service Description and Assumptions
    -Authentication Service Structures

    - -

    Principal Entity and Principal Set Entity - entity page with fields and examples.
    - -Authentication Stack Options - help understand how the Authentication service might interact with other service layers
    -PI Meeting Diagrams

    - -

    Operations

    - - - - - - - - - -
    Maintenance
    - -

    assignPrincipalToPerson
    -assignPrincipalToSystem Changed Service to System
    -removePrincipalFromPerson
    -removePrincipalFromSystem Changed Service to System

    -
    - -

    - -

    Setup

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfindObjectTypes
    DescriptionRetrieves the list of object type identifiers known by this service. Example: cluInfo.
    ParametersNoneNoneNo parameters
    ReturnobjectTypeKeyListlist of object type identifiers
    ErrorsOPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfetchObjectStructure
    DescriptionRetrieves the basic dictionary information about a particular object structure. Including all variations based on a certain type and state. Example: Given that a CLU is of type "Course" and in the state of "Proposed," tell which fields are read only, mandatory, not applicable, have enumerations available, etc.
    ParametersobjectTypeKeyobjectTypeKeyidentifier of the object type
    ReturnobjectStructuredescribes the fields for the input object type
    ErrorsDOES_NOT_EXISTspecified objectTypeKey not found
    INVALID_PARAMETERinvalid objectTypeKey
    MISSING_PARAMETERmissing objectTypeKey
    OPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfetchEnumeration
    DescriptionRetrieves the list of enumeration values for a particular enumeration with a certain context for a particular date. The values returned should be those where the supplied date is between the effective and expiration dates. Certain enumerations may not support this functionality.
    ParametersenumerationKeyenumerationKeyidentifier of the enumeration
    enumContextKeycontextTypeidentifier of the enumeration context type
    stringcontextValuevalue of the enumeration context
    dateTimecontextDatedate and time to get the enumeration for
    ReturnenumeratedValueListlist of enumerated codes and values
    ErrorsDOES_NOT_EXISTenumerationKey not found
    INVALID_PARAMETERinvalid enumerationKey, contextType, contextValue, contextDate
    MISSING_PARAMETERmissing enumerationKey, contextType, contextValue, contextDate
    OPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfindSearchTypes
    DescriptionRetrieves the list of search types known by this service.
    ParametersNoneNoneNo Parameters
    ReturnsearchTypeInfoListlist of search type information
    ErrorsOPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfetchSearchType
    DescriptionRetrieves information about a particular search type.
    ParameterssearchTypeKeysearchTypeKeyidentifier of the search type
    ReturnsearchTypeInfoinformation on the search type
    ErrorsDOES_NOT_EXISTspecified searchTypeKey not found
    INVALID_PARAMETERinvalid searchTypeKey
    MISSING_PARAMETERsearchTypeKey not specified
    OPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfindSearchTypesByResult
    DescriptionRetrieves the list of search types which return results in the specified format.
    ParameterssearchResultTypeKeysearchResultTypeKeyidentifier of the search result type
    ReturnsearchTypeInfoListlist of search type information
    ErrorsDOES_NOT_EXISTspecified searchResultTypeKey not found
    INVALID_PARAMETERinvalid searchResultTypeKey
    MISSING_PARAMETERsearchResultTypeKey not specified
    OPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    - -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfindSearchTypesByCriteria
    DescriptionRetrieves the list of search types which use criteria in the specified format.
    ParameterssearchCriteriaTypeKeysearchCriteriaTypeKeyidentifier of the search criteria
    ReturnsearchTypeInfoListlist of search type information
    ErrorsDOES_NOT_EXISTspecified searchCriteriaTypeKey not found
    INVALID_PARAMETERinvalid searchCriteriaTypeKey
    MISSING_PARAMETERsearchCriteriaTypeKey not specified
    OPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfindSearchResultTypes
    DescriptionRetrieves the list of search result types known by this service. Search result types describe the return structure for a search.
    ParametersNoneNoneNo Parameters
    ReturnsearchResultTypeInfoListlist of search result type information
    ErrorsOPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfetchSearchResultType
    DescriptionRetrieves information about a particular search result type. Search result types describe the return structure for a search.
    ParameterssearchResultTypeKeysearchResultTypeKeyidentifier of the search result type
    ReturnsearchResultTypeInfoinformation on the search result type
    ErrorsDOES_NOT_EXISTspecified searchResultTypeKey not found
    INVALID_PARAMETERinvalid searchResultTypeKey
    MISSING_PARAMETERsearchResultTypeKey not specified
    OPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfindSearchCriteriaTypes
    DescriptionRetrieves the list of search criteria types known by this service.
    ParametersNoneNoneNo parameters
    ReturnsearchCriteriaTypeInfoListlist of search criteria type information
    ErrorsOPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfetchSearchCriteriaType
    DescriptionRetrieves information about a particular search criteria type.
    ParameterssearchCriteriaTypeKeysearchCriteriaTypeKeyidentifier of the search criteria type
    ReturnsearchCriteriaTypeInfoinformation on the search criteria type
    ErrorsDOES_NOT_EXISTspecified searchCriteriaTypeKey not found
    INVALID_PARAMETERinvalid searchCriteriaTypeKey
    MISSING_PARAMETERsearchCriteriaTypeKey not specified
    OPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    - -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfindAuthenticationTypes
    DescriptionRetrieve the list of authentication types known by this service
    ParametersNoneNoneNo parameters
    ReturnauthenticationTypeListlist of authentication types
    ErrorsOPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    Read

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfindPrincipalIdsByPerson
    DescriptionRetrieves a list of Principals for a given Person
    ParameterspersonIdpersonIdperson identifier
    ReturnprincipalIdListlist of principal ids for the specified person
    ErrorsDISABLED_IDENTIFIERpersonId found but has been retired
    DOES_NOT_EXISTpersonId not found
    INVALID_PARAMETERinvalid personId
    MISSING_PARAMETERmissing personId
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfindPrincipalIdsBySystem
    DescriptionRetrieves a list of Principals for a given System
    ParameterssystemIdsystemIdsystem identifier
    ReturnprincipalIdListlist of principal ids for the given system
    ErrorsDISABLED_IDENTIFIERsystemId found but has been retired
    DOES_NOT_EXISTsystemId not found
    INVALID_PARAMETERinvalid systemId
    MISSING_PARAMETERmissing systemId
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfetchPersonIdByPrincipal
    DescriptionRetrieves a Person for a given Principal
    ParametersprincipalIdprincipalIdprincipal identifier
    ReturnpersonIdperson identifier that matches the supplied criteria
    ErrorsDISABLED_IDENTIFIERprincipalId found but has been retired
    DOES_NOT_EXISTprincipalId not found
    INVALID_PARAMETERinvalid principalId
    MISSING_PARAMETERmissing principalId
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfetchSystemByPrincipal
    DescriptionRetrieves a System for a given Principal
    ParametersprincipalIdprincipalIdprincipal identifier
    ReturnsystemIdsystem identifier that matches the supplied criteria
    ErrorsDISABLED_IDENTIFIERsystemId found but has been retired
    DOES_NOT_EXISTsystemId not found
    INVALID_PARAMETERinvalid principalId
    MISSING_PARAMETERmissing principalId
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfetchPrincipalTypeForPrincipal
    DescriptionRetrieves a Principal Type for a given Principal
    ParametersprincipalIdprincipalIdprincipal identifier
    ReturnprincipalTypeprincipal type that matches the supplied criteria
    ErrorsDISABLED_IDENTIFIERprincipalId found but has been retired
    DOES_NOT_EXISTprincipalId not found
    INVALID_PARAMETERinvalid principalId
    MISSING_PARAMETERmissing principalId
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfindPrincipalTypesByPrincipalIdList
    DescriptionRetrieves a list of Principal Types for a given list of Principal Ids
    ParametersprincipalIdListprincipalIdListlist of principal identifiers
    ReturnprincipalTypeListList of principal types that match the supplied criteria
    ErrorsDISABLED_IDENTIFIEROne or more principalIds found but have been retired
    DOES_NOT_EXISTOne or more principalIds not found
    INVALID_PARAMETERinvalid principalIdList
    MISSING_PARAMETERmissing principalId
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    Search

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodsearchForResults
    DescriptionRetrieves results in tabular form for the specified parameters.
    ParameterssearchTypeKeysearchTypeKeysearch identifier
    queryParamValueListqueryParamValueslist of values for search parameters
    ReturnresultListlist of results from the query
    ErrorsDOES_NOT_EXISTspecified search type not found
    INVALID_PARAMETERinvalid searchTypeKey, queryParamValueList
    MISSING_PARAMETERsearchTypeKey, queryParamValueList not specified
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    Maintenance

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodassignPrincipalToPerson
    DescriptionAssigns a Principal to a Person
    ParametersprincipalIdprincipalIdprincipal identifier
    personIdpersonIdperson identifier
    Returnstatusstatus of the operation
    ErrorsALREADY_EXISTSassociation already exists
    DISABLED_IDENTIFIERpersonId or principalId found but has been retired
    DOES_NOT_EXISTpersonId, principalId does not exist
    INVALID_PARAMETERinvalid personId, principalId
    MISSING_PARAMETERmissing personId, principalId
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodassignPrincipalToSystem
    DescriptionAssigns a Principal to a System
    ParametersprincipalIdprincipalIdprincipal identifier
    systemIdsystemIdsystem identifier
    Returnstatusstatus of the operation
    ErrorsALREADY_EXISTSassociation already exists
    DISABLED_IDENTIFIERprincipalId, systemId found but has been retired
    DOES_NOT_EXISTprincipalId, systemId does not exist
    INVALID_PARAMETERinvalid principalId, systemId
    MISSING_PARAMETERmissing principalId, systemId
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodremovePrincipalFromPerson
    DescriptionRemove a Principal from a Person
    ParametersprincipalIdprincipalIdprincipal identifier
    personIdpersonIdperson identifier
    Returnstatusstatus of the operation
    ErrorsDISABLED_IDENTIFIERpersonId or principalId found but has been retired
    DOES_NOT_EXISTpersonId, principalId, association does not exist
    INVALID_PARAMETERinvalid personId, principalId
    MISSING_PARAMETERmissing personId, principalId
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodremovePrincipalFromSystem
    DescriptionRemove a Principal from a System
    ParametersprincipalIdprincipalIdprincipal identifier
    systemIdsystemIdsystem identifier
    Returnstatusstatus of the operation
    ErrorsDISABLED_IDENTIFIERprincipalId, systemId found but has been retired
    DOES_NOT_EXISTprincipalId, systemId, association does not exist
    INVALID_PARAMETERinvalid principalId, systemId
    MISSING_PARAMETERmissing principalId, systemId
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback
    - -

    Back to Operations

    - -

    - -

    Capabilities

    -
    - - - - - - - - - - - - - -
    -
    -

    Labels

    - - Edit - -
    - -
    -
    -
    - - kss-svcs kss-svcs - Delete -
    -
    - kss-pi kss-pi - Delete - -
    -
    - kss-service kss-service - Delete -
    -
    - kss-svb1 kss-svb1 - - Delete -
    -
    - - -
    -
    - - -
    Enter labels to add to this page:
    - - - - -
    - Please wait  - - -
    -
    -
    -
    - Looking for a label? Just start typing. -
    -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - -

    - Add Comment -

    -
    - - - -
    -
    - - - - - - - \ No newline at end of file diff --git a/sandbox/kss/wiki_to_java/contracts/servicetemplate.old b/sandbox/kss/wiki_to_java/contracts/servicetemplate.old deleted file mode 100644 index 5b0ab97c3..000000000 --- a/sandbox/kss/wiki_to_java/contracts/servicetemplate.old +++ /dev/null @@ -1,1965 +0,0 @@ - - - - Authentication Service - KS Workspace - Confluence - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    - - - Authentication Service - -

    - - - - - - - - - - - - - - - - - -
    - - - - - - - -
    - -

    Authentication Service

    - - - - - - - - - - - - -
    NameAuthenticationService
    VersionDevRelease Notes/History
    - - - - - - - -
    References Operations Capabilities
    - -


    -
    Authentication Service Description and Assumptions
    -This service establishes identity only. It may also provide a mapping from the identity "Principal" to the Person_Id. -
    - -
    Notes
    - -
    - -

    References

    - -

    Authentication Service Description and Assumptions
    -Authentication Service Structures

    - -

    Principal Entity and Principal Set Entity - entity page with fields and examples.
    - -Authentication Stack Options - help understand how the Authentication service might interact with other service layers
    -PI Meeting Diagrams

    - -

    Operations

    - - - - - - - - - -
    Maintenance
    - -

    assignPrincipalToPerson
    -assignPrincipalToSystem Changed Service to System
    -removePrincipalFromPerson
    -removePrincipalFromSystem Changed Service to System

    -
    - -

    - -

    Setup

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfindObjectTypes
    DescriptionRetrieves the list of object type identifiers known by this service. Example: cluInfo.
    ParametersNoneNoneNo parameters
    ReturnobjectTypeKeyListlist of object type identifiers
    ErrorsOPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfetchObjectStructure
    DescriptionRetrieves the basic dictionary information about a particular object structure. Including all variations based on a certain type and state. Example: Given that a CLU is of type "Course" and in the state of "Proposed," tell which fields are read only, mandatory, not applicable, have enumerations available, etc.
    ParametersobjectTypeKeyobjectTypeKeyidentifier of the object type
    ReturnobjectStructuredescribes the fields for the input object type
    ErrorsDOES_NOT_EXISTspecified objectTypeKey not found
    INVALID_PARAMETERinvalid objectTypeKey
    MISSING_PARAMETERmissing objectTypeKey
    OPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfetchEnumeration
    DescriptionRetrieves the list of enumeration values for a particular enumeration with a certain context for a particular date. The values returned should be those where the supplied date is between the effective and expiration dates. Certain enumerations may not support this functionality.
    ParametersenumerationKeyenumerationKeyidentifier of the enumeration
    enumContextKeycontextTypeidentifier of the enumeration context type
    stringcontextValuevalue of the enumeration context
    dateTimecontextDatedate and time to get the enumeration for
    ReturnenumeratedValueListlist of enumerated codes and values
    ErrorsDOES_NOT_EXISTenumerationKey not found
    INVALID_PARAMETERinvalid enumerationKey, contextType, contextValue, contextDate
    MISSING_PARAMETERmissing enumerationKey, contextType, contextValue, contextDate
    OPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfindSearchTypes
    DescriptionRetrieves the list of search types known by this service.
    ParametersNoneNoneNo Parameters
    ReturnsearchTypeInfoListlist of search type information
    ErrorsOPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfetchSearchType
    DescriptionRetrieves information about a particular search type.
    ParameterssearchTypeKeysearchTypeKeyidentifier of the search type
    ReturnsearchTypeInfoinformation on the search type
    ErrorsDOES_NOT_EXISTspecified searchTypeKey not found
    INVALID_PARAMETERinvalid searchTypeKey
    MISSING_PARAMETERsearchTypeKey not specified
    OPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfindSearchTypesByResult
    DescriptionRetrieves the list of search types which return results in the specified format.
    ParameterssearchResultTypeKeysearchResultTypeKeyidentifier of the search result type
    ReturnsearchTypeInfoListlist of search type information
    ErrorsDOES_NOT_EXISTspecified searchResultTypeKey not found
    INVALID_PARAMETERinvalid searchResultTypeKey
    MISSING_PARAMETERsearchResultTypeKey not specified
    OPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    - -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfindSearchTypesByCriteria
    DescriptionRetrieves the list of search types which use criteria in the specified format.
    ParameterssearchCriteriaTypeKeysearchCriteriaTypeKeyidentifier of the search criteria
    ReturnsearchTypeInfoListlist of search type information
    ErrorsDOES_NOT_EXISTspecified searchCriteriaTypeKey not found
    INVALID_PARAMETERinvalid searchCriteriaTypeKey
    MISSING_PARAMETERsearchCriteriaTypeKey not specified
    OPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfindSearchResultTypes
    DescriptionRetrieves the list of search result types known by this service. Search result types describe the return structure for a search.
    ParametersNoneNoneNo Parameters
    ReturnsearchResultTypeInfoListlist of search result type information
    ErrorsOPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfetchSearchResultType
    DescriptionRetrieves information about a particular search result type. Search result types describe the return structure for a search.
    ParameterssearchResultTypeKeysearchResultTypeKeyidentifier of the search result type
    ReturnsearchResultTypeInfoinformation on the search result type
    ErrorsDOES_NOT_EXISTspecified searchResultTypeKey not found
    INVALID_PARAMETERinvalid searchResultTypeKey
    MISSING_PARAMETERsearchResultTypeKey not specified
    OPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfindSearchCriteriaTypes
    DescriptionRetrieves the list of search criteria types known by this service.
    ParametersNoneNoneNo parameters
    ReturnsearchCriteriaTypeInfoListlist of search criteria type information
    ErrorsOPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfetchSearchCriteriaType
    DescriptionRetrieves information about a particular search criteria type.
    ParameterssearchCriteriaTypeKeysearchCriteriaTypeKeyidentifier of the search criteria type
    ReturnsearchCriteriaTypeInfoinformation on the search criteria type
    ErrorsDOES_NOT_EXISTspecified searchCriteriaTypeKey not found
    INVALID_PARAMETERinvalid searchCriteriaTypeKey
    MISSING_PARAMETERsearchCriteriaTypeKey not specified
    OPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    - -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfindAuthenticationTypes
    DescriptionRetrieve the list of authentication types known by this service
    ParametersNoneNoneNo parameters
    ReturnauthenticationTypeListlist of authentication types
    ErrorsOPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    Read

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfindPrincipalIdsByPerson
    DescriptionRetrieves a list of Principals for a given Person
    ParameterspersonIdpersonIdperson identifier
    ReturnprincipalIdListlist of principal ids for the specified person
    ErrorsDISABLED_IDENTIFIERpersonId found but has been retired
    DOES_NOT_EXISTpersonId not found
    INVALID_PARAMETERinvalid personId
    MISSING_PARAMETERmissing personId
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfindPrincipalIdsBySystem
    DescriptionRetrieves a list of Principals for a given System
    ParameterssystemIdsystemIdsystem identifier
    ReturnprincipalIdListlist of principal ids for the given system
    ErrorsDISABLED_IDENTIFIERsystemId found but has been retired
    DOES_NOT_EXISTsystemId not found
    INVALID_PARAMETERinvalid systemId
    MISSING_PARAMETERmissing systemId
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfetchPersonIdByPrincipal
    DescriptionRetrieves a Person for a given Principal
    ParametersprincipalIdprincipalIdprincipal identifier
    ReturnpersonIdperson identifier that matches the supplied criteria
    ErrorsDISABLED_IDENTIFIERprincipalId found but has been retired
    DOES_NOT_EXISTprincipalId not found
    INVALID_PARAMETERinvalid principalId
    MISSING_PARAMETERmissing principalId
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfetchSystemByPrincipal
    DescriptionRetrieves a System for a given Principal
    ParametersprincipalIdprincipalIdprincipal identifier
    ReturnsystemIdsystem identifier that matches the supplied criteria
    ErrorsDISABLED_IDENTIFIERsystemId found but has been retired
    DOES_NOT_EXISTsystemId not found
    INVALID_PARAMETERinvalid principalId
    MISSING_PARAMETERmissing principalId
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfetchPrincipalTypeForPrincipal
    DescriptionRetrieves a Principal Type for a given Principal
    ParametersprincipalIdprincipalIdprincipal identifier
    ReturnprincipalTypeprincipal type that matches the supplied criteria
    ErrorsDISABLED_IDENTIFIERprincipalId found but has been retired
    DOES_NOT_EXISTprincipalId not found
    INVALID_PARAMETERinvalid principalId
    MISSING_PARAMETERmissing principalId
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodfindPrincipalTypesByPrincipalIdList
    DescriptionRetrieves a list of Principal Types for a given list of Principal Ids
    ParametersprincipalIdListprincipalIdListlist of principal identifiers
    ReturnprincipalTypeListList of principal types that match the supplied criteria
    ErrorsDISABLED_IDENTIFIEROne or more principalIds found but have been retired
    DOES_NOT_EXISTOne or more principalIds not found
    INVALID_PARAMETERinvalid principalIdList
    MISSING_PARAMETERmissing principalId
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    Search

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodsearchForResults
    DescriptionRetrieves results in tabular form for the specified parameters.
    ParameterssearchTypeKeysearchTypeKeysearch identifier
    queryParamValueListqueryParamValueslist of values for search parameters
    ReturnresultListlist of results from the query
    ErrorsDOES_NOT_EXISTspecified search type not found
    INVALID_PARAMETERinvalid searchTypeKey, queryParamValueList
    MISSING_PARAMETERsearchTypeKey, queryParamValueList not specified
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    Maintenance

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodassignPrincipalToPerson
    DescriptionAssigns a Principal to a Person
    ParametersprincipalIdprincipalIdprincipal identifier
    personIdpersonIdperson identifier
    Returnstatusstatus of the operation
    ErrorsALREADY_EXISTSassociation already exists
    DISABLED_IDENTIFIERpersonId or principalId found but has been retired
    DOES_NOT_EXISTpersonId, principalId does not exist
    INVALID_PARAMETERinvalid personId, principalId
    MISSING_PARAMETERmissing personId, principalId
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodassignPrincipalToSystem
    DescriptionAssigns a Principal to a System
    ParametersprincipalIdprincipalIdprincipal identifier
    systemIdsystemIdsystem identifier
    Returnstatusstatus of the operation
    ErrorsALREADY_EXISTSassociation already exists
    DISABLED_IDENTIFIERprincipalId, systemId found but has been retired
    DOES_NOT_EXISTprincipalId, systemId does not exist
    INVALID_PARAMETERinvalid principalId, systemId
    MISSING_PARAMETERmissing principalId, systemId
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodremovePrincipalFromPerson
    DescriptionRemove a Principal from a Person
    ParametersprincipalIdprincipalIdprincipal identifier
    personIdpersonIdperson identifier
    Returnstatusstatus of the operation
    ErrorsDISABLED_IDENTIFIERpersonId or principalId found but has been retired
    DOES_NOT_EXISTpersonId, principalId, association does not exist
    INVALID_PARAMETERinvalid personId, principalId
    MISSING_PARAMETERmissing personId, principalId
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodremovePrincipalFromSystem
    DescriptionRemove a Principal from a System
    ParametersprincipalIdprincipalIdprincipal identifier
    systemIdsystemIdsystem identifier
    Returnstatusstatus of the operation
    ErrorsDISABLED_IDENTIFIERprincipalId, systemId found but has been retired
    DOES_NOT_EXISTprincipalId, systemId, association does not exist
    INVALID_PARAMETERinvalid principalId, systemId
    MISSING_PARAMETERmissing principalId, systemId
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback
    - -

    Back to Operations

    - -

    - -

    Capabilities

    -
    - - - - - - - - - - - - - -
    -
    -

    Labels

    - - Edit - -
    - -
    -
    -
    - - kss-svcs kss-svcs - Delete -
    -
    - kss-pi kss-pi - Delete - -
    -
    - kss-service kss-service - Delete -
    -
    - kss-svb1 kss-svb1 - - Delete -
    -
    - - -
    -
    - - -
    Enter labels to add to this page:
    - - - - -
    - Please wait  - - -
    -
    -
    -
    - Looking for a label? Just start typing. -
    -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - -

    - Add Comment -

    -
    - - - -
    -
    - - - - - - - \ No newline at end of file diff --git a/sandbox/kss/wiki_to_java/contracts/servicetemplate.trimmed.xml b/sandbox/kss/wiki_to_java/contracts/servicetemplate.trimmed.xml deleted file mode 100644 index a18d4c454..000000000 --- a/sandbox/kss/wiki_to_java/contracts/servicetemplate.trimmed.xml +++ /dev/null @@ -1 +0,0 @@ -

    MethodfindObjectTypes
    DescriptionRetrieves the list of object type identifiers known by this service. Example: cluInfo.
    ParametersNoneNoneNo parameters
    ReturnobjectTypeKeyListlist of object type identifiers
    ErrorsOPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback

    Back to Operations

    MethodfetchObjectStructure
    DescriptionRetrieves the basic dictionary information about a particular object structure. Including all variations based on a certain type and state. Example: Given that a CLU is of type "Course" and in the state of "Proposed," tell which fields are read only, mandatory, not applicable, have enumerations available, etc.
    ParametersobjectTypeKeyobjectTypeKeyidentifier of the object type
    ReturnobjectStructuredescribes the fields for the input object type
    ErrorsDOES_NOT_EXISTspecified objectTypeKey not found
    INVALID_PARAMETERinvalid objectTypeKey
    MISSING_PARAMETERmissing objectTypeKey
    OPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback

    Back to Operations

    MethodfetchEnumeration
    DescriptionRetrieves the list of enumeration values for a particular enumeration with a certain context for a particular date. The values returned should be those where the supplied date is between the effective and expiration dates. Certain enumerations may not support this functionality.
    ParametersenumerationKeyenumerationKeyidentifier of the enumeration
    enumContextKeycontextTypeidentifier of the enumeration context type
    stringcontextValuevalue of the enumeration context
    dateTimecontextDatedate and time to get the enumeration for
    ReturnenumeratedValueListlist of enumerated codes and values
    ErrorsDOES_NOT_EXISTenumerationKey not found
    INVALID_PARAMETERinvalid enumerationKey, contextType, contextValue, contextDate
    MISSING_PARAMETERmissing enumerationKey, contextType, contextValue, contextDate
    OPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback

    Back to Operations

    MethodfindSearchTypes
    DescriptionRetrieves the list of search types known by this service.
    ParametersNoneNoneNo Parameters
    ReturnsearchTypeInfoListlist of search type information
    ErrorsOPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback

    Back to Operations

    MethodfetchSearchType
    DescriptionRetrieves information about a particular search type.
    ParameterssearchTypeKeysearchTypeKeyidentifier of the search type
    ReturnsearchTypeInfoinformation on the search type
    ErrorsDOES_NOT_EXISTspecified searchTypeKey not found
    INVALID_PARAMETERinvalid searchTypeKey
    MISSING_PARAMETERsearchTypeKey not specified
    OPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback

    Back to Operations

    MethodfindSearchTypesByResult
    DescriptionRetrieves the list of search types which return results in the specified format.
    ParameterssearchResultTypeKeysearchResultTypeKeyidentifier of the search result type
    ReturnsearchTypeInfoListlist of search type information
    ErrorsDOES_NOT_EXISTspecified searchResultTypeKey not found
    INVALID_PARAMETERinvalid searchResultTypeKey
    MISSING_PARAMETERsearchResultTypeKey not specified
    OPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback

    Back to Operations

    MethodfindSearchTypesByCriteria
    DescriptionRetrieves the list of search types which use criteria in the specified format.
    ParameterssearchCriteriaTypeKeysearchCriteriaTypeKeyidentifier of the search criteria
    ReturnsearchTypeInfoListlist of search type information
    ErrorsDOES_NOT_EXISTspecified searchCriteriaTypeKey not found
    INVALID_PARAMETERinvalid searchCriteriaTypeKey
    MISSING_PARAMETERsearchCriteriaTypeKey not specified
    OPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback

    Back to Operations

    MethodfindSearchResultTypes
    DescriptionRetrieves the list of search result types known by this service. Search result types describe the return structure for a search.
    ParametersNoneNoneNo Parameters
    ReturnsearchResultTypeInfoListlist of search result type information
    ErrorsOPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback

    Back to Operations

    MethodfetchSearchResultType
    DescriptionRetrieves information about a particular search result type. Search result types describe the return structure for a search.
    ParameterssearchResultTypeKeysearchResultTypeKeyidentifier of the search result type
    ReturnsearchResultTypeInfoinformation on the search result type
    ErrorsDOES_NOT_EXISTspecified searchResultTypeKey not found
    INVALID_PARAMETERinvalid searchResultTypeKey
    MISSING_PARAMETERsearchResultTypeKey not specified
    OPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback

    Back to Operations

    MethodfindSearchCriteriaTypes
    DescriptionRetrieves the list of search criteria types known by this service.
    ParametersNoneNoneNo parameters
    ReturnsearchCriteriaTypeInfoListlist of search criteria type information
    ErrorsOPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback

    Back to Operations

    MethodfetchSearchCriteriaType
    DescriptionRetrieves information about a particular search criteria type.
    ParameterssearchCriteriaTypeKeysearchCriteriaTypeKeyidentifier of the search criteria type
    ReturnsearchCriteriaTypeInfoinformation on the search criteria type
    ErrorsDOES_NOT_EXISTspecified searchCriteriaTypeKey not found
    INVALID_PARAMETERinvalid searchCriteriaTypeKey
    MISSING_PARAMETERsearchCriteriaTypeKey not specified
    OPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback

    Back to Operations

    MethodfindAuthenticationTypes
    DescriptionRetrieve the list of authentication types known by this service
    ParametersNoneNoneNo parameters
    ReturnauthenticationTypeListlist of authentication types
    ErrorsOPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback

    Back to Operations

    Read

    MethodfindPrincipalIdsByPerson
    DescriptionRetrieves a list of Principals for a given Person
    ParameterspersonIdpersonIdperson identifier
    ReturnprincipalIdListlist of principal ids for the specified person
    ErrorsDISABLED_IDENTIFIERpersonId found but has been retired
    DOES_NOT_EXISTpersonId not found
    INVALID_PARAMETERinvalid personId
    MISSING_PARAMETERmissing personId
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback

    Back to Operations

    MethodfindPrincipalIdsBySystem
    DescriptionRetrieves a list of Principals for a given System
    ParameterssystemIdsystemIdsystem identifier
    ReturnprincipalIdListlist of principal ids for the given system
    ErrorsDISABLED_IDENTIFIERsystemId found but has been retired
    DOES_NOT_EXISTsystemId not found
    INVALID_PARAMETERinvalid systemId
    MISSING_PARAMETERmissing systemId
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback

    Back to Operations

    MethodfetchPersonIdByPrincipal
    DescriptionRetrieves a Person for a given Principal
    ParametersprincipalIdprincipalIdprincipal identifier
    ReturnpersonIdperson identifier that matches the supplied criteria
    ErrorsDISABLED_IDENTIFIERprincipalId found but has been retired
    DOES_NOT_EXISTprincipalId not found
    INVALID_PARAMETERinvalid principalId
    MISSING_PARAMETERmissing principalId
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback

    Back to Operations

    MethodfetchSystemByPrincipal
    DescriptionRetrieves a System for a given Principal
    ParametersprincipalIdprincipalIdprincipal identifier
    ReturnsystemIdsystem identifier that matches the supplied criteria
    ErrorsDISABLED_IDENTIFIERsystemId found but has been retired
    DOES_NOT_EXISTsystemId not found
    INVALID_PARAMETERinvalid principalId
    MISSING_PARAMETERmissing principalId
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback

    Back to Operations

    MethodfetchPrincipalTypeForPrincipal
    DescriptionRetrieves a Principal Type for a given Principal
    ParametersprincipalIdprincipalIdprincipal identifier
    ReturnprincipalTypeprincipal type that matches the supplied criteria
    ErrorsDISABLED_IDENTIFIERprincipalId found but has been retired
    DOES_NOT_EXISTprincipalId not found
    INVALID_PARAMETERinvalid principalId
    MISSING_PARAMETERmissing principalId
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback

    Back to Operations

    MethodfindPrincipalTypesByPrincipalIdList
    DescriptionRetrieves a list of Principal Types for a given list of Principal Ids
    ParametersprincipalIdListprincipalIdListlist of principal identifiers
    ReturnprincipalTypeListList of principal types that match the supplied criteria
    ErrorsDISABLED_IDENTIFIEROne or more principalIds found but have been retired
    DOES_NOT_EXISTOne or more principalIds not found
    INVALID_PARAMETERinvalid principalIdList
    MISSING_PARAMETERmissing principalId
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback

    Back to Operations

    Search

    MethodsearchForResults
    DescriptionRetrieves results in tabular form for the specified parameters.
    ParameterssearchTypeKeysearchTypeKeysearch identifier
    queryParamValueListqueryParamValueslist of values for search parameters
    ReturnresultListlist of results from the query
    ErrorsDOES_NOT_EXISTspecified search type not found
    INVALID_PARAMETERinvalid searchTypeKey, queryParamValueList
    MISSING_PARAMETERsearchTypeKey, queryParamValueList not specified
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback

    Back to Operations

    Maintenance

    MethodassignPrincipalToPerson
    DescriptionAssigns a Principal to a Person
    ParametersprincipalIdprincipalIdprincipal identifier
    personIdpersonIdperson identifier
    Returnstatusstatus of the operation
    ErrorsALREADY_EXISTSassociation already exists
    DISABLED_IDENTIFIERpersonId or principalId found but has been retired
    DOES_NOT_EXISTpersonId, principalId does not exist
    INVALID_PARAMETERinvalid personId, principalId
    MISSING_PARAMETERmissing personId, principalId
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback

    Back to Operations

    MethodassignPrincipalToSystem
    DescriptionAssigns a Principal to a System
    ParametersprincipalIdprincipalIdprincipal identifier
    systemIdsystemIdsystem identifier
    Returnstatusstatus of the operation
    ErrorsALREADY_EXISTSassociation already exists
    DISABLED_IDENTIFIERprincipalId, systemId found but has been retired
    DOES_NOT_EXISTprincipalId, systemId does not exist
    INVALID_PARAMETERinvalid principalId, systemId
    MISSING_PARAMETERmissing principalId, systemId
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback

    Back to Operations

    MethodremovePrincipalFromPerson
    DescriptionRemove a Principal from a Person
    ParametersprincipalIdprincipalIdprincipal identifier
    personIdpersonIdperson identifier
    Returnstatusstatus of the operation
    ErrorsDISABLED_IDENTIFIERpersonId or principalId found but has been retired
    DOES_NOT_EXISTpersonId, principalId, association does not exist
    INVALID_PARAMETERinvalid personId, principalId
    MISSING_PARAMETERmissing personId, principalId
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback

    Back to Operations

    MethodremovePrincipalFromSystem
    DescriptionRemove a Principal from a System
    ParametersprincipalIdprincipalIdprincipal identifier
    systemIdsystemIdsystem identifier
    Returnstatusstatus of the operation
    ErrorsDISABLED_IDENTIFIERprincipalId, systemId found but has been retired
    DOES_NOT_EXISTprincipalId, systemId, association does not exist
    INVALID_PARAMETERinvalid principalId, systemId
    MISSING_PARAMETERmissing principalId, systemId
    OPERATION_FAILEDunable to complete request
    PERMISSION_DENIEDauthorization failure
    Capabilities
    Use Cases
    Comments/Feedback

    Back to Operations

    \ No newline at end of file diff --git a/sandbox/kss/wiki_to_java/contracts/~contract b/sandbox/kss/wiki_to_java/contracts/~contract deleted file mode 100644 index e23ba25bc..000000000 --- a/sandbox/kss/wiki_to_java/contracts/~contract +++ /dev/null @@ -1,853 +0,0 @@ - - - - Comment Service - KS Workspace - Confluence - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    - - - Comment Service - -

    - - - - - - - - - - - - - - - - - -
    - - - - - - - -
    - -

    Comment Service

    - - - - - - - - - - - - -
    NameCommentService
    VersionDevRelease Notes
    - - - - - - - -
    References Operations Capabilities
    - -

    Description

    -

    The Comment Service manages user comments associated with any object.This service is to allow comments and tags to be created for objects across the system. There is no expectation that the Objects no about these at all, and therefore objects can be deleted while there were still tags or comments.

    - -

    We're using "objects" in a different way than elsewhere, so we need a better name.
    - How much threading do we need

    - -

    Operations

    - - -
    Setup
    -

    Dictionary Operations
    -findObjectTypes
    -fetchObjectStructure
    -fetchEnumeration

    - -

    Search Operations
    - -findSearchTypes
    -fetchSearchType
    -findSearchTypesByResult
    -findSearchTypesByCriteria
    -findSearchResultTypes
    -fetchSearchResultType
    -findSearchCriteriaTypes
    -fetchSearchCriteriaType

    - -

    Domain Operations
    -getReferenceTypes
    -getCommentTypes – Do we need these? Separate Personal from Official etc
    -getTagTypes – Do we need these?

    -
    - -
    Read
    -

    getTagsForReference
    - -getCommentsForReference

    - -

    getComments

    - -

    getReferencesByTag
    -getReferencesOfTypeByTag

    - -

    getTags

    -
    - -
    Search
    - -
    Maintenance
    -

    addTag
    -removeTag

    - -

    addComment

    - -

    removeComment

    - -

    removeAllTags
    -removeAllComments

    -
    - -

    - -

    Setup

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodgetReferenceTypes
    DescriptionRetrieves the list of types which can be tagged or commented.
    ParametersNoneNoneNo parameters
    ReturnreferenceTypeInfoListthe list of types which can be tagged or commented
    ErrorsOPERATION_FAILEDunable to complete request
    Capabilities
    Use Cases
    Comments/Feedback
    -

    Back to Operations

    - -

    Read

    - -

    Search

    - -

    Maintenance

    -
    - - - - - - - - - - - - - -
    -
    -

    Labels

    - Edit - - -
    - -
    -
    -
    - kss-svcs kss-svcs - Delete - -
    -
    - kss-service kss-service - Delete -
    -
    - - -
    - -
    - - -
    Enter labels to add to this page:
    - - - - - -
    - Please wait  - -
    -
    -
    -
    - Looking for a label? Just start typing. -
    - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - -
    - - - - -

    - Add Comment -

    -
    - - - - -
    -
    - - - - - - - \ No newline at end of file diff --git a/sandbox/kss/wiki_to_java/pom.xml b/sandbox/kss/wiki_to_java/pom.xml deleted file mode 100644 index 099e339a2..000000000 --- a/sandbox/kss/wiki_to_java/pom.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - 4.0.0 - org.kuali.student.mojo - maven-kscontract-plugin - 0.0.1-SNAPSHOT - maven-plugin - - - - - - org.apache.maven - maven-plugin-api - 2.0 - - - net.sf.saxon - saxon - 8.7 - - - - \ No newline at end of file diff --git a/sandbox/kss/wiki_to_java/src/main/java/CSpace.java b/sandbox/kss/wiki_to_java/src/main/java/CSpace.java deleted file mode 100644 index 8a6852de3..000000000 --- a/sandbox/kss/wiki_to_java/src/main/java/CSpace.java +++ /dev/null @@ -1,78 +0,0 @@ -/** - * - */ - -import java.io.File; -import java.net.MalformedURLException; -import java.net.URL; - -import org.apache.maven.plugin.MojoExecutionException; -import org.apache.maven.plugin.MojoFailureException; - -import org.kuali.student.mojo.*; - -/** - * @author remillet - * - */ -public class CSpace { - - /** - * @param args - */ - public static void main(String[] args) { - - // the contract file to transform - File contractFile = null; -// contractFile = new File("C:/dev/src/kss/maven-kscontract-plugin/maven-kscontract-plugin/contracts/ffservice"); - - // the URL to the contract to transform - URL contractURL = null; - try { - contractURL = new URL("https://test.kuali.org/confluence/display/KULSTU/Authentication+Service"); -// contractURL = new URL("http://wiki.collectionspace.org/display/collectionspace/wikitojavatestservice"); - - // - } catch (MalformedURLException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - // where to store the transformed output - File outputDirectory = - new File("C:/dev/src/kss/maven-kscontract-plugin/maven-kscontract-plugin/transforms"); - - // XSLT file describing the transform - File transformFile = - new File("C:/dev/src/kss/maven-kscontract-plugin/maven-kscontract-plugin/src/main/resources/interface.xml"); - - // XSLT file describing the message transform - File messageTransformFile = - new File("C:/dev/src/kss/maven-kscontract-plugin/maven-kscontract-plugin/src/main/resources/messageInterface.xml"); - - // the session ID token - String jsessionId = "8B705ECBA5854E818026D31FC4A38C1A.Kuali3_1Engine"; - - - - KsContractMojo kssContractMojo = new KsContractMojo( - contractFile, - contractURL, - outputDirectory, - transformFile, - messageTransformFile, - jsessionId); - - try { - kssContractMojo.execute(); - } - catch (MojoExecutionException mee) { - System.err.print(mee.toString()); - } - catch (MojoFailureException mfe) { - System.err.print(mfe.toString()); - } - - } - -} diff --git a/sandbox/kss/wiki_to_java/src/main/java/org/kuali/student/contract/ContractReader.java b/sandbox/kss/wiki_to_java/src/main/java/org/kuali/student/contract/ContractReader.java deleted file mode 100644 index 1c23f0e1a..000000000 --- a/sandbox/kss/wiki_to_java/src/main/java/org/kuali/student/contract/ContractReader.java +++ /dev/null @@ -1,96 +0,0 @@ -package org.kuali.student.contract; - -import java.io.BufferedReader; -import java.io.ByteArrayInputStream; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.StringReader; -import java.io.UnsupportedEncodingException; -import java.net.URL; -import java.net.URLConnection; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.stream.StreamSource; - -import org.w3c.dom.Document; -import org.xml.sax.SAXException; -import java.util.regex.Pattern; - -public class ContractReader { - - private String contractText; - - public ContractReader(File file) throws FileNotFoundException, IOException { - FileReader fileReader = new FileReader(file); - BufferedReader reader = new BufferedReader(fileReader); - - contractText = trimContract(reader); - } - - public ContractReader(URL url, String jsessionId) throws IOException { - URLConnection connection = url.openConnection(); - connection.setRequestProperty("Cookie", "JSESSIONID=" + jsessionId); - - InputStreamReader myReader = new InputStreamReader(connection.getInputStream()); - BufferedReader reader = new BufferedReader(myReader); - - contractText = trimContract(reader); - } - - public Document getDocument() throws ParserConfigurationException, UnsupportedEncodingException, IOException, SAXException { - DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - DocumentBuilder builder = factory.newDocumentBuilder(); - - return builder.parse(new ByteArrayInputStream(contractText.getBytes("UTF-8"))); - } - - public StreamSource getStreamSource() { - StringReader stringReader = new StringReader(contractText); - - return new StreamSource(stringReader); - } - - protected String trimContract(BufferedReader reader) throws IOException { - - String result = null; - StringBuilder builder = new StringBuilder(); - String line; - boolean inContract = false; - - while ((line = reader.readLine()) != null) { -// System.out.println(line); - if (!inContract) { - if (line.contains("Setup")) { - inContract = true; - builder.append(""); - } - } else { -// if (line.contains("Capabilities")) { - if (line.matches(".*\\s*Capabilities\\s*.*") == true) { - inContract = false; - } else { - builder.append(line); - } - } - } - - builder.append("" + "\n"); - result = builder.toString(); - - System.out.print(result); - - return result; - } - - /** - * @return the contractText - */ - public String getContractText() { - return contractText; - } -} diff --git a/sandbox/kss/wiki_to_java/src/main/java/org/kuali/student/contract/MessageContractReader.java b/sandbox/kss/wiki_to_java/src/main/java/org/kuali/student/contract/MessageContractReader.java deleted file mode 100644 index ee4fbc9ab..000000000 --- a/sandbox/kss/wiki_to_java/src/main/java/org/kuali/student/contract/MessageContractReader.java +++ /dev/null @@ -1,106 +0,0 @@ -package org.kuali.student.contract; - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.net.URL; - -public class MessageContractReader extends ContractReader { - - /** - * @param url - * @throws IOException - */ - public MessageContractReader(URL url, String jsessionId) throws IOException { - super(url, jsessionId); - // TODO Auto-generated constructor stub - } - - public MessageContractReader(File file) throws FileNotFoundException, - IOException { - super(file); - // TODO Auto-generated constructor stub - } - - /* - * (non-Javadoc) - * - * @see org.kuali.student.contract.ContractReader#trimContract(java.io.BufferedReader) - */ - @Override - protected String trimContract(BufferedReader reader) throws IOException { - StringBuilder builder = new StringBuilder(); - String line; - - // Add in xml header and entity definitions - builder.append("" + "" + "]>"); - - // Get rid of the first line (doctype info stuff) - reader.readLine(); - - // read each line and fix any open tags, bad attributes, and '&' symbols - // without a ';' - boolean inContract = false; - while ((line = reader.readLine()) != null) { - - // Check if the current line has a tag that does not end yet - if (line.matches(".*<[^>]+")) { - - // Concatenate the next lines until the tag is closed - String newLine; - while ((newLine = reader.readLine()) != null - && !(line += newLine).contains(">")) { - } - } - -// System.err.println("Line before:" + line); // BEFORE - - // Do some regex to clean up the tags - line = line.replaceAll("border=0", "border=\"0\""); - line = line.replaceAll("([^:])nowrap([^=])", "$1nowrap=\"true\"$2"); - line = line.replaceAll("&(\\w+[^;])", "$1"); - line = line.replaceAll("(<(META|meta|br|hr|col|link|img|input)(\\s+[\\w-]+\\s*=\\s*(\"([^\"]*)\"|'([^']*)'))*\\s*)>", "$1/>"); - line = line.replaceAll("
    ", "
    "); - -// System.err.println("Line after :" + line); // AFTER -// System.err.println(); - - if (line.contains("Example")) { - inContract = false; - builder.append("
    " + "\n"); // end of
    - builder.append("
    " + "\n"); // end of
    - builder.append("
    " + "\n"); // end of
    - builder.append("" + "\n"); // end of - builder.append("" + "\n"); // end of - } - - if (line.contains("id=\"structureMetaTable\"")) { - inContract = true; - // Add , , and main
    nodes - builder.append("" + "\n"); - builder.append("" + "\n"); - builder.append("
    " + "\n"); - - // Add
    for content, and
    for wiki content - builder.append("
    " + "\n"); - builder.append("
    " + "\n"); - } - - if (inContract == true) { - builder.append(line + "\n"); -// System.out.println(line); - } - - - } - - System.out.println(builder.toString()); - - return builder.toString(); - - - } -} - diff --git a/sandbox/kss/wiki_to_java/src/main/java/org/kuali/student/mojo/KsContractMojo.java b/sandbox/kss/wiki_to_java/src/main/java/org/kuali/student/mojo/KsContractMojo.java deleted file mode 100644 index b5b6d6960..000000000 --- a/sandbox/kss/wiki_to_java/src/main/java/org/kuali/student/mojo/KsContractMojo.java +++ /dev/null @@ -1,350 +0,0 @@ -package org.kuali.student.mojo; - -import java.io.File; -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.HashSet; -import java.util.Set; - -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.Result; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerConfigurationException; -import javax.xml.transform.TransformerException; -import javax.xml.transform.TransformerFactoryConfigurationError; -import javax.xml.transform.stream.StreamResult; -import javax.xml.transform.stream.StreamSource; - -import org.apache.maven.plugin.AbstractMojo; -import org.apache.maven.plugin.MojoExecutionException; -import org.apache.maven.plugin.MojoFailureException; -import org.kuali.student.contract.ContractReader; -import org.kuali.student.contract.MessageContractReader; -import org.w3c.dom.DOMException; -import org.w3c.dom.Document; -import org.w3c.dom.NamedNodeMap; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import org.xml.sax.SAXException; - -/** - * Creates WS service interface from wiki service contract. - * - * @goal contractToJava - */ -public class KsContractMojo extends AbstractMojo { - - public KsContractMojo( - File contractFile, - URL contractURL, - File outputDirectory, - File transformFile, - File messageTransformFile, - String jsessionId) - { - this.contractFile = contractFile; - this.contractURL = contractURL; - this.outputDirectory = outputDirectory; - this.transformFile = transformFile; - this.messageTransformFile = messageTransformFile; - this.jsessionId = jsessionId; - - return; - } - - public KsContractMojo() { - this.contractFile = null; - this.contractURL = null; - } - - /** - * Path to service contract file. - * - * @parameter - */ - private File contractFile; - - /** - * URL of service contract from wiki. - * - * @parameter - */ - private URL contractURL; - - /** - * Path to output directory. - * - * @parameter - */ - private File outputDirectory; - - /** - * Path to custom xslt. - * - * @parameter - */ - private File transformFile; - - /** - * Path to custom xslt. - * - * @parameter - */ - private File messageTransformFile; - - /** - * JSESSIONID from a current session - * - * @parameter - */ - private String jsessionId; - - public void execute() throws MojoExecutionException, MojoFailureException { - - ContractReader contract; - - try { - if (contractURL != null) { - contract = new ContractReader(contractURL, jsessionId); - } else { - contract = new ContractReader(contractFile); - } - } catch (Exception ex) { - throw new MojoExecutionException("Can't parse contract", ex); - } - - StreamSource wsdlXslt; - if (transformFile == null) { - wsdlXslt = new StreamSource(this.getClass().getClassLoader() - .getResourceAsStream("interface.xml")); - } else { - wsdlXslt = new StreamSource(transformFile); - } - - try { - Transformer transformer = net.sf.saxon.TransformerFactoryImpl - .newInstance().newTransformer(wsdlXslt); - - Result result = new StreamResult(new File(outputDirectory, - "foo.java")); - transformer.transform(contract.getStreamSource(), result); - - findParams(contract.getDocument()); - } catch (TransformerConfigurationException tcex) { - getLog().error(tcex); - throw new MojoExecutionException("Can't initialize xslt.", tcex); - } catch (TransformerException tex) { - getLog().error(tex); - throw new MojoExecutionException("Can't transform contract.", tex); - } catch (Exception ex) { - ex.printStackTrace(); - throw new MojoExecutionException("Error parsing params", ex); - } - } - - public void findParamsFromMessage(String param, URL url, - Set alreadyParsedUrlSet) { - if (alreadyParsedUrlSet.contains(url) || "datetime".equals(param.toLowerCase()) - || "string".equals(param.toLowerCase()) || "boolean".equals(param.toLowerCase()) - || "integer".equals(param.toLowerCase())) { - return; - } - - //rem - if (param.equals("objectStructure")) { - System.out.println(); - } - - ContractReader contract; - try { - contract = new MessageContractReader(url, jsessionId); - // Create the java code - if (!param.endsWith("List") && !param.endsWith("Id") - && !param.endsWith("Key") && !param.endsWith("Type")) { - message2Java(contract, param); - } - // add this url to the already oarsed list - alreadyParsedUrlSet.add(url); - -// System.out.println("URL:" + url.toString()); -// System.out.println(contract.getContractText()); - - // recurse through the node to - NodeList nodeList = contract.getDocument().getElementsByTagName( - "td"); - for (int i = 0, iCnt = nodeList.getLength(); i < iCnt; i++) { - Node node = nodeList.item(i); - NamedNodeMap nodeMap = node.getAttributes(); - System.err.println("Node=" + i + ":" + node.toString()); - - //rem - if (nodeMap != null) { - if (nodeMap.getNamedItem("class") != null) { - String nodeValue = nodeMap.getNamedItem("class").getNodeValue(); - System.out.println("Node value: " + i + ":" + nodeValue); - } - } - - if (nodeMap != null - && nodeMap.getNamedItem("class") != null - && "structType".equals(nodeMap.getNamedItem("class") - .getNodeValue())) { - Node anchor = node.getFirstChild(); - String urlString = anchor.getAttributes().getNamedItem( - "href").getNodeValue(); - if (!urlString.startsWith("http") - && !urlString.startsWith("file")) { - urlString = contractURL.getProtocol()+"://"+contractURL.getHost() - + urlString; - } - URL newUrl = new URL(urlString); - String newParam = anchor.getTextContent().trim(); - if (!newParam.startsWith("<") - && !alreadyParsedUrlSet.contains(newUrl)) { - findParamsFromMessage(newParam, newUrl, - alreadyParsedUrlSet); - } - } - } - } catch (IOException e) { - getLog().warn( - "Error loading page for Type '" + param + "'" - + e.getMessage()); - } catch (ParserConfigurationException e) { - e.printStackTrace(); - getLog().warn( - "Error parsing page for Type '" + param + "'" - + e.getMessage()); - } catch (SAXException e) { - getLog().warn( - "Error parsing page for Type '" + param + "'" - + e.getMessage()); - } finally { - System.err.println(); - } - } - - public void findParams(Document document) { - Set alreadyParsedUrlSet = new HashSet(); - NodeList nodeList = document.getElementsByTagName("td"); - for (int i = 0, iCnt = nodeList.getLength(); i < iCnt; i++) { - Node node = nodeList.item(i); - NamedNodeMap nodeMap = node.getAttributes(); - if (nodeMap != null - && ("methodParamType".equals(nodeMap.getNamedItem("class") - .getNodeValue()) || "methodReturnType" - .equals(nodeMap.getNamedItem("class") - .getNodeValue()))) { - String param = node.getFirstChild().getTextContent().trim(); - if (!"None".equals(param) && !param.startsWith("<") - && !param.endsWith("Id") && !param.endsWith("Key")) { - try { - String urlString = node.getFirstChild().getAttributes() - .getNamedItem("href").getNodeValue(); -// System.out.println("urlString:" + urlString); -// System.out.println("contractURL:" + contractURL); - if (!urlString.startsWith("http") - && !urlString.startsWith("file")) { - urlString = contractURL.getProtocol()+"://"+contractURL.getHost() - + urlString; - } - findParamsFromMessage(param, new URL(urlString), - alreadyParsedUrlSet); - } catch (MalformedURLException e) { - getLog().warn( - "Error loading page for Type '" + param + "'" - + e.getMessage()); - } catch (DOMException e) { - getLog().warn( - "DOM Error parsing page for Type '" + param - + "'" + e.getMessage()); - } - } - } - } - } - - private void message2Java(ContractReader contract, String param) { - StreamSource wsdlXslt; - if (messageTransformFile == null) { - wsdlXslt = new StreamSource(this.getClass().getClassLoader() - .getResourceAsStream("messageInterface.xml")); - } else { - wsdlXslt = new StreamSource(messageTransformFile); - } - try { - Transformer transformer = net.sf.saxon.TransformerFactoryImpl - .newInstance().newTransformer(wsdlXslt); - - Result result = new StreamResult(new File(outputDirectory, param - .substring(0, 1).toUpperCase() - + param.substring(1) + ".java")); - - StreamSource xmlSource = contract.getStreamSource(); - transformer.transform(xmlSource, result); - - System.out.println(result.toString()); - } catch (TransformerConfigurationException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (TransformerFactoryConfigurationError e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (TransformerException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } finally { - System.out.println(); - } - - } - - public File getContractFile() { - return contractFile; - } - - public void setContractFile(File contractFile) { - this.contractFile = contractFile; - } - - public URL getContractURL() { - return contractURL; - } - - public void setContractURL(URL contractURL) { - this.contractURL = contractURL; - } - - public File getOutputDirectory() { - return outputDirectory; - } - - public void setOutputDirectory(File outputDirectory) { - this.outputDirectory = outputDirectory; - } - - public File getTransformFile() { - return transformFile; - } - - public void setTransformFile(File transformFile) { - this.transformFile = transformFile; - } - - /** - * @return the messageTransformFile - */ - public File getMessageTransformFile() { - return messageTransformFile; - } - - /** - * @param messageTransformFile - * the messageTransformFile to set - */ - public void setMessageTransformFile(File messageTransformFile) { - this.messageTransformFile = messageTransformFile; - } - -} diff --git a/sandbox/kss/wiki_to_java/src/main/resources/interface.xml b/sandbox/kss/wiki_to_java/src/main/resources/interface.xml deleted file mode 100644 index 180860e6e..000000000 --- a/sandbox/kss/wiki_to_java/src/main/resources/interface.xml +++ /dev/null @@ -1,143 +0,0 @@ - - - - - -/* - * Copyright 2008 The Kuali Foundation - * - * Licensed under the Educational Community License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.opensource.org/licenses/ecl1.php - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - - - public interface foo { - - /** - * - - - - - * @param - - - - - - - * @return - - - - * @throws - - Exception - - - - */ - public - - - - - - - - ( - - ) - - ; - - } - - - - - , - - @WebParam(name=" - - ") - - - - - - - - - - - - - , - - - throws - - - Exception - - - - - - - List< - - - - - - > - - - Date - - - String - - - String - - - - - - - \ No newline at end of file diff --git a/sandbox/kss/wiki_to_java/src/main/resources/messageInterface.xml b/sandbox/kss/wiki_to_java/src/main/resources/messageInterface.xml deleted file mode 100644 index 43da376ea..000000000 --- a/sandbox/kss/wiki_to_java/src/main/resources/messageInterface.xml +++ /dev/null @@ -1,154 +0,0 @@ - - - - - - - - - -/* - * Copyright 2008 The Kuali Foundation - * - * Licensed under the Educational Community License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.opensource.org/licenses/ecl1.php - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; - -@XmlAccessorType(XmlAccessType.FIELD) -public class - - implements Serializable { - private static final long serialVersionUID = 1L; - - - - @XmlAttribute - - - @XmlElement - - - private - - - - ; - - - - - - public - - get - - () { - - - if ( - - == null) { - - - = new Array - - (); - } - - return - - - ; - } - - - public void set - - ( - - - - ) { - this. - - = - - ; - } - - - } - - - - - List< - - > - - - Date - - - String - - - String - - - String - - - - - - - \ No newline at end of file diff --git a/sandbox/kss/wiki_to_java/target/classes/CSpace.class b/sandbox/kss/wiki_to_java/target/classes/CSpace.class deleted file mode 100644 index fb0e8a3fa..000000000 Binary files a/sandbox/kss/wiki_to_java/target/classes/CSpace.class and /dev/null differ diff --git a/sandbox/kss/wiki_to_java/target/classes/META-INF/maven/plugin.xml b/sandbox/kss/wiki_to_java/target/classes/META-INF/maven/plugin.xml deleted file mode 100644 index 1e578ce2f..000000000 --- a/sandbox/kss/wiki_to_java/target/classes/META-INF/maven/plugin.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - org.kuali.student.mojo - maven-kscontract-plugin - 0.0.1-SNAPSHOT - kscontract - false - true - - - contractToJava - Creates WS service interface from wiki service contract. - false - true - false - false - false - true - org.kuali.student.mojo.KsContractMojo - java - per-lookup - once-per-session - - - contractFile - java.io.File - false - true - Path to service contract file. - - - contractURL - java.net.URL - false - true - URL of service contract from wiki. - - - jsessionId - java.lang.String - false - true - JSESSIONID from a current session - - - messageTransformFile - java.io.File - false - true - Path to custom xslt. - - - outputDirectory - java.io.File - false - true - Path to output directory. - - - transformFile - java.io.File - false - true - Path to custom xslt. - - - - - - \ No newline at end of file diff --git a/sandbox/kss/wiki_to_java/target/classes/interface.xml b/sandbox/kss/wiki_to_java/target/classes/interface.xml deleted file mode 100644 index 180860e6e..000000000 --- a/sandbox/kss/wiki_to_java/target/classes/interface.xml +++ /dev/null @@ -1,143 +0,0 @@ - - - - - -/* - * Copyright 2008 The Kuali Foundation - * - * Licensed under the Educational Community License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.opensource.org/licenses/ecl1.php - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - - - public interface foo { - - /** - * - - - - - * @param - - - - - - - * @return - - - - * @throws - - Exception - - - - */ - public - - - - - - - - ( - - ) - - ; - - } - - - - - , - - @WebParam(name=" - - ") - - - - - - - - - - - - - , - - - throws - - - Exception - - - - - - - List< - - - - - - > - - - Date - - - String - - - String - - - - - - - \ No newline at end of file diff --git a/sandbox/kss/wiki_to_java/target/classes/messageInterface.xml b/sandbox/kss/wiki_to_java/target/classes/messageInterface.xml deleted file mode 100644 index 43da376ea..000000000 --- a/sandbox/kss/wiki_to_java/target/classes/messageInterface.xml +++ /dev/null @@ -1,154 +0,0 @@ - - - - - - - - - -/* - * Copyright 2008 The Kuali Foundation - * - * Licensed under the Educational Community License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.opensource.org/licenses/ecl1.php - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; - -@XmlAccessorType(XmlAccessType.FIELD) -public class - - implements Serializable { - private static final long serialVersionUID = 1L; - - - - @XmlAttribute - - - @XmlElement - - - private - - - - ; - - - - - - public - - get - - () { - - - if ( - - == null) { - - - = new Array - - (); - } - - return - - - ; - } - - - public void set - - ( - - - - ) { - this. - - = - - ; - } - - - } - - - - - List< - - > - - - Date - - - String - - - String - - - String - - - - - - - \ No newline at end of file diff --git a/sandbox/kss/wiki_to_java/target/classes/org/kuali/student/contract/ContractReader.class b/sandbox/kss/wiki_to_java/target/classes/org/kuali/student/contract/ContractReader.class deleted file mode 100644 index 63daac9d9..000000000 Binary files a/sandbox/kss/wiki_to_java/target/classes/org/kuali/student/contract/ContractReader.class and /dev/null differ diff --git a/sandbox/kss/wiki_to_java/target/classes/org/kuali/student/contract/MessageContractReader.class b/sandbox/kss/wiki_to_java/target/classes/org/kuali/student/contract/MessageContractReader.class deleted file mode 100644 index 8ef21debb..000000000 Binary files a/sandbox/kss/wiki_to_java/target/classes/org/kuali/student/contract/MessageContractReader.class and /dev/null differ diff --git a/sandbox/kss/wiki_to_java/target/classes/org/kuali/student/mojo/KsContractMojo.class b/sandbox/kss/wiki_to_java/target/classes/org/kuali/student/mojo/KsContractMojo.class deleted file mode 100644 index 4f2f43982..000000000 Binary files a/sandbox/kss/wiki_to_java/target/classes/org/kuali/student/mojo/KsContractMojo.class and /dev/null differ diff --git a/sandbox/kss/wiki_to_java/transforms/Attribute.java b/sandbox/kss/wiki_to_java/transforms/Attribute.java deleted file mode 100644 index f8b5ab6b0..000000000 --- a/sandbox/kss/wiki_to_java/transforms/Attribute.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2008 The Kuali Foundation - * - * Licensed under the Educational Community License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.opensource.org/licenses/ecl1.php - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; - -@XmlAccessorType(XmlAccessType.FIELD) -public class Attribute implements Serializable { - - private static final long serialVersionUID = 1L; - - @XmlElement - private String value; - - @XmlAttribute - private String key; - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } -} \ No newline at end of file diff --git a/sandbox/kss/wiki_to_java/transforms/CommMediaTypeInfo.java b/sandbox/kss/wiki_to_java/transforms/CommMediaTypeInfo.java deleted file mode 100644 index 7906e05cb..000000000 --- a/sandbox/kss/wiki_to_java/transforms/CommMediaTypeInfo.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright 2008 The Kuali Foundation - * - * Licensed under the Educational Community License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.opensource.org/licenses/ecl1.php - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; - -@XmlAccessorType(XmlAccessType.FIELD) -public class CommMediaTypeInfo Structure implements Serializable { - - private static final long serialVersionUID = 1L; - - @XmlElement - private String name; - - @XmlElement - private String desc; - - @XmlElement - private Date effectiveDate; - - @XmlElement - private Date expirationDate; - - @XmlElement - private List attributes; - - @XmlAttribute - private String key; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getDesc() { - return desc; - } - - public void setDesc(String desc) { - this.desc = desc; - } - - public Date getEffectiveDate() { - return effectiveDate; - } - - public void setEffectiveDate(Date effectiveDate) { - this.effectiveDate = effectiveDate; - } - - public Date getExpirationDate() { - return expirationDate; - } - - public void setExpirationDate(Date expirationDate) { - this.expirationDate = expirationDate; - } - - public List getAttributes() { - if (attributes == null) { - attributes = new ArrayList(); - } - return attributes; - } - - public void setAttributes(List attributes) { - this.attributes = attributes; - } - - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } -} \ No newline at end of file diff --git a/sandbox/kss/wiki_to_java/transforms/CommUsageTypeInfo.java b/sandbox/kss/wiki_to_java/transforms/CommUsageTypeInfo.java deleted file mode 100644 index 6f6b2e5ba..000000000 --- a/sandbox/kss/wiki_to_java/transforms/CommUsageTypeInfo.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright 2008 The Kuali Foundation - * - * Licensed under the Educational Community License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.opensource.org/licenses/ecl1.php - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; - -@XmlAccessorType(XmlAccessType.FIELD) -public class CommUsageTypeInfo implements Serializable { - - private static final long serialVersionUID = 1L; - - @XmlElement - private String name; - - @XmlElement - private String desc; - - @XmlElement - private Date effectiveDate; - - @XmlElement - private Date expirationDate; - - @XmlElement - private List attributes; - - @XmlAttribute - private String key; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getDesc() { - return desc; - } - - public void setDesc(String desc) { - this.desc = desc; - } - - public Date getEffectiveDate() { - return effectiveDate; - } - - public void setEffectiveDate(Date effectiveDate) { - this.effectiveDate = effectiveDate; - } - - public Date getExpirationDate() { - return expirationDate; - } - - public void setExpirationDate(Date expirationDate) { - this.expirationDate = expirationDate; - } - - public List getAttributes() { - if (attributes == null) { - attributes = new ArrayList(); - } - return attributes; - } - - public void setAttributes(List attributes) { - this.attributes = attributes; - } - - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } -} \ No newline at end of file diff --git a/sandbox/kss/wiki_to_java/transforms/Date.java b/sandbox/kss/wiki_to_java/transforms/Date.java deleted file mode 100644 index 75b7ffdaf..000000000 --- a/sandbox/kss/wiki_to_java/transforms/Date.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2008 The Kuali Foundation - * - * Licensed under the Educational Community License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.opensource.org/licenses/ecl1.php - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; - -@XmlAccessorType(XmlAccessType.FIELD) -public class Date implements Serializable { - - private static final long serialVersionUID = 1L; -} \ No newline at end of file diff --git a/sandbox/kss/wiki_to_java/transforms/EnumContextInfo.java b/sandbox/kss/wiki_to_java/transforms/EnumContextInfo.java deleted file mode 100644 index 958061624..000000000 --- a/sandbox/kss/wiki_to_java/transforms/EnumContextInfo.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2008 The Kuali Foundation - * - * Licensed under the Educational Community License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.opensource.org/licenses/ecl1.php - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; - -@XmlAccessorType(XmlAccessType.FIELD) -public class EnumContextInfo implements Serializable { - - private static final long serialVersionUID = 1L; - - @XmlElement - private FieldDescriptor contextValueDescriptor; - - @XmlAttribute - private String type; - - public FieldDescriptor getContextValueDescriptor() { - return contextValueDescriptor; - } - - public void setContextValueDescriptor(FieldDescriptor contextValueDescriptor) { - this.contextValueDescriptor = contextValueDescriptor; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } -} \ No newline at end of file diff --git a/sandbox/kss/wiki_to_java/transforms/EnumContextValue.java b/sandbox/kss/wiki_to_java/transforms/EnumContextValue.java deleted file mode 100644 index 629ad5dd2..000000000 --- a/sandbox/kss/wiki_to_java/transforms/EnumContextValue.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2008 The Kuali Foundation - * - * Licensed under the Educational Community License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.opensource.org/licenses/ecl1.php - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; - -@XmlAccessorType(XmlAccessType.FIELD) -public class EnumContextValue implements Serializable { - - private static final long serialVersionUID = 1L; - - @XmlElement - private String type; - - @XmlElement - private String value; - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } -} \ No newline at end of file diff --git a/sandbox/kss/wiki_to_java/transforms/EnumFieldView.java b/sandbox/kss/wiki_to_java/transforms/EnumFieldView.java deleted file mode 100644 index 2179423da..000000000 --- a/sandbox/kss/wiki_to_java/transforms/EnumFieldView.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2008 The Kuali Foundation - * - * Licensed under the Educational Community License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.opensource.org/licenses/ecl1.php - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; - -@XmlAccessorType(XmlAccessType.FIELD) -public class EnumFieldView implements Serializable { - - private static final long serialVersionUID = 1L; - - @XmlElement - private List contextDescriptors; - - @XmlAttribute - private String key; - - public List getContextDescriptors() { - if (contextDescriptors == null) { - contextDescriptors = new ArrayList(); - } - return contextDescriptors; - } - - public void setContextDescriptors(List contextDescriptors) { - this.contextDescriptors = contextDescriptors; - } - - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } -} \ No newline at end of file diff --git a/sandbox/kss/wiki_to_java/transforms/EnumeratedValue.java b/sandbox/kss/wiki_to_java/transforms/EnumeratedValue.java deleted file mode 100644 index 123844caa..000000000 --- a/sandbox/kss/wiki_to_java/transforms/EnumeratedValue.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright 2008 The Kuali Foundation - * - * Licensed under the Educational Community License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.opensource.org/licenses/ecl1.php - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; - -@XmlAccessorType(XmlAccessType.FIELD) -public class EnumeratedValue implements Serializable { - - private static final long serialVersionUID = 1L; - - @XmlElement - private String code; - - @XmlElement - private String abbrevValue; - - @XmlElement - private String value; - - @XmlElement - private Date effectiveDate; - - @XmlElement - private Date expirationDate; - - @XmlElement - private String sortKey; - - @XmlElement - private List contexts; - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getAbbrevValue() { - return abbrevValue; - } - - public void setAbbrevValue(String abbrevValue) { - this.abbrevValue = abbrevValue; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - public Date getEffectiveDate() { - return effectiveDate; - } - - public void setEffectiveDate(Date effectiveDate) { - this.effectiveDate = effectiveDate; - } - - public Date getExpirationDate() { - return expirationDate; - } - - public void setExpirationDate(Date expirationDate) { - this.expirationDate = expirationDate; - } - - public String getSortKey() { - return sortKey; - } - - public void setSortKey(String sortKey) { - this.sortKey = sortKey; - } - - public List getContexts() { - if (contexts == null) { - contexts = new ArrayList(); - } - return contexts; - } - - public void setContexts(List contexts) { - this.contexts = contexts; - } -} \ No newline at end of file diff --git a/sandbox/kss/wiki_to_java/transforms/FieldDescriptor.java b/sandbox/kss/wiki_to_java/transforms/FieldDescriptor.java deleted file mode 100644 index cbab3c16d..000000000 --- a/sandbox/kss/wiki_to_java/transforms/FieldDescriptor.java +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Copyright 2008 The Kuali Foundation - * - * Licensed under the Educational Community License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.opensource.org/licenses/ecl1.php - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; - -@XmlAccessorType(XmlAccessType.FIELD) -public class FieldDescriptor implements Serializable { - - private static final long serialVersionUID = 1L; - - @XmlElement - private String name; - - @XmlElement - private String desc; - - @XmlElement - private String dataType; - - @XmlElement - private Integer minLength; - - @XmlElement - private String maxLength; - - @XmlElement - private String validChars; - - @XmlElement - private String invalidChars; - - @XmlElement - private String minValue; - - @XmlElement - private String maxValue; - - @XmlElement - private EnumFieldView enumFieldView; - - @XmlElement - private Integer minOccurs; - - @XmlElement - private String maxOccurs; - - @XmlElement - private Boolean readOnly; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getDesc() { - return desc; - } - - public void setDesc(String desc) { - this.desc = desc; - } - - public String getDataType() { - return dataType; - } - - public void setDataType(String dataType) { - this.dataType = dataType; - } - - public Integer getMinLength() { - return minLength; - } - - public void setMinLength(Integer minLength) { - this.minLength = minLength; - } - - public String getMaxLength() { - return maxLength; - } - - public void setMaxLength(String maxLength) { - this.maxLength = maxLength; - } - - public String getValidChars() { - return validChars; - } - - public void setValidChars(String validChars) { - this.validChars = validChars; - } - - public String getInvalidChars() { - return invalidChars; - } - - public void setInvalidChars(String invalidChars) { - this.invalidChars = invalidChars; - } - - public String getMinValue() { - return minValue; - } - - public void setMinValue(String minValue) { - this.minValue = minValue; - } - - public String getMaxValue() { - return maxValue; - } - - public void setMaxValue(String maxValue) { - this.maxValue = maxValue; - } - - public EnumFieldView getEnumFieldView() { - return enumFieldView; - } - - public void setEnumFieldView(EnumFieldView enumFieldView) { - this.enumFieldView = enumFieldView; - } - - public Integer getMinOccurs() { - return minOccurs; - } - - public void setMinOccurs(Integer minOccurs) { - this.minOccurs = minOccurs; - } - - public String getMaxOccurs() { - return maxOccurs; - } - - public void setMaxOccurs(String maxOccurs) { - this.maxOccurs = maxOccurs; - } - - public Boolean getReadOnly() { - return readOnly; - } - - public void setReadOnly(Boolean readOnly) { - this.readOnly = readOnly; - } -} \ No newline at end of file diff --git a/sandbox/kss/wiki_to_java/transforms/FieldSelector.java b/sandbox/kss/wiki_to_java/transforms/FieldSelector.java deleted file mode 100644 index 55f5c225e..000000000 --- a/sandbox/kss/wiki_to_java/transforms/FieldSelector.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2008 The Kuali Foundation - * - * Licensed under the Educational Community License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.opensource.org/licenses/ecl1.php - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; - -@XmlAccessorType(XmlAccessType.FIELD) -public class FieldSelector implements Serializable { - - private static final long serialVersionUID = 1L; - - @XmlElement - private FieldDescriptor fieldDescriptor; - - @XmlElement - private Boolean isSelector; - - @XmlAttribute - private String key; - - public FieldDescriptor getFieldDescriptor() { - return fieldDescriptor; - } - - public void setFieldDescriptor(FieldDescriptor fieldDescriptor) { - this.fieldDescriptor = fieldDescriptor; - } - - public Boolean getIsSelector() { - return isSelector; - } - - public void setIsSelector(Boolean isSelector) { - this.isSelector = isSelector; - } - - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } -} \ No newline at end of file diff --git a/sandbox/kss/wiki_to_java/transforms/ObjectStructure.java b/sandbox/kss/wiki_to_java/transforms/ObjectStructure.java deleted file mode 100644 index 4eab0b98f..000000000 --- a/sandbox/kss/wiki_to_java/transforms/ObjectStructure.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2008 The Kuali Foundation - * - * Licensed under the Educational Community License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.opensource.org/licenses/ecl1.php - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; - -@XmlAccessorType(XmlAccessType.FIELD) -public class ObjectStructure implements Serializable { - - private static final long serialVersionUID = 1L; - - @XmlElement - private TypeSelector type; - - @XmlAttribute - private String objectTypeKey; - - public TypeSelector getType() { - return type; - } - - public void setType(TypeSelector type) { - this.type = type; - } - - public String getObjectTypeKey() { - return objectTypeKey; - } - - public void setObjectTypeKey(String objectTypeKey) { - this.objectTypeKey = objectTypeKey; - } -} \ No newline at end of file diff --git a/sandbox/kss/wiki_to_java/transforms/QueryParamInfo.java b/sandbox/kss/wiki_to_java/transforms/QueryParamInfo.java deleted file mode 100644 index 5a2b2a083..000000000 --- a/sandbox/kss/wiki_to_java/transforms/QueryParamInfo.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2008 The Kuali Foundation - * - * Licensed under the Educational Community License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.opensource.org/licenses/ecl1.php - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; - -@XmlAccessorType(XmlAccessType.FIELD) -public class QueryParamInfo implements Serializable { - - private static final long serialVersionUID = 1L; - - @XmlElement - private FieldDescriptor fieldDescriptor; - - @XmlAttribute - private String key; - - public FieldDescriptor getFieldDescriptor() { - return fieldDescriptor; - } - - public void setFieldDescriptor(FieldDescriptor fieldDescriptor) { - this.fieldDescriptor = fieldDescriptor; - } - - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } -} \ No newline at end of file diff --git a/sandbox/kss/wiki_to_java/transforms/QueryParamValue.java b/sandbox/kss/wiki_to_java/transforms/QueryParamValue.java deleted file mode 100644 index 5235bd6cf..000000000 --- a/sandbox/kss/wiki_to_java/transforms/QueryParamValue.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2008 The Kuali Foundation - * - * Licensed under the Educational Community License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.opensource.org/licenses/ecl1.php - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; - -@XmlAccessorType(XmlAccessType.FIELD) -public class QueryParamValue implements Serializable { - - private static final long serialVersionUID = 1L; - - @XmlElement - private String value; - - @XmlAttribute - private String key; - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } -} \ No newline at end of file diff --git a/sandbox/kss/wiki_to_java/transforms/Result.java b/sandbox/kss/wiki_to_java/transforms/Result.java deleted file mode 100644 index 501a45934..000000000 --- a/sandbox/kss/wiki_to_java/transforms/Result.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2008 The Kuali Foundation - * - * Licensed under the Educational Community License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.opensource.org/licenses/ecl1.php - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; - -@XmlAccessorType(XmlAccessType.FIELD) -public class Result implements Serializable { - - private static final long serialVersionUID = 1L; - - @XmlElement - private ResultCell resultCell; - - public ResultCell getResultCell() { - return resultCell; - } - - public void setResultCell(ResultCell resultCell) { - this.resultCell = resultCell; - } -} \ No newline at end of file diff --git a/sandbox/kss/wiki_to_java/transforms/ResultCell.java b/sandbox/kss/wiki_to_java/transforms/ResultCell.java deleted file mode 100644 index ca744a51a..000000000 --- a/sandbox/kss/wiki_to_java/transforms/ResultCell.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2008 The Kuali Foundation - * - * Licensed under the Educational Community License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.opensource.org/licenses/ecl1.php - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; - -@XmlAccessorType(XmlAccessType.FIELD) -public class ResultCell implements Serializable { - - private static final long serialVersionUID = 1L; - - @XmlElement - private String value; - - @XmlAttribute - private String key; - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } -} \ No newline at end of file diff --git a/sandbox/kss/wiki_to_java/transforms/ResultColumnInfo.java b/sandbox/kss/wiki_to_java/transforms/ResultColumnInfo.java deleted file mode 100644 index e1cad0e4e..000000000 --- a/sandbox/kss/wiki_to_java/transforms/ResultColumnInfo.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2008 The Kuali Foundation - * - * Licensed under the Educational Community License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.opensource.org/licenses/ecl1.php - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; - -@XmlAccessorType(XmlAccessType.FIELD) -public class ResultColumnInfo implements Serializable { - - private static final long serialVersionUID = 1L; - - @XmlElement - private String name; - - @XmlElement - private String desc; - - @XmlElement - private String dataType; - - @XmlAttribute - private String key; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getDesc() { - return desc; - } - - public void setDesc(String desc) { - this.desc = desc; - } - - public String getDataType() { - return dataType; - } - - public void setDataType(String dataType) { - this.dataType = dataType; - } - - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } -} \ No newline at end of file diff --git a/sandbox/kss/wiki_to_java/transforms/SearchCriteriaTypeInfo.java b/sandbox/kss/wiki_to_java/transforms/SearchCriteriaTypeInfo.java deleted file mode 100644 index 493cb925a..000000000 --- a/sandbox/kss/wiki_to_java/transforms/SearchCriteriaTypeInfo.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright 2008 The Kuali Foundation - * - * Licensed under the Educational Community License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.opensource.org/licenses/ecl1.php - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; - -@XmlAccessorType(XmlAccessType.FIELD) -public class SearchCriteriaTypeInfo implements Serializable { - - private static final long serialVersionUID = 1L; - - @XmlElement - private String name; - - @XmlElement - private String desc; - - @XmlElement - private List queryParams; - - @XmlAttribute - private String key; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getDesc() { - return desc; - } - - public void setDesc(String desc) { - this.desc = desc; - } - - public List getQueryParams() { - if (queryParams == null) { - queryParams = new ArrayList(); - } - return queryParams; - } - - public void setQueryParams(List queryParams) { - this.queryParams = queryParams; - } - - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } -} \ No newline at end of file diff --git a/sandbox/kss/wiki_to_java/transforms/SearchResultTypeInfo.java b/sandbox/kss/wiki_to_java/transforms/SearchResultTypeInfo.java deleted file mode 100644 index 9eec714b9..000000000 --- a/sandbox/kss/wiki_to_java/transforms/SearchResultTypeInfo.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright 2008 The Kuali Foundation - * - * Licensed under the Educational Community License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.opensource.org/licenses/ecl1.php - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; - -@XmlAccessorType(XmlAccessType.FIELD) -public class SearchResultTypeInfo implements Serializable { - - private static final long serialVersionUID = 1L; - - @XmlElement - private String name; - - @XmlElement - private String desc; - - @XmlElement - private List resultColumns; - - @XmlAttribute - private String key; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getDesc() { - return desc; - } - - public void setDesc(String desc) { - this.desc = desc; - } - - public List getResultColumns() { - if (resultColumns == null) { - resultColumns = new ArrayList(); - } - return resultColumns; - } - - public void setResultColumns(List resultColumns) { - this.resultColumns = resultColumns; - } - - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } -} \ No newline at end of file diff --git a/sandbox/kss/wiki_to_java/transforms/SearchTypeInfo.java b/sandbox/kss/wiki_to_java/transforms/SearchTypeInfo.java deleted file mode 100644 index e8e0447a9..000000000 --- a/sandbox/kss/wiki_to_java/transforms/SearchTypeInfo.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright 2008 The Kuali Foundation - * - * Licensed under the Educational Community License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.opensource.org/licenses/ecl1.php - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; - -@XmlAccessorType(XmlAccessType.FIELD) -public class SearchTypeInfo Structure implements Serializable { - - private static final long serialVersionUID = 1L; - - @XmlElement - private String name; - - @XmlElement - private String desc; - - @XmlElement - private SearchResultTypeInfo searchResultTypeInfo; - - @XmlElement - private SearchCriteriaTypeInfo searchCriteriaTypeInfo; - - @XmlAttribute - private String key; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getDesc() { - return desc; - } - - public void setDesc(String desc) { - this.desc = desc; - } - - public SearchResultTypeInfo getSearchResultTypeInfo() { - return searchResultTypeInfo; - } - - public void setSearchResultTypeInfo(SearchResultTypeInfo searchResultTypeInfo) { - this.searchResultTypeInfo = searchResultTypeInfo; - } - - public SearchCriteriaTypeInfo getSearchCriteriaTypeInfo() { - return searchCriteriaTypeInfo; - } - - public void setSearchCriteriaTypeInfo(SearchCriteriaTypeInfo searchCriteriaTypeInfo) { - this.searchCriteriaTypeInfo = searchCriteriaTypeInfo; - } - - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } -} \ No newline at end of file diff --git a/sandbox/kss/wiki_to_java/transforms/StateSelector.java b/sandbox/kss/wiki_to_java/transforms/StateSelector.java deleted file mode 100644 index 0a11c8209..000000000 --- a/sandbox/kss/wiki_to_java/transforms/StateSelector.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2008 The Kuali Foundation - * - * Licensed under the Educational Community License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.opensource.org/licenses/ecl1.php - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; - -@XmlAccessorType(XmlAccessType.FIELD) -public class StateSelector implements Serializable { - - private static final long serialVersionUID = 1L; - - @XmlElement - private FieldSelector field; - - @XmlAttribute - private String key; - - public FieldSelector getField() { - return field; - } - - public void setField(FieldSelector field) { - this.field = field; - } - - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } -} \ No newline at end of file diff --git a/sandbox/kss/wiki_to_java/transforms/Status.java b/sandbox/kss/wiki_to_java/transforms/Status.java deleted file mode 100644 index cc723c9c2..000000000 --- a/sandbox/kss/wiki_to_java/transforms/Status.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2008 The Kuali Foundation - * - * Licensed under the Educational Community License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.opensource.org/licenses/ecl1.php - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; - -@XmlAccessorType(XmlAccessType.FIELD) -public class Status implements Serializable { - - private static final long serialVersionUID = 1L; - - @XmlElement - private Boolean success; - - public Boolean getSuccess() { - return success; - } - - public void setSuccess(Boolean success) { - this.success = success; - } -} \ No newline at end of file diff --git a/sandbox/kss/wiki_to_java/transforms/TypeSelector.java b/sandbox/kss/wiki_to_java/transforms/TypeSelector.java deleted file mode 100644 index bb289192b..000000000 --- a/sandbox/kss/wiki_to_java/transforms/TypeSelector.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2008 The Kuali Foundation - * - * Licensed under the Educational Community License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.opensource.org/licenses/ecl1.php - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; - -@XmlAccessorType(XmlAccessType.FIELD) -public class TypeSelector implements Serializable { - - private static final long serialVersionUID = 1L; - - @XmlElement - private StateSelector state; - - @XmlAttribute - private String key; - - public StateSelector getState() { - return state; - } - - public void setState(StateSelector state) { - this.state = state; - } - - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } -} \ No newline at end of file diff --git a/sandbox/kss/wiki_to_java/transforms/foo.java b/sandbox/kss/wiki_to_java/transforms/foo.java deleted file mode 100644 index f64e875b5..000000000 --- a/sandbox/kss/wiki_to_java/transforms/foo.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2008 The Kuali Foundation - * - * Licensed under the Educational Community License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.opensource.org/licenses/ecl1.php - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - public interface foo { - /** - * Retrieves the list of communication media types that are supported for a given usage type. - * @param commUsageTypeKey usage type identifier - * @return list of communication media type information - * @throws DoesNotExistException commUsageTypeKey not found - * @throws InvalidParameterException invalid commUsageTypeKey - * @throws MissingParameterException missing commUsageTypeKey - * @throws OperationFailedException unable to complete request - */ - public List getCommMediaTypesForUsageType(@WebParam(name="commUsageTypeKey")String commUsageTypeKey) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException; - -} \ No newline at end of file diff --git a/sandbox/kss/wiki_to_java/transforms/~foo.java b/sandbox/kss/wiki_to_java/transforms/~foo.java deleted file mode 100644 index d9cf1f2bb..000000000 --- a/sandbox/kss/wiki_to_java/transforms/~foo.java +++ /dev/null @@ -1,282 +0,0 @@ -/* - * Copyright 2008 The Kuali Foundation - * - * Licensed under the Educational Community License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.opensource.org/licenses/ecl1.php - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - public interface foo { - /** - * Retrieves the list of object type identifiers known by this service. Example: cluInfo. - * @return list of object type identifiers - * @throws OperationFailedException unable to complete request - */ - public List findObjectTypes() throws OperationFailedException; - - /** - * Retrieves the basic dictionary information about a particular object structure. Including all variations based on a certain type and state. Example: Given that a CLU is of type "Course" and in the state of "Proposed," tell which fields are read only, mandatory, not applicable, have enumerations available, etc. - * @param objectTypeKey identifier of the object type - * @return describes the fields for the input object type - * @throws DoesNotExistException specified objectTypeKey not found - * @throws InvalidParameterException invalid objectTypeKey - * @throws MissingParameterException missing objectTypeKey - * @throws OperationFailedException unable to complete request - */ - public ObjectStructure fetchObjectStructure(@WebParam(name="objectTypeKey")String objectTypeKey) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException; - - /** - * Retrieves the list of enumeration values for a particular enumeration with a certain context for a particular date. The values returned should be those where the supplied date is between the effective and expiration dates. Certain enumerations may not support this functionality. - * @param enumerationKey identifier of the enumeration - * @param contextType identifier of the enumeration context type - * @param contextValue value of the enumeration context - * @param contextDate date and time to get the enumeration for - * @return list of enumerated codes and values - * @throws DoesNotExistException enumerationKey not found - * @throws InvalidParameterException invalid enumerationKey, contextType, contextValue, contextDate - * @throws MissingParameterException missing enumerationKey, contextType, contextValue, contextDate - * @throws OperationFailedException unable to complete request - */ - public List fetchEnumeration(@WebParam(name="enumerationKey")String enumerationKey, @WebParam(name="contextType")String contextType, @WebParam(name="contextValue")String contextValue, @WebParam(name="contextDate")Date contextDate) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException; - - /** - * Retrieves the list of search types known by this service. - * @return list of search type information - * @throws OperationFailedException unable to complete request - */ - public List findSearchTypes() throws OperationFailedException; - - /** - * Retrieves information about a particular search type. - * @param searchTypeKey identifier of the search type - * @return information on the search type - * @throws DoesNotExistException specified searchTypeKey not found - * @throws InvalidParameterException invalid searchTypeKey - * @throws MissingParameterException searchTypeKey not specified - * @throws OperationFailedException unable to complete request - */ - public SearchTypeInfo fetchSearchType(@WebParam(name="searchTypeKey")String searchTypeKey) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException; - - /** - * Retrieves the list of search types which return results in the specified format. - * @param searchResultTypeKey identifier of the search result type - * @return list of search type information - * @throws DoesNotExistException specified searchResultTypeKey not found - * @throws InvalidParameterException invalid searchResultTypeKey - * @throws MissingParameterException searchResultTypeKey not specified - * @throws OperationFailedException unable to complete request - */ - public List findSearchTypesByResult(@WebParam(name="searchResultTypeKey")String searchResultTypeKey) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException; - - /** - * Retrieves the list of search types which use criteria in the specified format. - * @param searchCriteriaTypeKey identifier of the search criteria - * @return list of search type information - * @throws DoesNotExistException specified searchCriteriaTypeKey not found - * @throws InvalidParameterException invalid searchCriteriaTypeKey - * @throws MissingParameterException searchCriteriaTypeKey not specified - * @throws OperationFailedException unable to complete request - */ - public List findSearchTypesByCriteria(@WebParam(name="searchCriteriaTypeKey")String searchCriteriaTypeKey) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException; - - /** - * Retrieves the list of search result types known by this service. Search result types describe the return structure for a search. - * @return list of search result type information - * @throws OperationFailedException unable to complete request - */ - public List findSearchResultTypes() throws OperationFailedException; - - /** - * Retrieves information about a particular search result type. Search result types describe the return structure for a search. - * @param searchResultTypeKey identifier of the search result type - * @return information on the search result type - * @throws DoesNotExistException specified searchResultTypeKey not found - * @throws InvalidParameterException invalid searchResultTypeKey - * @throws MissingParameterException searchResultTypeKey not specified - * @throws OperationFailedException unable to complete request - */ - public SearchResultTypeInfo fetchSearchResultType(@WebParam(name="searchResultTypeKey")String searchResultTypeKey) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException; - - /** - * Retrieves the list of search criteria types known by this service. - * @return list of search criteria type information - * @throws OperationFailedException unable to complete request - */ - public List findSearchCriteriaTypes() throws OperationFailedException; - - /** - * Retrieves information about a particular search criteria type. - * @param searchCriteriaTypeKey identifier of the search criteria type - * @return information on the search criteria type - * @throws DoesNotExistException specified searchCriteriaTypeKey not found - * @throws InvalidParameterException invalid searchCriteriaTypeKey - * @throws MissingParameterException searchCriteriaTypeKey not specified - * @throws OperationFailedException unable to complete request - */ - public SearchCriteriaTypeInfo fetchSearchCriteriaType(@WebParam(name="searchCriteriaTypeKey")String searchCriteriaTypeKey) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException; - - /** - * Retrieve the list of authentication types known by this service - * @return list of authentication types - * @throws OperationFailedException unable to complete request - */ - public List findAuthenticationTypes() throws OperationFailedException; - - /** - * Retrieves a list of Principals for a given Person - * @param personId person identifier - * @return list of principal ids for the specified person - * @throws DisabledIdentifierException personId found but has been retired - * @throws DoesNotExistException personId not found - * @throws InvalidParameterException invalid personId - * @throws MissingParameterException missing personId - * @throws OperationFailedException unable to complete request - * @throws PermissionDeniedException authorization failure - */ - public List findPrincipalIdsByPerson(@WebParam(name="personId")String personId) throws DisabledIdentifierException, DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException; - - /** - * Retrieves a list of Principals for a given System - * @param systemId system identifier - * @return list of principal ids for the given system - * @throws DisabledIdentifierException systemId found but has been retired - * @throws DoesNotExistException systemId not found - * @throws InvalidParameterException invalid systemId - * @throws MissingParameterException missing systemId - * @throws OperationFailedException unable to complete request - * @throws PermissionDeniedException authorization failure - */ - public List findPrincipalIdsBySystem(@WebParam(name="systemId")String systemId) throws DisabledIdentifierException, DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException; - - /** - * Retrieves a Person for a given Principal - * @param principalId principal identifier - * @return person identifier that matches the supplied criteria - * @throws DisabledIdentifierException principalId found but has been retired - * @throws DoesNotExistException principalId not found - * @throws InvalidParameterException invalid principalId - * @throws MissingParameterException missing principalId - * @throws OperationFailedException unable to complete request - * @throws PermissionDeniedException authorization failure - */ - public String fetchPersonIdByPrincipal(@WebParam(name="principalId")String principalId) throws DisabledIdentifierException, DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException; - - /** - * Retrieves a System for a given Principal - * @param principalId principal identifier - * @return system identifier that matches the supplied criteria - * @throws DisabledIdentifierException systemId found but has been retired - * @throws DoesNotExistException systemId not found - * @throws InvalidParameterException invalid principalId - * @throws MissingParameterException missing principalId - * @throws OperationFailedException unable to complete request - * @throws PermissionDeniedException authorization failure - */ - public String fetchSystemByPrincipal(@WebParam(name="principalId")String principalId) throws DisabledIdentifierException, DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException; - - /** - * Retrieves a Principal Type for a given Principal - * @param principalId principal identifier - * @return principal type that matches the supplied criteria - * @throws DisabledIdentifierException principalId found but has been retired - * @throws DoesNotExistException principalId not found - * @throws InvalidParameterException invalid principalId - * @throws MissingParameterException missing principalId - * @throws OperationFailedException unable to complete request - * @throws PermissionDeniedException authorization failure - */ - public PrincipalType fetchPrincipalTypeForPrincipal(@WebParam(name="principalId")String principalId) throws DisabledIdentifierException, DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException; - - /** - * Retrieves a list of Principal Types for a given list of Principal Ids - * @param principalIdList list of principal identifiers - * @return List of principal types that match the supplied criteria - * @throws DisabledIdentifierException One or more principalIds found but have been retired - * @throws DoesNotExistException One or more principalIds not found - * @throws InvalidParameterException invalid principalIdList - * @throws MissingParameterException missing principalId - * @throws OperationFailedException unable to complete request - * @throws PermissionDeniedException authorization failure - */ - public List findPrincipalTypesByPrincipalIdList(@WebParam(name="principalIdList")List principalIdList) throws DisabledIdentifierException, DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException; - - /** - * Retrieves results in tabular form for the specified parameters. - * @param searchTypeKey search identifier - * @param queryParamValues list of values for search parameters - * @return list of results from the query - * @throws DoesNotExistException specified search type not found - * @throws InvalidParameterException invalid searchTypeKey, queryParamValueList - * @throws MissingParameterException searchTypeKey, queryParamValueList not specified - * @throws OperationFailedException unable to complete request - * @throws PermissionDeniedException authorization failure - */ - public List searchForResults(@WebParam(name="searchTypeKey")String searchTypeKey, @WebParam(name="queryParamValues")List queryParamValues) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException; - - /** - * Assigns a Principal to a Person - * @param principalId principal identifier - * @param personId person identifier - * @return status of the operation - * @throws AlreadyExistsException association already exists - * @throws DisabledIdentifierException personId or principalId found but has been retired - * @throws DoesNotExistException personId, principalId does not exist - * @throws InvalidParameterException invalid personId, principalId - * @throws MissingParameterException missing personId, principalId - * @throws OperationFailedException unable to complete request - * @throws PermissionDeniedException authorization failure - */ - public Status assignPrincipalToPerson(@WebParam(name="principalId")String principalId, @WebParam(name="personId")String personId) throws AlreadyExistsException, DisabledIdentifierException, DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException; - - /** - * Assigns a Principal to a System - * @param principalId principal identifier - * @param systemId system identifier - * @return status of the operation - * @throws AlreadyExistsException association already exists - * @throws DisabledIdentifierException principalId, systemId found but has been retired - * @throws DoesNotExistException principalId, systemId does not exist - * @throws InvalidParameterException invalid principalId, systemId - * @throws MissingParameterException missing principalId, systemId - * @throws OperationFailedException unable to complete request - * @throws PermissionDeniedException authorization failure - */ - public Status assignPrincipalToSystem(@WebParam(name="principalId")String principalId, @WebParam(name="systemId")String systemId) throws AlreadyExistsException, DisabledIdentifierException, DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException; - - /** - * Remove a Principal from a Person - * @param principalId principal identifier - * @param personId person identifier - * @return status of the operation - * @throws DisabledIdentifierException personId or principalId found but has been retired - * @throws DoesNotExistException personId, principalId, association does not exist - * @throws InvalidParameterException invalid personId, principalId - * @throws MissingParameterException missing personId, principalId - * @throws OperationFailedException unable to complete request - * @throws PermissionDeniedException authorization failure - */ - public Status removePrincipalFromPerson(@WebParam(name="principalId")String principalId, @WebParam(name="personId")String personId) throws DisabledIdentifierException, DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException; - - /** - * Remove a Principal from a System - * @param principalId principal identifier - * @param systemId system identifier - * @return status of the operation - * @throws DisabledIdentifierException principalId, systemId found but has been retired - * @throws DoesNotExistException principalId, systemId, association does not exist - * @throws InvalidParameterException invalid principalId, systemId - * @throws MissingParameterException missing principalId, systemId - * @throws OperationFailedException unable to complete request - * @throws PermissionDeniedException authorization failure - */ - public Status removePrincipalFromSystem(@WebParam(name="principalId")String principalId, @WebParam(name="systemId")String systemId) throws DisabledIdentifierException, DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException; - -} \ No newline at end of file diff --git a/sandbox/richard/3rdparty/nuxeo/nuxeo-platform-collectionspace/build.properties b/sandbox/richard/3rdparty/nuxeo/nuxeo-platform-collectionspace/build.properties deleted file mode 100644 index c26799aa9..000000000 --- a/sandbox/richard/3rdparty/nuxeo/nuxeo-platform-collectionspace/build.properties +++ /dev/null @@ -1,15 +0,0 @@ -# Example for Windows -jboss.dir=c:/dev/jboss-4.2.3.GA -# Example for Unix -#jboss.dir=/opt/jboss - -# Which JBoss server config to use -jboss.config=default - -# nuxeo deployment -jboss.nuxeo.ear.dir=${jboss.dir}/server/${jboss.config}/deploy/nuxeo.ear - - -# additional command line parameters for mvn commands -# e.g. to work offline: -#mvn.opts=-o diff --git a/sandbox/richard/3rdparty/nuxeo/nuxeo-platform-collectionspace/build.xml b/sandbox/richard/3rdparty/nuxeo/nuxeo-platform-collectionspace/build.xml deleted file mode 100644 index d4e3b266c..000000000 --- a/sandbox/richard/3rdparty/nuxeo/nuxeo-platform-collectionspace/build.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/sandbox/richard/3rdparty/nuxeo/nuxeo-platform-collectionspace/pom.xml b/sandbox/richard/3rdparty/nuxeo/nuxeo-platform-collectionspace/pom.xml deleted file mode 100644 index 540859ee7..000000000 --- a/sandbox/richard/3rdparty/nuxeo/nuxeo-platform-collectionspace/pom.xml +++ /dev/null @@ -1,30 +0,0 @@ - - 4.0.0 - - - org.nuxeo.ecm.platform - nuxeo-platform-parent - 5.2-SNAPSHOT - - - nuxeo-platform-collectionspace - jar - Nuxeo CS extensions - - Nuxeo Enterprise Platform: CS extensions - - - - - org.nuxeo.ecm.core - nuxeo-core-schema - - - org.nuxeo.ecm.platform - nuxeo-platform-types-core - - - - diff --git a/sandbox/richard/3rdparty/nuxeo/nuxeo-platform-collectionspace/src/main/resources/META-INF/MANIFEST.MF b/sandbox/richard/3rdparty/nuxeo/nuxeo-platform-collectionspace/src/main/resources/META-INF/MANIFEST.MF deleted file mode 100644 index 91c534186..000000000 --- a/sandbox/richard/3rdparty/nuxeo/nuxeo-platform-collectionspace/src/main/resources/META-INF/MANIFEST.MF +++ /dev/null @@ -1,22 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 1 -Bundle-Name: NuxeoCS -Bundle-SymbolicName: org.collectionspace.collectionobject;singleton:=true -Bundle-Version: 1.0.0 -Bundle-Localization: plugin -Bundle-Vendor: Nuxeo -Require-Bundle: org.nuxeo.runtime, - org.nuxeo.ecm.core.api, - org.nuxeo.ecm.core, - org.nuxeo.ecm.core.api, - org.nuxeo.ecm.platform.types.api, - org.nuxeo.ecm.platform.versioning.api, - org.nuxeo.ecm.platform.ui, - org.nuxeo.ecm.platform.forms.layout.client, - org.nuxeo.ecm.platform.publishing.api, - org.nuxeo.ecm.platform.ws -Provide-Package: org.collectionspace.collectionobject -Nuxeo-Component: OSGI-INF/core-types-contrib.xml, - OSGI-INF/ecm-types-contrib.xml, - OSGI-INF/layouts-contrib.xml - diff --git a/sandbox/richard/3rdparty/nuxeo/nuxeo-platform-collectionspace/src/main/resources/OSGI-INF/core-types-contrib.xml b/sandbox/richard/3rdparty/nuxeo/nuxeo-platform-collectionspace/src/main/resources/OSGI-INF/core-types-contrib.xml deleted file mode 100644 index 72aa5ef19..000000000 --- a/sandbox/richard/3rdparty/nuxeo/nuxeo-platform-collectionspace/src/main/resources/OSGI-INF/core-types-contrib.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/sandbox/richard/3rdparty/nuxeo/nuxeo-platform-collectionspace/src/main/resources/OSGI-INF/deployment-fragment.xml b/sandbox/richard/3rdparty/nuxeo/nuxeo-platform-collectionspace/src/main/resources/OSGI-INF/deployment-fragment.xml deleted file mode 100644 index 88b94ffd1..000000000 --- a/sandbox/richard/3rdparty/nuxeo/nuxeo-platform-collectionspace/src/main/resources/OSGI-INF/deployment-fragment.xml +++ /dev/null @@ -1,408 +0,0 @@ - - - - - - ${bundle.fileName} - - - - - nuxeo.war - /nuxeo - - - - - - - - - - - - Seam Context Filter - /ws/FileManageWS - - - - Seam Context Filter - /DocumentManagerWS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #{currentServerLocation.name}/#{currentTabAction.label} - - - - Create new document in #{currentDocument.name} - - - - Create new document in #{currentDocument.name} - - - - breadcrumb=command.user_dashboard - - - - breadcrumb=command.manageMembers - - - - breadcrumb=command.manageMembers - - - - breadcrumb=title.vocabularies - - - - breadcrumb=command.advancedSearch - - - - - - en - en_GB - en_US - fr - de - es - it - ar - ru - ja - vn - - - messages - - - - config/addWorkspace.jpdl.xml - - - - - - generic_error_page - /generic_error_page.xhtml - - - - - generic_message_page - /generic_message_page.xhtml - - - - - home - /nxstartup.xhtml - - - - - user_login - /login.xhtml - - - - - user_logout - /logout.xhtml - - - - - view_servers - /view_servers.xhtml - - - - - - - view_domains - /view_domains.xhtml - - - - - select_document_type - /select_document_type.xhtml - - - - - create_document - /create_document.xhtml - - - - - edit_document - /edit_document.xhtml - - - - - view_documents - /view_documents.xhtml - - - - - create_file - /create_file.xhtml - - - - - create_workspace_wizard - /createWorkspaceWizard.xhtml - - - - - send_email - /document_email.xhtml - - - - - - view_workspaces - /view_workspaces.xhtml - - - - - - create_domain - /create_domain.xhtml - - - - - - edit_domain - /edit_domain.xhtml - - - - - - create_workspace - /create_workspace.xhtml - - - - - - edit_workspace - /edit_workspace.xhtml - - - - - - - members_management - /members_management.xhtml - - - - - view_users - /view_users.xhtml - - - - - view_many_users - /view_many_users.xhtml - - - - - edit_user - /edit_user.xhtml - - - - - edit_user_password - /edit_user_password.xhtml - - - - - view_user - /view_user.xhtml - - - - - create_user - /create_user.xhtml - - - - - view_groups - /view_groups.xhtml - - - - - view_group - /view_group.xhtml - - - - - edit_group - /edit_group.xhtml - - - - - create_group - /create_group.xhtml - - - - - view_vocabularies - /view_vocabularies.xhtml - - - - - view_vocabulary - /view_vocabulary.xhtml - - - - - - - search_form - /search/search_form.xhtml - - - - - search_results_nxql - /search/search_results_nxql.xhtml - - - - - search_results_advanced - - /search/search_results_advanced.xhtml - - - - - - search_results_simple - /search/search_results_simple.xhtml - - - - - - - clipboard - /incl/clipboard.xhtml - - - - - user_dashboard - /user_dashboard.xhtml - - - - - select_workspace_template - /select_workspace_template.xhtml - - - - - pdf_generation_error - /pdf_generation_error.xhtml - - - - - mass_edit - /massedit_documents.xhtml - - - - - mass_edit_confirm - /massedit_documents_preview.xhtml - - - - - - diff --git a/sandbox/richard/3rdparty/nuxeo/nuxeo-platform-collectionspace/src/main/resources/OSGI-INF/ecm-types-contrib.xml b/sandbox/richard/3rdparty/nuxeo/nuxeo-platform-collectionspace/src/main/resources/OSGI-INF/ecm-types-contrib.xml deleted file mode 100644 index 541251f1e..000000000 --- a/sandbox/richard/3rdparty/nuxeo/nuxeo-platform-collectionspace/src/main/resources/OSGI-INF/ecm-types-contrib.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - view_documents - - - heading - collectionobject - - - - - - CollectionObject - - - - - - CollectionObject - - - - - diff --git a/sandbox/richard/3rdparty/nuxeo/nuxeo-platform-collectionspace/src/main/resources/OSGI-INF/layouts-contrib.xml b/sandbox/richard/3rdparty/nuxeo/nuxeo-platform-collectionspace/src/main/resources/OSGI-INF/layouts-contrib.xml deleted file mode 100644 index f3db69e49..000000000 --- a/sandbox/richard/3rdparty/nuxeo/nuxeo-platform-collectionspace/src/main/resources/OSGI-INF/layouts-contrib.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - - - - - csid - identifier - description - - - - - - - true - - csid - - - - hidden - - - - true - - - - cssClass - - - - - - - - true - - identifier - - - dataInputText - - - - - - - - true - - description - - - dataInputText - - - - - - diff --git a/sandbox/richard/3rdparty/nuxeo/nuxeo-platform-collectionspace/src/main/resources/schemas/collectionobject.xsd b/sandbox/richard/3rdparty/nuxeo/nuxeo-platform-collectionspace/src/main/resources/schemas/collectionobject.xsd deleted file mode 100644 index 0a126c947..000000000 --- a/sandbox/richard/3rdparty/nuxeo/nuxeo-platform-collectionspace/src/main/resources/schemas/collectionobject.xsd +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - diff --git a/sandbox/richard/HelloWorld/.classpath b/sandbox/richard/HelloWorld/.classpath deleted file mode 100644 index cad20f7d9..000000000 --- a/sandbox/richard/HelloWorld/.classpath +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/sandbox/richard/HelloWorld/.project b/sandbox/richard/HelloWorld/.project deleted file mode 100644 index 234cbef57..000000000 --- a/sandbox/richard/HelloWorld/.project +++ /dev/null @@ -1,23 +0,0 @@ - - - helloworld - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.maven.ide.eclipse.maven2Builder - - - - - - org.eclipse.jdt.core.javanature - org.maven.ide.eclipse.maven2Nature - - diff --git a/sandbox/richard/HelloWorld/.settings/org.eclipse.jdt.core.prefs b/sandbox/richard/HelloWorld/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 63daa7058..000000000 --- a/sandbox/richard/HelloWorld/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,12 +0,0 @@ -#Mon Mar 30 16:16:36 PDT 2009 -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.5 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.5 diff --git a/sandbox/richard/HelloWorld/.settings/org.maven.ide.eclipse.prefs b/sandbox/richard/HelloWorld/.settings/org.maven.ide.eclipse.prefs deleted file mode 100644 index acbd721a0..000000000 --- a/sandbox/richard/HelloWorld/.settings/org.maven.ide.eclipse.prefs +++ /dev/null @@ -1,8 +0,0 @@ -#Thu Mar 26 12:47:04 PDT 2009 -activeProfiles= -eclipse.preferences.version=1 -fullBuildGoals=process-test-resources -includeModules=false -resolveWorkspaceProjects=true -resourceFilterGoals=process-resources resources\:testResources -version=1 diff --git a/sandbox/richard/HelloWorld/HelloWorldClient/.classpath b/sandbox/richard/HelloWorld/HelloWorldClient/.classpath deleted file mode 100644 index 5fc0d1639..000000000 --- a/sandbox/richard/HelloWorld/HelloWorldClient/.classpath +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/sandbox/richard/HelloWorld/HelloWorldClient/.project b/sandbox/richard/HelloWorld/HelloWorldClient/.project deleted file mode 100644 index f44220ec1..000000000 --- a/sandbox/richard/HelloWorld/HelloWorldClient/.project +++ /dev/null @@ -1,23 +0,0 @@ - - - javaee-addressbook-client - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.maven.ide.eclipse.maven2Builder - - - - - - org.eclipse.jdt.core.javanature - org.maven.ide.eclipse.maven2Nature - - diff --git a/sandbox/richard/HelloWorld/HelloWorldClient/.settings/org.eclipse.jdt.core.prefs b/sandbox/richard/HelloWorld/HelloWorldClient/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 8a8650d9d..000000000 --- a/sandbox/richard/HelloWorld/HelloWorldClient/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,12 +0,0 @@ -#Thu Mar 26 13:03:04 PDT 2009 -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.5 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.5 diff --git a/sandbox/richard/HelloWorld/HelloWorldClient/.settings/org.maven.ide.eclipse.prefs b/sandbox/richard/HelloWorld/HelloWorldClient/.settings/org.maven.ide.eclipse.prefs deleted file mode 100644 index c6e4123cd..000000000 --- a/sandbox/richard/HelloWorld/HelloWorldClient/.settings/org.maven.ide.eclipse.prefs +++ /dev/null @@ -1,8 +0,0 @@ -#Thu Feb 26 16:30:28 PST 2009 -activeProfiles= -eclipse.preferences.version=1 -fullBuildGoals=process-test-resources -includeModules=false -resolveWorkspaceProjects=true -resourceFilterGoals=process-resources resources\:testResources -version=1 diff --git a/sandbox/richard/HelloWorld/HelloWorldClient/nb-configuration.xml b/sandbox/richard/HelloWorld/HelloWorldClient/nb-configuration.xml deleted file mode 100644 index 6c3fe600b..000000000 --- a/sandbox/richard/HelloWorld/HelloWorldClient/nb-configuration.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - default - 8 - 80 - - diff --git a/sandbox/richard/HelloWorld/HelloWorldClient/nbactions.xml b/sandbox/richard/HelloWorld/HelloWorldClient/nbactions.xml deleted file mode 100644 index 047c73d4e..000000000 --- a/sandbox/richard/HelloWorld/HelloWorldClient/nbactions.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - rebuild - - * - - - clean - install - - - true - - - - diff --git a/sandbox/richard/HelloWorld/HelloWorldClient/pom.xml b/sandbox/richard/HelloWorld/HelloWorldClient/pom.xml deleted file mode 100644 index 4eff1b8e5..000000000 --- a/sandbox/richard/HelloWorld/HelloWorldClient/pom.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - - helloworld - org.collectionspace.hello.services - 0.1 - - 4.0.0 - org.collectionspace.hello.services - helloworld-client - jar - 0.1 - Helloworld Client - - - org.collectionspace.hello.services - helloworld-jaxb - 0.1 - - - org.testng - testng - 5.6 - - - org.slf4j - slf4j-api - - - org.slf4j - slf4j-log4j12 - - - org.jboss.resteasy - resteasy-jaxrs - 1.0.2.GA - - - - tjws - webserver - - - - - org.jboss.resteasy - resteasy-jaxb-provider - 1.0.2.GA - - - commons-httpclient - commons-httpclient - - - - - - maven-compiler-plugin - 2.0.2 - - 1.5 - 1.5 - - - - - diff --git a/sandbox/richard/HelloWorld/HelloWorldClient/src/main/java/org/collectionspace/hello/client/CollectionObjectClient.java b/sandbox/richard/HelloWorld/HelloWorldClient/src/main/java/org/collectionspace/hello/client/CollectionObjectClient.java deleted file mode 100644 index 8e5a7cf9f..000000000 --- a/sandbox/richard/HelloWorld/HelloWorldClient/src/main/java/org/collectionspace/hello/client/CollectionObjectClient.java +++ /dev/null @@ -1,96 +0,0 @@ -package org.collectionspace.hello.client; - -import javax.ws.rs.core.Response; - -import org.collectionspace.hello.CollectionObject; -import org.collectionspace.hello.CollectionObjectList; - -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 CollectionObjectClient. - - * @version $Revision:$ - */ -public class CollectionObjectClient { - - private static final String HOST = "http://localhost:8080"; - private static final String URI = "/helloworld/cspace-nuxeo"; - - /** - * - */ - private static final CollectionObjectClient instance = new CollectionObjectClient(); - /** - * - */ - private CollectionObjectProxy collectionObjectProxy; - - /** - * - * Default constructor for CollectionObjectClient class. - * - */ - private CollectionObjectClient() { - ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance(); - RegisterBuiltin.register(factory); - collectionObjectProxy = ProxyFactory.create(CollectionObjectProxy.class, HOST + URI); - } - - /** - * FIXME Comment this - * - * @return - */ - public static CollectionObjectClient getInstance() { - return instance; - } - - /** - * @return - * @see org.collectionspace.hello.client.CollectionObjectProxy#getCollectionObject() - */ - public ClientResponse getCollectionObjectList() { - return collectionObjectProxy.getCollectionObjectList(); - } - - /** - * @param csid - * @return - * @see org.collectionspace.hello.client.CollectionObjectProxy#getCollectionObject(java.lang.String) - */ - public ClientResponse getCollectionObject(String csid) { - return collectionObjectProxy.getCollectionObject(csid); - } - - /** - * @param collectionobject - * @return - * @see org.collectionspace.hello.client.CollectionObjectProxy#createCollectionObject(org.collectionspace.hello.CollectionObject) - */ - public ClientResponse createCollectionObject(CollectionObject collectionObject) { - return collectionObjectProxy.createCollectionObject(collectionObject); - } - - /** - * @param csid - * @param collectionobject - * @return - * @see org.collectionspace.hello.client.CollectionObjectProxy#updateCollectionObject(java.lang.Long, org.collectionspace.hello.CollectionObject) - */ - public ClientResponse updateCollectionObject(String csid, CollectionObject collectionObject) { - return collectionObjectProxy.updateCollectionObject(csid, collectionObject); - } - - /** - * @param csid - * @return - * @see org.collectionspace.hello.client.CollectionObjectProxy#deleteCollectionObject(java.lang.Long) - */ - public ClientResponse deleteCollectionObject(String csid) { - return collectionObjectProxy.deleteCollectionObject(csid); - } -} diff --git a/sandbox/richard/HelloWorld/HelloWorldClient/src/main/java/org/collectionspace/hello/client/CollectionObjectProxy.java b/sandbox/richard/HelloWorld/HelloWorldClient/src/main/java/org/collectionspace/hello/client/CollectionObjectProxy.java deleted file mode 100644 index 6097fed14..000000000 --- a/sandbox/richard/HelloWorld/HelloWorldClient/src/main/java/org/collectionspace/hello/client/CollectionObjectProxy.java +++ /dev/null @@ -1,46 +0,0 @@ -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.collectionspace.hello.CollectionObject; -import org.collectionspace.hello.CollectionObjectList; -import org.jboss.resteasy.client.ClientResponse; - -/** - * @version $Revision:$ - */ -@Path("/collectionobjects/") -@Produces({"application/xml"}) -@Consumes({"application/xml"}) -public interface CollectionObjectProxy { - - @GET - ClientResponse getCollectionObjectList(); - - //(C)reate - @POST - ClientResponse createCollectionObject(CollectionObject co); - - //(R)ead - @GET - @Path("/{csid}") - ClientResponse getCollectionObject(@PathParam("csid") String csid); - - //(U)pdate - @PUT - @Path("/{csid}") - ClientResponse updateCollectionObject(@PathParam("csid") String csid, CollectionObject co); - - //(D)elete - @DELETE - @Path("/{csid}") - ClientResponse deleteCollectionObject(@PathParam("csid") String csid); -} \ No newline at end of file diff --git a/sandbox/richard/HelloWorld/HelloWorldClient/src/main/java/org/collectionspace/hello/client/IdentifierClient.java b/sandbox/richard/HelloWorld/HelloWorldClient/src/main/java/org/collectionspace/hello/client/IdentifierClient.java deleted file mode 100644 index eda08b0d5..000000000 --- a/sandbox/richard/HelloWorld/HelloWorldClient/src/main/java/org/collectionspace/hello/client/IdentifierClient.java +++ /dev/null @@ -1,64 +0,0 @@ -package org.collectionspace.hello.client; - -import javax.ws.rs.core.Response; - -import org.collectionspace.hello.Identifier; -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 IdentifierClient. - - * @version $Revision:$ - */ -public class IdentifierClient { - - /** - * - */ - private static final IdentifierClient instance = new IdentifierClient(); - /** - * - */ - private IdentifierProxy identifierProxy; - - /** - * - * Create a new IdentifierClient. - * - */ - private IdentifierClient() { - ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance(); - RegisterBuiltin.register(factory); - identifierProxy = ProxyFactory.create(IdentifierProxy.class, "http://localhost:8080/helloworld/cspace-nuxeo"); - } - - /** - * FIXME Comment this - * - * @return - */ - public static IdentifierClient getInstance() { - return instance; - } - - /** - * @param id - * @return - * @see org.collectionspace.hello.client.IdentifierProxy#getIdentifier(java.lang.Long) - */ - public ClientResponse getIdentifier(Long id) { - return identifierProxy.getIdentifier(id); - } - - /** - * @param identifier - * @return - * @see org.collectionspace.hello.client.IdentifierProxy#createIdentifier(org.collectionspace.hello.client.entity.Identifier) - */ - public ClientResponse createIdentifier(Identifier identifier) { - return identifierProxy.createIdentifier(identifier); - } -} diff --git a/sandbox/richard/HelloWorld/HelloWorldClient/src/main/java/org/collectionspace/hello/client/IdentifierProxy.java b/sandbox/richard/HelloWorld/HelloWorldClient/src/main/java/org/collectionspace/hello/client/IdentifierProxy.java deleted file mode 100644 index 125aab47d..000000000 --- a/sandbox/richard/HelloWorld/HelloWorldClient/src/main/java/org/collectionspace/hello/client/IdentifierProxy.java +++ /dev/null @@ -1,32 +0,0 @@ -package org.collectionspace.hello.client; - -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.core.Response; - -import org.collectionspace.hello.Identifier; -import org.jboss.resteasy.client.ClientResponse; - -/** - * @version $Revision:$ - */ -@Path("/identifiers/") -@Produces({"application/xml"}) -@Consumes({"application/xml"}) -public interface IdentifierProxy { - - /** - * @param id - * @return - */ - @GET - @Path("/{id}") - ClientResponse getIdentifier(@PathParam("id") Long id); - - @POST - ClientResponse createIdentifier(Identifier so); -} \ No newline at end of file diff --git a/sandbox/richard/HelloWorld/HelloWorldClient/src/main/java/org/collectionspace/hello/client/PersonClient.java b/sandbox/richard/HelloWorld/HelloWorldClient/src/main/java/org/collectionspace/hello/client/PersonClient.java deleted file mode 100644 index e5de8f6e6..000000000 --- a/sandbox/richard/HelloWorld/HelloWorldClient/src/main/java/org/collectionspace/hello/client/PersonClient.java +++ /dev/null @@ -1,93 +0,0 @@ -package org.collectionspace.hello.client; - -import javax.ws.rs.core.Response; - -import org.collectionspace.hello.Person; -import org.collectionspace.hello.Persons; -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() - */ - public ClientResponse getPersons() { - return personProxy.getPersons(); - } - - /** - * @param id - * @return - * @see org.collectionspace.hello.client.PersonProxy#getPerson(java.lang.Long) - */ - public ClientResponse 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 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 updatePerson(Long id, Person person) { - return personProxy.updatePerson(id, person); - } - - /** - * @param id - * @return - * @see org.collectionspace.hello.client.PersonProxy#deletePerson(java.lang.Long) - */ - public ClientResponse deletePerson(Long id) { - return personProxy.deletePerson(id); - } -} diff --git a/sandbox/richard/HelloWorld/HelloWorldClient/src/main/java/org/collectionspace/hello/client/PersonNuxeoClient.java b/sandbox/richard/HelloWorld/HelloWorldClient/src/main/java/org/collectionspace/hello/client/PersonNuxeoClient.java deleted file mode 100644 index cc99f11ee..000000000 --- a/sandbox/richard/HelloWorld/HelloWorldClient/src/main/java/org/collectionspace/hello/client/PersonNuxeoClient.java +++ /dev/null @@ -1,93 +0,0 @@ -package org.collectionspace.hello.client; - -import javax.ws.rs.core.Response; - -import org.collectionspace.hello.PersonNuxeo; -import org.collectionspace.hello.People; -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 PersonNuxeoClient. - - * @version $Revision:$ - */ -public class PersonNuxeoClient { - - /** - * - */ - private static final PersonNuxeoClient instance = new PersonNuxeoClient(); - /** - * - */ - private PersonNuxeoProxy personProxy; - - /** - * - * Create a new PersonNuxeoClient. - * - */ - private PersonNuxeoClient() { - ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance(); - RegisterBuiltin.register(factory); - personProxy = ProxyFactory.create(PersonNuxeoProxy.class, "http://localhost:8080/helloworld/cspace-nuxeo"); - } - - /** - * FIXME Comment this - * - * @return - */ - public static PersonNuxeoClient getInstance() { - return instance; - } - - /** - * @param id - * @return - * @see org.collectionspace.hello.client.PersonNuxeoProxy#getPerson() - */ - public ClientResponse getPeople() { - return personProxy.getPeople(); - } - - /** - * @param id - * @return - * @see org.collectionspace.hello.client.PersonNuxeoProxy#getPerson(java.lang.String) - */ - public ClientResponse getPerson(String id) { - return personProxy.getPerson(id); - } - - /** - * @param person - * @return - * @see org.collectionspace.hello.client.PersonNuxeoProxy#createPerson(org.collectionspace.hello.PersonNuxeo) - */ - public ClientResponse createPerson(PersonNuxeo person) { - return personProxy.createPerson(person); - } - - /** - * @param id - * @param person - * @return - * @see org.collectionspace.hello.client.PersonNuxeoProxy#updatePerson(java.lang.Long, org.collectionspace.hello.PersonNuxeo) - */ - public ClientResponse updatePerson(String id, PersonNuxeo person) { - return personProxy.updatePerson(id, person); - } - - /** - * @param id - * @return - * @see org.collectionspace.hello.client.PersonNuxeoProxy#deletePerson(java.lang.Long) - */ - public ClientResponse deletePerson(String id) { - return personProxy.deletePerson(id); - } -} diff --git a/sandbox/richard/HelloWorld/HelloWorldClient/src/main/java/org/collectionspace/hello/client/PersonNuxeoProxy.java b/sandbox/richard/HelloWorld/HelloWorldClient/src/main/java/org/collectionspace/hello/client/PersonNuxeoProxy.java deleted file mode 100644 index 53265de84..000000000 --- a/sandbox/richard/HelloWorld/HelloWorldClient/src/main/java/org/collectionspace/hello/client/PersonNuxeoProxy.java +++ /dev/null @@ -1,42 +0,0 @@ -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.collectionspace.hello.PersonNuxeo; -import org.collectionspace.hello.People; -import org.jboss.resteasy.client.ClientResponse; - -/** - * @version $Revision:$ - */ -@Path("/persons/") -@Produces({"application/xml"}) -@Consumes({"application/xml"}) -public interface PersonNuxeoProxy { - - @GET - ClientResponse getPeople(); - - @GET - @Path("/{id}") - ClientResponse getPerson(@PathParam("id") String id); - - @POST - ClientResponse createPerson(PersonNuxeo so); - - @PUT - @Path("/{id}") - ClientResponse updatePerson(@PathParam("id") String id, PersonNuxeo so); - - @DELETE - @Path("/{id}") - ClientResponse deletePerson(@PathParam("id") String id); -} \ No newline at end of file diff --git a/sandbox/richard/HelloWorld/HelloWorldClient/src/main/java/org/collectionspace/hello/client/PersonProxy.java b/sandbox/richard/HelloWorld/HelloWorldClient/src/main/java/org/collectionspace/hello/client/PersonProxy.java deleted file mode 100644 index 2b6f2370b..000000000 --- a/sandbox/richard/HelloWorld/HelloWorldClient/src/main/java/org/collectionspace/hello/client/PersonProxy.java +++ /dev/null @@ -1,42 +0,0 @@ -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.collectionspace.hello.Person; -import org.collectionspace.hello.Persons; -import org.jboss.resteasy.client.ClientResponse; - -/** - * @version $Revision:$ - */ -@Path("/persons/") -@Produces({"application/xml"}) -@Consumes({"application/xml"}) -public interface PersonProxy { - - @GET - ClientResponse getPersons(); - - @GET - @Path("/{id}") - ClientResponse getPerson(@PathParam("id") Long id); - - @POST - ClientResponse createPerson(Person so); - - @PUT - @Path("/{id}") - ClientResponse updatePerson(@PathParam("id") Long id, Person so); - - @DELETE - @Path("/{id}") - ClientResponse deletePerson(@PathParam("id") Long id); -} \ No newline at end of file diff --git a/sandbox/richard/HelloWorld/HelloWorldClient/src/test/java/org/collectionspace/hello/client/test/CollectionObjectServiceTest.java b/sandbox/richard/HelloWorld/HelloWorldClient/src/test/java/org/collectionspace/hello/client/test/CollectionObjectServiceTest.java deleted file mode 100644 index aa76d13c3..000000000 --- a/sandbox/richard/HelloWorld/HelloWorldClient/src/test/java/org/collectionspace/hello/client/test/CollectionObjectServiceTest.java +++ /dev/null @@ -1,146 +0,0 @@ -package org.collectionspace.hello.client.test; - -import java.util.ArrayList; -import java.util.List; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.core.Response; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.Marshaller; -import org.jboss.resteasy.client.ClientResponse; -import org.testng.Assert; -import org.testng.annotations.Test; - -import org.collectionspace.hello.CollectionObject; -import org.collectionspace.hello.CollectionObjectList; -import org.collectionspace.hello.client.CollectionObjectClient; - -/** - * A CollectionObjectNuxeoServiceTest. - * - * @version $Revision:$ - */ -public class CollectionObjectServiceTest { - - private CollectionObjectClient collectionObjectClient = CollectionObjectClient.getInstance(); - private String updateId = null; - private String deleteId = null; - - @Test - public void createCollectionObject() { - long identifier = this.createIdentifier(); - - CollectionObject collectionObject = createCollectionObject(identifier); - ClientResponse res = collectionObjectClient.createCollectionObject(collectionObject); - Assert.assertEquals(res.getStatus(), Response.Status.CREATED.getStatusCode()); - - //store updateId locally for "update" test - if (updateId == null) - updateId = extractId(res); - else - deleteId = extractId(res); - } - - @Test(dependsOnMethods = {"createCollectionObject"}) - public void updateCollectionObject() { - ClientResponse res = collectionObjectClient.getCollectionObject(updateId); - CollectionObject collectionObject = res.getEntity(); - verbose("got collectionobject to update: " + updateId, - collectionObject, CollectionObject.class); - - //collectionObject.setCsid("updated-" + updateId); - collectionObject.setIdentifier("updated-" + collectionObject.getIdentifier()); - collectionObject.setDescription("updated-" + collectionObject.getDescription()); - - res = collectionObjectClient.updateCollectionObject(updateId, collectionObject); - CollectionObject updatedCollectionObject = res.getEntity(); - Assert.assertEquals(updatedCollectionObject.getDescription(), collectionObject.getDescription()); - - verbose("updated collectionObject", updatedCollectionObject, CollectionObject.class); - - return; - } - - @Test(dependsOnMethods = {"createCollectionObject"}) - public void createCollection() { - for (int i = 0; i < 3; i++) { - this.createCollectionObject(); - } - } - - @Test(dependsOnMethods = {"createCollection"}) - public void getCollectionObjectList() { - //the resource method is expected to return at least an empty list - CollectionObjectList coList = collectionObjectClient.getCollectionObjectList().getEntity(); - List coItemList = coList.getCollectionObjectListItem(); - int i = 0; - for(CollectionObjectList.CollectionObjectListItem pli : coItemList) { - verbose("getCollectionObjectList: list-item[" + i + "] csid=" + pli.getCsid()); - verbose("getCollectionObjectList: list-item[" + i + "] identifier=" + pli.getIdentifier()); - verbose("getCollectionObjectList: list-item[" + i + "] URI=" + pli.getUri()); - i++; - } - } - - @Test(dependsOnMethods = {"updateCollectionObject"}) - public void deleteCollectionObject() { - ClientResponse res = collectionObjectClient.deleteCollectionObject(deleteId); - verbose("deleteCollectionObject: csid=" + deleteId); - verbose("deleteCollectionObject: status = " + res.getStatus()); - Assert.assertEquals(res.getStatus(), Response.Status.NO_CONTENT.getStatusCode()); - } - - private CollectionObject createCollectionObject(String csid, String identifier, String description) { - CollectionObject collectionObject = new CollectionObject(); - - collectionObject.setCsid(csid); - collectionObject.setIdentifier(identifier); - collectionObject.setDescription(description); - - return collectionObject; - } - - private CollectionObject createCollectionObject(long identifier) { - CollectionObject collectionObject = createCollectionObject("csid-" + identifier, - "did-" + identifier, "description-" + identifier); - - return collectionObject; - } - - private String extractId(ClientResponse res) { - MultivaluedMap mvm = res.getMetadata(); - String uri = (String) ((ArrayList) mvm.get("Location")).get(0); - String[] segments = uri.split("/"); - String id = segments[segments.length - 1]; - verbose("id=" + id); - return id; - } - - private void verbose(String msg) { - System.out.println("CollectionObjectServiceTest : " + msg); - } - - private void verbose(String msg, Object o, Class clazz) { - try{ - verbose(msg); - JAXBContext jc = JAXBContext.newInstance(clazz); - Marshaller m = jc.createMarshaller(); - m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, - Boolean.TRUE); - m.marshal(o, System.out); - }catch(Exception e){ - e.printStackTrace(); - } - } - - private void verboseMap(MultivaluedMap map) { - for(Object entry : map.entrySet()){ - MultivaluedMap.Entry mentry = (MultivaluedMap.Entry) entry; - verbose(" name=" + mentry.getKey() + " value=" + mentry.getValue()); - } - } - - private long createIdentifier() { - long identifier = System.currentTimeMillis(); - return identifier; - } -} diff --git a/sandbox/richard/HelloWorld/HelloWorldClient/src/test/java/org/collectionspace/hello/client/test/IdentifierServiceTest.java b/sandbox/richard/HelloWorld/HelloWorldClient/src/test/java/org/collectionspace/hello/client/test/IdentifierServiceTest.java deleted file mode 100644 index 05bc199b5..000000000 --- a/sandbox/richard/HelloWorld/HelloWorldClient/src/test/java/org/collectionspace/hello/client/test/IdentifierServiceTest.java +++ /dev/null @@ -1,64 +0,0 @@ -package org.collectionspace.hello.client.test; - -import 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.Marshaller; -import org.collectionspace.hello.Identifier; -import org.jboss.resteasy.client.ClientResponse; -import org.testng.Assert; -import org.testng.annotations.Test; - -/** - * A IdentifierServiceTest. - * - * @version $Revision:$ - */ -public class IdentifierServiceTest { - - private IdentifierClient identifierClient = IdentifierClient.getInstance(); - private Long id = 0L; - - @Test - public void createIdentifier() { - Identifier identifier = new Identifier(); - identifier.setNamespace("org.bnhm"); - ClientResponse res = identifierClient.createIdentifier(identifier); - Assert.assertEquals(res.getStatus(), Response.Status.CREATED.getStatusCode()); - id = extractId(res); - } - - @Test(dependsOnMethods = {"createIdentifier"}) - public void getIdentifier() { - Identifier i = identifierClient.getIdentifier(id).getEntity(); - verbose("got Identifier", i); - } - - private Long extractId(ClientResponse res) { - MultivaluedMap mvm = res.getMetadata(); - String uri = (String) ((ArrayList) mvm.get("Location")).get(0); - String[] segments = uri.split("/"); - verbose("id=" + segments[segments.length - 1]); - return Long.valueOf(segments[segments.length - 1]); - } - - private void verbose(String msg) { - System.out.println("IdentifierServiceTest : " + msg); - } - - private void verbose(String msg, Identifier p) { - try { - verbose(msg); - JAXBContext jc = JAXBContext.newInstance(Identifier.class); - Marshaller m = jc.createMarshaller(); - m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, - Boolean.TRUE); - m.marshal(p, System.out); - //m.marshal(new JAXBElement(new QName("uri", "local"), Identifier.class, p), System.out); - } catch (Exception e) { - e.printStackTrace(); - } - } -} diff --git a/sandbox/richard/HelloWorld/HelloWorldClient/src/test/java/org/collectionspace/hello/client/test/PersonNuxeoServiceTest.java b/sandbox/richard/HelloWorld/HelloWorldClient/src/test/java/org/collectionspace/hello/client/test/PersonNuxeoServiceTest.java deleted file mode 100644 index 6c53d0510..000000000 --- a/sandbox/richard/HelloWorld/HelloWorldClient/src/test/java/org/collectionspace/hello/client/test/PersonNuxeoServiceTest.java +++ /dev/null @@ -1,133 +0,0 @@ -package org.collectionspace.hello.client.test; - -import java.util.ArrayList; -import java.util.List; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.core.Response; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.Marshaller; -import org.collectionspace.hello.PersonNuxeo; -import org.collectionspace.hello.People; -import org.collectionspace.hello.client.PersonNuxeoClient; -import org.jboss.resteasy.client.ClientResponse; -import org.testng.Assert; -import org.testng.annotations.Test; - -/** - * A PersonNuxeoServiceTest. - * - * @version $Revision:$ - */ -public class PersonNuxeoServiceTest { - - private PersonNuxeoClient personClient = PersonNuxeoClient.getInstance(); - private String updateId = ""; - private String deleteId = ""; - - @Test - public void createPerson() { - PersonNuxeo person = createPerson("Chris", "Hoffman"); - ClientResponse res = personClient.createPerson(person); - Assert.assertEquals(res.getStatus(), Response.Status.CREATED.getStatusCode()); - //store updateId locally - updateId = extractId(res); - } - - @Test - public void createTeam() { - PersonNuxeo person = createPerson("Sanjay", "Dalal"); - ClientResponse res = personClient.createPerson(person); - Assert.assertEquals(res.getStatus(), Response.Status.CREATED.getStatusCode()); - deleteId = extractId(res); - - person = createPerson("Aron", "Roberts"); - res = personClient.createPerson(person); - Assert.assertEquals(res.getStatus(), Response.Status.CREATED.getStatusCode()); - - person = createPerson("Richard", "Millet"); - res = personClient.createPerson(person); - Assert.assertEquals(res.getStatus(), Response.Status.CREATED.getStatusCode()); - - } - - @Test(dependsOnMethods = {"createPerson"}) - public void updatePerson() { - PersonNuxeo touPerson = personClient.getPerson(updateId).getEntity(); - touPerson.setId(updateId); - verbose("got person to update", touPerson, PersonNuxeo.class); - touPerson.setFirstName("Patrick"); - touPerson.setLastName("Schmitz"); - PersonNuxeo uPerson = personClient.updatePerson(updateId, touPerson).getEntity(); - verbose("updated person", uPerson, PersonNuxeo.class); - //Assert.assertNotSame(uPerson.getVersion(), initialVersion); - Assert.assertEquals(uPerson.getFirstName(), "Patrick"); - } - - @Test(dependsOnMethods = {"createTeam"}) - public void getPeople() { - //the resource method is expected to return at least an empty list - People people = personClient.getPeople().getEntity(); - List list = people.getPeopleItem(); - int i = 0; - for(People.PeopleItem pli : list){ - verbose("getPeople: list-item[" + i + "] title=" + pli.getTitle()); - verbose("getPeople: list-item[" + i + "] id=" + pli.getId()); - verbose("getPeople: list-item[" + i + "] uri=" + pli.getUri()); - i++; - } - } - - @Test(dependsOnMethods = {"updatePerson"}) - public void deletePerson() { - ClientResponse res = personClient.deletePerson(deleteId); - verbose("deletePerson: id=" + deleteId); - verbose("deletePerson: status = " + res.getStatus()); - Assert.assertEquals(res.getStatus(), Response.Status.NO_CONTENT.getStatusCode()); - } - - private PersonNuxeo createPerson(String firstName, String lastName) { - PersonNuxeo person = new PersonNuxeo(); - person.setFirstName(firstName); - person.setLastName(lastName); - person.setStreet("2195 Hearst Ave."); - person.setCity("Berkeley"); - person.setState("CA"); - person.setZip("94704"); - person.setCountry("US"); - person.setVersion("1.0"); - return person; - } - - private String extractId(ClientResponse res) { - MultivaluedMap mvm = res.getMetadata(); - String uri = (String) ((ArrayList) mvm.get("Location")).get(0); - String[] segments = uri.split("/"); - String id = segments[segments.length - 1]; - verbose("id=" + id); - return id; - } - - private void verbose(String msg) { - System.out.println("PersonServiceTest : " + msg); - } - - private void verbose(String msg, Object o, Class clazz) { - try{ - verbose(msg); - JAXBContext jc = JAXBContext.newInstance(clazz); - Marshaller m = jc.createMarshaller(); - m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, - Boolean.TRUE); - m.marshal(o, System.out); - }catch(Exception e){ - e.printStackTrace(); - } - } - - private void verboseMap(MultivaluedMap map) { - for(Object entry : map.entrySet()){ - MultivaluedMap.Entry mentry = (MultivaluedMap.Entry) entry; - verbose(" name=" + mentry.getKey() + " value=" + mentry.getValue()); - } - } -} diff --git a/sandbox/richard/HelloWorld/HelloWorldClient/src/test/java/org/collectionspace/hello/client/test/PersonServiceTest.java b/sandbox/richard/HelloWorld/HelloWorldClient/src/test/java/org/collectionspace/hello/client/test/PersonServiceTest.java deleted file mode 100644 index cf60e22bf..000000000 --- a/sandbox/richard/HelloWorld/HelloWorldClient/src/test/java/org/collectionspace/hello/client/test/PersonServiceTest.java +++ /dev/null @@ -1,159 +0,0 @@ -package org.collectionspace.hello.client.test; - -import java.util.ArrayList; -import java.util.List; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.core.Response; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.Marshaller; -import org.collectionspace.hello.Person; -import org.collectionspace.hello.Persons; -import org.collectionspace.hello.client.PersonClient; -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 updateId = 0L; - - @Test - public void createPerson() { - Person person = createPerson("Chris", "Hoffman"); - ClientResponse res = personClient.createPerson(person); - Assert.assertEquals(res.getStatus(), Response.Status.CREATED.getStatusCode()); - //store updateId locally - updateId = extractId(res); - } - - @Test - public void createPersons() { - Person person = createPerson("Aron", "Roberts"); - ClientResponse res = personClient.createPerson(person); - Assert.assertEquals(res.getStatus(), Response.Status.CREATED.getStatusCode()); - person = createPerson("Dan", "Sheppard"); - res = personClient.createPerson(person); - Assert.assertEquals(res.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test(dependsOnMethods = {"createPerson"}) - public void updatePerson() { - Person touPerson = personClient.getPerson(updateId).getEntity(); - verbose("got person to update", touPerson, Person.class); - touPerson.setFirstName("Richard"); - touPerson.setLastName("Millet"); - int initialVersion = touPerson.getVersion(); - Person uPerson = personClient.updatePerson(updateId, touPerson).getEntity(); - verbose("updated person", uPerson, Person.class); - Assert.assertNotSame(uPerson.getVersion(), initialVersion); - Assert.assertEquals(uPerson.getFirstName(), "Richard"); - } - - @Test(dependsOnMethods = {"createPerson"}) - public void getPersons() { - //the resource method is expected to return at least an empty list - Persons persons = personClient.getPersons().getEntity(); - List list = persons.getPersonListItem(); - int i = 0; - for (Persons.PersonListItem pli : list) { - verbose("getPersons: list-item[" + i + "] firstName=" + pli.getFirstName()); - verbose("getPersons: list-item[" + i + "] lastName=" + pli.getLastName()); - verbose("getPersons: list-item[" + i + "] uri=" + pli.getUri()); - i++; - } - } - - - @Test - public void getNonExistingPerson() { - ClientResponse res = personClient.getPerson(999L); - - Response.Status status = res.getResponseStatus(); - verbose(this.getClass().getName() + ": " + - "getNonExistingPerson: Status: code=" + status.getStatusCode() + - " message=" + status.toString()); - verbose("getNonExistingPerson: Metadata:"); - verboseMap(res.getMetadata()); - verbose("getNonExistingPerson: Headers:"); - verboseMap(res.getHeaders()); - if (status.equals(Response.Status.NOT_FOUND)) { - String msg = res.getEntity(String.class, String.class); - verbose("getNonExistingPerson: error message=" + msg); - } - } - - @Test(dependsOnMethods = {"updatePerson"}) - public void updateWrongPerson() { - Person touPerson = personClient.getPerson(updateId).getEntity(); - verbose("updateWrongPerson: got person to update", touPerson, Person.class); - touPerson.setFirstName("Richard"); - touPerson.setLastName("Millet"); - //use non existing person to update - ClientResponse res = personClient.updatePerson(9999L, touPerson); - if (res.getResponseStatus().equals(Response.Status.NOT_FOUND)) { - verbose("updateWrongPerson: Status=" + res.getResponseStatus().toString()); - String msg = res.getEntity(String.class, String.class); - verbose("updateWrongPerson: application error message=" + msg); - } - } - - - @Test(dependsOnMethods = {"updateWrongPerson"}) - public void deletePerson() { - ClientResponse res = personClient.deletePerson(updateId); - verbose("deletePerson: id=" + updateId); - verbose("deletePerson: status = " + res.getStatus()); - Assert.assertEquals(res.getStatus(), Response.Status.NO_CONTENT.getStatusCode()); - } - - private Person createPerson(String firstName, String lastName) { - Person person = new Person(); - person.setFirstName(firstName); - person.setLastName(lastName); - person.setStreet("2195 Hearst Ave."); - person.setCity("Berkeley"); - person.setState("CA"); - person.setZip("94704"); - person.setCountry("US"); - return person; - } - - private Long extractId(ClientResponse res) { - MultivaluedMap mvm = res.getMetadata(); - String uri = (String) ((ArrayList) mvm.get("Location")).get(0); - String[] segments = uri.split("/"); - verbose("id=" + segments[segments.length - 1]); - return Long.valueOf(segments[segments.length - 1]); - } - - private void verbose(String msg) { - System.out.println("PersonServiceTest : " + msg); - } - - private void verbose(String msg, Object o, Class clazz) { - try { - verbose(msg); - JAXBContext jc = JAXBContext.newInstance(clazz); - Marshaller m = jc.createMarshaller(); - m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, - Boolean.TRUE); - m.marshal(o, System.out); - //m.marshal(new JAXBElement(new QName("uri", "local"), Person.class, p), System.out); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void verboseMap(MultivaluedMap map) { - for (Object entry : map.entrySet()) { - MultivaluedMap.Entry mentry = (MultivaluedMap.Entry) entry; - verbose(" name=" + mentry.getKey() + " value=" + mentry.getValue()); - } - } -} diff --git a/sandbox/richard/HelloWorld/HelloWorldClient/src/test/resources/log4j.xml b/sandbox/richard/HelloWorld/HelloWorldClient/src/test/resources/log4j.xml deleted file mode 100644 index 52121cb83..000000000 --- a/sandbox/richard/HelloWorld/HelloWorldClient/src/test/resources/log4j.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sandbox/richard/HelloWorld/HelloWorldClient/temp-testng-customsuite.xml b/sandbox/richard/HelloWorld/HelloWorldClient/temp-testng-customsuite.xml deleted file mode 100644 index 9f2480621..000000000 --- a/sandbox/richard/HelloWorld/HelloWorldClient/temp-testng-customsuite.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/sandbox/richard/HelloWorld/HelloWorldJaxb/.classpath b/sandbox/richard/HelloWorld/HelloWorldJaxb/.classpath deleted file mode 100644 index a92b24a87..000000000 --- a/sandbox/richard/HelloWorld/HelloWorldJaxb/.classpath +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/sandbox/richard/HelloWorld/HelloWorldJaxb/.project b/sandbox/richard/HelloWorld/HelloWorldJaxb/.project deleted file mode 100644 index db1c789f7..000000000 --- a/sandbox/richard/HelloWorld/HelloWorldJaxb/.project +++ /dev/null @@ -1,23 +0,0 @@ - - - javaee-addressbook-jaxb - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.maven.ide.eclipse.maven2Builder - - - - - - org.eclipse.jdt.core.javanature - org.maven.ide.eclipse.maven2Nature - - diff --git a/sandbox/richard/HelloWorld/HelloWorldJaxb/.settings/org.eclipse.jdt.core.prefs b/sandbox/richard/HelloWorld/HelloWorldJaxb/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 8780c51c5..000000000 --- a/sandbox/richard/HelloWorld/HelloWorldJaxb/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,5 +0,0 @@ -#Thu Feb 26 16:32:52 PST 2009 -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 -org.eclipse.jdt.core.compiler.compliance=1.5 -org.eclipse.jdt.core.compiler.source=1.5 diff --git a/sandbox/richard/HelloWorld/HelloWorldJaxb/.settings/org.maven.ide.eclipse.prefs b/sandbox/richard/HelloWorld/HelloWorldJaxb/.settings/org.maven.ide.eclipse.prefs deleted file mode 100644 index c6e4123cd..000000000 --- a/sandbox/richard/HelloWorld/HelloWorldJaxb/.settings/org.maven.ide.eclipse.prefs +++ /dev/null @@ -1,8 +0,0 @@ -#Thu Feb 26 16:30:28 PST 2009 -activeProfiles= -eclipse.preferences.version=1 -fullBuildGoals=process-test-resources -includeModules=false -resolveWorkspaceProjects=true -resourceFilterGoals=process-resources resources\:testResources -version=1 diff --git a/sandbox/richard/HelloWorld/HelloWorldJaxb/nb-configuration.xml b/sandbox/richard/HelloWorld/HelloWorldJaxb/nb-configuration.xml deleted file mode 100644 index 6c3fe600b..000000000 --- a/sandbox/richard/HelloWorld/HelloWorldJaxb/nb-configuration.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - default - 8 - 80 - - diff --git a/sandbox/richard/HelloWorld/HelloWorldJaxb/pom.xml b/sandbox/richard/HelloWorld/HelloWorldJaxb/pom.xml deleted file mode 100644 index 20227a0c4..000000000 --- a/sandbox/richard/HelloWorld/HelloWorldJaxb/pom.xml +++ /dev/null @@ -1,62 +0,0 @@ - - - - helloworld - org.collectionspace.hello.services - 0.1 - - 4.0.0 - org.collectionspace.hello.services - helloworld-jaxb - 0.1 - Helloworld Client JAXB - - - com.sun.xml.bind - jaxb-impl - 2.0.2 - - - org.jvnet.jaxb2-commons - property-listener-injector - 1.0 - - - org.jvnet.jaxb2_commons - runtime - 0.4.1.4 - - - - install - - - org.jvnet.jaxb2.maven2 - maven-jaxb2-plugin - - - - javax.activation - activation - 1.1 - - - com.sun.xml.bind - jaxb-impl - 2.1.2 - - - - - maven-compiler-plugin - 2.0.2 - - 1.5 - 1.5 - - - - - diff --git a/sandbox/richard/HelloWorld/HelloWorldJaxb/src/main/resources/hello.xsd b/sandbox/richard/HelloWorld/HelloWorldJaxb/src/main/resources/hello.xsd deleted file mode 100644 index 65d724a57..000000000 --- a/sandbox/richard/HelloWorld/HelloWorldJaxb/src/main/resources/hello.xsd +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sandbox/richard/HelloWorld/HelloWorldNuxeoService/.classpath b/sandbox/richard/HelloWorld/HelloWorldNuxeoService/.classpath deleted file mode 100644 index 1d6493d01..000000000 --- a/sandbox/richard/HelloWorld/HelloWorldNuxeoService/.classpath +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/sandbox/richard/HelloWorld/HelloWorldNuxeoService/.project b/sandbox/richard/HelloWorld/HelloWorldNuxeoService/.project deleted file mode 100644 index dde7b1c9d..000000000 --- a/sandbox/richard/HelloWorld/HelloWorldNuxeoService/.project +++ /dev/null @@ -1,23 +0,0 @@ - - - helloworld-nuxeo-service - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.maven.ide.eclipse.maven2Builder - - - - - - org.eclipse.jdt.core.javanature - org.maven.ide.eclipse.maven2Nature - - diff --git a/sandbox/richard/HelloWorld/HelloWorldNuxeoService/.settings/org.eclipse.jdt.core.prefs b/sandbox/richard/HelloWorld/HelloWorldNuxeoService/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index bf687d53a..000000000 --- a/sandbox/richard/HelloWorld/HelloWorldNuxeoService/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,5 +0,0 @@ -#Wed Apr 01 10:19:44 PDT 2009 -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 -org.eclipse.jdt.core.compiler.compliance=1.5 -org.eclipse.jdt.core.compiler.source=1.5 diff --git a/sandbox/richard/HelloWorld/HelloWorldNuxeoService/.settings/org.maven.ide.eclipse.prefs b/sandbox/richard/HelloWorld/HelloWorldNuxeoService/.settings/org.maven.ide.eclipse.prefs deleted file mode 100644 index fe1aa9559..000000000 --- a/sandbox/richard/HelloWorld/HelloWorldNuxeoService/.settings/org.maven.ide.eclipse.prefs +++ /dev/null @@ -1,8 +0,0 @@ -#Wed Apr 01 10:19:28 PDT 2009 -activeProfiles= -eclipse.preferences.version=1 -fullBuildGoals=process-test-resources -includeModules=false -resolveWorkspaceProjects=true -resourceFilterGoals=process-resources resources\:testResources -version=1 diff --git a/sandbox/richard/HelloWorld/HelloWorldNuxeoService/README.txt b/sandbox/richard/HelloWorld/HelloWorldNuxeoService/README.txt deleted file mode 100644 index b1aa460dd..000000000 --- a/sandbox/richard/HelloWorld/HelloWorldNuxeoService/README.txt +++ /dev/null @@ -1,14 +0,0 @@ -Helloworld service interfacing with Nuxeo repository through Nuxeo -REST apis. - -System Requirements: -==================== -- Maven 2.0.9 or higher -- Nuxeo CollectionSpace Extensions - -Building the project: -==================== -In root directoy... -1. customize build.properties for your environment -2. mvn clean package -3. ant diff --git a/sandbox/richard/HelloWorld/HelloWorldNuxeoService/build.properties b/sandbox/richard/HelloWorld/HelloWorldNuxeoService/build.properties deleted file mode 100644 index f051cc0d6..000000000 --- a/sandbox/richard/HelloWorld/HelloWorldNuxeoService/build.properties +++ /dev/null @@ -1,4 +0,0 @@ -jboss.dir=C:/dev/tools/jboss-4.2.3.GA -nuxeo.dir=${jboss.dir}/server/default/deploy/nuxeo.ear/system -nuxeo.local.repo.dir=file:///C:/dev/jboss-4.2.3.GA/server/default/deploy/nuxeo.ear/system -nuxeo.local.repo.client.dir=file:///C:/dev/nuxeo/nuxeo-core/nuxeo-core-client/target diff --git a/sandbox/richard/HelloWorld/HelloWorldNuxeoService/build.xml b/sandbox/richard/HelloWorld/HelloWorldNuxeoService/build.xml deleted file mode 100644 index cdba8639c..000000000 --- a/sandbox/richard/HelloWorld/HelloWorldNuxeoService/build.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/sandbox/richard/HelloWorld/HelloWorldNuxeoService/nb-configuration.xml b/sandbox/richard/HelloWorld/HelloWorldNuxeoService/nb-configuration.xml deleted file mode 100644 index 3e5cd988f..000000000 --- a/sandbox/richard/HelloWorld/HelloWorldNuxeoService/nb-configuration.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - default - 8 - 80 - false - - diff --git a/sandbox/richard/HelloWorld/HelloWorldNuxeoService/nbactions.xml b/sandbox/richard/HelloWorld/HelloWorldNuxeoService/nbactions.xml deleted file mode 100644 index 9d30c239a..000000000 --- a/sandbox/richard/HelloWorld/HelloWorldNuxeoService/nbactions.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - - test - - * - - - test - - - - build - - * - - - install - - - - clean - - * - - - clean - - - - rebuild - - * - - - clean - install - - - true - - - - run - - war - ear - ejb - - - package - - - - true - - - - debug - - war - ear - ejb - - - package - - - - true - true - - - diff --git a/sandbox/richard/HelloWorld/HelloWorldNuxeoService/pom.xml b/sandbox/richard/HelloWorld/HelloWorldNuxeoService/pom.xml deleted file mode 100644 index f2fcee769..000000000 --- a/sandbox/richard/HelloWorld/HelloWorldNuxeoService/pom.xml +++ /dev/null @@ -1,270 +0,0 @@ - - - - helloworld - org.collectionspace.hello.services - 0.1 - - 4.0.0 - org.collectionspace.hello.services - helloworld-nuxeo-service - war - 0.1 - Helloworld Nuxeo Service - - - - java.net - http://download.java.net/maven/1 - legacy - - - maven repo - maven repo - http://repo1.maven.org/maven2/ - - - - jboss - jboss repo - http://repository.jboss.org/maven2 - - - mojo - mojo repo - http://svn.codehaus.org/mojo/trunk/mojo/jboss-maven-plugin - - - - maven-restlet - Public online Restlet repository - http://maven.restlet.org - - - - cspace.local.nuxeo - ${nuxeo.local.repo.dir} - - - cspace.local.nuxeo.client - ${nuxeo.local.repo.client.dir} - - - public - http://maven.nuxeo.org/public - - - - false - - - - public-snapshot - http://maven.nuxeo.org/public-snapshot - - false - - - - - - - - - - - public - http://maven.nuxeo.org/public - Nuxeo virtual release repository - - - - false - - - - public-snapshot - http://maven.nuxeo.org/public-snapshot - Nuxeo virtual snapshot repository - - false - - - - - - - - - 4.2.3.GA - 3.0 - UTF-8 - 1.5.1 - 0.9.7 - 5.2-SNAPSHOT - 1.5-SNAPSHOT - - - - - - org.collectionspace.hello.services - helloworld-jaxb - 0.1 - - - org.jboss.resteasy - resteasy-jaxrs - 1.0.2.GA - - - tjws - webserver - - - - - org.jboss.resteasy - resteasy-jaxb-provider - 1.0.2.GA - - - junit - junit - 4.1 - test - - - - - - - javax.security - jaas - 1.0.01 - provided - - - - dom4j - dom4j - 1.6.1 - provided - - - - - - - - org.nuxeo.ecm.core - nuxeo-core-api - ${nuxeo.version.1.5} - - - jboss-remoting - jboss - - - - - - - - org.restlet - org.restlet - 1.0.7 - - - com.noelios.restlet - com.noelios.restlet.ext.httpclient - 1.0.7 - - - com.noelios.restlet - com.noelios.restlet - 1.0.7 - - - - jaxen - jaxen - 1.1.1 - - - - - - - helloworld - - - org.codehaus.mojo - jboss-maven-plugin - - ${jboss.dir} - - - - jboss-undeploy - pre-integration-test - - undeploy - - - ${basedir}/target/helloworld.war - - - - jboss-deploy - pre-integration-test - - deploy - - - ${basedir}/target/helloworld.war - - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - - surefire-it - integration-test - - test - - - false - - - - - - org.apache.maven.plugins - maven-war-plugin - 2.0 - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.5 - 1.5 - - - - - diff --git a/sandbox/richard/HelloWorld/HelloWorldNuxeoService/src/main/java/org/collectionspace/hello/services/CollectionObjectResource.java b/sandbox/richard/HelloWorld/HelloWorldNuxeoService/src/main/java/org/collectionspace/hello/services/CollectionObjectResource.java deleted file mode 100644 index d861fc89c..000000000 --- a/sandbox/richard/HelloWorld/HelloWorldNuxeoService/src/main/java/org/collectionspace/hello/services/CollectionObjectResource.java +++ /dev/null @@ -1,300 +0,0 @@ -package org.collectionspace.hello.services; - -import java.io.ByteArrayInputStream; -import org.collectionspace.hello.services.nuxeo.NuxeoRESTClient; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import java.util.Map; -import javax.ws.rs.DELETE; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.PathParam; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriBuilder; -import javax.ws.rs.core.UriInfo; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.Marshaller; -import org.collectionspace.hello.*; - - -import org.collectionspace.hello.CollectionObjectList.CollectionObjectListItem; -import org.dom4j.Document; -import org.dom4j.Element; -import org.dom4j.Namespace; -import org.dom4j.io.SAXReader; -import org.restlet.resource.Representation; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@Path("/collectionobjects") -@Consumes("application/xml") -@Produces("application/xml") -public class CollectionObjectResource { - - final static String NUXEO_WORKSPACE_UID = "776a8787-9d81-41b0-a02c-1ba674638c0a"; - final static String NUXEO_DOCTYPE = "CollectionObject"; - - final Logger logger = LoggerFactory.getLogger(CollectionObjectResource.class); - - public CollectionObjectResource() { - // do nothing - } - - @GET - public CollectionObjectList getCollectionObjectList(@Context UriInfo ui) { - CollectionObjectList p = new CollectionObjectList(); - try{ - List list = p.getCollectionObjectListItem(); - NuxeoRESTClient nxClient = getClient(); - - List pathParams = new ArrayList(); - Map queryParams = new HashMap(); - pathParams = Arrays.asList("default", NUXEO_WORKSPACE_UID, "browse"); - Representation res = nxClient.get(pathParams, queryParams); - SAXReader reader = new SAXReader(); - Document document = reader.read(res.getStream()); - Element root = document.getRootElement(); - for(Iterator i = root.elementIterator(); i.hasNext();){ - Element element = (Element) i.next(); - CollectionObjectListItem pli = new CollectionObjectListItem(); - // - pli.setCsid(element.attributeValue("csid")); - pli.setUri(element.attributeValue("url")); - pli.setIdentifier(element.attributeValue("identifier")); - list.add(pli); - } - - }catch(Exception e){ - e.printStackTrace(); - } - return p; - } - - @POST - public Response createCollectionObject(CollectionObject co) { - - NuxeoRESTClient nxClient = getClient(); - - List pathParams = new ArrayList(); - Map queryParams = new HashMap(); - pathParams.add("default"); - pathParams.add(NUXEO_WORKSPACE_UID); - pathParams.add("createDocument"); - queryParams.put("docType", NUXEO_DOCTYPE); - - queryParams.put("dublincore:title", co.getIdentifier()); - // CollectionObject core values - queryParams.put("collectionobject:csid", Integer.valueOf(1).toString()); - queryParams.put("collectionobject:identifier", co.getIdentifier()); - queryParams.put("collectionobject:description", co.getDescription()); - - ByteArrayInputStream bais = new ByteArrayInputStream(new byte[0]); - Representation res = nxClient.post(pathParams, queryParams, bais); - - SAXReader reader = new SAXReader(); - try { - Document document = reader.read(res.getStream()); - Element root = document.getRootElement(); - for (Iterator i = root.elementIterator(); i.hasNext();){ - Element element = (Element) i.next(); - if ("docRef".equals(element.getName())){ - String id = (String) element.getData(); - co.setCsid(id); - } - } - } catch(Exception e){ - Response response = Response.status(Response.Status.NOT_FOUND).entity( - "Create failed").type("text/plain").build(); - throw new WebApplicationException(response); - } - - verbose("created collectionobject", co); - UriBuilder path = UriBuilder.fromResource(PersonNuxeoResource.class); - path.path("" + co.getCsid()); - Response response = Response.created(path.build()).build(); - - return response; - } - - @GET - @Path("{csid}") - public CollectionObject getCollectionObject(@PathParam("csid") String csid) { - - CollectionObject co = null; - try { - List pathParams = new ArrayList(); - Map queryParams = new HashMap(); - - pathParams.add("default"); - pathParams.add(csid); - pathParams.add("export"); - queryParams.put("format", "XML"); - - NuxeoRESTClient nxClient = getClient(); - Representation res = nxClient.get(pathParams, queryParams); - - SAXReader reader = new SAXReader(); - Document document = reader.read(res.getStream()); - Element root = document.getRootElement(); - co = new CollectionObject(); - - // TODO: recognize schema thru namespace uri -// Namespace ns = new Namespace("collectionobject", "http://collectionspace.org/collectionobject"); - - Iterator siter = root.elementIterator("schema"); - while (siter.hasNext()) { - - Element schemaElement = siter.next(); - System.err.println("CollectionObject.getCollectionObject() called."); - - //TODO: recognize schema thru namespace uri - if ("collectionobject".equals(schemaElement.attribute("name").getValue())){ - co.setCsid(csid); - Element ele = schemaElement.element("identifier"); - if(ele != null){ - co.setIdentifier((String) ele.getData()); - } - ele = schemaElement.element("description"); - if(ele != null){ - co.setDescription((String) ele.getData()); - } - } - } - - } catch(Exception e){ - e.printStackTrace(); - Response response = Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity( - "Get failed").type("text/plain").build(); - throw new WebApplicationException(response); - } - if (co == null) { - Response response = Response.status(Response.Status.NOT_FOUND).entity( - "Get failed, the requested CollectionObject CSID:" + csid + ": was not found.").type("text/plain").build(); - throw new WebApplicationException(response); - } - verbose("get collectionobject", co); - - return co; - } - - @PUT - @Path("{csid}") - public CollectionObject updateCollectionObject( - @PathParam("csid") String csid, - CollectionObject update) { - - verbose("updating collectionobject input", update); - - List pathParams = new ArrayList(); - Map queryParams = new HashMap(); - pathParams.add("default"); - pathParams.add(update.getCsid()); - pathParams.add("updateDocumentRestlet"); - - //todo: intelligent merge needed - if(update.getIdentifier() != null){ - queryParams.put("collectionobject:identifier", update.getIdentifier()); - } - - if(update.getDescription() != null){ - queryParams.put("collectionobject:description", update.getDescription()); - } - - NuxeoRESTClient nxClient = getClient(); - Representation res = nxClient.get(pathParams, queryParams); - SAXReader reader = new SAXReader(); - String status = ""; - try { - Document document = reader.read(res.getStream()); - Element root = document.getRootElement(); - for(Iterator i = root.elementIterator(); i.hasNext();){ - Element element = (Element) i.next(); - if("docRef".equals(element.getName())){ - status = (String) element.getData(); - verbose("update collectionobject: response=" + status); - } - - } - } catch(Exception e) { - //FIXME: NOT_FOUND? - Response response = Response.status(Response.Status.NOT_FOUND).entity( - "Update failed ").type("text/plain").build(); - throw new WebApplicationException(response); - } - - return update; - } - - @DELETE - @Path("{csid}") - public void deleteCollectionObject(@PathParam("csid") String csid) { - - verbose("deleting collectionobject with csid=" + csid); - - NuxeoRESTClient nxClient = getClient(); - List pathParams = new ArrayList(); - Map queryParams = new HashMap(); - - pathParams.add("default"); - pathParams.add(csid); - pathParams.add("deleteDocumentRestlet"); - Representation res = nxClient.get(pathParams, queryParams); - SAXReader reader = new SAXReader(); - String status = ""; - - try { - Document document = reader.read(res.getStream()); - Element root = document.getRootElement(); - for(Iterator i = root.elementIterator(); i.hasNext();){ - Element element = (Element) i.next(); - if("docRef".equals(element.getName())){ - status = (String) element.getData(); - verbose("delete collectionobject: response=" + status); - } - - } - }catch(Exception e){ - //FIXME: NOT_FOUND? - Response response = Response.status(Response.Status.NOT_FOUND).entity( - "Delete failed ").type("text/plain").build(); - throw new WebApplicationException(response); - } - - } - - private void verbose(String msg, CollectionObject co) { - try { - verbose(msg); - JAXBContext jc = JAXBContext.newInstance( - CollectionObject.class); - - Marshaller m = jc.createMarshaller(); - m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, - Boolean.TRUE); - m.marshal(co, System.out); - } catch(Exception e){ - e.printStackTrace(); - } - - } - - private NuxeoRESTClient getClient() { - NuxeoRESTClient nxClient = new NuxeoRESTClient("http://127.0.0.1:8080/nuxeo"); - nxClient.setAuthType(NuxeoRESTClient.AUTH_TYPE_BASIC); - nxClient.setBasicAuthentication("Administrator", "Administrator"); - return nxClient; - } - - private void verbose(String msg) { - System.out.println("CollectionObjectResource: " + msg); - } -} diff --git a/sandbox/richard/HelloWorld/HelloWorldNuxeoService/src/main/java/org/collectionspace/hello/services/HelloworldNuxeoApplication.java b/sandbox/richard/HelloWorld/HelloWorldNuxeoService/src/main/java/org/collectionspace/hello/services/HelloworldNuxeoApplication.java deleted file mode 100644 index e9e233ae1..000000000 --- a/sandbox/richard/HelloWorld/HelloWorldNuxeoService/src/main/java/org/collectionspace/hello/services/HelloworldNuxeoApplication.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.collectionspace.hello.services; - -import javax.ws.rs.core.Application; -import java.util.HashSet; -import java.util.Set; - -public class HelloworldNuxeoApplication extends Application { - - private Set singletons = new HashSet(); - private Set> empty = new HashSet>(); - - public HelloworldNuxeoApplication() { - singletons.add(new CollectionObjectResource()); - singletons.add(new IdentifierResource()); - singletons.add(new PersonNuxeoResource()); - } - - @Override - public Set> getClasses() { - return empty; - } - - @Override - public Set getSingletons() { - return singletons; - } -} diff --git a/sandbox/richard/HelloWorld/HelloWorldNuxeoService/src/main/java/org/collectionspace/hello/services/IdentifierResource.java b/sandbox/richard/HelloWorld/HelloWorldNuxeoService/src/main/java/org/collectionspace/hello/services/IdentifierResource.java deleted file mode 100644 index a91b4b56f..000000000 --- a/sandbox/richard/HelloWorld/HelloWorldNuxeoService/src/main/java/org/collectionspace/hello/services/IdentifierResource.java +++ /dev/null @@ -1,78 +0,0 @@ -package org.collectionspace.hello.services; - -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -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.UUID; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.atomic.AtomicLong; -import javax.ws.rs.core.UriBuilder; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.Marshaller; -import org.collectionspace.hello.Identifier; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@Path("/identifiers") -@Consumes("application/xml") -@Produces("application/xml") -public class IdentifierResource { - - final Logger logger = LoggerFactory.getLogger(IdentifierResource.class); - private Map idDB = new ConcurrentHashMap(); - private AtomicLong idCounter = new AtomicLong(); - - public IdentifierResource() { - // do nothing - } - - @POST - public Response createIdentifier(Identifier id) { - if (id.getNamespace() == null) { - id.setNamespace("edu.berkeley"); - } - id.setId(idCounter.incrementAndGet()); - id.setVersion(1); - UUID uuid = UUID.nameUUIDFromBytes(id.getNamespace().getBytes()); - id.setValue(uuid.toString()); - idDB.put(id.getId(), id); - verbose("created Id", id); - UriBuilder path = UriBuilder.fromResource(IdentifierResource.class); - path.path("" + id.getId()); - Response response = Response.created(path.build()).build(); - return response; - } - - @GET - @Path("{id}") - public Identifier getIdentifier(@PathParam("id") Long id) { - Identifier i = idDB.get(id); - if (i == 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 Id", i); - return i; - } - - private void verbose(String msg, Identifier id) { - try { - System.out.println("IdentifierResource : " + msg); - JAXBContext jc = JAXBContext.newInstance(Identifier.class); - Marshaller m = jc.createMarshaller(); - m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, - Boolean.TRUE); - m.marshal(id, System.out); - - } catch (Exception e) { - e.printStackTrace(); - } - } -} diff --git a/sandbox/richard/HelloWorld/HelloWorldNuxeoService/src/main/java/org/collectionspace/hello/services/PersonNuxeoResource.java b/sandbox/richard/HelloWorld/HelloWorldNuxeoService/src/main/java/org/collectionspace/hello/services/PersonNuxeoResource.java deleted file mode 100644 index c43426f24..000000000 --- a/sandbox/richard/HelloWorld/HelloWorldNuxeoService/src/main/java/org/collectionspace/hello/services/PersonNuxeoResource.java +++ /dev/null @@ -1,371 +0,0 @@ -package org.collectionspace.hello.services; - -import java.io.ByteArrayInputStream; -import org.collectionspace.hello.services.nuxeo.NuxeoRESTClient; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import java.util.Map; -import javax.ws.rs.DELETE; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.PathParam; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriBuilder; -import javax.ws.rs.core.UriInfo; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.Marshaller; -import org.collectionspace.hello.*; - - -import org.collectionspace.hello.People.PeopleItem; -import org.dom4j.Document; -import org.dom4j.Element; -import org.dom4j.Namespace; -import org.dom4j.io.SAXReader; -import org.restlet.resource.Representation; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@Path("/persons") -@Consumes("application/xml") -@Produces("application/xml") -public class PersonNuxeoResource { - - final Logger logger = LoggerFactory.getLogger(PersonNuxeoResource.class); - - public PersonNuxeoResource() { - } - - @GET - public People getPeople(@Context UriInfo ui) { - People p = new People(); - try{ - List list = p.getPeopleItem(); - NuxeoRESTClient nxClient = getClient(); - - List pathParams = new ArrayList(); - Map queryParams = new HashMap(); - //browse default repository for People - //For sanjay, People repository id is f084243e-4b81-42a1-9a05-518e974facbd - //For Richard, workspace repos ID is 77187c27-0467-4c3d-b395-122b82113f4d - pathParams = Arrays.asList("default", "1b58eef7-4fff-430b-b773-8c98724f19de", "browse"); - Representation res = nxClient.get(pathParams, queryParams); - SAXReader reader = new SAXReader(); - Document document = reader.read(res.getStream()); - Element root = document.getRootElement(); - for(Iterator i = root.elementIterator(); i.hasNext();){ - Element element = (Element) i.next(); - PeopleItem pli = new PeopleItem(); - pli.setTitle(element.attributeValue("title")); - pli.setUri(element.attributeValue("url")); - pli.setId(element.attributeValue("id")); - list.add(pli); - } - - }catch(Exception e){ - e.printStackTrace(); - } - return p; - } - - @POST - public Response createPerson(PersonNuxeo p) { - - NuxeoRESTClient nxClient = getClient(); - - List pathParams = new ArrayList(); - Map queryParams = new HashMap(); - pathParams.add("default"); - pathParams.add("1b58eef7-4fff-430b-b773-8c98724f19de"); - pathParams.add("createDocument"); - queryParams.put("docType", "Hello"); - queryParams.put("dublincore:title", p.getFirstName() + " " + p.getLastName()); - queryParams.put("hello:cversion", Integer.valueOf(1).toString()); - queryParams.put("hello:firstName", p.getFirstName()); - queryParams.put("hello:lastName", p.getLastName()); - queryParams.put("hello:street", p.getStreet()); - queryParams.put("hello:city", p.getCity()); - queryParams.put("hello:state", p.getState()); - queryParams.put("hello:zip", p.getZip()); - queryParams.put("hello:country", p.getCountry()); - ByteArrayInputStream bais = new ByteArrayInputStream(new byte[0]); - Representation res = nxClient.post(pathParams, queryParams, bais); - - SAXReader reader = new SAXReader(); - try{ - Document document = reader.read(res.getStream()); - Element root = document.getRootElement(); - for(Iterator i = root.elementIterator(); i.hasNext();){ - Element element = (Element) i.next(); - if("docRef".equals(element.getName())){ - String id = (String) element.getData(); - p.setId(id); - } - } - }catch(Exception e){ - Response response = Response.status(Response.Status.NOT_FOUND).entity( - "Create failed").type("text/plain").build(); - throw new WebApplicationException(response); - } - - verbose("created person", p); - UriBuilder path = UriBuilder.fromResource(PersonNuxeoResource.class); - path.path("" + p.getId()); - Response response = Response.created(path.build()).build(); - return response; - } - - @GET - @Path("{id}") - public PersonNuxeo getPerson(@PathParam("id") String id) { - - PersonNuxeo p = null; - try{ - - NuxeoRESTClient nxClient = getClient(); - - List pathParams = new ArrayList(); - Map queryParams = new HashMap(); - - pathParams.add("default"); - pathParams.add(id); - pathParams.add("export"); - queryParams.put("format", "XML"); - - Representation res = nxClient.get(pathParams, queryParams); - SAXReader reader = new SAXReader(); - - Document document = reader.read(res.getStream()); - Element root = document.getRootElement(); - p = new PersonNuxeo(); - //TODO: recognize schema thru namespace uri -// Namespace ns = new Namespace("hello", "http://collectionspace.org/hello"); - Iterator siter = root.elementIterator("schema"); - while(siter.hasNext()){ - - Element s = siter.next(); - - System.err.println("PersonNuxeo.getPerson() called."); - - //TODO: recognize schema thru namespace uri - if("hello".equals(s.attribute("name").getValue())){ - p.setId(id); - Element ele = s.element("cversion"); - if(ele != null){ - p.setVersion((String) ele.getData()); - } - ele = s.element("firstName"); - if(ele != null){ - p.setFirstName((String) ele.getData()); - } - ele = s.element("lastName"); - if(ele != null){ - p.setLastName((String) ele.getData()); - } - ele = s.element("city"); - if(ele != null){ - p.setCity((String) ele.getData()); - } - ele = s.element("state"); - if(ele != null){ - p.setState((String) ele.getData()); - } - ele = s.element("zip"); - if(ele != null){ - p.setZip((String) ele.getData()); - } - ele = s.element("country"); - if(ele != null){ - p.setCountry((String) ele.getData()); - } - } - } - - }catch(Exception e){ - e.printStackTrace(); - Response response = Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity( - "Get failed").type("text/plain").build(); - throw new WebApplicationException(response); - } - if(p == null){ - Response response = Response.status(Response.Status.NOT_FOUND).entity( - "Get failed, the requested person ID:" + id + ": was not found.").type("text/plain").build(); - throw new WebApplicationException(response); - } - verbose("get person", p); - return p; - } - - @PUT - @Path("{id}") - public PersonNuxeo updatePerson( - @PathParam("id") String id, - PersonNuxeo update) { - - verbose("updating person input", update); - - NuxeoRESTClient nxClient = getClient(); - - List pathParams = new ArrayList(); - Map queryParams = new HashMap(); - pathParams.add("default"); - pathParams.add(update.getId()); - pathParams.add("updateDocumentRestlet"); - queryParams.put("dublincore:title", "change title"); - //todo: intelligent merge needed - if(update.getFirstName() != null){ - queryParams.put("hello:firstName", update.getFirstName()); - } - - if(update.getLastName() != null){ - queryParams.put("hello:lastName", update.getLastName()); - } - - if(update.getFirstName() != null && update.getLastName() != null){ - queryParams.put("dublincore:title", update.getFirstName() + " " + update.getLastName()); - } - - if(update.getStreet() != null){ - queryParams.put("hello:street", update.getStreet()); - } - - if(update.getCity() != null){ - queryParams.put("hello:city", update.getCity()); - } - - if(update.getState() != null){ - queryParams.put("hello:state", update.getState()); - } - - if(update.getZip() != null){ - queryParams.put("hello:zip", update.getZip()); - } - - if(update.getCountry() != null){ - queryParams.put("hello:country", update.getCountry()); - } - - Representation res = nxClient.get(pathParams, queryParams); - SAXReader reader = new SAXReader(); - String status = ""; - try{ - Document document = reader.read(res.getStream()); - Element root = document.getRootElement(); - for(Iterator i = root.elementIterator(); i.hasNext();){ - Element element = (Element) i.next(); - if("docRef".equals(element.getName())){ - status = (String) element.getData(); - verbose("updatePerson: response=" + status); - } - - } - }catch(Exception e){ - //FIXME: NOT_FOUND? - Response response = Response.status(Response.Status.NOT_FOUND).entity( - "Update failed ").type("text/plain").build(); - throw new WebApplicationException(response); - } - return update; - } - - @DELETE - @Path("{id}") - public void deletePerson(@PathParam("id") String id) { - verbose("deleting person with id=" + id); - NuxeoRESTClient nxClient = getClient(); - List pathParams = new ArrayList(); - Map queryParams = new HashMap(); - pathParams.add("default"); - pathParams.add(id); - pathParams.add("deleteDocumentRestlet"); - Representation res = nxClient.get(pathParams, queryParams); - SAXReader reader = new SAXReader(); - String status = ""; - try{ - Document document = reader.read(res.getStream()); - Element root = document.getRootElement(); - for(Iterator i = root.elementIterator(); i.hasNext();){ - Element element = (Element) i.next(); - if("docRef".equals(element.getName())){ - status = (String) element.getData(); - verbose("deletePerson: response=" + status); - } - - } - }catch(Exception e){ - //FIXME: NOT_FOUND? - Response response = Response.status(Response.Status.NOT_FOUND).entity( - "Delete failed ").type("text/plain").build(); - throw new WebApplicationException(response); - } - - } - - private void verbose(String msg, PersonNuxeo p) { - try{ - verbose(msg); - JAXBContext jc = JAXBContext.newInstance( - PersonNuxeo.class); - - Marshaller m = jc.createMarshaller(); - m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, - Boolean.TRUE); - m.marshal(p, System.out); - }catch(Exception e){ - e.printStackTrace(); - } - - } - -// private void getQueryModel() throws IOException { -// NuxeoRESTClient nxClient = getClient(); -// -// List pathParams = new ArrayList(); -// Map queryParams = new HashMap(); -// -// //query model for user documents -// pathParams = Arrays.asList("execQueryModel", "USER_DOCUMENTS"); -// queryParams.put("QP1", "Administrator"); -// queryParams.put("format", "XML"); -// -// -// Representation res = nxClient.get(pathParams, queryParams); -// String resStr = res.getText(); -// verbose("getQueryModel:" + resStr); -// -// } -// -// private void getVocabulary() throws IOException { -// NuxeoRESTClient nxClient = getClient(); -// -// List pathParams = new ArrayList(); -// Map queryParams = new HashMap(); -// //get vocabulary -// pathParams = Arrays.asList("vocabulary", "continent_country"); -// queryParams.put("lang", "en"); -// -// Representation res = nxClient.get(pathParams, queryParams); -// String resStr = res.getText(); -// verbose("getVocabulary:" + resStr); -// -// } - private NuxeoRESTClient getClient() { - NuxeoRESTClient nxClient = new NuxeoRESTClient("http://127.0.0.1:8080/nuxeo"); - nxClient.setAuthType(NuxeoRESTClient.AUTH_TYPE_BASIC); - nxClient.setBasicAuthentication("Administrator", "Administrator"); - return nxClient; - } - - private void verbose(String msg) { - System.out.println("PersonNuxeoResource: " + msg); - } -} diff --git a/sandbox/richard/HelloWorld/HelloWorldNuxeoService/src/main/java/org/collectionspace/hello/services/nuxeo/NuxeoCallback.java b/sandbox/richard/HelloWorld/HelloWorldNuxeoService/src/main/java/org/collectionspace/hello/services/nuxeo/NuxeoCallback.java deleted file mode 100644 index 8e78e0076..000000000 --- a/sandbox/richard/HelloWorld/HelloWorldNuxeoService/src/main/java/org/collectionspace/hello/services/nuxeo/NuxeoCallback.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ - -package org.collectionspace.hello.services.nuxeo; - - -import javax.security.auth.callback.Callback; - -/** - * Copied from jbossx - * - * An implementation of Callback that simply obtains an Object to be used - * as the authentication credential. Interpretation of the Object is up to - * the LoginModules that validate the credential. - * - * @author Scott.Stark@jboss.org - */ -public class NuxeoCallback implements Callback { - - private final String prompt; - - private Object credential; - - public NuxeoCallback() { - this(""); - } - - public NuxeoCallback(String prompt) { - this.prompt = prompt; - } - - public String getPrompt() { - return prompt; - } - - public Object getCredential() { - return credential; - } - - public void setCredential(Object credential) { - this.credential = credential; - } - - public void clearCredential() { - credential = null; - } - -} diff --git a/sandbox/richard/HelloWorld/HelloWorldNuxeoService/src/main/java/org/collectionspace/hello/services/nuxeo/NuxeoCallbackHandler.java b/sandbox/richard/HelloWorld/HelloWorldNuxeoService/src/main/java/org/collectionspace/hello/services/nuxeo/NuxeoCallbackHandler.java deleted file mode 100644 index e8fff8c25..000000000 --- a/sandbox/richard/HelloWorld/HelloWorldNuxeoService/src/main/java/org/collectionspace/hello/services/nuxeo/NuxeoCallbackHandler.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ -package org.collectionspace.hello.services.nuxeo; - -/** - * - * @author sanjaydalal - */ -import javax.security.auth.callback.Callback; -import javax.security.auth.callback.CallbackHandler; -import javax.security.auth.callback.NameCallback; -import javax.security.auth.callback.PasswordCallback; -import javax.security.auth.callback.UnsupportedCallbackException; - -/** - * Copied from jbossx. - * - * @author Scott.Stark@jboss.org - */ -public class NuxeoCallbackHandler implements CallbackHandler { - - private final String username; - private char[] password; - private final Object credential; - - /** - * Initializes the UsernamePasswordHandler with the username and password to - * use. - * - * @param username the user name - * @param password the password for this user - */ - public NuxeoCallbackHandler(String username, char[] password) { - this.username = username; - this.password = password; - credential = password; - } - - public NuxeoCallbackHandler(String username, Object credential) { - this.username = username; - this.credential = credential; - if (credential instanceof char[]) { - password = (char[]) credential; - } else if (credential instanceof CharSequence) { - password = credential.toString().toCharArray(); - } - } - - /** - * Sets any NameCallback name property to the instance username, sets any - * PasswordCallback password property to the instance, and any password. - * - * @exception UnsupportedCallbackException, - * thrown if any callback of type other than NameCallback or - * PasswordCallback are seen. - */ - public void handle(Callback[] callbacks) - throws UnsupportedCallbackException { - for (Callback c : callbacks) { - if (c instanceof NameCallback) { - NameCallback nc = (NameCallback) c; - nc.setName(username); - } else if (c instanceof PasswordCallback) { - PasswordCallback pc = (PasswordCallback) c; - if (password == null) { - // We were given an opaque Object credential but a char[] is - // requested? - if (credential != null) { - String tmp = credential.toString(); - password = tmp.toCharArray(); - } - } - pc.setPassword(password); - } else if (c instanceof NuxeoCallback) { - NuxeoCallback oc = (NuxeoCallback) c; - oc.setCredential(credential); - } else { - throw new UnsupportedCallbackException(c, - "Unrecognized Callback"); - } - } - } -} diff --git a/sandbox/richard/HelloWorld/HelloWorldNuxeoService/src/main/java/org/collectionspace/hello/services/nuxeo/NuxeoLoginConfiguration.java b/sandbox/richard/HelloWorld/HelloWorldNuxeoService/src/main/java/org/collectionspace/hello/services/nuxeo/NuxeoLoginConfiguration.java deleted file mode 100644 index 81cedc3c4..000000000 --- a/sandbox/richard/HelloWorld/HelloWorldNuxeoService/src/main/java/org/collectionspace/hello/services/nuxeo/NuxeoLoginConfiguration.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ -package org.collectionspace.hello.services.nuxeo; - -/** - * - * @author sanjaydalal - */ -import java.util.HashMap; -import java.util.Map; - -import javax.security.auth.login.AppConfigurationEntry; -import javax.security.auth.login.Configuration; -import javax.security.auth.login.AppConfigurationEntry.LoginModuleControlFlag; - -public class NuxeoLoginConfiguration extends Configuration { - - private final Configuration parent; - public static final String LOGIN_DOMAIN = "nuxeo-client-login"; - - public NuxeoLoginConfiguration(Configuration parent) { - this.parent = parent; - } - - @Override - public AppConfigurationEntry[] getAppConfigurationEntry(String name) { - - if (LOGIN_DOMAIN.equals(name)) { - AppConfigurationEntry[] entries = new AppConfigurationEntry[1]; - - Map options = new HashMap(); - - options.put("restore-login-identity", "True"); - options.put("multi-threaded", "True"); - - entries[0] = new AppConfigurationEntry("org.jboss.security.ClientLoginModule", LoginModuleControlFlag.REQUIRED, options); - - - return entries; - } else { - return parent.getAppConfigurationEntry(name); - } - } - - @Override - public void refresh() { - if (parent != null) { - parent.refresh(); - } - } -} diff --git a/sandbox/richard/HelloWorld/HelloWorldNuxeoService/src/main/java/org/collectionspace/hello/services/nuxeo/NuxeoLoginContextFactory.java b/sandbox/richard/HelloWorld/HelloWorldNuxeoService/src/main/java/org/collectionspace/hello/services/nuxeo/NuxeoLoginContextFactory.java deleted file mode 100644 index d1d23f7fc..000000000 --- a/sandbox/richard/HelloWorld/HelloWorldNuxeoService/src/main/java/org/collectionspace/hello/services/nuxeo/NuxeoLoginContextFactory.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ - -package org.collectionspace.hello.services.nuxeo; - -/** - * - * @author sanjaydalal - */ - -import javax.security.auth.callback.CallbackHandler; -import javax.security.auth.login.Configuration; -import javax.security.auth.login.LoginContext; -import javax.security.auth.login.LoginException; - -public class NuxeoLoginContextFactory { - - - private static boolean initDone=false; - - private static void initLoginConfig() - { - if (initDone) - return; - - Configuration parentConfig = null; - try { - parentConfig = Configuration.getConfiguration(); - } catch (Exception e) { - // do nothing - this can happen if default configuration provider is not correctly configured - // for examnple FileConfig fails if no config file was defined - } - Configuration config = new NuxeoLoginConfiguration(parentConfig); - Configuration.setConfiguration(config); - - initDone=true; - - } - - - public static LoginContext getLoginContext(CallbackHandler handler) throws LoginException - { - initLoginConfig(); - return new LoginContext(NuxeoLoginConfiguration.LOGIN_DOMAIN, handler); - } -} diff --git a/sandbox/richard/HelloWorld/HelloWorldNuxeoService/src/main/java/org/collectionspace/hello/services/nuxeo/NuxeoRESTClient.java b/sandbox/richard/HelloWorld/HelloWorldNuxeoService/src/main/java/org/collectionspace/hello/services/nuxeo/NuxeoRESTClient.java deleted file mode 100644 index 175dca70a..000000000 --- a/sandbox/richard/HelloWorld/HelloWorldNuxeoService/src/main/java/org/collectionspace/hello/services/nuxeo/NuxeoRESTClient.java +++ /dev/null @@ -1,308 +0,0 @@ -/* - * (C) Copyright 2006-2007 Nuxeo SAS (http://nuxeo.com/) and contributors. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the GNU Lesser General Public License - * (LGPL) version 2.1 which accompanies this distribution, and is available at - * http://www.gnu.org/licenses/lgpl.html - * - * 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. - * - * Contributors: - * Nuxeo - initial API and implementation - * - * $Id: JOOoConvertPluginImpl.java 18651 2007-05-13 20:28:53Z sfermigier $ - */ -package org.collectionspace.hello.services.nuxeo; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.List; -import java.util.Map; - - -import org.restlet.Client; -import org.restlet.data.ChallengeResponse; -import org.restlet.data.ChallengeScheme; -import org.restlet.data.Cookie; -import org.restlet.data.Form; -import org.restlet.data.MediaType; -import org.restlet.data.Method; -import org.restlet.data.Parameter; -import org.restlet.data.Protocol; -import org.restlet.data.Request; -import org.restlet.resource.OutputRepresentation; -import org.restlet.resource.Representation; -import org.restlet.util.Series; - -public class NuxeoRESTClient { - - public static final int AUTH_TYPE_NONE = 0; - public static final int AUTH_TYPE_BASIC = 1; - public static final int AUTH_TYPE_SECRET = 2; - protected String baseURL = "http://127.0.0.1:8080/nuxeo"; - protected String restPrefix = "restAPI"; - protected String davPrefix = "dav"; - protected List cookies; - protected int authType = AUTH_TYPE_NONE; - protected String userName; - protected String password; - protected String secretToken; - protected Client restClient; - - public NuxeoRESTClient(String baseURL) { - this.baseURL = baseURL; - } - - public NuxeoRESTClient(String protocol, String serverIP, String serverPort) { - this(protocol, serverIP, serverPort, "nuxeo"); - } - - public NuxeoRESTClient(String protocol, String serverIP, String serverPort, - String servletPath) { - StringBuffer sb = new StringBuffer(); - sb.append(protocol); - sb.append("://"); - sb.append(serverIP); - if (serverPort != null && !serverIP.equals("80")) { - sb.append(':'); - sb.append(serverPort); - } - sb.append(servletPath); - sb.append('/'); - baseURL = sb.toString(); - } - - public void setBasicAuthentication(String userName, String password) { - authType = AUTH_TYPE_BASIC; - this.userName = userName; - this.password = password; - } - - public void setSharedSecretAuthentication(String userName, - String secretToken) { - authType = AUTH_TYPE_SECRET; - this.userName = userName; - this.secretToken = secretToken; - } - - public void setCookies(List cookies) { - this.cookies = cookies; - } - - public Representation post(List pathParams, - Map queryParams, InputStream istream) { - String path = ""; - StringBuffer pathBuffer = new StringBuffer(); - - if (pathParams != null) { - for (String p : pathParams) { - pathBuffer.append(p); - pathBuffer.append('/'); - } - path = pathBuffer.toString(); - } - - return post(path, queryParams, istream); - } - - public Representation post(String subPath, - Map queryParams, InputStream istream) { - StringBuffer urlBuffer = new StringBuffer(); - - if (subPath.startsWith("/")) { - subPath = subPath.substring(1); - } - if (subPath.endsWith("/")) { - subPath = subPath.substring(0, subPath.length() - 1); - } - - urlBuffer.append(baseURL); - urlBuffer.append('/'); - urlBuffer.append(restPrefix); - urlBuffer.append('/'); - urlBuffer.append(subPath); - - if (queryParams != null) { - urlBuffer.append('?'); - for (String qpName : queryParams.keySet()) { - urlBuffer.append(qpName); - urlBuffer.append('='); - urlBuffer.append(queryParams.get(qpName).replaceAll(" ", "%20")); - urlBuffer.append('&'); - } - } - - String completeURL = urlBuffer.toString(); - - Request request = new Request(Method.POST, completeURL); - - setupAuth(request); - setupCookies(request); - final InputStream in = istream; - request.setEntity(new OutputRepresentation( - MediaType.MULTIPART_FORM_DATA) { - - @Override - public void write(OutputStream outputStream) throws IOException { - byte[] buffer = new byte[1024 * 64]; - int read; - while ((read = in.read(buffer)) != -1) { - outputStream.write(buffer, 0, read); - } - - } - }); - - return getRestClient().handle(request).getEntity(); - } - - public Representation get(List pathParams, - Map queryParams) { - String path = ""; - StringBuffer pathBuffer = new StringBuffer(); - - if (pathParams != null) { - for (String p : pathParams) { - pathBuffer.append(p); - pathBuffer.append('/'); - } - path = pathBuffer.toString(); - } - - return get(path, queryParams); - } - - public Representation get(String subPath, - Map queryParams) { - StringBuffer urlBuffer = new StringBuffer(); - - if (subPath.startsWith("/")) { - subPath = subPath.substring(1); - } - if (subPath.endsWith("/")) { - subPath = subPath.substring(0, subPath.length() - 1); - } - - urlBuffer.append(baseURL); - urlBuffer.append('/'); - urlBuffer.append(restPrefix); - urlBuffer.append('/'); - urlBuffer.append(subPath); - - if (queryParams != null) { - urlBuffer.append('?'); - for (String qpName : queryParams.keySet()) { - urlBuffer.append(qpName); - urlBuffer.append('='); - urlBuffer.append(queryParams.get(qpName).replaceAll(" ", "%20")); - urlBuffer.append('&'); - } - } - - String completeURL = urlBuffer.toString(); - System.out.println("\nNuxeoRESTClient: calling " + completeURL); - Request request = new Request(Method.GET, completeURL); - setupAuth(request); - setupCookies(request); - - return getRestClient().handle(request).getEntity(); - } - - protected void setupAuth(Request request) { - - if (authType == AUTH_TYPE_BASIC) { - ChallengeScheme scheme = ChallengeScheme.HTTP_BASIC; - ChallengeResponse authentication = new ChallengeResponse(scheme, - userName, password); - request.setChallengeResponse(authentication); - - } else if (authType == AUTH_TYPE_SECRET) { - Series additionnalHeaders = new Form(); - - Map securityHeaders = PortalSSOAuthenticationProvider.getHeaders( - secretToken, userName); - - for (String hn : securityHeaders.keySet()) { - additionnalHeaders.add(hn, securityHeaders.get(hn)); - } - - request.getAttributes().put("org.restlet.http.headers", - additionnalHeaders); - } - } - - protected void setupCookies(Request request) { - if (cookies != null) { - request.getCookies().clear(); - for (Cookie cookie : cookies) { - request.getCookies().add(cookie); - } - } - - } - - protected Client getRestClient() { - if (restClient == null) { - if (baseURL.startsWith("https")) { - restClient = new Client(Protocol.HTTPS); - } else { - restClient = new Client(Protocol.HTTP); - } - } - - return restClient; - } - - public int getAuthType() { - return authType; - } - - public void setAuthType(int authType) { - this.authType = authType; - } - - public String getDavPrefix() { - return davPrefix; - } - - public void setDavPrefix(String davPrefix) { - this.davPrefix = davPrefix; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public String getRestPrefix() { - return restPrefix; - } - - public void setRestPrefix(String restPrefix) { - this.restPrefix = restPrefix; - } - - public String getSecretToken() { - return secretToken; - } - - public void setSecretToken(String secretToken) { - this.secretToken = secretToken; - } - - public String getUserName() { - return userName; - } - - public void setUserName(String userName) { - this.userName = userName; - } -} diff --git a/sandbox/richard/HelloWorld/HelloWorldNuxeoService/src/main/java/org/collectionspace/hello/services/nuxeo/PortalSSOAuthenticationProvider.java b/sandbox/richard/HelloWorld/HelloWorldNuxeoService/src/main/java/org/collectionspace/hello/services/nuxeo/PortalSSOAuthenticationProvider.java deleted file mode 100644 index ef1a61a40..000000000 --- a/sandbox/richard/HelloWorld/HelloWorldNuxeoService/src/main/java/org/collectionspace/hello/services/nuxeo/PortalSSOAuthenticationProvider.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * (C) Copyright 2006-2007 Nuxeo SAS (http://nuxeo.com/) and contributors. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the GNU Lesser General Public License - * (LGPL) version 2.1 which accompanies this distribution, and is available at - * http://www.gnu.org/licenses/lgpl.html - * - * 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. - * - * Contributors: - * Nuxeo - initial API and implementation - * - * $Id: JOOoConvertPluginImpl.java 18651 2007-05-13 20:28:53Z sfermigier $ - */ - -package org.collectionspace.hello.services.nuxeo; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; -import java.util.Date; -import java.util.HashMap; -import java.util.Map; -import java.util.Random; - -import com.noelios.restlet.util.Base64; - -public class PortalSSOAuthenticationProvider { - - private static final String TOKEN_SEP = ":"; - - private static final String TS_HEADER = "NX_TS"; - - private static final String RANDOM_HEADER = "NX_RD"; - - private static final String TOKEN_HEADER = "NX_TOKEN"; - - private static final String USER_HEADER = "NX_USER"; - - public static Map getHeaders(String secretKey, - String userName) { - - Map headers = new HashMap(); - - Date timestamp = new Date(); - int randomData = new Random(timestamp.getTime()).nextInt(); - - String clearToken = timestamp.getTime() + TOKEN_SEP + randomData - + TOKEN_SEP + secretKey + TOKEN_SEP + userName; - - byte[] hashedToken; - - try { - hashedToken = MessageDigest.getInstance("MD5").digest( - clearToken.getBytes()); - } catch (NoSuchAlgorithmException e) { - return null; - } - - String base64HashedToken = Base64.encodeBytes(hashedToken); - - headers.put(TS_HEADER, String.valueOf(timestamp.getTime())); - headers.put(RANDOM_HEADER, String.valueOf(randomData)); - headers.put(TOKEN_HEADER, base64HashedToken); - headers.put(USER_HEADER, userName); - - return headers; - } - -} diff --git a/sandbox/richard/HelloWorld/HelloWorldNuxeoService/src/main/resources/jndi.properties b/sandbox/richard/HelloWorld/HelloWorldNuxeoService/src/main/resources/jndi.properties deleted file mode 100644 index a3aa40712..000000000 --- a/sandbox/richard/HelloWorld/HelloWorldNuxeoService/src/main/resources/jndi.properties +++ /dev/null @@ -1,3 +0,0 @@ -java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory -java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces -java.naming.provider.url=jnp://localhost:1099 \ No newline at end of file diff --git a/sandbox/richard/HelloWorld/HelloWorldNuxeoService/src/main/resources/nuxeo.properties b/sandbox/richard/HelloWorld/HelloWorldNuxeoService/src/main/resources/nuxeo.properties deleted file mode 100644 index 3c9d5afb5..000000000 --- a/sandbox/richard/HelloWorld/HelloWorldNuxeoService/src/main/resources/nuxeo.properties +++ /dev/null @@ -1,2 +0,0 @@ -org.nuxeo.runtime.server.enabled=false -org.nuxeo.runtime.streaming.isServer=false diff --git a/sandbox/richard/HelloWorld/HelloWorldNuxeoService/src/main/webapp/WEB-INF/web.xml b/sandbox/richard/HelloWorld/HelloWorldNuxeoService/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index 0c188a4fb..000000000 --- a/sandbox/richard/HelloWorld/HelloWorldNuxeoService/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - HelloworldNuxeo - - - javax.ws.rs.Application - org.collectionspace.hello.services.HelloworldNuxeoApplication - - - - resteasy.servlet.mapping.prefix - /cspace-nuxeo - - - - - org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap - - - - - Resteasy - - org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher - - - - - Resteasy - /cspace-nuxeo/* - - - diff --git a/sandbox/richard/HelloWorld/pom.xml b/sandbox/richard/HelloWorld/pom.xml deleted file mode 100644 index cc90907a2..000000000 --- a/sandbox/richard/HelloWorld/pom.xml +++ /dev/null @@ -1,231 +0,0 @@ - - - - 4.0.0 - org.collectionspace.hello.services - 0.1 - helloworld - pom - HelloWorld - - HelloWorldJaxb - HelloWorldClient - HelloWorldNuxeoService - - - - jboss - http://repository.jboss.org/maven2 - - - sun - http://download.java.net/maven/2 - - - java.net - java.net Maven Repository - - https://maven-repository.dev.java.net/nonav/repository - - legacy - - - maven2-repository.dev.java.net - Java.net Maven 2 Repository - http://download.java.net/maven/2 - - - - - - java.net - java.net Maven Repository - - https://maven-repository.dev.java.net/nonav/repository - - legacy - - - maven2-repository.dev.java.net - Java.net Maven 2 Repository - http://download.java.net/maven/2 - - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.5 - 1.5 - - - - org.apache.maven.plugins - maven-site-plugin - - - /usr/bin/unzip -o > err.txt - - - - - org.apache.maven.plugins - maven-war-plugin - 2.0.1 - - - - WEB-INF/lib/*.jar - - - - true - - - - - - - org.jvnet.jaxb2.maven2 - maven-jaxb2-plugin - - - - generate - - - - - - -XtoString - -Xinject-listener-code - - - - - - - org.jvnet.jaxb2_commons - - basic - 0.4.1 - - - - org.jvnet.jaxb2-commons - - - property-listener-injector - - 1.0 - - - - - org.collectionspace.hello - - - - - - - - - - net.java.dev.jaxb2-commons - jaxb-fluent-api - 2.0.1 - - - org.testng - testng - 5.6 - test - jdk15 - - - org.jboss.resteasy - jaxrs-api - 1.0.2.GA - - - net.java.dev.jaxb2-commons - jaxb-fluent-api - 2.0.1 - - - org.jvnet.jaxb2-commons - property-listener-injector - 1.0 - - - org.jvnet.jaxb2_commons - runtime - 0.4.1 - - - org.jboss.resteasy - resteasy-jaxrs - 1.0.2.GA - - - commons-httpclient - commons-httpclient - 3.1 - - - com.sun.xml.bind - jaxb-impl - 2.1.7 - - - org.testng - testng - 5.6 - test - jdk15 - - - org.slf4j - slf4j-api - 1.5.2 - - - org.slf4j - slf4j-log4j12 - 1.5.2 - - - mysql - mysql-connector-java - 5.1.5 - test - - - com.jgoodies - binding - 2.0.2 - - - com.jgoodies - forms - 1.2.0 - - - - diff --git a/sandbox/richard/README.txt b/sandbox/richard/README.txt deleted file mode 100644 index 9ee934364..000000000 --- a/sandbox/richard/README.txt +++ /dev/null @@ -1 +0,0 @@ -this diff --git a/sandbox/richard/schema/Identifier.rng b/sandbox/richard/schema/Identifier.rng deleted file mode 100644 index b091b311a..000000000 --- a/sandbox/richard/schema/Identifier.rng +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/sandbox/richard/schema/Identifier.rng.bak b/sandbox/richard/schema/Identifier.rng.bak deleted file mode 100644 index e69de29bb..000000000 diff --git a/sandbox/richard/schema/csid.rng b/sandbox/richard/schema/csid.rng deleted file mode 100644 index 842368eb1..000000000 --- a/sandbox/richard/schema/csid.rng +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/sandbox/richard/schema/csid.rng.bak b/sandbox/richard/schema/csid.rng.bak deleted file mode 100644 index e69de29bb..000000000 diff --git a/sandbox/richard/schema/dsid.rng b/sandbox/richard/schema/dsid.rng deleted file mode 100644 index 10b85d85c..000000000 --- a/sandbox/richard/schema/dsid.rng +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/sandbox/richard/schema/libraryInstance.xml b/sandbox/richard/schema/libraryInstance.xml deleted file mode 100644 index b47331466..000000000 --- a/sandbox/richard/schema/libraryInstance.xml +++ /dev/null @@ -1,108 +0,0 @@ - - - - 0836217462 - - - Being a Dog Is a Full-Time Job - - - - - - - - - - 0805033106 - - - Peanuts Every Sunday - - - - - - - - - - Charles M. Schulz - - - SPARKY - - - November 26, 1922 - - - February 12, 2000 - - - - - Peppermint Patty - - - Aug. 22, 1966 - - - bold, brash and tomboyish - - - - - Snoopy - - - October 4, 1950 - - - extroverted beagle - - - - - Schroeder - - - May 30, 1951 - - - brought classical music to the Peanuts strip - - - - - Lucy - - - March 3, 1952 - - - bossy, crabby and selfish - - - - - Sally Brown - - - Aug, 22, 1960 - - - always looks for the easy way out - - - - - Linus - - - Sept. 19, 1952 - - - the intellectual of the gang - - - diff --git a/sandbox/richard/schema/librarySchema.rng.xml b/sandbox/richard/schema/librarySchema.rng.xml deleted file mode 100644 index a78648582..000000000 --- a/sandbox/richard/schema/librarySchema.rng.xml +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sandbox/richard/schema/librarySchema.rng.xml.bak b/sandbox/richard/schema/librarySchema.rng.xml.bak deleted file mode 100644 index e69de29bb..000000000 diff --git a/sandbox/richard/schema/librarySchema.xsd.xml b/sandbox/richard/schema/librarySchema.xsd.xml deleted file mode 100644 index 09d947a0a..000000000 --- a/sandbox/richard/schema/librarySchema.xsd.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sandbox/richard/schema/sampleSchema.xml.bak b/sandbox/richard/schema/sampleSchema.xml.bak deleted file mode 100644 index e69de29bb..000000000 diff --git a/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin.zip b/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin.zip deleted file mode 100644 index 5f69de20d..000000000 Binary files a/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin.zip and /dev/null differ diff --git a/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/LICENSE.txt b/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/LICENSE.txt deleted file mode 100644 index 2205987a9..000000000 --- a/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/LICENSE.txt +++ /dev/null @@ -1,384 +0,0 @@ -COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 -Submitted by nelson on Thu, 2007-06-07 16:10. :: - -COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 - -1. Definitions. - -1.1. "Contributor" means each individual or entity that -creates or contributes to the creation of Modifications. - -1.2. "Contributor Version" means the combination of the -Original Software, prior Modifications used by a -Contributor (if any), and the Modifications made by that -particular Contributor. - -1.3. "Covered Software" means (a) the Original Software, or -(b) Modifications, or (c) the combination of files -containing Original Software with files containing -Modifications, in each case including portions thereof. - -1.4. "Executable" means the Covered Software in any form -other than Source Code. - -1.5. "Initial Developer" means the individual or entity -that first makes Original Software available under this -License. - -1.6. "Larger Work" means a work which combines Covered -Software or portions thereof with code not governed by the -terms of this License. - -1.7. "License" means this document. - -1.8. "Licensable" means having the right to grant, to the -maximum extent possible, whether at the time of the initial -grant or subsequently acquired, any and all of the rights -conveyed herein. - -1.9. "Modifications" means the Source Code and Executable -form of any of the following: - -A. Any file that results from an addition to, -deletion from or modification of the contents of a -file containing Original Software or previous -Modifications; - -B. Any new file that contains any part of the -Original Software or previous Modification; or - -C. Any new file that is contributed or otherwise made -available under the terms of this License. - -1.10. "Original Software" means the Source Code and -Executable form of computer software code that is -originally released under this License. - -1.11. "Patent Claims" means any patent claim(s), now owned -or hereafter acquired, including without limitation, -method, process, and apparatus claims, in any patent -Licensable by grantor. - -1.12. "Source Code" means (a) the common form of computer -software code in which modifications are made and (b) -associated documentation included in or with such code. - -1.13. "You" (or "Your") means an individual or a legal -entity exercising rights under, and complying with all of -the terms of, this License. For legal entities, "You" -includes any entity which controls, is controlled by, or is -under common control with You. For purposes of this -definition, "control" means (a) the power, direct or -indirect, to cause the direction or management of such -entity, whether by contract or otherwise, or (b) ownership -of more than fifty percent (50%) of the outstanding shares -or beneficial ownership of such entity. - -2. License Grants. - -2.1. The Initial Developer Grant. - -Conditioned upon Your compliance with Section 3.1 below and -subject to third party intellectual property claims, the -Initial Developer hereby grants You a world-wide, -royalty-free, non-exclusive license: - -(a) under intellectual property rights (other than -patent or trademark) Licensable by Initial Developer, -to use, reproduce, modify, display, perform, -sublicense and distribute the Original Software (or -portions thereof), with or without Modifications, -and/or as part of a Larger Work; and - -(b) under Patent Claims infringed by the making, -using or selling of Original Software, to make, have -made, use, practice, sell, and offer for sale, and/or -otherwise dispose of the Original Software (or -portions thereof). - -(c) The licenses granted in Sections 2.1(a) and (b) -are effective on the date Initial Developer first -distributes or otherwise makes the Original Software -available to a third party under the terms of this -License. - -(d) Notwithstanding Section 2.1(b) above, no patent -license is granted: (1) for code that You delete from -the Original Software, or (2) for infringements -caused by: (i) the modification of the Original -Software, or (ii) the combination of the Original -Software with other software or devices. - -2.2. Contributor Grant. - -Conditioned upon Your compliance with Section 3.1 below and -subject to third party intellectual property claims, each -Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -(a) under intellectual property rights (other than -patent or trademark) Licensable by Contributor to -use, reproduce, modify, display, perform, sublicense -and distribute the Modifications created by such -Contributor (or portions thereof), either on an -unmodified basis, with other Modifications, as -Covered Software and/or as part of a Larger Work; and - -(b) under Patent Claims infringed by the making, -using, or selling of Modifications made by that -Contributor either alone and/or in combination with -its Contributor Version (or portions of such -combination), to make, use, sell, offer for sale, -have made, and/or otherwise dispose of: (1) -Modifications made by that Contributor (or portions -thereof); and (2) the combination of Modifications -made by that Contributor with its Contributor Version -(or portions of such combination). - -(c) The licenses granted in Sections 2.2(a) and -2.2(b) are effective on the date Contributor first -distributes or otherwise makes the Modifications -available to a third party. - -(d) Notwithstanding Section 2.2(b) above, no patent -license is granted: (1) for any code that Contributor -has deleted from the Contributor Version; (2) for -infringements caused by: (i) third party -modifications of Contributor Version, or (ii) the -combination of Modifications made by that Contributor -with other software (except as part of the -Contributor Version) or other devices; or (3) under -Patent Claims infringed by Covered Software in the -absence of Modifications made by that Contributor. - -3. Distribution Obligations. - -3.1. Availability of Source Code. - -Any Covered Software that You distribute or otherwise make -available in Executable form must also be made available in -Source Code form and that Source Code form must be -distributed only under the terms of this License. You must -include a copy of this License with every copy of the -Source Code form of the Covered Software You distribute or -otherwise make available. You must inform recipients of any -such Covered Software in Executable form as to how they can -obtain such Covered Software in Source Code form in a -reasonable manner on or through a medium customarily used -for software exchange. - -3.2. Modifications. - -The Modifications that You create or to which You -contribute are governed by the terms of this License. You -represent that You believe Your Modifications are Your -original creation(s) and/or You have sufficient rights to -grant the rights conveyed by this License. - -3.3. Required Notices. - -You must include a notice in each of Your Modifications -that identifies You as the Contributor of the Modification. -You may not remove or alter any copyright, patent or -trademark notices contained within the Covered Software, or -any notices of licensing or any descriptive text giving -attribution to any Contributor or the Initial Developer. - -3.4. Application of Additional Terms. - -You may not offer or impose any terms on any Covered -Software in Source Code form that alters or restricts the -applicable version of this License or the recipients' -rights hereunder. You may choose to offer, and to charge a -fee for, warranty, support, indemnity or liability -obligations to one or more recipients of Covered Software. -However, you may do so only on Your own behalf, and not on -behalf of the Initial Developer or any Contributor. You -must make it absolutely clear that any such warranty, -support, indemnity or liability obligation is offered by -You alone, and You hereby agree to indemnify the Initial -Developer and every Contributor for any liability incurred -by the Initial Developer or such Contributor as a result of -warranty, support, indemnity or liability terms You offer. - -3.5. Distribution of Executable Versions. - -You may distribute the Executable form of the Covered -Software under the terms of this License or under the terms -of a license of Your choice, which may contain terms -different from this License, provided that You are in -compliance with the terms of this License and that the -license for the Executable form does not attempt to limit -or alter the recipient's rights in the Source Code form -from the rights set forth in this License. If You -distribute the Covered Software in Executable form under a -different license, You must make it absolutely clear that -any terms which differ from this License are offered by You -alone, not by the Initial Developer or Contributor. You -hereby agree to indemnify the Initial Developer and every -Contributor for any liability incurred by the Initial -Developer or such Contributor as a result of any such terms -You offer. - -3.6. Larger Works. - -You may create a Larger Work by combining Covered Software -with other code not governed by the terms of this License -and distribute the Larger Work as a single product. In such -a case, You must make sure the requirements of this License -are fulfilled for the Covered Software. - -4. Versions of the License. - -4.1. New Versions. - -Sun Microsystems, Inc. is the initial license steward and -may publish revised and/or new versions of this License -from time to time. Each version will be given a -distinguishing version number. Except as provided in -Section 4.3, no one other than the license steward has the -right to modify this License. - -4.2. Effect of New Versions. - -You may always continue to use, distribute or otherwise -make the Covered Software available under the terms of the -version of the License under which You originally received -the Covered Software. If the Initial Developer includes a -notice in the Original Software prohibiting it from being -distributed or otherwise made available under any -subsequent version of the License, You must distribute and -make the Covered Software available under the terms of the -version of the License under which You originally received -the Covered Software. Otherwise, You may also choose to -use, distribute or otherwise make the Covered Software -available under the terms of any subsequent version of the -License published by the license steward. - -4.3. Modified Versions. - -When You are an Initial Developer and You want to create a -new license for Your Original Software, You may create and -use a modified version of this License if You: (a) rename -the license and remove any references to the name of the -license steward (except to note that the license differs -from this License); and (b) otherwise make it clear that -the license contains terms which differ from this License. - -5. DISCLAIMER OF WARRANTY. - -COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" -BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, -INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED -SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR -PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND -PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY -COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE -INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF -ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF -WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF -ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS -DISCLAIMER. - -6. TERMINATION. - -6.1. This License and the rights granted hereunder will -terminate automatically if You fail to comply with terms -herein and fail to cure such breach within 30 days of -becoming aware of the breach. Provisions which, by their -nature, must remain in effect beyond the termination of -this License shall survive. - -6.2. If You assert a patent infringement claim (excluding -declaratory judgment actions) against Initial Developer or -a Contributor (the Initial Developer or Contributor against -whom You assert such claim is referred to as "Participant") -alleging that the Participant Software (meaning the -Contributor Version where the Participant is a Contributor -or the Original Software where the Participant is the -Initial Developer) directly or indirectly infringes any -patent, then any and all rights granted directly or -indirectly to You by such Participant, the Initial -Developer (if the Initial Developer is not the Participant) -and all Contributors under Sections 2.1 and/or 2.2 of this -License shall, upon 60 days notice from Participant -terminate prospectively and automatically at the expiration -of such 60 day notice period, unless if within such 60 day -period You withdraw Your claim with respect to the -Participant Software against such Participant either -unilaterally or pursuant to a written agreement with -Participant. - -6.3. In the event of termination under Sections 6.1 or 6.2 -above, all end user licenses that have been validly granted -by You or any distributor hereunder prior to termination -(excluding licenses granted to You by any distributor) -shall survive termination. - -7. LIMITATION OF LIABILITY. - -UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT -(INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE -INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF -COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE -LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR -CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT -LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK -STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER -COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN -INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF -LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL -INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT -APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO -NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR -CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT -APPLY TO YOU. - -8. U.S. GOVERNMENT END USERS. - -The Covered Software is a "commercial item," as that term is -defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial -computer software" (as that term is defined at 48 C.F.R. ¤ -252.227-7014(a)(1)) and "commercial computer software -documentation" as such terms are used in 48 C.F.R. 12.212 (Sept. -1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 -through 227.7202-4 (June 1995), all U.S. Government End Users -acquire Covered Software with only those rights set forth herein. -This U.S. Government Rights clause is in lieu of, and supersedes, -any other FAR, DFAR, or other clause or provision that addresses -Government rights in computer software under this License. - -9. MISCELLANEOUS. - -This License represents the complete agreement concerning subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the -extent necessary to make it enforceable. This License shall be -governed by the law of the jurisdiction specified in a notice -contained within the Original Software (except to the extent -applicable law, if any, provides otherwise), excluding such -jurisdiction's conflict-of-law provisions. Any litigation -relating to this License shall be subject to the jurisdiction of -the courts located in the jurisdiction and venue specified in a -notice contained within the Original Software, with the losing -party responsible for costs, including, without limitation, court -costs and reasonable attorneys' fees and expenses. The -application of the United Nations Convention on Contracts for the -International Sale of Goods is expressly excluded. Any law or -regulation which provides that the language of a contract shall -be construed against the drafter shall not apply to this License. -You agree that You alone are responsible for compliance with the -United States export administration regulations (and the export -control laws and regulation of any other countries) when You use, -distribute or otherwise make available any Covered Software. - -10. RESPONSIBILITY FOR CLAIMS. - -As between Initial Developer and the Contributors, each party is -responsible for claims and damages arising, directly or -indirectly, out of its utilization of rights under this License -and You agree to work with Initial Developer and Contributors to -distribute such responsibility on an equitable basis. Nothing -herein is intended or shall be deemed to constitute any admission -of liability. - diff --git a/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/README.html b/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/README.html deleted file mode 100644 index 7cc8c1678..000000000 --- a/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/README.html +++ /dev/null @@ -1,27 +0,0 @@ - - - README - - -

    README

    -

    WADL v. 1.1-SNAPSHOT

    -

    - WADL is designed to provide a machine process-able description of - HTTP-based Web applications. To date such applications have - been mainly described using a combination of textual description - and XML schema, WADL aims to provide a machine process-able - description of such applications. -

    -

    - This distribution contains the following files: -

    -
    -
    ./bin
    -
    Scripts for running the commandline tool.
    -
    ./lib
    -
    The libraries required to run the commandline tools and the Ant task.
    -
    ./samples
    -
    Some examples, showing how to use the different tools provided.
    -
    - - \ No newline at end of file diff --git a/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/README.txt b/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/README.txt deleted file mode 100644 index e10ba0867..000000000 --- a/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/README.txt +++ /dev/null @@ -1,21 +0,0 @@ -README - - WADL v. 1.1-SNAPSHOT - - WADL is designed to provide a machine process-able description of - HTTP-based Web applications. To date such applications have - been mainly described using a combination of textual description - and XML schema, WADL aims to provide a machine process-able - description of such applications. - - This distribution contains the following files: - - ./bin - Scripts for running the commandline tool. - - ./lib - The libraries required to run the commandline tools and the Ant - task. - - ./samples - Some examples, showing how to use the different tools provided. diff --git a/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/bin/wadl2java b/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/bin/wadl2java deleted file mode 100644 index a59e1ca0a..000000000 --- a/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/bin/wadl2java +++ /dev/null @@ -1,130 +0,0 @@ -#!/bin/sh -# ---------------------------------------------------------------------------- -# The contents of this file are subject to the terms -# of the Common Development and Distribution License -# (the "License"). You may not use this file except -# in compliance with the License. - -# You can obtain a copy of the license at -# http://www.opensource.org/licenses/cddl1.php -# See the License for the specific language governing -# permissions and limitations under the License. -# ---------------------------------------------------------------------------- - -if [ -f /etc/wadlrc ] ; then - . /etc/wadlrc -fi - -if [ -f "$HOME/.wadlrc" ] ; then - . "$HOME/.wadlrc" -fi - -# OS specific support. $var _must_ be set to either true or false. -cygwin=false; -darwin=false; -case "`uname`" in - CYGWIN*) cygwin=true ;; - Darwin*) darwin=true - if [ -z "$JAVA_VERSION" ] ; then - JAVA_VERSION="CurrentJDK" - else - echo "Using Java version: $JAVA_VERSION" - fi - if [ -z "$JAVA_HOME" ] ; then - JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/${JAVA_VERSION}/Home - fi - ;; -esac - -if [ -z "$JAVA_HOME" ] ; then - if [ -e /etc/gentoo-release ] ; then - JAVA_HOME=`java-config --jre-home` - fi -fi - -if [ -z "$WADL_HOME" ] ; then - # try to find WADL - if [ -d /opt/wadl ] ; then - WADL_HOME=/opt/wadl - fi - - if [ -d "$HOME/wadl" ] ; then - WADL_HOME="$HOME/wadl" - fi - - ## resolve links - $0 may be a link to wadl's home - PRG="$0" - - # need this for relative symlinks - while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG="`dirname "$PRG"`/$link" - fi - done - - saveddir=`pwd` - - WADL_HOME=`dirname "$PRG"`/.. - - # make it fully qualified - WADL_HOME=`cd "$WADL_HOME" && pwd` - - cd "$saveddir" - # echo Using wadl at $WADL_HOME -fi - -# For Cygwin, ensure paths are in UNIX format before anything is touched -if $cygwin ; then - [ -n "$WADL_HOME" ] && - WADL_HOME=`cygpath --unix "$WADL_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --unix "$JAVA_HOME"` - [ -n "$CLASSPATH" ] && - CLASSPATH=`cygpath --path --unix "$CLASSPATH"` -fi - -if [ -z "$JAVACMD" ] ; then - if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - else - JAVACMD=java - fi -fi - -if [ ! -x "$JAVACMD" ] ; then - echo "Error: JAVA_HOME is not defined correctly." - echo " We cannot execute $JAVACMD" - exit 1 -fi - -if [ -z "$JAVA_HOME" ] ; then - echo "Warning: JAVA_HOME environment variable is not set." -fi - -CLASSWORLDS_LAUNCHER=org.codehaus.classworlds.Launcher - -# For Cygwin, switch paths to Windows format before running java -if $cygwin; then - [ -n "$WADL_HOME" ] && - WADL_HOME=`cygpath --path --windows "$WADL_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` - [ -n "$HOME" ] && - HOME=`cygpath --path --windows "$HOME"` -fi - -exec "$JAVACMD" \ - $WADL_OPTS \ - "-Dwadl.home=${WADL_HOME}" \ - -jar ${WADL_HOME}/lib/wadl-cmdline-1.0-SNAPSHOT.jar \ - "$@" - diff --git a/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/bin/wadl2java.bat b/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/bin/wadl2java.bat deleted file mode 100644 index 42340dd17..000000000 --- a/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/bin/wadl2java.bat +++ /dev/null @@ -1,151 +0,0 @@ -@REM ---------------------------------------------------------------------------- -@REM The contents of this file are subject to the terms -@REM of the Common Development and Distribution License -@REM (the "License"). You may not use this file except -@REM in compliance with the License. -@REM -@REM You can obtain a copy of the license at -@REM http://www.opensource.org/licenses/cddl1.php -@REM See the License for the specific language governing -@REM permissions and limitations under the License. - -@REM ---------------------------------------------------------------------------- -@REM - -@REM ---------------------------------------------------------------------------- -@REM Wadl2java Start Up Batch script -@REM -@REM Required ENV vars: -@REM JAVA_HOME - location of a JDK home dir -@REM -@REM Optional ENV vars -@REM WADL_HOME - location of wadl's installed home dir -@REM WADL_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands -@REM WADL_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending -@REM WADL_OPTS - parameters passed to the Java VM when running Wadl2java -@REM e.g. to debug Wadl2java itself, use -@REM set WADL_OPTS=-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -@REM ---------------------------------------------------------------------------- - -@REM Begin all REM lines with '@' in case WADL_BATCH_ECHO is 'on' -@echo off -@REM enable echoing my setting WADL_BATCH_ECHO to 'on' -@if "%WADL_BATCH_ECHO%" == "on" echo %WADL_BATCH_ECHO% - -@REM Execute a user defined script before this one -if exist "%HOME%\wadlrc_pre.bat" call "%HOME%\wadlrc_pre.bat" - -set ERROR_CODE=0 - -@REM set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" @setlocal - -@REM ==== START VALIDATION ==== -if not "%JAVA_HOME%" == "" goto OkJHome - -echo. -echo ERROR: JAVA_HOME not found in your environment. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation -echo. -goto error - -:OkJHome -if exist "%JAVA_HOME%\bin\java.exe" goto chkMHome - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory. -echo JAVA_HOME = %JAVA_HOME% -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation -echo. -goto error - -:chkMHome -if not "%WADL_HOME%"=="" goto valMHome - -if "%OS%"=="Windows_NT" SET WADL_HOME=%~dp0\.. -if not "%WADL_HOME%"=="" goto valMHome - -echo. -echo ERROR: WADL_HOME not found in your environment. -echo Please set the WADL_HOME variable in your environment to match the -echo location of the Wadl2java installation -echo. -goto error - -:valMHome -if exist "%WADL_HOME%\bin\wadl2java.bat" goto init - -echo. -echo ERROR: WADL_HOME is set to an invalid directory. -echo WADL_HOME = %WADL_HOME% -echo Please set the WADL_HOME variable in your environment to match the -echo location of the Wadl installation -echo. -goto error -@REM ==== END VALIDATION ==== - -:init -@REM Decide how to startup depending on the version of windows - -@REM -- Win98ME -if NOT "%OS%"=="Windows_NT" goto Win9xArg - -@REM -- 4NT shell -if "%eval[2+2]" == "4" goto 4NTArgs - -@REM -- Regular WinNT shell -set WADL_CMD_LINE_ARGS=%* -goto endInit - -@REM The 4NT Shell from jp software -:4NTArgs -set WADL_CMD_LINE_ARGS=%$ -goto endInit - -:Win9xArg -@REM Slurp the command line arguments. This loop allows for an unlimited number -@REM of agruments (up to the command line limit, anyway). -set WADL_CMD_LINE_ARGS= -:Win9xApp -if %1a==a goto endInit -set WADL_CMD_LINE_ARGS=%WADL_CMD_LINE_ARGS% %1 -shift -goto Win9xApp - -@REM Reaching here means variables are defined and arguments have been captured -:endInit -SET WADL_JAVA_EXE="%JAVA_HOME%\bin\java.exe" - -@REM Start Wadl2java -%WADL_JAVA_EXE% %WADL_OPTS% "-Dwadl.home=%WADL_HOME%" -jar "%WADL_HOME%\lib\wadl-cmdline-1.1-SNAPSHOT.jar" %WADL_CMD_LINE_ARGS% -if ERRORLEVEL 1 goto error -goto end - -:error -if "%OS%"=="Windows_NT" @endlocal -set ERROR_CODE=1 - -:end -@REM set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" goto endNT - -@REM For old DOS remove the set variables from ENV - we assume they were not set -@REM before we started - at least we don't leave any baggage around -set WADL_JAVA_EXE= -set WADL_CMD_LINE_ARGS= -goto postExec - -:endNT -@endlocal - -:postExec -if exist "%HOME%\wadlrc_post.bat" call "%HOME%\wadlrc_post.bat" -@REM pause the batch file if WADL_BATCH_PAUSE is set to 'on' -if "%WADL_BATCH_PAUSE%" == "on" pause - -if "%WADL_TERMINATE_CMD%" == "on" exit %ERROR_CODE% - -exit /B %ERROR_CODE% - diff --git a/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/lib/activation-1.1.jar b/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/lib/activation-1.1.jar deleted file mode 100644 index 66d290ee4..000000000 Binary files a/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/lib/activation-1.1.jar and /dev/null differ diff --git a/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/lib/comresrcgen-1.0.jar b/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/lib/comresrcgen-1.0.jar deleted file mode 100644 index 6caf827d5..000000000 Binary files a/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/lib/comresrcgen-1.0.jar and /dev/null differ diff --git a/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/lib/jaxb-api-2.1.jar b/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/lib/jaxb-api-2.1.jar deleted file mode 100644 index 5752f1946..000000000 Binary files a/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/lib/jaxb-api-2.1.jar and /dev/null differ diff --git a/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/lib/jaxb-impl-2.1.jar b/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/lib/jaxb-impl-2.1.jar deleted file mode 100644 index f3341e54f..000000000 Binary files a/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/lib/jaxb-impl-2.1.jar and /dev/null differ diff --git a/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/lib/jaxb-xjc-2.1.jar b/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/lib/jaxb-xjc-2.1.jar deleted file mode 100644 index cbc841a17..000000000 Binary files a/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/lib/jaxb-xjc-2.1.jar and /dev/null differ diff --git a/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/lib/localizer-1.0.jar b/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/lib/localizer-1.0.jar deleted file mode 100644 index 07ec93767..000000000 Binary files a/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/lib/localizer-1.0.jar and /dev/null differ diff --git a/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/lib/stax-api-1.0-2.jar b/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/lib/stax-api-1.0-2.jar deleted file mode 100644 index 015169dc7..000000000 Binary files a/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/lib/stax-api-1.0-2.jar and /dev/null differ diff --git a/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/lib/wadl-ant-1.1-SNAPSHOT.jar b/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/lib/wadl-ant-1.1-SNAPSHOT.jar deleted file mode 100644 index 97e25e141..000000000 Binary files a/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/lib/wadl-ant-1.1-SNAPSHOT.jar and /dev/null differ diff --git a/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/lib/wadl-cmdline-1.1-SNAPSHOT.jar b/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/lib/wadl-cmdline-1.1-SNAPSHOT.jar deleted file mode 100644 index 6e512a335..000000000 Binary files a/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/lib/wadl-cmdline-1.1-SNAPSHOT.jar and /dev/null differ diff --git a/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/lib/wadl-core-1.1-SNAPSHOT.jar b/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/lib/wadl-core-1.1-SNAPSHOT.jar deleted file mode 100644 index eac1b00b0..000000000 Binary files a/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/lib/wadl-core-1.1-SNAPSHOT.jar and /dev/null differ diff --git a/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/samples/README.html b/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/samples/README.html deleted file mode 100644 index 4489a6a6e..000000000 --- a/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/samples/README.html +++ /dev/null @@ -1,41 +0,0 @@ - - - README - - -

    README

    -

    - Each of the examples in this directory documents a way to - convert a WADL file to a collection of Java sources. -

    -
    -
    ./ant
    -
    - Convert a WADL file to Java sources using the Ant task. -
    -
    -
    -
    ./maven
    -
    - Convert a WADL file to Java sources using the Maven 2 - plugin. Note that the plugin will actually be downloaded from - the Maven repository. The plugin itself is not shipping as - part of this distribution. -
    -
    -
    -
    ./cmdline
    -
    - Convert a WADL file to Java sources using the commandline tool - found in the bin directory in this distribution. -
    -
    -
    -
    ./shared
    -
    - The WADL file and schemas used as input in each of these - examples. -
    -
    - - \ No newline at end of file diff --git a/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/samples/README.txt b/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/samples/README.txt deleted file mode 100644 index f5d164183..000000000 --- a/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/samples/README.txt +++ /dev/null @@ -1,20 +0,0 @@ -README - - Each of the examples in this directory documents a way to convert a WADL - file to a collection of Java sources. - - ./ant - Convert a WADL file to Java sources using the Ant task. - - ./maven - Convert a WADL file to Java sources using the Maven 2 plugin. Note - that the plugin will actually be downloaded from the Maven - repository. The plugin itself is not shipping as part of this - distribution. - - ./cmdline - Convert a WADL file to Java sources using the commandline tool - found in the bin directory in this distribution. - - ./shared - The WADL file and schemas used as input in each of these examples. diff --git a/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/samples/ant/build.xml b/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/samples/ant/build.xml deleted file mode 100644 index b198849f3..000000000 --- a/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/samples/ant/build.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - Builds stubs for accessing Yahoo Search service. - - - - - - - - - - - - - - - - - - - diff --git a/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/samples/cmdline/run b/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/samples/cmdline/run deleted file mode 100644 index f75756fc6..000000000 --- a/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/samples/cmdline/run +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -# -# An example showing how to use the commandline tools included in this -# package. -# - -mkdir -p ./gen-src - -../../bin/wadl2java \ - -o ./gen-src \ - -p com.yahoo.search \ - -c ../share/binding.xjb \ - ../share/YahooSearch.wadl diff --git a/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/samples/cmdline/run.cmd b/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/samples/cmdline/run.cmd deleted file mode 100644 index 77c66a0f6..000000000 --- a/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/samples/cmdline/run.cmd +++ /dev/null @@ -1,8 +0,0 @@ -# -# An example showing how to use the commandline tools included in this -# package. -# - -mkdir .\gen-src - -..\..\bin\wadl2java.bat -o ./gen-src -p com.yahoo.search -c ../share/binding.xjb ../share/YahooSearch.wadl diff --git a/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/samples/maven/pom.xml b/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/samples/maven/pom.xml deleted file mode 100644 index 8356ee11f..000000000 --- a/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/samples/maven/pom.xml +++ /dev/null @@ -1,83 +0,0 @@ - - - 4.0.0 - com.yahoo.search - search-api - 1.1-SNAPSHOT - Yahoo Search API - - - wadl-repository - WADL Maven Repository - https://wadl.dev.java.net/nonav/repository/ - - - maven2-repository.dev.java.net - Java.net Repository for Maven - http://download.java.net/maven/2/ - - - wadl-snapshots - WADL Snapshots Repository - https://wadl.dev.java.net/nonav/snapshots - - true - - - false - - - - - - wadl-snapshots - WADL Snapshots Repository - https://wadl.dev.java.net/nonav/snapshots - - true - - - false - - - - - - org.jvnet.ws.wadl - wadl-core - 1.1-SNAPSHOT - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.5 - 1.5 - - - - org.jvnet.ws.wadl - wadl-maven-plugin - 1.1-SNAPSHOT - - - - generate - - - - - ../share - com.yahoo.search - true - - ../share/binding.xjb - - - - - - \ No newline at end of file diff --git a/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/samples/share/NewsSearchError.xsd b/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/samples/share/NewsSearchError.xsd deleted file mode 100644 index b7ce5c99c..000000000 --- a/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/samples/share/NewsSearchError.xsd +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/samples/share/NewsSearchResponse.xsd b/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/samples/share/NewsSearchResponse.xsd deleted file mode 100644 index 20052fda1..000000000 --- a/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/samples/share/NewsSearchResponse.xsd +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/samples/share/YahooSearch.wadl b/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/samples/share/YahooSearch.wadl deleted file mode 100644 index 5494d7f0f..000000000 --- a/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/samples/share/YahooSearch.wadl +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - - - - - - - The Yahoo News Search service provides online searching of news - stories from around the world. - - - The application ID. See Application IDs for more information. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/samples/share/binding.xjb b/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/samples/share/binding.xjb deleted file mode 100644 index 567e50d76..000000000 --- a/sandbox/richard/wadl/wadl-dist-1.1-SNAPSHOT-bin/wadl-dist-1.1-SNAPSHOT/samples/share/binding.xjb +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/sandbox/sanjay/nuxeo/ConnectionListener.java b/sandbox/sanjay/nuxeo/ConnectionListener.java deleted file mode 100644 index 080cfef50..000000000 --- a/sandbox/sanjay/nuxeo/ConnectionListener.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * (C) Copyright 2006-2007 Nuxeo SAS (http://nuxeo.com/) and contributors. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the GNU Lesser General Public License - * (LGPL) version 2.1 which accompanies this distribution, and is available at - * http://www.gnu.org/licenses/lgpl.html - * - * 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. - * - * Contributors: - * bstefanescu - * - * $Id$ - */ - -package org.collectionspace.services.nuxeo; - -/** - * Listen to connection events - * - * @author Bogdan Stefanescu - * - */ -public interface ConnectionListener { - - /** - * The client connected to a server. - * - * @param client the client - */ - void connected(NuxeoClient client); - - /** - * The client disconnected. - * - * @param client the client - */ - void disconnected(NuxeoClient client); - - /** - * The client authentication failed against the remote server. - * - * @param client the client - */ - boolean authenticationFailed(NuxeoClient client); - -} diff --git a/sandbox/sanjay/nuxeo/DefaultLoginHandler.java b/sandbox/sanjay/nuxeo/DefaultLoginHandler.java deleted file mode 100644 index 2b1331132..000000000 --- a/sandbox/sanjay/nuxeo/DefaultLoginHandler.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * (C) Copyright 2006-2007 Nuxeo SAS (http://nuxeo.com/) and contributors. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the GNU Lesser General Public License - * (LGPL) version 2.1 which accompanies this distribution, and is available at - * http://www.gnu.org/licenses/lgpl.html - * - * 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. - * - * Contributors: - * bstefanescu - * - * $Id$ - */ - -package org.collectionspace.services.nuxeo; - -import javax.security.auth.login.LoginContext; -import javax.security.auth.login.LoginException; - -import org.nuxeo.runtime.api.Framework; - -/** - * @author Bogdan Stefanescu - * - */ -public class DefaultLoginHandler implements LoginHandler { - - private LoginContext lc; - - private String username; - private char[] password; - - public DefaultLoginHandler() { - } - - public DefaultLoginHandler(String username, String password) { - this(username, password.toCharArray()); - } - - public DefaultLoginHandler(String username, char[] password) { - this.username = username; - this.password = password; - } - - public void setUsername(String username) { - this.username = username; - } - - public void setPassword(char[] password) { - this.password = password; - } - - public void setPassword(String password) { - this.password = password.toCharArray(); - } - - public char[] getPassword() { - return password; - } - - public String getUsername() { - return username; - } - - public synchronized LoginContext getLoginContext() { - return lc; - } - - public synchronized LoginContext login() throws LoginException { - if (username == null) { - lc = Framework.login(); - } else { - lc = Framework.login(username, password); - } - return lc; - } - - public synchronized void logout() throws LoginException { - if (lc != null) { - lc.logout(); - } - } - - public synchronized void retryLogin() throws LoginException { - if (lc != null) { - lc.logout(); - } - login(); - } - -} diff --git a/sandbox/sanjay/nuxeo/LoginHandler.java b/sandbox/sanjay/nuxeo/LoginHandler.java deleted file mode 100644 index 57cb85332..000000000 --- a/sandbox/sanjay/nuxeo/LoginHandler.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * (C) Copyright 2006-2007 Nuxeo SAS (http://nuxeo.com/) and contributors. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the GNU Lesser General Public License - * (LGPL) version 2.1 which accompanies this distribution, and is available at - * http://www.gnu.org/licenses/lgpl.html - * - * 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. - * - * Contributors: - * bstefanescu - * - * $Id$ - */ - -package org.collectionspace.services.nuxeo; - -import javax.security.auth.login.LoginContext; -import javax.security.auth.login.LoginException; - -/** - * Manages user login and current user session. - * - * @author Bogdan Stefanescu - */ -public interface LoginHandler { - - LoginContext login() throws LoginException; - - void logout() throws LoginException; - - LoginContext getLoginContext(); - - void retryLogin() throws LoginException; - -} diff --git a/sandbox/sanjay/nuxeo/NuxeoApp.java b/sandbox/sanjay/nuxeo/NuxeoApp.java deleted file mode 100644 index 6295b8217..000000000 --- a/sandbox/sanjay/nuxeo/NuxeoApp.java +++ /dev/null @@ -1,176 +0,0 @@ -/* - * (C) Copyright 2006-2008 Nuxeo SAS (http://nuxeo.com/) and contributors. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the GNU Lesser General Public License - * (LGPL) version 2.1 which accompanies this distribution, and is available at - * http://www.gnu.org/licenses/lgpl.html - * - * 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. - * - * Contributors: - * bstefanescu - */ -package org.collectionspace.services.nuxeo; - -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.StringTokenizer; - -import org.nuxeo.common.Environment; -import org.nuxeo.osgi.BundleFile; -import org.nuxeo.osgi.BundleImpl; -import org.nuxeo.osgi.DirectoryBundleFile; -import org.nuxeo.osgi.JarBundleFile; -import org.nuxeo.osgi.OSGiAdapter; -import org.osgi.framework.BundleException; - -/** - * Nuxeo Runtime launcher. - * - * This launcher assume all bundles are already on the classpath. - * - * - * @author Bogdan Stefanescu - * - */ -public class NuxeoApp { - - protected OSGiAdapter osgi; - protected final ClassLoader loader; - protected final Environment env; - - public static ClassLoader getDefaultClassLoader() { - ClassLoader cl = Thread.currentThread().getContextClassLoader(); - return cl == null ? NuxeoApp.class.getClassLoader() : cl; - } - - public NuxeoApp() { - this (new File("."), getDefaultClassLoader()); - } - - public NuxeoApp(File home) { - this (home, getDefaultClassLoader()); - } - - public NuxeoApp(File home, ClassLoader loader) { - this.loader = loader; - env = new Environment(home); - } - - public Environment getEnvironment() { - return this.env; - } - - public synchronized void deployBundles(Collection files) throws BundleException, IOException { - if (!isStarted()) { - throw new IllegalStateException("Framework not started"); - } - for (File file : files) { - deployBundle(file); - } - } - - public synchronized void deployBundle(File file) throws BundleException, IOException { - if (!isStarted()) { - throw new IllegalStateException("Framework not started"); - } - BundleFile bf = file.isDirectory() ? new DirectoryBundleFile(file) : new JarBundleFile(file); - osgi.install(new BundleImpl(osgi, bf, loader)); - System.out.println(">>>NuxeoApp:deployed bundle: " + file.getName()); - } - - public synchronized void start() { - if (osgi != null) { - //throw new IllegalStateException("Nuxeo Runtime already started"); - //sd: why throw exception? - return; - } - osgi = new OSGiAdapter(env.getHome(), env.getData(), env.getProperties()); - } - - public synchronized boolean isStarted() { - return osgi != null; - } - - public synchronized OSGiAdapter getOsgi() { - return osgi; - } - - - public synchronized void shutdown() throws IOException { - if (osgi == null) { - throw new IllegalStateException("Nuxeo Runtime not started"); - } - osgi.shutdown(); - osgi = null; - } - - public static Collection getBundleFiles(File baseDir, String bundles, String delim) throws IOException { - LinkedHashSet result = new LinkedHashSet(); - StringTokenizer tokenizer = new StringTokenizer(bundles, delim == null ? " \t\n\r\f" : delim); - while (tokenizer.hasMoreTokens()) { - String tok = tokenizer.nextToken(); - List files = expandFiles(baseDir, tok); - for (File file : files) { - result.add(file.getCanonicalFile()); - } - } - return result; - } - - public static List expandFiles(File baseDir, String line) { - int p = line.lastIndexOf("/"); - String fileName = null; - if (p > -1) { - fileName = line.substring(p+1); - baseDir = new File(baseDir, line.substring(0, p)); - } else { - fileName = line; - } - p = fileName.indexOf("*"); - if (p == -1) { - return Collections.singletonList(new File(baseDir, fileName)); - } else if (fileName.length() == 0) { - return Arrays.asList(baseDir.listFiles()); - } else if (p == 0) { - String suffix= fileName.substring(p+1); - ArrayList result = new ArrayList(); - for (String name : baseDir.list()) { - if (name.endsWith(suffix)) { - result.add(new File(baseDir, name)); - } - } - return result; - } else if (p == fileName.length()-1) { - String prefix= fileName.substring(0, p); - ArrayList result = new ArrayList(); - for (String name : baseDir.list()) { - if (name.startsWith(prefix)) { - result.add(new File(baseDir, name)); - } - } - return result; - } else { - String prefix= fileName.substring(0, p); - String suffix= fileName.substring(p+1); - ArrayList result = new ArrayList(); - for (String name : baseDir.list()) { - if (name.startsWith(prefix) && name.endsWith(suffix)) { - result.add(new File(baseDir, name)); - } - } - return result; - } - } - -} diff --git a/sandbox/sanjay/nuxeo/NuxeoClient.java b/sandbox/sanjay/nuxeo/NuxeoClient.java deleted file mode 100644 index c2458b926..000000000 --- a/sandbox/sanjay/nuxeo/NuxeoClient.java +++ /dev/null @@ -1,409 +0,0 @@ -/* - * (C) Copyright 2006-2007 Nuxeo SAS (http://nuxeo.com/) and contributors. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the GNU Lesser General Public License - * (LGPL) version 2.1 which accompanies this distribution, and is available at - * http://www.gnu.org/licenses/lgpl.html - * - * 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. - * - * Contributors: - * bstefanescu - * - * $Id$ - */ -package org.collectionspace.services.nuxeo; - -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Vector; - -import javax.security.auth.login.AppConfigurationEntry; -import javax.security.auth.login.LoginException; - -import org.jboss.remoting.InvokerLocator; -import org.nuxeo.common.collections.ListenerList; -import org.nuxeo.ecm.core.api.repository.Repository; -import org.nuxeo.ecm.core.api.repository.RepositoryInstance; -import org.nuxeo.ecm.core.api.repository.RepositoryInstanceHandler; -import org.nuxeo.ecm.core.api.repository.RepositoryManager; -import org.nuxeo.ecm.core.schema.SchemaManager; -import org.nuxeo.ecm.core.schema.SchemaManagerImpl; -import org.nuxeo.ecm.core.schema.TypeProvider; -import org.nuxeo.runtime.api.Framework; -import org.nuxeo.runtime.api.ServiceDescriptor; -import org.nuxeo.runtime.api.ServiceManager; -import org.nuxeo.runtime.api.login.LoginComponent; -import org.nuxeo.runtime.api.login.LoginService; -import org.nuxeo.runtime.api.login.SecurityDomain; -import org.nuxeo.runtime.config.AutoConfigurationService; -import org.nuxeo.runtime.remoting.RemotingService; -import org.nuxeo.runtime.services.streaming.StreamingService; - -/** - * @author Bogdan Stefanescu - * - */ -public final class NuxeoClient { - - private LoginHandler loginHandler; - private final List repositoryInstances; - private final ListenerList connectionListeners; - private InvokerLocator locator; - private String serverName; - private final AutoConfigurationService cfg; - private RepositoryManager repositoryMgr; - private boolean multiThreadedLogin = false; - private static final NuxeoClient instance = new NuxeoClient(); - - private NuxeoClient() { - connectionListeners = new ListenerList(); - cfg = new AutoConfigurationService(); - loginHandler = loginHandler == null ? new DefaultLoginHandler() : loginHandler; - repositoryInstances = new Vector(); - } - - public static NuxeoClient getInstance() { - return instance; - } - - public void setMultiThreadedLogin(boolean useMultiThreadedLogin) { - multiThreadedLogin = useMultiThreadedLogin; - } - - public boolean getMultiThreadedLogin() { - return multiThreadedLogin; - } - - public synchronized void connect(String locator) throws Exception { - if(this.locator != null){ - throw new IllegalStateException("Client is already connected"); - } - doConnect(AutoConfigurationService.createLocator(locator)); - } - - public synchronized void connect(InvokerLocator locator) throws Exception { - if(this.locator != null){ - throw new IllegalStateException("Client is already connected"); - } - doConnect(locator); - } - - public synchronized void connect(String host, int port) throws Exception { - if(locator != null){ - throw new IllegalStateException("Client is already connected"); - } - doConnect(AutoConfigurationService.createLocator(host, port)); - } - - public synchronized void forceConnect(InvokerLocator locator) throws Exception { - if(this.locator != null){ - disconnect(); - } - doConnect(locator); - } - - public synchronized void forceConnect(String locator) throws Exception { - if(this.locator != null){ - disconnect(); - } - doConnect(AutoConfigurationService.createLocator(locator)); - } - - public synchronized void forceConnect(String host, int port) throws Exception { - if(locator != null){ - disconnect(); - } - doConnect(AutoConfigurationService.createLocator(host, port)); - } - - public synchronized void tryConnect(String host, int port) throws Exception { - if(locator != null){ - return; // do nothing - } - doConnect(AutoConfigurationService.createLocator(host, port)); - } - - public synchronized void tryConnect(String url) throws Exception { - if(locator != null){ - return; // do nothing - } - doConnect(AutoConfigurationService.createLocator(url)); - } - - public synchronized void tryConnect(InvokerLocator locator) throws Exception { - if(this.locator != null){ - return; // do nothing - } - doConnect(locator); - } - - private void doConnect(InvokerLocator locator) throws Exception { - this.locator = locator; - try{ - cfg.load(locator); - // FIXME TODO workaround to work with nxruntime core 1.3.3 -------------- - String newPort = Framework.getProperty("org.nuxeo.runtime.1.3.3.streaming.port"); - System.out.println(">>>NuxeoClient:newPort=" + newPort);//sd - if(newPort != null){ - StreamingService streamingService = (StreamingService) Framework.getRuntime().getComponent( - StreamingService.NAME); - // streaming config - String oldLocator = streamingService.getServerLocator(); - int p = oldLocator.lastIndexOf(':'); - if(p > -1){ - String withoutPort = oldLocator.substring(0, p); - String serverLocator = withoutPort + ":" + newPort; - streamingService.stopManager(); - streamingService.setServerLocator(serverLocator); - streamingService.setServer(false); - streamingService.startManager(); - } - } - System.out.println(">>>NuxeoClient:pre schemaRemotingWorkaround");//sd - // FIXME TODO workaround for remote services ------------------------------- - schemaRemotingWorkaround(locator.getHost()); - System.out.println(">>>NuxeoClient:post schemaRemotingWorkaround");//sd - - - // workaround for client login configuration - we need to make it not multi threaded - // TODO put an option for this in NuxeoClient - if(!multiThreadedLogin){ - LoginService ls = Framework.getService(LoginService.class); - SecurityDomain sysDomain = ls.getSecurityDomain(LoginComponent.SYSTEM_LOGIN); - SecurityDomain clientDomain = ls.getSecurityDomain(LoginComponent.CLIENT_LOGIN); - adaptClientSecurityDomain(sysDomain); - adaptClientSecurityDomain(clientDomain); - } - // ---------------- - login(); - System.out.println("NuxeoClient: login"); - }catch(Exception e){ - this.locator = null; - throw e; - } - fireConnected(this); - } - - public static void adaptClientSecurityDomain(SecurityDomain sd) { - AppConfigurationEntry[] entries = sd.getAppConfigurationEntries(); - if(entries != null){ - for(int i = 0; i < entries.length; i++){ - AppConfigurationEntry entry = entries[i]; - if("org.jboss.security.ClientLoginModule".equals(entry.getLoginModuleName())){ - Map opts = entry.getOptions(); - Map newOpts = new HashMap(opts); - newOpts.put("multi-threaded", "false"); - entries[i] = new AppConfigurationEntry(entry.getLoginModuleName(), - entry.getControlFlag(), entry.getOptions()); - } - } - } - } - - /** - * Workaround for being able to load schemas from remote - * TODO integrate this in core - * FIXME integrate this in core - */ - private static void schemaRemotingWorkaround(String host) throws Exception { - ServiceManager serviceManager = Framework.getLocalService(ServiceManager.class); - ServiceDescriptor sd = new ServiceDescriptor(TypeProvider.class, "core"); - sd.setLocator("%TypeProviderBean"); - serviceManager.registerService(sd); - TypeProvider typeProvider = Framework.getService(TypeProvider.class); - SchemaManager schemaMgr = Framework.getLocalService(SchemaManager.class); - ((SchemaManagerImpl) schemaMgr).importTypes(typeProvider); - } - - public synchronized void disconnect() throws Exception { - if(locator == null){ - throw new IllegalStateException("Client is not connected"); - } - doDisconnect(); - } - - public synchronized void tryDisconnect() throws Exception { - if(locator == null){ - return; // do nothing - } - doDisconnect(); - } - - private void doDisconnect() throws Exception { - locator = null; - serverName = null; - // close repository sessions if any - Iterator it = repositoryInstances.iterator(); - while(it.hasNext()){ - RepositoryInstance repo = it.next(); - try{ - repo.close(); - }catch(Exception e){ - e.printStackTrace(); - } - it.remove(); - } - // logout - logout(); - repositoryMgr = null; - fireDisconnected(this); - } - - public synchronized void reconnect() throws Exception { - if(locator == null){ - throw new IllegalStateException("Client is not connected"); - } - InvokerLocator locator = this.locator; - disconnect(); - connect(locator); - } - - public AutoConfigurationService getConfigurationService() { - return cfg; - } - - public synchronized String getServerName() { - if(locator == null){ - throw new IllegalStateException("Client is not connected"); - } - if(serverName == null){ - if(cfg == null){ // compatibility - serverName = RemotingService.ping(locator.getHost(), locator.getPort()); - }else{ - serverName = cfg.getServerConfiguration().getProductInfo(); - } - } - return serverName; - } - - public synchronized boolean isConnected() { - return locator != null; - } - - public String getServerHost() { - if(locator == null){ - throw new IllegalStateException("Client is not connected"); - } - return locator.getHost(); - } - - public int getServerPort() { - if(locator == null){ - throw new IllegalStateException("Client is not connected"); - } - return locator.getPort(); - } - - public InvokerLocator getLocator() { - return locator; - } - - public synchronized LoginHandler getLoginHandler() { - return loginHandler; - } - - public synchronized void setLoginHandler(LoginHandler loginHandler) { - this.loginHandler = loginHandler; - } - - public synchronized void login() throws LoginException { - if(loginHandler != null){ - loginHandler.login(); - } - } - - public synchronized void logout() throws LoginException { - if(loginHandler != null){ - loginHandler.logout(); - } - } - - public RepositoryManager getRepositoryManager() throws Exception { - if(repositoryMgr == null){ - repositoryMgr = Framework.getService(RepositoryManager.class); - } - return repositoryMgr; - } - - /** - * Gets the repositories available on the connected server. - * - * @return the repositories - */ - public Repository[] getRepositories() throws Exception { - Collection repos = getRepositoryManager().getRepositories(); - return repos.toArray(new Repository[repos.size()]); - } - - public Repository getDefaultRepository() throws Exception { - return getRepositoryManager().getDefaultRepository(); - } - - public Repository getRepository(String name) throws Exception { - return getRepositoryManager().getRepository(name); - } - - public RepositoryInstance openRepository() throws Exception { - Repository repository = getRepositoryManager().getDefaultRepository(); - RepositoryInstance repo = newRepositoryInstance(repository); - repositoryInstances.add(repo); - return repo; - } - - public RepositoryInstance openRepository(String name) throws Exception { - Repository repository = getRepositoryManager().getRepository(name); - RepositoryInstance repo = newRepositoryInstance(repository); - repositoryInstances.add(repo); - return repo; - } - - public void releaseRepository(RepositoryInstance repo) throws Exception { - try{ - repo.close(); - }finally{ - repositoryInstances.remove(repo); - } - } - - public RepositoryInstance[] getRepositoryInstances() { - return repositoryInstances.toArray(new RepositoryInstance[repositoryInstances.size()]); - } - - public static RepositoryInstance newRepositoryInstance(Repository repository) { - ClassLoader cl = Thread.currentThread().getContextClassLoader(); - if(cl == null){ - cl = NuxeoClient.class.getClassLoader(); - } - return new RepositoryInstanceHandler(repository).getProxy(); - } - - public void addConnectionListener(ConnectionListener listener) { - connectionListeners.add(listener); - } - - public void removeConnectionListener(ConnectionListener listener) { - connectionListeners.remove(listener); - } - - private void fireDisconnected(NuxeoClient client) { - Object[] listeners = connectionListeners.getListeners(); - for(Object listener : listeners){ - ((ConnectionListener) listener).disconnected(client); - } - } - - private void fireConnected(NuxeoClient client) { - Object[] listeners = connectionListeners.getListeners(); - for(Object listener : listeners){ - ((ConnectionListener) listener).connected(client); - } - } -} diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/3rdparty/nuxeo/jaxrs-nuxeo-cs/build.properties b/sandbox/sanjay/prototypes/jaxrs-prototype/3rdparty/nuxeo/jaxrs-nuxeo-cs/build.properties deleted file mode 100644 index c26799aa9..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/3rdparty/nuxeo/jaxrs-nuxeo-cs/build.properties +++ /dev/null @@ -1,15 +0,0 @@ -# Example for Windows -jboss.dir=c:/dev/jboss-4.2.3.GA -# Example for Unix -#jboss.dir=/opt/jboss - -# Which JBoss server config to use -jboss.config=default - -# nuxeo deployment -jboss.nuxeo.ear.dir=${jboss.dir}/server/${jboss.config}/deploy/nuxeo.ear - - -# additional command line parameters for mvn commands -# e.g. to work offline: -#mvn.opts=-o diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/3rdparty/nuxeo/jaxrs-nuxeo-cs/build.xml b/sandbox/sanjay/prototypes/jaxrs-prototype/3rdparty/nuxeo/jaxrs-nuxeo-cs/build.xml deleted file mode 100644 index 3f7bf4139..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/3rdparty/nuxeo/jaxrs-nuxeo-cs/build.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/3rdparty/nuxeo/jaxrs-nuxeo-cs/pom.xml b/sandbox/sanjay/prototypes/jaxrs-prototype/3rdparty/nuxeo/jaxrs-nuxeo-cs/pom.xml deleted file mode 100644 index 2c25c0bac..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/3rdparty/nuxeo/jaxrs-nuxeo-cs/pom.xml +++ /dev/null @@ -1,30 +0,0 @@ - - 4.0.0 - - - org.nuxeo.ecm.platform - nuxeo-platform-parent - 5.2-SNAPSHOT - - - nuxeo-platform-cs - jar - jaxrs-nuxeo extensions - - Nuxeo Enterprise Platform: jaxrs-nuxeo extensions - - - - - org.nuxeo.ecm.core - nuxeo-core-schema - - - org.nuxeo.ecm.platform - nuxeo-platform-types-core - - - - diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/3rdparty/nuxeo/jaxrs-nuxeo-cs/src/main/resources/META-INF/MANIFEST.MF b/sandbox/sanjay/prototypes/jaxrs-prototype/3rdparty/nuxeo/jaxrs-nuxeo-cs/src/main/resources/META-INF/MANIFEST.MF deleted file mode 100644 index ab71dc50b..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/3rdparty/nuxeo/jaxrs-nuxeo-cs/src/main/resources/META-INF/MANIFEST.MF +++ /dev/null @@ -1,22 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 1 -Bundle-Name: NuxeoCS -Bundle-SymbolicName: org.collectionspace.hello;singleton:=true -Bundle-Version: 1.0.0 -Bundle-Localization: plugin -Bundle-Vendor: Nuxeo -Require-Bundle: org.nuxeo.runtime, - org.nuxeo.ecm.core.api, - org.nuxeo.ecm.core, - org.nuxeo.ecm.core.api, - org.nuxeo.ecm.platform.types.api, - org.nuxeo.ecm.platform.versioning.api, - org.nuxeo.ecm.platform.ui, - org.nuxeo.ecm.platform.forms.layout.client, - org.nuxeo.ecm.platform.publishing.api, - org.nuxeo.ecm.platform.ws -Provide-Package: org.collectionspace.hello -Nuxeo-Component: OSGI-INF/core-types-contrib.xml, - OSGI-INF/ecm-types-contrib.xml, - OSGI-INF/layouts-contrib.xml - diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/3rdparty/nuxeo/jaxrs-nuxeo-cs/src/main/resources/OSGI-INF/core-types-contrib.xml b/sandbox/sanjay/prototypes/jaxrs-prototype/3rdparty/nuxeo/jaxrs-nuxeo-cs/src/main/resources/OSGI-INF/core-types-contrib.xml deleted file mode 100644 index 7be6addb0..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/3rdparty/nuxeo/jaxrs-nuxeo-cs/src/main/resources/OSGI-INF/core-types-contrib.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/3rdparty/nuxeo/jaxrs-nuxeo-cs/src/main/resources/OSGI-INF/deployment-fragment.xml b/sandbox/sanjay/prototypes/jaxrs-prototype/3rdparty/nuxeo/jaxrs-nuxeo-cs/src/main/resources/OSGI-INF/deployment-fragment.xml deleted file mode 100644 index 88b94ffd1..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/3rdparty/nuxeo/jaxrs-nuxeo-cs/src/main/resources/OSGI-INF/deployment-fragment.xml +++ /dev/null @@ -1,408 +0,0 @@ - - - - - - ${bundle.fileName} - - - - - nuxeo.war - /nuxeo - - - - - - - - - - - - Seam Context Filter - /ws/FileManageWS - - - - Seam Context Filter - /DocumentManagerWS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #{currentServerLocation.name}/#{currentTabAction.label} - - - - Create new document in #{currentDocument.name} - - - - Create new document in #{currentDocument.name} - - - - breadcrumb=command.user_dashboard - - - - breadcrumb=command.manageMembers - - - - breadcrumb=command.manageMembers - - - - breadcrumb=title.vocabularies - - - - breadcrumb=command.advancedSearch - - - - - - en - en_GB - en_US - fr - de - es - it - ar - ru - ja - vn - - - messages - - - - config/addWorkspace.jpdl.xml - - - - - - generic_error_page - /generic_error_page.xhtml - - - - - generic_message_page - /generic_message_page.xhtml - - - - - home - /nxstartup.xhtml - - - - - user_login - /login.xhtml - - - - - user_logout - /logout.xhtml - - - - - view_servers - /view_servers.xhtml - - - - - - - view_domains - /view_domains.xhtml - - - - - select_document_type - /select_document_type.xhtml - - - - - create_document - /create_document.xhtml - - - - - edit_document - /edit_document.xhtml - - - - - view_documents - /view_documents.xhtml - - - - - create_file - /create_file.xhtml - - - - - create_workspace_wizard - /createWorkspaceWizard.xhtml - - - - - send_email - /document_email.xhtml - - - - - - view_workspaces - /view_workspaces.xhtml - - - - - - create_domain - /create_domain.xhtml - - - - - - edit_domain - /edit_domain.xhtml - - - - - - create_workspace - /create_workspace.xhtml - - - - - - edit_workspace - /edit_workspace.xhtml - - - - - - - members_management - /members_management.xhtml - - - - - view_users - /view_users.xhtml - - - - - view_many_users - /view_many_users.xhtml - - - - - edit_user - /edit_user.xhtml - - - - - edit_user_password - /edit_user_password.xhtml - - - - - view_user - /view_user.xhtml - - - - - create_user - /create_user.xhtml - - - - - view_groups - /view_groups.xhtml - - - - - view_group - /view_group.xhtml - - - - - edit_group - /edit_group.xhtml - - - - - create_group - /create_group.xhtml - - - - - view_vocabularies - /view_vocabularies.xhtml - - - - - view_vocabulary - /view_vocabulary.xhtml - - - - - - - search_form - /search/search_form.xhtml - - - - - search_results_nxql - /search/search_results_nxql.xhtml - - - - - search_results_advanced - - /search/search_results_advanced.xhtml - - - - - - search_results_simple - /search/search_results_simple.xhtml - - - - - - - clipboard - /incl/clipboard.xhtml - - - - - user_dashboard - /user_dashboard.xhtml - - - - - select_workspace_template - /select_workspace_template.xhtml - - - - - pdf_generation_error - /pdf_generation_error.xhtml - - - - - mass_edit - /massedit_documents.xhtml - - - - - mass_edit_confirm - /massedit_documents_preview.xhtml - - - - - - diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/3rdparty/nuxeo/jaxrs-nuxeo-cs/src/main/resources/OSGI-INF/ecm-types-contrib.xml b/sandbox/sanjay/prototypes/jaxrs-prototype/3rdparty/nuxeo/jaxrs-nuxeo-cs/src/main/resources/OSGI-INF/ecm-types-contrib.xml deleted file mode 100644 index 02347959a..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/3rdparty/nuxeo/jaxrs-nuxeo-cs/src/main/resources/OSGI-INF/ecm-types-contrib.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - view_documents - - - heading - hello - - - - - - Hello - - - - - Hello - - - - - diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/3rdparty/nuxeo/jaxrs-nuxeo-cs/src/main/resources/OSGI-INF/layouts-contrib.xml b/sandbox/sanjay/prototypes/jaxrs-prototype/3rdparty/nuxeo/jaxrs-nuxeo-cs/src/main/resources/OSGI-INF/layouts-contrib.xml deleted file mode 100644 index 3cf9ff7cd..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/3rdparty/nuxeo/jaxrs-nuxeo-cs/src/main/resources/OSGI-INF/layouts-contrib.xml +++ /dev/null @@ -1,155 +0,0 @@ - - - - - - - - - - - - cid - cversion - firstname - lastname - street - city - state - zip - country - - - - - - true - - cid - - - - hidden - - - - true - - - - cssClass - - - - - - - true - - cversion - - - dataInputText - - - - - - - - - true - - firstName - - - dataInputText - - - - - - - - true - - lastName - - - dataInputText - - - - - - - - true - - street - - - dataInputText - - - - - - - - true - - city - - - dataInputText - - - - - - - - true - - state - - - dataInputText - - - - - - - - true - - zip - - - dataInputText - - - - - - - - true - - country - - - dataInputText - - - - - - - - - - diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/3rdparty/nuxeo/jaxrs-nuxeo-cs/src/main/resources/schemas/hello.xsd b/sandbox/sanjay/prototypes/jaxrs-prototype/3rdparty/nuxeo/jaxrs-nuxeo-cs/src/main/resources/schemas/hello.xsd deleted file mode 100644 index df2ec990f..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/3rdparty/nuxeo/jaxrs-nuxeo-cs/src/main/resources/schemas/hello.xsd +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/3rdparty/nuxeo/jaxrs-nuxeo-cs/target/classes/META-INF/MANIFEST.MF b/sandbox/sanjay/prototypes/jaxrs-prototype/3rdparty/nuxeo/jaxrs-nuxeo-cs/target/classes/META-INF/MANIFEST.MF deleted file mode 100644 index ab71dc50b..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/3rdparty/nuxeo/jaxrs-nuxeo-cs/target/classes/META-INF/MANIFEST.MF +++ /dev/null @@ -1,22 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 1 -Bundle-Name: NuxeoCS -Bundle-SymbolicName: org.collectionspace.hello;singleton:=true -Bundle-Version: 1.0.0 -Bundle-Localization: plugin -Bundle-Vendor: Nuxeo -Require-Bundle: org.nuxeo.runtime, - org.nuxeo.ecm.core.api, - org.nuxeo.ecm.core, - org.nuxeo.ecm.core.api, - org.nuxeo.ecm.platform.types.api, - org.nuxeo.ecm.platform.versioning.api, - org.nuxeo.ecm.platform.ui, - org.nuxeo.ecm.platform.forms.layout.client, - org.nuxeo.ecm.platform.publishing.api, - org.nuxeo.ecm.platform.ws -Provide-Package: org.collectionspace.hello -Nuxeo-Component: OSGI-INF/core-types-contrib.xml, - OSGI-INF/ecm-types-contrib.xml, - OSGI-INF/layouts-contrib.xml - diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/3rdparty/nuxeo/jaxrs-nuxeo-cs/target/classes/OSGI-INF/core-types-contrib.xml b/sandbox/sanjay/prototypes/jaxrs-prototype/3rdparty/nuxeo/jaxrs-nuxeo-cs/target/classes/OSGI-INF/core-types-contrib.xml deleted file mode 100644 index 7be6addb0..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/3rdparty/nuxeo/jaxrs-nuxeo-cs/target/classes/OSGI-INF/core-types-contrib.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/3rdparty/nuxeo/jaxrs-nuxeo-cs/target/classes/OSGI-INF/deployment-fragment.xml b/sandbox/sanjay/prototypes/jaxrs-prototype/3rdparty/nuxeo/jaxrs-nuxeo-cs/target/classes/OSGI-INF/deployment-fragment.xml deleted file mode 100644 index 88b94ffd1..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/3rdparty/nuxeo/jaxrs-nuxeo-cs/target/classes/OSGI-INF/deployment-fragment.xml +++ /dev/null @@ -1,408 +0,0 @@ - - - - - - ${bundle.fileName} - - - - - nuxeo.war - /nuxeo - - - - - - - - - - - - Seam Context Filter - /ws/FileManageWS - - - - Seam Context Filter - /DocumentManagerWS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #{currentServerLocation.name}/#{currentTabAction.label} - - - - Create new document in #{currentDocument.name} - - - - Create new document in #{currentDocument.name} - - - - breadcrumb=command.user_dashboard - - - - breadcrumb=command.manageMembers - - - - breadcrumb=command.manageMembers - - - - breadcrumb=title.vocabularies - - - - breadcrumb=command.advancedSearch - - - - - - en - en_GB - en_US - fr - de - es - it - ar - ru - ja - vn - - - messages - - - - config/addWorkspace.jpdl.xml - - - - - - generic_error_page - /generic_error_page.xhtml - - - - - generic_message_page - /generic_message_page.xhtml - - - - - home - /nxstartup.xhtml - - - - - user_login - /login.xhtml - - - - - user_logout - /logout.xhtml - - - - - view_servers - /view_servers.xhtml - - - - - - - view_domains - /view_domains.xhtml - - - - - select_document_type - /select_document_type.xhtml - - - - - create_document - /create_document.xhtml - - - - - edit_document - /edit_document.xhtml - - - - - view_documents - /view_documents.xhtml - - - - - create_file - /create_file.xhtml - - - - - create_workspace_wizard - /createWorkspaceWizard.xhtml - - - - - send_email - /document_email.xhtml - - - - - - view_workspaces - /view_workspaces.xhtml - - - - - - create_domain - /create_domain.xhtml - - - - - - edit_domain - /edit_domain.xhtml - - - - - - create_workspace - /create_workspace.xhtml - - - - - - edit_workspace - /edit_workspace.xhtml - - - - - - - members_management - /members_management.xhtml - - - - - view_users - /view_users.xhtml - - - - - view_many_users - /view_many_users.xhtml - - - - - edit_user - /edit_user.xhtml - - - - - edit_user_password - /edit_user_password.xhtml - - - - - view_user - /view_user.xhtml - - - - - create_user - /create_user.xhtml - - - - - view_groups - /view_groups.xhtml - - - - - view_group - /view_group.xhtml - - - - - edit_group - /edit_group.xhtml - - - - - create_group - /create_group.xhtml - - - - - view_vocabularies - /view_vocabularies.xhtml - - - - - view_vocabulary - /view_vocabulary.xhtml - - - - - - - search_form - /search/search_form.xhtml - - - - - search_results_nxql - /search/search_results_nxql.xhtml - - - - - search_results_advanced - - /search/search_results_advanced.xhtml - - - - - - search_results_simple - /search/search_results_simple.xhtml - - - - - - - clipboard - /incl/clipboard.xhtml - - - - - user_dashboard - /user_dashboard.xhtml - - - - - select_workspace_template - /select_workspace_template.xhtml - - - - - pdf_generation_error - /pdf_generation_error.xhtml - - - - - mass_edit - /massedit_documents.xhtml - - - - - mass_edit_confirm - /massedit_documents_preview.xhtml - - - - - - diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/3rdparty/nuxeo/jaxrs-nuxeo-cs/target/classes/OSGI-INF/ecm-types-contrib.xml b/sandbox/sanjay/prototypes/jaxrs-prototype/3rdparty/nuxeo/jaxrs-nuxeo-cs/target/classes/OSGI-INF/ecm-types-contrib.xml deleted file mode 100644 index 02347959a..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/3rdparty/nuxeo/jaxrs-nuxeo-cs/target/classes/OSGI-INF/ecm-types-contrib.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - view_documents - - - heading - hello - - - - - - Hello - - - - - Hello - - - - - diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/3rdparty/nuxeo/jaxrs-nuxeo-cs/target/classes/OSGI-INF/layouts-contrib.xml b/sandbox/sanjay/prototypes/jaxrs-prototype/3rdparty/nuxeo/jaxrs-nuxeo-cs/target/classes/OSGI-INF/layouts-contrib.xml deleted file mode 100644 index 3cf9ff7cd..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/3rdparty/nuxeo/jaxrs-nuxeo-cs/target/classes/OSGI-INF/layouts-contrib.xml +++ /dev/null @@ -1,155 +0,0 @@ - - - - - - - - - - - - cid - cversion - firstname - lastname - street - city - state - zip - country - - - - - - true - - cid - - - - hidden - - - - true - - - - cssClass - - - - - - - true - - cversion - - - dataInputText - - - - - - - - - true - - firstName - - - dataInputText - - - - - - - - true - - lastName - - - dataInputText - - - - - - - - true - - street - - - dataInputText - - - - - - - - true - - city - - - dataInputText - - - - - - - - true - - state - - - dataInputText - - - - - - - - true - - zip - - - dataInputText - - - - - - - - true - - country - - - dataInputText - - - - - - - - - - diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/3rdparty/nuxeo/jaxrs-nuxeo-cs/target/classes/schemas/hello.xsd b/sandbox/sanjay/prototypes/jaxrs-prototype/3rdparty/nuxeo/jaxrs-nuxeo-cs/target/classes/schemas/hello.xsd deleted file mode 100644 index df2ec990f..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/3rdparty/nuxeo/jaxrs-nuxeo-cs/target/classes/schemas/hello.xsd +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/3rdparty/nuxeo/jaxrs-nuxeo-cs/target/maven-archiver/pom.properties b/sandbox/sanjay/prototypes/jaxrs-prototype/3rdparty/nuxeo/jaxrs-nuxeo-cs/target/maven-archiver/pom.properties deleted file mode 100644 index 189aa7fe5..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/3rdparty/nuxeo/jaxrs-nuxeo-cs/target/maven-archiver/pom.properties +++ /dev/null @@ -1,5 +0,0 @@ -#Generated by Maven -#Fri Apr 17 14:17:59 PDT 2009 -version=5.2-SNAPSHOT -groupId=org.nuxeo.ecm.platform -artifactId=nuxeo-platform-cs diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/3rdparty/nuxeo/jaxrs-nuxeo-cs/target/nuxeo-platform-cs-5.2-SNAPSHOT-sources.jar b/sandbox/sanjay/prototypes/jaxrs-prototype/3rdparty/nuxeo/jaxrs-nuxeo-cs/target/nuxeo-platform-cs-5.2-SNAPSHOT-sources.jar deleted file mode 100644 index 4b59faca8..000000000 Binary files a/sandbox/sanjay/prototypes/jaxrs-prototype/3rdparty/nuxeo/jaxrs-nuxeo-cs/target/nuxeo-platform-cs-5.2-SNAPSHOT-sources.jar and /dev/null differ diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/3rdparty/nuxeo/jaxrs-nuxeo-cs/target/nuxeo-platform-cs-5.2-SNAPSHOT.jar b/sandbox/sanjay/prototypes/jaxrs-prototype/3rdparty/nuxeo/jaxrs-nuxeo-cs/target/nuxeo-platform-cs-5.2-SNAPSHOT.jar deleted file mode 100644 index b1249b152..000000000 Binary files a/sandbox/sanjay/prototypes/jaxrs-prototype/3rdparty/nuxeo/jaxrs-nuxeo-cs/target/nuxeo-platform-cs-5.2-SNAPSHOT.jar and /dev/null differ diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-client/nb-configuration.xml b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-client/nb-configuration.xml deleted file mode 100644 index 6c3fe600b..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-client/nb-configuration.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - default - 8 - 80 - - diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-client/nbactions.xml b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-client/nbactions.xml deleted file mode 100644 index 047c73d4e..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-client/nbactions.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - rebuild - - * - - - clean - install - - - true - - - - diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-client/pom.xml b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-client/pom.xml deleted file mode 100644 index 8001df0b9..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-client/pom.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - - jaxrs-prototype - org.collectionspace.hello.services - 0.1 - - 4.0.0 - org.collectionspace.hello.services - jaxrs-client - jar - 0.1 - jaxrs-client - - - org.collectionspace.hello.services - jaxrs-jaxb - 0.1 - - - org.testng - testng - 5.6 - - - org.slf4j - slf4j-api - - - org.slf4j - slf4j-log4j12 - - - org.jboss.resteasy - resteasy-jaxrs - 1.0.2.GA - - - - tjws - webserver - - - - - org.jboss.resteasy - resteasy-jaxb-provider - 1.0.2.GA - - - org.jboss.resteasy - resteasy-multipart-provider - 1.0.2.GA - - - commons-httpclient - commons-httpclient - - - - - - maven-compiler-plugin - 2.0.2 - - 1.5 - 1.5 - - - - - diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-client/src/main/java/org/collectionspace/hello/client/IdentifierClient.java b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-client/src/main/java/org/collectionspace/hello/client/IdentifierClient.java deleted file mode 100644 index a7b12f967..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-client/src/main/java/org/collectionspace/hello/client/IdentifierClient.java +++ /dev/null @@ -1,64 +0,0 @@ -package org.collectionspace.hello.client; - -import javax.ws.rs.core.Response; - -import org.collectionspace.hello.Identifier; -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 IdentifierClient. - - * @version $Revision:$ - */ -public class IdentifierClient { - - /** - * - */ - private static final IdentifierClient instance = new IdentifierClient(); - /** - * - */ - private IdentifierProxy identifierProxy; - - /** - * - * Create a new IdentifierClient. - * - */ - private IdentifierClient() { - ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance(); - RegisterBuiltin.register(factory); - identifierProxy = ProxyFactory.create(IdentifierProxy.class, "http://localhost:8080/helloworld/cspace"); - } - - /** - * FIXME Comment this - * - * @return - */ - public static IdentifierClient getInstance() { - return instance; - } - - /** - * @param id - * @return - * @see org.collectionspace.hello.client.IdentifierProxy#getIdentifier(java.lang.Long) - */ - public ClientResponse getIdentifier(Long id) { - return identifierProxy.getIdentifier(id); - } - - /** - * @param identifier - * @return - * @see org.collectionspace.hello.client.IdentifierProxy#createIdentifier(org.collectionspace.hello.client.entity.Identifier) - */ - public ClientResponse createIdentifier(Identifier identifier) { - return identifierProxy.createIdentifier(identifier); - } -} diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-client/src/main/java/org/collectionspace/hello/client/IdentifierProxy.java b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-client/src/main/java/org/collectionspace/hello/client/IdentifierProxy.java deleted file mode 100644 index 125aab47d..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-client/src/main/java/org/collectionspace/hello/client/IdentifierProxy.java +++ /dev/null @@ -1,32 +0,0 @@ -package org.collectionspace.hello.client; - -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.core.Response; - -import org.collectionspace.hello.Identifier; -import org.jboss.resteasy.client.ClientResponse; - -/** - * @version $Revision:$ - */ -@Path("/identifiers/") -@Produces({"application/xml"}) -@Consumes({"application/xml"}) -public interface IdentifierProxy { - - /** - * @param id - * @return - */ - @GET - @Path("/{id}") - ClientResponse getIdentifier(@PathParam("id") Long id); - - @POST - ClientResponse createIdentifier(Identifier so); -} \ No newline at end of file diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-client/src/main/java/org/collectionspace/hello/client/PersonClient.java b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-client/src/main/java/org/collectionspace/hello/client/PersonClient.java deleted file mode 100644 index e5de8f6e6..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-client/src/main/java/org/collectionspace/hello/client/PersonClient.java +++ /dev/null @@ -1,93 +0,0 @@ -package org.collectionspace.hello.client; - -import javax.ws.rs.core.Response; - -import org.collectionspace.hello.Person; -import org.collectionspace.hello.Persons; -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() - */ - public ClientResponse getPersons() { - return personProxy.getPersons(); - } - - /** - * @param id - * @return - * @see org.collectionspace.hello.client.PersonProxy#getPerson(java.lang.Long) - */ - public ClientResponse 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 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 updatePerson(Long id, Person person) { - return personProxy.updatePerson(id, person); - } - - /** - * @param id - * @return - * @see org.collectionspace.hello.client.PersonProxy#deletePerson(java.lang.Long) - */ - public ClientResponse deletePerson(Long id) { - return personProxy.deletePerson(id); - } -} diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-client/src/main/java/org/collectionspace/hello/client/PersonProxy.java b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-client/src/main/java/org/collectionspace/hello/client/PersonProxy.java deleted file mode 100644 index 2b6f2370b..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-client/src/main/java/org/collectionspace/hello/client/PersonProxy.java +++ /dev/null @@ -1,42 +0,0 @@ -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.collectionspace.hello.Person; -import org.collectionspace.hello.Persons; -import org.jboss.resteasy.client.ClientResponse; - -/** - * @version $Revision:$ - */ -@Path("/persons/") -@Produces({"application/xml"}) -@Consumes({"application/xml"}) -public interface PersonProxy { - - @GET - ClientResponse getPersons(); - - @GET - @Path("/{id}") - ClientResponse getPerson(@PathParam("id") Long id); - - @POST - ClientResponse createPerson(Person so); - - @PUT - @Path("/{id}") - ClientResponse updatePerson(@PathParam("id") Long id, Person so); - - @DELETE - @Path("/{id}") - ClientResponse deletePerson(@PathParam("id") Long id); -} \ No newline at end of file diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-client/src/test/java/org/collectionspace/hello/client/test/IdentifierServiceTest.java b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-client/src/test/java/org/collectionspace/hello/client/test/IdentifierServiceTest.java deleted file mode 100644 index 05bc199b5..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-client/src/test/java/org/collectionspace/hello/client/test/IdentifierServiceTest.java +++ /dev/null @@ -1,64 +0,0 @@ -package org.collectionspace.hello.client.test; - -import 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.Marshaller; -import org.collectionspace.hello.Identifier; -import org.jboss.resteasy.client.ClientResponse; -import org.testng.Assert; -import org.testng.annotations.Test; - -/** - * A IdentifierServiceTest. - * - * @version $Revision:$ - */ -public class IdentifierServiceTest { - - private IdentifierClient identifierClient = IdentifierClient.getInstance(); - private Long id = 0L; - - @Test - public void createIdentifier() { - Identifier identifier = new Identifier(); - identifier.setNamespace("org.bnhm"); - ClientResponse res = identifierClient.createIdentifier(identifier); - Assert.assertEquals(res.getStatus(), Response.Status.CREATED.getStatusCode()); - id = extractId(res); - } - - @Test(dependsOnMethods = {"createIdentifier"}) - public void getIdentifier() { - Identifier i = identifierClient.getIdentifier(id).getEntity(); - verbose("got Identifier", i); - } - - private Long extractId(ClientResponse res) { - MultivaluedMap mvm = res.getMetadata(); - String uri = (String) ((ArrayList) mvm.get("Location")).get(0); - String[] segments = uri.split("/"); - verbose("id=" + segments[segments.length - 1]); - return Long.valueOf(segments[segments.length - 1]); - } - - private void verbose(String msg) { - System.out.println("IdentifierServiceTest : " + msg); - } - - private void verbose(String msg, Identifier p) { - try { - verbose(msg); - JAXBContext jc = JAXBContext.newInstance(Identifier.class); - Marshaller m = jc.createMarshaller(); - m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, - Boolean.TRUE); - m.marshal(p, System.out); - //m.marshal(new JAXBElement(new QName("uri", "local"), Identifier.class, p), System.out); - } catch (Exception e) { - e.printStackTrace(); - } - } -} diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-client/src/test/java/org/collectionspace/hello/client/test/PersonServiceTest.java b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-client/src/test/java/org/collectionspace/hello/client/test/PersonServiceTest.java deleted file mode 100644 index cf60e22bf..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-client/src/test/java/org/collectionspace/hello/client/test/PersonServiceTest.java +++ /dev/null @@ -1,159 +0,0 @@ -package org.collectionspace.hello.client.test; - -import java.util.ArrayList; -import java.util.List; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.core.Response; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.Marshaller; -import org.collectionspace.hello.Person; -import org.collectionspace.hello.Persons; -import org.collectionspace.hello.client.PersonClient; -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 updateId = 0L; - - @Test - public void createPerson() { - Person person = createPerson("Chris", "Hoffman"); - ClientResponse res = personClient.createPerson(person); - Assert.assertEquals(res.getStatus(), Response.Status.CREATED.getStatusCode()); - //store updateId locally - updateId = extractId(res); - } - - @Test - public void createPersons() { - Person person = createPerson("Aron", "Roberts"); - ClientResponse res = personClient.createPerson(person); - Assert.assertEquals(res.getStatus(), Response.Status.CREATED.getStatusCode()); - person = createPerson("Dan", "Sheppard"); - res = personClient.createPerson(person); - Assert.assertEquals(res.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test(dependsOnMethods = {"createPerson"}) - public void updatePerson() { - Person touPerson = personClient.getPerson(updateId).getEntity(); - verbose("got person to update", touPerson, Person.class); - touPerson.setFirstName("Richard"); - touPerson.setLastName("Millet"); - int initialVersion = touPerson.getVersion(); - Person uPerson = personClient.updatePerson(updateId, touPerson).getEntity(); - verbose("updated person", uPerson, Person.class); - Assert.assertNotSame(uPerson.getVersion(), initialVersion); - Assert.assertEquals(uPerson.getFirstName(), "Richard"); - } - - @Test(dependsOnMethods = {"createPerson"}) - public void getPersons() { - //the resource method is expected to return at least an empty list - Persons persons = personClient.getPersons().getEntity(); - List list = persons.getPersonListItem(); - int i = 0; - for (Persons.PersonListItem pli : list) { - verbose("getPersons: list-item[" + i + "] firstName=" + pli.getFirstName()); - verbose("getPersons: list-item[" + i + "] lastName=" + pli.getLastName()); - verbose("getPersons: list-item[" + i + "] uri=" + pli.getUri()); - i++; - } - } - - - @Test - public void getNonExistingPerson() { - ClientResponse res = personClient.getPerson(999L); - - Response.Status status = res.getResponseStatus(); - verbose(this.getClass().getName() + ": " + - "getNonExistingPerson: Status: code=" + status.getStatusCode() + - " message=" + status.toString()); - verbose("getNonExistingPerson: Metadata:"); - verboseMap(res.getMetadata()); - verbose("getNonExistingPerson: Headers:"); - verboseMap(res.getHeaders()); - if (status.equals(Response.Status.NOT_FOUND)) { - String msg = res.getEntity(String.class, String.class); - verbose("getNonExistingPerson: error message=" + msg); - } - } - - @Test(dependsOnMethods = {"updatePerson"}) - public void updateWrongPerson() { - Person touPerson = personClient.getPerson(updateId).getEntity(); - verbose("updateWrongPerson: got person to update", touPerson, Person.class); - touPerson.setFirstName("Richard"); - touPerson.setLastName("Millet"); - //use non existing person to update - ClientResponse res = personClient.updatePerson(9999L, touPerson); - if (res.getResponseStatus().equals(Response.Status.NOT_FOUND)) { - verbose("updateWrongPerson: Status=" + res.getResponseStatus().toString()); - String msg = res.getEntity(String.class, String.class); - verbose("updateWrongPerson: application error message=" + msg); - } - } - - - @Test(dependsOnMethods = {"updateWrongPerson"}) - public void deletePerson() { - ClientResponse res = personClient.deletePerson(updateId); - verbose("deletePerson: id=" + updateId); - verbose("deletePerson: status = " + res.getStatus()); - Assert.assertEquals(res.getStatus(), Response.Status.NO_CONTENT.getStatusCode()); - } - - private Person createPerson(String firstName, String lastName) { - Person person = new Person(); - person.setFirstName(firstName); - person.setLastName(lastName); - person.setStreet("2195 Hearst Ave."); - person.setCity("Berkeley"); - person.setState("CA"); - person.setZip("94704"); - person.setCountry("US"); - return person; - } - - private Long extractId(ClientResponse res) { - MultivaluedMap mvm = res.getMetadata(); - String uri = (String) ((ArrayList) mvm.get("Location")).get(0); - String[] segments = uri.split("/"); - verbose("id=" + segments[segments.length - 1]); - return Long.valueOf(segments[segments.length - 1]); - } - - private void verbose(String msg) { - System.out.println("PersonServiceTest : " + msg); - } - - private void verbose(String msg, Object o, Class clazz) { - try { - verbose(msg); - JAXBContext jc = JAXBContext.newInstance(clazz); - Marshaller m = jc.createMarshaller(); - m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, - Boolean.TRUE); - m.marshal(o, System.out); - //m.marshal(new JAXBElement(new QName("uri", "local"), Person.class, p), System.out); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void verboseMap(MultivaluedMap map) { - for (Object entry : map.entrySet()) { - MultivaluedMap.Entry mentry = (MultivaluedMap.Entry) entry; - verbose(" name=" + mentry.getKey() + " value=" + mentry.getValue()); - } - } -} diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-client/src/test/resources/log4j.xml b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-client/src/test/resources/log4j.xml deleted file mode 100644 index 52121cb83..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-client/src/test/resources/log4j.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-client/temp-testng-customsuite.xml b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-client/temp-testng-customsuite.xml deleted file mode 100644 index 9f2480621..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-client/temp-testng-customsuite.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-jaxb/nb-configuration.xml b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-jaxb/nb-configuration.xml deleted file mode 100644 index 6c3fe600b..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-jaxb/nb-configuration.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - default - 8 - 80 - - diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-jaxb/pom.xml b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-jaxb/pom.xml deleted file mode 100644 index 57d5c33c5..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-jaxb/pom.xml +++ /dev/null @@ -1,97 +0,0 @@ - - - - jaxrs-prototype - org.collectionspace.hello.services - 0.1 - - 4.0.0 - org.collectionspace.hello.services - jaxrs-jaxb - 0.1 - jaxrs-jaxb - - - com.sun.xml.bind - jaxb-impl - 2.0.2 - - - org.jvnet.jaxb2-commons - property-listener-injector - 1.0 - - - org.jvnet.jaxb2_commons - runtime - 0.4.1.4 - - - - install - - - org.jvnet.jaxb2.maven2 - maven-jaxb2-plugin - - - - generate - - - - - - javax.activation - activation - 1.1 - - - com.sun.xml.bind - jaxb-impl - 2.1.2 - - - - - -XtoString - -Xinject-listener-code - - - **/*.xsd - **/*.dtd - - - - - org.jvnet.jaxb2_commons - - basic - 0.4.1 - - - - org.jvnet.jaxb2-commons - - - property-listener-injector - - 1.0 - - - - - - - maven-compiler-plugin - 2.0.2 - - 1.5 - 1.5 - - - - - diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-jaxb/src/main/java/org/collectionspace/hello/services/CollectionObjectJAXBSchema.java b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-jaxb/src/main/java/org/collectionspace/hello/services/CollectionObjectJAXBSchema.java deleted file mode 100644 index 8484bdb15..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-jaxb/src/main/java/org/collectionspace/hello/services/CollectionObjectJAXBSchema.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - * - */ -package org.collectionspace.hello.services; - -/** - * @author remillet - * - */ -public interface CollectionObjectJAXBSchema { - final static String OBJECT_NUMBER = "objectNumber"; - final static String OTHER_NUMBER = "otherNumber"; - final static String BRIEF_DESCRIPTION = "briefDescription"; - final static String COMMENTS = "comments"; - final static String DIST_FEATURES = "distFeatures"; - final static String OBJECT_NAME = "objectName"; - final static String RESPONSIBLE_DEPT = "responsibleDept"; - final static String TITLE = "title"; -} - - diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-jaxb/src/main/java/org/collectionspace/hello/services/CollectionObjectListItemJAXBSchema.java b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-jaxb/src/main/java/org/collectionspace/hello/services/CollectionObjectListItemJAXBSchema.java deleted file mode 100644 index c3aa8a577..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-jaxb/src/main/java/org/collectionspace/hello/services/CollectionObjectListItemJAXBSchema.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.collectionspace.hello.services; - -public interface CollectionObjectListItemJAXBSchema { - final static String OBJECT_NUMBER = "objectNumber"; - final static String CSID = "csid"; - final static String URI = "url"; -} diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-jaxb/src/main/resources/hello.xsd b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-jaxb/src/main/resources/hello.xsd deleted file mode 100644 index ae98d00a5..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-jaxb/src/main/resources/hello.xsd +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-jaxb/src/main/resources/world.xsd b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-jaxb/src/main/resources/world.xsd deleted file mode 100644 index 7cca087ca..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-jaxb/src/main/resources/world.xsd +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-client/nb-configuration.xml b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-client/nb-configuration.xml deleted file mode 100644 index 6c3fe600b..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-client/nb-configuration.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - default - 8 - 80 - - diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-client/nbactions.xml b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-client/nbactions.xml deleted file mode 100644 index 047c73d4e..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-client/nbactions.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - rebuild - - * - - - clean - install - - - true - - - - diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-client/pom.xml b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-client/pom.xml deleted file mode 100644 index 52e29adfe..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-client/pom.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - - jaxrs-prototype - org.collectionspace.hello.services - 0.1 - - 4.0.0 - org.collectionspace.hello.services - jaxrs-nuxeo-client - jar - 0.1 - jaxrs-nuxeo-client - - - org.collectionspace.hello.services - jaxrs-jaxb - 0.1 - - - org.testng - testng - 5.6 - - - org.slf4j - slf4j-api - - - org.slf4j - slf4j-log4j12 - - - org.jboss.resteasy - resteasy-jaxrs - 1.0.2.GA - - - - tjws - webserver - - - - - org.jboss.resteasy - resteasy-jaxb-provider - 1.0.2.GA - - - org.jboss.resteasy - resteasy-multipart-provider - 1.0.2.GA - - - commons-httpclient - commons-httpclient - - - - - - maven-compiler-plugin - 2.0.2 - - 1.5 - 1.5 - - - - - diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-client/src/main/java/org/collectionspace/hello/client/CollectionSpaceClient.java b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-client/src/main/java/org/collectionspace/hello/client/CollectionSpaceClient.java deleted file mode 100644 index c776044f8..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-client/src/main/java/org/collectionspace/hello/client/CollectionSpaceClient.java +++ /dev/null @@ -1,34 +0,0 @@ -package org.collectionspace.hello.client; - -import java.util.*; - -public abstract class CollectionSpaceClient { - static final String URL_PROPERTY = "org.collectionspace.url"; - /* - static final String URL_PROPERTY_SCHEME = "org.collectionspace.url.schme"; - static final String URL_PROPERTY_HOST = "org.collectionspace.url.host"; - static final String URL_PROPERTY_PORT = "org.collectionspace.url.port"; - static final String URL_PROPERTY_CONTEXT = "org.collectionspace.url.context"; - */ - - private static final String SCHEME = "http"; - private static final String HOST = "localhost"; - private static final String PORT = "8180"; - private static final String URI = "/helloworld/cspace-nuxeo"; - private static final String URL = SCHEME + "://" + - HOST + ":" + - PORT + - URI; - private String collectionSpaceURL = null; - - - String getURL() { - String result = collectionSpaceURL; - - if (collectionSpaceURL == null) { - result = collectionSpaceURL = System.getProperty(URL_PROPERTY, URL); - } - - return result; - } -} diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-client/src/main/java/org/collectionspace/hello/client/MultipartClient.java b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-client/src/main/java/org/collectionspace/hello/client/MultipartClient.java deleted file mode 100644 index 4f823c5b9..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-client/src/main/java/org/collectionspace/hello/client/MultipartClient.java +++ /dev/null @@ -1,86 +0,0 @@ -package org.collectionspace.hello.client; - -import javax.ws.rs.core.Response; - -import org.collectionspace.hello.PersonNuxeo; -import org.collectionspace.hello.People; -import org.jboss.resteasy.client.ProxyFactory; -import org.jboss.resteasy.plugins.providers.RegisterBuiltin; -import org.jboss.resteasy.client.ClientResponse; -import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput; -import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataOutput; -import org.jboss.resteasy.spi.ResteasyProviderFactory; - -/** - * A PersonNuxeoClient. - - * @version $Revision:$ - */ -public class MultipartClient extends CollectionSpaceClient { - - /** - * - */ - private static final MultipartClient instance = new MultipartClient(); - /** - * - */ - private MultipartProxy multipartProxy; - - /** - * - * Create a new PersonNuxeoClient. - * - */ - private MultipartClient() { - ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance(); - RegisterBuiltin.register(factory); - multipartProxy = ProxyFactory.create(MultipartProxy.class, getURL()); - } - - /** - * FIXME Comment this - * - * @return - */ - public static MultipartClient getInstance() { - return instance; - } - - /** - * @param id - * @return - * @see org.collectionspace.hello.client.PersonNuxeoProxy#getPerson(java.lang.String) - */ - public ClientResponse getPerson(String id) { - return multipartProxy.getPerson(id); - } - - /** - * @param person - * @return - * @see org.collectionspace.hello.client.PersonNuxeoProxy#createPerson(org.collectionspace.hello.PersonNuxeo) - */ - public ClientResponse createPerson(MultipartFormDataOutput multipartPerson) { - return multipartProxy.createPerson(multipartPerson); - } - - /** - * @param id - * @param person - * @return - * @see org.collectionspace.hello.client.PersonNuxeoProxy#updatePerson(java.lang.Long, org.collectionspace.hello.PersonNuxeo) - */ - public ClientResponse updatePerson(String id, PersonNuxeo person) { - return multipartProxy.updatePerson(id, person); - } - - /** - * @param id - * @return - * @see org.collectionspace.hello.client.PersonNuxeoProxy#deletePerson(java.lang.Long) - */ - public ClientResponse deletePerson(String id) { - return multipartProxy.deletePerson(id); - } -} diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-client/src/main/java/org/collectionspace/hello/client/MultipartProxy.java b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-client/src/main/java/org/collectionspace/hello/client/MultipartProxy.java deleted file mode 100644 index 11fd17b7f..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-client/src/main/java/org/collectionspace/hello/client/MultipartProxy.java +++ /dev/null @@ -1,44 +0,0 @@ -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.collectionspace.hello.PersonNuxeo; -import org.collectionspace.hello.People; -import org.jboss.resteasy.client.ClientResponse; -import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput; -import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataOutput; - -/** - * @version $Revision:$ - */ -@Path("/multipart/") -@Produces({"application/xml"}) -@Consumes({"application/xml"}) -public interface MultipartProxy { - - - @GET - @Path("/{id}") - @Produces("multipart/form-data") - ClientResponse getPerson(@PathParam("id") String id); - - @POST - @Consumes("multipart/form-data") - ClientResponse createPerson(MultipartFormDataOutput multipartPerson); - - @PUT - @Path("/{id}") - ClientResponse updatePerson(@PathParam("id") String id, PersonNuxeo so); - - @DELETE - @Path("/{id}") - ClientResponse deletePerson(@PathParam("id") String id); -} \ No newline at end of file diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-client/src/main/java/org/collectionspace/hello/client/MultischemaClient.java b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-client/src/main/java/org/collectionspace/hello/client/MultischemaClient.java deleted file mode 100644 index 924de121d..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-client/src/main/java/org/collectionspace/hello/client/MultischemaClient.java +++ /dev/null @@ -1,86 +0,0 @@ -package org.collectionspace.hello.client; - -import javax.ws.rs.core.Response; - -import org.collectionspace.hello.PersonNuxeo; -import org.collectionspace.hello.People; -import org.jboss.resteasy.client.ProxyFactory; -import org.jboss.resteasy.plugins.providers.RegisterBuiltin; -import org.jboss.resteasy.client.ClientResponse; -import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput; -import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataOutput; -import org.jboss.resteasy.spi.ResteasyProviderFactory; - -/** - * A PersonNuxeoClient. - - * @version $Revision:$ - */ -public class MultischemaClient extends CollectionSpaceClient { - - /** - * - */ - private static final MultischemaClient instance = new MultischemaClient(); - /** - * - */ - private MultischemaProxy proxy; - - /** - * - * Create a new PersonNuxeoClient. - * - */ - private MultischemaClient() { - ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance(); - RegisterBuiltin.register(factory); - proxy = ProxyFactory.create(MultischemaProxy.class, getURL()); - } - - /** - * FIXME Comment this - * - * @return - */ - public static MultischemaClient getInstance() { - return instance; - } - - /** - * @param id - * @return - * @see org.collectionspace.hello.client.PersonNuxeoProxy#getPerson(java.lang.String) - */ - public ClientResponse getPerson(String id) { - return proxy.getPerson(id); - } - - /** - * @param person - * @return - * @see org.collectionspace.hello.client.PersonNuxeoProxy#createPerson(org.collectionspace.hello.PersonNuxeo) - */ - public ClientResponse createPerson(MultipartFormDataOutput multipartPerson) { - return proxy.createPerson(multipartPerson); - } - - /** - * @param id - * @param person - * @return - * @see org.collectionspace.hello.client.PersonNuxeoProxy#updatePerson(java.lang.Long, org.collectionspace.hello.PersonNuxeo) - */ - public ClientResponse updatePerson(String id, PersonNuxeo person) { - return proxy.updatePerson(id, person); - } - - /** - * @param id - * @return - * @see org.collectionspace.hello.client.PersonNuxeoProxy#deletePerson(java.lang.Long) - */ - public ClientResponse deletePerson(String id) { - return proxy.deletePerson(id); - } -} diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-client/src/main/java/org/collectionspace/hello/client/MultischemaProxy.java b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-client/src/main/java/org/collectionspace/hello/client/MultischemaProxy.java deleted file mode 100644 index ef4d155b5..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-client/src/main/java/org/collectionspace/hello/client/MultischemaProxy.java +++ /dev/null @@ -1,43 +0,0 @@ -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.collectionspace.hello.PersonNuxeo; -import org.jboss.resteasy.client.ClientResponse; -import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput; -import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataOutput; - -/** - * @version $Revision:$ - */ -@Path("/multischema/") -@Produces({"application/xml"}) -@Consumes({"application/xml"}) -public interface MultischemaProxy { - - - @GET - @Path("/{id}") - @Produces("multipart/form-data") - ClientResponse getPerson(@PathParam("id") String id); - - @POST - @Consumes("multipart/form-data") - ClientResponse createPerson(MultipartFormDataOutput multipartPerson); - - @PUT - @Path("/{id}") - ClientResponse updatePerson(@PathParam("id") String id, PersonNuxeo so); - - @DELETE - @Path("/{id}") - ClientResponse deletePerson(@PathParam("id") String id); -} \ No newline at end of file diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-client/src/main/java/org/collectionspace/hello/client/PersonNuxeoClient.java b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-client/src/main/java/org/collectionspace/hello/client/PersonNuxeoClient.java deleted file mode 100644 index 68cdbf318..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-client/src/main/java/org/collectionspace/hello/client/PersonNuxeoClient.java +++ /dev/null @@ -1,93 +0,0 @@ -package org.collectionspace.hello.client; - -import javax.ws.rs.core.Response; - -import org.collectionspace.hello.PersonNuxeo; -import org.collectionspace.hello.People; -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 PersonNuxeoClient. - - * @version $Revision:$ - */ -public class PersonNuxeoClient extends CollectionSpaceClient { - - /** - * - */ - private static final PersonNuxeoClient instance = new PersonNuxeoClient(); - /** - * - */ - private PersonNuxeoProxy personProxy; - - /** - * - * Create a new PersonNuxeoClient. - * - */ - private PersonNuxeoClient() { - ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance(); - RegisterBuiltin.register(factory); - personProxy = ProxyFactory.create(PersonNuxeoProxy.class, getURL()); - } - - /** - * FIXME Comment this - * - * @return - */ - public static PersonNuxeoClient getInstance() { - return instance; - } - - /** - * @param id - * @return - * @see org.collectionspace.hello.client.PersonNuxeoProxy#getPerson() - */ - public ClientResponse getPeople() { - return personProxy.getPeople(); - } - - /** - * @param id - * @return - * @see org.collectionspace.hello.client.PersonNuxeoProxy#getPerson(java.lang.String) - */ - public ClientResponse getPerson(String id) { - return personProxy.getPerson(id); - } - - /** - * @param person - * @return - * @see org.collectionspace.hello.client.PersonNuxeoProxy#createPerson(org.collectionspace.hello.PersonNuxeo) - */ - public ClientResponse createPerson(PersonNuxeo person) { - return personProxy.createPerson(person); - } - - /** - * @param id - * @param person - * @return - * @see org.collectionspace.hello.client.PersonNuxeoProxy#updatePerson(java.lang.Long, org.collectionspace.hello.PersonNuxeo) - */ - public ClientResponse updatePerson(String id, PersonNuxeo person) { - return personProxy.updatePerson(id, person); - } - - /** - * @param id - * @return - * @see org.collectionspace.hello.client.PersonNuxeoProxy#deletePerson(java.lang.Long) - */ - public ClientResponse deletePerson(String id) { - return personProxy.deletePerson(id); - } -} diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-client/src/main/java/org/collectionspace/hello/client/PersonNuxeoProxy.java b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-client/src/main/java/org/collectionspace/hello/client/PersonNuxeoProxy.java deleted file mode 100644 index 53265de84..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-client/src/main/java/org/collectionspace/hello/client/PersonNuxeoProxy.java +++ /dev/null @@ -1,42 +0,0 @@ -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.collectionspace.hello.PersonNuxeo; -import org.collectionspace.hello.People; -import org.jboss.resteasy.client.ClientResponse; - -/** - * @version $Revision:$ - */ -@Path("/persons/") -@Produces({"application/xml"}) -@Consumes({"application/xml"}) -public interface PersonNuxeoProxy { - - @GET - ClientResponse getPeople(); - - @GET - @Path("/{id}") - ClientResponse getPerson(@PathParam("id") String id); - - @POST - ClientResponse createPerson(PersonNuxeo so); - - @PUT - @Path("/{id}") - ClientResponse updatePerson(@PathParam("id") String id, PersonNuxeo so); - - @DELETE - @Path("/{id}") - ClientResponse deletePerson(@PathParam("id") String id); -} \ No newline at end of file diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-client/src/test/java/org/collectionspace/hello/client/test/MultipartServiceTest.java b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-client/src/test/java/org/collectionspace/hello/client/test/MultipartServiceTest.java deleted file mode 100644 index b2dff47d8..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-client/src/test/java/org/collectionspace/hello/client/test/MultipartServiceTest.java +++ /dev/null @@ -1,128 +0,0 @@ -package org.collectionspace.hello.client.test; - -import java.util.ArrayList; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.core.Response; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.Marshaller; -import org.collectionspace.hello.PersonNuxeo; -import org.collectionspace.hello.client.MultipartClient; -import org.collectionspace.world.DublincoreNuxeo; -import org.jboss.resteasy.client.ClientResponse; -import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput; -import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataOutput; -import org.testng.Assert; -import org.testng.annotations.Test; - -/** - * A MultipartTest. - * - * @version $Revision:$ - */ -public class MultipartServiceTest { - - private MultipartClient multipartClient = MultipartClient.getInstance(); - private String updateId = ""; - private String deleteId = ""; - - @Test - public void createPerson() { - MultipartFormDataOutput multipartPerson = createPerson("Mr.", "Chris", "Hoffman"); - ClientResponse res = multipartClient.createPerson(multipartPerson); - Assert.assertEquals(res.getStatus(), Response.Status.CREATED.getStatusCode()); - //store updateId locally - updateId = extractId(res); - } - - @Test - public void createTeam() { - MultipartFormDataOutput multipartPerson = createPerson("Mr.", "Sanjay", "Dalal"); - ClientResponse res = multipartClient.createPerson(multipartPerson); - Assert.assertEquals(res.getStatus(), Response.Status.CREATED.getStatusCode()); - deleteId = extractId(res); - - multipartPerson = createPerson("Mr.", "Aron", "Roberts"); - res = multipartClient.createPerson(multipartPerson); - Assert.assertEquals(res.getStatus(), Response.Status.CREATED.getStatusCode()); - - multipartPerson = createPerson("Mr.", "Richard", "Millet"); - res = multipartClient.createPerson(multipartPerson); - Assert.assertEquals(res.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test(dependsOnMethods = {"createPerson"}) - public void updatePerson() throws Exception { - MultipartFormDataInput mdip = multipartClient.getPerson(updateId).getEntity(); - PersonNuxeo touPerson = mdip.getFormDataPart("hello", PersonNuxeo.class, null); - touPerson.setId(updateId); - verbose("got person to update", touPerson, PersonNuxeo.class); - touPerson.setFirstName("Patrick"); - touPerson.setLastName("Schmitz"); - PersonNuxeo uPerson = multipartClient.updatePerson(updateId, touPerson).getEntity(); - verbose("updated person", uPerson, PersonNuxeo.class); - //Assert.assertNotSame(uPerson.getVersion(), initialVersion); - Assert.assertEquals(uPerson.getFirstName(), "Patrick"); - } - - @Test(dependsOnMethods = {"createTeam"}) - public void deletePerson() { - ClientResponse res = multipartClient.deletePerson(deleteId); - verbose("deletePerson: id=" + deleteId); - verbose("deletePerson: status = " + res.getStatus()); - Assert.assertEquals(res.getStatus(), Response.Status.NO_CONTENT.getStatusCode()); - } - - private MultipartFormDataOutput createPerson(String title, String firstName, String lastName) { - PersonNuxeo person = new PersonNuxeo(); - - person.setFirstName(firstName); - person.setLastName(lastName); - person.setStreet("2195 Hearst Ave."); - person.setCity("Berkeley"); - person.setState("CA"); - person.setZip("94704"); - person.setCountry("US"); - person.setVersion("1.0"); - - DublincoreNuxeo dublin = new DublincoreNuxeo(); - dublin.setTitle(title); - MultipartFormDataOutput multipartPerson = new MultipartFormDataOutput(); - multipartPerson.addFormData("hello", person, MediaType.APPLICATION_XML_TYPE); - multipartPerson.addFormData("dublincore", dublin, MediaType.APPLICATION_XML_TYPE); - return multipartPerson; - } - - private String extractId(ClientResponse res) { - MultivaluedMap mvm = res.getMetadata(); - String uri = (String) ((ArrayList) mvm.get("Location")).get(0); - String[] segments = uri.split("/"); - String id = segments[segments.length - 1]; - verbose("extractId: id=" + id); - return id; - } - - private void verbose(String msg) { - System.out.println("MultipartServiceTest : " + msg); - } - - private void verbose(String msg, Object o, Class clazz) { - try{ - verbose(msg); - JAXBContext jc = JAXBContext.newInstance(clazz); - Marshaller m = jc.createMarshaller(); - m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, - Boolean.TRUE); - m.marshal(o, System.out); - }catch(Exception e){ - e.printStackTrace(); - } - } - - private void verboseMap(MultivaluedMap map) { - for(Object entry : map.entrySet()){ - MultivaluedMap.Entry mentry = (MultivaluedMap.Entry) entry; - verbose(" name=" + mentry.getKey() + " value=" + mentry.getValue()); - } - } -} diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-client/src/test/java/org/collectionspace/hello/client/test/MultischemaServiceTest.java b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-client/src/test/java/org/collectionspace/hello/client/test/MultischemaServiceTest.java deleted file mode 100644 index aadba2849..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-client/src/test/java/org/collectionspace/hello/client/test/MultischemaServiceTest.java +++ /dev/null @@ -1,124 +0,0 @@ -package org.collectionspace.hello.client.test; - -import java.util.ArrayList; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.core.Response; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.Marshaller; -import org.collectionspace.hello.PersonNuxeo; -import org.collectionspace.hello.client.MultischemaClient; -import org.collectionspace.world.DublincoreNuxeo; -import org.jboss.resteasy.client.ClientResponse; -import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput; -import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataOutput; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.testng.Assert; -import org.testng.annotations.Test; - -/** - * A MultipartTest. - * - * @version $Revision:$ - */ -public class MultischemaServiceTest { - - private MultischemaClient client = MultischemaClient.getInstance(); - private String updateId = ""; - private String deleteId = ""; - final Logger logger = LoggerFactory.getLogger(MultischemaServiceTest.class); - @Test - public void createPerson() { - MultipartFormDataOutput multipartPerson = createPerson("Mr.", "Chris", "Hoffman"); - ClientResponse res = client.createPerson(multipartPerson); - Assert.assertEquals(res.getStatus(), Response.Status.CREATED.getStatusCode()); - //store updateId locally - updateId = extractId(res); - } - - @Test - public void createTeam() { - MultipartFormDataOutput multipartPerson = createPerson("Mr.", "Sanjay", "Dalal"); - ClientResponse res = client.createPerson(multipartPerson); - Assert.assertEquals(res.getStatus(), Response.Status.CREATED.getStatusCode()); - deleteId = extractId(res); - - multipartPerson = createPerson("Mr.", "Aron", "Roberts"); - res = client.createPerson(multipartPerson); - Assert.assertEquals(res.getStatus(), Response.Status.CREATED.getStatusCode()); - - multipartPerson = createPerson("Mr.", "Richard", "Millet"); - res = client.createPerson(multipartPerson); - Assert.assertEquals(res.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test(dependsOnMethods = {"createPerson"}) - public void updatePerson() throws Exception { - MultipartFormDataInput mdip = client.getPerson(updateId).getEntity(); - PersonNuxeo touPerson = mdip.getFormDataPart("hello", PersonNuxeo.class, null); - touPerson.setId(updateId); - verbose("got person to update", touPerson, PersonNuxeo.class); - touPerson.setFirstName("Patrick"); - touPerson.setLastName("Schmitz"); - PersonNuxeo uPerson = client.updatePerson(updateId, touPerson).getEntity(); - verbose("updated person", uPerson, PersonNuxeo.class); - //Assert.assertNotSame(uPerson.getVersion(), initialVersion); - Assert.assertEquals(uPerson.getFirstName(), "Patrick"); - } - - @Test(dependsOnMethods = {"createTeam"}) - public void deletePerson() { - ClientResponse res = client.deletePerson(deleteId); - verbose("deletePerson: id=" + deleteId); - verbose("deletePerson: status = " + res.getStatus()); - Assert.assertEquals(res.getStatus(), Response.Status.NO_CONTENT.getStatusCode()); - } - - private MultipartFormDataOutput createPerson(String title, String firstName, String lastName) { - PersonNuxeo person = new PersonNuxeo(); - - person.setFirstName(firstName); - person.setLastName(lastName); - person.setStreet("2195 Hearst Ave."); - person.setCity("Berkeley"); - person.setState("CA"); - person.setZip("94704"); - person.setCountry("US"); - person.setVersion("1.0"); - - DublincoreNuxeo dublin = new DublincoreNuxeo(); - dublin.setTitle(title); - MultipartFormDataOutput multipartPerson = new MultipartFormDataOutput(); - multipartPerson.addFormData("hello", person, MediaType.APPLICATION_XML_TYPE); - multipartPerson.addFormData("dublincore", dublin, MediaType.APPLICATION_XML_TYPE); - return multipartPerson; - } - - private String extractId(ClientResponse res) { - MultivaluedMap mvm = res.getMetadata(); - String uri = (String) ((ArrayList) mvm.get("Location")).get(0); - String[] segments = uri.split("/"); - String id = segments[segments.length - 1]; - verbose("extractId: id=" + id); - return id; - } - - private void verbose(String msg) { - logger.info(msg); - } - - private void verbose(String msg, Object o, Class clazz) { - try{ - verbose(msg); - JAXBContext jc = JAXBContext.newInstance(clazz); - Marshaller m = jc.createMarshaller(); - m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, - Boolean.TRUE); - m.marshal(o, System.out); - }catch(Exception e){ - e.printStackTrace(); - } - } - -} diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-client/src/test/java/org/collectionspace/hello/client/test/PersonNuxeoServiceTest.java b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-client/src/test/java/org/collectionspace/hello/client/test/PersonNuxeoServiceTest.java deleted file mode 100644 index 1a71db83a..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-client/src/test/java/org/collectionspace/hello/client/test/PersonNuxeoServiceTest.java +++ /dev/null @@ -1,163 +0,0 @@ -package org.collectionspace.hello.client.test; - -import java.util.ArrayList; -import java.util.List; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.core.Response; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.Marshaller; -import org.collectionspace.hello.PersonNuxeo; -import org.collectionspace.hello.People; -import org.collectionspace.hello.client.PersonNuxeoClient; -import org.jboss.resteasy.client.ClientResponse; -import org.testng.Assert; -import org.testng.annotations.Test; - -/** - * A PersonNuxeoServiceTest. - * - * @version $Revision:$ - */ -public class PersonNuxeoServiceTest { - - private PersonNuxeoClient personClient = PersonNuxeoClient.getInstance(); - private String updateId = ""; - private String deleteId = ""; - - @Test - public void createPerson() { - PersonNuxeo person = createPerson("Chris", "Hoffman"); - ClientResponse res = personClient.createPerson(person); - Assert.assertEquals(res.getStatus(), Response.Status.CREATED.getStatusCode()); - //store updateId locally - updateId = extractId(res); - } - - @Test - public void createTeam() { - PersonNuxeo person = createPerson("Sanjay", "Dalal"); - ClientResponse res = personClient.createPerson(person); - Assert.assertEquals(res.getStatus(), Response.Status.CREATED.getStatusCode()); - deleteId = extractId(res); - - person = createPerson("Aron", "Roberts"); - res = personClient.createPerson(person); - Assert.assertEquals(res.getStatus(), Response.Status.CREATED.getStatusCode()); - - person = createPerson("Richard", "Millet"); - res = personClient.createPerson(person); - Assert.assertEquals(res.getStatus(), Response.Status.CREATED.getStatusCode()); - - person = createPerson("Megan", "Forbes"); - person.setCity("NewYork"); - person.setState("NY"); - person.setZip("01234"); - res = personClient.createPerson(person); - Assert.assertEquals(res.getStatus(), Response.Status.CREATED.getStatusCode()); - - person = createPerson("Carl", "Goodman"); - person.setCity("NewYork"); - person.setState("NY"); - person.setZip("01234"); - res = personClient.createPerson(person); - Assert.assertEquals(res.getStatus(), Response.Status.CREATED.getStatusCode()); - - person = createPerson("Dan", "Sheppard"); - person.setCity("Cambridge"); - person.setState("ZZ"); - person.setCountry("UK"); - person.setZip("UK-01234"); - res = personClient.createPerson(person); - Assert.assertEquals(res.getStatus(), Response.Status.CREATED.getStatusCode()); - - person = createPerson("Colin", "Clark"); - person.setCity("Toranto"); - person.setState("ON"); - person.setCountry("CA"); - person.setZip("CA-01234"); - res = personClient.createPerson(person); - Assert.assertEquals(res.getStatus(), Response.Status.CREATED.getStatusCode()); - - } - - @Test(dependsOnMethods = {"createPerson"}) - public void updatePerson() { - PersonNuxeo touPerson = personClient.getPerson(updateId).getEntity(); - touPerson.setId(updateId); - verbose("got person to update", touPerson, PersonNuxeo.class); - touPerson.setFirstName("Patrick"); - touPerson.setLastName("Schmitz"); - PersonNuxeo uPerson = personClient.updatePerson(updateId, touPerson).getEntity(); - verbose("updated person", uPerson, PersonNuxeo.class); - //Assert.assertNotSame(uPerson.getVersion(), initialVersion); - Assert.assertEquals(uPerson.getFirstName(), "Patrick"); - } - - @Test(dependsOnMethods = {"createTeam"}) - public void getPeople() { - //the resource method is expected to return at least an empty list - People people = personClient.getPeople().getEntity(); - List list = people.getPeopleItem(); - int i = 0; - for(People.PeopleItem pli : list){ - verbose("getPeople: list-item[" + i + "] title=" + pli.getTitle()); - verbose("getPeople: list-item[" + i + "] id=" + pli.getId()); - verbose("getPeople: list-item[" + i + "] uri=" + pli.getUri()); - i++; - } - } - - @Test(dependsOnMethods = {"updatePerson"}) - public void deletePerson() { - ClientResponse res = personClient.deletePerson(deleteId); - verbose("deletePerson: id=" + deleteId); - verbose("deletePerson: status = " + res.getStatus()); - Assert.assertEquals(res.getStatus(), Response.Status.NO_CONTENT.getStatusCode()); - } - - private PersonNuxeo createPerson(String firstName, String lastName) { - PersonNuxeo person = new PersonNuxeo(); - person.setFirstName(firstName); - person.setLastName(lastName); - person.setStreet("2195 Hearst Ave."); - person.setCity("Berkeley"); - person.setState("CA"); - person.setZip("94704"); - person.setCountry("US"); - person.setVersion("1.0"); - return person; - } - - private String extractId(ClientResponse res) { - MultivaluedMap mvm = res.getMetadata(); - String uri = (String) ((ArrayList) mvm.get("Location")).get(0); - String[] segments = uri.split("/"); - String id = segments[segments.length - 1]; - verbose("extractId: id=" + id); - return id; - } - - private void verbose(String msg) { - System.out.println("PersonServiceTest : " + msg); - } - - private void verbose(String msg, Object o, Class clazz) { - try{ - verbose(msg); - JAXBContext jc = JAXBContext.newInstance(clazz); - Marshaller m = jc.createMarshaller(); - m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, - Boolean.TRUE); - m.marshal(o, System.out); - }catch(Exception e){ - e.printStackTrace(); - } - } - - private void verboseMap(MultivaluedMap map) { - for(Object entry : map.entrySet()){ - MultivaluedMap.Entry mentry = (MultivaluedMap.Entry) entry; - verbose(" name=" + mentry.getKey() + " value=" + mentry.getValue()); - } - } -} diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-client/src/test/resources/log4j.xml b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-client/src/test/resources/log4j.xml deleted file mode 100644 index 52121cb83..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-client/src/test/resources/log4j.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-client/temp-testng-customsuite.xml b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-client/temp-testng-customsuite.xml deleted file mode 100644 index 9f2480621..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-client/temp-testng-customsuite.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-javaapi-service/README.txt b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-javaapi-service/README.txt deleted file mode 100644 index b1aa460dd..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-javaapi-service/README.txt +++ /dev/null @@ -1,14 +0,0 @@ -Helloworld service interfacing with Nuxeo repository through Nuxeo -REST apis. - -System Requirements: -==================== -- Maven 2.0.9 or higher -- Nuxeo CollectionSpace Extensions - -Building the project: -==================== -In root directoy... -1. customize build.properties for your environment -2. mvn clean package -3. ant diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-javaapi-service/build.properties b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-javaapi-service/build.properties deleted file mode 100644 index 6dfe3f7b2..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-javaapi-service/build.properties +++ /dev/null @@ -1,5 +0,0 @@ -jboss.dir=C:/dev/jboss-4.2.3.GA -jboss.client.dir=${jboss.dir}/client -nuxeo.dir=${jboss.dir}/server/default/deploy/nuxeo.ear/system -nuxeo.local.repo.dir=file:///C:/dev/jboss-4.2.3.GA/server/default/deploy/nuxeo.ear/system -nuxeo.local.repo.client.dir=file:///C:/dev/nuxeo/nuxeo-core/nuxeo-core-client/target diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-javaapi-service/build.xml b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-javaapi-service/build.xml deleted file mode 100644 index cdba8639c..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-javaapi-service/build.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-javaapi-service/jboss-web_4_2.dtd b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-javaapi-service/jboss-web_4_2.dtd deleted file mode 100644 index caa7f8850..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-javaapi-service/jboss-web_4_2.dtd +++ /dev/null @@ -1,462 +0,0 @@ - - - - - - -%service-ref; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-javaapi-service/nb-configuration.xml b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-javaapi-service/nb-configuration.xml deleted file mode 100644 index 3e5cd988f..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-javaapi-service/nb-configuration.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - default - 8 - 80 - false - - diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-javaapi-service/nbactions.xml b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-javaapi-service/nbactions.xml deleted file mode 100644 index 9d30c239a..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-javaapi-service/nbactions.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - - test - - * - - - test - - - - build - - * - - - install - - - - clean - - * - - - clean - - - - rebuild - - * - - - clean - install - - - true - - - - run - - war - ear - ejb - - - package - - - - true - - - - debug - - war - ear - ejb - - - package - - - - true - true - - - diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-javaapi-service/pom.xml b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-javaapi-service/pom.xml deleted file mode 100644 index 6c25b5405..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-javaapi-service/pom.xml +++ /dev/null @@ -1,294 +0,0 @@ - - - - jaxrs-prototype - org.collectionspace.hello.services - 0.1 - - 4.0.0 - org.collectionspace.hello.services - jaxrs-nuxeo-javaapi-service - war - 0.1 - jaxrs-nuxeo-javaapi-service - - - - java.net - http://download.java.net/maven/1 - legacy - - - maven repo - maven repo - http://repo1.maven.org/maven2/ - - - - - jboss - jboss repo - http://repository.jboss.org/maven2 - - - mojo - mojo repo - http://svn.codehaus.org/mojo/trunk/mojo/jboss-maven-plugin - - - - - - - - - - public - http://maven.nuxeo.org/public - Nuxeo virtual release repository - - - - false - - - - public-snapshot - http://maven.nuxeo.org/public-snapshot - Nuxeo virtual snapshot repository - - false - - - - - - - - - 4.2.3.GA - 3.0 - UTF-8 - 1.5.1 - 0.9.7 - 5.2-SNAPSHOT - 1.5-SNAPSHOT - - - - - - org.collectionspace.hello.services - jaxrs-jaxb - 0.1 - - - org.jboss.resteasy - resteasy-jaxrs - 1.0.2.GA - - - tjws - webserver - - - - - org.jboss.resteasy - resteasy-jaxb-provider - 1.0.2.GA - - - org.jboss.resteasy - resteasy-multipart-provider - 1.0.2.GA - - - junit - junit - 4.1 - test - - - org.slf4j - slf4j-api - 1.5.2 - - - org.slf4j - slf4j-log4j12 - 1.5.2 - - - - javax.servlet - servlet-api - 2.5 - provided - - - - javax.security - jaas - 1.0.01 - provided - - - - - dom4j - dom4j - 1.6.1 - provided - - - - - jboss - jboss-remoting - 2.2.2.SP8 - provided - - - - - - org.nuxeo.common - nuxeo-common - ${nuxeo.version.1.5} - provided - - - org.nuxeo.runtime - nuxeo-runtime - ${nuxeo.version.1.5} - - - org.nuxeo.ecm.core - nuxeo-core-api - ${nuxeo.version.1.5} - - - org.nuxeo.ecm.core - nuxeo-core-client - ${nuxeo.version.1.5} - - - org.nuxeo.ecm.core - nuxeo-core-query - ${nuxeo.version.1.5} - - - org.nuxeo.ecm.core - nuxeo-core-schema - ${nuxeo.version.1.5} - - - org.nuxeo.ecm.core - nuxeo-core-io - ${nuxeo.version.1.5} - - - org.nuxeo.ecm.core - nuxeo-core-facade - ${nuxeo.version.1.5} - - - org.nuxeo.runtime - nuxeo-runtime-osgi - ${nuxeo.version.1.5} - - - org.osgi - osgi-core - 4.1 - - - - - - - helloworld - - - org.codehaus.mojo - jboss-maven-plugin - - ${jboss.dir} - 8180 - - - - jboss-undeploy - pre-integration-test - - undeploy - - - ${basedir}/target/helloworld.war - - - - jboss-deploy - pre-integration-test - - deploy - - - ${basedir}/target/helloworld.war - - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - - surefire-it - integration-test - - test - - - false - - - - - - org.apache.maven.plugins - maven-war-plugin - 2.0 - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.5 - 1.5 - - - - - diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-javaapi-service/src/main/java/org/collectionspace/hello/services/CollectionSpaceApplication.java b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-javaapi-service/src/main/java/org/collectionspace/hello/services/CollectionSpaceApplication.java deleted file mode 100644 index d1a44a975..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-javaapi-service/src/main/java/org/collectionspace/hello/services/CollectionSpaceApplication.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.collectionspace.hello.services; - -import javax.ws.rs.core.Application; -import java.util.HashSet; -import java.util.Set; - -public class CollectionSpaceApplication extends Application { - - private Set singletons = new HashSet(); - private Set> empty = new HashSet>(); - - public CollectionSpaceApplication() { - singletons.add(new MultischemaResource()); - } - - @Override - public Set> getClasses() { - return empty; - } - - @Override - public Set getSingletons() { - return singletons; - } -} diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-javaapi-service/src/main/java/org/collectionspace/hello/services/CollectionSpaceResource.java b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-javaapi-service/src/main/java/org/collectionspace/hello/services/CollectionSpaceResource.java deleted file mode 100644 index 29e681a70..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-javaapi-service/src/main/java/org/collectionspace/hello/services/CollectionSpaceResource.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.collectionspace.hello.services; - - -public abstract class CollectionSpaceResource { - //replace WORKSPACE_UID for resource workspace - static String CS_COLLECTIONOBJECT_WORKSPACE_UID = "5a37d40f-59c4-4d15-93ad-e0e6a0c33587"; - //sanjay 6c7881fe-54c5-486e-b144-a025dee3a484 - //demo eae0d7b6-580a-45a3-a0f3-e25e980e03bb - static String CS_PERSON_WORKSPACE_UID = "6c7881fe-54c5-486e-b144-a025dee3a484"; - - //replace host if not running on localhost - //static String CS_NUXEO_HOST = "173.45.234.217"; - static String CS_NUXEO_HOST = "localhost"; - static String CS_NUXEO_URI = "http://" + CS_NUXEO_HOST + ":8080/nuxeo"; - -} diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-javaapi-service/src/main/java/org/collectionspace/hello/services/MultischemaResource.java b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-javaapi-service/src/main/java/org/collectionspace/hello/services/MultischemaResource.java deleted file mode 100644 index 0fe6f8cc6..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-javaapi-service/src/main/java/org/collectionspace/hello/services/MultischemaResource.java +++ /dev/null @@ -1,371 +0,0 @@ -package org.collectionspace.hello.services; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.util.Iterator; -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.DELETE; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.PathParam; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriBuilder; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.Marshaller; - -import org.collectionspace.hello.PersonNuxeo; - -import org.collectionspace.services.nuxeo.NuxeoConnector; -import org.collectionspace.world.DublincoreNuxeo; -import org.dom4j.Document; -import org.dom4j.Element; -import org.dom4j.io.SAXReader; -import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput; -import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataOutput; - - -import org.nuxeo.common.utils.IdUtils; -import org.nuxeo.ecm.core.api.DocumentModel; - - -import org.nuxeo.ecm.core.api.DocumentRef; -import org.nuxeo.ecm.core.api.IdRef; -import org.nuxeo.ecm.core.api.repository.RepositoryInstance; -import org.nuxeo.ecm.core.client.NuxeoClient; -import org.nuxeo.ecm.core.io.DocumentPipe; -import org.nuxeo.ecm.core.io.DocumentReader; -import org.nuxeo.ecm.core.io.DocumentWriter; -import org.nuxeo.ecm.core.io.impl.DocumentPipeImpl; -import org.nuxeo.ecm.core.io.impl.plugins.SingleDocumentReader; -import org.nuxeo.ecm.core.io.impl.plugins.XMLDocumentWriter; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@Path("/multischema") -@Consumes("application/xml") -@Produces("application/xml") -public class MultischemaResource extends CollectionSpaceResource { - - final Logger logger = LoggerFactory.getLogger(MultischemaResource.class); - - public MultischemaResource() { - } - - @POST - @Consumes("multipart/form-data") - public Response createPerson(MultipartFormDataInput multipart) { - - PersonNuxeo personPart = new PersonNuxeo(); - DublincoreNuxeo dcPart = new DublincoreNuxeo(); - - RepositoryInstance repoSession = null; - try{ - if(multipart.getFormData().containsKey("dublincore")){ - dcPart = multipart.getFormDataPart("dublincore", DublincoreNuxeo.class, null); - } - if(multipart.getFormData().containsKey("hello")){ - personPart = multipart.getFormDataPart("hello", PersonNuxeo.class, null); - } - - repoSession = getRepositorySession(); - DocumentRef nuxeoWspace = new IdRef(CS_PERSON_WORKSPACE_UID); - DocumentModel wspacePeople = repoSession.getDocument(nuxeoWspace); - String wspacePath = wspacePeople.getPathAsString(); - String docType = "Hello"; - String id = IdUtils.generateId("New " + docType); - //create document model - DocumentModel helloDoc = repoSession.createDocumentModel(wspacePath, id, docType); - fillDocument(personPart, helloDoc); - //create document with documentmodel - helloDoc = repoSession.createDocument(helloDoc); - repoSession.save(); - - personPart.setId(helloDoc.getId()); - - }catch(Exception e){ - e.printStackTrace(); - Response response = Response.status(Response.Status.NOT_FOUND).entity( - "Create failed").type("text/plain").build(); - throw new WebApplicationException(response); - }finally{ - if(repoSession != null){ - releaseRepositorySession(repoSession); - } - } - - if(logger.isDebugEnabled()){ - verboseObject("createPerson: person", PersonNuxeo.class, personPart); - verboseObject("createPerson: dublincore", DublincoreNuxeo.class, dcPart); - } - UriBuilder path = UriBuilder.fromResource(MultischemaResource.class); - - path.path("" + personPart.getId()); - Response response = Response.created(path.build()).build(); - return response; - } - - @GET - @Path("{id}") - @Produces("multipart/form-data") - public MultipartFormDataOutput getPerson( - @PathParam("id") String id) { - - PersonNuxeo personPart = new PersonNuxeo(); - DublincoreNuxeo dublinPart = new DublincoreNuxeo(); - MultipartFormDataOutput output = new MultipartFormDataOutput(); - RepositoryInstance repoSession = null; - - try{ - repoSession = getRepositorySession(); - DocumentRef helloDocRef = new IdRef(id); - DocumentModel helloDoc = repoSession.getDocument(helloDocRef); - if(helloDoc == null){ - Response response = Response.status(Response.Status.NOT_FOUND).entity( - "Get failed, the requested person ID:" + id + ": was not found.").type("text/plain").build(); - throw new WebApplicationException(response); - } - Document doc = getDocument(repoSession, helloDoc); - Element root = doc.getRootElement(); - //TODO: recognize schema thru namespace uri - //Namespace ns = new Namespace("hello", "http://collectionspace.org/hello"); - Iterator siter = root.elementIterator("schema"); - while(siter.hasNext()){ - - Element s = siter.next(); - - //TODO: recognize schema thru namespace uri - if("hello".equals(s.attribute("name").getValue())){ - personPart.setId(id); - Element ele = s.element("cversion"); - if(ele != null){ - personPart.setVersion((String) ele.getData()); - } - ele = s.element("firstName"); - if(ele != null){ - personPart.setFirstName((String) ele.getData()); - } - ele = s.element("lastName"); - if(ele != null){ - personPart.setLastName((String) ele.getData()); - } - ele = s.element("city"); - if(ele != null){ - personPart.setCity((String) ele.getData()); - } - ele = s.element("state"); - if(ele != null){ - personPart.setState((String) ele.getData()); - } - ele = s.element("zip"); - if(ele != null){ - personPart.setZip((String) ele.getData()); - } - ele = s.element("country"); - if(ele != null){ - personPart.setCountry((String) ele.getData()); - } - }else if("dublincore".equals(s.attribute("name").getValue())){ - Element ele = s.element("title"); - if(ele != null){ - dublinPart.setTitle((String) ele.getData()); - } - } - }//while - if(logger.isDebugEnabled()){ - verboseObject("getPerson:hello:", PersonNuxeo.class, personPart); - verboseObject("getPerson:dublincore:", DublincoreNuxeo.class, dublinPart); - } - output.addFormData("hello", personPart, MediaType.APPLICATION_XML_TYPE); - output.addFormData("dublincore", dublinPart, MediaType.APPLICATION_XML_TYPE); - - }catch(Exception e){ - if(e instanceof WebApplicationException){ - throw (WebApplicationException) e; - } - if(logger.isDebugEnabled()){ - e.printStackTrace(); - } - Response response = Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity( - "Get failed").type("text/plain").build(); - throw new WebApplicationException(response); - }finally{ - if(repoSession != null){ - releaseRepositorySession(repoSession); - } - } - return output; - } - - @PUT - @Path("{id}") - public PersonNuxeo updatePerson( - @PathParam("id") String id, - PersonNuxeo personPart) { - if(logger.isDebugEnabled()){ - verboseObject("updating person input", PersonNuxeo.class, personPart); - } - RepositoryInstance repoSession = null; - try{ - repoSession = getRepositorySession(); - DocumentRef helloDocRef = new IdRef(id); - DocumentModel helloDoc = repoSession.getDocument(helloDocRef); - if(helloDoc == null){ - Response response = Response.status(Response.Status.NOT_FOUND).entity( - "Get failed, the requested person ID:" + id + ": was not found.").type("text/plain").build(); - throw new WebApplicationException(response); - } - fillDocument(personPart, helloDoc); - repoSession.saveDocument(helloDoc); - repoSession.save(); - }catch(Exception e){ - if(e instanceof WebApplicationException){ - throw (WebApplicationException) e; - } - //FIXME: NOT_FOUND? - Response response = Response.status(Response.Status.NOT_FOUND).entity( - "Update failed ").type("text/plain").build(); - throw new WebApplicationException(response); - }finally{ - if(repoSession != null){ - releaseRepositorySession(repoSession); - } - } - return personPart; - } - - @DELETE - @Path("{id}") - public void deletePerson(@PathParam("id") String id) { - if(logger.isDebugEnabled()){ - logger.debug("deleting person with id=" + id); - } - RepositoryInstance repoSession = null; - try{ - repoSession = getRepositorySession(); - DocumentRef helloDocRef = new IdRef(id); - repoSession.removeDocument(helloDocRef); - repoSession.save(); - }catch(Exception e){ - //FIXME: NOT_FOUND? - Response response = Response.status(Response.Status.NOT_FOUND).entity( - "Delete failed ").type("text/plain").build(); - throw new WebApplicationException(response); - }finally{ - if(repoSession != null){ - releaseRepositorySession(repoSession); - } - } - } - - private RepositoryInstance getRepositorySession() throws Exception { - NuxeoConnector nuxeoConnector = NuxeoConnector.getInstance(); - nuxeoConnector.initialize(); - NuxeoClient client = nuxeoConnector.getClient(); - //FIXME: is it possible to reuse repository session? - //Authentication failures happen while trying to reuse the session - RepositoryInstance repoSession = client.openRepository(); - if(logger.isDebugEnabled()){ - logger.debug("getRepository() repository root: " + - repoSession.getRootDocument()); - } - return repoSession; - } - - private void releaseRepositorySession(RepositoryInstance repoSession) { - try{ - //release session - NuxeoClient.getInstance().releaseRepository(repoSession); - }catch(Exception e){ - logger.error("Could not close the repository session", e); - //no need to throw this service specific exception - } - } - - private Document getDocument(RepositoryInstance repoSession, DocumentModel helloDoc) - throws Exception { - Document doc = null; - DocumentWriter writer = null; - DocumentReader reader = null; - ByteArrayOutputStream baos = null; - ByteArrayInputStream bais = null; - try{ - baos = new ByteArrayOutputStream(); - //nuxeo io.impl begin - reader = new SingleDocumentReader(repoSession, helloDoc); - writer = new XMLDocumentWriter(baos); - DocumentPipe pipe = new DocumentPipeImpl(); - //nuxeo io.impl end - pipe.setReader(reader); - pipe.setWriter(writer); - pipe.run(); - bais = new ByteArrayInputStream(baos.toByteArray()); - SAXReader saxReader = new SAXReader(); - doc = saxReader.read(bais); - }finally{ - if(reader != null){ - reader.close(); - } - if(writer != null){ - writer.close(); - } - try{ - if(bais != null){ - bais.close(); - } - if(baos != null){ - baos.close(); - } - }catch(IOException ioe){ - logger.error("Failed to close io streams with {}", ioe); - throw new WebApplicationException(); - } - } - return doc; - } - - private void fillDocument(PersonNuxeo p, DocumentModel helloDoc) throws Exception { - if(p.getFirstName() != null){ - helloDoc.setPropertyValue("dublincore:title", p.getFirstName() + " " + p.getLastName()); - helloDoc.setPropertyValue("hello:firstName", p.getFirstName()); - } - if(p.getLastName() != null){ - helloDoc.setPropertyValue("hello:lastName", p.getLastName()); - } - if(p.getStreet() != null){ - helloDoc.setPropertyValue("hello:street", p.getStreet()); - } - if(p.getCity() != null){ - helloDoc.setPropertyValue("hello:city", p.getCity()); - } - if(p.getState() != null){ - helloDoc.setPropertyValue("hello:state", p.getState()); - } - if(p.getZip() != null){ - helloDoc.setPropertyValue("hello:zip", p.getZip()); - } - if(p.getCountry() != null){ - helloDoc.setPropertyValue("hello:country", p.getCountry()); - } - } - - private void verboseObject(String msg, Class klass, Object obj) { - try{ - if(logger.isDebugEnabled()){ - logger.debug(msg); - } - JAXBContext jc = JAXBContext.newInstance(klass); - Marshaller m = jc.createMarshaller(); - m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); - m.marshal(obj, System.out); - }catch(Exception e){ - e.printStackTrace(); - } - - } -} diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-javaapi-service/src/main/java/org/collectionspace/services/nuxeo/NuxeoConnector.java b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-javaapi-service/src/main/java/org/collectionspace/services/nuxeo/NuxeoConnector.java deleted file mode 100644 index bd67b290b..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-javaapi-service/src/main/java/org/collectionspace/services/nuxeo/NuxeoConnector.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ -package org.collectionspace.services.nuxeo; - -import java.io.File; -import java.util.Collection; -import org.nuxeo.ecm.core.client.NuxeoApp; -import org.nuxeo.ecm.core.client.NuxeoClient; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * NuxeoConnector is a facade to Nuxeo remoting client - * @author - */ -public class NuxeoConnector { - //FIXME: get port and host from configuration - public static int NUXEO_PORT = 62474; - public static String NUXEO_HOST = "localhost"; - private Logger logger = LoggerFactory.getLogger(NuxeoConnector.class); - private static final NuxeoConnector self = new NuxeoConnector(); - private NuxeoApp app; - private NuxeoClient client; - volatile boolean initialized = false; //use volatile for lazy initialization in singleton - - private NuxeoConnector() { - } - - public final static NuxeoConnector getInstance() { - return self; - } - - public void initialize() throws Exception { - - try{ - if(initialized == false){ - setProperties(); - app = new NuxeoApp(); - app.start(); - if(logger.isDebugEnabled()) { - logger.debug("initialize() NuxeoApp started"); - } - loadBundles(); - client = NuxeoClient.getInstance(); - initialized = true; - } - }catch(Exception e){ - if(logger.isDebugEnabled()){ - e.printStackTrace(); - } - } - } - - public void release() throws Exception { - if(initialized == true) { - client.disconnect(); - } - } - - private void loadBundles() throws Exception { - String bundles = "nuxeo-client/lib/nuxeo-runtime-*:nuxeo-client/lib/nuxeo-*"; - Collection files = null; - if(bundles != null){ - files = NuxeoApp.getBundleFiles(new File("."), bundles, ":"); - } - if(logger.isDebugEnabled()){ - logger.debug("loadBundles(): deploying bundles: " + files); - } - if(files != null){ - app.deployBundles(files); - } - } - - private void setProperties() { - System.setProperty("org.nuxeo.runtime.server.enabled", Boolean.FALSE.toString()); - System.setProperty("org.nuxeo.runtime.server.port", "" + NUXEO_PORT); - System.setProperty("org.nuxeo.runtime.server.host", "127.0.0.1"); - //System.setProperty("org.nuxeo.runtime.1.3.3.streaming.port", "3233"); - System.setProperty("org.nuxeo.runtime.streaming.serverLocator", "socket://127.0.0.1:3233"); - System.setProperty("org.nuxeo.runtime.streaming.isServer", Boolean.FALSE.toString()); - System.setProperty("org.nuxeo.client.remote", Boolean.TRUE.toString()); - } - - public NuxeoClient getClient() throws Exception { - if(initialized == true){ -// if(client.isConnected()){ -// return client; -// }else{ - //authentication failure error comes when reusing the client - //fore connect for now - client.forceConnect(NUXEO_HOST, NUXEO_PORT); - if(logger.isDebugEnabled()){ - logger.debug("getClient(): connection successful port=" + NUXEO_PORT); - } - return client; -// } - } - String msg = "NuxeoConnector is not initialized!"; - logger.error(msg); - throw new IllegalStateException(msg); - } -} diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-javaapi-service/src/main/resources/config/log4j.properties b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-javaapi-service/src/main/resources/config/log4j.properties deleted file mode 100644 index 718069d67..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-javaapi-service/src/main/resources/config/log4j.properties +++ /dev/null @@ -1,14 +0,0 @@ -# Set root logger level to DEBUG and its only appender to CONSOLE. -#log4j.rootLogger=INFO, CONSOLE, DEBUG -log4j.rootLogger=INFO, FILE, CONSOLE - -# CONSOLE -log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender -log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout -log4j.appender.CONSOLE.layout.ConversionPattern=%d{HH:mm:ss,SSS} [%t] %-5p %C{1} : %m%n - -# FILE -log4j.appender.FILE=org.apache.log4j.FileAppender -log4j.appender.FILE.File=log/server.log -log4j.appender.FILE.layout=org.apache.log4j.PatternLayout -log4j.appender.FILE.layout.ConversionPattern=%d{HH:mm:ss,SSS} [%t] %-5p %C{1} : %m%n diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-javaapi-service/src/main/resources/config/login-config.xml b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-javaapi-service/src/main/resources/config/login-config.xml deleted file mode 100644 index f78c9c945..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-javaapi-service/src/main/resources/config/login-config.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - Login modules used on JBoss - @author Bogdan Stefanescu (bs@nuxeo.com) - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-javaapi-service/src/main/webapp/WEB-INF/jboss-web.xml b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-javaapi-service/src/main/webapp/WEB-INF/jboss-web.xml deleted file mode 100644 index 5bc04b2c4..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-javaapi-service/src/main/webapp/WEB-INF/jboss-web.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-javaapi-service/src/main/webapp/WEB-INF/web.xml b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-javaapi-service/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index c2cd079c1..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-javaapi-service/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - HelloworldNuxeo - - - - javax.ws.rs.Application - org.collectionspace.hello.services.CollectionSpaceApplication - - - - resteasy.servlet.mapping.prefix - /cspace-nuxeo - - - - - org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap - - - - - Resteasy - - org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher - - - - - Resteasy - /cspace-nuxeo/* - - - diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/README.txt b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/README.txt deleted file mode 100644 index b1aa460dd..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/README.txt +++ /dev/null @@ -1,14 +0,0 @@ -Helloworld service interfacing with Nuxeo repository through Nuxeo -REST apis. - -System Requirements: -==================== -- Maven 2.0.9 or higher -- Nuxeo CollectionSpace Extensions - -Building the project: -==================== -In root directoy... -1. customize build.properties for your environment -2. mvn clean package -3. ant diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/build.properties b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/build.properties deleted file mode 100644 index 50c373854..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/build.properties +++ /dev/null @@ -1,4 +0,0 @@ -jboss.dir=C:/dev/jboss-4.2.3.GA -nuxeo.dir=${jboss.dir}/server/default/deploy/nuxeo.ear/system -nuxeo.local.repo.dir=file:///C:/dev/jboss-4.2.3.GA/server/default/deploy/nuxeo.ear/system -nuxeo.local.repo.client.dir=file:///C:/dev/nuxeo/nuxeo-core/nuxeo-core-client/target diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/build.xml b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/build.xml deleted file mode 100644 index cdba8639c..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/build.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/nb-configuration.xml b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/nb-configuration.xml deleted file mode 100644 index 3e5cd988f..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/nb-configuration.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - default - 8 - 80 - false - - diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/nbactions.xml b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/nbactions.xml deleted file mode 100644 index 9d30c239a..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/nbactions.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - - test - - * - - - test - - - - build - - * - - - install - - - - clean - - * - - - clean - - - - rebuild - - * - - - clean - install - - - true - - - - run - - war - ear - ejb - - - package - - - - true - - - - debug - - war - ear - ejb - - - package - - - - true - true - - - diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/pom.xml b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/pom.xml deleted file mode 100644 index 1a94a7889..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/pom.xml +++ /dev/null @@ -1,266 +0,0 @@ - - - - jaxrs-prototype - org.collectionspace.hello.services - 0.1 - - 4.0.0 - org.collectionspace.hello.services - jaxrs-nuxeo-service - war - 0.1 - jaxrs-nuxeo-service - - - - java.net - http://download.java.net/maven/1 - legacy - - - maven repo - maven repo - http://repo1.maven.org/maven2/ - - - - jboss - jboss repo - http://repository.jboss.org/maven2 - - - mojo - mojo repo - http://svn.codehaus.org/mojo/trunk/mojo/jboss-maven-plugin - - - - maven-restlet - Public online Restlet repository - http://maven.restlet.org - - - public - http://maven.nuxeo.org/public - - - - false - - - - public-snapshot - http://maven.nuxeo.org/public-snapshot - - false - - - - - - - - - - - public - http://maven.nuxeo.org/public - Nuxeo virtual release repository - - - - false - - - - public-snapshot - http://maven.nuxeo.org/public-snapshot - Nuxeo virtual snapshot repository - - false - - - - - - - - - 4.2.3.GA - 3.0 - UTF-8 - 1.5.1 - 0.9.7 - 5.2-SNAPSHOT - 1.5-SNAPSHOT - - - - - - org.collectionspace.hello.services - jaxrs-jaxb - 0.1 - - - org.jboss.resteasy - resteasy-jaxrs - 1.0.2.GA - - - tjws - webserver - - - - - org.jboss.resteasy - resteasy-jaxb-provider - 1.0.2.GA - - - org.jboss.resteasy - resteasy-multipart-provider - 1.0.2.GA - - - junit - junit - 4.1 - test - - - - - - - javax.security - jaas - 1.0.01 - provided - - - - dom4j - dom4j - 1.6.1 - provided - - - - - - - - org.nuxeo.ecm.core - nuxeo-core-api - ${nuxeo.version.1.5} - - - jboss-remoting - jboss - - - - - - - - org.restlet - org.restlet - 1.0.7 - - - com.noelios.restlet - com.noelios.restlet.ext.httpclient - 1.0.7 - - - com.noelios.restlet - com.noelios.restlet - 1.0.7 - - - - jaxen - jaxen - 1.1.1 - - - - - - - helloworld - - - org.codehaus.mojo - jboss-maven-plugin - - ${jboss.dir} - - - - jboss-undeploy - pre-integration-test - - undeploy - - - ${basedir}/target/helloworld.war - - - - jboss-deploy - pre-integration-test - - deploy - - - ${basedir}/target/helloworld.war - - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - - surefire-it - integration-test - - test - - - false - - - - - - org.apache.maven.plugins - maven-war-plugin - 2.0 - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.5 - 1.5 - - - - - diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/src/main/java/org/collectionspace/hello/services/CollectionSpaceResource.java b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/src/main/java/org/collectionspace/hello/services/CollectionSpaceResource.java deleted file mode 100644 index ff3ae26df..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/src/main/java/org/collectionspace/hello/services/CollectionSpaceResource.java +++ /dev/null @@ -1,24 +0,0 @@ -package org.collectionspace.hello.services; - -import org.collectionspace.hello.services.nuxeo.NuxeoRESTClient; - -public abstract class CollectionSpaceResource { - //replace WORKSPACE_UID for resource workspace - static String CS_COLLECTIONOBJECT_WORKSPACE_UID = "5a37d40f-59c4-4d15-93ad-e0e6a0c33587"; - //sanjay 6c7881fe-54c5-486e-b144-a025dee3a484 - //demo eae0d7b6-580a-45a3-a0f3-e25e980e03bb - static String CS_PERSON_WORKSPACE_UID = "6c7881fe-54c5-486e-b144-a025dee3a484"; - - //replace host if not running on localhost - //static String CS_NUXEO_HOST = "173.45.234.217"; - static String CS_NUXEO_HOST = "localhost"; - static String CS_NUXEO_URI = "http://" + CS_NUXEO_HOST + ":8080/nuxeo"; - - NuxeoRESTClient getClient() { - NuxeoRESTClient nxClient = new NuxeoRESTClient(CS_NUXEO_URI); - nxClient.setAuthType(NuxeoRESTClient.AUTH_TYPE_BASIC); - nxClient.setBasicAuthentication("Administrator", "Administrator"); - return nxClient; - } - -} diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/src/main/java/org/collectionspace/hello/services/HelloworldNuxeoApplication.java b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/src/main/java/org/collectionspace/hello/services/HelloworldNuxeoApplication.java deleted file mode 100644 index 98ae5b1c4..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/src/main/java/org/collectionspace/hello/services/HelloworldNuxeoApplication.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.collectionspace.hello.services; - -import javax.ws.rs.core.Application; -import java.util.HashSet; -import java.util.Set; - -public class HelloworldNuxeoApplication extends Application { - - private Set singletons = new HashSet(); - private Set> empty = new HashSet>(); - - public HelloworldNuxeoApplication() { - singletons.add(new IdentifierResource()); - singletons.add(new PersonNuxeoResource()); - singletons.add(new MultipartResource()); - } - - @Override - public Set> getClasses() { - return empty; - } - - @Override - public Set getSingletons() { - return singletons; - } -} diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/src/main/java/org/collectionspace/hello/services/IdentifierResource.java b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/src/main/java/org/collectionspace/hello/services/IdentifierResource.java deleted file mode 100644 index a91b4b56f..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/src/main/java/org/collectionspace/hello/services/IdentifierResource.java +++ /dev/null @@ -1,78 +0,0 @@ -package org.collectionspace.hello.services; - -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -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.UUID; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.atomic.AtomicLong; -import javax.ws.rs.core.UriBuilder; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.Marshaller; -import org.collectionspace.hello.Identifier; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@Path("/identifiers") -@Consumes("application/xml") -@Produces("application/xml") -public class IdentifierResource { - - final Logger logger = LoggerFactory.getLogger(IdentifierResource.class); - private Map idDB = new ConcurrentHashMap(); - private AtomicLong idCounter = new AtomicLong(); - - public IdentifierResource() { - // do nothing - } - - @POST - public Response createIdentifier(Identifier id) { - if (id.getNamespace() == null) { - id.setNamespace("edu.berkeley"); - } - id.setId(idCounter.incrementAndGet()); - id.setVersion(1); - UUID uuid = UUID.nameUUIDFromBytes(id.getNamespace().getBytes()); - id.setValue(uuid.toString()); - idDB.put(id.getId(), id); - verbose("created Id", id); - UriBuilder path = UriBuilder.fromResource(IdentifierResource.class); - path.path("" + id.getId()); - Response response = Response.created(path.build()).build(); - return response; - } - - @GET - @Path("{id}") - public Identifier getIdentifier(@PathParam("id") Long id) { - Identifier i = idDB.get(id); - if (i == 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 Id", i); - return i; - } - - private void verbose(String msg, Identifier id) { - try { - System.out.println("IdentifierResource : " + msg); - JAXBContext jc = JAXBContext.newInstance(Identifier.class); - Marshaller m = jc.createMarshaller(); - m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, - Boolean.TRUE); - m.marshal(id, System.out); - - } catch (Exception e) { - e.printStackTrace(); - } - } -} diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/src/main/java/org/collectionspace/hello/services/MultipartResource.java b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/src/main/java/org/collectionspace/hello/services/MultipartResource.java deleted file mode 100644 index 9e4fb9078..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/src/main/java/org/collectionspace/hello/services/MultipartResource.java +++ /dev/null @@ -1,352 +0,0 @@ -package org.collectionspace.hello.services; - -import java.io.ByteArrayInputStream; -import org.collectionspace.hello.services.nuxeo.NuxeoRESTClient; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import java.util.Map; -import javax.ws.rs.DELETE; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.PathParam; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriBuilder; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.Marshaller; -import org.collectionspace.hello.*; - -import org.collectionspace.world.DublincoreNuxeo; -import org.dom4j.Document; -import org.dom4j.Element; -import org.dom4j.io.SAXReader; -import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput; -import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataOutput; -import org.restlet.resource.Representation; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@Path("/multipart") -@Consumes("application/xml") -@Produces("application/xml") -public class MultipartResource extends CollectionSpaceResource { - - final Logger logger = LoggerFactory.getLogger(MultipartResource.class); - - public MultipartResource() { - } - - @POST - @Consumes("multipart/form-data") - public Response createPerson(MultipartFormDataInput multipart) { - - PersonNuxeo p = new PersonNuxeo(); - DublincoreNuxeo dc = new DublincoreNuxeo(); - NuxeoRESTClient nxClient = getClient(); - - List pathParams = new ArrayList(); - Map queryParams = new HashMap(); - pathParams.add("default"); - pathParams.add(CS_PERSON_WORKSPACE_UID); - pathParams.add("createDocument"); - queryParams.put("docType", "Hello"); - - try{ - if(multipart.getFormData().containsKey("dublincore")){ - dc = multipart.getFormDataPart("dublincore", DublincoreNuxeo.class, null); - if(dc.getTitle() != null){ - queryParams.put("dublincore:title", dc.getTitle()); - } - } - if(multipart.getFormData().containsKey("hello")){ - p = multipart.getFormDataPart("hello", PersonNuxeo.class, null); - queryParams.put("hello:cversion", Integer.valueOf(1).toString()); - if(p.getFirstName() != null){ - queryParams.put("hello:firstName", p.getFirstName()); - } - if(p.getLastName() != null){ - queryParams.put("hello:lastName", p.getLastName()); - } - if(p.getStreet() != null){ - queryParams.put("hello:street", p.getStreet()); - } - if(p.getCity() != null){ - queryParams.put("hello:city", p.getCity()); - } - if(p.getState() != null){ - queryParams.put("hello:state", p.getState()); - } - if(p.getZip() != null){ - queryParams.put("hello:zip", p.getZip()); - } - if(p.getCountry() != null){ - queryParams.put("hello:country", p.getCountry()); - } - } - ByteArrayInputStream bais = new ByteArrayInputStream(new byte[0]); - Representation res = nxClient.post(pathParams, queryParams, bais); - - SAXReader reader = new SAXReader(); - - Document document = reader.read(res.getStream()); - Element root = document.getRootElement(); - for(Iterator i = root.elementIterator(); i.hasNext();){ - Element element = (Element) i.next(); - if("docRef".equals(element.getName())){ - String id = (String) element.getData(); - p.setId(id); - } - } - }catch(Exception e){ - Response response = Response.status(Response.Status.NOT_FOUND).entity( - "Create failed").type("text/plain").build(); - throw new WebApplicationException(response); - } - - verbosePerson("createPerson: person", p); - verboseDublin("createPerson: dublincore", dc); - UriBuilder path = UriBuilder.fromResource(MultipartResource.class); - path.path("" + p.getId()); - Response response = Response.created(path.build()).build(); - return response; - } - - @GET - @Path("{id}") - @Produces("multipart/form-data") - public MultipartFormDataOutput getPerson(@PathParam("id") String id) { - - PersonNuxeo person = new PersonNuxeo(); - DublincoreNuxeo dublin = new DublincoreNuxeo(); - MultipartFormDataOutput output = new MultipartFormDataOutput(); - - try{ - NuxeoRESTClient nxClient = getClient(); - - List pathParams = new ArrayList(); - Map queryParams = new HashMap(); - - pathParams.add("default"); - pathParams.add(id); - pathParams.add("export"); - queryParams.put("format", "XML"); - - Representation res = nxClient.get(pathParams, queryParams); - SAXReader reader = new SAXReader(); - - Document document = reader.read(res.getStream()); - Element root = document.getRootElement(); - - //TODO: recognize schema thru namespace uri -// Namespace ns = new Namespace("hello", "http://collectionspace.org/hello"); - Iterator siter = root.elementIterator("schema"); - while(siter.hasNext()){ - - Element s = siter.next(); - - //TODO: recognize schema thru namespace uri - if("hello".equals(s.attribute("name").getValue())){ - person.setId(id); - Element ele = s.element("cversion"); - if(ele != null){ - person.setVersion((String) ele.getData()); - } - ele = s.element("firstName"); - if(ele != null){ - person.setFirstName((String) ele.getData()); - } - ele = s.element("lastName"); - if(ele != null){ - person.setLastName((String) ele.getData()); - } - ele = s.element("city"); - if(ele != null){ - person.setCity((String) ele.getData()); - } - ele = s.element("state"); - if(ele != null){ - person.setState((String) ele.getData()); - } - ele = s.element("zip"); - if(ele != null){ - person.setZip((String) ele.getData()); - } - ele = s.element("country"); - if(ele != null){ - person.setCountry((String) ele.getData()); - } - }else if("dublincore".equals(s.attribute("name").getValue())){ - Element ele = s.element("title"); - if(ele != null){ - dublin.setTitle((String) ele.getData()); - } - } - }//while - verbosePerson("getPerson:hello:", person); - output.addFormData("hello", person, MediaType.APPLICATION_XML_TYPE); - verboseDublin("getPerson:dublincore:", dublin); - output.addFormData("dublincore", dublin, MediaType.APPLICATION_XML_TYPE); - - }catch(Exception e){ - e.printStackTrace(); - Response response = Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity( - "Get failed").type("text/plain").build(); - throw new WebApplicationException(response); - } - if(person == null){ - Response response = Response.status(Response.Status.NOT_FOUND).entity( - "Get failed, the requested person ID:" + id + ": was not found.").type("text/plain").build(); - throw new WebApplicationException(response); - } - - return output; - } - - @PUT - @Path("{id}") - public PersonNuxeo updatePerson( - @PathParam("id") String id, - PersonNuxeo update) { - - verbosePerson("updating person input", update); - - NuxeoRESTClient nxClient = getClient(); - - List pathParams = new ArrayList(); - Map queryParams = new HashMap(); - pathParams.add("default"); - pathParams.add(update.getId()); - pathParams.add("updateDocumentRestlet"); - queryParams.put("dublincore:title", "change title"); - //todo: intelligent merge needed - if(update.getFirstName() != null){ - queryParams.put("hello:firstName", update.getFirstName()); - } - - if(update.getLastName() != null){ - queryParams.put("hello:lastName", update.getLastName()); - } - - if(update.getFirstName() != null && update.getLastName() != null){ - queryParams.put("dublincore:title", update.getFirstName() + " " + update.getLastName()); - } - - if(update.getStreet() != null){ - queryParams.put("hello:street", update.getStreet()); - } - - if(update.getCity() != null){ - queryParams.put("hello:city", update.getCity()); - } - - if(update.getState() != null){ - queryParams.put("hello:state", update.getState()); - } - - if(update.getZip() != null){ - queryParams.put("hello:zip", update.getZip()); - } - - if(update.getCountry() != null){ - queryParams.put("hello:country", update.getCountry()); - } - - Representation res = nxClient.get(pathParams, queryParams); - SAXReader reader = new SAXReader(); - String status = ""; - try{ - Document document = reader.read(res.getStream()); - Element root = document.getRootElement(); - for(Iterator i = root.elementIterator(); i.hasNext();){ - Element element = (Element) i.next(); - if("docRef".equals(element.getName())){ - status = (String) element.getData(); - verbose("updatePerson: response=" + status); - } - - } - }catch(Exception e){ - //FIXME: NOT_FOUND? - Response response = Response.status(Response.Status.NOT_FOUND).entity( - "Update failed ").type("text/plain").build(); - throw new WebApplicationException(response); - } - return update; - } - - @DELETE - @Path("{id}") - public void deletePerson(@PathParam("id") String id) { - verbose("deleting person with id=" + id); - NuxeoRESTClient nxClient = getClient(); - List pathParams = new ArrayList(); - Map queryParams = new HashMap(); - pathParams.add("default"); - pathParams.add(id); - pathParams.add("deleteDocumentRestlet"); - Representation res = nxClient.get(pathParams, queryParams); - SAXReader reader = new SAXReader(); - String status = ""; - try{ - Document document = reader.read(res.getStream()); - Element root = document.getRootElement(); - for(Iterator i = root.elementIterator(); i.hasNext();){ - Element element = (Element) i.next(); - if("docRef".equals(element.getName())){ - status = (String) element.getData(); - verbose("deletePerson: response=" + status); - } - - } - }catch(Exception e){ - //FIXME: NOT_FOUND? - Response response = Response.status(Response.Status.NOT_FOUND).entity( - "Delete failed ").type("text/plain").build(); - throw new WebApplicationException(response); - } - - } - - private void verbosePerson(String msg, PersonNuxeo person) { - try{ - verbose(msg); - JAXBContext jc = JAXBContext.newInstance( - PersonNuxeo.class); - - Marshaller m = jc.createMarshaller(); - m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, - Boolean.TRUE); - m.marshal(person, System.out); - }catch(Exception e){ - e.printStackTrace(); - } - - } - - private void verboseDublin(String msg, DublincoreNuxeo dubin) { - try{ - verbose(msg); - JAXBContext jc = JAXBContext.newInstance( - DublincoreNuxeo.class); - - Marshaller m = jc.createMarshaller(); - m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, - Boolean.TRUE); - m.marshal(dubin, System.out); - }catch(Exception e){ - e.printStackTrace(); - } - - } - - private void verbose(String msg) { - System.out.println("MultipartResource: " + msg); - } -} diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/src/main/java/org/collectionspace/hello/services/PersonNuxeoResource.java b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/src/main/java/org/collectionspace/hello/services/PersonNuxeoResource.java deleted file mode 100644 index 50149d8ce..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/src/main/java/org/collectionspace/hello/services/PersonNuxeoResource.java +++ /dev/null @@ -1,361 +0,0 @@ -package org.collectionspace.hello.services; - -import java.io.ByteArrayInputStream; -import org.collectionspace.hello.services.nuxeo.NuxeoRESTClient; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import java.util.Map; -import javax.ws.rs.DELETE; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.PathParam; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriBuilder; -import javax.ws.rs.core.UriInfo; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.Marshaller; -import org.collectionspace.hello.*; - - -import org.collectionspace.hello.People.PeopleItem; -import org.dom4j.Document; -import org.dom4j.Element; -import org.dom4j.Namespace; -import org.dom4j.io.SAXReader; -import org.restlet.resource.Representation; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@Path("/persons") -@Consumes("application/xml") -@Produces("application/xml") -public class PersonNuxeoResource extends CollectionSpaceResource { - - final Logger logger = LoggerFactory.getLogger(PersonNuxeoResource.class); - - public PersonNuxeoResource() { - } - - @GET - public People getPeople(@Context UriInfo ui) { - People p = new People(); - try{ - List list = p.getPeopleItem(); - NuxeoRESTClient nxClient = getClient(); - - List pathParams = new ArrayList(); - Map queryParams = new HashMap(); - - pathParams = Arrays.asList("default", CS_PERSON_WORKSPACE_UID, "browse"); - Representation res = nxClient.get(pathParams, queryParams); - SAXReader reader = new SAXReader(); - Document document = reader.read(res.getStream()); - Element root = document.getRootElement(); - for(Iterator i = root.elementIterator(); i.hasNext();){ - Element element = (Element) i.next(); - PeopleItem pli = new PeopleItem(); - pli.setTitle(element.attributeValue("title")); - pli.setUri(element.attributeValue("url")); - pli.setId(element.attributeValue("id")); - list.add(pli); - } - - }catch(Exception e){ - e.printStackTrace(); - } - return p; - } - - @POST - public Response createPerson(PersonNuxeo p) { - - NuxeoRESTClient nxClient = getClient(); - - List pathParams = new ArrayList(); - Map queryParams = new HashMap(); - pathParams.add("default"); - pathParams.add(CS_PERSON_WORKSPACE_UID); - pathParams.add("createDocument"); - queryParams.put("docType", "Hello"); - queryParams.put("dublincore:title", p.getFirstName() + " " + p.getLastName()); - queryParams.put("hello:cversion", Integer.valueOf(1).toString()); - queryParams.put("hello:firstName", p.getFirstName()); - queryParams.put("hello:lastName", p.getLastName()); - queryParams.put("hello:street", p.getStreet()); - queryParams.put("hello:city", p.getCity()); - queryParams.put("hello:state", p.getState()); - queryParams.put("hello:zip", p.getZip()); - queryParams.put("hello:country", p.getCountry()); - ByteArrayInputStream bais = new ByteArrayInputStream(new byte[0]); - Representation res = nxClient.post(pathParams, queryParams,bais); - - SAXReader reader = new SAXReader(); - try{ - Document document = reader.read(res.getStream()); - Element root = document.getRootElement(); - for(Iterator i = root.elementIterator(); i.hasNext();){ - Element element = (Element) i.next(); - if("docRef".equals(element.getName())){ - String id = (String) element.getData(); - p.setId(id); - } - } - }catch(Exception e){ - Response response = Response.status(Response.Status.NOT_FOUND).entity( - "Create failed").type("text/plain").build(); - throw new WebApplicationException(response); - } - - verbose("created person", p); - UriBuilder path = UriBuilder.fromResource(PersonNuxeoResource.class); - path.path("" + p.getId()); - Response response = Response.created(path.build()).build(); - return response; - } - - @GET - @Path("{id}") - public PersonNuxeo getPerson(@PathParam("id") String id) { - - PersonNuxeo p = null; - try{ - - NuxeoRESTClient nxClient = getClient(); - - List pathParams = new ArrayList(); - Map queryParams = new HashMap(); - - pathParams.add("default"); - pathParams.add(id); - pathParams.add("export"); - queryParams.put("format", "XML"); - - Representation res = nxClient.get(pathParams, queryParams); - SAXReader reader = new SAXReader(); - - Document document = reader.read(res.getStream()); - Element root = document.getRootElement(); - p = new PersonNuxeo(); - //TODO: recognize schema thru namespace uri -// Namespace ns = new Namespace("hello", "http://collectionspace.org/hello"); - Iterator siter = root.elementIterator("schema"); - while(siter.hasNext()){ - - Element s = siter.next(); - - //TODO: recognize schema thru namespace uri - if("hello".equals(s.attribute("name").getValue())){ - p.setId(id); - Element ele = s.element("cversion"); - if(ele != null){ - p.setVersion((String) ele.getData()); - } - ele = s.element("firstName"); - if(ele != null){ - p.setFirstName((String) ele.getData()); - } - ele = s.element("lastName"); - if(ele != null){ - p.setLastName((String) ele.getData()); - } - ele = s.element("city"); - if(ele != null){ - p.setCity((String) ele.getData()); - } - ele = s.element("state"); - if(ele != null){ - p.setState((String) ele.getData()); - } - ele = s.element("zip"); - if(ele != null){ - p.setZip((String) ele.getData()); - } - ele = s.element("country"); - if(ele != null){ - p.setCountry((String) ele.getData()); - } - } - } - - }catch(Exception e){ - e.printStackTrace(); - Response response = Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity( - "Get failed").type("text/plain").build(); - throw new WebApplicationException(response); - } - if(p == null){ - Response response = Response.status(Response.Status.NOT_FOUND).entity( - "Get failed, the requested person ID:" + id + ": was not found.").type("text/plain").build(); - throw new WebApplicationException(response); - } - verbose("get person", p); - return p; - } - - @PUT - @Path("{id}") - public PersonNuxeo updatePerson( - @PathParam("id") String id, - PersonNuxeo update) { - - verbose("updating person input", update); - - NuxeoRESTClient nxClient = getClient(); - - List pathParams = new ArrayList(); - Map queryParams = new HashMap(); - pathParams.add("default"); - pathParams.add(update.getId()); - pathParams.add("updateDocumentRestlet"); - queryParams.put("dublincore:title", "change title"); - //todo: intelligent merge needed - if(update.getFirstName() != null){ - queryParams.put("hello:firstName", update.getFirstName()); - } - - if(update.getLastName() != null){ - queryParams.put("hello:lastName", update.getLastName()); - } - - if(update.getFirstName() != null && update.getLastName() != null){ - queryParams.put("dublincore:title", update.getFirstName() + " " + update.getLastName()); - } - - if(update.getStreet() != null){ - queryParams.put("hello:street", update.getStreet()); - } - - if(update.getCity() != null){ - queryParams.put("hello:city", update.getCity()); - } - - if(update.getState() != null){ - queryParams.put("hello:state", update.getState()); - } - - if(update.getZip() != null){ - queryParams.put("hello:zip", update.getZip()); - } - - if(update.getCountry() != null){ - queryParams.put("hello:country", update.getCountry()); - } - - Representation res = nxClient.get(pathParams, queryParams); - SAXReader reader = new SAXReader(); - String status = ""; - try{ - Document document = reader.read(res.getStream()); - Element root = document.getRootElement(); - for(Iterator i = root.elementIterator(); i.hasNext();){ - Element element = (Element) i.next(); - if("docRef".equals(element.getName())){ - status = (String) element.getData(); - verbose("updatePerson: response=" + status); - } - - } - }catch(Exception e){ - //FIXME: NOT_FOUND? - Response response = Response.status(Response.Status.NOT_FOUND).entity( - "Update failed ").type("text/plain").build(); - throw new WebApplicationException(response); - } - return update; - } - - @DELETE - @Path("{id}") - public void deletePerson(@PathParam("id") String id) { - verbose("deleting person with id=" + id); - NuxeoRESTClient nxClient = getClient(); - List pathParams = new ArrayList(); - Map queryParams = new HashMap(); - pathParams.add("default"); - pathParams.add(id); - pathParams.add("deleteDocumentRestlet"); - Representation res = nxClient.get(pathParams, queryParams); - SAXReader reader = new SAXReader(); - String status = ""; - try{ - Document document = reader.read(res.getStream()); - Element root = document.getRootElement(); - for(Iterator i = root.elementIterator(); i.hasNext();){ - Element element = (Element) i.next(); - if("docRef".equals(element.getName())){ - status = (String) element.getData(); - verbose("deletePerson: response=" + status); - } - - } - }catch(Exception e){ - //FIXME: NOT_FOUND? - Response response = Response.status(Response.Status.NOT_FOUND).entity( - "Delete failed ").type("text/plain").build(); - throw new WebApplicationException(response); - } - - } - - private void verbose(String msg, PersonNuxeo p) { - try{ - verbose(msg); - JAXBContext jc = JAXBContext.newInstance( - PersonNuxeo.class); - - Marshaller m = jc.createMarshaller(); - m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, - Boolean.TRUE); - m.marshal(p, System.out); - } catch(Exception e){ - e.printStackTrace(); - } - - } - -// private void getQueryModel() throws IOException { -// NuxeoRESTClient nxClient = getClient(); -// -// List pathParams = new ArrayList(); -// Map queryParams = new HashMap(); -// -// //query model for user documents -// pathParams = Arrays.asList("execQueryModel", "USER_DOCUMENTS"); -// queryParams.put("QP1", "Administrator"); -// queryParams.put("format", "XML"); -// -// -// Representation res = nxClient.get(pathParams, queryParams); -// String resStr = res.getText(); -// verbose("getQueryModel:" + resStr); -// -// } -// -// private void getVocabulary() throws IOException { -// NuxeoRESTClient nxClient = getClient(); -// -// List pathParams = new ArrayList(); -// Map queryParams = new HashMap(); -// //get vocabulary -// pathParams = Arrays.asList("vocabulary", "continent_country"); -// queryParams.put("lang", "en"); -// -// Representation res = nxClient.get(pathParams, queryParams); -// String resStr = res.getText(); -// verbose("getVocabulary:" + resStr); -// -// } - - private void verbose(String msg) { - System.out.println("PersonNuxeoResource: " + msg); - } -} diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/src/main/java/org/collectionspace/hello/services/nuxeo/NuxeoCallback.java b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/src/main/java/org/collectionspace/hello/services/nuxeo/NuxeoCallback.java deleted file mode 100644 index 8e78e0076..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/src/main/java/org/collectionspace/hello/services/nuxeo/NuxeoCallback.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ - -package org.collectionspace.hello.services.nuxeo; - - -import javax.security.auth.callback.Callback; - -/** - * Copied from jbossx - * - * An implementation of Callback that simply obtains an Object to be used - * as the authentication credential. Interpretation of the Object is up to - * the LoginModules that validate the credential. - * - * @author Scott.Stark@jboss.org - */ -public class NuxeoCallback implements Callback { - - private final String prompt; - - private Object credential; - - public NuxeoCallback() { - this(""); - } - - public NuxeoCallback(String prompt) { - this.prompt = prompt; - } - - public String getPrompt() { - return prompt; - } - - public Object getCredential() { - return credential; - } - - public void setCredential(Object credential) { - this.credential = credential; - } - - public void clearCredential() { - credential = null; - } - -} diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/src/main/java/org/collectionspace/hello/services/nuxeo/NuxeoCallbackHandler.java b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/src/main/java/org/collectionspace/hello/services/nuxeo/NuxeoCallbackHandler.java deleted file mode 100644 index e8fff8c25..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/src/main/java/org/collectionspace/hello/services/nuxeo/NuxeoCallbackHandler.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ -package org.collectionspace.hello.services.nuxeo; - -/** - * - * @author sanjaydalal - */ -import javax.security.auth.callback.Callback; -import javax.security.auth.callback.CallbackHandler; -import javax.security.auth.callback.NameCallback; -import javax.security.auth.callback.PasswordCallback; -import javax.security.auth.callback.UnsupportedCallbackException; - -/** - * Copied from jbossx. - * - * @author Scott.Stark@jboss.org - */ -public class NuxeoCallbackHandler implements CallbackHandler { - - private final String username; - private char[] password; - private final Object credential; - - /** - * Initializes the UsernamePasswordHandler with the username and password to - * use. - * - * @param username the user name - * @param password the password for this user - */ - public NuxeoCallbackHandler(String username, char[] password) { - this.username = username; - this.password = password; - credential = password; - } - - public NuxeoCallbackHandler(String username, Object credential) { - this.username = username; - this.credential = credential; - if (credential instanceof char[]) { - password = (char[]) credential; - } else if (credential instanceof CharSequence) { - password = credential.toString().toCharArray(); - } - } - - /** - * Sets any NameCallback name property to the instance username, sets any - * PasswordCallback password property to the instance, and any password. - * - * @exception UnsupportedCallbackException, - * thrown if any callback of type other than NameCallback or - * PasswordCallback are seen. - */ - public void handle(Callback[] callbacks) - throws UnsupportedCallbackException { - for (Callback c : callbacks) { - if (c instanceof NameCallback) { - NameCallback nc = (NameCallback) c; - nc.setName(username); - } else if (c instanceof PasswordCallback) { - PasswordCallback pc = (PasswordCallback) c; - if (password == null) { - // We were given an opaque Object credential but a char[] is - // requested? - if (credential != null) { - String tmp = credential.toString(); - password = tmp.toCharArray(); - } - } - pc.setPassword(password); - } else if (c instanceof NuxeoCallback) { - NuxeoCallback oc = (NuxeoCallback) c; - oc.setCredential(credential); - } else { - throw new UnsupportedCallbackException(c, - "Unrecognized Callback"); - } - } - } -} diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/src/main/java/org/collectionspace/hello/services/nuxeo/NuxeoLoginConfiguration.java b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/src/main/java/org/collectionspace/hello/services/nuxeo/NuxeoLoginConfiguration.java deleted file mode 100644 index 81cedc3c4..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/src/main/java/org/collectionspace/hello/services/nuxeo/NuxeoLoginConfiguration.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ -package org.collectionspace.hello.services.nuxeo; - -/** - * - * @author sanjaydalal - */ -import java.util.HashMap; -import java.util.Map; - -import javax.security.auth.login.AppConfigurationEntry; -import javax.security.auth.login.Configuration; -import javax.security.auth.login.AppConfigurationEntry.LoginModuleControlFlag; - -public class NuxeoLoginConfiguration extends Configuration { - - private final Configuration parent; - public static final String LOGIN_DOMAIN = "nuxeo-client-login"; - - public NuxeoLoginConfiguration(Configuration parent) { - this.parent = parent; - } - - @Override - public AppConfigurationEntry[] getAppConfigurationEntry(String name) { - - if (LOGIN_DOMAIN.equals(name)) { - AppConfigurationEntry[] entries = new AppConfigurationEntry[1]; - - Map options = new HashMap(); - - options.put("restore-login-identity", "True"); - options.put("multi-threaded", "True"); - - entries[0] = new AppConfigurationEntry("org.jboss.security.ClientLoginModule", LoginModuleControlFlag.REQUIRED, options); - - - return entries; - } else { - return parent.getAppConfigurationEntry(name); - } - } - - @Override - public void refresh() { - if (parent != null) { - parent.refresh(); - } - } -} diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/src/main/java/org/collectionspace/hello/services/nuxeo/NuxeoLoginContextFactory.java b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/src/main/java/org/collectionspace/hello/services/nuxeo/NuxeoLoginContextFactory.java deleted file mode 100644 index d1d23f7fc..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/src/main/java/org/collectionspace/hello/services/nuxeo/NuxeoLoginContextFactory.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ - -package org.collectionspace.hello.services.nuxeo; - -/** - * - * @author sanjaydalal - */ - -import javax.security.auth.callback.CallbackHandler; -import javax.security.auth.login.Configuration; -import javax.security.auth.login.LoginContext; -import javax.security.auth.login.LoginException; - -public class NuxeoLoginContextFactory { - - - private static boolean initDone=false; - - private static void initLoginConfig() - { - if (initDone) - return; - - Configuration parentConfig = null; - try { - parentConfig = Configuration.getConfiguration(); - } catch (Exception e) { - // do nothing - this can happen if default configuration provider is not correctly configured - // for examnple FileConfig fails if no config file was defined - } - Configuration config = new NuxeoLoginConfiguration(parentConfig); - Configuration.setConfiguration(config); - - initDone=true; - - } - - - public static LoginContext getLoginContext(CallbackHandler handler) throws LoginException - { - initLoginConfig(); - return new LoginContext(NuxeoLoginConfiguration.LOGIN_DOMAIN, handler); - } -} diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/src/main/java/org/collectionspace/hello/services/nuxeo/NuxeoRESTClient.java b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/src/main/java/org/collectionspace/hello/services/nuxeo/NuxeoRESTClient.java deleted file mode 100644 index 9f76f7b92..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/src/main/java/org/collectionspace/hello/services/nuxeo/NuxeoRESTClient.java +++ /dev/null @@ -1,313 +0,0 @@ -/* - * (C) Copyright 2006-2007 Nuxeo SAS (http://nuxeo.com/) and contributors. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the GNU Lesser General Public License - * (LGPL) version 2.1 which accompanies this distribution, and is available at - * http://www.gnu.org/licenses/lgpl.html - * - * 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. - * - * Contributors: - * Nuxeo - initial API and implementation - * - * $Id: JOOoConvertPluginImpl.java 18651 2007-05-13 20:28:53Z sfermigier $ - */ -package org.collectionspace.hello.services.nuxeo; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.List; -import java.util.Map; - - -import org.restlet.Client; -import org.restlet.data.ChallengeResponse; -import org.restlet.data.ChallengeScheme; -import org.restlet.data.Cookie; -import org.restlet.data.Form; -import org.restlet.data.MediaType; -import org.restlet.data.Method; -import org.restlet.data.Parameter; -import org.restlet.data.Protocol; -import org.restlet.data.Request; -import org.restlet.resource.OutputRepresentation; -import org.restlet.resource.Representation; -import org.restlet.util.Series; - -public class NuxeoRESTClient { - - public static final int AUTH_TYPE_NONE = 0; - public static final int AUTH_TYPE_BASIC = 1; - public static final int AUTH_TYPE_SECRET = 2; - protected String baseURL = "http://127.0.0.1:8080/nuxeo"; - protected String restPrefix = "restAPI"; - protected String davPrefix = "dav"; - protected List cookies; - protected int authType = AUTH_TYPE_NONE; - protected String userName; - protected String password; - protected String secretToken; - protected Client restClient; - - public NuxeoRESTClient(String baseURL) { - this.baseURL = baseURL; - } - - public NuxeoRESTClient(String protocol, String serverIP, String serverPort) { - this(protocol, serverIP, serverPort, "nuxeo"); - } - - public NuxeoRESTClient(String protocol, String serverIP, String serverPort, - String servletPath) { - StringBuffer sb = new StringBuffer(); - sb.append(protocol); - sb.append("://"); - sb.append(serverIP); - if (serverPort != null && !serverIP.equals("80")) { - sb.append(':'); - sb.append(serverPort); - } - sb.append(servletPath); - sb.append('/'); - baseURL = sb.toString(); - } - - public void setBasicAuthentication(String userName, String password) { - authType = AUTH_TYPE_BASIC; - this.userName = userName; - this.password = password; - } - - public void setSharedSecretAuthentication(String userName, - String secretToken) { - authType = AUTH_TYPE_SECRET; - this.userName = userName; - this.secretToken = secretToken; - } - - public void setCookies(List cookies) { - this.cookies = cookies; - } - - public Representation post(List pathParams, - Map queryParams, InputStream istream) { - String path = ""; - StringBuffer pathBuffer = new StringBuffer(); - - if (pathParams != null) { - for (String p : pathParams) { - pathBuffer.append(p); - pathBuffer.append('/'); - } - path = pathBuffer.toString(); - } - - return post(path, queryParams, istream); - } - - public Representation post(String subPath, - Map queryParams, InputStream istream) { - StringBuffer urlBuffer = new StringBuffer(); - - if (subPath.startsWith("/")) { - subPath = subPath.substring(1); - } - if (subPath.endsWith("/")) { - subPath = subPath.substring(0, subPath.length() - 1); - } - - urlBuffer.append(baseURL); - urlBuffer.append('/'); - urlBuffer.append(restPrefix); - urlBuffer.append('/'); - urlBuffer.append(subPath); - - if (queryParams != null) { - urlBuffer.append('?'); - - String qpValue = null; - for (String qpName : queryParams.keySet()) { - urlBuffer.append(qpName); - urlBuffer.append('='); - qpValue = queryParams.get(qpName); - if (qpValue != null) { - urlBuffer.append(qpValue.replaceAll(" ", "%20")); - } - urlBuffer.append('&'); - } - } - - String completeURL = urlBuffer.toString(); - System.out.println("\nNuxeoRESTClient: calling " + completeURL); - Request request = new Request(Method.POST, completeURL); - - setupAuth(request); - setupCookies(request); - final InputStream in = istream; - request.setEntity(new OutputRepresentation( - MediaType.MULTIPART_FORM_DATA) { - - @Override - public void write(OutputStream outputStream) throws IOException { - byte[] buffer = new byte[1024 * 64]; - int read; - while ((read = in.read(buffer)) != -1) { - outputStream.write(buffer, 0, read); - } - - } - }); - - return getRestClient().handle(request).getEntity(); - } - - public Representation get(List pathParams, - Map queryParams) { - String path = ""; - StringBuffer pathBuffer = new StringBuffer(); - - if (pathParams != null) { - for (String p : pathParams) { - pathBuffer.append(p); - pathBuffer.append('/'); - } - path = pathBuffer.toString(); - } - - return get(path, queryParams); - } - - public Representation get(String subPath, - Map queryParams) { - StringBuffer urlBuffer = new StringBuffer(); - - if (subPath.startsWith("/")) { - subPath = subPath.substring(1); - } - if (subPath.endsWith("/")) { - subPath = subPath.substring(0, subPath.length() - 1); - } - - urlBuffer.append(baseURL); - urlBuffer.append('/'); - urlBuffer.append(restPrefix); - urlBuffer.append('/'); - urlBuffer.append(subPath); - - if (queryParams != null) { - urlBuffer.append('?'); - for (String qpName : queryParams.keySet()) { - urlBuffer.append(qpName); - urlBuffer.append('='); - urlBuffer.append(queryParams.get(qpName).replaceAll(" ", "%20")); - urlBuffer.append('&'); - } - } - - String completeURL = urlBuffer.toString(); - System.out.println("\nNuxeoRESTClient: calling " + completeURL); - Request request = new Request(Method.GET, completeURL); - setupAuth(request); - setupCookies(request); - - return getRestClient().handle(request).getEntity(); - } - - protected void setupAuth(Request request) { - - if (authType == AUTH_TYPE_BASIC) { - ChallengeScheme scheme = ChallengeScheme.HTTP_BASIC; - ChallengeResponse authentication = new ChallengeResponse(scheme, - userName, password); - request.setChallengeResponse(authentication); - - } else if (authType == AUTH_TYPE_SECRET) { - Series additionnalHeaders = new Form(); - - Map securityHeaders = PortalSSOAuthenticationProvider.getHeaders( - secretToken, userName); - - for (String hn : securityHeaders.keySet()) { - additionnalHeaders.add(hn, securityHeaders.get(hn)); - } - - request.getAttributes().put("org.restlet.http.headers", - additionnalHeaders); - } - } - - protected void setupCookies(Request request) { - if (cookies != null) { - request.getCookies().clear(); - for (Cookie cookie : cookies) { - request.getCookies().add(cookie); - } - } - - } - - protected Client getRestClient() { - if (restClient == null) { - if (baseURL.startsWith("https")) { - restClient = new Client(Protocol.HTTPS); - } else { - restClient = new Client(Protocol.HTTP); - } - } - - return restClient; - } - - public int getAuthType() { - return authType; - } - - public void setAuthType(int authType) { - this.authType = authType; - } - - public String getDavPrefix() { - return davPrefix; - } - - public void setDavPrefix(String davPrefix) { - this.davPrefix = davPrefix; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public String getRestPrefix() { - return restPrefix; - } - - public void setRestPrefix(String restPrefix) { - this.restPrefix = restPrefix; - } - - public String getSecretToken() { - return secretToken; - } - - public void setSecretToken(String secretToken) { - this.secretToken = secretToken; - } - - public String getUserName() { - return userName; - } - - public void setUserName(String userName) { - this.userName = userName; - } -} diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/src/main/java/org/collectionspace/hello/services/nuxeo/PortalSSOAuthenticationProvider.java b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/src/main/java/org/collectionspace/hello/services/nuxeo/PortalSSOAuthenticationProvider.java deleted file mode 100644 index ef1a61a40..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/src/main/java/org/collectionspace/hello/services/nuxeo/PortalSSOAuthenticationProvider.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * (C) Copyright 2006-2007 Nuxeo SAS (http://nuxeo.com/) and contributors. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the GNU Lesser General Public License - * (LGPL) version 2.1 which accompanies this distribution, and is available at - * http://www.gnu.org/licenses/lgpl.html - * - * 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. - * - * Contributors: - * Nuxeo - initial API and implementation - * - * $Id: JOOoConvertPluginImpl.java 18651 2007-05-13 20:28:53Z sfermigier $ - */ - -package org.collectionspace.hello.services.nuxeo; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; -import java.util.Date; -import java.util.HashMap; -import java.util.Map; -import java.util.Random; - -import com.noelios.restlet.util.Base64; - -public class PortalSSOAuthenticationProvider { - - private static final String TOKEN_SEP = ":"; - - private static final String TS_HEADER = "NX_TS"; - - private static final String RANDOM_HEADER = "NX_RD"; - - private static final String TOKEN_HEADER = "NX_TOKEN"; - - private static final String USER_HEADER = "NX_USER"; - - public static Map getHeaders(String secretKey, - String userName) { - - Map headers = new HashMap(); - - Date timestamp = new Date(); - int randomData = new Random(timestamp.getTime()).nextInt(); - - String clearToken = timestamp.getTime() + TOKEN_SEP + randomData - + TOKEN_SEP + secretKey + TOKEN_SEP + userName; - - byte[] hashedToken; - - try { - hashedToken = MessageDigest.getInstance("MD5").digest( - clearToken.getBytes()); - } catch (NoSuchAlgorithmException e) { - return null; - } - - String base64HashedToken = Base64.encodeBytes(hashedToken); - - headers.put(TS_HEADER, String.valueOf(timestamp.getTime())); - headers.put(RANDOM_HEADER, String.valueOf(randomData)); - headers.put(TOKEN_HEADER, base64HashedToken); - headers.put(USER_HEADER, userName); - - return headers; - } - -} diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/src/main/resources/jndi.properties b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/src/main/resources/jndi.properties deleted file mode 100644 index a3aa40712..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/src/main/resources/jndi.properties +++ /dev/null @@ -1,3 +0,0 @@ -java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory -java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces -java.naming.provider.url=jnp://localhost:1099 \ No newline at end of file diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/src/main/resources/nuxeo.properties b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/src/main/resources/nuxeo.properties deleted file mode 100644 index 3c9d5afb5..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/src/main/resources/nuxeo.properties +++ /dev/null @@ -1,2 +0,0 @@ -org.nuxeo.runtime.server.enabled=false -org.nuxeo.runtime.streaming.isServer=false diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/src/main/webapp/WEB-INF/web.xml b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index 0c188a4fb..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-nuxeo-service/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - HelloworldNuxeo - - - javax.ws.rs.Application - org.collectionspace.hello.services.HelloworldNuxeoApplication - - - - resteasy.servlet.mapping.prefix - /cspace-nuxeo - - - - - org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap - - - - - Resteasy - - org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher - - - - - Resteasy - /cspace-nuxeo/* - - - diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-service/README.txt b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-service/README.txt deleted file mode 100644 index bd38e834c..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-service/README.txt +++ /dev/null @@ -1,15 +0,0 @@ - -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 diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-service/build.properties b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-service/build.properties deleted file mode 100644 index 332484b24..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-service/build.properties +++ /dev/null @@ -1 +0,0 @@ -jboss.dir=C:/dev/jboss-4.2.3.GA \ No newline at end of file diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-service/build.xml b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-service/build.xml deleted file mode 100644 index cdba8639c..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-service/build.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-service/nb-configuration.xml b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-service/nb-configuration.xml deleted file mode 100644 index 3e5cd988f..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-service/nb-configuration.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - default - 8 - 80 - false - - diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-service/nbactions.xml b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-service/nbactions.xml deleted file mode 100644 index 9d30c239a..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-service/nbactions.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - - test - - * - - - test - - - - build - - * - - - install - - - - clean - - * - - - clean - - - - rebuild - - * - - - clean - install - - - true - - - - run - - war - ear - ejb - - - package - - - - true - - - - debug - - war - ear - ejb - - - package - - - - true - true - - - diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-service/pom.xml b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-service/pom.xml deleted file mode 100644 index 891e055d9..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-service/pom.xml +++ /dev/null @@ -1,177 +0,0 @@ - - - - jaxrs-prototype - org.collectionspace.hello.services - 0.1 - - 4.0.0 - org.collectionspace.hello.services - jaxrs-service - war - 0.1 - jaxrs-service - - - - java.net - http://download.java.net/maven/1 - legacy - - - maven repo - maven repo - http://repo1.maven.org/maven2/ - - - - jboss - jboss repo - http://repository.jboss.org/maven2 - - - mojo - mojo repo - http://svn.codehaus.org/mojo/trunk/mojo/jboss-maven-plugin - - - - - - org.collectionspace.hello.services - jaxrs-jaxb - 0.1 - - - org.jboss.resteasy - resteasy-jaxrs - 1.0.2.GA - - - - tjws - webserver - - - - - org.jboss.resteasy - resteasy-jaxb-provider - 1.0.2.GA - - - junit - junit - 4.1 - test - - - - - helloworld - - - org.codehaus.mojo - jboss-maven-plugin - - ${jboss.dir} - - - - jboss-undeploy - pre-integration-test - - undeploy - - - ${basedir}/target/helloworld.war - - - - jboss-deploy - pre-integration-test - - deploy - - - ${basedir}/target/helloworld.war - - - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - - - surefire-it - integration-test - - test - - - false - - - - - - org.apache.maven.plugins - maven-war-plugin - 2.0 - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.5 - 1.5 - - - - - diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-service/src/main/java/org/collectionspace/hello/services/HelloworldApplication.java b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-service/src/main/java/org/collectionspace/hello/services/HelloworldApplication.java deleted file mode 100644 index b7b7acdc0..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-service/src/main/java/org/collectionspace/hello/services/HelloworldApplication.java +++ /dev/null @@ -1,26 +0,0 @@ -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 singletons = new HashSet(); - private Set> empty = new HashSet>(); - - public HelloworldApplication() { - singletons.add(new PersonResource()); - singletons.add(new IdentifierResource()); - } - - @Override - public Set> getClasses() { - return empty; - } - - @Override - public Set getSingletons() { - return singletons; - } -} diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-service/src/main/java/org/collectionspace/hello/services/IdentifierResource.java b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-service/src/main/java/org/collectionspace/hello/services/IdentifierResource.java deleted file mode 100644 index 4c4104890..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-service/src/main/java/org/collectionspace/hello/services/IdentifierResource.java +++ /dev/null @@ -1,77 +0,0 @@ -package org.collectionspace.hello.services; - -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -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.UUID; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.atomic.AtomicLong; -import javax.ws.rs.core.UriBuilder; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.Marshaller; -import org.collectionspace.hello.Identifier; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@Path("/identifiers") -@Consumes("application/xml") -@Produces("application/xml") -public class IdentifierResource { - - final Logger logger = LoggerFactory.getLogger(IdentifierResource.class); - private Map idDB = new ConcurrentHashMap(); - private AtomicLong idCounter = new AtomicLong(); - - public IdentifierResource() { - } - - @POST - public Response createIdentifier(Identifier id) { - if (id.getNamespace() == null) { - id.setNamespace("edu.berkeley"); - } - id.setId(idCounter.incrementAndGet()); - id.setVersion(1); - UUID uuid = UUID.nameUUIDFromBytes(id.getNamespace().getBytes()); - id.setValue(uuid.toString()); - idDB.put(id.getId(), id); - verbose("created Id", id); - UriBuilder path = UriBuilder.fromResource(IdentifierResource.class); - path.path("" + id.getId()); - Response response = Response.created(path.build()).build(); - return response; - } - - @GET - @Path("{id}") - public Identifier getIdentifier(@PathParam("id") Long id) { - Identifier i = idDB.get(id); - if (i == 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 Id", i); - return i; - } - - private void verbose(String msg, Identifier id) { - try { - System.out.println("IdentifierResource : " + msg); - JAXBContext jc = JAXBContext.newInstance(Identifier.class); - Marshaller m = jc.createMarshaller(); - m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, - Boolean.TRUE); - m.marshal(id, System.out); - - } catch (Exception e) { - e.printStackTrace(); - } - } -} diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-service/src/main/java/org/collectionspace/hello/services/PersonResource.java b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-service/src/main/java/org/collectionspace/hello/services/PersonResource.java deleted file mode 100644 index b8c06b852..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-service/src/main/java/org/collectionspace/hello/services/PersonResource.java +++ /dev/null @@ -1,241 +0,0 @@ -package org.collectionspace.hello.services; - -import java.net.URI; -import java.util.List; -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.AtomicLong; -import javax.ws.rs.DELETE; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.UriBuilder; -import javax.ws.rs.core.UriInfo; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.Marshaller; -import org.collectionspace.hello.Person; -import org.collectionspace.hello.Persons.PersonListItem; -import org.collectionspace.hello.Persons; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@Path("/persons") -@Consumes("application/xml") -@Produces("application/xml") -public class PersonResource { - - final Logger logger = LoggerFactory.getLogger(PersonResource.class); - private Map personDB = new ConcurrentHashMap(); - private AtomicLong idCounter = new AtomicLong(); - - public PersonResource() { - } - - @POST - public Response createPerson(Person p) { - p.setId(idCounter.incrementAndGet()); - p.setVersion(1); - personDB.put(p.getId(), p); - verbose("created 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") Long id) { - Person p = personDB.get(id); - if (p == null) { - Response response = Response.status(Response.Status.NOT_FOUND).entity( - "Get failed, the requested person ID:" + 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") Long id, Person update) { - Person current = personDB.get(id); - if (current == null) { - Response response = Response.status(Response.Status.NOT_FOUND).entity( - "Update failed, the person ID:" + id + ": was not found.").type("text/plain").build(); - throw new WebApplicationException(response); - } - verbose("update person input", 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("update person output", current); - return current; - } - - @GET - public Persons getPersons(@Context UriInfo ui) { - Persons persons = new Persons(); - List list = persons.getPersonListItem(); - // builder starts with current URI and has appended path of getPerson method - UriBuilder ub = ui.getAbsolutePathBuilder().path(this.getClass(), "getPerson"); - for (Person p : personDB.values()) { - PersonListItem pli = new PersonListItem(); - pli.setFirstName(p.getFirstName()); - pli.setLastName(p.getLastName()); - pli.setId(p.getId()); - // builder has {id} variable that must be filled in for each customer - URI uri = ub.build(p.getId()); - pli.setUri(uri.toString()); - list.add(pli); - } - return persons; - } - - @DELETE - @Path("{id}") - public void deletePerson(@PathParam("id") Long id) { - Person removed = personDB.remove(id); - if (removed == null) { - Response response = Response.status(Response.Status.NOT_FOUND).entity( - "Delete failed, the person ID:" + id + ": was not found.").type("text/plain").build(); - throw new WebApplicationException(response); - } - verbose("deleted person", removed); - } - - private void verbose(String msg, Person p) { - try { - System.out.println("PersonResource : " + 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(""); -// writer.println(" " + p.getFirstName() + ""); -// writer.println(" " + p.getLastName() + ""); -// writer.println(" " + p.getStreet() + ""); -// writer.println(" " + p.getCity() + ""); -// writer.println(" " + p.getState() + ""); -// writer.println(" " + p.getZip() + ""); -// writer.println(" " + p.getCountry() + ""); -// writer.println(""); -// } -// -// 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); -// } -// } -} diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-service/src/main/webapp/WEB-INF/web.xml b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-service/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index eb42428a2..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-service/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - Helloworld - - - javax.ws.rs.Application - org.collectionspace.hello.services.HelloworldApplication - - - - resteasy.servlet.mapping.prefix - /cspace - - - - - org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap - - - - - Resteasy - - org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher - - - - - Resteasy - /cspace/* - - - diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-service/src/test/java/org/collectionspace/hello/test/IdentifierServiceRawXmlTest.java b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-service/src/test/java/org/collectionspace/hello/test/IdentifierServiceRawXmlTest.java deleted file mode 100644 index e9893fecc..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-service/src/test/java/org/collectionspace/hello/test/IdentifierServiceRawXmlTest.java +++ /dev/null @@ -1,62 +0,0 @@ -package org.collectionspace.hello.test; - -import org.junit.Assert; -import org.junit.Test; - -import java.io.BufferedReader; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.net.HttpURLConnection; -import java.net.URL; - -/** - * @version $Revision: 1 $ - */ -public class IdentifierServiceRawXmlTest { - - @Test - public void testIdentifierResource() throws Exception { - verbose("create a new Identifier"); - // Create a new object - String newIdentifier = "" + - "edu.stanford" + - ""; - - URL postUrl = new URL("http://localhost:8080/helloworld/cspace/identifiers"); - 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(newIdentifier.getBytes()); - os.flush(); - Assert.assertEquals(HttpURLConnection.HTTP_CREATED, connection.getResponseCode()); - String createdUrl = connection.getHeaderField("Location"); - verbose("Location: " + createdUrl); - connection.disconnect(); - - - // Get the new object - verbose("get created Identifier"); - URL getUrl = new URL(createdUrl); - connection = (HttpURLConnection) getUrl.openConnection(); - connection.setRequestMethod("GET"); - verbose("Content-Type: " + connection.getContentType()); - - BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream())); - - String line = reader.readLine(); - while (line != null) { - verbose(line); - line = reader.readLine(); - } - Assert.assertEquals(HttpURLConnection.HTTP_OK, connection.getResponseCode()); - connection.disconnect(); - - } - - private void verbose(String msg) { - System.out.println("IdentifierServiceRawXmlTest : " + msg); - } -} diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-service/src/test/java/org/collectionspace/hello/test/PersonServiceRawXmlTest.java b/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-service/src/test/java/org/collectionspace/hello/test/PersonServiceRawXmlTest.java deleted file mode 100644 index b455b2f01..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/jaxrs-service/src/test/java/org/collectionspace/hello/test/PersonServiceRawXmlTest.java +++ /dev/null @@ -1,89 +0,0 @@ -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; - -/** - * @version $Revision: 1 $ - */ -public class PersonServiceRawXmlTest { - - @Test - public void testPersonResource() throws Exception { - verbose("create a new Person"); - // Create a new object - String newPerson = "" + "John" + "Doe" + "2195 Hearst Ave" + "Berkeley" + "CA" + "94504" + "USA" + ""; - - 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"); - verbose("Location: " + createdUrl); - connection.disconnect(); - - - // Get the new object - verbose("get created Person"); - URL getUrl = new URL(createdUrl); - connection = (HttpURLConnection) getUrl.openConnection(); - connection.setRequestMethod("GET"); - verbose("Content-Type: " + connection.getContentType()); - - BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream())); - - String line = reader.readLine(); - while (line != null) { - verbose(line); - line = reader.readLine(); - } - Assert.assertEquals(HttpURLConnection.HTTP_OK, connection.getResponseCode()); - connection.disconnect(); - - String updatePerson = "" + "Jane" + "Doe" + "1 University Ave" + "Berkeley" + "CA" + "94504" + "USA" + ""; - 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 - verbose("updated Person"); - connection = (HttpURLConnection) getUrl.openConnection(); - connection.setRequestMethod("GET"); - - verbose("Content-Type: " + connection.getContentType()); - reader = new BufferedReader(new InputStreamReader(connection.getInputStream())); - - line = reader.readLine(); - while (line != null) { - verbose(line); - line = reader.readLine(); - } - Assert.assertEquals(HttpURLConnection.HTTP_OK, connection.getResponseCode()); - connection.disconnect(); - } - - private void verbose(String msg) { - System.out.println("PersonServiceRawXmlTest : " + msg); - } -} diff --git a/sandbox/sanjay/prototypes/jaxrs-prototype/pom.xml b/sandbox/sanjay/prototypes/jaxrs-prototype/pom.xml deleted file mode 100644 index 7a6a1a7a7..000000000 --- a/sandbox/sanjay/prototypes/jaxrs-prototype/pom.xml +++ /dev/null @@ -1,175 +0,0 @@ - - - - 4.0.0 - org.collectionspace.hello.services - 0.1 - jaxrs-prototype - pom - jaxrs-prototype - - jaxrs-jaxb - jaxrs-service - jaxrs-client - jaxrs-nuxeo-service - jaxrs-nuxeo-client - jaxrs-nuxeo-javaapi-service - - - - jboss - http://repository.jboss.org/maven2 - - - sun - http://download.java.net/maven/2 - - - java.net - java.net Maven Repository - https://maven-repository.dev.java.net/nonav/repository - legacy - - - maven2-repository.dev.java.net - Java.net Maven 2 Repository - http://download.java.net/maven/2 - - - - - - java.net - java.net Maven Repository - https://maven-repository.dev.java.net/nonav/repository - legacy - - - maven2-repository.dev.java.net - Java.net Maven 2 Repository - http://download.java.net/maven/2 - - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.5 - 1.5 - - - - org.apache.maven.plugins - maven-site-plugin - - /usr/bin/unzip -o > err.txt - - - - org.apache.maven.plugins - maven-war-plugin - 2.0.1 - - - WEB-INF/lib/*.jar - - - true - - - - - - - - - - - - - net.java.dev.jaxb2-commons - jaxb-fluent-api - 2.0.1 - - - org.testng - testng - 5.6 - test - jdk15 - - - org.jboss.resteasy - jaxrs-api - 1.0.2.GA - - - net.java.dev.jaxb2-commons - jaxb-fluent-api - 2.0.1 - - - org.jvnet.jaxb2-commons - property-listener-injector - 1.0 - - - org.jvnet.jaxb2_commons - runtime - 0.4.1 - - - org.jboss.resteasy - resteasy-jaxrs - 1.0.2.GA - - - commons-httpclient - commons-httpclient - 3.1 - - - com.sun.xml.bind - jaxb-impl - 2.1.7 - - - org.testng - testng - 5.6 - test - jdk15 - - - org.slf4j - slf4j-api - 1.5.2 - - - org.slf4j - slf4j-log4j12 - 1.5.2 - - - mysql - mysql-connector-java - 5.1.5 - test - - - com.jgoodies - binding - 2.0.2 - - - com.jgoodies - forms - 1.2.0 - - - - diff --git a/sandbox/sanjay/prototypes/restws/HelloWorldDocService/README.txt b/sandbox/sanjay/prototypes/restws/HelloWorldDocService/README.txt deleted file mode 100644 index bd38e834c..000000000 --- a/sandbox/sanjay/prototypes/restws/HelloWorldDocService/README.txt +++ /dev/null @@ -1,15 +0,0 @@ - -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 diff --git a/sandbox/sanjay/prototypes/restws/HelloWorldDocService/build.properties b/sandbox/sanjay/prototypes/restws/HelloWorldDocService/build.properties deleted file mode 100644 index 50c373854..000000000 --- a/sandbox/sanjay/prototypes/restws/HelloWorldDocService/build.properties +++ /dev/null @@ -1,4 +0,0 @@ -jboss.dir=C:/dev/jboss-4.2.3.GA -nuxeo.dir=${jboss.dir}/server/default/deploy/nuxeo.ear/system -nuxeo.local.repo.dir=file:///C:/dev/jboss-4.2.3.GA/server/default/deploy/nuxeo.ear/system -nuxeo.local.repo.client.dir=file:///C:/dev/nuxeo/nuxeo-core/nuxeo-core-client/target diff --git a/sandbox/sanjay/prototypes/restws/HelloWorldDocService/nb-configuration.xml b/sandbox/sanjay/prototypes/restws/HelloWorldDocService/nb-configuration.xml deleted file mode 100644 index 3e5cd988f..000000000 --- a/sandbox/sanjay/prototypes/restws/HelloWorldDocService/nb-configuration.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - default - 8 - 80 - false - - diff --git a/sandbox/sanjay/prototypes/restws/HelloWorldDocService/nbactions.xml b/sandbox/sanjay/prototypes/restws/HelloWorldDocService/nbactions.xml deleted file mode 100644 index 9d30c239a..000000000 --- a/sandbox/sanjay/prototypes/restws/HelloWorldDocService/nbactions.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - - test - - * - - - test - - - - build - - * - - - install - - - - clean - - * - - - clean - - - - rebuild - - * - - - clean - install - - - true - - - - run - - war - ear - ejb - - - package - - - - true - - - - debug - - war - ear - ejb - - - package - - - - true - true - - - diff --git a/sandbox/sanjay/prototypes/restws/HelloWorldDocService/pom.all.xml b/sandbox/sanjay/prototypes/restws/HelloWorldDocService/pom.all.xml deleted file mode 100644 index e00b239d6..000000000 --- a/sandbox/sanjay/prototypes/restws/HelloWorldDocService/pom.all.xml +++ /dev/null @@ -1,1075 +0,0 @@ - - - - helloworld - org.collectionspace.hello.services - 0.1 - - 4.0.0 - org.collectionspace.hello.services - helloworld-doc-service - war - 0.1 - Helloworld Document Service - - - - java.net - http://download.java.net/maven/1 - legacy - - - maven repo - maven repo - http://repo1.maven.org/maven2/ - - - - jboss - jboss repo - http://repository.jboss.org/maven2 - - - mojo - mojo repo - http://svn.codehaus.org/mojo/trunk/mojo/jboss-maven-plugin - - - public - http://maven.nuxeo.org/public - - - - false - - - - public-snapshot - http://maven.nuxeo.org/public-snapshot - - false - - - - - - - - - - - public - http://maven.nuxeo.org/public - Nuxeo virtual release repository - - - - false - - - - public-snapshot - http://maven.nuxeo.org/public-snapshot - Nuxeo virtual snapshot repository - - false - - - - - - - - - 4.2.3.GA - 3.0 - UTF-8 - 1.5.1 - 0.9.7 - 5.2-SNAPSHOT - 1.5-SNAPSHOT - - - - - - org.collectionspace.hello.services - helloworld-jaxb - 0.1 - - - org.jboss.resteasy - resteasy-jaxrs - 1.0.2.GA - - - - tjws - webserver - - - - - org.jboss.resteasy - resteasy-jaxb-provider - 1.0.2.GA - - - junit - junit - 4.1 - test - - - - - - - javax.ejb - ejb - 3.0 - provided - - - - javax.ejb - ejb-api - 3.0 - provided - - - - javax.annotation - jsr250-api - 1.0 - provided - - - - javax.security - jaas - 1.0.01 - provided - - - - - - - - - dom4j - dom4j - 1.6.1 - provided - - - - - - - - - - - - - - - - - org.nuxeo.ecm.core - nuxeo-core-api - ${nuxeo.version.1.5} - - - - org.nuxeo.ecm.platform - nuxeo-platform-api - ${nuxeo.version.5.2} - - - - - - - - helloworld - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - - surefire-it - integration-test - - test - - - false - - - - - - org.apache.maven.plugins - maven-war-plugin - 2.0 - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.5 - 1.5 - - - - - diff --git a/sandbox/sanjay/prototypes/restws/HelloWorldDocService/pom.xml b/sandbox/sanjay/prototypes/restws/HelloWorldDocService/pom.xml deleted file mode 100644 index 8f611c947..000000000 --- a/sandbox/sanjay/prototypes/restws/HelloWorldDocService/pom.xml +++ /dev/null @@ -1,262 +0,0 @@ - - - - helloworld - org.collectionspace.hello.services - 0.1 - - 4.0.0 - org.collectionspace.hello.services - helloworld-doc-service - war - 0.1 - Helloworld Document Service - - - - java.net - http://download.java.net/maven/1 - legacy - - - maven repo - maven repo - http://repo1.maven.org/maven2/ - - - - jboss - jboss repo - http://repository.jboss.org/maven2 - - - mojo - mojo repo - http://svn.codehaus.org/mojo/trunk/mojo/jboss-maven-plugin - - - - maven-restlet - Public online Restlet repository - http://maven.restlet.org - - - - public - http://maven.nuxeo.org/public - - - - false - - - - public-snapshot - http://maven.nuxeo.org/public-snapshot - - false - - - - - - - - - - - public - http://maven.nuxeo.org/public - Nuxeo virtual release repository - - - - false - - - - public-snapshot - http://maven.nuxeo.org/public-snapshot - Nuxeo virtual snapshot repository - - false - - - - - - - - - 4.2.3.GA - 3.0 - UTF-8 - 1.5.1 - 0.9.7 - 5.2-SNAPSHOT - 1.5-SNAPSHOT - - - - - - org.collectionspace.hello.services - helloworld-jaxb - 0.1 - - - org.jboss.resteasy - resteasy-jaxrs - 1.0.2.GA - - - tjws - webserver - - - - - org.jboss.resteasy - resteasy-jaxb-provider - 1.0.2.GA - - - junit - junit - 4.1 - test - - - - - - - javax.security - jaas - 1.0.01 - provided - - - - dom4j - dom4j - 1.6.1 - provided - - - - - - - - org.nuxeo.ecm.core - nuxeo-core-api - ${nuxeo.version.1.5} - - - jboss-remoting - jboss - - - - - - - - org.restlet - org.restlet - 1.0.7 - - - com.noelios.restlet - com.noelios.restlet.ext.httpclient - 1.0.7 - - - com.noelios.restlet - com.noelios.restlet - 1.0.7 - - - - jaxen - jaxen - 1.1.1 - - - - - - - helloworld - - - org.codehaus.mojo - jboss-maven-plugin - - ${jboss.dir} - - - - jboss-undeploy - pre-integration-test - - undeploy - - - ${basedir}/target/helloworld.war - - - - jboss-deploy - pre-integration-test - - deploy - - - ${basedir}/target/helloworld.war - - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - - surefire-it - integration-test - - test - - - false - - - - - - org.apache.maven.plugins - maven-war-plugin - 2.0 - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.5 - 1.5 - - - - - diff --git a/sandbox/sanjay/prototypes/restws/HelloWorldDocService/src/main/java/org/collectionspace/hello/services/HelloworldDocApplication.java b/sandbox/sanjay/prototypes/restws/HelloWorldDocService/src/main/java/org/collectionspace/hello/services/HelloworldDocApplication.java deleted file mode 100644 index 1ccfcac41..000000000 --- a/sandbox/sanjay/prototypes/restws/HelloWorldDocService/src/main/java/org/collectionspace/hello/services/HelloworldDocApplication.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.collectionspace.hello.services; - -import javax.ws.rs.core.Application; -import java.util.HashSet; -import java.util.Set; - -public class HelloworldDocApplication extends Application { - - private Set singletons = new HashSet(); - private Set> empty = new HashSet>(); - - public HelloworldDocApplication() { - singletons.add(new PersonDocResource()); - } - - @Override - public Set> getClasses() { - return empty; - } - - @Override - public Set getSingletons() { - return singletons; - } -} diff --git a/sandbox/sanjay/prototypes/restws/HelloWorldDocService/src/main/java/org/collectionspace/hello/services/PersonDocResource.java b/sandbox/sanjay/prototypes/restws/HelloWorldDocService/src/main/java/org/collectionspace/hello/services/PersonDocResource.java deleted file mode 100644 index ecad94865..000000000 --- a/sandbox/sanjay/prototypes/restws/HelloWorldDocService/src/main/java/org/collectionspace/hello/services/PersonDocResource.java +++ /dev/null @@ -1,111 +0,0 @@ -package org.collectionspace.hello.services; - -import org.collectionspace.hello.services.nuxeo.NuxeoRESTClient; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import java.util.Map; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.UriInfo; -import org.collectionspace.hello.*; - - -import org.collectionspace.hello.People.PeopleItem; -import org.dom4j.Document; -import org.dom4j.Element; -import org.dom4j.io.SAXReader; -import org.restlet.resource.Representation; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@Path("/persons") -@Consumes("application/xml") -@Produces("application/xml") -public class PersonDocResource { - - final Logger logger = LoggerFactory.getLogger(PersonDocResource.class); - - public PersonDocResource() { - } - - @GET - public People getPeople(@Context UriInfo ui) { - People p = new People(); - try { - List list = p.getPeopleItem(); - NuxeoRESTClient nxClient = getClient(); - - List pathParams = new ArrayList(); - Map queryParams = new HashMap(); - //browse default repository for People - //For sanjay, People repository id is f084243e-4b81-42a1-9a05-518e974facbd - pathParams = Arrays.asList("default", "f084243e-4b81-42a1-9a05-518e974facbd", "browse"); - Representation res = nxClient.get(pathParams, queryParams); - SAXReader reader = new SAXReader(); - Document document = reader.read(res.getStream()); - Element root = document.getRootElement(); - for (Iterator i = root.elementIterator(); i.hasNext();) { - Element element = (Element) i.next(); - PeopleItem pli = new PeopleItem(); - pli.setTitle(element.attributeValue("title")); - pli.setUri(element.attributeValue("url")); - pli.setId(element.attributeValue("id")); - list.add(pli); - } - - } catch (Exception e) { - e.printStackTrace(); - } - return p; - } - - -// private void getQueryModel() throws IOException { -// NuxeoRESTClient nxClient = getClient(); -// -// List pathParams = new ArrayList(); -// Map queryParams = new HashMap(); -// -// //query model for user documents -// pathParams = Arrays.asList("execQueryModel", "USER_DOCUMENTS"); -// queryParams.put("QP1", "Administrator"); -// queryParams.put("format", "XML"); -// -// -// Representation res = nxClient.get(pathParams, queryParams); -// String resStr = res.getText(); -// verbose("getQueryModel:" + resStr); -// -// } -// -// private void getVocabulary() throws IOException { -// NuxeoRESTClient nxClient = getClient(); -// -// List pathParams = new ArrayList(); -// Map queryParams = new HashMap(); -// //get vocabulary -// pathParams = Arrays.asList("vocabulary", "continent_country"); -// queryParams.put("lang", "en"); -// -// Representation res = nxClient.get(pathParams, queryParams); -// String resStr = res.getText(); -// verbose("getVocabulary:" + resStr); -// -// } - private NuxeoRESTClient getClient() { - NuxeoRESTClient nxClient = new NuxeoRESTClient("http://127.0.0.1:8080/nuxeo"); - nxClient.setAuthType(NuxeoRESTClient.AUTH_TYPE_BASIC); - nxClient.setBasicAuthentication("Administrator", "Administrator"); - return nxClient; - } - - private void verbose(String msg) { - System.out.println("PersonDocResource: " + msg); - } -} diff --git a/sandbox/sanjay/prototypes/restws/HelloWorldDocService/src/main/java/org/collectionspace/hello/services/nuxeo/NuxeoCallback.java b/sandbox/sanjay/prototypes/restws/HelloWorldDocService/src/main/java/org/collectionspace/hello/services/nuxeo/NuxeoCallback.java deleted file mode 100644 index 8e78e0076..000000000 --- a/sandbox/sanjay/prototypes/restws/HelloWorldDocService/src/main/java/org/collectionspace/hello/services/nuxeo/NuxeoCallback.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ - -package org.collectionspace.hello.services.nuxeo; - - -import javax.security.auth.callback.Callback; - -/** - * Copied from jbossx - * - * An implementation of Callback that simply obtains an Object to be used - * as the authentication credential. Interpretation of the Object is up to - * the LoginModules that validate the credential. - * - * @author Scott.Stark@jboss.org - */ -public class NuxeoCallback implements Callback { - - private final String prompt; - - private Object credential; - - public NuxeoCallback() { - this(""); - } - - public NuxeoCallback(String prompt) { - this.prompt = prompt; - } - - public String getPrompt() { - return prompt; - } - - public Object getCredential() { - return credential; - } - - public void setCredential(Object credential) { - this.credential = credential; - } - - public void clearCredential() { - credential = null; - } - -} diff --git a/sandbox/sanjay/prototypes/restws/HelloWorldDocService/src/main/java/org/collectionspace/hello/services/nuxeo/NuxeoCallbackHandler.java b/sandbox/sanjay/prototypes/restws/HelloWorldDocService/src/main/java/org/collectionspace/hello/services/nuxeo/NuxeoCallbackHandler.java deleted file mode 100644 index e8fff8c25..000000000 --- a/sandbox/sanjay/prototypes/restws/HelloWorldDocService/src/main/java/org/collectionspace/hello/services/nuxeo/NuxeoCallbackHandler.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ -package org.collectionspace.hello.services.nuxeo; - -/** - * - * @author sanjaydalal - */ -import javax.security.auth.callback.Callback; -import javax.security.auth.callback.CallbackHandler; -import javax.security.auth.callback.NameCallback; -import javax.security.auth.callback.PasswordCallback; -import javax.security.auth.callback.UnsupportedCallbackException; - -/** - * Copied from jbossx. - * - * @author Scott.Stark@jboss.org - */ -public class NuxeoCallbackHandler implements CallbackHandler { - - private final String username; - private char[] password; - private final Object credential; - - /** - * Initializes the UsernamePasswordHandler with the username and password to - * use. - * - * @param username the user name - * @param password the password for this user - */ - public NuxeoCallbackHandler(String username, char[] password) { - this.username = username; - this.password = password; - credential = password; - } - - public NuxeoCallbackHandler(String username, Object credential) { - this.username = username; - this.credential = credential; - if (credential instanceof char[]) { - password = (char[]) credential; - } else if (credential instanceof CharSequence) { - password = credential.toString().toCharArray(); - } - } - - /** - * Sets any NameCallback name property to the instance username, sets any - * PasswordCallback password property to the instance, and any password. - * - * @exception UnsupportedCallbackException, - * thrown if any callback of type other than NameCallback or - * PasswordCallback are seen. - */ - public void handle(Callback[] callbacks) - throws UnsupportedCallbackException { - for (Callback c : callbacks) { - if (c instanceof NameCallback) { - NameCallback nc = (NameCallback) c; - nc.setName(username); - } else if (c instanceof PasswordCallback) { - PasswordCallback pc = (PasswordCallback) c; - if (password == null) { - // We were given an opaque Object credential but a char[] is - // requested? - if (credential != null) { - String tmp = credential.toString(); - password = tmp.toCharArray(); - } - } - pc.setPassword(password); - } else if (c instanceof NuxeoCallback) { - NuxeoCallback oc = (NuxeoCallback) c; - oc.setCredential(credential); - } else { - throw new UnsupportedCallbackException(c, - "Unrecognized Callback"); - } - } - } -} diff --git a/sandbox/sanjay/prototypes/restws/HelloWorldDocService/src/main/java/org/collectionspace/hello/services/nuxeo/NuxeoLoginConfiguration.java b/sandbox/sanjay/prototypes/restws/HelloWorldDocService/src/main/java/org/collectionspace/hello/services/nuxeo/NuxeoLoginConfiguration.java deleted file mode 100644 index 81cedc3c4..000000000 --- a/sandbox/sanjay/prototypes/restws/HelloWorldDocService/src/main/java/org/collectionspace/hello/services/nuxeo/NuxeoLoginConfiguration.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ -package org.collectionspace.hello.services.nuxeo; - -/** - * - * @author sanjaydalal - */ -import java.util.HashMap; -import java.util.Map; - -import javax.security.auth.login.AppConfigurationEntry; -import javax.security.auth.login.Configuration; -import javax.security.auth.login.AppConfigurationEntry.LoginModuleControlFlag; - -public class NuxeoLoginConfiguration extends Configuration { - - private final Configuration parent; - public static final String LOGIN_DOMAIN = "nuxeo-client-login"; - - public NuxeoLoginConfiguration(Configuration parent) { - this.parent = parent; - } - - @Override - public AppConfigurationEntry[] getAppConfigurationEntry(String name) { - - if (LOGIN_DOMAIN.equals(name)) { - AppConfigurationEntry[] entries = new AppConfigurationEntry[1]; - - Map options = new HashMap(); - - options.put("restore-login-identity", "True"); - options.put("multi-threaded", "True"); - - entries[0] = new AppConfigurationEntry("org.jboss.security.ClientLoginModule", LoginModuleControlFlag.REQUIRED, options); - - - return entries; - } else { - return parent.getAppConfigurationEntry(name); - } - } - - @Override - public void refresh() { - if (parent != null) { - parent.refresh(); - } - } -} diff --git a/sandbox/sanjay/prototypes/restws/HelloWorldDocService/src/main/java/org/collectionspace/hello/services/nuxeo/NuxeoLoginContextFactory.java b/sandbox/sanjay/prototypes/restws/HelloWorldDocService/src/main/java/org/collectionspace/hello/services/nuxeo/NuxeoLoginContextFactory.java deleted file mode 100644 index d1d23f7fc..000000000 --- a/sandbox/sanjay/prototypes/restws/HelloWorldDocService/src/main/java/org/collectionspace/hello/services/nuxeo/NuxeoLoginContextFactory.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ - -package org.collectionspace.hello.services.nuxeo; - -/** - * - * @author sanjaydalal - */ - -import javax.security.auth.callback.CallbackHandler; -import javax.security.auth.login.Configuration; -import javax.security.auth.login.LoginContext; -import javax.security.auth.login.LoginException; - -public class NuxeoLoginContextFactory { - - - private static boolean initDone=false; - - private static void initLoginConfig() - { - if (initDone) - return; - - Configuration parentConfig = null; - try { - parentConfig = Configuration.getConfiguration(); - } catch (Exception e) { - // do nothing - this can happen if default configuration provider is not correctly configured - // for examnple FileConfig fails if no config file was defined - } - Configuration config = new NuxeoLoginConfiguration(parentConfig); - Configuration.setConfiguration(config); - - initDone=true; - - } - - - public static LoginContext getLoginContext(CallbackHandler handler) throws LoginException - { - initLoginConfig(); - return new LoginContext(NuxeoLoginConfiguration.LOGIN_DOMAIN, handler); - } -} diff --git a/sandbox/sanjay/prototypes/restws/HelloWorldDocService/src/main/java/org/collectionspace/hello/services/nuxeo/NuxeoRESTClient.java b/sandbox/sanjay/prototypes/restws/HelloWorldDocService/src/main/java/org/collectionspace/hello/services/nuxeo/NuxeoRESTClient.java deleted file mode 100644 index 175dca70a..000000000 --- a/sandbox/sanjay/prototypes/restws/HelloWorldDocService/src/main/java/org/collectionspace/hello/services/nuxeo/NuxeoRESTClient.java +++ /dev/null @@ -1,308 +0,0 @@ -/* - * (C) Copyright 2006-2007 Nuxeo SAS (http://nuxeo.com/) and contributors. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the GNU Lesser General Public License - * (LGPL) version 2.1 which accompanies this distribution, and is available at - * http://www.gnu.org/licenses/lgpl.html - * - * 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. - * - * Contributors: - * Nuxeo - initial API and implementation - * - * $Id: JOOoConvertPluginImpl.java 18651 2007-05-13 20:28:53Z sfermigier $ - */ -package org.collectionspace.hello.services.nuxeo; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.List; -import java.util.Map; - - -import org.restlet.Client; -import org.restlet.data.ChallengeResponse; -import org.restlet.data.ChallengeScheme; -import org.restlet.data.Cookie; -import org.restlet.data.Form; -import org.restlet.data.MediaType; -import org.restlet.data.Method; -import org.restlet.data.Parameter; -import org.restlet.data.Protocol; -import org.restlet.data.Request; -import org.restlet.resource.OutputRepresentation; -import org.restlet.resource.Representation; -import org.restlet.util.Series; - -public class NuxeoRESTClient { - - public static final int AUTH_TYPE_NONE = 0; - public static final int AUTH_TYPE_BASIC = 1; - public static final int AUTH_TYPE_SECRET = 2; - protected String baseURL = "http://127.0.0.1:8080/nuxeo"; - protected String restPrefix = "restAPI"; - protected String davPrefix = "dav"; - protected List cookies; - protected int authType = AUTH_TYPE_NONE; - protected String userName; - protected String password; - protected String secretToken; - protected Client restClient; - - public NuxeoRESTClient(String baseURL) { - this.baseURL = baseURL; - } - - public NuxeoRESTClient(String protocol, String serverIP, String serverPort) { - this(protocol, serverIP, serverPort, "nuxeo"); - } - - public NuxeoRESTClient(String protocol, String serverIP, String serverPort, - String servletPath) { - StringBuffer sb = new StringBuffer(); - sb.append(protocol); - sb.append("://"); - sb.append(serverIP); - if (serverPort != null && !serverIP.equals("80")) { - sb.append(':'); - sb.append(serverPort); - } - sb.append(servletPath); - sb.append('/'); - baseURL = sb.toString(); - } - - public void setBasicAuthentication(String userName, String password) { - authType = AUTH_TYPE_BASIC; - this.userName = userName; - this.password = password; - } - - public void setSharedSecretAuthentication(String userName, - String secretToken) { - authType = AUTH_TYPE_SECRET; - this.userName = userName; - this.secretToken = secretToken; - } - - public void setCookies(List cookies) { - this.cookies = cookies; - } - - public Representation post(List pathParams, - Map queryParams, InputStream istream) { - String path = ""; - StringBuffer pathBuffer = new StringBuffer(); - - if (pathParams != null) { - for (String p : pathParams) { - pathBuffer.append(p); - pathBuffer.append('/'); - } - path = pathBuffer.toString(); - } - - return post(path, queryParams, istream); - } - - public Representation post(String subPath, - Map queryParams, InputStream istream) { - StringBuffer urlBuffer = new StringBuffer(); - - if (subPath.startsWith("/")) { - subPath = subPath.substring(1); - } - if (subPath.endsWith("/")) { - subPath = subPath.substring(0, subPath.length() - 1); - } - - urlBuffer.append(baseURL); - urlBuffer.append('/'); - urlBuffer.append(restPrefix); - urlBuffer.append('/'); - urlBuffer.append(subPath); - - if (queryParams != null) { - urlBuffer.append('?'); - for (String qpName : queryParams.keySet()) { - urlBuffer.append(qpName); - urlBuffer.append('='); - urlBuffer.append(queryParams.get(qpName).replaceAll(" ", "%20")); - urlBuffer.append('&'); - } - } - - String completeURL = urlBuffer.toString(); - - Request request = new Request(Method.POST, completeURL); - - setupAuth(request); - setupCookies(request); - final InputStream in = istream; - request.setEntity(new OutputRepresentation( - MediaType.MULTIPART_FORM_DATA) { - - @Override - public void write(OutputStream outputStream) throws IOException { - byte[] buffer = new byte[1024 * 64]; - int read; - while ((read = in.read(buffer)) != -1) { - outputStream.write(buffer, 0, read); - } - - } - }); - - return getRestClient().handle(request).getEntity(); - } - - public Representation get(List pathParams, - Map queryParams) { - String path = ""; - StringBuffer pathBuffer = new StringBuffer(); - - if (pathParams != null) { - for (String p : pathParams) { - pathBuffer.append(p); - pathBuffer.append('/'); - } - path = pathBuffer.toString(); - } - - return get(path, queryParams); - } - - public Representation get(String subPath, - Map queryParams) { - StringBuffer urlBuffer = new StringBuffer(); - - if (subPath.startsWith("/")) { - subPath = subPath.substring(1); - } - if (subPath.endsWith("/")) { - subPath = subPath.substring(0, subPath.length() - 1); - } - - urlBuffer.append(baseURL); - urlBuffer.append('/'); - urlBuffer.append(restPrefix); - urlBuffer.append('/'); - urlBuffer.append(subPath); - - if (queryParams != null) { - urlBuffer.append('?'); - for (String qpName : queryParams.keySet()) { - urlBuffer.append(qpName); - urlBuffer.append('='); - urlBuffer.append(queryParams.get(qpName).replaceAll(" ", "%20")); - urlBuffer.append('&'); - } - } - - String completeURL = urlBuffer.toString(); - System.out.println("\nNuxeoRESTClient: calling " + completeURL); - Request request = new Request(Method.GET, completeURL); - setupAuth(request); - setupCookies(request); - - return getRestClient().handle(request).getEntity(); - } - - protected void setupAuth(Request request) { - - if (authType == AUTH_TYPE_BASIC) { - ChallengeScheme scheme = ChallengeScheme.HTTP_BASIC; - ChallengeResponse authentication = new ChallengeResponse(scheme, - userName, password); - request.setChallengeResponse(authentication); - - } else if (authType == AUTH_TYPE_SECRET) { - Series additionnalHeaders = new Form(); - - Map securityHeaders = PortalSSOAuthenticationProvider.getHeaders( - secretToken, userName); - - for (String hn : securityHeaders.keySet()) { - additionnalHeaders.add(hn, securityHeaders.get(hn)); - } - - request.getAttributes().put("org.restlet.http.headers", - additionnalHeaders); - } - } - - protected void setupCookies(Request request) { - if (cookies != null) { - request.getCookies().clear(); - for (Cookie cookie : cookies) { - request.getCookies().add(cookie); - } - } - - } - - protected Client getRestClient() { - if (restClient == null) { - if (baseURL.startsWith("https")) { - restClient = new Client(Protocol.HTTPS); - } else { - restClient = new Client(Protocol.HTTP); - } - } - - return restClient; - } - - public int getAuthType() { - return authType; - } - - public void setAuthType(int authType) { - this.authType = authType; - } - - public String getDavPrefix() { - return davPrefix; - } - - public void setDavPrefix(String davPrefix) { - this.davPrefix = davPrefix; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public String getRestPrefix() { - return restPrefix; - } - - public void setRestPrefix(String restPrefix) { - this.restPrefix = restPrefix; - } - - public String getSecretToken() { - return secretToken; - } - - public void setSecretToken(String secretToken) { - this.secretToken = secretToken; - } - - public String getUserName() { - return userName; - } - - public void setUserName(String userName) { - this.userName = userName; - } -} diff --git a/sandbox/sanjay/prototypes/restws/HelloWorldDocService/src/main/java/org/collectionspace/hello/services/nuxeo/PortalSSOAuthenticationProvider.java b/sandbox/sanjay/prototypes/restws/HelloWorldDocService/src/main/java/org/collectionspace/hello/services/nuxeo/PortalSSOAuthenticationProvider.java deleted file mode 100644 index ef1a61a40..000000000 --- a/sandbox/sanjay/prototypes/restws/HelloWorldDocService/src/main/java/org/collectionspace/hello/services/nuxeo/PortalSSOAuthenticationProvider.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * (C) Copyright 2006-2007 Nuxeo SAS (http://nuxeo.com/) and contributors. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the GNU Lesser General Public License - * (LGPL) version 2.1 which accompanies this distribution, and is available at - * http://www.gnu.org/licenses/lgpl.html - * - * 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. - * - * Contributors: - * Nuxeo - initial API and implementation - * - * $Id: JOOoConvertPluginImpl.java 18651 2007-05-13 20:28:53Z sfermigier $ - */ - -package org.collectionspace.hello.services.nuxeo; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; -import java.util.Date; -import java.util.HashMap; -import java.util.Map; -import java.util.Random; - -import com.noelios.restlet.util.Base64; - -public class PortalSSOAuthenticationProvider { - - private static final String TOKEN_SEP = ":"; - - private static final String TS_HEADER = "NX_TS"; - - private static final String RANDOM_HEADER = "NX_RD"; - - private static final String TOKEN_HEADER = "NX_TOKEN"; - - private static final String USER_HEADER = "NX_USER"; - - public static Map getHeaders(String secretKey, - String userName) { - - Map headers = new HashMap(); - - Date timestamp = new Date(); - int randomData = new Random(timestamp.getTime()).nextInt(); - - String clearToken = timestamp.getTime() + TOKEN_SEP + randomData - + TOKEN_SEP + secretKey + TOKEN_SEP + userName; - - byte[] hashedToken; - - try { - hashedToken = MessageDigest.getInstance("MD5").digest( - clearToken.getBytes()); - } catch (NoSuchAlgorithmException e) { - return null; - } - - String base64HashedToken = Base64.encodeBytes(hashedToken); - - headers.put(TS_HEADER, String.valueOf(timestamp.getTime())); - headers.put(RANDOM_HEADER, String.valueOf(randomData)); - headers.put(TOKEN_HEADER, base64HashedToken); - headers.put(USER_HEADER, userName); - - return headers; - } - -} diff --git a/sandbox/sanjay/prototypes/restws/HelloWorldDocService/src/main/resources/jndi.properties b/sandbox/sanjay/prototypes/restws/HelloWorldDocService/src/main/resources/jndi.properties deleted file mode 100644 index a3aa40712..000000000 --- a/sandbox/sanjay/prototypes/restws/HelloWorldDocService/src/main/resources/jndi.properties +++ /dev/null @@ -1,3 +0,0 @@ -java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory -java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces -java.naming.provider.url=jnp://localhost:1099 \ No newline at end of file diff --git a/sandbox/sanjay/prototypes/restws/HelloWorldDocService/src/main/resources/nuxeo.properties b/sandbox/sanjay/prototypes/restws/HelloWorldDocService/src/main/resources/nuxeo.properties deleted file mode 100644 index 3c9d5afb5..000000000 --- a/sandbox/sanjay/prototypes/restws/HelloWorldDocService/src/main/resources/nuxeo.properties +++ /dev/null @@ -1,2 +0,0 @@ -org.nuxeo.runtime.server.enabled=false -org.nuxeo.runtime.streaming.isServer=false diff --git a/sandbox/sanjay/prototypes/restws/HelloWorldDocService/src/main/webapp/WEB-INF/web.xml b/sandbox/sanjay/prototypes/restws/HelloWorldDocService/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index d6187fc0d..000000000 --- a/sandbox/sanjay/prototypes/restws/HelloWorldDocService/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - HelloworldDoc - - - javax.ws.rs.Application - org.collectionspace.hello.services.HelloworldDocApplication - - - - resteasy.servlet.mapping.prefix - /cspace-doc - - - - - org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap - - - - - Resteasy - - org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher - - - - - Resteasy - /cspace-doc/* - - -