org.nuxeo.ecm.webapp.core\r
Provide-Package: org.collectionspace.collectionspace_core\r
Nuxeo-Component: OSGI-INF/core-types-contrib.xml,\r
+ OSGI-INF/default-life-cycle-contrib.xml,\r
OSGI-INF/ecm-types-contrib.xml,\r
OSGI-INF/layouts-contrib.xml\r
\r
<schema name="collectionspace_core" prefix="collectionspace_core" src="schemas/collectionspace_core.xsd"/>
<schema name="subitem" prefix="subitem" src="schemas/subitem.xsd"/>
</extension>
+ <extension target="org.nuxeo.ecm.core.schema.TypeService" point="doctype">
+ <doctype name="CollectionSpaceDocument" extends="Document">
+ </doctype>
+ </extension>
<extension target="org.nuxeo.ecm.core.schema.TypeService" point="doctype">
<doctype name="CollectionSpace_Core" extends="Document">
<schema name="common"/>
--- /dev/null
+<?xml version="1.0"?>
+<component name="org.collectionspace.ecm.platform.default.LifeCycleManagerExtensions">
+
+ <extension target="org.nuxeo.ecm.core.lifecycle.LifeCycleService"
+ point="types">
+ <types>
+ <type name="CollectionSpaceDocument">default</type>
+ </types>
+ </extension>
+
+</component>
<?xml version="1.0"?>\r
\r
-<component name="com.myexample.query.model.override">\r
+<component name="com.collectionspace.query.model.override">\r
<require>org.nuxeo.ecm.webapp.querymodel.DefaultQueryModels</require>\r
<extension\r
target="org.nuxeo.ecm.core.search.api.client.querymodel.QueryModelService"\r
<classpathentry kind="src" path="/org.collectionspace.services.vocabulary.client"/>\r
<classpathentry kind="src" path="/org.collectionspace.services.vocabulary.jaxb"/>\r
<classpathentry kind="src" path="/org.collectionspace.services.vocabulary.service"/>\r
+ <classpathentry kind="src" path="/org.collectionspace.services.workflow.service"/>\r
<classpathentry kind="var" path="M2_REPO/org/osgi/org.osgi.core/4.1.0/org.osgi.core-4.1.0.jar"/>\r
<classpathentry kind="var" path="M2_REPO/org/restlet/org.restlet/1.0.7/org.restlet-1.0.7.jar"/>\r
<classpathentry kind="var" path="M2_REPO/org/codehaus/plexus/plexus-container-default/1.0-alpha-9-stable-1/plexus-container-default-1.0-alpha-9-stable-1.jar" sourcepath="M2_REPO/org/codehaus/plexus/plexus-container-default/1.0-alpha-9-stable-1/plexus-container-default-1.0-alpha-9-stable-1-sources.jar">\r
<project>org.collectionspace.services.vocabulary.client</project>\r
<project>org.collectionspace.services.vocabulary.jaxb</project>\r
<project>org.collectionspace.services.vocabulary.service</project>\r
+ <project>org.collectionspace.services.workflow.service</project>\r
</projects>\r
<buildSpec>\r
<buildCommand>\r
<artifactId>org.collectionspace.services.relation.service</artifactId>\r
<version>${project.version}</version>\r
</dependency>\r
+ <dependency>\r
+ <groupId>org.collectionspace.services</groupId>\r
+ <artifactId>org.collectionspace.services.workflow.service</artifactId>\r
+ <version>${project.version}</version>\r
+ </dependency>\r
<!--dependency>\r
<groupId>org.collectionspace.services</groupId>\r
<artifactId>org.collectionspace.services.query.service</artifactId>\r
import org.collectionspace.services.vocabulary.VocabularyResource;
import org.collectionspace.services.organization.OrgAuthorityResource;
import org.collectionspace.services.person.PersonAuthorityResource;
+import org.collectionspace.services.workflow.WorkflowResource;
//import org.collectionspace.services.query.QueryResource;
singletons.add(new AccountResource());
singletons.add(new RoleResource());
singletons.add(new PermissionResource());
- singletons.add(new CollectionObjectResource());
- singletons.add(new IntakeResource());
singletons.add(new VocabularyResource());
- singletons.add(new DimensionResource());
singletons.add(new ContactResource());
singletons.add(new PersonAuthorityResource());
singletons.add(new OrgAuthorityResource());
+ singletons.add(new CollectionObjectResource());
+ singletons.add(new IntakeResource());
+ singletons.add(new DimensionResource());
singletons.add(new RelationResource());
singletons.add(new NoteResource());
singletons.add(new LoaninResource());
singletons.add(new ReportResource());
singletons.add(new LocationAuthorityResource());
singletons.add(new IDResource());
+ /*
+ singletons.add(new WorkflowResource());
+ */
// singletons.add(new QueryResource());
// singletons.add(new DomainIdentifierResource());
// singletons.add(new PingResource());
package org.collectionspace.services.client;
import javax.ws.rs.core.Response;
-
-
import org.collectionspace.services.account.AccountsCommon;
import org.collectionspace.services.account.AccountsCommonList;
-import org.jboss.resteasy.client.ProxyFactory;
-import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.client.core.executors.ApacheHttpClientExecutor;
-import org.jboss.resteasy.spi.ResteasyProviderFactory;
/**
* A AccountClient.
* @version $Revision:$
*/
-public class AccountClient extends AbstractServiceClientImpl {
+public class AccountClient extends AbstractServiceClientImpl<AccountProxy> {
public static final String SERVICE_NAME = "accounts";
- /**
- *
- */
- private AccountProxy accountProxy;
-
@Override
public String getServiceName() {
return SERVICE_NAME;
public String getServicePathComponent() {
return SERVICE_NAME;
}
-
- /**
- *
- * Default constructor for AccountClient class.
- *
- */
- public AccountClient() {
- ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
- RegisterBuiltin.register(factory);
- setProxy();
- }
-
- @Override
- public CollectionSpaceProxy getProxy() {
- return this.accountProxy;
- }
-
- /**
- * allow to reset proxy as per security needs
- */
- public void setProxy() {
- if (useAuth()) {
- accountProxy = ProxyFactory.create(AccountProxy.class,
- getBaseURL(), new ApacheHttpClientExecutor(getHttpClient()));
- } else {
- accountProxy = ProxyFactory.create(AccountProxy.class,
- getBaseURL());
- }
+
+ public String getTenantId() {
+ return getProperty(AccountClient.TENANT_PROPERTY);
}
+ @Override
+ public Class<AccountProxy> getProxyClass() {
+ return AccountProxy.class;
+ }
+
+ /*
+ * CRUD+L Methods
+ */
+
/**
* @return response
* @see org.collectionspace.hello.client.AccountProxy#readList()
*/
public ClientResponse<AccountsCommonList> readList() {
- return accountProxy.readList();
-
+ return getProxy().readList();
}
public ClientResponse<AccountsCommonList> readSearchList(String screenName, String uid, String email) {
- return accountProxy.readSearchList(screenName, uid, email);
-
+ return getProxy().readSearchList(screenName, uid, email);
}
/**
* @see org.collectionspace.hello.client.AccountProxy#getAccount(java.lang.String)
*/
public ClientResponse<AccountsCommon> read(String csid) {
- return accountProxy.read(csid);
+ return getProxy().read(csid);
}
/**
* @see org.collectionspace.hello.client.AccountProxy#create(org.collectionspace.services.account.AccountsCommon)
*/
public ClientResponse<Response> create(AccountsCommon multipart) {
- return accountProxy.create(multipart);
+ return getProxy().create(multipart);
}
/**
* @see org.collectionspace.hello.client.AccountProxy#updateAccount(java.lang.Long, org.collectionspace.services.account.AccountsCommon)
*/
public ClientResponse<AccountsCommon> update(String csid, AccountsCommon multipart) {
- return accountProxy.update(csid, multipart);
- }
-
- /**
- * @param csid
- * @return response
- * @see org.collectionspace.hello.client.AccountProxy#deleteAccount(java.lang.Long)
- */
- @Override
- public ClientResponse<Response> delete(String csid) {
- return accountProxy.delete(csid);
- }
-
-
- public String getTenantId() {
- return getProperty(AccountClient.TENANT_PROPERTY);
+ return getProxy().update(csid, multipart);
}
}
@Produces({"application/xml"})
ClientResponse<AccountsCommonList> readList();
- @GET
+ @GET
@Produces({"application/xml"})
ClientResponse<AccountsCommonList> readSearchList(@QueryParam("sn") String screenName, @QueryParam("uid") String uid, @QueryParam("email") String email);
@PUT
@Path("/{csid}")
ClientResponse<AccountsCommon> update(@PathParam("csid") String csid, AccountsCommon multipart);
-
- //(D)elete
- @DELETE
- @Path("/{csid}")
- ClientResponse<Response> delete(@PathParam("csid") String csid);
}
//import org.collectionspace.services.authorization.AccountRolesList;
import org.collectionspace.services.authorization.AccountRole;
-import org.jboss.resteasy.client.ProxyFactory;
-import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.client.core.executors.ApacheHttpClientExecutor;
-import org.jboss.resteasy.spi.ResteasyProviderFactory;
/**
* A AccountRoleClient.
* @version $Revision:$
*/
-public class AccountRoleClient extends AbstractServiceClientImpl {
+public class AccountRoleClient extends AbstractServiceClientImpl<AccountRoleProxy> {
public static final String SERVICE_NAME = "accountroles";
@Override
return AccountRoleClient.SERVICE_NAME;
}
- /**
- *
- */
- private AccountRoleProxy accountRoleProxy;
-
/* (non-Javadoc)
* @see
*/
return "accounts";
}
- /**
- *
- * Default constructor for AccountRoleClient class.
- *
- */
- public AccountRoleClient() {
- ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
- RegisterBuiltin.register(factory);
- setProxy();
- }
-
- @Override
- public CollectionSpaceProxy getProxy() {
- return this.accountRoleProxy;
- }
-
- /**
- * allow to reset proxy as per security needs
- */
- public void setProxy() {
- if (useAuth()) {
- accountRoleProxy = ProxyFactory.create(AccountRoleProxy.class,
- getBaseURL(), new ApacheHttpClientExecutor(getHttpClient()));
- } else {
- accountRoleProxy = ProxyFactory.create(AccountRoleProxy.class,
- getBaseURL());
- }
- }
-
+ @Override
+ public Class<AccountRoleProxy> getProxyClass() {
+ return AccountRoleProxy.class;
+ }
+ /*
+ * CRUD+L Methods
+ */
+
/**
* @param csid
* @param arcsid relationship does not have an id, junk is fine
* @see
*/
public ClientResponse<AccountRole> read(String csid, String arcsid) {
- return accountRoleProxy.read(csid, arcsid);
+ return getProxy().read(csid, arcsid);
}
/**
* @return the client response
*/
public ClientResponse<AccountRole> read(String csid) {
- return accountRoleProxy.read(csid);
+ return getProxy().read(csid);
}
/**
* @see
*/
public ClientResponse<Response> create(String csid, AccountRole accRole) {
- return accountRoleProxy.create(csid, accRole);
+ return getProxy().create(csid, accRole);
}
* @see
*/
public ClientResponse<Response> delete(String csid, AccountRole accRole) {
- return accountRoleProxy.delete(csid, "delete", accRole);
- }
-
- /* (non-Javadoc)
- * @see org.collectionspace.services.client.AbstractServiceClientImpl#delete(java.lang.String)
- */
- public ClientResponse<Response> delete(String csid) {
- return accountRoleProxy.delete(csid);
+ return getProxy().delete(csid, "delete", accRole);
}
}
package org.collectionspace.services.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.DELETE;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
AccountRole accRole);
//(D)elete
- @DELETE
+ @Override
+ @DELETE
@Path("/{csid}/accountroles")
ClientResponse<Response> delete(@PathParam("csid") String csid);
}
package org.collectionspace.services.client;
-import javax.ws.rs.core.Response;
-
-import org.collectionspace.services.jaxb.AbstractCommonList;
-import org.collectionspace.services.common.authorityref.AuthorityRefList;
-import org.jboss.resteasy.client.ProxyFactory;
-import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.client.core.executors.ApacheHttpClientExecutor;
-import org.jboss.resteasy.spi.ResteasyProviderFactory;
+import org.collectionspace.services.jaxb.AbstractCommonList;
/**
* An AcquisitionClient.
* @version $Revision:$
*/
-public class AcquisitionClient extends AbstractServiceClientImpl {
+public class AcquisitionClient extends AbstractPoxServiceClientImpl<AcquisitionProxy> {
public static final String SERVICE_NAME = "acquisitions";
public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;
public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT;
public String getServicePathComponent() {
return SERVICE_PATH_COMPONENT;
}
-
- /**
- *
- */
- private AcquisitionProxy acquisitionProxy;
-
- /**
- *
- * Default constructor for IntakeClient class.
- *
- */
- public AcquisitionClient() {
- ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
- RegisterBuiltin.register(factory);
- setProxy();
- }
-
- @Override
- public CollectionSpaceProxy getProxy() {
- return this.acquisitionProxy;
- }
-
- /**
- * allow to reset proxy as per security needs
- */
- public void setProxy() {
- if (useAuth()) {
- acquisitionProxy = ProxyFactory.create(AcquisitionProxy.class,
- getBaseURL(), new ApacheHttpClientExecutor(getHttpClient()));
- } else {
- acquisitionProxy = ProxyFactory.create(AcquisitionProxy.class,
- getBaseURL());
- }
- }
- /**
- * FIXME Is this method still needed/used?
- *
- * @return
- */
-// public static AcquisitionClient getInstance() {
-// return instance;
-// }
+ @Override
+ public Class<AcquisitionProxy> getProxyClass() {
+ // TODO Auto-generated method stub
+ return AcquisitionProxy.class;
+ }
+ /*
+ * Proxied service calls.
+ */
+
/**
* @return
* @see org.collectionspace.hello.client.IntakeProxy#getIntake()
*/
public ClientResponse<AbstractCommonList> readList() {
- return acquisitionProxy.readList();
+ return getProxy().readList();
}
/**
* @return
* @see org.collectionspace.hello.client.IntakeProxy#getIntake(java.lang.String)
*/
- public ClientResponse<String> read(String csid) {
- return acquisitionProxy.read(csid);
- }
-
- /**
- * @param csid
- * @return
- * @see org.collectionspace.services.client.CollectionObjectProxy#getAuthorityRefs(java.lang.String)
- */
- public ClientResponse<AuthorityRefList> getAuthorityRefs(String csid) {
- return acquisitionProxy.getAuthorityRefs(csid);
- }
-
- /**
- * @param intake
- * @return
- * @see org.collectionspace.hello.client.IntakeProxy#createIntake(org.collectionspace.hello.Intake)
- */
- public ClientResponse<Response> create(PoxPayloadOut xmlPayload) {
- return acquisitionProxy.create(xmlPayload.getBytes());
- }
-
- /**
- * @param csid
- * @param intake
- * @return
- * @see org.collectionspace.hello.client.IntakeProxy#updateIntake(java.lang.Long, org.collectionspace.hello.Intake)
- */
- public ClientResponse<String> update(String csid, PoxPayloadOut xmlPayload) {
- return acquisitionProxy.update(csid, xmlPayload.getBytes());
- }
-
- /**
- * @param csid
- * @return
- * @see org.collectionspace.hello.client.IntakeProxy#deleteIntake(java.lang.Long)
- */
- public ClientResponse<Response> delete(String csid) {
- return acquisitionProxy.delete(csid);
+ @Override
+ public ClientResponse<String> read(String csid) {
+ return getProxy().read(csid);
}
}
package org.collectionspace.services.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.services.jaxb.AbstractCommonList;
-import org.collectionspace.services.common.authorityref.AuthorityRefList;
import org.jboss.resteasy.client.ClientResponse;
/**
@Path(AcquisitionClient.SERVICE_PATH_PROXY)
@Produces({"application/xml"})
@Consumes({"application/xml"})
-public interface AcquisitionProxy extends CollectionSpaceProxy {
-
+public interface AcquisitionProxy extends CollectionSpacePoxProxy {
@GET
ClientResponse<AbstractCommonList> readList();
-
- //(C)reate
- @POST
- ClientResponse<Response> create(byte[] xmlPayload);
-
- //(R)ead
- @GET
- @Path("/{csid}")
- ClientResponse<String> read(@PathParam("csid") String csid);
-
- // List Authority references
- @GET
- @Path("/{csid}/authorityrefs/")
- ClientResponse<AuthorityRefList> getAuthorityRefs(@PathParam("csid") String csid);
-
- //(U)pdate
- @PUT
- @Path("/{csid}")
- ClientResponse<String> update(@PathParam("csid") String csid, byte[] xmlPayload);
-
- //(D)elete
- @DELETE
- @Path("/{csid}")
- ClientResponse<Response> delete(@PathParam("csid") String csid);
}
import javax.ws.rs.core.UriBuilder;
import javax.ws.rs.core.UriInfo;
+import org.collectionspace.services.client.IQueryManager;
import org.collectionspace.services.client.PoxPayloadIn;
import org.collectionspace.services.client.PoxPayloadOut;
import org.collectionspace.services.client.AcquisitionClient;
import org.collectionspace.services.common.document.DocumentNotFoundException;
import org.collectionspace.services.common.document.DocumentHandler;
import org.collectionspace.services.common.document.DocumentWrapper;
-import org.collectionspace.services.common.query.IQueryManager;
import org.collectionspace.services.common.query.QueryManager;
import org.collectionspace.services.common.security.UnauthorizedException;
-import org.collectionspace.services.nuxeo.client.java.DocumentModelHandler;
-import org.collectionspace.services.jaxb.AbstractCommonList;
import org.collectionspace.services.nuxeo.client.java.CommonList;
import org.jboss.resteasy.util.HttpResponseCodes;
package org.collectionspace.services.client;
import javax.ws.rs.core.Response;
-
+import org.jboss.resteasy.client.ClientResponse;
import org.collectionspace.services.authorization.Permission;
import org.collectionspace.services.authorization.PermissionsList;
-import org.jboss.resteasy.client.ProxyFactory;
-import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
-import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.client.core.executors.ApacheHttpClientExecutor;
-import org.jboss.resteasy.spi.ResteasyProviderFactory;
/**
* A PermissionClient.
* @version $Revision:$
*/
-public class PermissionClient extends AbstractServiceClientImpl {
+public class PermissionClient extends AbstractServiceClientImpl<PermissionProxy> {
public static final String SERVICE_NAME = "authorization/permissions";
public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;
public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT;
public static final String SERVICE_PATH_PROXY = SERVICE_PATH + "/";
- /**
- *
- */
- private PermissionProxy permissionProxy;
-
/* (non-Javadoc)
* @see org.collectionspace.services.client.AbstractServiceClientImpl#getServicePathComponent()
*/
- public String getServicePathComponent() {
+ @Override
+ public String getServicePathComponent() {
return SERVICE_PATH_COMPONENT;
}
- /**
- *
- * Default constructor for PermissionClient class.
- *
- */
- public PermissionClient() {
- ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
- RegisterBuiltin.register(factory);
- setProxy();
- }
-
- @Override
- public CollectionSpaceProxy getProxy() {
- return this.permissionProxy;
- }
-
- /**
- * allow to reset proxy as per security needs
- */
- public void setProxy() {
- if (useAuth()) {
- permissionProxy = ProxyFactory.create(PermissionProxy.class,
- getBaseURL(), new ApacheHttpClientExecutor(getHttpClient()));
- } else {
- permissionProxy = ProxyFactory.create(PermissionProxy.class,
- getBaseURL());
- }
- }
+ @Override
+ public String getServiceName() {
+ return SERVICE_NAME;
+ }
+ @Override
+ public Class<PermissionProxy> getProxyClass() {
+ return PermissionProxy.class;
+ }
+
+ /*
+ * CRUD+L Methods
+ */
+
/**
* @return
* @see org.collectionspace.hello.client.PermissionProxy#readList()
*/
public ClientResponse<PermissionsList> readList() {
- return permissionProxy.readList();
+ return getProxy().readList();
}
public ClientResponse<PermissionsList> readSearchList(String resourceName) {
- return permissionProxy.readSearchList(resourceName);
+ return getProxy().readSearchList(resourceName);
}
* @see org.collectionspace.hello.client.PermissionProxy#getAccount(java.lang.String)
*/
public ClientResponse<Permission> read(String csid) {
- return permissionProxy.read(csid);
+ return getProxy().read(csid);
}
/**
* @see org.collectionspace.hello.client.PermissionProxy#create(org.collectionspace.services.permission.Permission)
*/
public ClientResponse<Response> create(Permission permission) {
- return permissionProxy.create(permission);
+ return getProxy().create(permission);
}
/**
* @see org.collectionspace.hello.client.PermissionProxy#updateAccount(java.lang.Long, org.collectionspace.services.permission.Permission)
*/
public ClientResponse<Permission> update(String csid, Permission permission) {
- return permissionProxy.update(csid, permission);
- }
-
- /**
- * @param csid
- * @return
- * @see org.collectionspace.hello.client.PermissionProxy#deleteAccount(java.lang.Long)
- */
- public ClientResponse<Response> delete(String csid) {
- return permissionProxy.delete(csid);
+ return getProxy().update(csid, permission);
}
-
- @Override
- public String getServiceName() {
- return SERVICE_NAME;
- }
}
package org.collectionspace.services.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.QueryParam;
import javax.ws.rs.core.Response;
-
import org.collectionspace.services.authorization.Permission;
import org.collectionspace.services.authorization.PermissionsList;
import org.jboss.resteasy.client.ClientResponse;
ClientResponse<PermissionsList> readList();
@GET
-
ClientResponse<PermissionsList> readSearchList(@QueryParam("res") String resourceName);
//(C)reate
@PUT
@Path("/{csid}")
ClientResponse<Permission> update(@PathParam("csid") String csid, Permission permission);
-
- //(D)elete
- @DELETE
- @Path("/{csid}")
- ClientResponse<Response> delete(@PathParam("csid") String csid);
}
package org.collectionspace.services.client;
import javax.ws.rs.core.Response;
-
-
-import org.collectionspace.services.authorization.PermissionRole;
-import org.jboss.resteasy.client.ProxyFactory;
-import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.client.core.executors.ApacheHttpClientExecutor;
-import org.jboss.resteasy.spi.ResteasyProviderFactory;
+import org.collectionspace.services.authorization.PermissionRole;
/**
* A PermissionRoleClient.
* @version $Revision:$
*/
-public class PermissionRoleClient extends AbstractServiceClientImpl {
-
- /** The permission role proxy. */
- private PermissionRoleProxy permissionRoleProxy;
-
+public class PermissionRoleClient extends AbstractServiceClientImpl<PermissionRoleProxy> {
@Override
public String getServiceName() {
throw new UnsupportedOperationException(); //FIXME: REM - http://issues.collectionspace.org/browse/CSPACE-3497
/* (non-Javadoc)
* @see
*/
- public String getServicePathComponent() {
- return "authorization/permissions";
- }
-
- /**
- *
- * Default constructor for PermissionRoleClient class.
- *
- */
- public PermissionRoleClient() {
- ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
- RegisterBuiltin.register(factory);
- setProxy();
- }
-
- /* (non-Javadoc)
- * @see org.collectionspace.services.client.CollectionSpaceClient#getProxy()
- */
@Override
- public CollectionSpaceProxy getProxy() {
- return this.permissionRoleProxy;
+ public String getServicePathComponent() {
+ return "authorization/permissions";
}
- /**
- * allow to reset proxy as per security needs.
- */
- public void setProxy() {
- if (useAuth()) {
- permissionRoleProxy = ProxyFactory.create(PermissionRoleProxy.class,
- getBaseURL(), new ApacheHttpClientExecutor(getHttpClient()));
- } else {
- permissionRoleProxy = ProxyFactory.create(PermissionRoleProxy.class,
- getBaseURL());
- }
- }
+ @Override
+ public Class<PermissionRoleProxy> getProxyClass() {
+ return PermissionRoleProxy.class;
+ }
+ /*
+ * CRUD+L Methods
+ */
+
/**
* Read.
*
* @see
*/
public ClientResponse<PermissionRole> read(String csid, String prcsid) {
- return permissionRoleProxy.read(csid, prcsid);
+ return getProxy().read(csid, prcsid);
}
/**
* @see
*/
public ClientResponse<PermissionRole> read(String csid) {
- return permissionRoleProxy.read(csid);
+ return getProxy().read(csid);
}
/**
* @see
*/
public ClientResponse<Response> create(String csid, PermissionRole permRole) {
- return permissionRoleProxy.create(csid, permRole);
+ return getProxy().create(csid, permRole);
}
-
-
+
/**
- * Delete given relationships between given permission and role(s)
+ * Delete with payload
*
* @param csid the csid
- * @param relationships to delete
- * @return response
- * @see
+ * @param permRole the perm role
+ * @return the client response
*/
public ClientResponse<Response> delete(String csid, PermissionRole permRole) {
- return permissionRoleProxy.delete(csid, "delete", permRole);
+ return getProxy().delete(csid, "delete", permRole);
}
-
- @Override
- public ClientResponse<Response> delete(String csid) {
- return permissionRoleProxy.delete(csid);
- }
-
}
@Produces({"application/xml"})
@Consumes({"application/xml"})
public interface PermissionRoleProxy extends CollectionSpaceProxy {
-
//(C)reate
@POST
@Path("/{csid}/permroles")
ClientResponse<PermissionRole> read(@PathParam("csid") String csid,
@PathParam("prcsid") String prcsid);
- //(D)elete
- @POST
- @Path("/{csid}/permroles")
- ClientResponse<Response> delete(@PathParam("csid") String csid,
- @QueryParam("_method") String method,
- PermissionRole permRole);
-
//(D)elete
@DELETE
@Path("/{csid}/permroles")
ClientResponse<Response> delete(@PathParam("csid") String csid);
+ //(D)elete - with a payload
+ @POST
+ @Path("/{csid}/permroles")
+ ClientResponse<Response> delete(@PathParam("csid") String csid,
+ @QueryParam("_method") String method,
+ PermissionRole permRole);
}
import org.collectionspace.services.authorization.Role;
import org.collectionspace.services.authorization.RolesList;
-import org.jboss.resteasy.client.ProxyFactory;
-import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.client.core.executors.ApacheHttpClientExecutor;
-import org.jboss.resteasy.spi.ResteasyProviderFactory;
/**
* A RoleClient.
* @version $Revision:$
*/
-public class RoleClient extends AbstractServiceClientImpl {
+public class RoleClient extends AbstractServiceClientImpl<RoleProxy> {
public static final String SERVICE_NAME = "authorization/roles";
public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;
public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT;
public static final String SERVICE_PATH_PROXY = SERVICE_PATH + "/";
- /**
- *
- */
- private RoleProxy roleProxy;
@Override
public String getServiceName() {
/* (non-Javadoc)
* @see org.collectionspace.services.client.AbstractServiceClientImpl#getServicePathComponent()
*/
- public String getServicePathComponent() {
- return "authorization/roles";
- }
-
- /**
- *
- * Default constructor for RoleClient class.
- *
- */
- public RoleClient() {
- ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
- RegisterBuiltin.register(factory);
- setProxy();
- }
-
@Override
- public CollectionSpaceProxy getProxy() {
- return this.roleProxy;
- }
-
- /**
- * allow to reset proxy as per security needs
- */
- public void setProxy() {
- if (useAuth()) {
- roleProxy = ProxyFactory.create(RoleProxy.class,
- getBaseURL(), new ApacheHttpClientExecutor(getHttpClient()));
- } else {
- roleProxy = ProxyFactory.create(RoleProxy.class,
- getBaseURL());
- }
+ public String getServicePathComponent() {
+ return SERVICE_PATH_COMPONENT;
}
/**
* @see org.collectionspace.hello.client.RoleProxy#readList()
*/
public ClientResponse<RolesList> readList() {
- return roleProxy.readList();
+ return getProxy().readList();
}
public ClientResponse<RolesList> readSearchList(String roleName) {
- return roleProxy.readSearchList(roleName);
+ return getProxy().readSearchList(roleName);
}
* @see org.collectionspace.hello.client.RoleProxy#getAccount(java.lang.String)
*/
public ClientResponse<Role> read(String csid) {
- return roleProxy.read(csid);
+ return getProxy().read(csid);
}
/**
- * @param role
- * @return
- * @see org.collectionspace.hello.client.RoleProxy#create(org.collectionspace.services.role.Role)
+ * Creates the.
+ *
+ * @param role the role
+ * @return the client response
*/
public ClientResponse<Response> create(Role role) {
- return roleProxy.create(role);
+ return getProxy().create(role);
}
/**
* @see org.collectionspace.hello.client.RoleProxy#updateAccount(java.lang.Long, org.collectionspace.services.role.Role)
*/
public ClientResponse<Role> update(String csid, Role role) {
- return roleProxy.update(csid, role);
+ return getProxy().update(csid, role);
}
- /**
- * @param csid
- * @return
- * @see org.collectionspace.hello.client.RoleProxy#deleteAccount(java.lang.Long)
- */
- public ClientResponse<Response> delete(String csid) {
- return roleProxy.delete(csid);
- }
+ @Override
+ public Class<RoleProxy> getProxyClass() {
+ return RoleProxy.class;
+ }
}
* @version $Revision:$
*/
-public class RolePermissionClient extends AbstractServiceClientImpl {
-
- /** The role permission proxy. */
- private RolePermissionProxy rolePermissionProxy;
-
+public class RolePermissionClient extends AbstractServiceClientImpl<RolePermissionProxy> {
@Override
public String getServiceName() {
- throw new UnsupportedOperationException(); //FIXME: REM - http://issues.collectionspace.org/browse/CSPACE-3498 }
+ throw new UnsupportedOperationException(); //FIXME: REM - http://issues.collectionspace.org/browse/CSPACE-3498
}
/* (non-Javadoc)
* @see
*/
- public String getServicePathComponent() {
+ public String getServicePathComponent() {
return "authorization/roles";
}
+
+ @Override
+ public Class<RolePermissionProxy> getProxyClass() {
+ return RolePermissionProxy.class;
+ }
- /**
- *
- * Default constructor for PermissionRoleClient class.
- *
- */
- public RolePermissionClient() {
- ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
- RegisterBuiltin.register(factory);
- setProxy();
- }
-
- /* (non-Javadoc)
- * @see org.collectionspace.services.client.CollectionSpaceClient#getProxy()
- */
- @Override
- public CollectionSpaceProxy getProxy() {
- return this.rolePermissionProxy;
- }
-
- /**
- * allow to reset proxy as per security needs.
- */
- public void setProxy() {
- if (useAuth()) {
- rolePermissionProxy = ProxyFactory.create(RolePermissionProxy.class,
- getBaseURL(), new ApacheHttpClientExecutor(getHttpClient()));
- } else {
- rolePermissionProxy = ProxyFactory.create(RolePermissionProxy.class,
- getBaseURL());
- }
- }
-
+ /*
+ * CRUD+L Methods
+ */
+
/**
* Read.
*
* @see
*/
public ClientResponse<PermissionRole> read(String csid) {
- return rolePermissionProxy.read(csid);
+ return getProxy().read(csid);
}
/**
* @return the client response
*/
public ClientResponse<PermissionRole> read(String csid, String prcsid) {
- return rolePermissionProxy.read(csid, prcsid);
+ return getProxy().read(csid, prcsid);
}
/**
* @see
*/
public ClientResponse<Response> create(String csid, PermissionRole permRole) {
- return rolePermissionProxy.create(csid, permRole);
+ return getProxy().create(csid, permRole);
}
/**
* @return the client response
*/
public ClientResponse<Response> delete(String csid, PermissionRole permRole) {
- return rolePermissionProxy.delete(csid, "delete", permRole);
- }
-
- /**
- * delete given relationships between given role and permission(s).
- *
- * @param csid the csid
- * @return the client response
- */
- @Override
- public ClientResponse<Response> delete(String csid) {
- return rolePermissionProxy.delete(csid);
+ return getProxy().delete(csid, "delete", permRole);
}
}
ClientResponse<PermissionRole> read(@PathParam("csid") String csid,
@PathParam("prcsid") String prcsid);
- //(D)elete - with a payload
- @POST
- @Path("/{csid}/permroles")
- ClientResponse<Response> delete(@PathParam("csid") String csid,
- @QueryParam("_method") String method, PermissionRole permRole);
-
//(D)elete
@DELETE
@Path("/{csid}/permroles")
ClientResponse<Response> delete(@PathParam("csid") String csid);
+
+ //(D)elete - with a payload
+ @POST
+ @Path("/{csid}/permroles")
+ ClientResponse<Response> delete(@PathParam("csid") String csid,
+ @QueryParam("_method") String method,
+ PermissionRole permRole);
}
package org.collectionspace.services.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;
ClientResponse<RolesList> readList();
@GET
-
ClientResponse<RolesList> readSearchList(@QueryParam("r") String roleName);
//(C)reate
@PUT
@Path("/{csid}")
ClientResponse<Role> update(@PathParam("csid") String csid, Role role);
-
- //(D)elete
- @DELETE
- @Path("/{csid}")
- ClientResponse<Response> delete(@PathParam("csid") String csid);
}
@Path("{csid}/permroles")
public Response deleteRolePermission(
@PathParam("csid") String roleCsid) {
-
if (logger.isDebugEnabled()) {
logger.debug("deleteRolePermission with roleCsid=" + roleCsid);
}
import javax.ws.rs.core.Response;
-import org.collectionspace.services.common.authorityref.AuthorityRefList;
import org.collectionspace.services.jaxb.AbstractCommonList;
-
-import org.jboss.resteasy.client.ProxyFactory;
-import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.client.core.executors.ApacheHttpClientExecutor;
-import org.jboss.resteasy.spi.ResteasyProviderFactory;
-
-import org.jboss.resteasy.plugins.providers.multipart.InputPart;
-import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
-import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
-import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput;
import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataOutput;
-
/**
* BlobClient.java
*
* $LastChangedDate: 2010-05-17 18:25:37 -0700 (Mon, 17 May 2010) $
*
*/
-public class BlobClient extends AbstractServiceClientImpl {
+public class BlobClient extends AbstractPoxServiceClientImpl<BlobProxy> {
public static final String SERVICE_NAME = "blobs";
public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;
public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT;
public String getServicePathComponent() {
return SERVICE_PATH_COMPONENT;
}
- /**
- *
- */
- private BlobProxy blobProxy;
-
- /**
- *
- * Default constructor for BlobClient class.
- *
- */
- public BlobClient() {
- ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
- RegisterBuiltin.register(factory);
- setProxy();
- }
-
- @Override
- public CollectionSpaceProxy getProxy() {
- return this.blobProxy;
- }
-
- /**
- * allow to reset proxy as per security needs
- */
- @Override
- public void setProxy() {
- if (useAuth()) {
- blobProxy = ProxyFactory.create(BlobProxy.class,
- getBaseURL(), new ApacheHttpClientExecutor(getHttpClient()));
- } else {
- blobProxy = ProxyFactory.create(BlobProxy.class,
- getBaseURL());
- }
- }
-
- /**
- * FIXME Comment this
- *
- * @return
- */
-// public static BlobClient getInstance() {
-// return instance;
-// }
+
+ @Override
+ public Class<BlobProxy> getProxyClass() {
+ return BlobProxy.class;
+ }
+ /**
+ * Blob proxied service calls
+ */
+
/**
* @return
* @see org.collectionspace.services.client.BlobProxy#getBlob()
*/
public ClientResponse<AbstractCommonList> readList() {
- return blobProxy.readList();
- }
-
- /**
- * @param csid
- * @return
- * @see org.collectionspace.services.client.BlobProxy#getAuthorityRefs(java.lang.String)
- */
- public ClientResponse<AuthorityRefList> getAuthorityRefs(String csid) {
- return blobProxy.getAuthorityRefs(csid);
- }
-
-
- /**
- * @param csid
- * @return
- * @see org.collectionspace.services.client.BlobProxy#getBlob(java.lang.String)
- */
- public ClientResponse<String> read(String csid) {
- return blobProxy.read(csid);
+ return getProxy().readList();
}
-
- /**
- * @param blob
- * @return
- *
- */
- public ClientResponse<Response> create(PoxPayloadOut xmlPayload) {
- return blobProxy.create(xmlPayload.getBytes());
- }
public ClientResponse<Response> createBlobFromFormData(MultipartFormDataOutput formDataOutput) {
- return blobProxy.createBlobFromFormData(formDataOutput);
+ return getProxy().createBlobFromFormData(formDataOutput);
}
public ClientResponse<Response> createBlobFromURI(String blobUri) {
- return blobProxy.createBlobFromURI("".getBytes(), blobUri);
- }
-
- /**
- * @param csid
- * @param blob
- * @return
- */
- public ClientResponse<String> update(String csid, PoxPayloadOut xmlPayload) {
- return blobProxy.update(csid, xmlPayload.getBytes());
-
- }
-
- /**
- * @param csid
- * @return
- * @see org.collectionspace.services.client.BlobProxy#deleteBlob(java.lang.Long)
- */
- public ClientResponse<Response> delete(String csid) {
- return blobProxy.delete(csid);
+ return getProxy().createBlobFromURI("".getBytes(), blobUri);
}
}
@Path(BlobClient.SERVICE_PATH + "/")
@Produces("application/xml")
@Consumes("application/xml")
-public interface BlobProxy extends CollectionSpaceProxy {
-
- //(C)reate
- @POST
- ClientResponse<Response> create(byte[] xmlPayload);
-
+public interface BlobProxy extends CollectionSpacePoxProxy {
//(C)reate
@POST
ClientResponse<Response> createBlobFromURI(byte[] xmlPayload,
@POST
@Consumes("multipart/form-data")
ClientResponse<Response> createBlobFromFormData(MultipartFormDataOutput formDataOutput);
-
- //(R)ead
- @GET
- @Path("/{csid}")
- ClientResponse<String> read(@PathParam("csid") String csid);
-
- //(U)pdate
- @PUT
- @Path("/{csid}")
- ClientResponse<String> update(@PathParam("csid") String csid, byte[] xmlPayload);
-
- //(D)elete
- @DELETE
- @Path("/{csid}")
- ClientResponse<Response> delete(@PathParam("csid") String csid);
-
+
// List
@GET
@Produces({"application/xml"})
- ClientResponse<AbstractCommonList> readList();
-
- // List Authority References
- @GET
- @Produces({"application/xml"})
- @Path("/{csid}/authorityrefs/")
- ClientResponse<AuthorityRefList> getAuthorityRefs(@PathParam("csid") String csid);
-
+ ClientResponse<AbstractCommonList> readList();
}
-<?xml version="1.0" encoding="UTF-8"?>\r
<classpath>\r
- <classpathentry kind="src" output="target/classes" path="src/main/java"/>\r
- <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>\r
- <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>\r
- <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>\r
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
- <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
- <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+ <classpathentry kind="src" path="src/test/java" output="target/test-classes" including="**/*.java"/>\r
+ <classpathentry kind="src" path="src/test/resources" output="target/test-classes" excluding="**/*.java"/>\r
+ <classpathentry kind="src" path="src/main/java" including="**/*.java"/>\r
+ <classpathentry kind="src" path="src/main/resources" excluding="**/*.java"/>\r
+ <classpathentry kind="output" path="target/classes"/>\r
+ <classpathentry kind="var" path="M2_REPO/javax/activation/activation/1.1/activation-1.1.jar" sourcepath="M2_REPO/javax/activation/activation/1.1/activation-1.1-sources.jar"/>\r
+ <classpathentry kind="var" path="M2_REPO/javax/security/jaas/1.0.01/jaas-1.0.01.jar"/>\r
+ <classpathentry kind="var" path="M2_REPO/javax/xml/bind/jaxb-api/2.2.2/jaxb-api-2.2.2.jar"/>\r
+ <classpathentry kind="var" path="M2_REPO/javax/annotation/jsr250-api/1.0/jsr250-api-1.0.jar" sourcepath="M2_REPO/javax/annotation/jsr250-api/1.0/jsr250-api-1.0-sources.jar"/>\r
+ <classpathentry kind="var" path="M2_REPO/javax/mail/mail/1.4/mail-1.4.jar" sourcepath="M2_REPO/javax/mail/mail/1.4/mail-1.4-sources.jar"/>\r
+ <classpathentry kind="var" path="M2_REPO/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar" sourcepath="M2_REPO/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2-sources.jar"/>\r
+ <classpathentry kind="var" path="M2_REPO/org/apache/james/apache-mime4j/0.6/apache-mime4j-0.6.jar" sourcepath="M2_REPO/org/apache/james/apache-mime4j/0.6/apache-mime4j-0.6-sources.jar">\r
+ <attributes>\r
+ <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/apache/james/apache-mime4j/0.6/apache-mime4j-0.6-javadoc.jar!/" name="javadoc_location"/>\r
+ </attributes>\r
+ </classpathentry>\r
+ <classpathentry kind="var" path="M2_REPO/classworlds/classworlds/1.1/classworlds-1.1.jar" sourcepath="M2_REPO/classworlds/classworlds/1.1/classworlds-1.1-sources.jar"/>\r
+ <classpathentry kind="var" path="M2_REPO/commons-cli/commons-cli/1.2/commons-cli-1.2.jar" sourcepath="M2_REPO/commons-cli/commons-cli/1.2/commons-cli-1.2-sources.jar"/>\r
+ <classpathentry kind="var" path="M2_REPO/commons-codec/commons-codec/1.2/commons-codec-1.2.jar">\r
+ <attributes>\r
+ <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/commons-codec/commons-codec/1.2/commons-codec-1.2-javadoc.jar!/" name="javadoc_location"/>\r
+ </attributes>\r
+ </classpathentry>\r
+ <classpathentry kind="var" path="M2_REPO/commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1.jar" sourcepath="M2_REPO/commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1-sources.jar"/>\r
+ <classpathentry kind="var" path="M2_REPO/commons-io/commons-io/1.4/commons-io-1.4.jar" sourcepath="M2_REPO/commons-io/commons-io/1.4/commons-io-1.4-sources.jar">\r
+ <attributes>\r
+ <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/commons-io/commons-io/1.4/commons-io-1.4-javadoc.jar!/" name="javadoc_location"/>\r
+ </attributes>\r
+ </classpathentry>\r
+ <classpathentry kind="var" path="M2_REPO/commons-lang/commons-lang/2.2/commons-lang-2.2.jar" sourcepath="M2_REPO/commons-lang/commons-lang/2.2/commons-lang-2.2-sources.jar">\r
+ <attributes>\r
+ <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/commons-lang/commons-lang/2.2/commons-lang-2.2-javadoc.jar!/" name="javadoc_location"/>\r
+ </attributes>\r
+ </classpathentry>\r
+ <classpathentry kind="var" path="M2_REPO/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar" sourcepath="M2_REPO/dom4j/dom4j/1.6.1/dom4j-1.6.1-sources.jar"/>\r
+ <classpathentry kind="var" path="M2_REPO/org/apache/maven/doxia/doxia-sink-api/1.0-alpha-7/doxia-sink-api-1.0-alpha-7.jar" sourcepath="M2_REPO/org/apache/maven/doxia/doxia-sink-api/1.0-alpha-7/doxia-sink-api-1.0-alpha-7-sources.jar">\r
+ <attributes>\r
+ <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/apache/maven/doxia/doxia-sink-api/1.0-alpha-7/doxia-sink-api-1.0-alpha-7-javadoc.jar!/" name="javadoc_location"/>\r
+ </attributes>\r
+ </classpathentry>\r
+ <classpathentry kind="var" path="M2_REPO/org/apache/httpcomponents/httpclient/4.0/httpclient-4.0.jar" sourcepath="M2_REPO/org/apache/httpcomponents/httpclient/4.0/httpclient-4.0-sources.jar"/>\r
+ <classpathentry kind="var" path="M2_REPO/org/apache/httpcomponents/httpcore/4.0.1/httpcore-4.0.1.jar" sourcepath="M2_REPO/org/apache/httpcomponents/httpcore/4.0.1/httpcore-4.0.1-sources.jar"/>\r
+ <classpathentry kind="var" path="M2_REPO/javassist/javassist/3.6.0.GA/javassist-3.6.0.GA.jar"/>\r
+ <classpathentry kind="var" path="M2_REPO/com/sun/xml/bind/jaxb-impl/2.2.2/jaxb-impl-2.2.2.jar"/>\r
+ <classpathentry kind="var" path="M2_REPO/com/sun/xml/bind/jaxb-xjc/2.1/jaxb-xjc-2.1.jar" sourcepath="M2_REPO/com/sun/xml/bind/jaxb-xjc/2.1/jaxb-xjc-2.1-sources.jar"/>\r
+ <classpathentry kind="var" path="M2_REPO/org/jboss/resteasy/jaxrs-api/1.2.1.GA/jaxrs-api-1.2.1.GA.jar"/>\r
+ <classpathentry kind="var" path="M2_REPO/net/jcip/jcip-annotations/1.0/jcip-annotations-1.0.jar" sourcepath="M2_REPO/net/jcip/jcip-annotations/1.0/jcip-annotations-1.0-sources.jar"/>\r
+ <classpathentry kind="var" path="M2_REPO/org/slf4j/jcl-over-slf4j/1.5.8/jcl-over-slf4j-1.5.8.jar"/>\r
+ <classpathentry kind="var" path="M2_REPO/com/jcraft/jsch/0.1.27/jsch-0.1.27.jar" sourcepath="M2_REPO/com/jcraft/jsch/0.1.27/jsch-0.1.27-sources.jar">\r
+ <attributes>\r
+ <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/com/jcraft/jsch/0.1.27/jsch-0.1.27-javadoc.jar!/" name="javadoc_location"/>\r
+ </attributes>\r
+ </classpathentry>\r
+ <classpathentry kind="var" path="M2_REPO/jtidy/jtidy/4aug2000r7-dev/jtidy-4aug2000r7-dev.jar" sourcepath="M2_REPO/jtidy/jtidy/4aug2000r7-dev/jtidy-4aug2000r7-dev-sources.jar"/>\r
+ <classpathentry kind="var" path="M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar" sourcepath="M2_REPO/junit/junit/3.8.1/junit-3.8.1-sources.jar"/>\r
+ <classpathentry kind="var" path="M2_REPO/log4j/log4j/1.2.14/log4j-1.2.14.jar" sourcepath="M2_REPO/log4j/log4j/1.2.14/log4j-1.2.14-sources.jar"/>\r
+ <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-artifact/2.0.6/maven-artifact-2.0.6.jar" sourcepath="M2_REPO/org/apache/maven/maven-artifact/2.0.6/maven-artifact-2.0.6-sources.jar">\r
+ <attributes>\r
+ <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/apache/maven/maven-artifact/2.0.6/maven-artifact-2.0.6-javadoc.jar!/" name="javadoc_location"/>\r
+ </attributes>\r
+ </classpathentry>\r
+ <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-artifact-manager/2.0.6/maven-artifact-manager-2.0.6.jar" sourcepath="M2_REPO/org/apache/maven/maven-artifact-manager/2.0.6/maven-artifact-manager-2.0.6-sources.jar">\r
+ <attributes>\r
+ <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/apache/maven/maven-artifact-manager/2.0.6/maven-artifact-manager-2.0.6-javadoc.jar!/" name="javadoc_location"/>\r
+ </attributes>\r
+ </classpathentry>\r
+ <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-core/2.0.6/maven-core-2.0.6.jar" sourcepath="M2_REPO/org/apache/maven/maven-core/2.0.6/maven-core-2.0.6-sources.jar">\r
+ <attributes>\r
+ <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/apache/maven/maven-core/2.0.6/maven-core-2.0.6-javadoc.jar!/" name="javadoc_location"/>\r
+ </attributes>\r
+ </classpathentry>\r
+ <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-error-diagnostics/2.0.6/maven-error-diagnostics-2.0.6.jar" sourcepath="M2_REPO/org/apache/maven/maven-error-diagnostics/2.0.6/maven-error-diagnostics-2.0.6-sources.jar">\r
+ <attributes>\r
+ <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/apache/maven/maven-error-diagnostics/2.0.6/maven-error-diagnostics-2.0.6-javadoc.jar!/" name="javadoc_location"/>\r
+ </attributes>\r
+ </classpathentry>\r
+ <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-model/2.0.6/maven-model-2.0.6.jar" sourcepath="M2_REPO/org/apache/maven/maven-model/2.0.6/maven-model-2.0.6-sources.jar">\r
+ <attributes>\r
+ <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/apache/maven/maven-model/2.0.6/maven-model-2.0.6-javadoc.jar!/" name="javadoc_location"/>\r
+ </attributes>\r
+ </classpathentry>\r
+ <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-monitor/2.0.6/maven-monitor-2.0.6.jar" sourcepath="M2_REPO/org/apache/maven/maven-monitor/2.0.6/maven-monitor-2.0.6-sources.jar">\r
+ <attributes>\r
+ <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/apache/maven/maven-monitor/2.0.6/maven-monitor-2.0.6-javadoc.jar!/" name="javadoc_location"/>\r
+ </attributes>\r
+ </classpathentry>\r
+ <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-plugin-api/2.0.6/maven-plugin-api-2.0.6.jar" sourcepath="M2_REPO/org/apache/maven/maven-plugin-api/2.0.6/maven-plugin-api-2.0.6-sources.jar">\r
+ <attributes>\r
+ <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/apache/maven/maven-plugin-api/2.0.6/maven-plugin-api-2.0.6-javadoc.jar!/" name="javadoc_location"/>\r
+ </attributes>\r
+ </classpathentry>\r
+ <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-plugin-descriptor/2.0.6/maven-plugin-descriptor-2.0.6.jar" sourcepath="M2_REPO/org/apache/maven/maven-plugin-descriptor/2.0.6/maven-plugin-descriptor-2.0.6-sources.jar">\r
+ <attributes>\r
+ <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/apache/maven/maven-plugin-descriptor/2.0.6/maven-plugin-descriptor-2.0.6-javadoc.jar!/" name="javadoc_location"/>\r
+ </attributes>\r
+ </classpathentry>\r
+ <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-plugin-parameter-documenter/2.0.6/maven-plugin-parameter-documenter-2.0.6.jar" sourcepath="M2_REPO/org/apache/maven/maven-plugin-parameter-documenter/2.0.6/maven-plugin-parameter-documenter-2.0.6-sources.jar">\r
+ <attributes>\r
+ <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/apache/maven/maven-plugin-parameter-documenter/2.0.6/maven-plugin-parameter-documenter-2.0.6-javadoc.jar!/" name="javadoc_location"/>\r
+ </attributes>\r
+ </classpathentry>\r
+ <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-plugin-registry/2.0.6/maven-plugin-registry-2.0.6.jar" sourcepath="M2_REPO/org/apache/maven/maven-plugin-registry/2.0.6/maven-plugin-registry-2.0.6-sources.jar">\r
+ <attributes>\r
+ <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/apache/maven/maven-plugin-registry/2.0.6/maven-plugin-registry-2.0.6-javadoc.jar!/" name="javadoc_location"/>\r
+ </attributes>\r
+ </classpathentry>\r
+ <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-profile/2.0.6/maven-profile-2.0.6.jar" sourcepath="M2_REPO/org/apache/maven/maven-profile/2.0.6/maven-profile-2.0.6-sources.jar">\r
+ <attributes>\r
+ <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/apache/maven/maven-profile/2.0.6/maven-profile-2.0.6-javadoc.jar!/" name="javadoc_location"/>\r
+ </attributes>\r
+ </classpathentry>\r
+ <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-project/2.0.6/maven-project-2.0.6.jar" sourcepath="M2_REPO/org/apache/maven/maven-project/2.0.6/maven-project-2.0.6-sources.jar">\r
+ <attributes>\r
+ <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/apache/maven/maven-project/2.0.6/maven-project-2.0.6-javadoc.jar!/" name="javadoc_location"/>\r
+ </attributes>\r
+ </classpathentry>\r
+ <classpathentry kind="var" path="M2_REPO/org/apache/maven/reporting/maven-reporting-api/2.0.6/maven-reporting-api-2.0.6.jar" sourcepath="M2_REPO/org/apache/maven/reporting/maven-reporting-api/2.0.6/maven-reporting-api-2.0.6-sources.jar">\r
+ <attributes>\r
+ <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/apache/maven/reporting/maven-reporting-api/2.0.6/maven-reporting-api-2.0.6-javadoc.jar!/" name="javadoc_location"/>\r
+ </attributes>\r
+ </classpathentry>\r
+ <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-repository-metadata/2.0.6/maven-repository-metadata-2.0.6.jar" sourcepath="M2_REPO/org/apache/maven/maven-repository-metadata/2.0.6/maven-repository-metadata-2.0.6-sources.jar">\r
+ <attributes>\r
+ <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/apache/maven/maven-repository-metadata/2.0.6/maven-repository-metadata-2.0.6-javadoc.jar!/" name="javadoc_location"/>\r
+ </attributes>\r
+ </classpathentry>\r
+ <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-settings/2.0.6/maven-settings-2.0.6.jar" sourcepath="M2_REPO/org/apache/maven/maven-settings/2.0.6/maven-settings-2.0.6-sources.jar">\r
+ <attributes>\r
+ <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/apache/maven/maven-settings/2.0.6/maven-settings-2.0.6-javadoc.jar!/" name="javadoc_location"/>\r
+ </attributes>\r
+ </classpathentry>\r
+ <classpathentry kind="var" path="M2_REPO/org/apache/maven/plugins/maven-surefire-plugin/2.4.3/maven-surefire-plugin-2.4.3.jar" sourcepath="M2_REPO/org/apache/maven/plugins/maven-surefire-plugin/2.4.3/maven-surefire-plugin-2.4.3-sources.jar">\r
+ <attributes>\r
+ <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/apache/maven/plugins/maven-surefire-plugin/2.4.3/maven-surefire-plugin-2.4.3-javadoc.jar!/" name="javadoc_location"/>\r
+ </attributes>\r
+ </classpathentry>\r
+ <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-toolchain/1.0/maven-toolchain-1.0.jar" sourcepath="M2_REPO/org/apache/maven/maven-toolchain/1.0/maven-toolchain-1.0-sources.jar">\r
+ <attributes>\r
+ <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/apache/maven/maven-toolchain/1.0/maven-toolchain-1.0-javadoc.jar!/" name="javadoc_location"/>\r
+ </attributes>\r
+ </classpathentry>\r
+ <classpathentry kind="src" path="/org.collectionspace.services.jaxb"/>\r
+ <classpathentry kind="var" path="M2_REPO/org/codehaus/plexus/plexus-container-default/1.0-alpha-9-stable-1/plexus-container-default-1.0-alpha-9-stable-1.jar" sourcepath="M2_REPO/org/codehaus/plexus/plexus-container-default/1.0-alpha-9-stable-1/plexus-container-default-1.0-alpha-9-stable-1-sources.jar">\r
+ <attributes>\r
+ <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/codehaus/plexus/plexus-container-default/1.0-alpha-9-stable-1/plexus-container-default-1.0-alpha-9-stable-1-javadoc.jar!/" name="javadoc_location"/>\r
+ </attributes>\r
+ </classpathentry>\r
+ <classpathentry kind="var" path="M2_REPO/org/codehaus/plexus/plexus-interactivity-api/1.0-alpha-4/plexus-interactivity-api-1.0-alpha-4.jar" sourcepath="M2_REPO/org/codehaus/plexus/plexus-interactivity-api/1.0-alpha-4/plexus-interactivity-api-1.0-alpha-4-sources.jar"/>\r
+ <classpathentry kind="var" path="M2_REPO/org/codehaus/plexus/plexus-utils/1.5.1/plexus-utils-1.5.1.jar" sourcepath="M2_REPO/org/codehaus/plexus/plexus-utils/1.5.1/plexus-utils-1.5.1-sources.jar"/>\r
+ <classpathentry kind="var" path="M2_REPO/org/jvnet/jaxb2-commons/property-listener-injector/1.0/property-listener-injector-1.0.jar" sourcepath="M2_REPO/org/jvnet/jaxb2-commons/property-listener-injector/1.0/property-listener-injector-1.0-sources.jar">\r
+ <attributes>\r
+ <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/jvnet/jaxb2-commons/property-listener-injector/1.0/property-listener-injector-1.0-javadoc.jar!/" name="javadoc_location"/>\r
+ </attributes>\r
+ </classpathentry>\r
+ <classpathentry kind="var" path="M2_REPO/org/jboss/resteasy/resteasy-jaxb-provider/1.2.1.GA/resteasy-jaxb-provider-1.2.1.GA.jar"/>\r
+ <classpathentry kind="var" path="M2_REPO/org/jboss/resteasy/resteasy-jaxrs/1.2.1.GA/resteasy-jaxrs-1.2.1.GA.jar" sourcepath="M2_REPO/org/jboss/resteasy/resteasy-jaxrs/1.2.1.GA/resteasy-jaxrs-1.2.1.GA-sources.jar"/>\r
+ <classpathentry kind="var" path="M2_REPO/org/jboss/resteasy/resteasy-multipart-provider/1.2.1.GA/resteasy-multipart-provider-1.2.1.GA.jar"/>\r
+ <classpathentry kind="var" path="M2_REPO/org/jvnet/jaxb2_commons/runtime/0.4.1.4/runtime-0.4.1.4.jar" sourcepath="M2_REPO/org/jvnet/jaxb2_commons/runtime/0.4.1.4/runtime-0.4.1.4-sources.jar">\r
+ <attributes>\r
+ <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/jvnet/jaxb2_commons/runtime/0.4.1.4/runtime-0.4.1.4-javadoc.jar!/" name="javadoc_location"/>\r
+ </attributes>\r
+ </classpathentry>\r
+ <classpathentry kind="var" path="M2_REPO/org/scannotation/scannotation/1.0.2/scannotation-1.0.2.jar"/>\r
+ <classpathentry kind="var" path="M2_REPO/com/sun/xml/stream/sjsxp/1.0.1/sjsxp-1.0.1.jar"/>\r
+ <classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-api/1.5.8/slf4j-api-1.5.8.jar"/>\r
+ <classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-log4j12/1.5.8/slf4j-log4j12-1.5.8.jar"/>\r
+ <classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-simple/1.5.8/slf4j-simple-1.5.8.jar"/>\r
+ <classpathentry kind="var" path="M2_REPO/org/apache/maven/surefire/surefire-api/2.4.3/surefire-api-2.4.3.jar" sourcepath="M2_REPO/org/apache/maven/surefire/surefire-api/2.4.3/surefire-api-2.4.3-sources.jar">\r
+ <attributes>\r
+ <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/apache/maven/surefire/surefire-api/2.4.3/surefire-api-2.4.3-javadoc.jar!/" name="javadoc_location"/>\r
+ </attributes>\r
+ </classpathentry>\r
+ <classpathentry kind="var" path="M2_REPO/org/apache/maven/surefire/surefire-booter/2.4.3/surefire-booter-2.4.3.jar" sourcepath="M2_REPO/org/apache/maven/surefire/surefire-booter/2.4.3/surefire-booter-2.4.3-sources.jar">\r
+ <attributes>\r
+ <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/apache/maven/surefire/surefire-booter/2.4.3/surefire-booter-2.4.3-javadoc.jar!/" name="javadoc_location"/>\r
+ </attributes>\r
+ </classpathentry>\r
+ <classpathentry kind="var" path="M2_REPO/org/testng/testng/5.6/testng-5.6-jdk15.jar"/>\r
+ <classpathentry kind="var" path="M2_REPO/org/testng/testng/5.6/testng-5.6.jar"/>\r
+ <classpathentry kind="var" path="M2_REPO/org/apache/maven/wagon/wagon-file/1.0-beta-2/wagon-file-1.0-beta-2.jar" sourcepath="M2_REPO/org/apache/maven/wagon/wagon-file/1.0-beta-2/wagon-file-1.0-beta-2-sources.jar">\r
+ <attributes>\r
+ <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/apache/maven/wagon/wagon-file/1.0-beta-2/wagon-file-1.0-beta-2-javadoc.jar!/" name="javadoc_location"/>\r
+ </attributes>\r
+ </classpathentry>\r
+ <classpathentry kind="var" path="M2_REPO/org/apache/maven/wagon/wagon-http-lightweight/1.0-beta-2/wagon-http-lightweight-1.0-beta-2.jar" sourcepath="M2_REPO/org/apache/maven/wagon/wagon-http-lightweight/1.0-beta-2/wagon-http-lightweight-1.0-beta-2-sources.jar">\r
+ <attributes>\r
+ <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/apache/maven/wagon/wagon-http-lightweight/1.0-beta-2/wagon-http-lightweight-1.0-beta-2-javadoc.jar!/" name="javadoc_location"/>\r
+ </attributes>\r
+ </classpathentry>\r
+ <classpathentry kind="var" path="M2_REPO/org/apache/maven/wagon/wagon-http-shared/1.0-beta-2/wagon-http-shared-1.0-beta-2.jar" sourcepath="M2_REPO/org/apache/maven/wagon/wagon-http-shared/1.0-beta-2/wagon-http-shared-1.0-beta-2-sources.jar">\r
+ <attributes>\r
+ <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/apache/maven/wagon/wagon-http-shared/1.0-beta-2/wagon-http-shared-1.0-beta-2-javadoc.jar!/" name="javadoc_location"/>\r
+ </attributes>\r
+ </classpathentry>\r
+ <classpathentry kind="var" path="M2_REPO/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2.jar" sourcepath="M2_REPO/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2-sources.jar">\r
+ <attributes>\r
+ <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2-javadoc.jar!/" name="javadoc_location"/>\r
+ </attributes>\r
+ </classpathentry>\r
+ <classpathentry kind="var" path="M2_REPO/org/apache/maven/wagon/wagon-ssh/1.0-beta-2/wagon-ssh-1.0-beta-2.jar" sourcepath="M2_REPO/org/apache/maven/wagon/wagon-ssh/1.0-beta-2/wagon-ssh-1.0-beta-2-sources.jar">\r
+ <attributes>\r
+ <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/apache/maven/wagon/wagon-ssh/1.0-beta-2/wagon-ssh-1.0-beta-2-javadoc.jar!/" name="javadoc_location"/>\r
+ </attributes>\r
+ </classpathentry>\r
+ <classpathentry kind="var" path="M2_REPO/org/apache/maven/wagon/wagon-ssh-common/1.0-beta-2/wagon-ssh-common-1.0-beta-2.jar" sourcepath="M2_REPO/org/apache/maven/wagon/wagon-ssh-common/1.0-beta-2/wagon-ssh-common-1.0-beta-2-sources.jar">\r
+ <attributes>\r
+ <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/apache/maven/wagon/wagon-ssh-common/1.0-beta-2/wagon-ssh-common-1.0-beta-2-javadoc.jar!/" name="javadoc_location"/>\r
+ </attributes>\r
+ </classpathentry>\r
+ <classpathentry kind="var" path="M2_REPO/org/apache/maven/wagon/wagon-ssh-external/1.0-beta-2/wagon-ssh-external-1.0-beta-2.jar" sourcepath="M2_REPO/org/apache/maven/wagon/wagon-ssh-external/1.0-beta-2/wagon-ssh-external-1.0-beta-2-sources.jar">\r
+ <attributes>\r
+ <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/apache/maven/wagon/wagon-ssh-external/1.0-beta-2/wagon-ssh-external-1.0-beta-2-javadoc.jar!/" name="javadoc_location"/>\r
+ </attributes>\r
+ </classpathentry>\r
+ <classpathentry kind="var" path="M2_REPO/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar"/>\r
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>\r
+</classpath>
\ No newline at end of file
--- /dev/null
+package org.collectionspace.services.client;\r
+\r
+import javax.ws.rs.PathParam;\r
+import javax.ws.rs.core.Response;\r
+\r
+import org.apache.commons.httpclient.HttpClient;\r
+import org.collectionspace.services.common.authorityref.AuthorityRefList;\r
+import org.collectionspace.services.jaxb.AbstractCommonList;\r
+import org.collectionspace.services.workflow.WorkflowsCommon;\r
+import org.jboss.resteasy.client.ClientResponse;\r
+\r
+public abstract class AbstractPoxServiceClientImpl<T extends CollectionSpacePoxProxy> extends AbstractServiceClientImpl<T> \r
+ implements CollectionSpacePoxClient<T> {\r
+ @Override\r
+ public ClientResponse<Response> create(PoxPayloadOut xmlPayload) {\r
+ return getProxy().create(xmlPayload.getBytes());\r
+ }\r
+ \r
+ @Override\r
+ public ClientResponse<String> read(String csid) {\r
+ return getProxy().read(csid);\r
+ }\r
+\r
+ @Override\r
+ public ClientResponse<String> update(String csid, PoxPayloadOut xmlPayload) {\r
+ return getProxy().update(csid, xmlPayload.getBytes());\r
+ }\r
+}\r
import java.net.URL;\r
import java.util.Properties;\r
\r
+import javax.ws.rs.PathParam;\r
import javax.ws.rs.core.Response;\r
\r
-//import javax.ws.rs.core.Response;\r
-\r
import org.apache.commons.httpclient.HttpClient;\r
import org.apache.commons.httpclient.UsernamePasswordCredentials;\r
import org.apache.commons.httpclient.auth.AuthScope; //import org.collectionspace.services.collectionobject.CollectionobjectsCommonList;\r
\r
+import org.collectionspace.services.common.authorityref.AuthorityRefList;\r
import org.collectionspace.services.jaxb.AbstractCommonList;\r
+import org.collectionspace.services.workflow.WorkflowsCommon;\r
import org.jboss.resteasy.client.ClientResponse; //import org.collectionspace.services.common.context.ServiceContext;\r
+import org.jboss.resteasy.client.ProxyFactory;\r
+import org.jboss.resteasy.client.core.executors.ApacheHttpClientExecutor;\r
+import org.jboss.resteasy.plugins.providers.RegisterBuiltin;\r
+import org.jboss.resteasy.spi.ResteasyProviderFactory;\r
\r
import org.slf4j.Logger;\r
import org.slf4j.LoggerFactory;\r
* @param <CommonListType> \r
* @param <ListType> \r
*/\r
-public abstract class AbstractServiceClientImpl implements\r
- CollectionSpaceClient {\r
+public abstract class AbstractServiceClientImpl<T extends CollectionSpaceProxy> implements\r
+ CollectionSpaceClient<T> {\r
\r
/** The logger. */\r
protected final Logger logger = LoggerFactory.getLogger(AbstractServiceClientImpl.class);\r
private URL url;\r
/** The http client. */\r
private HttpClient httpClient;\r
+ /** The RESTEasy proxy */\r
+ private T proxy;\r
\r
/**\r
* Gets the logger.\r
protected AbstractServiceClientImpl() {\r
readProperties();\r
setupHttpClient();\r
+ ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();\r
+ RegisterBuiltin.register(factory);\r
+ setProxy(); \r
}\r
\r
/*\r
return Boolean.getBoolean("cspace.server.secure");\r
}\r
\r
- /*\r
- * (non-Javadoc)\r
- *\r
- * @see\r
- * org.collectionspace.services.client.CollectionSpaceClient#readList(java\r
- * .lang.String, java.lang.String)\r
- */\r
- @Override\r
- public ClientResponse<AbstractCommonList> readList(Long pageSize,\r
- Long pageNumber) {\r
- return getProxy().readList(pageSize, pageNumber);\r
- }\r
-\r
- /*\r
- * (non-Javadoc)\r
- *\r
- * @see\r
- * org.collectionspace.services.client.CollectionSpaceClient#readList(java\r
- * .lang.String, java.lang.String)\r
- */\r
@Override\r
- public ClientResponse<AbstractCommonList> readList(String sortBy, Long pageSize,\r
- Long pageNumber) {\r
- return getProxy().readList(sortBy, pageSize, pageNumber);\r
+ public T getProxy() {\r
+ return proxy;\r
}\r
-\r
- /* (non-Javadoc)\r
- * @see org.collectionspace.services.client.CollectionSpaceClient#delete(java.lang.String)\r
+ \r
+ /**\r
+ * allow to reset proxy as per security needs\r
*/\r
@Override\r
- public ClientResponse<Response> delete(String csid) {\r
- // must override in children if you want behavior\r
- throw new UnsupportedOperationException();\r
+ public void setProxy() {\r
+ Class<T> proxyClass = this.getProxyClass();\r
+ if (useAuth()) {\r
+ proxy = ProxyFactory.create(proxyClass,\r
+ getBaseURL(), new ApacheHttpClientExecutor(getHttpClient()));\r
+ } else {\r
+ proxy = ProxyFactory.create(proxyClass,\r
+ getBaseURL());\r
+ }\r
}\r
\r
@Override\r
- public abstract CollectionSpaceProxy getProxy();\r
-\r
- @Override\r
- public abstract void setProxy();\r
-\r
- public void setAuth(boolean useAuth,\r
+ public void setAuth(boolean useAuth,\r
String user, boolean useUser,\r
String password, boolean usePassword) {\r
- if (useAuth) {\r
- setProperty(CollectionSpaceClient.AUTH_PROPERTY,\r
- "true");\r
+ if (useAuth == true) {\r
+ setProperty(CollectionSpaceClient.AUTH_PROPERTY, "true");\r
if (useUser) {\r
setProperty(CollectionSpaceClient.USER_PROPERTY,\r
user);\r
setupHttpClient();\r
setProxy();\r
}\r
+ \r
+ /*\r
+ * \r
+ * Common Proxied service calls\r
+ * \r
+ */\r
+ \r
+ /* (non-Javadoc)\r
+ * @see org.collectionspace.services.client.AbstractServiceClientImpl#delete(java.lang.String)\r
+ */\r
+ @Override\r
+ public ClientResponse<Response> delete(String csid) {\r
+ return getProxy().delete(csid);\r
+ }\r
+\r
+ /**\r
+ * @param csid\r
+ * @return\r
+ * @see org.collectionspace.services.client.BlobProxy#getAuthorityRefs(java.lang.String)\r
+ */\r
+ @Override\r
+ public ClientResponse<AuthorityRefList> getAuthorityRefs(String csid) {\r
+ return getProxy().getAuthorityRefs(csid);\r
+ }\r
+ \r
+ @Override\r
+ public ClientResponse<String> getWorkflow(@PathParam("csid") String csid) {\r
+ return getProxy().getWorkflow(csid);\r
+ } \r
+ \r
+ /*\r
+ * Because of how RESTEasy creates proxy classes, sub-interfaces will need to override\r
+ * these methods with their specific "common" list return types. Otherwise, only the info\r
+ * in the AbstractCommonList type will be returned to the callers\r
+ */\r
+ \r
+ /*\r
+ * (non-Javadoc)\r
+ *\r
+ * @see\r
+ * org.collectionspace.services.client.CollectionSpaceClient#readList(java\r
+ * .lang.String, java.lang.String)\r
+ */\r
+ @Override\r
+ public ClientResponse<AbstractCommonList> readList(Long pageSize,\r
+ Long pageNumber) {\r
+ return getProxy().readList(pageSize, pageNumber);\r
+ }\r
+\r
+ /*\r
+ * (non-Javadoc)\r
+ *\r
+ * @see\r
+ * org.collectionspace.services.client.CollectionSpaceClient#readList(java\r
+ * .lang.String, java.lang.String)\r
+ */\r
+ @Override\r
+ public ClientResponse<AbstractCommonList> readList(String sortBy, Long pageSize,\r
+ Long pageNumber) {\r
+ return getProxy().readList(sortBy, pageSize, pageNumber);\r
+ }\r
}\r
--- /dev/null
+package org.collectionspace.services.client;\r
+\r
+import javax.ws.rs.core.Response;\r
+\r
+import org.collectionspace.services.common.authorityref.AuthorityRefDocList;\r
+import org.collectionspace.services.common.authorityref.AuthorityRefList;\r
+import org.collectionspace.services.jaxb.AbstractCommonList;\r
+import org.jboss.resteasy.client.ClientResponse;\r
+\r
+public interface AuthorityClient<TL extends AbstractCommonList, T extends AuthorityProxy<TL>> extends CollectionSpacePoxClient<T> { \r
+ /*\r
+ * Basic CRUD operations\r
+ */\r
+ \r
+ //(C)reate Item\r
+ ClientResponse<Response> createItem(String vcsid, PoxPayloadOut poxPayloadOut);\r
+\r
+ //(R)ead Item\r
+ ClientResponse<String> readItem(String vcsid, String csid);\r
+\r
+ //(U)pdate Item\r
+ ClientResponse<String> updateItem(String vcsid, String csid, PoxPayloadOut poxPayloadOut);\r
+\r
+ //(D)elete Item\r
+ ClientResponse<Response> deleteItem(String vcsid, String csid);\r
+ \r
+ // Get a list of objects that\r
+ ClientResponse<AuthorityRefDocList> getReferencingObjects(\r
+ String parentcsid,\r
+ String itemcsid);\r
+ /**\r
+ * Get a list of objects that reference a given authority term.\r
+ * \r
+ * @param parentcsid \r
+ * @param itemcsid \r
+ * @param csid\r
+ * @return\r
+ * @see org.collectionspace.services.client.IntakeProxy#getAuthorityRefs(java.lang.String)\r
+ */\r
+ public ClientResponse<AuthorityRefList> getItemAuthorityRefs(String parentcsid, String itemcsid); \r
+ \r
+ /*\r
+ * \r
+ */\r
+ \r
+ ClientResponse<String> readByName(String name);\r
+ \r
+ /*\r
+ * Item subresource methods\r
+ */\r
+ \r
+ /**\r
+ * Read named item.\r
+ *\r
+ * @param vcsid the vcsid\r
+ * @param shortId the shortIdentifier\r
+ * @return the client response\r
+ */\r
+ public ClientResponse<String> readNamedItem(String vcsid, String shortId);\r
+\r
+ /**\r
+ * Read item in Named Authority.\r
+ *\r
+ * @param authShortId the shortIdentifier for the Authority\r
+ * @param csid the csid\r
+ * @return the client response\r
+ */\r
+ public ClientResponse<String> readItemInNamedAuthority(String authShortId, String csid);\r
+\r
+ /**\r
+ * Read named item in Named Authority.\r
+ *\r
+ * @param authShortId the shortIdentifier for the Authority\r
+ * @param itemShortId the shortIdentifier for the item\r
+ * @return the client response\r
+ */\r
+ public ClientResponse<String> readNamedItemInNamedAuthority(String authShortId, String itemShortId);\r
+ \r
+ /**\r
+ * Read item list, filtering by partial term match, or keywords. Only one of\r
+ * partialTerm or keywords should be specified. If both are specified, keywords\r
+ * will be ignored.\r
+ *\r
+ * @param inAuthority the parent authority\r
+ * @param partialTerm A partial term on which to match,\r
+ * which will filter list results to return only matched resources.\r
+ * @param keywords A set of keywords on which to match,\r
+ * which will filter list results to return only matched resources.\r
+ * @return the client response\r
+ */\r
+ public ClientResponse<TL> readItemList(String inAuthority, String partialTerm, String keywords);\r
+ \r
+ /**\r
+ * Read item list for named vocabulary, filtering by partial term match, or keywords. Only one of\r
+ * partialTerm or keywords should be specified. If both are specified, keywords\r
+ * will be ignored.\r
+ *\r
+ * @param specifier the specifier\r
+ * @param partialTerm A partial term on which to match,\r
+ * which will filter list results to return only matched resources.\r
+ * @param keywords A set of keywords on which to match,\r
+ * which will filter list results to return only matched resources.\r
+ * @return the client response\r
+ */\r
+ public ClientResponse<TL> readItemListForNamedAuthority(String specifier, \r
+ String partialTerm, String keywords);\r
+ \r
+}\r
--- /dev/null
+package org.collectionspace.services.client;\r
+\r
+import javax.ws.rs.core.Response;\r
+import org.jboss.resteasy.client.ClientResponse;\r
+\r
+import org.collectionspace.services.common.authorityref.AuthorityRefDocList;\r
+import org.collectionspace.services.common.authorityref.AuthorityRefList;\r
+import org.collectionspace.services.jaxb.AbstractCommonList;\r
+\r
+public abstract class AuthorityClientImpl<TL extends AbstractCommonList, T extends AuthorityProxy<TL>> extends AbstractPoxServiceClientImpl<T>\r
+ implements AuthorityClient<TL, T> {\r
+\r
+ /*\r
+ * Basic CRUD proxied methods\r
+ */\r
+\r
+ //(C)reate Item\r
+ @Override\r
+ public ClientResponse<Response> createItem(String vcsid, PoxPayloadOut poxPayloadOut) {\r
+ return getProxy().createItem(vcsid, poxPayloadOut.getBytes());\r
+ }\r
+\r
+ //(R)ead Item\r
+ @Override\r
+ public ClientResponse<String> readItem(String vcsid, String csid) {\r
+ return getProxy().readItem(vcsid, csid);\r
+ }\r
+\r
+ //(U)pdate Item\r
+ @Override\r
+ public ClientResponse<String> updateItem(String vcsid, String csid, PoxPayloadOut poxPayloadOut) {\r
+ return getProxy().updateItem(vcsid, csid, poxPayloadOut.getBytes());\r
+ }\r
+\r
+ //(D)elete Item\r
+ @Override\r
+ public ClientResponse<Response> deleteItem(String vcsid, String csid) {\r
+ return getProxy().deleteItem(vcsid, csid);\r
+ }\r
+ \r
+ @Override\r
+ public ClientResponse<AuthorityRefDocList> getReferencingObjects(\r
+ String parentcsid,\r
+ String itemcsid) {\r
+ return getProxy().getReferencingObjects(parentcsid, itemcsid);\r
+ }\r
+ \r
+ /**\r
+ * Gets the item authority refs.\r
+ *\r
+ * @param parentcsid the parentcsid\r
+ * @param csid the csid\r
+ * @return the item authority refs\r
+ */\r
+ @Override\r
+ public ClientResponse<AuthorityRefList> getItemAuthorityRefs(String parentcsid, String csid) {\r
+ return getProxy().getItemAuthorityRefs(parentcsid, csid);\r
+ }\r
+ \r
+ /*\r
+ * \r
+ */\r
+ \r
+ @Override\r
+ public ClientResponse<String> readByName(String name) {\r
+ return getProxy().readByName(name);\r
+ }\r
+ \r
+ /*\r
+ * Item subresource methods\r
+ */\r
+ \r
+ /**\r
+ * Read named item.\r
+ *\r
+ * @param vcsid the vcsid\r
+ * @param shortId the shortIdentifier\r
+ * @return the client response\r
+ */\r
+ @Override\r
+ public ClientResponse<String> readNamedItem(String vcsid, String shortId) {\r
+ return getProxy().readNamedItem(vcsid, shortId);\r
+ }\r
+\r
+ /**\r
+ * Read item in Named Authority.\r
+ *\r
+ * @param authShortId the shortIdentifier for the Authority\r
+ * @param csid the csid\r
+ * @return the client response\r
+ */\r
+ @Override\r
+ public ClientResponse<String> readItemInNamedAuthority(String authShortId, String csid) {\r
+ return getProxy().readItemInNamedAuthority(authShortId, csid);\r
+ }\r
+\r
+ /**\r
+ * Read named item in Named Authority.\r
+ *\r
+ * @param authShortId the shortIdentifier for the Authority\r
+ * @param itemShortId the shortIdentifier for the item\r
+ * @return the client response\r
+ */\r
+ @Override\r
+ public ClientResponse<String> readNamedItemInNamedAuthority(String authShortId, String itemShortId) {\r
+ return getProxy().readNamedItemInNamedAuthority(authShortId, itemShortId);\r
+ }\r
+\r
+ /**\r
+ * Read item list, filtering by partial term match, or keywords. Only one of\r
+ * partialTerm or keywords should be specified. If both are specified, keywords\r
+ * will be ignored.\r
+ *\r
+ * @param inAuthority the parent authority\r
+ * @param partialTerm A partial term on which to match,\r
+ * which will filter list results to return only matched resources.\r
+ * @param keywords A set of keywords on which to match,\r
+ * which will filter list results to return only matched resources.\r
+ * @return the client response\r
+ */\r
+ @Override\r
+ public ClientResponse<TL> \r
+ readItemList(String inAuthority, String partialTerm, String keywords) {\r
+ return getProxy().readItemList(inAuthority, partialTerm, keywords);\r
+ }\r
+\r
+ /**\r
+ * Read item list for named vocabulary, filtering by partial term match, or keywords. Only one of\r
+ * partialTerm or keywords should be specified. If both are specified, keywords\r
+ * will be ignored.\r
+ *\r
+ * @param specifier the specifier\r
+ * @param partialTerm A partial term on which to match,\r
+ * which will filter list results to return only matched resources.\r
+ * @param keywords A set of keywords on which to match,\r
+ * which will filter list results to return only matched resources.\r
+ * @return the client response\r
+ */\r
+\r
+ @Override\r
+ public ClientResponse<TL> readItemListForNamedAuthority(\r
+ String specifier, String partialTerm, String keywords) {\r
+ return getProxy().readItemListForNamedAuthority(specifier, partialTerm, keywords);\r
+ }\r
+}\r
--- /dev/null
+package org.collectionspace.services.client;\r
+\r
+import javax.ws.rs.DELETE;\r
+import javax.ws.rs.GET;\r
+import javax.ws.rs.POST;\r
+import javax.ws.rs.PUT;\r
+import javax.ws.rs.Path;\r
+import javax.ws.rs.PathParam;\r
+import javax.ws.rs.Produces;\r
+import javax.ws.rs.QueryParam;\r
+import javax.ws.rs.core.Response;\r
+\r
+import org.collectionspace.services.common.authorityref.AuthorityRefDocList;\r
+import org.collectionspace.services.common.authorityref.AuthorityRefList;\r
+import org.collectionspace.services.jaxb.AbstractCommonList;\r
+import org.jboss.resteasy.client.ClientResponse;\r
+\r
+public interface AuthorityProxy<TL extends AbstractCommonList> extends CollectionSpacePoxProxy {\r
+ \r
+ /*\r
+ * Basic CRUD operations\r
+ */\r
+ \r
+ //(C)reate Item\r
+ @POST\r
+ @Path("/{vcsid}/items/")\r
+ ClientResponse<Response> createItem(@PathParam("vcsid") String vcsid, byte[] xmlPayload);\r
+\r
+ //(R)ead Item\r
+ @GET\r
+ @Path("/{vcsid}/items/{csid}")\r
+ ClientResponse<String> readItem(@PathParam("vcsid") String vcsid, @PathParam("csid") String csid);\r
+\r
+ //(U)pdate Item\r
+ @PUT\r
+ @Path("/{vcsid}/items/{csid}")\r
+ ClientResponse<String> updateItem(@PathParam("vcsid") String vcsid, @PathParam("csid") String csid, byte[] xmlPayload);\r
+\r
+ //(D)elete Item\r
+ @DELETE\r
+ @Path("/{vcsid}/items/{csid}")\r
+ ClientResponse<Response> deleteItem(@PathParam("vcsid") String vcsid, @PathParam("csid") String csid);\r
+ \r
+ /**\r
+ * Get a list of objects that reference a given authority term.\r
+ * \r
+ * @param parentcsid \r
+ * @param itemcsid \r
+ * @param csid\r
+ * @return\r
+ * @see org.collectionspace.services.client.IntakeProxy#getAuthorityRefs(java.lang.String)\r
+ */\r
+ @GET\r
+ @Path("{csid}/items/{itemcsid}/refObjs")\r
+ @Produces("application/xml")\r
+ ClientResponse<AuthorityRefDocList> getReferencingObjects(\r
+ @PathParam("csid") String parentcsid,\r
+ @PathParam("itemcsid") String itemcsid);\r
+ \r
+ // List Item Authority References\r
+ @GET\r
+ @Produces({"application/xml"})\r
+ @Path("/{parentcsid}/items/{itemcsid}/authorityrefs/")\r
+ public ClientResponse<AuthorityRefList> getItemAuthorityRefs(\r
+ @PathParam("parentcsid") String parentcsid,\r
+ @PathParam("itemcsid") String itemcsid);\r
+ \r
+ /*\r
+ * \r
+ */\r
+ \r
+ //(R)ead by name\r
+ @GET\r
+ @Path("/urn:cspace:name({name})")\r
+ ClientResponse<String> readByName(@PathParam("name") String name);\r
+ \r
+ /*\r
+ * Item subresource methods\r
+ */\r
+ \r
+ //(R)ead Named Item\r
+ @GET\r
+ @Path("/{vcsid}/items/urn:cspace:name({specifier})")\r
+ ClientResponse<String> readNamedItem(@PathParam("vcsid") String vcsid, @PathParam("specifier") String specifier);\r
+\r
+ //(R)ead Item In Named Authority\r
+ @GET\r
+ @Path("/urn:cspace:name({specifier})/items/{csid}")\r
+ ClientResponse<String> readItemInNamedAuthority(@PathParam("specifier") String specifier, @PathParam("csid") String csid);\r
+\r
+ //(R)ead Named Item In Named Authority\r
+ @GET\r
+ @Path("/urn:cspace:name({specifier})/items/urn:cspace:name({itemspecifier})")\r
+ ClientResponse<String> readNamedItemInNamedAuthority(@PathParam("specifier") String specifier, @PathParam("itemspecifier") String itemspecifier);\r
+ \r
+ /*\r
+ * Item subresource List methods\r
+ */\r
+\r
+ // List Items matching a partial term or keywords.\r
+ @GET\r
+ @Produces({"application/xml"})\r
+ @Path("/{csid}/items/")\r
+ ClientResponse<TL> readItemList(\r
+ @PathParam("csid") String vcsid,\r
+ @QueryParam (IQueryManager.SEARCH_TYPE_PARTIALTERM) String partialTerm,\r
+ @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords);\r
+ \r
+ // List Items for a named authority matching a partial term or keywords.\r
+ @GET\r
+ @Produces({"application/xml"})\r
+ @Path("/urn:cspace:name({specifier})/items/")\r
+ ClientResponse<TL> readItemListForNamedAuthority(\r
+ @PathParam("specifier") String specifier,\r
+ @QueryParam (IQueryManager.SEARCH_TYPE_PARTIALTERM) String partialTerm,\r
+ @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords);\r
+\r
+}\r
*/
package org.collectionspace.services.client;
+import javax.ws.rs.PathParam;
import javax.ws.rs.core.Response;
import org.apache.commons.httpclient.HttpClient;
+import org.collectionspace.services.common.authorityref.AuthorityRefList;
import org.collectionspace.services.jaxb.AbstractCommonList;
+import org.collectionspace.services.workflow.WorkflowsCommon;
import org.jboss.resteasy.client.ClientResponse;
/**
*
*/
-public interface CollectionSpaceClient {
+public interface CollectionSpaceClient<T extends CollectionSpaceProxy> {
public static final String AUTH_PROPERTY = "cspace.auth";
public static final String PASSWORD_PROPERTY = "cspace.password";
*
* @return the proxy
*/
- CollectionSpaceProxy getProxy();
+ T getProxy();
+ Class<T> getProxyClass();
+
/**
* Gets the base url.
*
* @return boolean
*/
boolean isServerSecure();
+
+ /*
+ * Common proxied service calls
+ */
/**
* Read list.
Long pageSize,
Long pageNumber);
+ /**
+ * Gets the workflow information
+ *
+ * @param csid the csid of the entity
+ * @return the workflow
+ */
+ public ClientResponse<String> getWorkflow(@PathParam("csid") String csid);
+
+ /**
+ * Gets the authority refs.
+ *
+ * @param csid the csid
+ * @return the authority refs
+ */
+ public ClientResponse<AuthorityRefList> getAuthorityRefs(String csid);
+
/**
* Delete.
*
--- /dev/null
+package org.collectionspace.services.client;\r
+\r
+import javax.ws.rs.core.Response;\r
+import org.jboss.resteasy.client.ClientResponse;\r
+\r
+public interface CollectionSpacePoxClient<T extends CollectionSpacePoxProxy> extends CollectionSpaceClient<T> {\r
+ /*\r
+ * Common service calls\r
+ */\r
+ public ClientResponse<Response> create(PoxPayloadOut xmlPayload);\r
+ \r
+ public ClientResponse<String> read(String csid);\r
+\r
+ public ClientResponse<String> update(String csid, PoxPayloadOut xmlPayload);\r
+}\r
--- /dev/null
+package org.collectionspace.services.client;\r
+\r
+import javax.ws.rs.GET;\r
+import javax.ws.rs.POST;\r
+import javax.ws.rs.PUT;\r
+import javax.ws.rs.Path;\r
+import javax.ws.rs.PathParam;\r
+import javax.ws.rs.core.Response;\r
+\r
+import org.jboss.resteasy.client.ClientResponse;\r
+\r
+public interface CollectionSpacePoxProxy extends CollectionSpaceProxy {\r
+ //(C)reate\r
+ @POST\r
+ ClientResponse<Response> create(byte[] payload);\r
+\r
+ //(R)ead\r
+ @GET\r
+ @Path("/{csid}")\r
+ ClientResponse<String> read(@PathParam("csid") String csid);\r
+\r
+ //(U)pdate\r
+ @PUT\r
+ @Path("/{csid}")\r
+ ClientResponse<String> update(@PathParam("csid") String csid, byte[] payload);\r
+}\r
package org.collectionspace.services.client;\r
\r
import javax.ws.rs.GET;\r
+import javax.ws.rs.DELETE;\r
+import javax.ws.rs.Path;\r
+import javax.ws.rs.PathParam;\r
import javax.ws.rs.Produces;\r
import javax.ws.rs.QueryParam;\r
+import javax.ws.rs.core.Response;\r
\r
+import org.collectionspace.services.common.authorityref.AuthorityRefList;\r
import org.collectionspace.services.jaxb.AbstractCommonList;\r
+import org.collectionspace.services.workflow.WorkflowsCommon;\r
import org.jboss.resteasy.client.ClientResponse;\r
\r
/**\r
*/\r
public interface CollectionSpaceProxy {\r
\r
+ //(D)elete\r
+ @DELETE\r
+ @Path("/{csid}")\r
+ ClientResponse<Response> delete(@PathParam("csid") String csid);\r
+ \r
+ // List Authority References\r
+ @GET\r
+ @Produces({"application/xml"})\r
+ @Path("/{csid}/authorityrefs/")\r
+ ClientResponse<AuthorityRefList> getAuthorityRefs(@PathParam("csid") String csid);\r
+ \r
+ @GET\r
+ @Path("{csid}/workflow")\r
+ ClientResponse<String> getWorkflow(@PathParam("csid") String csid);\r
+ \r
+ /*\r
+ * (R)read List operations\r
+ */\r
+ \r
/**\r
* Read list.\r
*\r
* You may obtain a copy of the ECL 2.0 License at\r
* https://source.collectionspace.org/collection-space/LICENSE.txt\r
*/\r
-package org.collectionspace.services.common.query;\r
+package org.collectionspace.services.client;\r
\r
public interface IQueryManager {\r
\r
* @version $Revision:$
*/
-public class TestServiceClient extends AbstractServiceClientImpl {
+public class TestServiceClient extends AbstractServiceClientImpl<TestServiceProxy> {
/**
*
throw new UnsupportedOperationException();
}
-
- @Override
- public CollectionSpaceProxy getProxy() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public void setProxy() {
- throw new UnsupportedOperationException();
- }
-
- public ClientResponse<Response> delete(String csid) {
- throw new UnsupportedOperationException();
- }
-
@Override
public String getServiceName() {
throw new UnsupportedOperationException();
- }
+ }
+
+ @Override
+ public Class<TestServiceProxy> getProxyClass() {
+ // TODO Auto-generated method stub
+ return TestServiceProxy.class;
+ }
}
--- /dev/null
+package org.collectionspace.services.client;\r
+\r
+public interface TestServiceProxy extends CollectionSpaceProxy {\r
+\r
+}\r
--- /dev/null
+package org.collectionspace.services.client.test;\r
+\r
+public class ServiceTestUtils {\r
+\r
+ \r
+}\r
org.collectionspace.collectionspace_core\r
Provide-Package: org.collectionspace.collectionobject\r
Nuxeo-Component: OSGI-INF/core-types-contrib.xml,\r
+ OSGI-INF/life-cycle-contrib.xml,\r
OSGI-INF/ecm-types-contrib.xml,\r
OSGI-INF/layouts-contrib.xml\r
-\r
<schema name="collectionobjects_naturalhistory" prefix="collectionobjects_naturalhistory" src="schemas/collectionobjects_naturalhistory.xsd"/>
</extension>
<extension target="org.nuxeo.ecm.core.schema.TypeService" point="doctype">
- <doctype name="CollectionObject" extends="Document">
+ <doctype name="CollectionObject" extends="CollectionSpaceDocument">
<schema name="common"/>
<schema name="dublincore"/>
<schema name="collectionspace_core"/>
--- /dev/null
+<?xml version="1.0"?>
+<component name="org.collectionspace.ecm.platform.collectionobject.LifeCycleManagerExtensions">
+
+ <extension target="org.nuxeo.ecm.core.lifecycle.LifeCycleService"
+ point="types">
+ <types>
+ <type name="CollectionObject">default</type>
+ </types>
+ </extension>
+
+</component>
*/
package org.collectionspace.services.client;
+import org.jboss.resteasy.client.ClientResponse;
import javax.ws.rs.core.Response;
-
import org.collectionspace.services.collectionobject.CollectionobjectsCommonList;
-import org.collectionspace.services.common.authorityref.AuthorityRefList;
-//import org.collectionspace.services.common.context.ServiceContext;
-//import org.collectionspace.services.common.query.IQueryManager;
-import org.jboss.resteasy.client.ProxyFactory;
-import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
-import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.client.core.executors.ApacheHttpClientExecutor;
-//import org.jboss.resteasy.plugins.providers.multipart.PoxPayloadIn;
-//import org.jboss.resteasy.plugins.providers.multipart.PoxPayloadOut;
-import org.jboss.resteasy.spi.ResteasyProviderFactory;
-
-import org.slf4j.Logger;
/**
* The Class CollectionObjectClient.
* FIXME: http://issues.collectionspace.org/browse/CSPACE-1684
*/
-public class CollectionObjectClient extends AbstractServiceClientImpl {
+public class CollectionObjectClient extends AbstractPoxServiceClientImpl<CollectionObjectProxy> {
public static final String SERVICE_NAME = "collectionobjects";
public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;
public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT;
public static final String SERVICE_PATH_PROXY = SERVICE_PATH + "/";
public static final String SERVICE_PAYLOAD_NAME = SERVICE_NAME;
-
- /** The collection object proxy. */
- private CollectionObjectProxy collectionObjectProxy;
@Override
public String getServiceName() {
return SERVICE_NAME;
}
- /* (non-Javadoc)
- * @see org.collectionspace.services.client.BaseServiceClient#getServicePathComponent()
- */
@Override
public String getServicePathComponent() {
return SERVICE_PATH_COMPONENT;
}
- /**
- * Instantiates a new collection object client.
- */
- public CollectionObjectClient() {
- ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
- RegisterBuiltin.register(factory);
- setProxy();
- }
-
- @Override
- public CollectionSpaceProxy getProxy() {
- return this.collectionObjectProxy;
- }
-
- /**
- * Sets the proxy.
- */
- public void setProxy() {
- if(useAuth()){
- collectionObjectProxy = ProxyFactory.create(CollectionObjectProxy.class,
- getBaseURL(), new ApacheHttpClientExecutor(getHttpClient()));
- }else{
- collectionObjectProxy = ProxyFactory.create(CollectionObjectProxy.class,
- getBaseURL());
- }
- }
+ @Override
+ public Class<CollectionObjectProxy> getProxyClass() {
+ return CollectionObjectProxy.class;
+ }
- /**
+ /*
+ * Proxied service calls
+ */
+
+ /**
* Read list.
*
* @see org.collectionspace.services.client.CollectionObjectProxy#readList()
* @return the client response< collectionobjects common list>
*/
public ClientResponse<CollectionobjectsCommonList> readList() {
- return collectionObjectProxy.readList();
+ CollectionObjectProxy proxy = (CollectionObjectProxy)getProxy();
+ return proxy.readList();
}
-// @Override
-// public ClientResponse<CollectionobjectsCommonList> readList(String pageSize,
-// String pageNumber) {
-// return collectionObjectProxy.readList(pageSize, pageNumber);
-// }
-
/**
* Roundtrip.
*
*/
public ClientResponse<Response> roundtrip(int ms) {
getLogger().debug(">>>>Roundtrip start.");
- ClientResponse<Response> result = collectionObjectProxy.roundtrip(ms);
+ ClientResponse<Response> result = getProxy().roundtrip(ms);
getLogger().debug("<<<<Roundtrip stop.");
return result;
}
* @see org.collectionspace.services.client.CollectionObjectProxy#keywordSearch()
* @return the client response< collectionobjects common list>
*/
- public ClientResponse<CollectionobjectsCommonList> keywordSearch(String keywords) {
- return collectionObjectProxy.keywordSearch(keywords);
- }
-
-
- /**
- * Read.
- *
- * @param csid the csid
- *
- * @see org.collectionspace.services.client.CollectionObjectProxy#keywordSearch()
- * @return the client response< multipart input>
- */
- public ClientResponse<String> read(String csid) {
- return collectionObjectProxy.read(csid);
+ public ClientResponse<CollectionobjectsCommonList> keywordSearch(String keywords) {
+ return getProxy().keywordSearch(keywords);
}
-
- public ClientResponse<Response> createPicture(String csid) {
- return collectionObjectProxy.createPicture(csid);
- }
-
- /**
- * @param csid
- * @return response
- * @see org.collectionspace.services.client.CollectionObjectProxy#getAuthorityRefs(java.lang.String)
- */
- public ClientResponse<AuthorityRefList> getAuthorityRefs(String csid) {
- return collectionObjectProxy.getAuthorityRefs(csid);
- }
-
-
- /**
- * Creates the.
- *
- * @param multipart the multipart
- *
- * @see org.collectionspace.services.client.CollectionObjectProxy#create()
- * @return the client response< response>
- */
- public ClientResponse<Response> create(PoxPayloadOut xmlPayload) {
- return collectionObjectProxy.create(xmlPayload.getBytes());
- }
-
- /**
- * Update.
- *
- * @param csid the csid
- * @param multipart the multipart
- *
- * @see org.collectionspace.services.client.CollectionObjectProxy#update()
- * @return the client response< multipart input>
- */
- public ClientResponse<String> update(String csid, PoxPayloadOut multipart) {
- String payload = multipart.toXML();
- return collectionObjectProxy.update(csid, payload.getBytes());
- }
-
- /**
- * Delete.
- *
- * @param csid the csid
- *
- * @see org.collectionspace.services.client.CollectionObjectProxy#delete()
- * @return the client response< response>
- */
- @Override
- public ClientResponse<Response> delete(String csid) {
- return collectionObjectProxy.delete(csid);
- }
-
}
*/
package org.collectionspace.services.client;
+import org.jboss.resteasy.client.ClientResponse;
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.QueryParam;
import javax.ws.rs.Produces;
-//import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
-//import javax.ws.rs.core.UriInfo;
-//import org.collectionspace.services.client.IClientQueryParams;
-import org.collectionspace.services.client.CollectionSpaceProxy;
-import org.collectionspace.services.common.query.IQueryManager;
-import org.collectionspace.services.common.authorityref.AuthorityRefList;
-//import org.collectionspace.services.jaxb.AbstractCommonList;
import org.collectionspace.services.collectionobject.CollectionobjectsCommonList;
-import org.jboss.resteasy.client.ClientResponse;
-
/**
* @version $Revision:$
* FIXME: http://issues.collectionspace.org/browse/CSPACE-1684
@Path(CollectionObjectClient.SERVICE_PATH_PROXY)
@Produces({"application/xml"})
@Consumes({"application/xml"})
-public interface CollectionObjectProxy extends CollectionSpaceProxy {
-
- /**
- * Read list.
- *
- * @return the client response
- */
- @GET
- @Produces({"application/xml"})
- ClientResponse<CollectionobjectsCommonList> readList();
-
-// /**
-// * Read list. //FIXME: REM - Remove this dead code please.
-// *
-// * @param pageSize the page size
-// * @param pageNumber the page number
-// * @return the client response
-// */
-// @GET
-// @Produces({"application/xml"})
-// @Override
-// ClientResponse<CollectionobjectsCommonList> readList(
-// @QueryParam(IClientQueryParams.PAGE_SIZE_PARAM) String pageSize,
-// @QueryParam(IClientQueryParams.START_PAGE_PARAM) String pageNumber);
-
+public interface CollectionObjectProxy extends CollectionSpacePoxProxy {
/**
* Roundtrip.
ClientResponse<Response> roundtrip(@PathParam("ms") int ms);
/**
- * Keyword search.
- *
- * @param keywords the keywords
- * @return the client response
- */
- @GET
- @Produces({"application/xml"})
- ClientResponse<CollectionobjectsCommonList> keywordSearch(
- @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords);
-
- //(C)reate
- /**
- * Creates the.
- *
- * @param payload the payload
- * @return the client response
- */
- @POST
- ClientResponse<Response> create(byte[] payload);
-
- //(R)ead
- /**
- * Read.
+ * Read list.
*
- * @param csid the csid
* @return the client response
*/
- @GET
- @Path("/{csid}")
- ClientResponse<String> read(@PathParam("csid") String csid);
-
@GET
@Produces({"application/xml"})
- @Path("/{csid}/picture")
- @Deprecated //FIXME: REM - Remove this method and the corresponding client, and resource as well.
- ClientResponse<Response> createPicture(@PathParam("csid") String csid);
+ ClientResponse<CollectionobjectsCommonList> readList();
- // List Authority references
/**
- * Gets the authority refs.
+ * Keyword search.
*
- * @param csid the csid
- * @return the authority refs
+ * @param keywords the keywords
+ * @return the client response
*/
@GET
@Produces({"application/xml"})
- @Path("/{csid}/authorityrefs/")
- ClientResponse<AuthorityRefList> getAuthorityRefs(@PathParam("csid") String csid);
+ ClientResponse<CollectionobjectsCommonList> keywordSearch(
+ @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords);
-
- //(U)pdate
- /**
- * Update.
- *
- * @param csid the csid
- * @param multipart the multipart
- * @return the client response
- */
- @PUT
- @Path("/{csid}")
- ClientResponse<String> update(@PathParam("csid") String csid, byte[] payload);
-
- //(D)elete
- /**
- * Delete.
- *
- * @param csid the csid
- * @return the client response
- */
- @DELETE
- @Path("/{csid}")
- ClientResponse<Response> delete(@PathParam("csid") String csid);
}
import javax.ws.rs.core.MultivaluedMap;
import org.collectionspace.services.client.CollectionObjectClient;
+import org.collectionspace.services.client.IQueryManager;
import org.collectionspace.services.client.PoxPayloadIn;
import org.collectionspace.services.client.PoxPayloadOut;
//import org.collectionspace.services.common.imaging.nuxeo.NuxeoImageUtils; //FIXME: REM - Please remove all unneeded imports
import org.collectionspace.services.common.document.DocumentHandler;
import org.collectionspace.services.common.document.DocumentNotFoundException;
import org.collectionspace.services.common.document.DocumentWrapper;
-import org.collectionspace.services.common.query.IQueryManager;
+//import org.collectionspace.services.common.query.IQueryManager;
import org.collectionspace.services.common.query.QueryManager;
import org.collectionspace.services.common.security.UnauthorizedException;
import org.collectionspace.services.intake.IntakeResource;
<?xml version="1.0" encoding="UTF-8"?>\r
<projectDescription>\r
<name>common-api</name>\r
- <comment/>\r
- <projects/>\r
+ <comment></comment>\r
+ <projects>\r
+ </projects>\r
<buildSpec>\r
<buildCommand>\r
<name>org.eclipse.jdt.core.javabuilder</name>\r
- <arguments/>\r
+ <arguments>\r
+ </arguments>\r
+ </buildCommand>\r
+ <buildCommand>\r
+ <name>org.maven.ide.eclipse.maven2Builder</name>\r
+ <arguments>\r
+ </arguments>\r
</buildCommand>\r
</buildSpec>\r
<natures>\r
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>\r
<nature>org.eclipse.jdt.core.javanature</nature>\r
</natures>\r
</projectDescription>\r
</tenant:serviceBindings>
<!-- end movement service meta-data -->
+ <!-- begin Workflow service meta-data -->
+ <tenant:serviceBindings name="Workflows" type="procedure" version="0.1">
+ <service:repositoryDomain xmlns:service='http://collectionspace.org/services/common/service'>
+ default-domain
+ </service:repositoryDomain>
+ <service:documentHandler xmlns:service='http://collectionspace.org/services/common/service'>
+ org.collectionspace.services.common.workflow.service.nuxeo.WorkflowDocumentModelHandler
+ </service:documentHandler>
+ <service:validatorHandler xmlns:service='http://collectionspace.org/services/common/service'>
+ org.collectionspace.services.workflow.nuxeo.WorkflowValidatorHandler
+ </service:validatorHandler>
+ <service:object name="Workflow" version="0.1"
+ xmlns:service='http://collectionspace.org/services/common/service'>
+ <service:part id="0" control_group="Managed"
+ versionable="true" auditable="false"
+ label="workflows-system" updated="" order="0">
+ <service:content contentType="application/xml">
+ <service:xmlContent
+ namespaceURI="http://collectionspace.org/services/common/system"
+ schemaLocation="http://collectionspace.org/services/common/system http://collectionspace.org/services/common/system/system-response.xsd">
+ </service:xmlContent>
+ </service:content>
+ </service:part>
+ <service:part id="1" control_group="Managed"
+ versionable="true" auditable="false"
+ label="workflows_common" updated="" order="1">
+ <service:content contentType="application/xml">
+ <service:xmlContent
+ namespaceURI="http://collectionspace.org/services/workflow"
+ schemaLocation="http://collectionspace.org/services/workflow http://services.collectionspace.org/movement/workflows_common.xsd">
+ </service:xmlContent>
+ </service:content>
+ </service:part>
+ </service:object>
+ </tenant:serviceBindings>
+ <!-- end Workflow service meta-data -->
+
<!-- begin report service meta-data -->
<tenant:serviceBindings name="Reports" type="procedure" version="0.1">
<!-- other URI paths using which this service could be accessed -->
*/\r
package org.collectionspace.services.common;\r
\r
+import javax.ws.rs.GET;\r
+import javax.ws.rs.Path;\r
+import javax.ws.rs.PathParam;\r
+import javax.ws.rs.WebApplicationException;\r
+import javax.ws.rs.core.Response;\r
+\r
import org.collectionspace.services.client.PayloadInputPart;\r
import org.collectionspace.services.client.PoxPayloadIn;\r
import org.collectionspace.services.client.PoxPayloadOut;\r
import org.collectionspace.services.common.context.ServiceContext;\r
import org.collectionspace.services.common.context.ServiceContextFactory;\r
import org.collectionspace.services.common.document.DocumentHandler;\r
+import org.collectionspace.services.common.document.DocumentNotFoundException;\r
+import org.collectionspace.services.common.security.UnauthorizedException;\r
+import org.collectionspace.services.common.workflow.client.WorkflowClient;\r
+import org.collectionspace.services.common.workflow.service.nuxeo.WorkflowDocumentModelHandler;\r
+import org.collectionspace.services.workflow.WorkflowsCommon;\r
\r
-import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;\r
-import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;\r
import org.slf4j.Logger;\r
import org.slf4j.LoggerFactory;\r
\r
return MultipartServiceContextFactory.get();\r
}\r
\r
+ protected WebApplicationException bigReThrow(Exception e, String serviceMsg)\r
+ throws WebApplicationException {\r
+ return bigReThrow(e, serviceMsg, "");\r
+ }\r
+\r
+ protected WebApplicationException bigReThrow(Exception e,\r
+ String serviceMsg, String csid) throws WebApplicationException {\r
+ Response response;\r
+ if (logger.isDebugEnabled()) {\r
+ logger.debug(getClass().getName(), e);\r
+ }\r
+ if (e instanceof UnauthorizedException) {\r
+ response = Response.status(Response.Status.UNAUTHORIZED)\r
+ .entity(serviceMsg + e.getMessage()).type("text/plain")\r
+ .build();\r
+ return new WebApplicationException(response);\r
+ } else if (e instanceof DocumentNotFoundException) {\r
+ response = Response\r
+ .status(Response.Status.NOT_FOUND)\r
+ .entity(serviceMsg + " on " + getClass().getName()\r
+ + " csid=" + csid).type("text/plain").build();\r
+ return new WebApplicationException(response);\r
+ } else if (e instanceof WebApplicationException) {\r
+ //\r
+ // subresource may have already thrown this exception\r
+ // so just pass it on\r
+ return (WebApplicationException)e;\r
+ } else { // e is now instanceof Exception\r
+ response = Response.status(Response.Status.INTERNAL_SERVER_ERROR)\r
+ .entity(serviceMsg).type("text/plain").build();\r
+ return new WebApplicationException(response);\r
+ }\r
+ }\r
+ \r
@Override\r
public DocumentHandler createDocumentHandler(ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx) throws Exception {\r
return createDocumentHandler(ctx, ctx.getCommonPartLabel(), getCommonPartClass());\r
return createDocumentHandler(ctx, ctx.getCommonPartLabel(), commonClass);\r
}\r
\r
+ /**\r
+ * Creates the contact document handler.\r
+ * \r
+ * @param ctx the ctx\r
+ * @param inAuthority the in authority\r
+ * @param inItem the in item\r
+ * \r
+ * @return the document handler\r
+ * \r
+ * @throws Exception the exception\r
+ */\r
+ private WorkflowDocumentModelHandler createWorkflowDocumentHandler(\r
+ ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx) throws Exception {\r
+ \r
+ WorkflowDocumentModelHandler docHandler = (WorkflowDocumentModelHandler)createDocumentHandler(ctx,\r
+ WorkflowClient.SERVICE_COMMONPART_NAME,\r
+ WorkflowsCommon.class); \r
+ \r
+ return docHandler;\r
+ }\r
+ \r
+ /*\r
+ * JAX-RS Annotated methods\r
+ */\r
+ \r
+ @GET\r
+ @Path("{csid}/workflow")\r
+ public byte[] getWorkflow(\r
+ @PathParam("csid") String csid) {\r
+ PoxPayloadOut result = null;\r
+\r
+ try {\r
+ ServiceContext<PoxPayloadIn, PoxPayloadOut> parentCtx = createServiceContext();\r
+ String parentWorkspaceName = parentCtx.getRepositoryWorkspaceName();\r
+ \r
+ MultipartServiceContext ctx = (MultipartServiceContext) createServiceContext(WorkflowClient.SERVICE_NAME);\r
+ WorkflowDocumentModelHandler handler = createWorkflowDocumentHandler(ctx);\r
+ ctx.setRespositoryWorkspaceName(parentWorkspaceName); //find the document in the parent's workspace\r
+ getRepositoryClient(ctx).get(ctx, csid, handler);\r
+ result = ctx.getOutput();\r
+ } catch (Exception e) {\r
+ throw bigReThrow(e, ServiceMessages.READ_FAILED + WorkflowClient.SERVICE_PAYLOAD_NAME, csid);\r
+ }\r
+ \r
+ return result.getBytes();\r
+ }\r
+ \r
}\r
\r
package org.collectionspace.services.common;\r
\r
+import org.collectionspace.services.client.IQueryManager;\r
import org.collectionspace.services.client.PoxPayloadIn;\r
import org.collectionspace.services.client.PoxPayloadOut;\r
import org.collectionspace.services.common.authorityref.AuthorityRefList;\r
import org.collectionspace.services.common.document.DocumentHandler;\r
import org.collectionspace.services.common.document.DocumentNotFoundException;\r
import org.collectionspace.services.common.document.DocumentWrapper;\r
-import org.collectionspace.services.common.query.IQueryManager;\r
import org.collectionspace.services.common.query.QueryManager;\r
import org.collectionspace.services.common.security.UnauthorizedException;\r
import org.collectionspace.services.jaxb.AbstractCommonList;\r
}\r
}\r
\r
- protected WebApplicationException bigReThrow(Exception e, String serviceMsg)\r
- throws WebApplicationException {\r
- return bigReThrow(e, serviceMsg, "");\r
- }\r
-\r
- protected WebApplicationException bigReThrow(Exception e,\r
- String serviceMsg, String csid) throws WebApplicationException {\r
- Response response;\r
- //if (logger.isDebugEnabled()) {\r
- logger.error(getClass().getName(), e);\r
- //}\r
- if (e instanceof UnauthorizedException) {\r
- response = Response.status(Response.Status.UNAUTHORIZED)\r
- .entity(serviceMsg + e.getMessage()).type("text/plain")\r
- .build();\r
- return new WebApplicationException(response);\r
- } else if (e instanceof DocumentNotFoundException) {\r
- response = Response\r
- .status(Response.Status.NOT_FOUND)\r
- .entity(serviceMsg + " on " + getClass().getName()\r
- + " csid=" + csid).type("text/plain").build();\r
- return new WebApplicationException(response);\r
- } else if (e instanceof WebApplicationException) {\r
- //\r
- // subresource may have already thrown this exception\r
- // so just pass it on\r
- return (WebApplicationException)e;\r
- } else { // e is now instanceof Exception\r
- response = Response.status(Response.Status.INTERNAL_SERVER_ERROR)\r
- .entity(serviceMsg).type("text/plain").build();\r
- return new WebApplicationException(response);\r
- }\r
- }\r
\r
//======================= CREATE ====================================================\r
\r
public class ServiceMessages {
private static final String FAILED = "failed: ";
+ private static final String UNSUPPORTED = "unsupported: ";
public static final String POST_FAILED = "POST " + FAILED;
public static final String GET_FAILED = "GET " + FAILED;
public static final String CREATE_FAILED = "Create request " + FAILED;
public static final String READ_FAILED = "Read request " + FAILED;
public static final String UPDATE_FAILED = "Update request " + FAILED;
+
+ public static final String POST_UNSUPPORTED = "POST " + UNSUPPORTED;
+ public static final String GET_UNSUPPORTED = "GET " + UNSUPPORTED;
+ public static final String GET_LIST_UNSUPPORTED = "GET/LIST " + UNSUPPORTED;
+ public static final String PUT_UNSUPPORTED = "PUT " + UNSUPPORTED;
+ public static final String DELETE_UNSUPPORTED = "DELETE " + UNSUPPORTED;
public static final String DELETE_FAILED = "Delete request " + FAILED;
public static final String LIST_FAILED = "List request " + FAILED;
/** The object part map. */
Map<String, ObjectPartType> objectPartMap = new HashMap<String, ObjectPartType>();
/** The service binding. */
- private ServiceBindingType serviceBinding;
+ protected ServiceBindingType serviceBinding;
/** The tenant binding. */
private TenantBindingType tenantBinding;
/** repository domain used by the service */
* @param contentType media type
*/
public void addOutputPart(String label, Element doc, String contentType) throws Exception;
+
+ public void setRespositoryWorkspaceName(String workspaceName);
}
/** The logger. */
final Logger logger = LoggerFactory.getLogger(MultipartServiceContextImpl.class);
+ private String repositoryWorkspaceName;
/**
* Instantiates a new multipart service context impl.
ServiceContext ctx = (ServiceContext) ctor.newInstance(getServiceName());
return ctx;
}
+
+ /* (non-Javadoc)
+ * @see org.collectionspace.services.common.context.ServiceContext#getRepositoryWorkspaceName()
+ */
+ @Override
+ public String getRepositoryWorkspaceName() {
+ String result = repositoryWorkspaceName;
+ //service name is workspace name by convention
+ if (result == null) {
+ result = serviceBinding.getName();
+ }
+ return result;
+ }
+
+ @Override
+ public void setRespositoryWorkspaceName(String workspaceName) {
+ repositoryWorkspaceName = workspaceName;
+ }
}
*/\r
package org.collectionspace.services.common.query;\r
\r
+import org.collectionspace.services.client.IQueryManager;\r
import org.collectionspace.services.common.query.nuxeo.QueryManagerNuxeoImpl;\r
\r
public class QueryManager {\r
*/\r
package org.collectionspace.services.common.query.nuxeo;\r
\r
-import java.util.StringTokenizer;\r
-\r
import org.slf4j.Logger;\r
import org.slf4j.LoggerFactory;\r
\r
-import java.util.Map;\r
-import java.util.HashMap;\r
-import java.util.StringTokenizer;\r
import java.util.regex.Pattern;\r
\r
import org.nuxeo.ecm.core.api.DocumentModel;\r
\r
import org.collectionspace.services.nuxeo.client.java.NuxeoConnector;\r
import org.collectionspace.services.nuxeo.client.java.RepositoryJavaClientImpl;\r
-import org.collectionspace.services.common.document.DocumentFilter;\r
-import org.collectionspace.services.common.query.IQueryManager;\r
-import org.collectionspace.services.common.vocabulary.AuthorityItemJAXBSchema;\r
+import org.collectionspace.services.client.IQueryManager;\r
\r
public class QueryManagerNuxeoImpl implements IQueryManager {\r
\r
import java.lang.StringBuilder;
-import org.collectionspace.services.common.query.IQueryManager;
+import org.collectionspace.services.client.IQueryManager;
import org.collectionspace.services.common.relation.RelationJAXBSchema;
import org.slf4j.Logger;
import javax.ws.rs.core.UriBuilder;
import javax.ws.rs.core.UriInfo;
+import org.collectionspace.services.client.IQueryManager;
import org.collectionspace.services.client.PoxPayloadIn;
import org.collectionspace.services.client.PoxPayloadOut;
import org.collectionspace.services.common.vocabulary.AuthorityJAXBSchema;
import org.collectionspace.services.common.document.DocumentWrapper;
import org.collectionspace.services.common.repository.RepositoryClient;
import org.collectionspace.services.common.security.UnauthorizedException;
-import org.collectionspace.services.common.query.IQueryManager;
import org.collectionspace.services.common.query.QueryManager;
import org.collectionspace.services.nuxeo.client.java.RemoteDocumentModelHandlerImpl;
import org.jboss.resteasy.util.HttpResponseCodes;
\r
import org.collectionspace.services.nuxeo.client.java.NuxeoConnector;\r
import org.collectionspace.services.nuxeo.client.java.RepositoryJavaClientImpl;\r
-import org.collectionspace.services.common.query.IQueryManager;\r
+//import org.collectionspace.services.common.query.IQueryManager;\r
\r
public class VocabManagerImpl implements IVocabManager {\r
\r
--- /dev/null
+/**
+ * This document is a part of the source code and related artifacts
+ * for CollectionSpace, an open source collections management system
+ * for museums and related institutions:
+ *
+ * http://www.collectionspace.org
+ * http://wiki.collectionspace.org
+ *
+ * Copyright (c) 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
+ */
+package org.collectionspace.services.common.workflow.client;
+
+import org.collectionspace.services.client.AbstractPoxServiceClientImpl;
+
+/**
+ * WorkflowClient.java
+ *
+ * $LastChangedRevision: 2108 $
+ * $LastChangedDate: 2010-05-17 18:25:37 -0700 (Mon, 17 May 2010) $
+ *
+ */
+public class WorkflowClient extends AbstractPoxServiceClientImpl<WorkflowProxy> {
+ public static final String SERVICE_NAME = "workflows";
+ public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;
+ public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT;
+ public static final String SERVICE_PAYLOAD_NAME = SERVICE_NAME;
+ public static final String SERVICE_COMMONPART_NAME = SERVICE_NAME + PART_LABEL_SEPARATOR + PART_COMMON_LABEL;
+
+ @Override
+ public String getServiceName() {
+ return SERVICE_NAME;
+ }
+
+ @Override
+ public String getServicePathComponent() {
+ return SERVICE_PATH_COMPONENT;
+ }
+
+ @Override
+ public Class<WorkflowProxy> getProxyClass() {
+ // TODO Auto-generated method stub
+ return WorkflowProxy.class;
+ }
+}
--- /dev/null
+package org.collectionspace.services.common.workflow.client;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+
+import org.collectionspace.services.client.CollectionSpacePoxProxy;
+
+/**
+ * @version $Revision: 2108 $
+ */
+@Path(WorkflowClient.SERVICE_PATH + "/")
+@Produces({"application/xml"})
+@Consumes({"application/xml"})
+public interface WorkflowProxy extends CollectionSpacePoxProxy {
+}
* @param partMeta the part meta
* @throws Exception the exception
*/
- private void addOutputPart(Map<String, Object> unQObjectProperties, String schema, ObjectPartType partMeta)
+ protected void addOutputPart(Map<String, Object> unQObjectProperties, String schema, ObjectPartType partMeta)
throws Exception {
Element doc = DocumentUtils.buildDocument(partMeta, schema,
unQObjectProperties);
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
+import org.collectionspace.services.client.IQueryManager;
import org.collectionspace.services.client.PoxPayloadIn;
import org.collectionspace.services.client.PoxPayloadOut;
import org.collectionspace.services.common.context.ServiceContext;
import org.collectionspace.services.common.datetime.GregorianCalendarDateTimeUtils;
-import org.collectionspace.services.common.query.IQueryManager;
import org.collectionspace.services.common.query.QueryContext;
import org.collectionspace.services.common.repository.RepositoryClient;
import org.collectionspace.services.common.profile.Profiler;
import org.collectionspace.services.common.document.DocumentWrapper;
import org.collectionspace.services.common.document.DocumentWrapperImpl;
-import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
-import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
-
import org.nuxeo.common.utils.IdUtils;
import org.nuxeo.ecm.core.api.ClientException;
import org.nuxeo.ecm.core.api.DocumentModel;
--- /dev/null
+package org.collectionspace.services.client;\r
+\r
+import javax.ws.rs.core.Response;\r
+\r
+import org.collectionspace.services.contact.ContactsCommonList;\r
+import org.collectionspace.services.jaxb.AbstractCommonList;\r
+import org.jboss.resteasy.client.ClientResponse;\r
+\r
+public interface AuthorityWithContactsClient<TL extends AbstractCommonList, T extends AuthorityProxy<TL>> extends AuthorityClient<TL, T> {\r
+ /**\r
+ * Creates the contact.\r
+ *\r
+ * @param parentcsid the parentcsid\r
+ * @param itemcsid the itemcsid\r
+ * @param multipart the multipart\r
+ * @return the client response\r
+ */\r
+ public ClientResponse<Response> createContact(String parentcsid,\r
+ String itemcsid, PoxPayloadOut xmlPayload);\r
+ \r
+ /**\r
+ * Creates the contact.\r
+ *\r
+ * @param parentcsid\r
+ * @param itemspecifier (shortIdentifier)\r
+ * @param multipart\r
+ * @return the client response\r
+ */\r
+ public ClientResponse<Response> createContactForNamedItem(\r
+ String parentcsid,\r
+ String itemspecifier,\r
+ PoxPayloadOut xmlPayload);\r
+ \r
+ /**\r
+ * Creates the contact.\r
+ *\r
+ * @param parentspecifier (shortIdentifier)\r
+ * @param itemcsid\r
+ * @param multipart\r
+ * @return the client response\r
+ */\r
+ public ClientResponse<Response> createContactForItemInNamedAuthority(\r
+ String parentspecifier,\r
+ String itemcsid,\r
+ PoxPayloadOut xmlPayload);\r
+ \r
+ /**\r
+ * Creates the contact.\r
+ *\r
+ * @param parentspecifier (shortIdentifier)\r
+ * @param itemspecifier (shortIdentifier)\r
+ * @param multipart\r
+ * @return the client response\r
+ */\r
+ public ClientResponse<Response> createContactForNamedItemInNamedAuthority(\r
+ String parentspecifier,\r
+ String itemspecifier,\r
+ PoxPayloadOut xmlPayload);\r
+ \r
+ /**\r
+ * Read contact.\r
+ *\r
+ * @param parentcsid the parentcsid\r
+ * @param itemcsid the itemcsid\r
+ * @param csid the csid\r
+ * @return the client response\r
+ */\r
+ public ClientResponse<String> readContact(String parentcsid,\r
+ String itemcsid, String csid);\r
+ \r
+ /**\r
+ * Read contact.\r
+ *\r
+ * @param parentcsid\r
+ * @param itemspecifier (shortIdentifier)\r
+ * @param csid\r
+ * @return the client response\r
+ */\r
+ public ClientResponse<String> readContactForNamedItem(\r
+ String parentcsid,\r
+ String itemspecifier,\r
+ String csid);\r
+\r
+ /**\r
+ * Read contact.\r
+ *\r
+ * @param parentspecifier (shortIdentifier)\r
+ * @param itemcsid\r
+ * @param csid\r
+ * @return the client response\r
+ */\r
+ public ClientResponse<String> readContactInNamedAuthority(\r
+ String parentspecifier,\r
+ String itemcsid,\r
+ String csid);\r
+\r
+ /**\r
+ * Read contact.\r
+ *\r
+ * @param parentspecifier (shortIdentifier)\r
+ * @param itemspecifier (shortIdentifier)\r
+ * @param csid\r
+ * @return the client response\r
+ */\r
+ public ClientResponse<String> readContactForNamedItemInNamedAuthority(\r
+ String parentspecifier,\r
+ String itemspecifier,\r
+ String csid);\r
+ \r
+\r
+ /**\r
+ * Read contact list.\r
+ *\r
+ * @param parentcsid the parentcsid\r
+ * @param itemcsid the itemcsid\r
+ * @return the client response\r
+ */\r
+ public ClientResponse<ContactsCommonList> readContactList(String parentcsid,\r
+ String itemcsid);\r
+ \r
+ /**\r
+ * Read contact list.\r
+ *\r
+ * @param parentcsid\r
+ * @param itemspecifier (shortIdentifier)\r
+ * @return the client response\r
+ */\r
+ public ClientResponse<ContactsCommonList> readContactListForNamedItem(\r
+ String parentcsid,\r
+ String itemspecifier);\r
+\r
+ /**\r
+ * Read contact list.\r
+ *\r
+ * @param parentspecifier (shortIdentifier)\r
+ * @param itemcsid\r
+ * @return the client response\r
+ */\r
+ public ClientResponse<ContactsCommonList> readContactListForItemInNamedAuthority(\r
+ String parentspecifier,\r
+ String itemcsid);\r
+\r
+ /**\r
+ * Read contact list.\r
+ *\r
+ * @param parentspecifier (shortIdentifier)\r
+ * @param itemspecifier (shortIdentifier)\r
+ * @return the client response\r
+ */\r
+ public ClientResponse<ContactsCommonList> readContactListForNamedItemInNamedAuthority(\r
+ String parentspecifier,\r
+ String itemspecifier);\r
+\r
+ /**\r
+ * Update contact.\r
+ *\r
+ * @param parentcsid the parentcsid\r
+ * @param itemcsid the itemcsid\r
+ * @param csid the csid\r
+ * @param multipart the multipart\r
+ * @return the client response\r
+ */\r
+ public ClientResponse<String> updateContact(String parentcsid,\r
+ String itemcsid, String csid, PoxPayloadOut xmlPayload);\r
+ \r
+ /**\r
+ * Update contact.\r
+ *\r
+ * @param parentcsid the parentcsid\r
+ * @param itemspecifier (shortIdentifier)\r
+ * @param csid the csid\r
+ * @param multipart the multipart\r
+ * @return the client response\r
+ */\r
+ public ClientResponse<String> updateContactForNamedItem(\r
+ String parentcsid,\r
+ String itemspecifier,\r
+ String csid,\r
+ PoxPayloadOut xmlPayload);\r
+\r
+ /**\r
+ * Update contact.\r
+ *\r
+ * @param parentspecifier (shortIdentifier)\r
+ * @param itemcsid the itemcsid\r
+ * @param csid the csid\r
+ * @param multipart the multipart\r
+ * @return the client response\r
+ */\r
+ public ClientResponse<String> updateContactInNamedAuthority(\r
+ String parentspecifier,\r
+ String itemcsid,\r
+ String csid,\r
+ PoxPayloadOut xmlPayload);\r
+\r
+ /**\r
+ * Update contact.\r
+ *\r
+ * @param parentspecifier (shortIdentifier)\r
+ * @param itemspecifier (shortIdentifier)\r
+ * @param csid the csid\r
+ * @param multipart the multipart\r
+ * @return the client response\r
+ */\r
+ public ClientResponse<String> updateContactForNamedItemInNamedAuthority(\r
+ String parentspecifier,\r
+ String itemspecifier,\r
+ String csid,\r
+ PoxPayloadOut xmlPayload);\r
+\r
+ /**\r
+ * Delete contact.\r
+ *\r
+ * @param parentcsid the parentcsid\r
+ * @param itemcsid the itemcsid\r
+ * @param csid the csid\r
+ * @return the client response\r
+ */\r
+ public ClientResponse<Response> deleteContact(String parentcsid,\r
+ String itemcsid, String csid);\r
+ \r
+ /**\r
+ * Delete contact.\r
+ *\r
+ * @param parentcsid the parentcsid\r
+ * @param itemspecifier (shortIdentifier)\r
+ * @param csid the csid\r
+ * @return the client response\r
+ */\r
+ public ClientResponse<Response> deleteContactForNamedItem(\r
+ String parentcsid,\r
+ String itemspecifier,\r
+ String csid);\r
+\r
+ /**\r
+ * Delete contact.\r
+ *\r
+ * @param parentspecifier (shortIdentifier)\r
+ * @param itemcsid the itemcsid\r
+ * @param csid the csid\r
+ * @return the client response\r
+ */\r
+ public ClientResponse<Response> deleteContactInNamedAuthority(\r
+ String parentspecifier,\r
+ String itemcsid,\r
+ String csid);\r
+\r
+ /**\r
+ * Delete contact.\r
+ *\r
+ * @param parentspecifier (shortIdentifier)\r
+ * @param itemspecifier (shortIdentifier)\r
+ * @param csid the csid\r
+ * @return the client response\r
+ */\r
+ public ClientResponse<Response> deleteContactForNamedItemInNamedAuthority(\r
+ String parentspecifier,\r
+ String itemspecifier,\r
+ String csid);\r
+ \r
+}\r
--- /dev/null
+package org.collectionspace.services.client;\r
+\r
+import javax.ws.rs.core.Response;\r
+import org.jboss.resteasy.client.ClientResponse;\r
+\r
+import org.collectionspace.services.contact.ContactsCommonList;\r
+import org.collectionspace.services.jaxb.AbstractCommonList;\r
+\r
+public abstract class AuthorityWithContactsClientImpl<TL extends AbstractCommonList, T extends AuthorityWithContactsProxy<TL>>\r
+ extends AuthorityClientImpl<TL, T>\r
+ implements AuthorityWithContactsClient<TL, T> {\r
+ \r
+ @Override\r
+ public ClientResponse<Response> createContact(String parentcsid,\r
+ String itemcsid, PoxPayloadOut xmlPayload) {\r
+ return getProxy().createContact(parentcsid, itemcsid, xmlPayload.getBytes());\r
+ }\r
+ \r
+ /**\r
+ * Creates the contact.\r
+ *\r
+ * @param parentcsid\r
+ * @param itemspecifier (shortIdentifier)\r
+ * @param multipart\r
+ * @return the client response\r
+ */\r
+ @Override\r
+ public ClientResponse<Response> createContactForNamedItem(\r
+ String parentcsid,\r
+ String itemspecifier,\r
+ PoxPayloadOut xmlPayload) {\r
+ return getProxy().createContactForNamedItem(parentcsid, itemspecifier, xmlPayload.getBytes());\r
+ }\r
+ /**\r
+ * Creates the contact.\r
+ *\r
+ * @param parentspecifier (shortIdentifier)\r
+ * @param itemcsid\r
+ * @param multipart\r
+ * @return the client response\r
+ */\r
+ @Override\r
+ public ClientResponse<Response> createContactForItemInNamedAuthority(\r
+ String parentspecifier,\r
+ String itemcsid,\r
+ PoxPayloadOut xmlPayload) {\r
+ return getProxy().createContactForItemInNamedAuthority(parentspecifier,\r
+ itemcsid, xmlPayload.getBytes());\r
+ }\r
+ /**\r
+ * Creates the contact.\r
+ *\r
+ * @param parentspecifier (shortIdentifier)\r
+ * @param itemspecifier (shortIdentifier)\r
+ * @param multipart\r
+ * @return the client response\r
+ */\r
+ @Override\r
+ public ClientResponse<Response> createContactForNamedItemInNamedAuthority(\r
+ String parentspecifier,\r
+ String itemspecifier,\r
+ PoxPayloadOut xmlPayload) {\r
+ return getProxy().createContactForNamedItemInNamedAuthority(parentspecifier, itemspecifier,\r
+ xmlPayload.getBytes());\r
+ }\r
+ \r
+ /**\r
+ * Read contact.\r
+ *\r
+ * @param parentcsid the parentcsid\r
+ * @param itemcsid the itemcsid\r
+ * @param csid the csid\r
+ * @return the client response\r
+ */\r
+ @Override\r
+ public ClientResponse<String> readContact(String parentcsid,\r
+ String itemcsid, String csid) {\r
+ return getProxy().readContact(parentcsid, itemcsid, csid);\r
+ }\r
+ \r
+ /**\r
+ * Read contact.\r
+ *\r
+ * @param parentcsid\r
+ * @param itemspecifier (shortIdentifier)\r
+ * @param csid\r
+ * @return the client response\r
+ */\r
+ @Override\r
+ public ClientResponse<String> readContactForNamedItem(\r
+ String parentcsid,\r
+ String itemspecifier,\r
+ String csid){\r
+ return getProxy().readContactForNamedItem(parentcsid, itemspecifier, csid);\r
+ }\r
+\r
+ /**\r
+ * Read contact.\r
+ *\r
+ * @param parentspecifier (shortIdentifier)\r
+ * @param itemcsid\r
+ * @param csid\r
+ * @return the client response\r
+ */\r
+ @Override\r
+ public ClientResponse<String> readContactInNamedAuthority(\r
+ String parentspecifier,\r
+ String itemcsid,\r
+ String csid){\r
+ return getProxy().readContactInNamedAuthority(parentspecifier, itemcsid, csid);\r
+ }\r
+\r
+ /**\r
+ * Read contact.\r
+ *\r
+ * @param parentspecifier (shortIdentifier)\r
+ * @param itemspecifier (shortIdentifier)\r
+ * @param csid\r
+ * @return the client response\r
+ */\r
+ @Override\r
+ public ClientResponse<String> readContactForNamedItemInNamedAuthority(\r
+ String parentspecifier,\r
+ String itemspecifier,\r
+ String csid){\r
+ return getProxy().readContactForNamedItemInNamedAuthority(parentspecifier, itemspecifier, csid);\r
+ }\r
+ \r
+\r
+ /**\r
+ * Read contact list.\r
+ *\r
+ * @param parentcsid the parentcsid\r
+ * @param itemcsid the itemcsid\r
+ * @return the client response\r
+ */\r
+ @Override\r
+ public ClientResponse<ContactsCommonList> readContactList(String parentcsid,\r
+ String itemcsid) {\r
+ return getProxy().readContactList(parentcsid, itemcsid);\r
+ }\r
+ \r
+ /**\r
+ * Read contact list.\r
+ *\r
+ * @param parentcsid\r
+ * @param itemspecifier (shortIdentifier)\r
+ * @return the client response\r
+ */\r
+ @Override\r
+ public ClientResponse<ContactsCommonList> readContactListForNamedItem(\r
+ String parentcsid,\r
+ String itemspecifier){\r
+ return getProxy().readContactList(parentcsid, itemspecifier);\r
+ }\r
+\r
+ /**\r
+ * Read contact list.\r
+ *\r
+ * @param parentspecifier (shortIdentifier)\r
+ * @param itemcsid\r
+ * @return the client response\r
+ */\r
+ @Override\r
+ public ClientResponse<ContactsCommonList> readContactListForItemInNamedAuthority(\r
+ String parentspecifier,\r
+ String itemcsid){\r
+ return getProxy().readContactList(parentspecifier, itemcsid);\r
+ }\r
+\r
+ /**\r
+ * Read contact list.\r
+ *\r
+ * @param parentspecifier (shortIdentifier)\r
+ * @param itemspecifier (shortIdentifier)\r
+ * @return the client response\r
+ */\r
+ @Override\r
+ public ClientResponse<ContactsCommonList> readContactListForNamedItemInNamedAuthority(\r
+ String parentspecifier,\r
+ String itemspecifier){\r
+ return getProxy().readContactList(parentspecifier, itemspecifier);\r
+ }\r
+\r
+ /**\r
+ * Update contact.\r
+ *\r
+ * @param parentcsid the parentcsid\r
+ * @param itemcsid the itemcsid\r
+ * @param csid the csid\r
+ * @param multipart the multipart\r
+ * @return the client response\r
+ */\r
+ @Override\r
+ public ClientResponse<String> updateContact(String parentcsid,\r
+ String itemcsid, String csid, PoxPayloadOut xmlPayload) {\r
+ return getProxy().updateContact(parentcsid, itemcsid, csid, xmlPayload.getBytes());\r
+ }\r
+ \r
+ /**\r
+ * Update contact.\r
+ *\r
+ * @param parentcsid the parentcsid\r
+ * @param itemspecifier (shortIdentifier)\r
+ * @param csid the csid\r
+ * @param multipart the multipart\r
+ * @return the client response\r
+ */\r
+ @Override\r
+ public ClientResponse<String> updateContactForNamedItem(\r
+ String parentcsid,\r
+ String itemspecifier,\r
+ String csid,\r
+ PoxPayloadOut xmlPayload) {\r
+ return getProxy().updateContactForNamedItem(parentcsid, itemspecifier, csid, xmlPayload.getBytes());\r
+ }\r
+\r
+ /**\r
+ * Update contact.\r
+ *\r
+ * @param parentspecifier (shortIdentifier)\r
+ * @param itemcsid the itemcsid\r
+ * @param csid the csid\r
+ * @param multipart the multipart\r
+ * @return the client response\r
+ */\r
+ @Override\r
+ public ClientResponse<String> updateContactInNamedAuthority(\r
+ String parentspecifier,\r
+ String itemcsid,\r
+ String csid,\r
+ PoxPayloadOut xmlPayload) {\r
+ return getProxy().updateContactInNamedAuthority(parentspecifier, itemcsid, csid, xmlPayload.getBytes());\r
+ }\r
+\r
+ /**\r
+ * Update contact.\r
+ *\r
+ * @param parentspecifier (shortIdentifier)\r
+ * @param itemspecifier (shortIdentifier)\r
+ * @param csid the csid\r
+ * @param multipart the multipart\r
+ * @return the client response\r
+ */\r
+ @Override\r
+ public ClientResponse<String> updateContactForNamedItemInNamedAuthority(\r
+ String parentspecifier,\r
+ String itemspecifier,\r
+ String csid,\r
+ PoxPayloadOut xmlPayload) {\r
+ return getProxy().updateContactForNamedItemInNamedAuthority(parentspecifier, itemspecifier, csid,\r
+ xmlPayload.getBytes());\r
+ }\r
+\r
+ /**\r
+ * Delete contact.\r
+ *\r
+ * @param parentcsid the parentcsid\r
+ * @param itemcsid the itemcsid\r
+ * @param csid the csid\r
+ * @return the client response\r
+ */\r
+ @Override\r
+ public ClientResponse<Response> deleteContact(String parentcsid,\r
+ String itemcsid, String csid) {\r
+ return getProxy().deleteContact(parentcsid,\r
+ itemcsid, csid);\r
+ }\r
+ \r
+ /**\r
+ * Delete contact.\r
+ *\r
+ * @param parentcsid the parentcsid\r
+ * @param itemspecifier (shortIdentifier)\r
+ * @param csid the csid\r
+ * @return the client response\r
+ */\r
+ @Override\r
+ public ClientResponse<Response> deleteContactForNamedItem(\r
+ String parentcsid,\r
+ String itemspecifier,\r
+ String csid) {\r
+ return getProxy().deleteContactForNamedItem(parentcsid,\r
+ itemspecifier, csid);\r
+ }\r
+\r
+ /**\r
+ * Delete contact.\r
+ *\r
+ * @param parentspecifier (shortIdentifier)\r
+ * @param itemcsid the itemcsid\r
+ * @param csid the csid\r
+ * @return the client response\r
+ */\r
+ @Override\r
+ public ClientResponse<Response> deleteContactInNamedAuthority(\r
+ String parentspecifier,\r
+ String itemcsid,\r
+ String csid) {\r
+ return getProxy().deleteContactInNamedAuthority(parentspecifier,\r
+ itemcsid, csid);\r
+ }\r
+\r
+ /**\r
+ * Delete contact.\r
+ *\r
+ * @param parentspecifier (shortIdentifier)\r
+ * @param itemspecifier (shortIdentifier)\r
+ * @param csid the csid\r
+ * @return the client response\r
+ */\r
+ @Override\r
+ public ClientResponse<Response> deleteContactForNamedItemInNamedAuthority(\r
+ String parentspecifier,\r
+ String itemspecifier,\r
+ String csid) {\r
+ return getProxy().deleteContactForNamedItemInNamedAuthority(parentspecifier,\r
+ itemspecifier, csid);\r
+ }\r
+ \r
+}\r
--- /dev/null
+package org.collectionspace.services.client;\r
+\r
+import javax.ws.rs.DELETE;\r
+import javax.ws.rs.GET;\r
+import javax.ws.rs.POST;\r
+import javax.ws.rs.PUT;\r
+import javax.ws.rs.Path;\r
+import javax.ws.rs.PathParam;\r
+import javax.ws.rs.Produces;\r
+import javax.ws.rs.core.Response;\r
+\r
+import org.collectionspace.services.contact.ContactsCommonList;\r
+import org.collectionspace.services.jaxb.AbstractCommonList;\r
+import org.jboss.resteasy.client.ClientResponse;\r
+\r
+public interface AuthorityWithContactsProxy<TL extends AbstractCommonList> extends AuthorityProxy<TL> {\r
+ @GET\r
+ @Produces({"application/xml"})\r
+ @Path("/{parentcsid}/items/{itemcsid}/contacts/")\r
+ public ClientResponse<ContactsCommonList> readContactList(\r
+ @PathParam("parentcsid") String parentcsid,\r
+ @PathParam("itemcsid") String itemcsid);\r
+\r
+ @GET\r
+ @Produces({"application/xml"})\r
+ @Path("/{parentcsid}/items/urn:cspace:name({itemspecifier})/contacts/")\r
+ ClientResponse<ContactsCommonList> readContactListForNamedItem(\r
+ @PathParam("parentcsid") String parentcsid,\r
+ @PathParam("itemspecifier") String itemspecifier);\r
+ \r
+ @GET\r
+ @Produces({"application/xml"})\r
+ @Path("/urn:cspace:name({parentspecifier})/items/{itemcsid}/contacts/")\r
+ ClientResponse<ContactsCommonList> readContactListForItemInNamedAuthority(\r
+ @PathParam("parentspecifier") String parentspecifier,\r
+ @PathParam("itemcsid") String itemcsid);\r
+ @GET\r
+ @Produces({"application/xml"})\r
+ @Path("/urn:cspace:name({parentspecifier})/items/urn:cspace:name({itemspecifier})/contacts/")\r
+ ClientResponse<ContactsCommonList> readContactListForNamedItemInNamedAuthority(\r
+ @PathParam("parentspecifier") String parentspecifier,\r
+ @PathParam("itemspecifier") String itemspecifier);\r
+\r
+ //(C)reate Contact\r
+ @POST\r
+ @Path("/{parentcsid}/items/{itemcsid}/contacts/")\r
+ ClientResponse<Response> createContact(\r
+ @PathParam("parentcsid") String parentcsid,\r
+ @PathParam("itemcsid") String itemcsid,\r
+ byte[] xmlPayload);\r
+ @POST\r
+ @Path("/{parentcsid}/items/urn:cspace:name({itemspecifier})/contacts/")\r
+ ClientResponse<Response> createContactForNamedItem(\r
+ @PathParam("parentcsid") String parentcsid,\r
+ @PathParam("itemspecifier") String itemspecifier,\r
+ byte[] xmlPayload);\r
+ @POST\r
+ @Path("/urn:cspace:name({parentspecifier})/items/{itemcsid}/contacts/")\r
+ ClientResponse<Response> createContactForItemInNamedAuthority(\r
+ @PathParam("parentspecifier") String parentspecifier,\r
+ @PathParam("itemcsid") String itemcsid,\r
+ byte[] xmlPayload);\r
+ @POST\r
+ @Path("/urn:cspace:name({parentspecifier})/items/urn:cspace:name({itemspecifier})/contacts/")\r
+ ClientResponse<Response> createContactForNamedItemInNamedAuthority(\r
+ @PathParam("parentspecifier") String parentspecifier,\r
+ @PathParam("itemspecifier") String itemspecifier,\r
+ byte[] xmlPayload);\r
+\r
+ //(R)ead Contact\r
+ @GET\r
+ @Path("/{parentcsid}/items/{itemcsid}/contacts/{csid}")\r
+ ClientResponse<String> readContact(\r
+ @PathParam("parentcsid") String parentcsid,\r
+ @PathParam("itemcsid") String itemcsid,\r
+ @PathParam("csid") String csid);\r
+ @GET\r
+ @Path("/{parentcsid}/items/urn:cspace:name({itemspecifier})/contacts/{csid}")\r
+ ClientResponse<String> readContactForNamedItem(\r
+ @PathParam("parentcsid") String parentcsid,\r
+ @PathParam("itemspecifier") String itemspecifier,\r
+ @PathParam("csid") String csid);\r
+ @GET\r
+ @Path("/urn:cspace:name({parentspecifier})/items/{itemcsid}/contacts/{csid}")\r
+ ClientResponse<String> readContactInNamedAuthority(\r
+ @PathParam("parentspecifier") String parentspecifier,\r
+ @PathParam("itemcsid") String itemcsid,\r
+ @PathParam("csid") String csid);\r
+ @GET\r
+ @Path("/urn:cspace:name({parentspecifier})/items/urn:cspace:name({itemspecifier})/contacts/{csid}")\r
+ ClientResponse<String> readContactForNamedItemInNamedAuthority(\r
+ @PathParam("parentspecifier") String parentspecifier,\r
+ @PathParam("itemspecifier") String itemspecifier,\r
+ @PathParam("csid") String csid);\r
+\r
+ //(U)pdate Contact\r
+ @PUT\r
+ @Path("/{parentcsid}/items/{itemcsid}/contacts/{csid}")\r
+ ClientResponse<String> updateContact(\r
+ @PathParam("parentcsid") String parentcsid,\r
+ @PathParam("itemcsid") String itemcsid,\r
+ @PathParam("csid") String csid,\r
+ byte[] xmlPayload);\r
+ @PUT\r
+ @Path("/{parentcsid}/items/urn:cspace:name({itemspecifier})/contacts/{csid}")\r
+ ClientResponse<String> updateContactForNamedItem(\r
+ @PathParam("parentcsid") String parentcsid,\r
+ @PathParam("itemspecifier") String itemspecifier,\r
+ @PathParam("csid") String csid,\r
+ byte[] xmlPayload);\r
+ @PUT\r
+ @Path("/urn:cspace:name({parentspecifier})/items/{itemcsid}/contacts/{csid}")\r
+ ClientResponse<String> updateContactInNamedAuthority(\r
+ @PathParam("parentspecifier") String parentspecifier,\r
+ @PathParam("itemcsid") String itemcsid,\r
+ @PathParam("csid") String csid,\r
+ byte[] xmlPayload);\r
+ @PUT\r
+ @Path("/urn:cspace:name({parentspecifier})/items/urn:cspace:name({itemspecifier})/contacts/{csid}")\r
+ ClientResponse<String> updateContactForNamedItemInNamedAuthority(\r
+ @PathParam("parentspecifier") String parentspecifier,\r
+ @PathParam("itemspecifier") String itemspecifier,\r
+ @PathParam("csid") String csid,\r
+ byte[] xmlPayload);\r
+\r
+ //(D)elete Contact\r
+ @DELETE\r
+ @Path("/{parentcsid}/items/{itemcsid}/contacts/{csid}")\r
+ ClientResponse<Response> deleteContact(\r
+ @PathParam("parentcsid") String parentcsid,\r
+ @PathParam("itemcsid") String itemcsid,\r
+ @PathParam("csid") String csid);\r
+ \r
+ @DELETE\r
+ @Path("/{parentcsid}/items/urn:cspace:name({itemspecifier})/contacts/{csid}")\r
+ ClientResponse<Response> deleteContactForNamedItem(\r
+ @PathParam("parentcsid") String parentcsid,\r
+ @PathParam("itemspecifier") String itemspecifier,\r
+ @PathParam("csid") String csid);\r
+ @DELETE\r
+ @Path("/urn:cspace:name({parentspecifier})/items/{itemcsid}/contacts/{csid}")\r
+ ClientResponse<Response> deleteContactInNamedAuthority(\r
+ @PathParam("parentspecifier") String parentspecifier,\r
+ @PathParam("itemcsid") String itemcsid,\r
+ @PathParam("csid") String csid);\r
+ \r
+ @DELETE\r
+ @Path("/urn:cspace:name({parentspecifier})/items/urn:cspace:name({itemspecifier})/contacts/{csid}")\r
+ ClientResponse<Response> deleteContactForNamedItemInNamedAuthority(\r
+ @PathParam("parentspecifier") String parentspecifier,\r
+ @PathParam("itemspecifier") String itemspecifier,\r
+ @PathParam("csid") String csid);\r
+}\r
*/
package org.collectionspace.services.client;
-import javax.ws.rs.core.Response;
-
-import org.collectionspace.services.contact.ContactsCommonList;
-
-import org.jboss.resteasy.client.ProxyFactory;
-import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.client.core.executors.ApacheHttpClientExecutor;
-import org.jboss.resteasy.spi.ResteasyProviderFactory;
+import org.collectionspace.services.contact.ContactsCommonList;
/**
* ContactClient.java
* $LastChangedDate: $
*/
-public class ContactClient extends AbstractServiceClientImpl {
+public class ContactClient extends AbstractPoxServiceClientImpl<ContactProxy> {
public static final String SERVICE_NAME = "contacts";
public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;
public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT;
return SERVICE_PATH_COMPONENT;
}
- /**
- *
- */
-// private static final ContactClient instance = new ContactClient();
-
- /**
- *
- */
- private ContactProxy contactProxy;
-
- /**
- *
- * Default constructor for ContactClient class.
- *
- */
- public ContactClient() {
- ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
- RegisterBuiltin.register(factory);
- setProxy();
- }
-
- @Override
- public CollectionSpaceProxy getProxy() {
- return this.contactProxy;
- }
-
- /**
- * allow to reset proxy as per security needs
- */
- public void setProxy() {
- if (useAuth()) {
- contactProxy = ProxyFactory.create(ContactProxy.class,
- getBaseURL(), new ApacheHttpClientExecutor(getHttpClient()));
- } else {
- contactProxy = ProxyFactory.create(ContactProxy.class,
- getBaseURL());
- }
- }
-
- /**
- * FIXME Comment this
- *
- * @return
- */
-// public static ContactClient getInstance() {
-// return instance;
-// }
+ @Override
+ public Class<ContactProxy> getProxyClass() {
+ return ContactProxy.class;
+ }
+ /*
+ * Service calls
+ */
+
/**
* @return
* @see org.collectionspace.services.client.Contact#getContact()
*/
public ClientResponse<ContactsCommonList> readList() {
- return contactProxy.readList();
- }
-
- /**
- * @param csid
- * @return
- * @see org.collectionspace.services.client.Contact#getContact(java.lang.String)
- */
-
- public ClientResponse<String> read(String csid) {
- return contactProxy.read(csid);
- }
-
- /**
- * @param contact
- * @return
- * @see org.collectionspace.services.client.Contact#createContact(org.collectionspace.services.Contact)
- */
- public ClientResponse<Response> create(PoxPayloadOut xmlPayload) {
- return contactProxy.create(xmlPayload.getBytes());
- }
-
- /**
- * @param csid
- * @param contact
- * @return
- * @see org.collectionspace.services.client.Contact#updateContact(java.lang.Long, org.collectionspace.services.Contact)
- */
- public ClientResponse<String> update(String csid, PoxPayloadOut xmlPayload) {
- return contactProxy.update(csid, xmlPayload.getBytes());
-
- }
-
- /**
- * @param csid
- * @return
- * @see org.collectionspace.services.client.Contact#deleteContact(java.lang.Long)
- */
- public ClientResponse<Response> delete(String csid) {
- return contactProxy.delete(csid);
+ return getProxy().readList();
}
}
package org.collectionspace.services.client;
+import org.jboss.resteasy.client.ClientResponse;
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.services.contact.ContactsCommonList;
-import org.jboss.resteasy.client.ClientResponse;
/**
* @version $Revision:$
@Path(ContactClient.SERVICE_PATH_PROXY)
@Produces({"application/xml"})
@Consumes({"application/xml"})
-public interface ContactProxy extends CollectionSpaceProxy {
-
+public interface ContactProxy extends CollectionSpacePoxProxy {
@GET
ClientResponse<ContactsCommonList> readList();
-
- //(C)reate
- @POST
- ClientResponse<Response> create(byte[] xmlPayload);
-
- //(R)ead
- @GET
- @Path("/{csid}")
- ClientResponse<String> read(@PathParam("csid") String csid);
-
- //(U)pdate
- @PUT
- @Path("/{csid}")
- ClientResponse<String> update(@PathParam("csid") String csid, byte[] xmlPayload);
-
- //(D)elete
- @DELETE
- @Path("/{csid}")
- ClientResponse<Response> delete(@PathParam("csid") String csid);
}
import javax.ws.rs.core.UriBuilder;
import javax.ws.rs.core.UriInfo;
+import org.collectionspace.services.client.IQueryManager;
import org.collectionspace.services.client.PoxPayloadIn;
import org.collectionspace.services.client.PoxPayloadOut;
import org.collectionspace.services.common.vocabulary.AuthorityResource;
import org.collectionspace.services.contact.nuxeo.ContactDocumentModelHandler;
//import org.collectionspace.services.common.repository.RepositoryClient;
import org.collectionspace.services.common.security.UnauthorizedException;
-import org.collectionspace.services.common.query.IQueryManager;
+//import org.collectionspace.services.common.query.IQueryManager;
//import org.collectionspace.services.common.query.QueryManager;
//import org.collectionspace.services.nuxeo.client.java.RemoteDocumentModelHandlerImpl;
//import org.jboss.remoting.samples.chat.exceptions.InvalidArgumentException;
org.collectionspace.collectionspace_core\r
Provide-Package: org.collectionspace.dimension\r
Nuxeo-Component: OSGI-INF/core-types-contrib.xml,\r
+ OSGI-INF/life-cycle-contrib.xml,\r
OSGI-INF/ecm-types-contrib.xml,\r
OSGI-INF/layouts-contrib.xml\r
\r
--- /dev/null
+<?xml version="1.0"?>
+<component name="org.collectionspace.ecm.platform.intake.LifeCycleManagerExtensions">
+
+ <extension target="org.nuxeo.ecm.core.lifecycle.LifeCycleService"
+ point="types">
+ <types>
+ <type name="Dimension">default</type>
+ </types>
+ </extension>
+
+</component>
*/
package org.collectionspace.services.client;
-import javax.ws.rs.core.Response;
-
-//import org.collectionspace.services.common.context.ServiceContext;
import org.collectionspace.services.dimension.DimensionsCommonList;
-
-import org.jboss.resteasy.client.ProxyFactory;
-import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.client.core.executors.ApacheHttpClientExecutor;
-//import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
-//import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
-import org.jboss.resteasy.spi.ResteasyProviderFactory;
/**
* A DimensionClient.
* @version $Revision:$
*/
-public class DimensionClient extends AbstractServiceClientImpl {
+public class DimensionClient extends AbstractPoxServiceClientImpl<DimensionProxy> {
public static final String SERVICE_NAME = "dimensions";
public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;
public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT;
return SERVICE_NAME;
}
- /**
- *
- */
-// private static final DimensionClient instance = new DimensionClient();
-
- /**
- *
- */
- private DimensionProxy dimensionProxy;
-
- /**
- *
- * Default constructor for DimensionClient class.
- *
- */
- public DimensionClient() {
- ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
- RegisterBuiltin.register(factory);
- setProxy();
- }
-
- /* (non-Javadoc)
- * @see org.collectionspace.services.client.CollectionSpaceClient#getProxy()
- */
- @Override
- public CollectionSpaceProxy getProxy() {
- return this.dimensionProxy;
- }
-
- /**
- * allow to reset proxy as per security needs
- */
- public void setProxy() {
- if (useAuth()) {
- dimensionProxy = ProxyFactory.create(DimensionProxy.class,
- getBaseURL(), new ApacheHttpClientExecutor(getHttpClient()));
- } else {
- dimensionProxy = ProxyFactory.create(DimensionProxy.class,
- getBaseURL());
- }
- }
-
- /**
- * FIXME Comment this
- *
- * @return
- */
-// public static DimensionClient getInstance() {
-// return instance;
-// }
-
- /**
- * @return
- * @see org.collectionspace.services.client.DimensionProxy#getDimension()
- */
+ @Override
+ public Class<DimensionProxy> getProxyClass() {
+ return DimensionProxy.class;
+ }
+
+ /*
+ * Proxied service calls
+ */
+
public ClientResponse<DimensionsCommonList> readList() {
- return dimensionProxy.readList();
- }
-
- /**
- * @param csid
- * @return
- * @see org.collectionspace.services.client.DimensionProxy#getDimension(java.lang.String)
- */
-
- public ClientResponse<String> read(String csid) {
- return dimensionProxy.read(csid);
- }
-
- /**
- * @param dimension
- * @return
- * @see org.collectionspace.services.client.DimensionProxy#createDimension(org.collectionspace.services.Dimension)
- */
- public ClientResponse<Response> create(PoxPayloadOut xmlPayload) {
- return dimensionProxy.create(xmlPayload.getBytes());
- }
-
- /**
- * @param csid
- * @param dimension
- * @return
- * @see org.collectionspace.services.client.DimensionProxy#updateDimension(java.lang.Long, org.collectionspace.services.Dimension)
- */
- public ClientResponse<String> update(String csid, PoxPayloadOut xmlPayload) {
- return dimensionProxy.update(csid, xmlPayload.getBytes());
- }
-
- /**
- * @param csid
- * @return response
- * @see org.collectionspace.services.client.DimensionProxy#deleteDimension(java.lang.Long)
- */
- @Override
- public ClientResponse<Response> delete(String csid) {
- return dimensionProxy.delete(csid);
+ DimensionProxy proxy = (DimensionProxy)getProxy();
+ return proxy.readList();
}
+
}
package org.collectionspace.services.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.services.dimension.DimensionsCommonList;
import org.jboss.resteasy.client.ClientResponse;
@Path("/dimensions/")
@Produces({"application/xml"})
@Consumes({"application/xml"})
-public interface DimensionProxy extends CollectionSpaceProxy {
-
+public interface DimensionProxy extends CollectionSpacePoxProxy {
@GET
@Produces({"application/xml"})
ClientResponse<DimensionsCommonList> readList();
-
- //(C)reate
- @POST
- ClientResponse<Response> create(byte[] payload);
-
- //(R)ead
- @GET
- @Path("/{csid}")
- ClientResponse<String> read(@PathParam("csid") String csid);
-
- //(U)pdate
- @PUT
- @Path("/{csid}")
- ClientResponse<String> update(@PathParam("csid") String csid, byte[] payload);
-
- //(D)elete
- @DELETE
- @Path("/{csid}")
- ClientResponse<Response> delete(@PathParam("csid") String csid);
}
// Instance variables specific to this test.
/** The SERVIC e_ pat h_ component. */
- final String SERVICE_PATH_COMPONENT = "dimensions";
/** The known resource id. */
private String knownResourceId = null;
*/
@Override
public String getServicePathComponent() {
- return SERVICE_PATH_COMPONENT;
+ return DimensionClient.SERVICE_PATH_COMPONENT;
}
/**
package org.collectionspace.services.client;
-import javax.ws.rs.core.Response;
-
-import org.jboss.resteasy.client.ProxyFactory;
-import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.client.core.executors.ApacheHttpClientExecutor;
-import org.jboss.resteasy.spi.ResteasyProviderFactory;
/**
* An AcquisitionClient.
* @version $Revision:$
*/
-public class IdClient extends AbstractServiceClientImpl {
+public class IdClient extends AbstractServiceClientImpl<IdProxy> {
/* (non-Javadoc)
* @see org.collectionspace.services.client.BaseServiceClient#getServicePathComponent()
*/
- public String getServicePathComponent() {
+ @Override
+ public String getServicePathComponent() {
return "idgenerators";
}
- // FIXME: Is the "instance" member still needed/used?
- /**
- *
- */
-// private static final AcquisitionClient instance = new AcquisitionClient();
- /**
- *
- */
- private IdProxy idProxy;
- /**
- *
- * Default constructor for IntakeClient class.
- *
- */
- public IdClient() {
- ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
- RegisterBuiltin.register(factory);
- setProxy();
- }
+ @Override
+ public String getServiceName() {
+ return null; //FIXME: REM - See http://issues.collectionspace.org/browse/CSPACE-3497
+ }
- @Override
- public CollectionSpaceProxy getProxy() {
- return this.idProxy;
- }
+ @Override
+ public Class<IdProxy> getProxyClass() {
+ return IdProxy.class;
+ }
- /**
- * allow to reset proxy as per security needs
+ /*
+ * Proxied service calls
*/
- public void setProxy() {
- if (useAuth()) {
- idProxy = ProxyFactory.create(IdProxy.class,
- getBaseURL(), new ApacheHttpClientExecutor(getHttpClient()));
- } else {
- idProxy = ProxyFactory.create(IdProxy.class,
- getBaseURL());
- }
- }
-
+
public ClientResponse<String> readList() {
- return idProxy.readList();
+ return getProxy().readList();
}
public ClientResponse<String> read(String csid) {
- return idProxy.read(csid);
+ return getProxy().read(csid);
}
public ClientResponse<String> createId(String csid) {
- return idProxy.createId(csid);
+ return getProxy().createId(csid);
}
-
- @Override
- public String getServiceName() {
- // TODO Auto-generated method stub
- return null; //FIXME: REM - See http://issues.collectionspace.org/browse/CSPACE-3497
- }
-
}
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
-import javax.ws.rs.core.Response;
-
import org.jboss.resteasy.client.ClientResponse;
-
@Path("/idgenerators/")
@Produces({"application/xml"})
@Consumes({"text/plain"})
org.collectionspace.collectionspace_core\r
Provide-Package: org.collectionspace.intake\r
Nuxeo-Component: OSGI-INF/core-types-contrib.xml,\r
+ OSGI-INF/life-cycle-contrib.xml,\r
OSGI-INF/ecm-types-contrib.xml,\r
OSGI-INF/layouts-contrib.xml\r
\r
<schema name="intakes_common" prefix="intakes_common" src="schemas/intakes_common.xsd"/>
</extension>
<extension target="org.nuxeo.ecm.core.schema.TypeService" point="doctype">
- <doctype name="Intake" extends="Document">
+ <doctype name="Intake" extends="CollectionSpaceDocument">
<schema name="common"/>
<schema name="dublincore"/>
<schema name="collectionspace_core"/>
--- /dev/null
+<?xml version="1.0"?>
+<component name="org.collectionspace.ecm.platform.intake.LifeCycleManagerExtensions">
+
+ <extension target="org.nuxeo.ecm.core.lifecycle.LifeCycleService"
+ point="types">
+ <types>
+ <type name="Intake">default</type>
+ </types>
+ </extension>
+
+</component>
*/
package org.collectionspace.services.client;
-//import javax.ws.rs.PathParam;
-import javax.ws.rs.core.Response;
-
-import org.collectionspace.services.common.authorityref.AuthorityRefList;
-//import org.collectionspace.services.common.context.ServiceContext;
-import org.collectionspace.services.intake.IntakesCommonList;
-
-import org.jboss.resteasy.client.ProxyFactory;
-import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.client.core.executors.ApacheHttpClientExecutor;
-//import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
-//import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
-import org.jboss.resteasy.spi.ResteasyProviderFactory;
+import org.collectionspace.services.intake.IntakesCommonList;
/**
* A IntakeClient.
* @version $Revision:$
* FIXME: http://issues.collectionspace.org/browse/CSPACE-1684
*/
-public class IntakeClient extends AbstractServiceClientImpl {
+public class IntakeClient extends AbstractPoxServiceClientImpl<IntakeProxy> {
public static final String SERVICE_NAME = "intakes";
public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;
public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT;
return SERVICE_PATH_COMPONENT;
}
- /**
- *
- */
- private IntakeProxy intakeProxy;
-
- /**
- *
- * Default constructor for IntakeClient class.
- *
- */
- public IntakeClient() {
- ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
- RegisterBuiltin.register(factory);
- setProxy();
- }
-
- @Override
- public CollectionSpaceProxy getProxy() {
- return this.intakeProxy;
- }
-
- /**
- * allow to reset proxy as per security needs
- */
- public void setProxy() {
- if (useAuth()) {
- intakeProxy = ProxyFactory.create(IntakeProxy.class,
- getBaseURL(), new ApacheHttpClientExecutor(getHttpClient()));
- } else {
- intakeProxy = ProxyFactory.create(IntakeProxy.class,
- getBaseURL());
- }
- }
-
- /**
- * FIXME Comment this
- *
- * @return
- */
-// public static IntakeClient getInstance() {
-// return instance;
-// }
-
- /**
+ @Override
+ public Class<IntakeProxy> getProxyClass() {
+ // TODO Auto-generated method stub
+ return IntakeProxy.class;
+ }
+
+ /*
+ * Proxied service calls
+ */
+
+ /**
* @return
* @see org.collectionspace.services.client.IntakeProxy#getIntake()
*/
public ClientResponse<IntakesCommonList> readList() {
- return intakeProxy.readList();
- }
-
- /**
- * @param csid
- * @return
- * @see org.collectionspace.services.client.IntakeProxy#getAuthorityRefs(java.lang.String)
- */
- public ClientResponse<AuthorityRefList> getAuthorityRefs(String csid) {
- return intakeProxy.getAuthorityRefs(csid);
- }
-
-
- /**
- * @param csid
- * @return
- * @see org.collectionspace.services.client.IntakeProxy#getIntake(java.lang.String)
- */
- public ClientResponse<String> read(String csid) {
- return intakeProxy.read(csid);
- }
-
- /**
- * @param intake
- * @return
- * @see org.collectionspace.services.client.IntakeProxy#createIntake(org.collectionspace.hello.Intake)
- */
- public ClientResponse<Response> create(PoxPayloadOut xmlPayload) {
- return intakeProxy.create(xmlPayload.getBytes());
- }
-
- /**
- * @param csid
- * @param intake
- * @return
- * @see org.collectionspace.services.client.IntakeProxy#updateIntake(java.lang.Long, org.collectionspace.hello.Intake)
- */
- public ClientResponse<String> update(String csid, PoxPayloadOut xmlPayload) {
- return intakeProxy.update(csid, xmlPayload.getBytes());
-
- }
-
- /**
- * @param csid
- * @return
- * @see org.collectionspace.services.client.IntakeProxy#deleteIntake(java.lang.Long)
- */
- public ClientResponse<Response> delete(String csid) {
- return intakeProxy.delete(csid);
- }
+ return getProxy().readList();
+ }
}
*/
package org.collectionspace.services.client;
+import org.jboss.resteasy.client.ClientResponse;
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.services.common.authorityref.AuthorityRefList;
import org.collectionspace.services.intake.IntakesCommonList;
-//import org.collectionspace.services.person.PersonsCommonList;
-import org.jboss.resteasy.client.ClientResponse;
-//import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
-//import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
/**
* @version $Revision:$
@Path(IntakeClient.SERVICE_PATH_PROXY)
@Produces({"application/xml"})
@Consumes({"application/xml"})
-public interface IntakeProxy extends CollectionSpaceProxy {
+public interface IntakeProxy extends CollectionSpacePoxProxy {
/**
* Read list.
*
@GET
@Produces({"application/xml"})
ClientResponse<IntakesCommonList> readList();
-
- //(C)reate
- /**
- * Creates the.
- *
- * @param multipart the multipart
- * @return the client response
- */
- @POST
- ClientResponse<Response> create(byte[] payload);
-
- //(R)ead
- /**
- * Read.
- *
- * @param csid the csid
- * @return the client response
- */
- @GET
- @Path("/{csid}")
- ClientResponse<String> read(@PathParam("csid") String csid);
-
- //(U)pdate
- /**
- * Update.
- *
- * @param csid the csid
- * @param multipart the multipart
- * @return the client response
- */
- @PUT
- @Path("/{csid}")
- ClientResponse<String> update(@PathParam("csid") String csid, byte[] payload);
-
- //(D)elete
- /**
- * Delete.
- *
- * @param csid the csid
- * @return the client response
- */
- @DELETE
- @Path("/{csid}")
- ClientResponse<Response> delete(@PathParam("csid") String csid);
-
- // List Items
- /**
- * Gets the authority refs.
- *
- * @param csid the csid
- * @return the authority refs
- */
- @GET
- @Produces({"application/xml"})
- @Path("/{csid}/authorityrefs/")
- ClientResponse<AuthorityRefList> getAuthorityRefs(@PathParam("csid") String csid);
-
}
import javax.ws.rs.core.UriBuilder;
import javax.ws.rs.core.UriInfo;
-//import org.collectionspace.services.collectionobject.CollectionobjectsCommonList;
+import org.collectionspace.services.client.IQueryManager;
import org.collectionspace.services.client.IntakeClient;
import org.collectionspace.services.client.PoxPayloadIn;
import org.collectionspace.services.client.PoxPayloadOut;
import org.collectionspace.services.common.AbstractMultiPartCollectionSpaceResourceImpl;
import org.collectionspace.services.common.ClientType;
import org.collectionspace.services.common.ServiceMain;
+
import org.collectionspace.services.common.authorityref.AuthorityRefList;
-//import org.collectionspace.services.common.context.MultipartServiceContext;
-//import org.collectionspace.services.common.context.MultipartServiceContextFactory;
import org.collectionspace.services.common.context.MultipartServiceContextImpl;
import org.collectionspace.services.common.context.ServiceBindingUtils;
import org.collectionspace.services.common.context.ServiceContext;
import org.collectionspace.services.common.document.DocumentHandler;
import org.collectionspace.services.common.document.DocumentNotFoundException;
import org.collectionspace.services.common.document.DocumentWrapper;
-import org.collectionspace.services.common.query.IQueryManager;
import org.collectionspace.services.common.query.QueryManager;
import org.collectionspace.services.common.security.UnauthorizedException;
-//import org.collectionspace.services.common.vocabulary.RefNameServiceUtils;
import org.collectionspace.services.nuxeo.client.java.DocumentModelHandler;
-//import org.collectionspace.services.nuxeo.client.java.RemoteDocumentModelHandlerImpl;
-//import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
-//import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
import org.jboss.resteasy.util.HttpResponseCodes;
import org.nuxeo.ecm.core.api.DocumentModel;
import org.slf4j.Logger;
}
}
+
/**
* Gets the intake.
*
>
<!-- This is the base class for paginated lists -->
+ <!--
<xs:complexType name="abstractCommonList">
<xs:annotation>
<xs:appinfo>
</xs:appinfo>
</xs:annotation>
</xs:complexType>
+ -->
<xs:element name="authority-ref-doc-list">
<xs:complexType>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+
+<!--
+ Loan Out schema (XSD)
+
+ Entity : Workflow
+ Part : Common
+ Used for: JAXB binding between XML and Java objects
+
+ $LastChangedRevision: 2316 $
+ $LastChangedDate: 2010-06-02 16:03:51 -0700 (Wed, 02 Jun 2010) $
+-->
+
+<xs:schema
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
+ jaxb:version="1.0" elementFormDefault="unqualified"
+ xmlns:ns="http://collectionspace.org/services/workflow"
+ xmlns="http://collectionspace.org/services/workflow"
+ targetNamespace="http://collectionspace.org/services/workflow"
+ version="0.1">
+<!--
+ Avoid XmlRootElement nightmare:
+ See http://weblogs.java.net/blog/kohsuke/archive/2006/03/why_does_jaxb_p.html
+-->
+ <!-- workflow -->
+ <xs:element name="workflows_common">
+ <xs:complexType>
+ <xs:sequence>
+ <!-- Workflow Information Group -->
+ <xs:element name="lifeCyclePolicy" type="xs:string"/>
+ <xs:element name="currentLifeCycleState" type="xs:string"/>
+ <xs:element name="allowedStateTransitionList">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="stateTransition" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <!--
+ <xs:complexType name="stateTransitionList">
+ <xs:sequence>
+ <xs:element name="stateTransition" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+ -->
+
+</xs:schema>
+
*/
package org.collectionspace.services.client;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.core.Response;
-
-import org.collectionspace.services.common.authorityref.AuthorityRefList;
-//import org.collectionspace.services.common.context.ServiceContext;
-import org.collectionspace.services.jaxb.AbstractCommonList;
-
-import org.jboss.resteasy.client.ProxyFactory;
-import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.client.core.executors.ApacheHttpClientExecutor;
-import org.jboss.resteasy.spi.ResteasyProviderFactory;
+import org.collectionspace.services.jaxb.AbstractCommonList;
/**
* LoaninClient.java
* $LastChangedDate$
*
*/
-public class LoaninClient extends AbstractServiceClientImpl {
-
- private LoaninProxy loaninProxy;
+public class LoaninClient extends AbstractPoxServiceClientImpl<LoaninProxy> {
public static final String SERVICE_NAME = "loansin";
public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;
-
- /**
- *
- * Default constructor for LoaninClient class.
- *
- */
- public LoaninClient() {
- ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
- RegisterBuiltin.register(factory);
- setProxy();
- }
-
/* (non-Javadoc)
* @see org.collectionspace.services.client.AbstractServiceClientImpl#getServicePathComponent()
*/
return SERVICE_PATH_COMPONENT;
}
+ @Override
public String getServiceName() {
return SERVICE_NAME;
}
- @Override
- public CollectionSpaceProxy getProxy() {
- return this.loaninProxy;
- }
+ @Override
+ public Class<LoaninProxy> getProxyClass() {
+ return LoaninProxy.class;
+ }
- /**
- * allow to reset proxy as per security needs
+ /*
+ * Proxied service calls
*/
- public void setProxy() {
- if (useAuth()) {
- loaninProxy = ProxyFactory.create(LoaninProxy.class,
- getBaseURL(), new ApacheHttpClientExecutor(getHttpClient()));
- } else {
- loaninProxy = ProxyFactory.create(LoaninProxy.class,
- getBaseURL());
- }
- }
-
- /**
- * FIXME Comment this
- *
- * @return
- */
-// public static LoaninClient getInstance() {
-// return instance;
-// }
/**
* @return
* @see org.collectionspace.services.client.LoaninProxy#getLoanin()
*/
public ClientResponse<AbstractCommonList> readList() {
- return loaninProxy.readList();
- }
-
- /**
- * @param csid
- * @return
- * @see org.collectionspace.services.client.LoaninProxy#getAuthorityRefs(java.lang.String)
- */
- public ClientResponse<AuthorityRefList> getAuthorityRefs(String csid) {
- return loaninProxy.getAuthorityRefs(csid);
- }
-
-
- /**
- * @param csid
- * @return
- * @see org.collectionspace.services.client.LoaninProxy#getLoanin(java.lang.String)
- */
- public ClientResponse<String> read(String csid) {
- return loaninProxy.read(csid);
- }
-
- /**
- * @param loanin
- * @return
- * @see org.collectionspace.services.client.LoaninProxy#createLoanin(org.collectionspace.hello.Loanin)
- */
- public ClientResponse<Response> create(PoxPayloadOut xmlPayload) {
- return loaninProxy.create(xmlPayload.getBytes());
- }
-
- /**
- * @param csid
- * @param loanin
- * @return
- * @see org.collectionspace.services.client.LoaninProxy#updateLoanin(java.lang.Long, org.collectionspace.hello.Loanin)
- */
- public ClientResponse<String> update(String csid, PoxPayloadOut xmlPayload) {
- return loaninProxy.update(csid, xmlPayload.getBytes());
- }
-
- /**
- * @param csid
- * @return
- * @see org.collectionspace.services.client.LoaninProxy#deleteLoanin(java.lang.Long)
- */
- public ClientResponse<Response> delete(String csid) {
- return loaninProxy.delete(csid);
+ return getProxy().readList();
}
}
package org.collectionspace.services.client;
+import org.jboss.resteasy.client.ClientResponse;
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.services.common.authorityref.AuthorityRefList;
import org.collectionspace.services.jaxb.AbstractCommonList;
-import org.jboss.resteasy.client.ClientResponse;
/**
* @version $Revision$
@Path("/loansin/")
@Produces({"application/xml;charset=UTF-8"})
@Consumes({"application/xml"})
-public interface LoaninProxy extends CollectionSpaceProxy {
-
- //(C)reate
- @POST
- ClientResponse<Response> create(byte[] payload);
-
- //(R)ead
- @GET
- @Path("/{csid}")
- ClientResponse<String> read(@PathParam("csid") String csid);
-
- //(U)pdate
- @PUT
- @Path("/{csid}")
- ClientResponse<String> update(@PathParam("csid") String csid, byte[] payload);
-
- //(D)elete
- @DELETE
- @Path("/{csid}")
- ClientResponse<Response> delete(@PathParam("csid") String csid);
-
+public interface LoaninProxy extends CollectionSpacePoxProxy {
// List
@GET
ClientResponse<AbstractCommonList> readList();
-
- // List Authority References
- @GET
- @Path("/{csid}/authorityrefs/")
- ClientResponse<AuthorityRefList> getAuthorityRefs(@PathParam("csid") String csid);
-
}
import javax.ws.rs.core.UriInfo;
import javax.xml.parsers.ParserConfigurationException;
+import org.collectionspace.services.client.IQueryManager;
import org.collectionspace.services.client.PoxPayloadIn;
import org.collectionspace.services.client.PoxPayloadOut;
import org.collectionspace.services.common.AbstractMultiPartCollectionSpaceResourceImpl;
import org.collectionspace.services.common.document.DocumentHandler;
import org.collectionspace.services.common.document.DocumentNotFoundException;
import org.collectionspace.services.common.document.DocumentWrapper;
-import org.collectionspace.services.common.query.IQueryManager;
+//import org.collectionspace.services.common.query.IQueryManager;
import org.collectionspace.services.common.query.QueryManager;
import org.collectionspace.services.common.security.UnauthorizedException;
import org.collectionspace.services.common.vocabulary.RefNameServiceUtils;
*/
package org.collectionspace.services.client;
-import javax.ws.rs.core.Response;
-
-import org.collectionspace.services.common.authorityref.AuthorityRefList;
-import org.collectionspace.services.loanout.LoansoutCommonList;
-
-import org.jboss.resteasy.client.ProxyFactory;
-import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.client.core.executors.ApacheHttpClientExecutor;
-import org.jboss.resteasy.spi.ResteasyProviderFactory;
+import org.collectionspace.services.loanout.LoansoutCommonList;
/**
* LoanoutClient.java
* $LastChangedRevision$
* $LastChangedDate$
*/
-public class LoanoutClient extends AbstractServiceClientImpl {
+public class LoanoutClient extends AbstractPoxServiceClientImpl<LoanoutProxy> {
public static final String SERVICE_NAME = "loansout";
public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;
public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT;
public static final String SERVICE_PATH_PROXY = SERVICE_PATH + "/";
public static final String SERVICE_PAYLOAD_NAME = SERVICE_NAME;
- private LoanoutProxy loanoutProxy;
-
@Override
public String getServiceName() {
return SERVICE_NAME;
}
-
- /**
- *
- * Default constructor for LoanoutClient class.
- *
- */
- public LoanoutClient() {
- ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
- RegisterBuiltin.register(factory);
- setProxy();
- }
-
- /* (non-Javadoc)
- * @see org.collectionspace.services.client.AbstractServiceClientImpl#getServicePathComponent()
- */
+
@Override
public String getServicePathComponent() {
return SERVICE_PATH_COMPONENT;
}
- @Override
- public CollectionSpaceProxy getProxy() {
- return this.loanoutProxy;
- }
+ @Override
+ public Class<LoanoutProxy> getProxyClass() {
+ // TODO Auto-generated method stub
+ return LoanoutProxy.class;
+ }
- /**
- * allow to reset proxy as per security needs
+ /*
+ * Proxied service calls
*/
- @Override
- public void setProxy() {
- if (useAuth()) {
- loanoutProxy = ProxyFactory.create(LoanoutProxy.class,
- getBaseURL(), new ApacheHttpClientExecutor(getHttpClient()));
- } else {
- loanoutProxy = ProxyFactory.create(LoanoutProxy.class,
- getBaseURL());
- }
- }
/**
* @return
* @see org.collectionspace.services.client.LoanoutProxy#getLoanout()
*/
public ClientResponse<LoansoutCommonList> readList() {
- return loanoutProxy.readList();
- }
-
- /**
- * @param csid
- * @return
- * @see org.collectionspace.services.client.LoanoutProxy#getAuthorityRefs(java.lang.String)
- */
- public ClientResponse<AuthorityRefList> getAuthorityRefs(String csid) {
- return loanoutProxy.getAuthorityRefs(csid);
- }
-
-
- /**
- * @param csid
- * @return
- * @see org.collectionspace.services.client.LoanoutProxy#getLoanout(java.lang.String)
- */
- public ClientResponse<String> read(String csid) {
- return loanoutProxy.read(csid);
- }
-
- /**
- * @param multipart
- * @return
- * @see org.collectionspace.services.client.LoanoutProxy#createLoanout(org.collectionspace.hello.Loanout)
- */
- public ClientResponse<Response> create(PoxPayloadOut xmlPayload) {
- return loanoutProxy.create(xmlPayload.getBytes());
- }
-
- /**
- * @param csid
- * @param multipart
- * @return
- * @see org.collectionspace.services.client.LoanoutProxy#updateLoanout(java.lang.Long, org.collectionspace.hello.Loanout)
- */
- public ClientResponse<String> update(String csid, PoxPayloadOut xmlPayload) {
- return loanoutProxy.update(csid, xmlPayload.getBytes());
-
- }
-
- /**
- * @param csid
- * @return
- * @see org.collectionspace.services.client.LoanoutProxy#deleteLoanout(java.lang.Long)
- */
- @Override
- public ClientResponse<Response> delete(String csid) {
- return loanoutProxy.delete(csid);
- }
+ return getProxy().readList();
+ }
}
package org.collectionspace.services.client;
+import org.jboss.resteasy.client.ClientResponse;
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.services.common.authorityref.AuthorityRefList;
import org.collectionspace.services.loanout.LoansoutCommonList;
-import org.jboss.resteasy.client.ClientResponse;
/**
* @version $Revision$
@Path("/loansout/")
@Produces({"application/xml"})
@Consumes({"application/xml"})
-public interface LoanoutProxy extends CollectionSpaceProxy {
-
- //(C)reate
- @POST
- ClientResponse<Response> create(byte[] payload);
-
- //(R)ead
- @GET
- @Path("/{csid}")
- ClientResponse<String> read(@PathParam("csid") String csid);
-
- //(U)pdate
- @PUT
- @Path("/{csid}")
- ClientResponse<String> update(@PathParam("csid") String csid, byte[] payload);
-
- //(D)elete
- @DELETE
- @Path("/{csid}")
- ClientResponse<Response> delete(@PathParam("csid") String csid);
-
+public interface LoanoutProxy extends CollectionSpacePoxProxy {
// List
@GET
@Produces({"application/xml"})
ClientResponse<LoansoutCommonList> readList();
-
- // List Authority References
- @GET
- @Produces({"application/xml"})
- @Path("/{csid}/authorityrefs/")
- ClientResponse<AuthorityRefList> getAuthorityRefs(@PathParam("csid") String csid);
-
}
import javax.ws.rs.core.UriBuilder;
import javax.ws.rs.core.UriInfo;
+import org.collectionspace.services.client.IQueryManager;
import org.collectionspace.services.client.PoxPayloadIn;
import org.collectionspace.services.client.PoxPayloadOut;
import org.collectionspace.services.common.AbstractMultiPartCollectionSpaceResourceImpl;
import org.collectionspace.services.common.document.DocumentHandler;
import org.collectionspace.services.common.document.DocumentNotFoundException;
import org.collectionspace.services.common.document.DocumentWrapper;
-import org.collectionspace.services.common.query.IQueryManager;
+//import org.collectionspace.services.common.query.IQueryManager;
import org.collectionspace.services.common.query.QueryManager;
import org.collectionspace.services.common.security.UnauthorizedException;
import org.collectionspace.services.nuxeo.client.java.DocumentModelHandler;
/**
* The Class LocationAuthorityClient.
*/
-public class LocationAuthorityClient extends AbstractServiceClientImpl { //FIXME: REM - Client classes for Person, Org, Vocab, and Location should have a common base class
+public class LocationAuthorityClient extends AuthorityClientImpl<LocationsCommonList, LocationAuthorityProxy> {
public static final String SERVICE_NAME = "locationauthorities";
public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;
public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT;
public String getItemCommonPartName() {
return getCommonPartName(SERVICE_ITEM_NAME);
}
-
- /**
- *
- */
- private LocationAuthorityProxy locationAuthorityProxy;
-
- /**
- * Instantiates a new location authority client.
- */
- public LocationAuthorityClient() {
- ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
- RegisterBuiltin.register(factory);
- setProxy();
- }
-
- /* (non-Javadoc)
- * @see org.collectionspace.services.client.CollectionSpaceClient#getProxy()
- */
- @Override
- public CollectionSpaceProxy getProxy() {
- return this.locationAuthorityProxy;
- }
- /**
- * Sets the proxy.
- */
- public void setProxy() {
- if (useAuth()) {
- locationAuthorityProxy = ProxyFactory.create(LocationAuthorityProxy.class,
- getBaseURL(), new ApacheHttpClientExecutor(getHttpClient()));
- } else {
- locationAuthorityProxy = ProxyFactory.create(LocationAuthorityProxy.class,
- getBaseURL());
- }
- }
-
- /**
- * Read list.
- *
- * @return the client response
+ @Override
+ public Class<LocationAuthorityProxy> getProxyClass() {
+ return LocationAuthorityProxy.class;
+ }
+
+ /*
+ * Proxied service calls.
*/
-
+
/**
* @return list
* @see org.collectionspace.services.client.LocationAuthorityProxy#readList()
*/
public ClientResponse<LocationauthoritiesCommonList> readList() {
- return locationAuthorityProxy.readList();
- }
-
- /**
- * Read.
- *
- * @param csid the csid
- * @return the client response
- */
- public ClientResponse<String> read(String csid) {
- return locationAuthorityProxy.read(csid);
- }
-
- /**
- * Read by name.
- *
- * @param name the name
- * @return the client response
- */
- public ClientResponse<String> readByName(String name) {
- return locationAuthorityProxy.readByName(name);
- }
-
- /**
- * Creates the.
- *
- * @param multipart the multipart
- * @return the client response
- */
- public ClientResponse<Response> create(PoxPayloadOut xmlPayload) {
- return locationAuthorityProxy.create(xmlPayload.getBytes());
- }
-
- /**
- * Update.
- *
- * @param csid the csid
- * @param multipart the multipart
- * @return the client response
- */
- public ClientResponse<String> update(String csid, PoxPayloadOut xmlPayload) {
- return locationAuthorityProxy.update(csid, xmlPayload.getBytes());
-
- }
-
- /**
- * Delete.
- *
- * @param csid the csid
- * @return the client response
- */
- public ClientResponse<Response> delete(String csid) {
- return locationAuthorityProxy.delete(csid);
- }
-
- /**
- * Read item list, filtering by partial term match, or keywords. Only one of
- * partialTerm or keywords should be specified. If both are specified, keywords
- * will be ignored.
- *
- * @param inAuthority the parent authority
- * @param partialTerm A partial term on which to match,
- * which will filter list results to return only matched resources.
- * @param keywords A set of keywords on which to match,
- * which will filter list results to return only matched resources.
- * @return the client response
- */
- public ClientResponse<LocationsCommonList>
- readItemList(String inAuthority, String partialTerm, String keywords) {
- return locationAuthorityProxy.readItemList(inAuthority, partialTerm, keywords);
- }
-
- /**
- * Gets the referencing objects.
- *
- * @param parentcsid the parentcsid
- * @param csid the csid
- * @return the referencing objects
- */
- public ClientResponse<AuthorityRefDocList> getReferencingObjects(String parentcsid, String csid) {
- return locationAuthorityProxy.getReferencingObjects(parentcsid, csid);
- }
-
- /**
- * Read item list for named vocabulary, filtering by partial term match, or keywords. Only one of
- * partialTerm or keywords should be specified. If both are specified, keywords
- * will be ignored.
- *
- * @param specifier the specifier
- * @param partialTerm A partial term on which to match,
- * which will filter list results to return only matched resources.
- * @param keywords A set of keywords on which to match,
- * which will filter list results to return only matched resources.
- * @return the client response
- */
- public ClientResponse<LocationsCommonList>
- readItemListForNamedAuthority(String specifier, String partialTerm, String keywords) {
- return locationAuthorityProxy.readItemListForNamedAuthority(specifier, partialTerm, keywords);
- }
-
- /**
- * Read item.
- *
- * @param vcsid the vcsid
- * @param csid the csid
- * @return the client response
- */
- public ClientResponse<String> readItem(String vcsid, String csid) {
- return locationAuthorityProxy.readItem(vcsid, csid);
- }
-
- /**
- * Creates the item.
- *
- * @param vcsid the vcsid
- * @param multipart the multipart
- * @return the client response
- */
- public ClientResponse<Response> createItem(String vcsid, PoxPayloadOut xmlPayload) {
- return locationAuthorityProxy.createItem(vcsid, xmlPayload.getBytes());
- }
-
- /**
- * Update item.
- *
- * @param vcsid the vcsid
- * @param csid the csid
- * @param multipart the multipart
- * @return the client response
- */
- public ClientResponse<String> updateItem(String vcsid, String csid, PoxPayloadOut xmlPayload) {
- return locationAuthorityProxy.updateItem(vcsid, csid, xmlPayload.getBytes());
-
- }
-
- /**
- * Delete item.
- *
- * @param vcsid the vcsid
- * @param csid the csid
- * @return the client response
- */
- public ClientResponse<Response> deleteItem(String vcsid, String csid) {
- return locationAuthorityProxy.deleteItem(vcsid, csid);
- }
-
- /**
- * Creates the contact.
- *
- * @param parentcsid the parentcsid
- * @param itemcsid the itemcsid
- * @param multipart the multipart
- * @return the client response
- */
- public ClientResponse<Response> createContact(String parentcsid,
- String itemcsid, PoxPayloadOut xmlPayload) {
- return locationAuthorityProxy.createContact(parentcsid, itemcsid, xmlPayload.getBytes());
- }
-
- /**
- * Read contact.
- *
- * @param parentcsid the parentcsid
- * @param itemcsid the itemcsid
- * @param csid the csid
- * @return the client response
- */
- public ClientResponse<String> readContact(String parentcsid,
- String itemcsid, String csid) {
- return locationAuthorityProxy.readContact(parentcsid, itemcsid, csid);
- }
-
- /**
- * Read contact list.
- *
- * @param parentcsid the parentcsid
- * @param itemcsid the itemcsid
- * @return the client response
- */
- public ClientResponse<ContactsCommonList> readContactList(String parentcsid,
- String itemcsid) {
- return locationAuthorityProxy.readContactList(parentcsid, itemcsid);
- }
-
- /**
- * Update contact.
- *
- * @param parentcsid the parentcsid
- * @param itemcsid the itemcsid
- * @param csid the csid
- * @param multipart the multipart
- * @return the client response
- */
- public ClientResponse<String> updateContact(String parentcsid,
- String itemcsid, String csid, PoxPayloadOut xmlPayload) {
- return locationAuthorityProxy.updateContact(parentcsid, itemcsid, csid, xmlPayload.getBytes());
- }
-
- /**
- * Delete contact.
- *
- * @param parentcsid the parentcsid
- * @param itemcsid the itemcsid
- * @param csid the csid
- * @return the client response
- */
- public ClientResponse<Response> deleteContact(String parentcsid,
- String itemcsid, String csid) {
- return locationAuthorityProxy.deleteContact(parentcsid,
- itemcsid, csid);
+ return getProxy().readList();
}
}
package org.collectionspace.services.client;
+import org.jboss.resteasy.client.ClientResponse;
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.QueryParam;
-import javax.ws.rs.core.Response;
-import org.collectionspace.services.common.query.IQueryManager;
-import org.collectionspace.services.common.authorityref.AuthorityRefDocList;
-import org.collectionspace.services.contact.ContactsCommonList;
import org.collectionspace.services.location.LocationauthoritiesCommonList;
import org.collectionspace.services.location.LocationsCommonList;
-import org.jboss.resteasy.client.ClientResponse;
/**
* @version $Revision:$
@Path(LocationAuthorityClient.SERVICE_PATH + "/")
@Produces("application/xml")
@Consumes("application/xml")
-public interface LocationAuthorityProxy extends CollectionSpaceProxy {
+public interface LocationAuthorityProxy extends AuthorityProxy<LocationsCommonList> {
// List Locationauthorities
@GET
ClientResponse<LocationauthoritiesCommonList> readList();
-
- //(C)reate
- @POST
- ClientResponse<Response> create(byte[] xmlPayload);
-
- //(R)ead
- @GET
- @Path("/{csid}")
- ClientResponse<String> read(@PathParam("csid") String csid);
-
- //(R)ead by name
- @GET
- @Path("/urn:cspace:name({name})")
- ClientResponse<String> readByName(@PathParam("name") String name);
-
- //(U)pdate
- @PUT
- @Path("/{csid}")
- ClientResponse<String> update(@PathParam("csid") String csid, byte[] xmlPayload);
-
- //(D)elete
- @DELETE
- @Path("/{csid}")
- ClientResponse<Response> delete(@PathParam("csid") String csid);
-
+
+ /*
+ * List results that must be overridden for the RESTEasy proxy generation to work correctly.
+ */
+
// List Items matching a partial term or keywords.
- @GET
+ @Override
+ @GET
@Produces({"application/xml"})
- @Path("/{vcsid}/items/")
+ @Path("/{csid}/items/")
ClientResponse<LocationsCommonList> readItemList(
- @PathParam("vcsid") String vcsid,
+ @PathParam("csid") String vcsid,
@QueryParam (IQueryManager.SEARCH_TYPE_PARTIALTERM) String partialTerm,
@QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords);
-
- /**
- * @param parentcsid
- * @param itemcsid
- * @param csid
- * @return
- * @see org.collectionspace.services.client.IntakeProxy#getAuthorityRefs(java.lang.String)
- */
- @GET
- @Path("{csid}/items/{itemcsid}/refObjs")
- @Produces("application/xml")
- ClientResponse<AuthorityRefDocList> getReferencingObjects(
- @PathParam("csid") String parentcsid,
- @PathParam("itemcsid") String itemcsid);
-
+
// List Items for a named authority matching a partial term or keywords.
- @GET
+ @Override
+ @GET
@Produces({"application/xml"})
@Path("/urn:cspace:name({specifier})/items/")
ClientResponse<LocationsCommonList> readItemListForNamedAuthority(
@PathParam("specifier") String specifier,
@QueryParam (IQueryManager.SEARCH_TYPE_PARTIALTERM) String partialTerm,
@QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords);
-
- //(C)reate Item
- @POST
- @Path("/{vcsid}/items/")
- ClientResponse<Response> createItem(@PathParam("vcsid") String vcsid, byte[] xmlPayload);
-
- //(R)ead Item
- @GET
- @Path("/{vcsid}/items/{csid}")
- ClientResponse<String> readItem(@PathParam("vcsid") String vcsid, @PathParam("csid") String csid);
-
- //(U)pdate Item
- @PUT
- @Path("/{vcsid}/items/{csid}")
- ClientResponse<String> updateItem(@PathParam("vcsid") String vcsid, @PathParam("csid") String csid, byte[] xmlPayload);
-
- //(D)elete Item
- @DELETE
- @Path("/{vcsid}/items/{csid}")
- ClientResponse<Response> deleteItem(@PathParam("vcsid") String vcsid, @PathParam("csid") String csid);
-
- // List Contacts
- @GET
- @Path("/{parentcsid}/items/{itemcsid}/contacts/")
- ClientResponse<ContactsCommonList> readContactList(
- @PathParam("parentcsid") String parentcsid,
- @PathParam("itemcsid") String itemcsid);
-
- //(C)reate Contact
- @POST
- @Path("/{parentcsid}/items/{itemcsid}/contacts/")
- ClientResponse<Response> createContact(
- @PathParam("parentcsid") String parentcsid,
- @PathParam("itemcsid") String itemcsid,
- byte[] xmlPayload);
-
- //(R)ead Contact
- @GET
- @Path("/{parentcsid}/items/{itemcsid}/contacts/{csid}")
- ClientResponse<String> readContact(
- @PathParam("parentcsid") String parentcsid,
- @PathParam("itemcsid") String itemcsid,
- @PathParam("csid") String csid);
-
- //(U)pdate Contact
- @PUT
- @Path("/{parentcsid}/items/{itemcsid}/contacts/{csid}")
- ClientResponse<String> updateContact(
- @PathParam("parentcsid") String parentcsid,
- @PathParam("itemcsid") String itemcsid,
- @PathParam("csid") String csid,
- byte[] xmlPayload);
-
- //(D)elete Contact
- @DELETE
- @Path("/{parentcsid}/items/{itemcsid}/contacts/{csid}")
- ClientResponse<Response> deleteContact(
- @PathParam("parentcsid") String parentcsid,
- @PathParam("itemcsid") String itemcsid,
- @PathParam("csid") String csid);
-
+
}
import org.collectionspace.services.common.vocabulary.AuthorityResource;
import org.collectionspace.services.common.vocabulary.RefNameServiceUtils;
import org.collectionspace.services.common.vocabulary.RefNameUtils;
-import org.collectionspace.services.common.query.IQueryManager;
import org.collectionspace.services.nuxeo.client.java.RemoteDocumentModelHandlerImpl;
import org.collectionspace.services.location.nuxeo.LocationDocumentModelHandler;
import org.jboss.resteasy.util.HttpResponseCodes;
*/
package org.collectionspace.services.client;
-import javax.ws.rs.PathParam;
import javax.ws.rs.core.Response;
-
-import org.collectionspace.services.common.authorityref.AuthorityRefList;
-import org.collectionspace.services.jaxb.AbstractCommonList;
-
-import org.jboss.resteasy.client.ProxyFactory;
-import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataOutput;
import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.client.core.executors.ApacheHttpClientExecutor;
-//import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
-//import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
-import org.jboss.resteasy.spi.ResteasyProviderFactory;
+
+import org.collectionspace.services.jaxb.AbstractCommonList;
/**
* MediaClient.java
* $LastChangedDate: 2010-05-17 18:25:37 -0700 (Mon, 17 May 2010) $
*
*/
-public class MediaClient extends AbstractServiceClientImpl {
+public class MediaClient extends AbstractPoxServiceClientImpl<MediaProxy> {
public static final String SERVICE_NAME = "media";
public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;
public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT;
public String getServicePathComponent() {
return SERVICE_PATH_COMPONENT;
}
-
- /**
- *
- */
- private MediaProxy mediaProxy;
-
- /**
- *
- * Default constructor for MediaClient class.
- *
- */
- public MediaClient() {
- ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
- RegisterBuiltin.register(factory);
- setProxy();
- }
- @Override
- public CollectionSpaceProxy getProxy() {
- return this.mediaProxy;
- }
-
- /**
- * allow to reset proxy as per security needs
- */
- public void setProxy() {
- if (useAuth()) {
- mediaProxy = ProxyFactory.create(MediaProxy.class,
- getBaseURL(), new ApacheHttpClientExecutor(getHttpClient()));
- } else {
- mediaProxy = ProxyFactory.create(MediaProxy.class,
- getBaseURL());
- }
- }
+ @Override
+ public Class<MediaProxy> getProxyClass() {
+ return MediaProxy.class;
+ }
+
+ /*
+ * Proxied service calls
+ */
/**
* @return
* @see org.collectionspace.services.client.MediaProxy#getMedia()
*/
public ClientResponse<AbstractCommonList> readList() {
- return mediaProxy.readList();
- }
-
- /**
- * @param csid
- * @return
- * @see org.collectionspace.services.client.MediaProxy#getAuthorityRefs(java.lang.String)
- */
- public ClientResponse<AuthorityRefList> getAuthorityRefs(String csid) {
- return mediaProxy.getAuthorityRefs(csid);
+ return getProxy().readList();
}
-
-
- /**
- * @param csid
- * @return
- * @see org.collectionspace.services.client.MediaProxy#getMedia(java.lang.String)
- */
- public ClientResponse<String> read(String csid) {
- return mediaProxy.read(csid);
- }
-
- /**
- * @param media
- * @return
- *
- */
- public ClientResponse<Response> create(PoxPayloadOut xmlPayload) {
- return mediaProxy.create(xmlPayload.getBytes());
- }
-
+
/**
* @param media
* @return
*/
public ClientResponse<Response> createBlobFromFormData(String csid,
MultipartFormDataOutput formDataOutput) {
- return mediaProxy.createBlobFromFormData(csid, formDataOutput);
+ return getProxy().createBlobFromFormData(csid, formDataOutput);
}
/**
*
*/
public ClientResponse<Response> createBlobFromUri(String csid, String blobUri) {
- return mediaProxy.createBlobFromUri(csid, blobUri);
+ return getProxy().createBlobFromUri(csid, blobUri);
}
-
- /**
- * @param csid
- * @param media
- * @return
- */
- public ClientResponse<String> update(String csid, PoxPayloadOut xmlPayload) {
- return mediaProxy.update(csid, xmlPayload.getBytes());
-
- }
-
+
/**
* @param csid
* @param media
* @return
*/
public ClientResponse<String> update(String csid, PoxPayloadOut xmlPayload, String URI) {
- return mediaProxy.update(csid, xmlPayload.getBytes());
+ return getProxy().update(csid, xmlPayload.getBytes());
}
-
-
- /**
- * @param csid
- * @return
- * @see org.collectionspace.services.client.MediaProxy#deleteMedia(java.lang.Long)
- */
- public ClientResponse<Response> delete(String csid) {
- return mediaProxy.delete(csid);
- }
}
package org.collectionspace.services.client;
-import javax.servlet.http.HttpServletRequest;
+import org.jboss.resteasy.client.ClientResponse;
+import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataOutput;
+
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.QueryParam;
-import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
-import org.collectionspace.services.common.authorityref.AuthorityRefList;
import org.collectionspace.services.jaxb.AbstractCommonList;
import org.collectionspace.services.client.BlobClient;
-import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataOutput;
/**
* @version $Revision: 2108 $
@Path(MediaClient.SERVICE_PATH + "/")
@Produces("application/xml")
@Consumes("application/xml")
-public interface MediaProxy extends CollectionSpaceProxy {
+public interface MediaProxy extends CollectionSpacePoxProxy {
- //(C)reate
- @POST
- ClientResponse<Response> create(byte[] xmlPayload);
-
@POST
@Path("/{csid}")
@Consumes("multipart/form-data")
@Consumes("application/xml")
ClientResponse<Response>createBlobFromUri(@PathParam("csid") String csid,
@QueryParam(BlobClient.BLOB_URI_PARAM) String blobUri);
-
- //(R)ead
- @GET
- @Path("/{csid}")
- ClientResponse<String> read(@PathParam("csid") String csid);
-
- //(U)pdate
- @PUT
- @Path("/{csid}")
- ClientResponse<String> update(@PathParam("csid") String csid, byte[] xmlPayload);
-
- //(D)elete
- @DELETE
- @Path("/{csid}")
- ClientResponse<Response> delete(@PathParam("csid") String csid);
// List
@GET
@Produces({"application/xml"})
ClientResponse<AbstractCommonList> readList();
-
- // List Authority References
- @GET
- @Produces({"application/xml"})
- @Path("/{csid}/authorityrefs/")
- ClientResponse<AuthorityRefList> getAuthorityRefs(@PathParam("csid") String csid);
-
}
package org.collectionspace.services.client;
-import javax.ws.rs.core.Response;
-
-import org.collectionspace.services.common.authorityref.AuthorityRefList;
-import org.collectionspace.services.movement.MovementsCommonList;
-
-import org.jboss.resteasy.client.ProxyFactory;
-import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.client.core.executors.ApacheHttpClientExecutor;
-import org.jboss.resteasy.spi.ResteasyProviderFactory;
+import org.collectionspace.services.movement.MovementsCommonList;
/**
* MovementClient.java
* $LastChangedDate$
*
*/
-public class MovementClient extends AbstractServiceClientImpl {
+public class MovementClient extends AbstractPoxServiceClientImpl<MovementProxy> {
public static final String SERVICE_NAME = "movements";
public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;
public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT;
public static final String SERVICE_PATH_PROXY = SERVICE_PATH + "/";
public static final String SERVICE_PAYLOAD_NAME = SERVICE_NAME;
- private MovementProxy movementProxy;
- /**
- *
- * Default constructor for MovementClient class.
- *
- */
- public MovementClient() {
- ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
- RegisterBuiltin.register(factory);
- setProxy();
- }
-
@Override
public String getServiceName() {
return SERVICE_NAME;
}
- /* (non-Javadoc)
- * @see org.collectionspace.services.client.AbstractServiceClientImpl#getServicePathComponent()
- */
@Override
public String getServicePathComponent() {
return SERVICE_PATH_COMPONENT;
}
-
- @Override
- public CollectionSpaceProxy getProxy() {
- return this.movementProxy;
- }
- /**
- * allow to reset proxy as per security needs
- */
- @Override
- public void setProxy() {
- if (useAuth()) {
- movementProxy = ProxyFactory.create(MovementProxy.class,
- getBaseURL(), new ApacheHttpClientExecutor(getHttpClient()));
- } else {
- movementProxy = ProxyFactory.create(MovementProxy.class,
- getBaseURL());
- }
- }
+ @Override
+ public Class<MovementProxy> getProxyClass() {
+ return MovementProxy.class;
+ }
+ /*
+ * Proxied service calls
+ */
+
/**
* @return
* @see org.collectionspace.services.client.MovementProxy#readList()
*/
public ClientResponse<MovementsCommonList> readList() {
- return movementProxy.readList();
+ return getProxy().readList();
}
/**
* @see org.collectionspace.services.client.MovementProxy#readList(java.lang.String)
*/
public ClientResponse<MovementsCommonList> readListSortedBy(String sortFieldName) {
- return movementProxy.readListSortedBy(sortFieldName);
+ return getProxy().readListSortedBy(sortFieldName);
}
/**
* @see org.collectionspace.services.client.MovementProxy#keywordSearchSortedBy(java.lang.String, java.lang.String)
*/
public ClientResponse<MovementsCommonList> keywordSearchSortedBy(String keywords, String sortFieldName) {
- return movementProxy.keywordSearchSortedBy(keywords, sortFieldName);
- }
-
- /**
- * @param csid
- * @return
- * @see org.collectionspace.services.client.MovementProxy#getAuthorityRefs(java.lang.String)
- */
- public ClientResponse<AuthorityRefList> getAuthorityRefs(String csid) {
- return movementProxy.getAuthorityRefs(csid);
- }
-
-
- /**
- * @param csid
- * @return
- * @see org.collectionspace.services.client.MovementProxy#getMovement(java.lang.String)
- */
- public ClientResponse<String> read(String csid) {
- return movementProxy.read(csid);
- }
-
- /**
- * @param multipart
- * @return
- * @see org.collectionspace.services.client.MovementProxy#createMovement(org.collectionspace.hello.Movement)
- */
- public ClientResponse<Response> create(PoxPayloadOut xmlPayload) {
- return movementProxy.create(xmlPayload.getBytes());
- }
-
- /**
- * @param csid
- * @param multipart
- * @return
- * @see org.collectionspace.services.client.MovementProxy#updateMovement(java.lang.Long, org.collectionspace.hello.Movement)
- */
- public ClientResponse<String> update(String csid, PoxPayloadOut xmlPayload) {
- return movementProxy.update(csid, xmlPayload.getBytes());
-
- }
-
- /**
- * @param csid
- * @return
- * @see org.collectionspace.services.client.MovementProxy#deleteMovement(java.lang.Long)
- */
- @Override
- public ClientResponse<Response> delete(String csid) {
- return movementProxy.delete(csid);
- }
+ return getProxy().keywordSearchSortedBy(keywords, sortFieldName);
+ }
}
package org.collectionspace.services.client;
+import org.jboss.resteasy.client.ClientResponse;
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.QueryParam;
-import javax.ws.rs.core.Response;
-import org.collectionspace.services.common.query.IQueryManager;
-import org.collectionspace.services.common.authorityref.AuthorityRefList;
import org.collectionspace.services.movement.MovementsCommonList;
-import org.jboss.resteasy.client.ClientResponse;
-
/**
* MovementProxy.java
@Path("/movements/")
@Produces("application/xml")
@Consumes("application/xml")
-public interface MovementProxy extends CollectionSpaceProxy {
-
- //(C)reate
- @POST
- ClientResponse<Response> create(byte[] payload);
-
- //(R)ead
- @GET
- @Path("/{csid}")
- ClientResponse<String> read(@PathParam("csid") String csid);
+public interface MovementProxy extends CollectionSpacePoxProxy {
- //(U)pdate
- @PUT
- @Path("/{csid}")
- ClientResponse<String> update(@PathParam("csid") String csid, byte[] payload);
-
- //(D)elete
- @DELETE
- @Path("/{csid}")
- ClientResponse<Response> delete(@PathParam("csid") String csid);
-
// List
@GET
@Produces({"application/xml"})
ClientResponse<MovementsCommonList> keywordSearchSortedBy(
@QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords,
@QueryParam(IClientQueryParams.SORT_BY_PARAM) String sortFieldName);
-
- // List Authority References
- @GET
- @Produces({"application/xml"})
- @Path("/{csid}/authorityrefs/")
- ClientResponse<AuthorityRefList> getAuthorityRefs(@PathParam("csid") String csid);
-
}
import javax.ws.rs.core.UriBuilder;
import javax.ws.rs.core.UriInfo;
+import org.collectionspace.services.client.IQueryManager;
import org.collectionspace.services.client.PoxPayloadIn;
import org.collectionspace.services.client.PoxPayloadOut;
import org.collectionspace.services.common.AbstractMultiPartCollectionSpaceResourceImpl;
import org.collectionspace.services.common.document.DocumentHandler;
import org.collectionspace.services.common.document.DocumentNotFoundException;
import org.collectionspace.services.common.document.DocumentWrapper;
-import org.collectionspace.services.common.query.IQueryManager;
+//import org.collectionspace.services.common.query.IQueryManager;
import org.collectionspace.services.common.query.QueryManager;
import org.collectionspace.services.common.security.UnauthorizedException;
import org.collectionspace.services.movement.MovementsCommon;
* $LastChangedDate: $\r
*/\r
\r
-public class NoteClient extends AbstractServiceClientImpl {\r
+public class NoteClient extends AbstractServiceClientImpl<NoteProxy> {\r
\r
- private NoteProxy noteProxy;\r
public static final String SERVICE_NAME = "notes";\r
public static final String SERVICE_PATH_COMPONENT = "notes";\r
\r
- /**\r
- *\r
- * Default constructor for NoteClient class.\r
- *\r
- */\r
- public NoteClient() {\r
- ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();\r
- RegisterBuiltin.register(factory);\r
- setProxy();\r
- }\r
-\r
@Override\r
public String getServiceName() {\r
return SERVICE_NAME;\r
}\r
\r
- /* (non-Javadoc)\r
- * @see org.collectionspace.services.client.BaseServiceClient#getServicePathComponent()\r
- */\r
@Override\r
public String getServicePathComponent() {\r
return SERVICE_PATH_COMPONENT;\r
}\r
\r
- @Override\r
- public CollectionSpaceProxy getProxy() {\r
- return this.noteProxy;\r
- }\r
- \r
- /**\r
- * allow to reset proxy as per security needs\r
- */\r
- public void setProxy() {\r
- if (useAuth()) {\r
- noteProxy = ProxyFactory.create(NoteProxy.class,\r
- getBaseURL(), new ApacheHttpClientExecutor(getHttpClient()));\r
- } else {\r
- noteProxy = ProxyFactory.create(NoteProxy.class,\r
- getBaseURL());\r
- }\r
- }\r
+ @Override\r
+ public Class<NoteProxy> getProxyClass() {\r
+ return NoteProxy.class;\r
+ }\r
\r
+ /*\r
+ * Proxied service calls\r
+ */\r
+ \r
/**\r
* @return\r
* @see org.collectionspace.services.client.Note#getNote()\r
*/\r
public ClientResponse<NotesCommonList> readList() {\r
- return noteProxy.readList();\r
+ return getProxy().readList();\r
}\r
\r
/**\r
*/\r
\r
public ClientResponse<String> read(String csid) {\r
- return noteProxy.read(csid);\r
+ return getProxy().read(csid);\r
}\r
\r
/**\r
*/\r
public ClientResponse<Response> create(PoxPayloadOut multipart) {\r
String payload = multipart.toXML();\r
- return noteProxy.create(payload);\r
+ return getProxy().create(payload);\r
}\r
\r
/**\r
*/\r
public ClientResponse<String> update(String csid, PoxPayloadOut multipart) {\r
String payload = multipart.toXML();\r
- return noteProxy.update(csid, payload);\r
-\r
- }\r
+ return getProxy().update(csid, payload);\r
\r
- /**\r
- * @param csid\r
- * @return\r
- * @see org.collectionspace.services.client.Note#deleteNote(java.lang.Long)\r
- */\r
- @Override\r
- public ClientResponse<Response> delete(String csid) {\r
- return noteProxy.delete(csid);\r
}\r
}\r
*/
package org.collectionspace.services.client;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.core.Response;
-
-import org.collectionspace.services.common.authorityref.AuthorityRefList;
import org.collectionspace.services.jaxb.AbstractCommonList;
-
-import org.jboss.resteasy.client.ProxyFactory;
-import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.client.core.executors.ApacheHttpClientExecutor;
-import org.jboss.resteasy.spi.ResteasyProviderFactory;
/**
* ObjectExitClient.java
* $LastChangedDate: 2010-05-17 18:25:37 -0700 (Mon, 17 May 2010) $
*
*/
-public class ObjectExitClient extends AbstractServiceClientImpl {
+public class ObjectExitClient extends AbstractPoxServiceClientImpl<ObjectExitProxy> {
public static final String SERVICE_NAME = "objectexit";
public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;
public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT;
public static final String SERVICE_PAYLOAD_NAME = SERVICE_NAME;
- /**
- *
- */
- private ObjectExitProxy objectexitProxy;
@Override
public String getServiceName() {
public String getServicePathComponent() {
return SERVICE_PATH_COMPONENT;
}
-
- /**
- *
- * Default constructor for ObjectExitClient class.
- *
- */
- public ObjectExitClient() {
- ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
- RegisterBuiltin.register(factory);
- setProxy();
- }
-
- @Override
- public CollectionSpaceProxy getProxy() {
- return this.objectexitProxy;
- }
-
- /**
- * allow to reset proxy as per security needs
- */
- public void setProxy() {
- if (useAuth()) {
- objectexitProxy = ProxyFactory.create(ObjectExitProxy.class,
- getBaseURL(), new ApacheHttpClientExecutor(getHttpClient()));
- } else {
- objectexitProxy = ProxyFactory.create(ObjectExitProxy.class,
- getBaseURL());
- }
- }
- /**
- * FIXME Comment this
- *
- * @return
- */
-// public static ObjectExitClient getInstance() {
-// return instance;
-// }
+ @Override
+ public Class<ObjectExitProxy> getProxyClass() {
+ // TODO Auto-generated method stub
+ return ObjectExitProxy.class;
+ }
- /**
- * @return
- * @see org.collectionspace.services.client.ObjectExitProxy#getObjectExit()
- */
+ /*
+ * Proxied service calls.
+ *
+ */
+
public ClientResponse<AbstractCommonList> readList() {
- return objectexitProxy.readList();
- }
-
- /**
- * @param csid
- * @return
- * @see org.collectionspace.services.client.ObjectExitProxy#getAuthorityRefs(java.lang.String)
- */
- public ClientResponse<AuthorityRefList> getAuthorityRefs(String csid) {
- return objectexitProxy.getAuthorityRefs(csid);
- }
-
-
- /**
- * @param csid
- * @return
- * @see org.collectionspace.services.client.ObjectExitProxy#getObjectExit(java.lang.String)
- */
- public ClientResponse<String> read(String csid) {
- return objectexitProxy.read(csid);
- }
-
- /**
- * @param objectexit
- * @return
- *
- */
- public ClientResponse<Response> create(PoxPayloadOut xmlPayload) {
- return objectexitProxy.create(xmlPayload.getBytes());
- }
-
- /**
- * @param csid
- * @param objectexit
- * @return
- */
- public ClientResponse<String> update(String csid, PoxPayloadOut xmlPayload) {
- return objectexitProxy.update(csid, xmlPayload.getBytes());
-
- }
-
- /**
- * @param csid
- * @return
- * @see org.collectionspace.services.client.ObjectExitProxy#deleteObjectExit(java.lang.Long)
- */
- public ClientResponse<Response> delete(String csid) {
- return objectexitProxy.delete(csid);
+ return getProxy().readList();
}
}
package org.collectionspace.services.client;
+import org.jboss.resteasy.client.ClientResponse;
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.services.common.authorityref.AuthorityRefList;
import org.collectionspace.services.jaxb.AbstractCommonList;
-import org.jboss.resteasy.client.ClientResponse;
/**
* @version $Revision: 2108 $
@Path(ObjectExitClient.SERVICE_PATH + "/")
@Produces({"application/xml"})
@Consumes({"application/xml"})
-public interface ObjectExitProxy extends CollectionSpaceProxy {
-
- //(C)reate
- @POST
- ClientResponse<Response> create(byte[] xmlPayload);
-
- //(R)ead
- @GET
- @Path("/{csid}")
- ClientResponse<String> read(@PathParam("csid") String csid);
-
- //(U)pdate
- @PUT
- @Path("/{csid}")
- ClientResponse<String> update(@PathParam("csid") String csid, byte[] xmlPayload);
-
- //(D)elete
- @DELETE
- @Path("/{csid}")
- ClientResponse<Response> delete(@PathParam("csid") String csid);
-
+public interface ObjectExitProxy extends CollectionSpacePoxProxy {
// List
@GET
ClientResponse<AbstractCommonList> readList();
-
- // List Authority References
- @GET
- @Path("/{csid}/authorityrefs/")
- ClientResponse<AuthorityRefList> getAuthorityRefs(@PathParam("csid") String csid);
-
}
* https://source.collectionspace.org/collection-space/LICENSE.txt
*/
package org.collectionspace.services.client;
+import org.jboss.resteasy.client.ClientResponse;
-//import javax.ws.rs.PathParam;
-import javax.ws.rs.core.Response;
-
-import org.collectionspace.services.common.authorityref.AuthorityRefDocList;
-import org.collectionspace.services.common.authorityref.AuthorityRefList;
-import org.collectionspace.services.contact.ContactsCommonList;
import org.collectionspace.services.organization.OrgauthoritiesCommonList;
import org.collectionspace.services.organization.OrganizationsCommonList;
-import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.client.ProxyFactory;
-import org.jboss.resteasy.client.core.executors.ApacheHttpClientExecutor;
-import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
-import org.jboss.resteasy.spi.ResteasyProviderFactory;
-
/**
* The Class OrgAuthorityClient.
*/
-public class OrgAuthorityClient extends AbstractServiceClientImpl {
+public class OrgAuthorityClient extends AuthorityWithContactsClientImpl<OrganizationsCommonList, OrgAuthorityProxy> {
public static final String SERVICE_NAME = "orgauthorities";
public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;
public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT;
public String getServicePathComponent() {
return SERVICE_PATH_COMPONENT;
}
-
- /**
- * Gets the item common part name.
- *
- * @return the item common part name
- */
+
+ @Override
+ public Class<OrgAuthorityProxy> getProxyClass() {
+ return OrgAuthorityProxy.class;
+ }
+
public String getItemCommonPartName() {
return getCommonPartName(SERVICE_ITEM_NAME);
}
-
- /** The org authority proxy. */
- private OrgAuthorityProxy orgAuthorityProxy;
- /**
- * Instantiates a new org authority client.
+ /*
+ * Proxied service call methods
*/
- public OrgAuthorityClient() {
- ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
- RegisterBuiltin.register(factory);
- setProxy();
- }
-
- /* (non-Javadoc)
- * @see org.collectionspace.services.client.CollectionSpaceClient#getProxy()
- */
- @Override
- public CollectionSpaceProxy getProxy() {
- return this.orgAuthorityProxy;
- }
-
- /**
- * Sets the proxy.
- */
- public void setProxy() {
- if (useAuth()) {
- orgAuthorityProxy = ProxyFactory.create(OrgAuthorityProxy.class,
- getBaseURL(), new ApacheHttpClientExecutor(getHttpClient()));
- } else {
- orgAuthorityProxy = ProxyFactory.create(OrgAuthorityProxy.class,
- getBaseURL());
- }
- }
-
- /**
- * Gets the single instance of OrgAuthorityClient.
- *
- * @return single instance of OrgAuthorityClient //FIXME: This is wrong. There should NOT be a static instance of the client
- */
-// public static OrgAuthorityClient getInstance() {
-// return instance;
-// }
-
+
/**
* Read list.
*
* @return the client response
*/
public ClientResponse<OrgauthoritiesCommonList> readList() {
- return orgAuthorityProxy.readList();
- }
-
- /**
- * Read.
- *
- * @param csid the csid
- * @return the client response
- */
- public ClientResponse<String> read(String csid) {
- return orgAuthorityProxy.read(csid);
- }
-
- /**
- * Read by name.
- *
- * @param name the name
- * @return the client response
- */
- public ClientResponse<String> readByName(String name) {
- return orgAuthorityProxy.readByName(name);
- }
-
- /**
- * Creates the.
- *
- * @param multipart the multipart
- * @return the client response
- */
- public ClientResponse<Response> create(PoxPayloadOut xmlPayload) {
- return orgAuthorityProxy.create(xmlPayload.getBytes());
- }
-
- /**
- * Update.
- *
- * @param csid the csid
- * @param multipart the multipart
- * @return the client response
- */
- public ClientResponse<String> update(String csid, PoxPayloadOut xmlPayload) {
- return orgAuthorityProxy.update(csid, xmlPayload.getBytes());
-
- }
-
- /**
- * Delete.
- *
- * @param csid the csid
- * @return the client response
- */
- @Override
- public ClientResponse<Response> delete(String csid) {
- return orgAuthorityProxy.delete(csid);
- }
-
- /**
- * Read item list, filtering by partial term match, or keywords. Only one of
- * partialTerm or keywords should be specified. If both are specified, keywords
- * will be ignored.
- *
- * @param inAuthority the parent authority
- * @param partialTerm A partial term on which to match,
- * which will filter list results to return only matched resources.
- * @param keywords A set of keywords on which to match,
- * which will filter list results to return only matched resources.
- * @return the client response
- */
- public ClientResponse<OrganizationsCommonList>
- readItemList(String inAuthority, String partialTerm, String keywords) {
- return orgAuthorityProxy.readItemList(inAuthority, partialTerm, keywords);
- }
-
- /**
- * Gets the referencing objects.
- *
- * @param parentcsid the parentcsid
- * @param csid the csid
- * @return the referencing objects
- */
- public ClientResponse<AuthorityRefDocList> getReferencingObjects(String parentcsid, String csid) {
- return orgAuthorityProxy.getReferencingObjects(parentcsid, csid);
- }
-
-
- /**
- * Read item list for named vocabulary, filtering by partial term match, or keywords. Only one of
- * partialTerm or keywords should be specified. If both are specified, keywords
- * will be ignored.
- *
- * @param specifier the specifier
- * @param partialTerm A partial term on which to match,
- * which will filter list results to return only matched resources.
- * @param keywords A set of keywords on which to match,
- * which will filter list results to return only matched resources.
- * @return the client response
- */
- public ClientResponse<OrganizationsCommonList>
- readItemListForNamedAuthority(String specifier, String partialTerm, String keywords) {
- return orgAuthorityProxy.readItemListForNamedAuthority(specifier, partialTerm, keywords);
- }
-
- /**
- * Gets the item authority refs.
- *
- * @param parentcsid the parentcsid
- * @param csid the csid
- * @return the item authority refs
- */
- public ClientResponse<AuthorityRefList> getItemAuthorityRefs(String parentcsid, String csid) {
- return orgAuthorityProxy.getItemAuthorityRefs(parentcsid, csid);
- }
-
- /**
- * Read item.
- *
- * @param vcsid the vcsid
- * @param csid the csid
- * @return the client response
- */
- public ClientResponse<String> readItem(String vcsid, String csid) {
- return orgAuthorityProxy.readItem(vcsid, csid);
- }
-
- /**
- * Read named item.
- *
- * @param vcsid the vcsid
- * @param shortId the shortIdentifier
- * @return the client response
- */
- public ClientResponse<String> readNamedItem(String vcsid, String shortId) {
- return orgAuthorityProxy.readNamedItem(vcsid, shortId);
- }
-
- /**
- * Read item in Named Authority.
- *
- * @param authShortId the shortIdentifier for the Authority
- * @param csid the csid
- * @return the client response
- */
- public ClientResponse<String> readItemInNamedAuthority(String authShortId, String csid) {
- return orgAuthorityProxy.readItemInNamedAuthority(authShortId, csid);
+ return getProxy().readList();
}
-
- /**
- * Read named item in Named Authority.
- *
- * @param authShortId the shortIdentifier for the Authority
- * @param itemShortId the shortIdentifier for the item
- * @return the client response
- */
- public ClientResponse<String> readNamedItemInNamedAuthority(String authShortId, String itemShortId) {
- return orgAuthorityProxy.readNamedItemInNamedAuthority(authShortId, itemShortId);
- }
-
- /**
- * Creates the item.
- *
- * @param vcsid the vcsid
- * @param multipart the multipart
- * @return the client response
- */
- public ClientResponse<Response> createItem(String vcsid, PoxPayloadOut multipart) {
- return orgAuthorityProxy.createItem(vcsid, multipart.getBytes());
- }
-
- /**
- * Update item.
- *
- * @param vcsid the vcsid
- * @param csid the csid
- * @param multipart the multipart
- * @return the client response
- */
- public ClientResponse<String> updateItem(String vcsid, String csid, PoxPayloadOut xmlPayload) {
- return orgAuthorityProxy.updateItem(vcsid, csid, xmlPayload.getBytes());
-
- }
-
- /**
- * Delete item.
- *
- * @param vcsid the vcsid
- * @param csid the csid
- * @return the client response
- */
- public ClientResponse<Response> deleteItem(String vcsid, String csid) {
- return orgAuthorityProxy.deleteItem(vcsid, csid);
- }
-
- /***************************************************************************
- *
- * Contact sub-resource interfaces
- *
- ***************************************************************************/
-
- /**
- * Creates the contact.
- *
- * @param parentcsid the parentcsid
- * @param itemcsid the itemcsid
- * @param multipart the multipart
- * @return the client response
- */
- public ClientResponse<Response> createContact(String parentcsid,
- String itemcsid, PoxPayloadOut xmlPayload) {
- return orgAuthorityProxy.createContact(parentcsid, itemcsid, xmlPayload.getBytes());
- }
-
- /**
- * Creates the contact.
- *
- * @param parentcsid
- * @param itemspecifier (shortIdentifier)
- * @param multipart
- * @return the client response
- */
- public ClientResponse<Response> createContactForNamedItem(
- String parentcsid,
- String itemspecifier,
- PoxPayloadOut xmlPayload) {
- return orgAuthorityProxy.createContactForNamedItem(parentcsid, itemspecifier, xmlPayload.getBytes());
- }
- /**
- * Creates the contact.
- *
- * @param parentspecifier (shortIdentifier)
- * @param itemcsid
- * @param multipart
- * @return the client response
- */
- public ClientResponse<Response> createContactForItemInNamedAuthority(
- String parentspecifier,
- String itemcsid,
- PoxPayloadOut xmlPayload) {
- return orgAuthorityProxy.createContactForItemInNamedAuthority(parentspecifier, itemcsid, xmlPayload.getBytes());
- }
- /**
- * Creates the contact.
- *
- * @param parentspecifier (shortIdentifier)
- * @param itemspecifier (shortIdentifier)
- * @param multipart
- * @return the client response
- */
- public ClientResponse<Response> createContactForNamedItemInNamedAuthority(
- String parentspecifier,
- String itemspecifier,
- PoxPayloadOut xmlPayload) {
- return orgAuthorityProxy.createContactForNamedItemInNamedAuthority(parentspecifier, itemspecifier, xmlPayload.getBytes());
- }
-
- /**
- * Read contact.
- *
- * @param parentcsid the parentcsid
- * @param itemcsid the itemcsid
- * @param csid the csid
- * @return the client response
- */
- public ClientResponse<String> readContact(String parentcsid,
- String itemcsid, String csid) {
- return orgAuthorityProxy.readContact(parentcsid, itemcsid, csid);
- }
-
- /**
- * Read contact.
- *
- * @param parentcsid
- * @param itemspecifier (shortIdentifier)
- * @param csid
- * @return the client response
- */
- public ClientResponse<String> readContactForNamedItem(
- String parentcsid,
- String itemspecifier,
- String csid){
- return orgAuthorityProxy.readContactForNamedItem(parentcsid, itemspecifier, csid);
- }
-
- /**
- * Read contact.
- *
- * @param parentspecifier (shortIdentifier)
- * @param itemcsid
- * @param csid
- * @return the client response
- */
- public ClientResponse<String> readContactInNamedAuthority(
- String parentspecifier,
- String itemcsid,
- String csid){
- return orgAuthorityProxy.readContactInNamedAuthority(parentspecifier, itemcsid, csid);
- }
-
- /**
- * Read contact.
- *
- * @param parentspecifier (shortIdentifier)
- * @param itemspecifier (shortIdentifier)
- * @param csid
- * @return the client response
- */
- public ClientResponse<String> readContactForNamedItemInNamedAuthority(
- String parentspecifier,
- String itemspecifier,
- String csid){
- return orgAuthorityProxy.readContactForNamedItemInNamedAuthority(parentspecifier, itemspecifier, csid);
- }
-
-
- /**
- * Read contact list.
- *
- * @param parentcsid the parentcsid
- * @param itemcsid the itemcsid
- * @return the client response
- */
- public ClientResponse<ContactsCommonList> readContactList(String parentcsid,
- String itemcsid) {
- return orgAuthorityProxy.readContactList(parentcsid, itemcsid);
- }
-
- /**
- * Read contact list.
- *
- * @param parentcsid
- * @param itemspecifier (shortIdentifier)
- * @return the client response
- */
- public ClientResponse<ContactsCommonList> readContactListForNamedItem(
- String parentcsid,
- String itemspecifier){
- return orgAuthorityProxy.readContactList(parentcsid, itemspecifier);
- }
-
- /**
- * Read contact list.
- *
- * @param parentspecifier (shortIdentifier)
- * @param itemcsid
- * @return the client response
- */
- public ClientResponse<ContactsCommonList> readContactListForItemInNamedAuthority(
- String parentspecifier,
- String itemcsid){
- return orgAuthorityProxy.readContactList(parentspecifier, itemcsid);
- }
-
- /**
- * Read contact list.
- *
- * @param parentspecifier (shortIdentifier)
- * @param itemspecifier (shortIdentifier)
- * @return the client response
- */
- public ClientResponse<ContactsCommonList> readContactListForNamedItemInNamedAuthority(
- String parentspecifier,
- String itemspecifier){
- return orgAuthorityProxy.readContactList(parentspecifier, itemspecifier);
- }
-
-
- /**
- * Update contact.
- *
- * @param parentcsid the parentcsid
- * @param itemcsid the itemcsid
- * @param csid the csid
- * @param multipart the multipart
- * @return the client response
- */
- public ClientResponse<String> updateContact(String parentcsid,
- String itemcsid, String csid, PoxPayloadOut xmlPayload) {
- return orgAuthorityProxy.updateContact(parentcsid, itemcsid, csid, xmlPayload.getBytes());
- }
-
- /**
- * Update contact.
- *
- * @param parentcsid the parentcsid
- * @param itemspecifier (shortIdentifier)
- * @param csid the csid
- * @param multipart the multipart
- * @return the client response
- */
- public ClientResponse<String> updateContactForNamedItem(
- String parentcsid,
- String itemspecifier,
- String csid,
- PoxPayloadOut xmlPayload) {
- return orgAuthorityProxy.updateContactForNamedItem(parentcsid, itemspecifier, csid, xmlPayload.getBytes());
- }
-
- /**
- * Update contact.
- *
- * @param parentspecifier (shortIdentifier)
- * @param itemcsid the itemcsid
- * @param csid the csid
- * @param multipart the multipart
- * @return the client response
- */
- public ClientResponse<String> updateContactInNamedAuthority(
- String parentspecifier,
- String itemcsid,
- String csid,
- PoxPayloadOut xmlPayload) {
- return orgAuthorityProxy.updateContactInNamedAuthority(parentspecifier, itemcsid, csid, xmlPayload.getBytes());
- }
-
- /**
- * Update contact.
- *
- * @param parentspecifier (shortIdentifier)
- * @param itemspecifier (shortIdentifier)
- * @param csid the csid
- * @param multipart the multipart
- * @return the client response
- */
- public ClientResponse<String> updateContactForNamedItemInNamedAuthority(
- String parentspecifier,
- String itemspecifier,
- String csid,
- PoxPayloadOut xmlPayload) {
- return orgAuthorityProxy.updateContactForNamedItemInNamedAuthority(parentspecifier, itemspecifier, csid, xmlPayload.getBytes());
- }
-
-
- /**
- * Delete contact.
- *
- * @param parentcsid the parentcsid
- * @param itemcsid the itemcsid
- * @param csid the csid
- * @return the client response
- */
- public ClientResponse<Response> deleteContact(String parentcsid,
- String itemcsid, String csid) {
- return orgAuthorityProxy.deleteContact(parentcsid,
- itemcsid, csid);
- }
-
- /**
- * Delete contact.
- *
- * @param parentcsid the parentcsid
- * @param itemspecifier (shortIdentifier)
- * @param csid the csid
- * @return the client response
- */
- public ClientResponse<Response> deleteContactForNamedItem(
- String parentcsid,
- String itemspecifier,
- String csid) {
- return orgAuthorityProxy.deleteContactForNamedItem(parentcsid,
- itemspecifier, csid);
- }
-
- /**
- * Delete contact.
- *
- * @param parentspecifier (shortIdentifier)
- * @param itemcsid the itemcsid
- * @param csid the csid
- * @return the client response
- */
- public ClientResponse<Response> deleteContactInNamedAuthority(
- String parentspecifier,
- String itemcsid,
- String csid) {
- return orgAuthorityProxy.deleteContactInNamedAuthority(parentspecifier,
- itemcsid, csid);
- }
-
- /**
- * Delete contact.
- *
- * @param parentspecifier (shortIdentifier)
- * @param itemspecifier (shortIdentifier)
- * @param csid the csid
- * @return the client response
- */
- public ClientResponse<Response> deleteContactForNamedItemInNamedAuthority(
- String parentspecifier,
- String itemspecifier,
- String csid) {
- return orgAuthorityProxy.deleteContactForNamedItemInNamedAuthority(parentspecifier,
- itemspecifier, csid);
- }
-
}
package org.collectionspace.services.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.QueryParam;
-import javax.ws.rs.core.Response;
-import org.collectionspace.services.common.query.IQueryManager;
-import org.collectionspace.services.common.authorityref.AuthorityRefDocList;
import org.collectionspace.services.common.authorityref.AuthorityRefList;
-import org.collectionspace.services.contact.ContactsCommonList;
import org.collectionspace.services.organization.OrgauthoritiesCommonList;
import org.collectionspace.services.organization.OrganizationsCommonList;
-//import org.collectionspace.services.person.PersonsCommonList;
+import org.collectionspace.services.person.PersonauthoritiesCommonList;
import org.jboss.resteasy.client.ClientResponse;
/**
@Path(OrgAuthorityClient.SERVICE_PATH + "/")
@Produces({"application/xml"})
@Consumes({"application/xml"})
-public interface OrgAuthorityProxy extends CollectionSpaceProxy { //FIXME: REM - Most of the methods in this class and PersonAuthorityProxy are the same and should be moved to a base class
-
+public interface OrgAuthorityProxy extends AuthorityWithContactsProxy<OrganizationsCommonList> {
// List OrgAuthorities
@GET
ClientResponse<OrgauthoritiesCommonList> readList();
-
- //(C)reate
- @POST
- ClientResponse<Response> create(byte[] xmlPayload);
-
- //(R)ead
- @GET
- @Path("/{csid}")
- ClientResponse<String> read(@PathParam("csid") String csid);
-
- //(R)ead by name
- @GET
- @Path("/urn:cspace:name({name})")
- ClientResponse<String> readByName(@PathParam("name") String name);
-
- //(U)pdate
- @PUT
- @Path("/{csid}")
- ClientResponse<String> update(@PathParam("csid") String csid, byte[] xmlPayload);
-
- //(D)elete
- @DELETE
- @Path("/{csid}")
- ClientResponse<Response> delete(@PathParam("csid") String csid);
-
- // List Items with options for matching a partial term or keywords.
- @GET
- @Produces("application/xml")
+
+ /*
+ * List results that must be overridden for the RESTEasy proxy generation to work correctly.
+ */
+
+ // List Items matching a partial term or keywords.
+ @Override
+ @GET
+ @Produces({"application/xml"})
@Path("/{csid}/items/")
- ClientResponse<OrganizationsCommonList>readItemList(
- @PathParam("csid") String parentcsid,
+ ClientResponse<OrganizationsCommonList> readItemList(
+ @PathParam("csid") String vcsid,
@QueryParam (IQueryManager.SEARCH_TYPE_PARTIALTERM) String partialTerm,
@QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords);
-
- /**
- * @param parentcsid
- * @param itemcsid
- * @param csid
- * @return
- * @see org.collectionspace.services.client.IntakeProxy#getAuthorityRefs(java.lang.String)
- */
- @GET
- @Path("{csid}/items/{itemcsid}/refObjs")
- @Produces("application/xml")
- ClientResponse<AuthorityRefDocList> getReferencingObjects(
- @PathParam("csid") String parentcsid,
- @PathParam("itemcsid") String itemcsid);
-
+
// List Items for a named authority matching a partial term or keywords.
- @GET
+ @Override
+ @GET
@Produces({"application/xml"})
@Path("/urn:cspace:name({specifier})/items/")
ClientResponse<OrganizationsCommonList> readItemListForNamedAuthority(
@PathParam("specifier") String specifier,
@QueryParam (IQueryManager.SEARCH_TYPE_PARTIALTERM) String partialTerm,
@QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords);
-
- // List Item Authority References
- @GET
- @Produces({"application/xml"})
- @Path("/{parentcsid}/items/{itemcsid}/authorityrefs/")
- public ClientResponse<AuthorityRefList> getItemAuthorityRefs(
- @PathParam("parentcsid") String parentcsid,
- @PathParam("itemcsid") String itemcsid);
-
- //(C)reate Item
- @POST
- @Path("/{vcsid}/items/")
- ClientResponse<Response> createItem(@PathParam("vcsid") String vcsid, byte[] xmlPayload);
-
- //(R)ead Item
- @GET
- @Path("/{vcsid}/items/{csid}")
- ClientResponse<String> readItem(@PathParam("vcsid") String vcsid, @PathParam("csid") String csid);
-
- //(R)ead Named Item
- @GET
- @Path("/{vcsid}/items/urn:cspace:name({specifier})")
- ClientResponse<String> readNamedItem(@PathParam("vcsid") String vcsid, @PathParam("specifier") String specifier);
-
- //(R)ead Item In Named Authority
- @GET
- @Path("/urn:cspace:name({specifier})/items/{csid}")
- ClientResponse<String> readItemInNamedAuthority(@PathParam("specifier") String specifier, @PathParam("csid") String csid);
-
- //(R)ead Named Item In Named Authority
- @GET
- @Path("/urn:cspace:name({specifier})/items/urn:cspace:name({itemspecifier})")
- ClientResponse<String> readNamedItemInNamedAuthority(@PathParam("specifier") String specifier, @PathParam("itemspecifier") String itemspecifier);
-
- //(U)pdate Item
- @PUT
- @Path("/{vcsid}/items/{csid}")
- ClientResponse<String> updateItem(@PathParam("vcsid") String vcsid, @PathParam("csid") String csid, byte[] xmlPayload);
-
- //(D)elete Item
- @DELETE
- @Path("/{vcsid}/items/{csid}")
- ClientResponse<Response> deleteItem(@PathParam("vcsid") String vcsid, @PathParam("csid") String csid);
-
- // List Contacts
- @GET
- @Produces({"application/xml"})
- @Path("/{parentcsid}/items/{itemcsid}/contacts/")
- ClientResponse<ContactsCommonList> readContactList(
- @PathParam("parentcsid") String parentcsid,
- @PathParam("itemcsid") String itemcsid);
- @GET
- @Produces({"application/xml"})
- @Path("/{parentcsid}/items/urn:cspace:name({itemspecifier})/contacts/")
- ClientResponse<ContactsCommonList> readContactListForNamedItem(
- @PathParam("parentcsid") String parentcsid,
- @PathParam("itemspecifier") String itemspecifier);
- @GET
- @Produces({"application/xml"})
- @Path("/urn:cspace:name({parentspecifier})/items/{itemcsid}/contacts/")
- ClientResponse<ContactsCommonList> readContactListForItemInNamedAuthority(
- @PathParam("parentspecifier") String parentspecifier,
- @PathParam("itemcsid") String itemcsid);
- @GET
- @Produces({"application/xml"})
- @Path("/urn:cspace:name({parentspecifier})/items/urn:cspace:name({itemspecifier})/contacts/")
- ClientResponse<ContactsCommonList> readContactListForNamedItemInNamedAuthority(
- @PathParam("parentspecifier") String parentspecifier,
- @PathParam("itemspecifier") String itemspecifier);
-
- //(C)reate Contact
- @POST
- @Path("/{parentcsid}/items/{itemcsid}/contacts/")
- ClientResponse<Response> createContact(
- @PathParam("parentcsid") String parentcsid,
- @PathParam("itemcsid") String itemcsid,
- byte[] xmlPayload);
- @POST
- @Path("/{parentcsid}/items/urn:cspace:name({itemspecifier})/contacts/")
- ClientResponse<Response> createContactForNamedItem(
- @PathParam("parentcsid") String parentcsid,
- @PathParam("itemspecifier") String itemspecifier,
- byte[] xmlPayload);
- @POST
- @Path("/urn:cspace:name({parentspecifier})/items/{itemcsid}/contacts/")
- ClientResponse<Response> createContactForItemInNamedAuthority(
- @PathParam("parentspecifier") String parentspecifier,
- @PathParam("itemcsid") String itemcsid,
- byte[] xmlPayload);
- @POST
- @Path("/urn:cspace:name({parentspecifier})/items/urn:cspace:name({itemspecifier})/contacts/")
- ClientResponse<Response> createContactForNamedItemInNamedAuthority(
- @PathParam("parentspecifier") String parentspecifier,
- @PathParam("itemspecifier") String itemspecifier,
- byte[] xmlPayload);
-
- //(R)ead Contact
- @GET
- @Path("/{parentcsid}/items/{itemcsid}/contacts/{csid}")
- ClientResponse<String> readContact(
- @PathParam("parentcsid") String parentcsid,
- @PathParam("itemcsid") String itemcsid,
- @PathParam("csid") String csid);
- @GET
- @Path("/{parentcsid}/items/urn:cspace:name({itemspecifier})/contacts/{csid}")
- ClientResponse<String> readContactForNamedItem(
- @PathParam("parentcsid") String parentcsid,
- @PathParam("itemspecifier") String itemspecifier,
- @PathParam("csid") String csid);
- @GET
- @Path("/urn:cspace:name({parentspecifier})/items/{itemcsid}/contacts/{csid}")
- ClientResponse<String> readContactInNamedAuthority(
- @PathParam("parentspecifier") String parentspecifier,
- @PathParam("itemcsid") String itemcsid,
- @PathParam("csid") String csid);
- @GET
- @Path("/urn:cspace:name({parentspecifier})/items/urn:cspace:name({itemspecifier})/contacts/{csid}")
- ClientResponse<String> readContactForNamedItemInNamedAuthority(
- @PathParam("parentspecifier") String parentspecifier,
- @PathParam("itemspecifier") String itemspecifier,
- @PathParam("csid") String csid);
-
- //(U)pdate Contact
- @PUT
- @Path("/{parentcsid}/items/{itemcsid}/contacts/{csid}")
- ClientResponse<String> updateContact(
- @PathParam("parentcsid") String parentcsid,
- @PathParam("itemcsid") String itemcsid,
- @PathParam("csid") String csid,
- byte[] xmlPayload);
- @PUT
- @Path("/{parentcsid}/items/urn:cspace:name({itemspecifier})/contacts/{csid}")
- ClientResponse<String> updateContactForNamedItem(
- @PathParam("parentcsid") String parentcsid,
- @PathParam("itemspecifier") String itemspecifier,
- @PathParam("csid") String csid,
- byte[] xmlPayload);
- @PUT
- @Path("/urn:cspace:name({parentspecifier})/items/{itemcsid}/contacts/{csid}")
- ClientResponse<String> updateContactInNamedAuthority(
- @PathParam("parentspecifier") String parentspecifier,
- @PathParam("itemcsid") String itemcsid,
- @PathParam("csid") String csid,
- byte[] xmlPayload);
- @PUT
- @Path("/urn:cspace:name({parentspecifier})/items/urn:cspace:name({itemspecifier})/contacts/{csid}")
- ClientResponse<String> updateContactForNamedItemInNamedAuthority(
- @PathParam("parentspecifier") String parentspecifier,
- @PathParam("itemspecifier") String itemspecifier,
- @PathParam("csid") String csid,
- byte[] xmlPayload);
-
- //(D)elete Contact
- @DELETE
- @Path("/{parentcsid}/items/{itemcsid}/contacts/{csid}")
- ClientResponse<Response> deleteContact(
- @PathParam("parentcsid") String parentcsid,
- @PathParam("itemcsid") String itemcsid,
- @PathParam("csid") String csid);
- @DELETE
- @Path("/{parentcsid}/items/urn:cspace:name({itemspecifier})/contacts/{csid}")
- ClientResponse<Response> deleteContactForNamedItem(
- @PathParam("parentcsid") String parentcsid,
- @PathParam("itemspecifier") String itemspecifier,
- @PathParam("csid") String csid);
- @DELETE
- @Path("/urn:cspace:name({parentspecifier})/items/{itemcsid}/contacts/{csid}")
- ClientResponse<Response> deleteContactInNamedAuthority(
- @PathParam("parentspecifier") String parentspecifier,
- @PathParam("itemcsid") String itemcsid,
- @PathParam("csid") String csid);
- @DELETE
- @Path("/urn:cspace:name({parentspecifier})/items/urn:cspace:name({itemspecifier})/contacts/{csid}")
- ClientResponse<Response> deleteContactForNamedItemInNamedAuthority(
- @PathParam("parentspecifier") String parentspecifier,
- @PathParam("itemspecifier") String itemspecifier,
- @PathParam("csid") String csid);
-
}
package org.collectionspace.services.client;
//import javax.ws.rs.PathParam;
-import javax.ws.rs.core.Response;
+import org.jboss.resteasy.client.ClientResponse;
-//import org.collectionspace.services.common.authorityref.AuthorityRefList;
-import org.collectionspace.services.common.authorityref.AuthorityRefDocList;
-import org.collectionspace.services.contact.ContactsCommonList;
import org.collectionspace.services.person.PersonauthoritiesCommonList;
import org.collectionspace.services.person.PersonsCommonList;
import org.collectionspace.services.client.PersonAuthorityProxy;
-import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.client.ProxyFactory;
-import org.jboss.resteasy.client.core.executors.ApacheHttpClientExecutor;
-import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
-import org.jboss.resteasy.spi.ResteasyProviderFactory;
-
/**
* The Class PersonAuthorityClient.
*/
-public class PersonAuthorityClient extends AbstractServiceClientImpl {
+public class PersonAuthorityClient extends AuthorityWithContactsClientImpl<PersonsCommonList, PersonAuthorityProxy> {
public static final String SERVICE_NAME = "personauthorities";
public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;
public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT;
return getCommonPartName(SERVICE_ITEM_NAME);
}
- /**
- *
- */
- private PersonAuthorityProxy personAuthorityProxy;
-
- /**
- * Instantiates a new person authority client.
- */
- public PersonAuthorityClient() {
- ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
- RegisterBuiltin.register(factory);
- setProxy();
- }
-
- /* (non-Javadoc)
- * @see org.collectionspace.services.client.CollectionSpaceClient#getProxy()
- */
- @Override
- public CollectionSpaceProxy getProxy() {
- return this.personAuthorityProxy;
- }
-
- /**
- * Sets the proxy.
- */
- public void setProxy() {
- if (useAuth()) {
- personAuthorityProxy = ProxyFactory.create(PersonAuthorityProxy.class,
- getBaseURL(), new ApacheHttpClientExecutor(getHttpClient()));
- } else {
- personAuthorityProxy = ProxyFactory.create(PersonAuthorityProxy.class,
- getBaseURL());
- }
- }
-
- /**
- * Read list.
- *
- * @return the client response
- */
-// public static PersonAuthorityClient getInstance() {
-// return instance;
-// }
-
- /**
- * @return list
- * @see org.collectionspace.services.client.PersonAuthorityProxy#readList()
- */
- public ClientResponse<PersonauthoritiesCommonList> readList() {
- return personAuthorityProxy.readList();
- }
-
- /**
- * Read.
- *
- * @param csid the csid
- * @return the client response
- */
- public ClientResponse<String> read(String csid) {
- return personAuthorityProxy.read(csid);
- }
-
- /**
- * Read by name.
- *
- * @param name the name
- * @return the client response
- */
- public ClientResponse<String> readByName(String name) {
- return personAuthorityProxy.readByName(name);
- }
-
- /**
- * Creates the.
- *
- * @param multipart the multipart
- * @return the client response
- */
- public ClientResponse<Response> create(PoxPayloadOut xmlPayload) {
- return personAuthorityProxy.create(xmlPayload.getBytes());
- }
-
- /**
- * Update.
- *
- * @param csid the csid
- * @param multipart the multipart
- * @return the client response
- */
- public ClientResponse<String> update(String csid, PoxPayloadOut xmlPayload) {
- return personAuthorityProxy.update(csid, xmlPayload.getBytes());
-
- }
-
- /**
- * Delete.
- *
- * @param csid the csid
- * @return the client response
- */
- public ClientResponse<Response> delete(String csid) {
- return personAuthorityProxy.delete(csid);
- }
-
- /**
- * Gets the referencing objects.
- *
- * @param parentcsid the parentcsid
- * @param csid the csid
- * @return the referencing objects
- */
- public ClientResponse<AuthorityRefDocList> getReferencingObjects(String parentcsid, String csid) {
- return personAuthorityProxy.getReferencingObjects(parentcsid, csid);
- }
-
- /**
- * Read item list, filtering by partial term match, or keywords. Only one of
- * partialTerm or keywords should be specified. If both are specified, keywords
- * will be ignored.
- *
- * @param inAuthority the parent authority
- * @param partialTerm A partial term on which to match,
- * which will filter list results to return only matched resources.
- * @param keywords A set of keywords on which to match,
- * which will filter list results to return only matched resources.
- * @return the client response
- */
- public ClientResponse<PersonsCommonList>
- readItemList(String inAuthority, String partialTerm, String keywords) {
- return personAuthorityProxy.readItemList(inAuthority, partialTerm, keywords);
- }
-
- /**
- * Read item list for named vocabulary, filtering by partial term match, or keywords. Only one of
- * partialTerm or keywords should be specified. If both are specified, keywords
- * will be ignored.
- *
- * @param specifier the specifier
- * @param partialTerm A partial term on which to match,
- * which will filter list results to return only matched resources.
- * @param keywords A set of keywords on which to match,
- * which will filter list results to return only matched resources.
- * @return the client response
- */
- public ClientResponse<PersonsCommonList>
- readItemListForNamedAuthority(String specifier, String partialTerm, String keywords) {
- return personAuthorityProxy.readItemListForNamedAuthority(specifier, partialTerm, keywords);
- }
-
- /**
- * Read item.
- *
- * @param vcsid the vcsid
- * @param csid the csid
- * @return the client response
- */
- public ClientResponse<String> readItem(String vcsid, String csid) {
- return personAuthorityProxy.readItem(vcsid, csid);
- }
-
- /**
- * Read named item.
- *
- * @param vcsid the vcsid
- * @param shortId the shortIdentifier
- * @return the client response
- */
- public ClientResponse<String> readNamedItem(String vcsid, String shortId) {
- return personAuthorityProxy.readNamedItem(vcsid, shortId);
- }
-
- /**
- * Read item in Named Authority.
- *
- * @param authShortId the shortIdentifier for the Authority
- * @param csid the csid
- * @return the client response
- */
- public ClientResponse<String> readItemInNamedAuthority(String authShortId, String csid) {
- return personAuthorityProxy.readItemInNamedAuthority(authShortId, csid);
- }
-
- /**
- * Read named item in Named Authority.
- *
- * @param authShortId the shortIdentifier for the Authority
- * @param itemShortId the shortIdentifier for the item
- * @return the client response
- */
- public ClientResponse<String> readNamedItemInNamedAuthority(String authShortId, String itemShortId) {
- return personAuthorityProxy.readNamedItemInNamedAuthority(authShortId, itemShortId);
- }
-
- /**
- * Creates the item.
- *
- * @param vcsid the vcsid
- * @param multipart the multipart
- * @return the client response
- */
- public ClientResponse<Response> createItem(String vcsid, PoxPayloadOut xmlPayload) {
- return personAuthorityProxy.createItem(vcsid, xmlPayload.getBytes());
- }
-
- /**
- * Update item.
- *
- * @param vcsid the vcsid
- * @param csid the csid
- * @param multipart the multipart
- * @return the client response
- */
- public ClientResponse<String> updateItem(String vcsid, String csid, PoxPayloadOut xmlPayload) {
- return personAuthorityProxy.updateItem(vcsid, csid, xmlPayload.getBytes());
-
- }
-
- /**
- * Delete item.
- *
- * @param vcsid the vcsid
- * @param csid the csid
- * @return the client response
- */
- public ClientResponse<Response> deleteItem(String vcsid, String csid) {
- return personAuthorityProxy.deleteItem(vcsid, csid);
- }
-
- /***************************************************************************
- *
- * Contact sub-resource interfaces
- *
- ***************************************************************************/
-
- /**
- * Creates the contact.
- *
- * @param parentcsid the parentcsid
- * @param itemcsid the itemcsid
- * @param multipart the multipart
- * @return the client response
- */
- public ClientResponse<Response> createContact(String parentcsid,
- String itemcsid, PoxPayloadOut xmlPayload) {
- return personAuthorityProxy.createContact(parentcsid, itemcsid, xmlPayload.getBytes());
- }
-
- /**
- * Creates the contact.
- *
- * @param parentcsid
- * @param itemspecifier (shortIdentifier)
- * @param multipart
- * @return the client response
- */
- public ClientResponse<Response> createContactForNamedItem(
- String parentcsid,
- String itemspecifier,
- PoxPayloadOut xmlPayload) {
- return personAuthorityProxy.createContactForNamedItem(parentcsid, itemspecifier, xmlPayload.getBytes());
- }
- /**
- * Creates the contact.
- *
- * @param parentspecifier (shortIdentifier)
- * @param itemcsid
- * @param multipart
- * @return the client response
- */
- public ClientResponse<Response> createContactForItemInNamedAuthority(
- String parentspecifier,
- String itemcsid,
- PoxPayloadOut xmlPayload) {
- return personAuthorityProxy.createContactForItemInNamedAuthority(parentspecifier,
- itemcsid, xmlPayload.getBytes());
- }
- /**
- * Creates the contact.
- *
- * @param parentspecifier (shortIdentifier)
- * @param itemspecifier (shortIdentifier)
- * @param multipart
- * @return the client response
- */
- public ClientResponse<Response> createContactForNamedItemInNamedAuthority(
- String parentspecifier,
- String itemspecifier,
- PoxPayloadOut xmlPayload) {
- return personAuthorityProxy.createContactForNamedItemInNamedAuthority(parentspecifier, itemspecifier,
- xmlPayload.getBytes());
- }
-
- /**
- * Read contact.
- *
- * @param parentcsid the parentcsid
- * @param itemcsid the itemcsid
- * @param csid the csid
- * @return the client response
- */
- public ClientResponse<String> readContact(String parentcsid,
- String itemcsid, String csid) {
- return personAuthorityProxy.readContact(parentcsid, itemcsid, csid);
- }
-
- /**
- * Read contact.
- *
- * @param parentcsid
- * @param itemspecifier (shortIdentifier)
- * @param csid
- * @return the client response
- */
- public ClientResponse<String> readContactForNamedItem(
- String parentcsid,
- String itemspecifier,
- String csid){
- return personAuthorityProxy.readContactForNamedItem(parentcsid, itemspecifier, csid);
- }
-
- /**
- * Read contact.
- *
- * @param parentspecifier (shortIdentifier)
- * @param itemcsid
- * @param csid
- * @return the client response
- */
- public ClientResponse<String> readContactInNamedAuthority(
- String parentspecifier,
- String itemcsid,
- String csid){
- return personAuthorityProxy.readContactInNamedAuthority(parentspecifier, itemcsid, csid);
- }
-
- /**
- * Read contact.
- *
- * @param parentspecifier (shortIdentifier)
- * @param itemspecifier (shortIdentifier)
- * @param csid
- * @return the client response
- */
- public ClientResponse<String> readContactForNamedItemInNamedAuthority(
- String parentspecifier,
- String itemspecifier,
- String csid){
- return personAuthorityProxy.readContactForNamedItemInNamedAuthority(parentspecifier, itemspecifier, csid);
- }
-
-
- /**
- * Read contact list.
- *
- * @param parentcsid the parentcsid
- * @param itemcsid the itemcsid
- * @return the client response
- */
- public ClientResponse<ContactsCommonList> readContactList(String parentcsid,
- String itemcsid) {
- return personAuthorityProxy.readContactList(parentcsid, itemcsid);
- }
-
- /**
- * Read contact list.
- *
- * @param parentcsid
- * @param itemspecifier (shortIdentifier)
- * @return the client response
- */
- public ClientResponse<ContactsCommonList> readContactListForNamedItem(
- String parentcsid,
- String itemspecifier){
- return personAuthorityProxy.readContactList(parentcsid, itemspecifier);
- }
-
- /**
- * Read contact list.
- *
- * @param parentspecifier (shortIdentifier)
- * @param itemcsid
- * @return the client response
- */
- public ClientResponse<ContactsCommonList> readContactListForItemInNamedAuthority(
- String parentspecifier,
- String itemcsid){
- return personAuthorityProxy.readContactList(parentspecifier, itemcsid);
- }
-
- /**
- * Read contact list.
- *
- * @param parentspecifier (shortIdentifier)
- * @param itemspecifier (shortIdentifier)
- * @return the client response
- */
- public ClientResponse<ContactsCommonList> readContactListForNamedItemInNamedAuthority(
- String parentspecifier,
- String itemspecifier){
- return personAuthorityProxy.readContactList(parentspecifier, itemspecifier);
- }
-
-
- /**
- * Update contact.
- *
- * @param parentcsid the parentcsid
- * @param itemcsid the itemcsid
- * @param csid the csid
- * @param multipart the multipart
- * @return the client response
- */
- public ClientResponse<String> updateContact(String parentcsid,
- String itemcsid, String csid, PoxPayloadOut xmlPayload) {
- return personAuthorityProxy.updateContact(parentcsid, itemcsid, csid, xmlPayload.getBytes());
- }
-
- /**
- * Update contact.
- *
- * @param parentcsid the parentcsid
- * @param itemspecifier (shortIdentifier)
- * @param csid the csid
- * @param multipart the multipart
- * @return the client response
- */
- public ClientResponse<String> updateContactForNamedItem(
- String parentcsid,
- String itemspecifier,
- String csid,
- PoxPayloadOut xmlPayload) {
- return personAuthorityProxy.updateContactForNamedItem(parentcsid, itemspecifier, csid, xmlPayload.getBytes());
- }
-
- /**
- * Update contact.
- *
- * @param parentspecifier (shortIdentifier)
- * @param itemcsid the itemcsid
- * @param csid the csid
- * @param multipart the multipart
- * @return the client response
- */
- public ClientResponse<String> updateContactInNamedAuthority(
- String parentspecifier,
- String itemcsid,
- String csid,
- PoxPayloadOut xmlPayload) {
- return personAuthorityProxy.updateContactInNamedAuthority(parentspecifier, itemcsid, csid, xmlPayload.getBytes());
- }
-
- /**
- * Update contact.
- *
- * @param parentspecifier (shortIdentifier)
- * @param itemspecifier (shortIdentifier)
- * @param csid the csid
- * @param multipart the multipart
- * @return the client response
- */
- public ClientResponse<String> updateContactForNamedItemInNamedAuthority(
- String parentspecifier,
- String itemspecifier,
- String csid,
- PoxPayloadOut xmlPayload) {
- return personAuthorityProxy.updateContactForNamedItemInNamedAuthority(parentspecifier, itemspecifier, csid,
- xmlPayload.getBytes());
- }
-
-
- /**
- * Delete contact.
- *
- * @param parentcsid the parentcsid
- * @param itemcsid the itemcsid
- * @param csid the csid
- * @return the client response
- */
- public ClientResponse<Response> deleteContact(String parentcsid,
- String itemcsid, String csid) {
- return personAuthorityProxy.deleteContact(parentcsid,
- itemcsid, csid);
- }
+ @Override
+ public Class<PersonAuthorityProxy> getProxyClass() {
+ return PersonAuthorityProxy.class;
+ }
- /**
- * Delete contact.
- *
- * @param parentcsid the parentcsid
- * @param itemspecifier (shortIdentifier)
- * @param csid the csid
- * @return the client response
- */
- public ClientResponse<Response> deleteContactForNamedItem(
- String parentcsid,
- String itemspecifier,
- String csid) {
- return personAuthorityProxy.deleteContactForNamedItem(parentcsid,
- itemspecifier, csid);
- }
-
- /**
- * Delete contact.
- *
- * @param parentspecifier (shortIdentifier)
- * @param itemcsid the itemcsid
- * @param csid the csid
- * @return the client response
- */
- public ClientResponse<Response> deleteContactInNamedAuthority(
- String parentspecifier,
- String itemcsid,
- String csid) {
- return personAuthorityProxy.deleteContactInNamedAuthority(parentspecifier,
- itemcsid, csid);
- }
-
- /**
- * Delete contact.
- *
- * @param parentspecifier (shortIdentifier)
- * @param itemspecifier (shortIdentifier)
- * @param csid the csid
- * @return the client response
+ /*
+ * Proxied service call methods
*/
- public ClientResponse<Response> deleteContactForNamedItemInNamedAuthority(
- String parentspecifier,
- String itemspecifier,
- String csid) {
- return personAuthorityProxy.deleteContactForNamedItemInNamedAuthority(parentspecifier,
- itemspecifier, csid);
+
+ public ClientResponse<PersonauthoritiesCommonList> readList() {
+ return getProxy().readList();
}
-
}
package org.collectionspace.services.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.QueryParam;
-import javax.ws.rs.Encoded;
-import javax.ws.rs.core.Response;
-import org.collectionspace.services.common.authorityref.AuthorityRefDocList;
-import org.collectionspace.services.common.query.IQueryManager;
-import org.collectionspace.services.contact.ContactsCommonList;
import org.collectionspace.services.person.PersonauthoritiesCommonList;
import org.collectionspace.services.person.PersonsCommonList;
import org.jboss.resteasy.client.ClientResponse;
-//import org.jboss.resteasy.plugins.providers.multipart.PoxPayloadOut;
/**
* @version $Revision:$
@Path(PersonAuthorityClient.SERVICE_PATH + "/")
@Produces({"application/xml"})
@Consumes({"application/xml"})
-public interface PersonAuthorityProxy extends CollectionSpaceProxy {
+public interface PersonAuthorityProxy extends AuthorityWithContactsProxy<PersonsCommonList> {
// List Personauthorities
@GET
ClientResponse<PersonauthoritiesCommonList> readList();
- //(C)reate
- @POST
- ClientResponse<Response> create(byte[] xmlPayload);
-
- //(R)ead
- @GET
- @Path("/{csid}")
- ClientResponse<String> read(@PathParam("csid") String csid);
-
- //(R)ead by name
- @GET
- @Path("/urn:cspace:name({name})")
- ClientResponse<String> readByName(@PathParam("name") String name);
-
- //(U)pdate
- @PUT
- @Path("/{csid}")
- ClientResponse<String> update(@PathParam("csid") String csid, byte[] xmlPayload);
-
- //(D)elete
- @DELETE
- @Path("/{csid}")
- ClientResponse<Response> delete(@PathParam("csid") String csid);
-
- // List Items with options for matching a partial term or keywords.
- @GET
- @Produces("application/xml")
- @Path("/{csid}/items/")
- ClientResponse<PersonsCommonList>readItemList(
- @PathParam("csid") String parentcsid,
- @QueryParam (IQueryManager.SEARCH_TYPE_PARTIALTERM) @Encoded String partialTerm,
- @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) @Encoded String keywords);
-
- /**
- * @param parentcsid
- * @param itemcsid
- * @param csid
- * @return
- * @see org.collectionspace.services.client.IntakeProxy#getAuthorityRefs(java.lang.String)
+ /*
+ * List results that must be overridden for the RESTEasy proxy generation to work correctly.
*/
- @GET
- @Path("{csid}/items/{itemcsid}/refObjs")
- @Produces("application/xml")
- ClientResponse<AuthorityRefDocList> getReferencingObjects(
- @PathParam("csid") String parentcsid,
- @PathParam("itemcsid") String itemcsid);
-
+
+ // List Items matching a partial term or keywords.
+ @Override
+ @GET
+ @Produces({"application/xml"})
+ @Path("/{csid}/items/")
+ ClientResponse<PersonsCommonList> readItemList(
+ @PathParam("csid") String vcsid,
+ @QueryParam (IQueryManager.SEARCH_TYPE_PARTIALTERM) String partialTerm,
+ @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords);
+
// List Items for a named authority matching a partial term or keywords.
- @GET
+ @Override
+ @GET
@Produces({"application/xml"})
@Path("/urn:cspace:name({specifier})/items/")
ClientResponse<PersonsCommonList> readItemListForNamedAuthority(
@PathParam("specifier") String specifier,
@QueryParam (IQueryManager.SEARCH_TYPE_PARTIALTERM) String partialTerm,
@QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords);
-
- //(C)reate Item
- @POST
- @Path("/{vcsid}/items/")
- ClientResponse<Response> createItem(@PathParam("vcsid") String vcsid, byte[] xmlPayload);
-
- //(R)ead Item
- @GET
- @Path("/{vcsid}/items/{csid}")
- ClientResponse<String> readItem(@PathParam("vcsid") String vcsid, @PathParam("csid") String csid);
-
- //(R)ead Named Item
- @GET
- @Path("/{vcsid}/items/urn:cspace:name({specifier})")
- ClientResponse<String> readNamedItem(@PathParam("vcsid") String vcsid, @PathParam("specifier") String specifier);
-
- //(R)ead Item In Named Authority
- @GET
- @Path("/urn:cspace:name({specifier})/items/{csid}")
- ClientResponse<String> readItemInNamedAuthority(@PathParam("specifier") String specifier, @PathParam("csid") String csid);
-
- //(R)ead Named Item In Named Authority
- @GET
- @Path("/urn:cspace:name({specifier})/items/urn:cspace:name({itemspecifier})")
- ClientResponse<String> readNamedItemInNamedAuthority(@PathParam("specifier") String specifier, @PathParam("itemspecifier") String itemspecifier);
-
- //(U)pdate Item
- @PUT
- @Path("/{vcsid}/items/{csid}")
- ClientResponse<String> updateItem(@PathParam("vcsid") String vcsid, @PathParam("csid") String csid, byte[] xmlPayload);
-
- //(D)elete Item
- @DELETE
- @Path("/{vcsid}/items/{csid}")
- ClientResponse<Response> deleteItem(@PathParam("vcsid") String vcsid, @PathParam("csid") String csid);
-
- // List Contacts
- @GET
- @Produces({"application/xml"})
- @Path("/{parentcsid}/items/{itemcsid}/contacts/")
- ClientResponse<ContactsCommonList> readContactList(
- @PathParam("parentcsid") String parentcsid,
- @PathParam("itemcsid") String itemcsid);
- @GET
- @Produces({"application/xml"})
- @Path("/{parentcsid}/items/urn:cspace:name({itemspecifier})/contacts/")
- ClientResponse<ContactsCommonList> readContactListForNamedItem(
- @PathParam("parentcsid") String parentcsid,
- @PathParam("itemspecifier") String itemspecifier);
- @GET
- @Produces({"application/xml"})
- @Path("/urn:cspace:name({parentspecifier})/items/{itemcsid}/contacts/")
- ClientResponse<ContactsCommonList> readContactListForItemInNamedAuthority(
- @PathParam("parentspecifier") String parentspecifier,
- @PathParam("itemcsid") String itemcsid);
- @GET
- @Produces({"application/xml"})
- @Path("/urn:cspace:name({parentspecifier})/items/urn:cspace:name({itemspecifier})/contacts/")
- ClientResponse<ContactsCommonList> readContactListForNamedItemInNamedAuthority(
- @PathParam("parentspecifier") String parentspecifier,
- @PathParam("itemspecifier") String itemspecifier);
-
- //(C)reate Contact
- @POST
- @Path("/{parentcsid}/items/{itemcsid}/contacts/")
- ClientResponse<Response> createContact(
- @PathParam("parentcsid") String parentcsid,
- @PathParam("itemcsid") String itemcsid,
- byte[] xmlPayload);
- @POST
- @Path("/{parentcsid}/items/urn:cspace:name({itemspecifier})/contacts/")
- ClientResponse<Response> createContactForNamedItem(
- @PathParam("parentcsid") String parentcsid,
- @PathParam("itemspecifier") String itemspecifier,
- byte[] xmlPayload);
- @POST
- @Path("/urn:cspace:name({parentspecifier})/items/{itemcsid}/contacts/")
- ClientResponse<Response> createContactForItemInNamedAuthority(
- @PathParam("parentspecifier") String parentspecifier,
- @PathParam("itemcsid") String itemcsid,
- byte[] xmlPayload);
- @POST
- @Path("/urn:cspace:name({parentspecifier})/items/urn:cspace:name({itemspecifier})/contacts/")
- ClientResponse<Response> createContactForNamedItemInNamedAuthority(
- @PathParam("parentspecifier") String parentspecifier,
- @PathParam("itemspecifier") String itemspecifier,
- byte[] xmlPayload);
-
- //(R)ead Contact
- @GET
- @Path("/{parentcsid}/items/{itemcsid}/contacts/{csid}")
- ClientResponse<String> readContact(
- @PathParam("parentcsid") String parentcsid,
- @PathParam("itemcsid") String itemcsid,
- @PathParam("csid") String csid);
- @GET
- @Path("/{parentcsid}/items/urn:cspace:name({itemspecifier})/contacts/{csid}")
- ClientResponse<String> readContactForNamedItem(
- @PathParam("parentcsid") String parentcsid,
- @PathParam("itemspecifier") String itemspecifier,
- @PathParam("csid") String csid);
- @GET
- @Path("/urn:cspace:name({parentspecifier})/items/{itemcsid}/contacts/{csid}")
- ClientResponse<String> readContactInNamedAuthority(
- @PathParam("parentspecifier") String parentspecifier,
- @PathParam("itemcsid") String itemcsid,
- @PathParam("csid") String csid);
- @GET
- @Path("/urn:cspace:name({parentspecifier})/items/urn:cspace:name({itemspecifier})/contacts/{csid}")
- ClientResponse<String> readContactForNamedItemInNamedAuthority(
- @PathParam("parentspecifier") String parentspecifier,
- @PathParam("itemspecifier") String itemspecifier,
- @PathParam("csid") String csid);
-
- //(U)pdate Contact
- @PUT
- @Path("/{parentcsid}/items/{itemcsid}/contacts/{csid}")
- ClientResponse<String> updateContact(
- @PathParam("parentcsid") String parentcsid,
- @PathParam("itemcsid") String itemcsid,
- @PathParam("csid") String csid,
- byte[] xmlPayload);
- @PUT
- @Path("/{parentcsid}/items/urn:cspace:name({itemspecifier})/contacts/{csid}")
- ClientResponse<String> updateContactForNamedItem(
- @PathParam("parentcsid") String parentcsid,
- @PathParam("itemspecifier") String itemspecifier,
- @PathParam("csid") String csid,
- byte[] xmlPayload);
- @PUT
- @Path("/urn:cspace:name({parentspecifier})/items/{itemcsid}/contacts/{csid}")
- ClientResponse<String> updateContactInNamedAuthority(
- @PathParam("parentspecifier") String parentspecifier,
- @PathParam("itemcsid") String itemcsid,
- @PathParam("csid") String csid,
- byte[] xmlPayload);
- @PUT
- @Path("/urn:cspace:name({parentspecifier})/items/urn:cspace:name({itemspecifier})/contacts/{csid}")
- ClientResponse<String> updateContactForNamedItemInNamedAuthority(
- @PathParam("parentspecifier") String parentspecifier,
- @PathParam("itemspecifier") String itemspecifier,
- @PathParam("csid") String csid,
- byte[] xmlPayload);
-
- //(D)elete Contact
- @DELETE
- @Path("/{parentcsid}/items/{itemcsid}/contacts/{csid}")
- ClientResponse<Response> deleteContact(
- @PathParam("parentcsid") String parentcsid,
- @PathParam("itemcsid") String itemcsid,
- @PathParam("csid") String csid);
-
- @DELETE
- @Path("/{parentcsid}/items/urn:cspace:name({itemspecifier})/contacts/{csid}")
- ClientResponse<Response> deleteContactForNamedItem(
- @PathParam("parentcsid") String parentcsid,
- @PathParam("itemspecifier") String itemspecifier,
- @PathParam("csid") String csid);
- @DELETE
- @Path("/urn:cspace:name({parentspecifier})/items/{itemcsid}/contacts/{csid}")
- ClientResponse<Response> deleteContactInNamedAuthority(
- @PathParam("parentspecifier") String parentspecifier,
- @PathParam("itemcsid") String itemcsid,
- @PathParam("csid") String csid);
-
- @DELETE
- @Path("/urn:cspace:name({parentspecifier})/items/urn:cspace:name({itemspecifier})/contacts/{csid}")
- ClientResponse<Response> deleteContactForNamedItemInNamedAuthority(
- @PathParam("parentspecifier") String parentspecifier,
- @PathParam("itemspecifier") String itemspecifier,
- @PathParam("csid") String csid);
}
<module>report</module>
<module>dimension</module>
<module>contact</module>
+ <module>workflow</module>
<module>JaxRsServiceProvider</module>
<!--module>sdk</module-->
<module>IntegrationTests</module>
*/
package org.collectionspace.services.client;
-import javax.ws.rs.core.Response;
-
-//import org.collectionspace.services.common.context.ServiceContext;
+import org.jboss.resteasy.client.ClientResponse;
import org.collectionspace.services.relation.RelationsCommonList;
-import org.jboss.resteasy.client.ProxyFactory;
-import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
-import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.client.core.executors.ApacheHttpClientExecutor;
-import org.jboss.resteasy.spi.ResteasyProviderFactory;
/**
* The Class RelationClient.
*/
-public class RelationClient extends AbstractServiceClientImpl {
+public class RelationClient extends AbstractPoxServiceClientImpl<RelationProxy> {
public static final String SERVICE_NAME = "relations";
public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;
public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT;
return SERVICE_PATH_COMPONENT;
}
- /** The relation proxy. */
- private RelationProxy relationProxy;
-
- /**
- * Instantiates a new relation client.
- */
- public RelationClient() {
- ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
- RegisterBuiltin.register(factory);
- setProxy();
- }
-
- @Override
- public CollectionSpaceProxy getProxy() {
- return this.relationProxy;
- }
-
- /**
- * Sets the proxy.
- */
@Override
- public void setProxy() {
- if (useAuth()) {
- relationProxy = ProxyFactory.create(RelationProxy.class,
- getBaseURL(), new ApacheHttpClientExecutor(getHttpClient()));
- } else {
- relationProxy = ProxyFactory.create(RelationProxy.class,
- getBaseURL());
- }
+ public Class<RelationProxy> getProxyClass() {
+ return RelationProxy.class;
}
+ /*
+ * Proxied service calls
+ */
+
/**
* Read list.
*
* @return the client response
*/
public ClientResponse<RelationsCommonList> readList() {
- return relationProxy.readList();
+ return getProxy().readList();
}
/**
String predicate,
String objectCsid,
String objectType) {
- return relationProxy.readList(subjectCsid, subjectType, predicate, objectCsid, objectType);
+ return getProxy().readList(subjectCsid, subjectType, predicate, objectCsid, objectType);
}
public ClientResponse<RelationsCommonList> readList(String subjectCsid,
String sortBy,
Long pageSize,
Long pageNumber) {
- return relationProxy.readList(subjectCsid, subjectType, predicate, objectCsid, objectType, sortBy, pageSize, pageNumber);
+ return getProxy().readList(subjectCsid, subjectType, predicate, objectCsid, objectType, sortBy, pageSize, pageNumber);
}
-
-
- /**
- * Read.
- *
- * @param csid the csid
- * @return the client response
- */
- public ClientResponse<String> read(String csid) {
- return relationProxy.read(csid);
- }
-
- /**
- * Creates the.
- *
- * @param multipart the multipart
- * @return the client response
- */
- public ClientResponse<Response> create(PoxPayloadOut multipart) {
- return relationProxy.create(multipart.getBytes());
- }
-
- /**
- * Update.
- *
- * @param csid the csid
- * @param multipart the multipart
- * @return the client response
- */
- public ClientResponse<String> update(String csid,
- PoxPayloadOut multipart) {
- return relationProxy.update(csid, multipart.getBytes());
- }
-
- /**
- * Delete.
- *
- * @param csid the csid
- * @return the client response
- */
- public ClientResponse<Response> delete(String csid) {
- return relationProxy.delete(csid);
- }
}
package org.collectionspace.services.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.services.relation.RelationsCommonList;
import org.collectionspace.services.common.relation.IRelationsManager;
import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
-import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
import javax.ws.rs.QueryParam;
/**
@Path("/relations/")
@Produces({"application/xml"})
@Consumes({"application/xml"})
-public interface RelationProxy extends CollectionSpaceProxy {
+public interface RelationProxy extends CollectionSpacePoxProxy {
@GET
@Produces({"application/xml"})
@QueryParam(IClientQueryParams.SORT_BY_PARAM) String sortBy,
@QueryParam(IClientQueryParams.PAGE_SIZE_PARAM) Long pageSize,
@QueryParam(IClientQueryParams.START_PAGE_PARAM) Long pageNumber);
-
- //(C)reate
- @POST
- ClientResponse<Response> create(byte[] payload);
-
- //(R)ead
- @GET
- @Path("/{csid}")
- ClientResponse<String> read(@PathParam("csid") String csid);
-
- //(U)pdate
- @PUT
- @Path("/{csid}")
- ClientResponse<String> update(@PathParam("csid") String csid, byte[] payload);
-
- //(D)elete
- @DELETE
- @Path("/{csid}")
- ClientResponse<Response> delete(@PathParam("csid") String csid);
}
import javax.ws.rs.core.UriBuilder;
import javax.ws.rs.core.UriInfo;
+import org.collectionspace.services.client.IQueryManager;
import org.collectionspace.services.client.PoxPayloadIn;
import org.collectionspace.services.client.PoxPayloadOut;
-import org.collectionspace.services.common.query.IQueryManager;
+//import org.collectionspace.services.common.query.IQueryManager;
import org.collectionspace.services.common.relation.IRelationsManager;
import org.collectionspace.services.common.relation.nuxeo.RelationsUtils;
import org.collectionspace.services.common.AbstractMultiPartCollectionSpaceResourceImpl;
*/
package org.collectionspace.services.client;
-import javax.ws.rs.core.Response;
-
-import org.collectionspace.services.common.authorityref.AuthorityRefList;
//import org.collectionspace.services.common.context.ServiceContext;
import org.collectionspace.services.report.ReportsCommonList;
-
-import org.jboss.resteasy.client.ProxyFactory;
-import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.client.core.executors.ApacheHttpClientExecutor;
-import org.jboss.resteasy.spi.ResteasyProviderFactory;
/**
* A ReportClient.
* @version $Revision:$
* FIXME: http://issues.collectionspace.org/browse/CSPACE-1684
*/
-public class ReportClient extends AbstractServiceClientImpl {
+public class ReportClient extends AbstractPoxServiceClientImpl<ReportProxy> {
- private ReportProxy reportProxy;
public static final String SERVICE_NAME = "reports";
public static final String SERVICE_PATH_COMPONENT = "reports";
- /**
- *
- * Default constructor for ReportClient class.
- *
- */
- public ReportClient() {
- ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
- RegisterBuiltin.register(factory);
- setProxy();
- }
-
@Override
public String getServiceName() {
return SERVICE_NAME;
}
- /* (non-Javadoc)
- * @see org.collectionspace.services.client.AbstractServiceClientImpl#getServicePathComponent()
- */
- public String getServicePathComponent() {
- return SERVICE_PATH_COMPONENT;
- }
-
-
@Override
- public CollectionSpaceProxy getProxy() {
- return this.reportProxy;
- }
-
- /**
- * allow to reset proxy as per security needs
- */
- public void setProxy() {
- if (useAuth()) {
- reportProxy = ProxyFactory.create(ReportProxy.class,
- getBaseURL(), new ApacheHttpClientExecutor(getHttpClient()));
- } else {
- reportProxy = ProxyFactory.create(ReportProxy.class,
- getBaseURL());
- }
+ public String getServicePathComponent() {
+ return SERVICE_PATH_COMPONENT;
}
+ @Override
+ public Class<ReportProxy> getProxyClass() {
+ return ReportProxy.class;
+ }
+
+ /*
+ * Proxied service calls.
+ */
+
/**
* @return
* @see org.collectionspace.services.client.ReportProxy#getReport()
*/
public ClientResponse<ReportsCommonList> readList() {
- return reportProxy.readList();
+ return getProxy().readList();
}
- /**
- * @param csid
- * @return
- * @see org.collectionspace.services.client.ReportProxy#getAuthorityRefs(java.lang.String)
- */
- public ClientResponse<AuthorityRefList> getAuthorityRefs(String csid) {
- return reportProxy.getAuthorityRefs(csid);
- }
-
-
- /**
- * @param csid
- * @return
- * @see org.collectionspace.services.client.ReportProxy#getReport(java.lang.String)
- */
- public ClientResponse<String> read(String csid) {
- return reportProxy.read(csid);
- }
-
- /**
- * @param report
- * @return
- * @see org.collectionspace.services.client.ReportProxy#createReport(org.collectionspace.hello.Report)
- */
- public ClientResponse<Response> create(PoxPayloadOut multipart) {
- return reportProxy.create(multipart.getBytes());
- }
-
- /**
- * @param csid
- * @param report
- * @return
- * @see org.collectionspace.services.client.ReportProxy#updateReport(java.lang.Long, org.collectionspace.hello.Report)
- */
- public ClientResponse<String> update(String csid, PoxPayloadOut multipart) {
- return reportProxy.update(csid, multipart.getBytes());
- }
-
- /**
- * @param csid
- * @return
- * @see org.collectionspace.services.client.ReportProxy#deleteReport(java.lang.Long)
- */
- public ClientResponse<Response> delete(String csid) {
- return reportProxy.delete(csid);
- }
-
-
}
package org.collectionspace.services.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.services.common.authorityref.AuthorityRefList;
import org.collectionspace.services.report.ReportsCommonList;
-import org.collectionspace.services.person.PersonsCommonList;
import org.jboss.resteasy.client.ClientResponse;
/**
@Path("/reports/")
@Produces({"application/xml;charset=UTF-8"})
@Consumes({"application/xml"})
-public interface ReportProxy extends CollectionSpaceProxy {
-
+public interface ReportProxy extends CollectionSpacePoxProxy {
/**
* Read list.
*
@GET
@Produces({"application/xml"})
ClientResponse<ReportsCommonList> readList();
-
- //(C)reate
- /**
- * Creates the.
- *
- * @param multipart the multipart
- * @return the client response
- */
- @POST
- ClientResponse<Response> create(byte[] payload);
-
- //(R)ead
- /**
- * Read.
- *
- * @param csid the csid
- * @return the client response
- */
- @GET
- @Path("/{csid}")
- ClientResponse<String> read(@PathParam("csid") String csid);
-
- //(U)pdate
- /**
- * Update.
- *
- * @param csid the csid
- * @param multipart the multipart
- * @return the client response
- */
- @PUT
- @Path("/{csid}")
- ClientResponse<String> update(@PathParam("csid") String csid, byte[] payload);
-
- //(D)elete
- /**
- * Delete.
- *
- * @param csid the csid
- * @return the client response
- */
- @DELETE
- @Path("/{csid}")
- ClientResponse<Response> delete(@PathParam("csid") String csid);
-
- // List Items
- /**
- * Gets the authority refs.
- *
- * @param csid the csid
- * @return the authority refs
- */
- @GET
- @Produces({"application/xml"})
- @Path("/{csid}/authorityrefs/")
- ClientResponse<AuthorityRefList> getAuthorityRefs(@PathParam("csid") String csid);
-
}
import net.sf.jasperreports.engine.JasperPrint;
import org.collectionspace.services.ReportJAXBSchema;
+import org.collectionspace.services.client.IQueryManager;
import org.collectionspace.services.client.PoxPayloadIn;
import org.collectionspace.services.client.PoxPayloadOut;
import org.collectionspace.services.common.AbstractMultiPartCollectionSpaceResourceImpl;
import org.collectionspace.services.common.document.DocumentHandler;
import org.collectionspace.services.common.document.DocumentNotFoundException;
import org.collectionspace.services.common.document.DocumentWrapper;
-import org.collectionspace.services.common.query.IQueryManager;
import org.collectionspace.services.common.query.QueryManager;
import org.collectionspace.services.common.security.UnauthorizedException;
import org.collectionspace.services.common.vocabulary.AuthorityItemJAXBSchema;
*/
package org.collectionspace.services.client;
-import javax.ws.rs.core.Response;
+import org.jboss.resteasy.client.ClientResponse;
import org.collectionspace.services.vocabulary.VocabulariesCommonList;
import org.collectionspace.services.vocabulary.VocabularyitemsCommonList;
import org.collectionspace.services.client.VocabularyProxy;
-import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.client.ProxyFactory;
-import org.jboss.resteasy.client.core.executors.ApacheHttpClientExecutor;
-import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
-import org.jboss.resteasy.spi.ResteasyProviderFactory;
-
/**
* The Class VocabularyClient.
*/
-public class VocabularyClient extends AbstractServiceClientImpl {
+public class VocabularyClient extends AuthorityClientImpl<VocabularyitemsCommonList, VocabularyProxy> {
public static final String SERVICE_NAME = "vocabularies";
public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;
public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT;
return SERVICE_NAME;
}
- /* (non-Javadoc)
- * @see org.collectionspace.services.client.BaseServiceClient#getServicePathComponent()
- */
@Override
public String getServicePathComponent() {
return SERVICE_PATH_COMPONENT;
return SERVICE_PAYLOAD_NAME;
}
+ @Override
+ public Class<VocabularyProxy> getProxyClass() {
+ return VocabularyProxy.class;
+ }
+
/**
* Gets the item common part name.
*
return getCommonPartName(SERVICE_ITEM_PAYLOAD_NAME);
}
- /** The Constant instance. */ //FIXME: This is wrong. There should not be a static instance of the client.
-// private static final VocabularyClient instance = new VocabularyClient();
-
- /** The vocabulary proxy. */
- private VocabularyProxy vocabularyProxy;
-
- /**
- * Instantiates a new vocabulary client.
- */
- public VocabularyClient() {
- ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
- RegisterBuiltin.register(factory);
- setProxy();
- }
-
- /* (non-Javadoc)
- * @see org.collectionspace.services.client.CollectionSpaceClient#getProxy()
+ /*
+ * Service calls
*/
- @Override
- public CollectionSpaceProxy getProxy() {
- return this.vocabularyProxy;
- }
-
- /**
- * Sets the proxy.
- */
- public void setProxy() {
- if (useAuth()) {
- vocabularyProxy = ProxyFactory.create(VocabularyProxy.class, getBaseURL(),
- new ApacheHttpClientExecutor(getHttpClient()));
- } else {
- vocabularyProxy = ProxyFactory.create(VocabularyProxy.class, getBaseURL());
- }
- }
-
- /**
- * Gets the single instance of VocabularyClient.
- *
- * @return single instance of VocabularyClient //FIXME: This is wrong. There should not be a static instance of the client.
- */
-// public static VocabularyClient getInstance() {
-// return instance;
-// }
-
+
/**
* Read list.
*
* @return the client response
*/
public ClientResponse<VocabulariesCommonList> readList() {
- return vocabularyProxy.readList();
- }
-
- /**
- * Read.
- *
- * @param csid the csid
- * @return the client response
- */
- public ClientResponse<String> read(String csid) {
- return vocabularyProxy.read(csid);
- }
-
- /**
- * Read by name.
- *
- * @param name the name
- * @return the client response
- */
- public ClientResponse<String> readByName(String name) {
- return vocabularyProxy.readByName(name);
- }
-
- /**
- * Creates the.
- *
- * @param multipart the multipart
- * @return the client response
- */
- public ClientResponse<Response> create(PoxPayloadOut poxPayloadout) {
- return vocabularyProxy.create(poxPayloadout.getBytes());
- }
-
- /**
- * Update.
- *
- * @param csid the csid
- * @param multipart the multipart
- * @return the client response
- */
- public ClientResponse<String> update(String csid, PoxPayloadOut poxPayloadout) {
- return vocabularyProxy.update(csid, poxPayloadout.getBytes());
-
- }
-
- /**
- * Delete.
- *
- * @param csid the csid
- * @return the client response
- */
- public ClientResponse<Response> delete(String csid) {
- return vocabularyProxy.delete(csid);
- }
-
- /**
- * Read item list, filtering by partial term match, or keywords. Only one of
- * partialTerm or keywords should be specified. If both are specified, keywords
- * will be ignored.
- *
- * @param inAuthority the parent authority
- * @param partialTerm A partial term on which to match,
- * which will filter list results to return only matched resources.
- * @param keywords A set of keywords on which to match,
- * which will filter list results to return only matched resources.
- * @return the client response
- */
- public ClientResponse<VocabularyitemsCommonList>
- readItemList(String inAuthority, String partialTerm, String keywords) {
- return vocabularyProxy.readItemList(inAuthority, partialTerm, keywords);
- }
-
- /**
- * Read item list for named vocabulary, filtering by partial term match, or keywords. Only one of
- * partialTerm or keywords should be specified. If both are specified, keywords
- * will be ignored.
- *
- * @param specifier the specifier
- * @param partialTerm A partial term on which to match,
- * which will filter list results to return only matched resources.
- * @param keywords A set of keywords on which to match,
- * which will filter list results to return only matched resources.
- * @return the client response
- */
- public ClientResponse<VocabularyitemsCommonList>
- readItemListForNamedVocabulary(String specifier, String partialTerm, String keywords) {
- return vocabularyProxy.readItemListForNamedVocabulary(specifier, partialTerm, keywords);
- }
-
- /**
- * Read item.
- *
- * @param vcsid the vcsid
- * @param csid the csid
- * @return the client response
- */
- public ClientResponse<String> readItem(String vcsid, String csid) {
- return vocabularyProxy.readItem(vcsid, csid);
- }
-
- /**
- * Creates the item.
- *
- * @param vcsid the vcsid
- * @param multipart the multipart
- * @return the client response
- */
- public ClientResponse<Response> createItem(String vcsid, PoxPayloadOut poxPayloadOut) {
- String xmlPayload = poxPayloadOut.toXML();
- return vocabularyProxy.createItem(vcsid, xmlPayload);
- }
-
- /**
- * Update item.
- *
- * @param vcsid the vcsid
- * @param csid the csid
- * @param multipart the multipart
- * @return the client response
- */
- public ClientResponse<String> updateItem(String vcsid, String csid, PoxPayloadOut poxPayloadOut) {
- String xmlPayload = poxPayloadOut.toXML();
- return vocabularyProxy.updateItem(vcsid, csid, xmlPayload);
- }
-
- /**
- * Delete item.
- *
- * @param vcsid the vcsid
- * @param csid the csid
- * @return the client response
- */
- public ClientResponse<Response> deleteItem(String vcsid, String csid) {
- return vocabularyProxy.deleteItem(vcsid, csid);
+ return getProxy().readList();
}
}
package org.collectionspace.services.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.QueryParam;
-//import javax.ws.rs.core.Context;
-import javax.ws.rs.core.Response;
-//import javax.ws.rs.core.UriInfo;
-import org.collectionspace.services.common.query.IQueryManager;
import org.collectionspace.services.vocabulary.VocabulariesCommonList;
import org.collectionspace.services.vocabulary.VocabularyitemsCommonList;
import org.jboss.resteasy.client.ClientResponse;
/**
* @version $Revision:$
*/
-//@Path("/vocabularies/")
@Path("/" + VocabularyClient.SERVICE_PATH_COMPONENT + "/")
@Produces({"application/xml"})
@Consumes({"application/xml"})
-public interface VocabularyProxy extends CollectionSpaceProxy {
-
+public interface VocabularyProxy extends AuthorityProxy<VocabularyitemsCommonList> {
// List Vocabularies
@GET
@Produces({"application/xml"})
ClientResponse<VocabulariesCommonList> readList();
-
- //(C)reate
- @POST
- ClientResponse<Response> create(byte[] xmlPayload);
-
- //(R)ead
- @GET
- @Path("/{csid}")
- ClientResponse<String> read(@PathParam("csid") String csid);
-
- //(R)ead by name
- @GET
- @Path("/urn:cspace:name({name})")
- ClientResponse<String> readByName(@PathParam("name") String name);
-
- //(U)pdate
- @PUT
- @Path("/{csid}")
- ClientResponse<String> update(@PathParam("csid") String csid, byte[] xmlPayload);
-
- //(D)elete
- @DELETE
- @Path("/{csid}")
- ClientResponse<Response> delete(@PathParam("csid") String csid);
-
+
+ /*
+ * List results that must be overridden for the RESTEasy proxy generation to work correctly.
+ */
+
// List Items matching a partial term or keywords.
- @GET
+ @Override
+ @GET
@Produces({"application/xml"})
- @Path("/{vcsid}/items/")
+ @Path("/{csid}/items/")
ClientResponse<VocabularyitemsCommonList> readItemList(
- @PathParam("vcsid") String vcsid,
+ @PathParam("csid") String vcsid,
@QueryParam (IQueryManager.SEARCH_TYPE_PARTIALTERM) String partialTerm,
@QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords);
// List Items for a named authority matching a partial term or keywords.
- @GET
+ @Override
+ @GET
@Produces({"application/xml"})
- @Path("/urn:cspace:name({specifier})/items")
- ClientResponse<VocabularyitemsCommonList> readItemListForNamedVocabulary(
+ @Path("/urn:cspace:name({specifier})/items/")
+ ClientResponse<VocabularyitemsCommonList> readItemListForNamedAuthority(
@PathParam("specifier") String specifier,
@QueryParam (IQueryManager.SEARCH_TYPE_PARTIALTERM) String partialTerm,
@QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords);
-
- //(C)reate Item
- @POST
- @Path("/{vcsid}/items/")
- ClientResponse<Response> createItem(@PathParam("vcsid") String vcsid, String xmlPayload);
-
- //(R)ead
- @GET
- @Path("/{vcsid}/items/{csid}")
- ClientResponse<String> readItem(@PathParam("vcsid") String vcsid, @PathParam("csid") String csid);
-
- //(U)pdate
- @PUT
- @Path("/{vcsid}/items/{csid}")
- ClientResponse<String> updateItem(@PathParam("vcsid") String vcsid, @PathParam("csid") String csid, String xmlPayload);
-
- //(D)elete
- @DELETE
- @Path("/{vcsid}/items/{csid}")
- ClientResponse<Response> deleteItem(@PathParam("vcsid") String vcsid, @PathParam("csid") String csid);
}
if (vcsid != null) {
res = client.readItemList(vcsid, null, null);
} else if (shortId != null) {
- res = client.readItemListForNamedVocabulary(shortId, null, null);
+ res = client.readItemListForNamedAuthority(shortId, null, null);
} else {
Assert.fail("Internal Error: readItemList both vcsid and shortId are null!");
}
--- /dev/null
+
+<project name="workflow.3rdparty" default="package" basedir=".">
+ <description>
+ workflow service 3rdparty
+ </description>
+ <!-- set global properties for this build -->
+ <property name="services.trunk" value="../../.."/>
+ <!-- environment should be declared before reading build.properties -->
+ <property environment="env" />
+ <property file="${services.trunk}/build.properties" />
+ <property name="mvn.opts" value="" />
+ <property name="src" location="src"/>
+
+ <condition property="osfamily-unix">
+ <os family="unix" />
+ </condition>
+ <condition property="osfamily-windows">
+ <os family="windows" />
+ </condition>
+
+ <target name="init" >
+ <!-- Create the time stamp -->
+ <tstamp/>
+ </target>
+
+ <target name="package" depends="package-unix,package-windows"
+ description="Package CollectionSpace Services" />
+ <target name="package-unix" if="osfamily-unix">
+ <exec executable="mvn" failonerror="true">
+ <arg value="package" />
+ <arg value="-Dmaven.test.skip=true" />
+ <arg value="-f" />
+ <arg value="${basedir}/pom.xml" />
+ <arg value="-N" />
+ <arg value="${mvn.opts}" />
+ </exec>
+ </target>
+ <target name="package-windows" if="osfamily-windows">
+ <exec executable="cmd" failonerror="true">
+ <arg value="/c" />
+ <arg value="mvn.bat" />
+ <arg value="package" />
+ <arg value="-Dmaven.test.skip=true" />
+ <arg value="-f" />
+ <arg value="${basedir}/pom.xml" />
+ <arg value="-N" />
+ <arg value="${mvn.opts}" />
+ </exec>
+ </target>
+
+ <target name="install" depends="install-unix,install-windows"
+ description="Install" />
+ <target name="install-unix" if="osfamily-unix">
+ <exec executable="mvn" failonerror="true">
+ <arg value="install" />
+ <arg value="-Dmaven.test.skip=true" />
+ <arg value="-f" />
+ <arg value="${basedir}/pom.xml" />
+ <arg value="-N" />
+ <arg value="${mvn.opts}" />
+ </exec>
+ </target>
+ <target name="install-windows" if="osfamily-windows">
+ <exec executable="cmd" failonerror="true">
+ <arg value="/c" />
+ <arg value="mvn.bat" />
+ <arg value="install" />
+ <arg value="-Dmaven.test.skip=true" />
+ <arg value="-f" />
+ <arg value="${basedir}/pom.xml" />
+ <arg value="-N" />
+ <arg value="${mvn.opts}" />
+ </exec>
+ </target>
+
+ <target name="clean" depends="clean-unix,clean-windows"
+ description="Delete target directories" >
+ <delete dir="${build}"/>
+ </target>
+ <target name="clean-unix" if="osfamily-unix">
+ <exec executable="mvn" failonerror="true">
+ <arg value="clean" />
+ <arg value="${mvn.opts}" />
+ </exec>
+ </target>
+ <target name="clean-windows" if="osfamily-windows">
+ <exec executable="cmd" failonerror="true">
+ <arg value="/c" />
+ <arg value="mvn.bat" />
+ <arg value="clean" />
+ <arg value="${mvn.opts}" />
+ </exec>
+ </target>
+
+ <target name="test" depends="test-unix,test-windows" description="Run tests" />
+ <target name="test-unix" if="osfamily-unix">
+ <exec executable="mvn" failonerror="true">
+ <arg value="test" />
+ <arg value="${mvn.opts}" />
+ </exec>
+ </target>
+ <target name="test-windows" if="osfamily-windows">
+ <exec executable="cmd" failonerror="true">
+ <arg value="/c" />
+ <arg value="mvn.bat" />
+ <arg value="test" />
+ <arg value="${mvn.opts}" />
+ </exec>
+ </target>
+
+ <target name="deploy" depends="install"
+ description="deploy workflow in ${jboss.server.nuxeo}">
+ <ant antfile="nuxeo-platform-cs-workflow/build.xml" target="deploy" inheritall="false"/>
+ </target>
+
+ <target name="undeploy"
+ description="undeploy workflow from ${jboss.server.nuxeo}">
+ <ant antfile="nuxeo-platform-cs-workflow/build.xml" target="undeploy" inheritall="false"/>
+ </target>
+
+ <target name="dist"
+ description="generate distribution for workflow" depends="package">
+ <ant antfile="nuxeo-platform-cs-workflow/build.xml" target="dist" inheritall="false"/>
+ </target>
+
+
+</project>
--- /dev/null
+
+<project name="nuxeo-platform-cs-workflow" default="package" basedir=".">
+ <description>
+ workflow nuxeo document type
+ </description>
+ <!-- set global properties for this build -->
+ <property name="services.trunk" value="../../../.."/>
+ <!-- environment should be declared before reading build.properties -->
+ <property environment="env" />
+ <property file="${services.trunk}/build.properties" />
+ <property name="mvn.opts" value="" />
+ <property name="src" location="src"/>
+ <property name="nuxeo.workflow.jar"
+ value="org.collectionspace.services.workflow.3rdparty.nuxeo-${cspace.release}.jar"/>
+ <property name="nuxeo.workflow.jars.all"
+ value="org.collectionspace.services.workflow.3rdparty.nuxeo-*.jar"/>
+
+ <condition property="osfamily-unix">
+ <os family="unix" />
+ </condition>
+ <condition property="osfamily-windows">
+ <os family="windows" />
+ </condition>
+
+ <target name="init" >
+ <!-- Create the time stamp -->
+ <tstamp/>
+ </target>
+
+ <target name="package" depends="package-unix,package-windows"
+ description="Package CollectionSpace Services" />
+ <target name="package-unix" if="osfamily-unix">
+ <exec executable="mvn" failonerror="true">
+ <arg value="package" />
+ <arg value="-Dmaven.test.skip=true" />
+ <arg value="-f" />
+ <arg value="${basedir}/pom.xml" />
+ <arg value="-N" />
+ <arg value="${mvn.opts}" />
+ </exec>
+ </target>
+ <target name="package-windows" if="osfamily-windows">
+ <exec executable="cmd" failonerror="true">
+ <arg value="/c" />
+ <arg value="mvn.bat" />
+ <arg value="package" />
+ <arg value="-Dmaven.test.skip=true" />
+ <arg value="-f" />
+ <arg value="${basedir}/pom.xml" />
+ <arg value="-N" />
+ <arg value="${mvn.opts}" />
+ </exec>
+ </target>
+
+ <target name="install" depends="install-unix,install-windows"
+ description="Install" />
+ <target name="install-unix" if="osfamily-unix">
+ <exec executable="mvn" failonerror="true">
+ <arg value="install" />
+ <arg value="-Dmaven.test.skip=true" />
+ <arg value="-f" />
+ <arg value="${basedir}/pom.xml" />
+ <arg value="-N" />
+ <arg value="${mvn.opts}" />
+ </exec>
+ </target>
+ <target name="install-windows" if="osfamily-windows">
+ <exec executable="cmd" failonerror="true">
+ <arg value="/c" />
+ <arg value="mvn.bat" />
+ <arg value="install" />
+ <arg value="-Dmaven.test.skip=true" />
+ <arg value="-f" />
+ <arg value="${basedir}/pom.xml" />
+ <arg value="-N" />
+ <arg value="${mvn.opts}" />
+ </exec>
+ </target>
+
+ <target name="clean" depends="clean-unix,clean-windows"
+ description="Delete target directories" >
+ <delete dir="${build}"/>
+ </target>
+ <target name="clean-unix" if="osfamily-unix">
+ <exec executable="mvn" failonerror="true">
+ <arg value="clean" />
+ <arg value="${mvn.opts}" />
+ </exec>
+ </target>
+ <target name="clean-windows" if="osfamily-windows">
+ <exec executable="cmd" failonerror="true">
+ <arg value="/c" />
+ <arg value="mvn.bat" />
+ <arg value="clean" />
+ <arg value="${mvn.opts}" />
+ </exec>
+ </target>
+
+ <target name="test" depends="test-unix,test-windows" description="Run tests" />
+ <target name="test-unix" if="osfamily-unix">
+ <exec executable="mvn" failonerror="true">
+ <arg value="test" />
+ <arg value="${mvn.opts}" />
+ </exec>
+ </target>
+ <target name="test-windows" if="osfamily-windows">
+ <exec executable="cmd" failonerror="true">
+ <arg value="/c" />
+ <arg value="mvn.bat" />
+ <arg value="test" />
+ <arg value="${mvn.opts}" />
+ </exec>
+ </target>
+
+ <target name="deploy" depends="install"
+ description="deploy workflow doctype in ${jboss.server.nuxeo}">
+ <copy file="${basedir}/target/${nuxeo.workflow.jar}"
+ todir="${jboss.deploy.nuxeo.plugins}"/>
+ </target>
+
+ <target name="undeploy"
+ description="undeploy workflow doctype from ${jboss.server.nuxeo}">
+ <delete>
+ <fileset dir="${jboss.deploy.nuxeo.plugins}">
+ <include name="${nuxeo.workflow.jars.all}"/>
+ </fileset>
+ <!-- Legacy deployment location through release 0.6 -->
+ <fileset dir="${jboss.deploy.nuxeo.system}">
+ <include name="${nuxeo.workflow.jars.all}"/>
+ </fileset>
+ </delete>
+ </target>
+
+
+ <target name="dist"
+ description="generate distribution for workflow doctype" depends="package">
+ <copy todir="${services.trunk}/${dist.deploy.nuxeo.plugins}">
+ <fileset file="${basedir}/target/${nuxeo.workflow.jar}"/>
+ </copy>
+ </target>
+
+</project>
+
--- /dev/null
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.collectionspace.services</groupId>
+ <artifactId>org.collectionspace.services.workflow.3rdparty</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.collectionspace.services</groupId>
+ <artifactId>org.collectionspace.services.workflow.3rdparty.nuxeo</artifactId>
+ <name>services.workflow.3rdparty.nuxeo</name>
+ <packaging>jar</packaging>
+ <description>
+ Workflow Nuxeo Document Type
+ </description>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifestFile> src/main/resources/META-INF/MANIFEST.MF </manifestFile>
+ <manifestEntries>
+ <Bundle-Version>${eclipseVersion}</Bundle-Version>
+ <Bundle-ManifestVersion>2</Bundle-ManifestVersion>
+ </manifestEntries>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
--- /dev/null
+Manifest-Version: 1.0 \r
+Bundle-ManifestVersion: 1 \r
+Bundle-Name: NuxeoCS\r
+Bundle-SymbolicName: org.collectionspace.workflow;singleton:=true \r
+Bundle-Version: 1.0.0\r
+Bundle-Localization: plugin\r
+Bundle-Vendor: Nuxeo \r
+Require-Bundle: org.nuxeo.runtime, \r
+ org.nuxeo.ecm.core.api, \r
+ org.nuxeo.ecm.core,\r
+ org.nuxeo.ecm.core.api,\r
+ org.nuxeo.ecm.platform.types.api,\r
+ org.nuxeo.ecm.platform.versioning.api,\r
+ org.nuxeo.ecm.platform.ui,\r
+ org.nuxeo.ecm.platform.forms.layout.client,\r
+ org.nuxeo.ecm.platform.ws,\r
+ org.collectionspace.collectionspace_core\r
+Provide-Package: org.collectionspace.workflow\r
+Nuxeo-Component: OSGI-INF/core-types-contrib.xml,\r
+ OSGI-INF/ecm-types-contrib.xml,\r
+ OSGI-INF/layouts-contrib.xml\r
+\r
--- /dev/null
+<?xml version="1.0"?>
+<component name="org.collectionspace.workflow.coreTypes">
+ <extension target="org.nuxeo.ecm.core.schema.TypeService" point="schema">
+ <schema name="workflows_common" prefix="workflows_common" src="schemas/workflows_common.xsd"/>
+ </extension>
+</component>
--- /dev/null
+<?xml version="1.0"?>
+<fragment>
+
+ <extension target="application#MODULE">
+ <module>
+ <java>${bundle.fileName}</java>
+ </module>
+ </extension>
+
+</fragment>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
+\r
+<!--\r
+ Workflow schema (XSD)\r
+ \r
+ Entity : Workflow\r
+ Part : Common\r
+ Used for: Nuxeo EP core document type\r
+\r
+ $LastChangedRevision: 2316 $\r
+ $LastChangedDate: 2010-06-02 16:03:51 -0700 (Wed, 02 Jun 2010) $\r
+-->\r
+\r
+<xs:schema \r
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"\r
+ xmlns:ns="http://collectionspace.org/workflow/"\r
+ xmlns="http://collectionspace.org/workflow/"\r
+ targetNamespace="http://collectionspace.org/workflow/"\r
+ version="0.1">\r
+ <!-- Workflow Information Group -->\r
+ <xs:element name="lifeCyclePolicy" type="xs:string"/>\r
+ <xs:element name="currentLifeCycleState" type="xs:string"/>\r
+ <xs:element name="allowedStateTransitionList" type="stateTransitionList">\r
+ <xs:complexType>\r
+ <xs:sequence>\r
+ <xs:element name="stateTransition" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>\r
+ </xs:sequence>\r
+ </xs:complexType>\r
+ </xs:element>\r
+</xs:schema>\r
--- /dev/null
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>org.collectionspace.services.workflow</artifactId>
+ <groupId>org.collectionspace.services</groupId>
+ <version>1.6-SNAPSHOT</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.collectionspace.services</groupId>
+ <artifactId>org.collectionspace.services.workflow.3rdparty</artifactId>
+ <name>services.workflow.3rdparty</name>
+ <packaging>pom</packaging>
+
+ <description>
+ 3rd party build for workflow service
+ </description>
+
+ <modules>
+ <module>nuxeo-platform-cs-workflow</module>
+ </modules>
+</project>
--- /dev/null
+
+<project name="workflow" default="package" basedir=".">
+ <description>
+ workflow service
+ </description>
+ <!-- set global properties for this build -->
+ <property name="services.trunk" value="../.."/>
+ <!-- environment should be declared before reading build.properties -->
+ <property environment="env" />
+ <property file="${services.trunk}/build.properties" />
+ <property name="mvn.opts" value="" />
+ <property name="src" location="src"/>
+
+ <condition property="osfamily-unix">
+ <os family="unix" />
+ </condition>
+ <condition property="osfamily-windows">
+ <os family="windows" />
+ </condition>
+
+ <target name="package" depends="package-unix,package-windows"
+ description="Package CollectionSpace Services" />
+
+ <target name="package-unix" if="osfamily-unix">
+ <exec executable="mvn" failonerror="true">
+ <arg value="package" />
+ <arg value="-Dmaven.test.skip=true" />
+ <arg value="-f" />
+ <arg value="${basedir}/pom.xml" />
+ <arg value="-N" />
+ <arg value="${mvn.opts}" />
+ </exec>
+ </target>
+
+ <target name="package-windows" if="osfamily-windows">
+ <exec executable="cmd" failonerror="true">
+ <arg value="/c" />
+ <arg value="mvn.bat" />
+ <arg value="package" />
+ <arg value="-Dmaven.test.skip=true" />
+ <arg value="-f" />
+ <arg value="${basedir}/pom.xml" />
+ <arg value="-N" />
+ <arg value="${mvn.opts}" />
+ </exec>
+ </target>
+
+
+ <target name="install" depends="install-unix,install-windows"
+ description="Install" />
+ <target name="install-unix" if="osfamily-unix">
+ <exec executable="mvn" failonerror="true">
+ <arg value="install" />
+ <arg value="-Dmaven.test.skip=true" />
+ <arg value="-f" />
+ <arg value="${basedir}/pom.xml" />
+ <arg value="-N" />
+ <arg value="${mvn.opts}" />
+ </exec>
+ </target>
+ <target name="install-windows" if="osfamily-windows">
+ <exec executable="cmd" failonerror="true">
+ <arg value="/c" />
+ <arg value="mvn.bat" />
+ <arg value="install" />
+ <arg value="-Dmaven.test.skip=true" />
+ <arg value="-f" />
+ <arg value="${basedir}/pom.xml" />
+ <arg value="-N" />
+ <arg value="${mvn.opts}" />
+ </exec>
+ </target>
+
+ <target name="clean" depends="clean-unix,clean-windows"
+ description="Delete target directories" >
+ <delete dir="${build}"/>
+ </target>
+ <target name="clean-unix" if="osfamily-unix">
+ <exec executable="mvn" failonerror="true">
+ <arg value="clean" />
+ <arg value="${mvn.opts}" />
+ </exec>
+ </target>
+ <target name="clean-windows" if="osfamily-windows">
+ <exec executable="cmd" failonerror="true">
+ <arg value="/c" />
+ <arg value="mvn.bat" />
+ <arg value="clean" />
+ <arg value="${mvn.opts}" />
+ </exec>
+ </target>
+
+ <target name="test" depends="test-unix,test-windows" description="Run tests" />
+ <target name="test-unix" if="osfamily-unix">
+ <exec executable="mvn" failonerror="true">
+ <arg value="test" />
+ <arg value="${mvn.opts}" />
+ </exec>
+ </target>
+ <target name="test-windows" if="osfamily-windows">
+ <exec executable="cmd" failonerror="true">
+ <arg value="/c" />
+ <arg value="mvn.bat" />
+ <arg value="test" />
+ <arg value="${mvn.opts}" />
+ </exec>
+ </target>
+
+ <target name="deploy" depends="install"
+ description="deploy workflow service">
+ </target>
+
+ <target name="undeploy"
+ description="undeploy workflow service">
+ </target>
+
+ <target name="dist" depends="package"
+ description="distribute workflow service">
+ </target>
+
+</project>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.collectionspace.services</groupId>
+ <artifactId>org.collectionspace.services.workflow</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.collectionspace.services</groupId>
+ <artifactId>org.collectionspace.services.workflow.client</artifactId>
+ <name>services.workflow.client</name>
+
+ <dependencies>
+ <!-- keep slf4j dependencies on the top -->
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <scope>test</scope>
+ </dependency>
+<!-- CollectionSpace dependencies -->
+ <dependency>
+ <groupId>org.collectionspace.services</groupId>
+ <artifactId>org.collectionspace.services.jaxb</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.collectionspace.services</groupId>
+ <artifactId>org.collectionspace.services.common</artifactId>
+ <optional>true</optional>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.collectionspace.services</groupId>
+ <artifactId>org.collectionspace.services.client</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.collectionspace.services</groupId>
+ <artifactId>org.collectionspace.services.dimension.client</artifactId> <!-- Dimension instances are used as a unit-tests targets -->
+ <version>${project.version}</version>
+ </dependency>
+<!-- External dependencies -->
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <version>5.6</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>resteasy-jaxrs</artifactId>
+ <!-- filter out unwanted jars -->
+ <exclusions>
+ <exclusion>
+ <groupId>tjws</groupId>
+ <artifactId>webserver</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>resteasy-jaxb-provider</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>resteasy-multipart-provider</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ <version>3.1</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>collectionspace-services-workflow-client</finalName>
+ </build>
+</project>
--- /dev/null
+/**
+ * This document is a part of the source code and related artifacts
+ * for CollectionSpace, an open source collections management system
+ * for museums and related institutions:
+ *
+ * http://www.collectionspace.org
+ * http://wiki.collectionspace.org
+ *
+ * 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
+ *
+ * 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.
+ */
+package org.collectionspace.services.client.test;
+
+import java.util.List;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+import org.collectionspace.services.client.CollectionSpaceClient;
+import org.collectionspace.services.client.PayloadOutputPart;
+import org.collectionspace.services.client.PoxPayloadIn;
+import org.collectionspace.services.client.PoxPayloadOut;
+
+import org.collectionspace.services.jaxb.AbstractCommonList;
+import org.collectionspace.services.common.workflow.client.WorkflowClient;
+import org.collectionspace.services.workflow.WorkflowsCommon;
+import org.collectionspace.services.client.DimensionClient;
+import org.collectionspace.services.dimension.DimensionsCommon;
+
+import org.jboss.resteasy.client.ClientResponse;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * ObjectExitServiceTest, carries out tests against a deployed and running ObjectExit Service. <p/>
+ * $LastChangedRevision: $
+ * $LastChangedDate: $
+ */
+public class WorkflowServiceTest extends AbstractServiceTestImpl {
+
+ private final String CLASS_NAME = WorkflowServiceTest.class.getName();
+ private final Logger logger = LoggerFactory.getLogger(CLASS_NAME);
+ private String knownResourceId = null;
+
+ @Override
+ public String getServicePathComponent() {
+ return WorkflowClient.SERVICE_PATH_COMPONENT;
+ }
+
+ @Override
+ protected String getServiceName() {
+ return WorkflowClient.SERVICE_NAME;
+ }
+
+ @Override
+ protected CollectionSpaceClient getClientInstance() {
+ return new WorkflowClient();
+ }
+
+ @Override
+ protected AbstractCommonList getAbstractCommonList(ClientResponse<AbstractCommonList> response) {
+ return response.getEntity(AbstractCommonList.class);
+ }
+
+// @Override
+// @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class)
+// public void create(String testName) throws Exception {
+// logger.debug(testBanner(testName, CLASS_NAME));
+// setupCreate();
+// WorkflowClient client = new WorkflowClient();
+// PoxPayloadOut multipart = createObjectExitInstance(createIdentifier());
+// ClientResponse<Response> res = client.create(multipart);
+// assertStatusCode(res, testName);
+// if (knownResourceId == null) {
+// knownResourceId = extractId(res); // Store the ID returned from the first resource created for additional tests below.
+// logger.debug(testName + ": knownResourceId=" + knownResourceId);
+// }
+// allResourceIdsCreated.add(extractId(res)); // Store the IDs from every resource created by tests so they can be deleted after tests have been run.
+// }
+
+ /*
+ * Create a Dimension instance to use as our test target.
+ */
+ @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class)
+ public void createTestObject(String testName) throws Exception {
+ logger.debug(testBanner(testName, CLASS_NAME));
+ setupCreate();
+ DimensionClient client = new DimensionClient();
+ PoxPayloadOut multipart = createDimensionInstance(createIdentifier());
+ ClientResponse<Response> res = client.create(multipart);
+ assertStatusCode(res, testName);
+ if (knownResourceId == null) {
+ knownResourceId = extractId(res); // Store the ID returned from the first resource created for additional tests below.
+ logger.debug(testName + ": knownResourceId=" + knownResourceId);
+ }
+ allResourceIdsCreated.add(extractId(res)); // Store the IDs from every resource created by tests so they can be deleted after tests have been run.
+ }
+
+ @Override
+ public void createList(String testName) throws Exception {
+ //empty N/A
+ }
+
+ @Override
+ @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class, dependsOnMethods = {"createTestObject"})
+ public void read(String testName) throws Exception {
+ logger.debug(testBanner(testName, CLASS_NAME));
+ setupRead();
+ DimensionClient client = new DimensionClient();
+ ClientResponse<String> res = client.getWorkflow(knownResourceId);
+ assertStatusCode(res, testName);
+ PoxPayloadIn input = new PoxPayloadIn(res.getEntity());
+ WorkflowsCommon workflowsCommon = (WorkflowsCommon) extractPart(input, WorkflowClient.SERVICE_COMMONPART_NAME, WorkflowsCommon.class);
+ if (logger.isDebugEnabled() == true) {
+ logger.debug("Workflow payload is: " + input.getXmlPayload());
+ }
+ Assert.assertNotNull(workflowsCommon);
+ }
+
+// @Override
+// @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class, dependsOnMethods = {"createList", "read"})
+// public void readList(String testName) throws Exception {
+// logger.debug(testBanner(testName, CLASS_NAME));
+// setupReadList();
+// WorkflowClient client = new WorkflowClient();
+// ClientResponse<AbstractCommonList> res = client.readList();
+// AbstractCommonList list = res.getEntity();
+// assertStatusCode(res, testName);
+// if (logger.isDebugEnabled()) {
+// List<AbstractCommonList.ListItem> items =
+// list.getListItem();
+// int i = 0;
+// for(AbstractCommonList.ListItem item : items){
+// logger.debug(testName + ": list-item[" + i + "] " +
+// item.toString());
+// i++;
+// }
+// }
+// }
+
+ @Override
+// @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class, dependsOnMethods = {"read"})
+ public void update(String testName) throws Exception {
+ logger.debug(testBanner(testName, CLASS_NAME));
+ setupUpdate();
+ WorkflowClient client = new WorkflowClient();
+ ClientResponse<String> res = client.read(knownResourceId);
+ assertStatusCode(res, testName);
+ logger.debug("got object to update with ID: " + knownResourceId);
+ PoxPayloadIn input = new PoxPayloadIn(res.getEntity());
+ WorkflowsCommon objectexit = (WorkflowsCommon) extractPart(input, client.getCommonPartName(), WorkflowsCommon.class);
+ Assert.assertNotNull(objectexit);
+
+// objectexit.setExitNumber("updated-" + objectexit.getExitNumber());
+ logger.debug("Object to be updated:"+objectAsXmlString(objectexit, WorkflowsCommon.class));
+ PoxPayloadOut output = new PoxPayloadOut(WorkflowClient.SERVICE_PAYLOAD_NAME);
+ PayloadOutputPart commonPart = output.addPart(objectexit, MediaType.APPLICATION_XML_TYPE);
+ commonPart.setLabel(client.getCommonPartName());
+ res = client.update(knownResourceId, output);
+ assertStatusCode(res, testName);
+ input = new PoxPayloadIn(res.getEntity());
+ WorkflowsCommon updatedObjectExit = (WorkflowsCommon) extractPart(input, client.getCommonPartName(), WorkflowsCommon.class);
+ Assert.assertNotNull(updatedObjectExit);
+ }
+
+ @Override
+// @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class, dependsOnMethods = {"update", "testSubmitRequest"})
+ public void updateNonExistent(String testName) throws Exception {
+ logger.debug(testBanner(testName, CLASS_NAME));
+ setupUpdateNonExistent();
+ // Submit the request to the service and store the response.
+ // Note: The ID used in this 'create' call may be arbitrary.
+ // The only relevant ID may be the one used in update(), below.
+ WorkflowClient client = new WorkflowClient();
+ PoxPayloadOut multipart = createDimensionInstance(NON_EXISTENT_ID);
+ ClientResponse<String> res = client.update(NON_EXISTENT_ID, multipart);
+ assertStatusCode(res, testName);
+ }
+
+ @Override
+// @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class, dependsOnMethods = {"create", "readList", "testSubmitRequest", "update"})
+ public void delete(String testName) throws Exception {
+ logger.debug(testBanner(testName, CLASS_NAME));
+ setupDelete();
+ WorkflowClient client = new WorkflowClient();
+ ClientResponse<Response> res = client.delete(knownResourceId);
+ assertStatusCode(res, testName);
+ }
+
+ // ---------------------------------------------------------------
+ // Failure outcome tests : means we expect response to fail, but test to succeed
+ // ---------------------------------------------------------------
+
+ // Failure outcome
+ @Override
+// @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class, dependsOnMethods = {"read"})
+ public void readNonExistent(String testName) throws Exception {
+ logger.debug(testBanner(testName, CLASS_NAME));
+ setupReadNonExistent();
+ WorkflowClient client = new WorkflowClient();
+ ClientResponse<String> res = client.read(NON_EXISTENT_ID);
+ assertStatusCode(res, testName);
+ }
+
+ // Failure outcome
+ @Override
+// @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class, dependsOnMethods = {"delete"})
+ public void deleteNonExistent(String testName) throws Exception {
+ logger.debug(testBanner(testName, CLASS_NAME));
+ setupDeleteNonExistent();
+ WorkflowClient client = new WorkflowClient();
+ ClientResponse<Response> res = client.delete(NON_EXISTENT_ID);
+ assertStatusCode(res, testName);
+ }
+
+ // Failure outcomes
+ // Placeholders until the tests below can be implemented. See Issue CSPACE-401.
+
+ @Override
+ public void createWithEmptyEntityBody(String testName) throws Exception {
+ }
+
+ @Override
+ public void createWithMalformedXml(String testName) throws Exception {
+ }
+
+ @Override
+ public void createWithWrongXmlSchema(String testName) throws Exception {
+ }
+
+ @Override
+ public void updateWithEmptyEntityBody(String testName) throws Exception {
+ }
+
+ @Override
+ public void updateWithMalformedXml(String testName) throws Exception {
+ }
+
+ @Override
+ public void updateWithWrongXmlSchema(String testName) throws Exception {
+ }
+
+ // ---------------------------------------------------------------
+ // Utility tests : tests of code used in tests above
+ // ---------------------------------------------------------------
+
+// @Test(dependsOnMethods = {"create", "read"})
+ public void testSubmitRequest() {
+ final int EXPECTED_STATUS = Response.Status.OK.getStatusCode(); // Expected status code: 200 OK
+ String method = ServiceRequestType.READ.httpMethodName();
+ String url = getResourceURL(knownResourceId);
+ int statusCode = submitRequest(method, url);
+ logger.debug("testSubmitRequest: url=" + url + " status=" + statusCode);
+ Assert.assertEquals(statusCode, EXPECTED_STATUS);
+ }
+
+ // ---------------------------------------------------------------
+ // Utility methods used by tests above
+ // ---------------------------------------------------------------
+ private PoxPayloadOut createDimensionInstance(String dimensionValue) {
+ String value = "dimensionValue-" + dimensionValue;
+ String dimensionsCommonPartName = new DimensionClient().getCommonPartName();
+ DimensionsCommon dimensionsCommon = new DimensionsCommon();
+
+ dimensionsCommon.setValue(value);
+ PoxPayloadOut multipart = new PoxPayloadOut(DimensionClient.SERVICE_PAYLOAD_NAME);
+ PayloadOutputPart commonPart = multipart.addPart(dimensionsCommonPartName, dimensionsCommon);
+
+ if (logger.isDebugEnabled()) {
+ logger.debug("To be created, Dimensions common: " + commonPart.asXML());
+ logger.debug(objectAsXmlString(dimensionsCommon, DimensionsCommon.class));
+ }
+
+ return multipart;
+ }
+
+ @Override
+ public void create(String testName) throws Exception {
+ //empty N/A
+ }
+
+ @Override
+ public void readList(String testName) throws Exception {
+ //empty N/A
+ }
+
+ @Override
+ public void readPaginatedList(String testName) throws Exception {
+ //empty N/A
+ }
+
+}
--- /dev/null
+log4j.rootLogger=debug, stdout, R\r
+\r
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender\r
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout\r
+\r
+# Pattern to output the caller's file name and line number.\r
+log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
+\r
+log4j.appender.R=org.apache.log4j.RollingFileAppender\r
+log4j.appender.R.File=target/test-client.log\r
+\r
+log4j.appender.R.MaxFileSize=100KB\r
+# Keep one backup file\r
+log4j.appender.R.MaxBackupIndex=1\r
+\r
+log4j.appender.R.layout=org.apache.log4j.PatternLayout\r
+log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
+\r
+#packages\r
+log4j.logger.org.collectionspace=DEBUG\r
+log4j.logger.org.apache=INFO\r
+log4j.logger.httpclient=INFO\r
+log4j.logger.org.jboss.resteasy=INFO\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>org.collectionspace.services.workflow</artifactId>
+ <groupId>org.collectionspace.services</groupId>
+ <version>1.6-SNAPSHOT</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.collectionspace.services</groupId>
+ <artifactId>org.collectionspace.services.workflow.jaxb</artifactId>
+ <name>services.workflow.jaxb</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jvnet.jaxb2-commons</groupId>
+ <artifactId>property-listener-injector</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jvnet.jaxb2_commons</groupId>
+ <artifactId>runtime</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.collectionspace.services</groupId>
+ <artifactId>org.collectionspace.services.jaxb</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>collectionspace-services-workflow-jaxb</finalName>
+ <defaultGoal>install</defaultGoal>
+ <plugins>
+ <plugin>
+ <groupId>org.jvnet.jaxb2.maven2</groupId>
+ <artifactId>maven-jaxb2-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+</project>
+
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- A comment. -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.collectionspace.services</groupId>
+ <artifactId>org.collectionspace.services.main</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.collectionspace.services</groupId>
+ <artifactId>org.collectionspace.services.workflow</artifactId>
+ <name>services.workflow</name>
+ <packaging>pom</packaging>
+
+ <modules>
+ <module>3rdparty</module>
+ <module>client</module>
+ <module>service</module>
+ </modules>
+
+</project>
+
--- /dev/null
+<projectDescription>\r
+ <name>org.collectionspace.services.workflow.service</name>\r
+ <comment>NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment>\r
+ <projects>\r
+ <project>org.collectionspace.services.3rdparty.nuxeo.quote-api</project>\r
+ <project>org.collectionspace.services.client</project>\r
+ <project>org.collectionspace.services.common</project>\r
+ <project>org.collectionspace.services.hyperjaxb</project>\r
+ <project>org.collectionspace.services.jaxb</project>\r
+ </projects>\r
+ <buildSpec>\r
+ <buildCommand>\r
+ <name>org.eclipse.jdt.core.javabuilder</name>\r
+ </buildCommand>\r
+ <buildCommand>\r
+ <name>org.maven.ide.eclipse.maven2Builder</name>\r
+ </buildCommand>\r
+ </buildSpec>\r
+ <natures>\r
+ <nature>org.eclipse.jdt.core.javanature</nature>\r
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>\r
+ </natures>\r
+</projectDescription>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <parent>
+ <groupId>org.collectionspace.services</groupId>
+ <artifactId>org.collectionspace.services.workflow</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.collectionspace.services</groupId>
+ <artifactId>org.collectionspace.services.workflow.service</artifactId>
+ <name>services.workflow.service</name>
+ <packaging>jar</packaging>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.collectionspace.services</groupId>
+ <artifactId>org.collectionspace.services.common</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.collectionspace.services</groupId>
+ <artifactId>org.collectionspace.services.jaxb</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <!-- External dependencies -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <version>5.6</version>
+ </dependency>
+
+ <!-- javax -->
+
+ <dependency>
+ <groupId>javax.security</groupId>
+ <artifactId>jaas</artifactId>
+ <version>1.0.01</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>dom4j</groupId>
+ <artifactId>dom4j</artifactId>
+ <version>1.6.1</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- jboss -->
+
+ <dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>resteasy-jaxrs</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>tjws</groupId>
+ <artifactId>webserver</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>resteasy-jaxb-provider</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>resteasy-multipart-provider</artifactId>
+ </dependency>
+
+ <!-- nuxeo -->
+
+ <dependency>
+ <groupId>org.nuxeo.ecm.core</groupId>
+ <artifactId>nuxeo-core-api</artifactId>
+ <version>${nuxeo.core.version}</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>jboss-remoting</artifactId>
+ <groupId>jboss</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>collectionspace-services-workflow</finalName>
+ </build>
+</project>
+
--- /dev/null
+/**
+ * This document is a part of the source code and related artifacts
+ * for CollectionSpace, an open source collections management system
+ * for museums and related institutions:
+
+ * http://www.collectionspace.org
+ * http://wiki.collectionspace.org
+
+ * Copyright 2009 University of California at Berkeley
+
+ * 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
+
+ * 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.
+ */
+package org.collectionspace.services.workflow;
+
+import org.collectionspace.services.client.IQueryManager;
+import org.collectionspace.services.client.PoxPayloadIn;
+import org.collectionspace.services.client.PoxPayloadOut;
+import org.collectionspace.services.common.ResourceBase;
+import org.collectionspace.services.common.ServiceMessages;
+import org.collectionspace.services.common.context.ServiceContext;
+import org.collectionspace.services.jaxb.AbstractCommonList;
+import org.collectionspace.services.common.workflow.client.WorkflowClient;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+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.QueryParam;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.UriInfo;
+
+@Path(WorkflowClient.SERVICE_PATH)
+@Produces({"application/xml"})
+@Consumes({"application/xml"})
+public class WorkflowResource extends ResourceBase {
+
+ @Override
+ public String getServiceName(){
+ return WorkflowClient.SERVICE_NAME;
+ }
+
+ @Override
+ protected String getVersionString() {
+ final String lastChangeRevision = "$LastChangedRevision: 2108 $";
+ return lastChangeRevision;
+ }
+
+ @Override
+ //public Class<ObjectexitCommon> getCommonPartClass() {
+ public Class<?> getCommonPartClass() {
+ try {
+ return Class.forName("org.collectionspace.services.objectexit.WorkflowCommon");//.class;
+ } catch (ClassNotFoundException e){
+ return null;
+ }
+ }
+
+ /*
+ * HTTP Methods
+ */
+
+ @Override
+ @POST
+ public Response create(@Context UriInfo ui, String xmlPayload) {
+ Response response = Response.status(Response.Status.BAD_REQUEST)
+ .entity(ServiceMessages.POST_UNSUPPORTED).type("text/plain").build();
+ return response;
+ }
+
+ @Override
+ @DELETE
+ @Path("{csid}")
+ public Response delete(@PathParam("csid") String csid) {
+ Response response = Response.status(Response.Status.BAD_REQUEST)
+ .entity(ServiceMessages.DELETE_UNSUPPORTED).type("text/plain")
+ .build();
+ return response;
+ }
+
+
+ /* (non-Javadoc)
+ * @see org.collectionspace.services.common.ResourceBase#getList(javax.ws.rs.core.UriInfo, java.lang.String)
+ *
+ * The workflow sub-resource does not support a getList operation.
+ */
+ @Override
+ @GET
+ public AbstractCommonList getList(@Context UriInfo ui,
+ @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords) {
+ Response response = Response.status(Response.Status.BAD_REQUEST)
+ .entity(ServiceMessages.GET_LIST_UNSUPPORTED).type("text/plain")
+ .build();
+ throw new WebApplicationException(response);
+ }
+
+}
--- /dev/null
+package org.collectionspace.services.workflow.nuxeo;
+
+import org.collectionspace.services.client.PoxPayloadIn;
+import org.collectionspace.services.client.PoxPayloadOut;
+import org.collectionspace.services.common.document.InvalidDocumentException;
+import org.collectionspace.services.common.document.ValidatorHandlerImpl;
+import org.collectionspace.services.workflow.WorkflowsCommon;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class WorkflowValidatorHandler extends ValidatorHandlerImpl<PoxPayloadIn, PoxPayloadOut> {
+
+ /** The logger. */
+ private final Logger logger = LoggerFactory.getLogger(WorkflowValidatorHandler.class);
+
+ /** Error Messages **/
+ private static final String VALIDATION_ERROR = "The intake record payload was invalid. See log file for more details.";
+
+
+ @Override
+ protected Class<?> getCommonPartClass() {
+ return WorkflowsCommon.class;
+ }
+
+ @Override
+ protected void handleCreate() throws InvalidDocumentException {
+ try {
+ WorkflowsCommon intakesCommon = (WorkflowsCommon)getCommonPart();
+ assert(intakesCommon != null);
+ } catch (AssertionError e) {
+ if (logger.isErrorEnabled() == true) {
+ logger.error(e.getMessage(), e);
+ }
+ throw new InvalidDocumentException(VALIDATION_ERROR, e);
+ }
+ }
+
+ @Override
+ protected void handleGet() throws InvalidDocumentException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ protected void handleGetAll() throws InvalidDocumentException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ protected void handleUpdate() throws InvalidDocumentException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ protected void handleDelete() throws InvalidDocumentException {
+ // TODO Auto-generated method stub
+
+ }
+
+}
--- /dev/null
+package org.collectionspace.services.test;
+
+//import org.collectionspace.services.objectexit.ObjectExit;
+//import org.collectionspace.services.objectexit.ObjectexitList;
+
+/**
+ * Placeholder for server-side testing of Loan Out service code.
+ *
+ * @version $Revision: 2108 $
+ */
+public class WorkflowServiceTest {
+ //empty
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+
+ <appender name="console" class="org.apache.log4j.ConsoleAppender">
+ <param name="Target" value="System.out" />
+ <layout class="org.apache.log4j.TTCCLayout">
+ <param name="DateFormat" value="ISO8601" />
+ </layout>
+ </appender>
+
+
+ <appender name="unit-tests"
+ class="org.apache.log4j.RollingFileAppender">
+ <param name="File" value="./target/unit-tests.log" />
+ <param name="MaxFileSize" value="10240KB" />
+ <param name="MaxBackupIndex" value="6" />
+ <layout class="org.apache.log4j.TTCCLayout">
+ <param name="DateFormat" value="ISO8601" />
+ </layout>
+ </appender>
+
+ <logger name="org.apache.commons.httpclient" additivity="false">
+ <level value="warn" />
+ <appender-ref ref="console" />
+ <appender-ref ref="unit-tests" />
+ </logger>
+
+ <logger name="httpclient.wire" additivity="false">
+ <level value="info" />
+ <appender-ref ref="console" />
+ <appender-ref ref="unit-tests" />
+ </logger>
+
+ <root>
+ <priority value="debug" />
+ <appender-ref ref="console" />
+ <appender-ref ref="unit-tests" />
+ </root>
+
+</log4j:configuration>
+
+
+
+