From 599768159267fac471ea36f0b7e60576f40fd876 Mon Sep 17 00:00:00 2001 From: Richard Millet Date: Thu, 6 May 2010 08:09:02 +0000 Subject: [PATCH] CSPACE-1349, 1422, 1428, 1429, 1469, 1465, 1466, 1468, 1470, 1473: 1. Adding additional pagination tests to all Nuxeo based services. 2. Replacing .getAll() calls with .getFiltered 3. Removing dead/deprecated code in many http clients 4. Fixing file refs to test and config files to *not* assume current dir is in classpath. --- .../client/test/AccountRoleServiceTest.java | 2 +- .../services/client/AcquisitionClient.java | 8 +- .../acquisition/AcquisitionResource.java | 38 ++-- services/authorization/service/pom.xml | 4 + .../test/AbstractAuthorizationTestImpl.java | 11 +- .../test/AuthorizationSeedTest.java | 17 +- services/client/pom.xml | 4 + .../client/test/AbstractServiceTestImpl.java | 111 ++++++++-- .../services/client/test/BaseServiceTest.java | 3 + .../test/CollectionObjectServiceTest.java | 18 +- .../CollectionObjectResource.java | 15 +- .../context/AbstractServiceContextImpl.java | 40 ++-- .../java/RemoteDocumentModelHandlerImpl.java | 4 +- .../services/client/ContactClient.java | 8 +- .../services/contact/ContactResource.java | 8 +- .../services/client/DimensionClient.java | 8 +- .../client/test/DimensionServiceTest.java | 2 +- .../services/dimension/DimensionResource.java | 2 +- .../services/client/IntakeClient.java | 8 +- .../client/test/PersonAuthRefDocsTest.java | 6 +- .../services/intake/IntakeResource.java | 18 +- .../src/main/resources/AbstractCommonList.xsd | 5 +- .../services/client/LoaninClient.java | 8 +- .../client/test/LoaninAuthRefsTest.java | 27 +-- .../services/loanin/LoaninResource.java | 19 +- .../services/client/LoanoutClient.java | 8 +- .../client/test/LoanoutAuthRefsTest.java | 25 +-- .../services/loanout/LoanoutResource.java | 17 +- .../services/client/OrgAuthorityClient.java | 203 +++++++++++++----- .../client/PersonAuthorityClient.java | 196 ++++++++++++----- services/pom.xml | 4 + .../client/test/RelationServiceTest.java | 99 ++++++++- .../relation/NewRelationResource.java | 65 ++++-- .../services/client/VocabularyClient.java | 141 +++++++----- 34 files changed, 802 insertions(+), 350 deletions(-) diff --git a/services/account/client/src/test/java/org/collectionspace/services/account/client/test/AccountRoleServiceTest.java b/services/account/client/src/test/java/org/collectionspace/services/account/client/test/AccountRoleServiceTest.java index 0a893e675..569e537a0 100644 --- a/services/account/client/src/test/java/org/collectionspace/services/account/client/test/AccountRoleServiceTest.java +++ b/services/account/client/src/test/java/org/collectionspace/services/account/client/test/AccountRoleServiceTest.java @@ -181,9 +181,9 @@ public class AccountRoleServiceTest extends AbstractServiceTestImpl { } //to not cause uniqueness violation for accRole, createList is removed - @Override @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class, dependsOnMethods = {"create"}) + @Override public void createList(String testName) throws Exception { //FIXME: Should this test really be empty? If so, please comment accordingly. } diff --git a/services/acquisition/client/src/main/java/org/collectionspace/services/client/AcquisitionClient.java b/services/acquisition/client/src/main/java/org/collectionspace/services/client/AcquisitionClient.java index 358804ef7..4aedd2722 100644 --- a/services/acquisition/client/src/main/java/org/collectionspace/services/client/AcquisitionClient.java +++ b/services/acquisition/client/src/main/java/org/collectionspace/services/client/AcquisitionClient.java @@ -29,7 +29,7 @@ public class AcquisitionClient extends AbstractServiceClientImpl { /** * */ - private static final AcquisitionClient instance = new AcquisitionClient(); +// private static final AcquisitionClient instance = new AcquisitionClient(); /** * */ @@ -69,9 +69,9 @@ public class AcquisitionClient extends AbstractServiceClientImpl { * * @return */ - public static AcquisitionClient getInstance() { - return instance; - } +// public static AcquisitionClient getInstance() { +// return instance; +// } /** * @return diff --git a/services/acquisition/service/src/main/java/org/collectionspace/services/acquisition/AcquisitionResource.java b/services/acquisition/service/src/main/java/org/collectionspace/services/acquisition/AcquisitionResource.java index 5065ddb78..291a8b2f9 100644 --- a/services/acquisition/service/src/main/java/org/collectionspace/services/acquisition/AcquisitionResource.java +++ b/services/acquisition/service/src/main/java/org/collectionspace/services/acquisition/AcquisitionResource.java @@ -36,6 +36,7 @@ import javax.ws.rs.PathParam; import javax.ws.rs.QueryParam; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.Context; +import javax.ws.rs.core.MultivaluedMap; import javax.ws.rs.core.Response; import javax.ws.rs.core.UriBuilder; import javax.ws.rs.core.UriInfo; @@ -52,8 +53,7 @@ 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.RemoteDocumentModelHandlerImpl; +import org.collectionspace.services.nuxeo.client.java.DocumentModelHandler; import org.jboss.resteasy.plugins.providers.multipart.MultipartInput; import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput; import org.jboss.resteasy.util.HttpResponseCodes; @@ -223,10 +223,11 @@ public class AcquisitionResource public AcquisitionsCommonList getAcquisitionList(@Context UriInfo ui, @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords) { AcquisitionsCommonList result = null; + MultivaluedMap queryParams = ui.getQueryParameters(); if (keywords != null) { - result = searchAcquisitions(keywords); + result = searchAcquisitions(queryParams, keywords); } else { - result = getAcquisitionsList(); + result = getAcquisitionsList(queryParams); } return result; @@ -237,12 +238,12 @@ public class AcquisitionResource * * @return the acquisitions list */ - private AcquisitionsCommonList getAcquisitionsList() { + private AcquisitionsCommonList getAcquisitionsList(MultivaluedMap queryParams) { AcquisitionsCommonList acquisitionObjectList; try { - ServiceContext ctx = createServiceContext(); + ServiceContext ctx = createServiceContext(queryParams); DocumentHandler handler = createDocumentHandler(ctx); - getRepositoryClient(ctx).getAll(ctx, handler); + getRepositoryClient(ctx).getFiltered(ctx, handler); acquisitionObjectList = (AcquisitionsCommonList) handler.getCommonPartList(); } catch (UnauthorizedException ue) { Response response = Response.status( @@ -366,9 +367,11 @@ public class AcquisitionResource @GET @Path("/search") @Produces("application/xml") + @Deprecated public AcquisitionsCommonList keywordsSearchAcquisitions(@Context UriInfo ui, @QueryParam (IQueryManager.SEARCH_TYPE_KEYWORDS) String keywords) { - return searchAcquisitions(keywords); + MultivaluedMap queryParams = ui.getQueryParameters(); + return searchAcquisitions(queryParams, keywords); } /** @@ -378,10 +381,12 @@ public class AcquisitionResource * * @return the acquisitions common list */ - private AcquisitionsCommonList searchAcquisitions(String keywords) { + private AcquisitionsCommonList searchAcquisitions( + MultivaluedMap queryParams, + String keywords) { AcquisitionsCommonList acquisitionObjectList; try { - ServiceContext ctx = createServiceContext(); + ServiceContext ctx = createServiceContext(queryParams); DocumentHandler handler = createDocumentHandler(ctx); // perform a keyword search @@ -392,12 +397,9 @@ public class AcquisitionResource if (logger.isDebugEnabled()) { logger.debug("The WHERE clause is: " + documentFilter.getWhereClause()); } - getRepositoryClient(ctx).getFiltered(ctx, handler); - } else { - getRepositoryClient(ctx).getAll(ctx, handler); - } - acquisitionObjectList = (AcquisitionsCommonList) handler.getCommonPartList(); - + } + getRepositoryClient(ctx).getFiltered(ctx, handler); + acquisitionObjectList = (AcquisitionsCommonList) handler.getCommonPartList(); } catch (UnauthorizedException ue) { Response response = Response.status( Response.Status.UNAUTHORIZED).entity("Index failed reason " + ue.getErrorReason()).type("text/plain").build(); @@ -432,8 +434,8 @@ public class AcquisitionResource ServiceContext ctx = createServiceContext(); DocumentWrapper docWrapper = getRepositoryClient(ctx).getDoc(ctx, csid); - RemoteDocumentModelHandlerImpl handler - = (RemoteDocumentModelHandlerImpl)createDocumentHandler(ctx); + DocumentModelHandler handler + = (DocumentModelHandler)createDocumentHandler(ctx); List authRefFields = ((MultipartServiceContextImpl)ctx).getCommonPartPropertyValues( ServiceBindingUtils.AUTH_REF_PROP, ServiceBindingUtils.QUALIFIED_PROP_NAMES); diff --git a/services/authorization/service/pom.xml b/services/authorization/service/pom.xml index 981a48cb1..e1d7e0570 100644 --- a/services/authorization/service/pom.xml +++ b/services/authorization/service/pom.xml @@ -171,6 +171,10 @@ maven-surefire-plugin + + maven.basedir + ${basedir} + log4j.configuration file:${project.build.directory}/test-classes/log4j.properties diff --git a/services/authorization/service/src/test/java/org/collectionspace/services/authorization/test/AbstractAuthorizationTestImpl.java b/services/authorization/service/src/test/java/org/collectionspace/services/authorization/test/AbstractAuthorizationTestImpl.java index 259ae39c7..585bdc3ee 100644 --- a/services/authorization/service/src/test/java/org/collectionspace/services/authorization/test/AbstractAuthorizationTestImpl.java +++ b/services/authorization/service/src/test/java/org/collectionspace/services/authorization/test/AbstractAuthorizationTestImpl.java @@ -78,9 +78,18 @@ import org.testng.annotations.Test; */ public abstract class AbstractAuthorizationTestImpl { - final Logger logger = LoggerFactory.getLogger(AbstractAuthorizationTestImpl.class); + static protected final String MAVEN_BASEDIR_PROPERTY = "maven.basedir"; + final Logger logger = LoggerFactory.getLogger(AbstractAuthorizationTestImpl.class); private org.springframework.jdbc.datasource.DataSourceTransactionManager txManager; final static String testDataDir = "src/test/resources/test-data/"; + static String baseDir; + static { + baseDir = System.getProperty(AbstractAuthorizationTestImpl.MAVEN_BASEDIR_PROPERTY); + if (baseDir == null || baseDir.isEmpty()) { + baseDir = System.getProperty("user.dir"); + } + baseDir = baseDir + System.getProperty("file.separator"); + } /** * Returns the name of the currently running test. diff --git a/services/authorization/service/src/test/java/org/collectionspace/services/authorization/test/AuthorizationSeedTest.java b/services/authorization/service/src/test/java/org/collectionspace/services/authorization/test/AuthorizationSeedTest.java index 8404f9975..d45fffe97 100644 --- a/services/authorization/service/src/test/java/org/collectionspace/services/authorization/test/AuthorizationSeedTest.java +++ b/services/authorization/service/src/test/java/org/collectionspace/services/authorization/test/AuthorizationSeedTest.java @@ -23,10 +23,11 @@ */ package org.collectionspace.services.authorization.test; -import java.util.ArrayList; -import java.util.List; +//import java.util.ArrayList; +//import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +//import org.collectionspace.services.client.test.BaseServiceTest; import org.collectionspace.services.authorization.AuthZ; import org.collectionspace.services.authorization.Permission; import org.collectionspace.services.authorization.PermissionRole; @@ -62,20 +63,20 @@ public class AuthorizationSeedTest extends AbstractAuthorizationTestImpl { } public void seedRoles() throws Exception { + //Should this test really be empty? } - public void seedPermissions() throws Exception { - + public void seedPermissions() throws Exception { PermissionsList pcList = - (PermissionsList) fromFile(PermissionsList.class, + (PermissionsList) fromFile(PermissionsList.class, baseDir + AbstractAuthorizationTestImpl.testDataDir + "test-permissions.xml"); logger.info("read permissions from " - + AbstractAuthorizationTestImpl.testDataDir + "test-permissions.xml"); + + baseDir + AbstractAuthorizationTestImpl.testDataDir + "test-permissions.xml"); PermissionsRolesList pcrList = - (PermissionsRolesList) fromFile(PermissionsRolesList.class, + (PermissionsRolesList) fromFile(PermissionsRolesList.class, baseDir + AbstractAuthorizationTestImpl.testDataDir + "test-permissions-roles.xml"); logger.info("read permissions-roles from " - + AbstractAuthorizationTestImpl.testDataDir + "test-permissions.xml"); + + baseDir + AbstractAuthorizationTestImpl.testDataDir + "test-permissions.xml"); AuthZ authZ = AuthZ.get(); for (Permission p : pcList.getPermissions()) { if (logger.isDebugEnabled()) { diff --git a/services/client/pom.xml b/services/client/pom.xml index 5635bb6e0..4f82486a5 100644 --- a/services/client/pom.xml +++ b/services/client/pom.xml @@ -56,6 +56,10 @@ + + org.jboss.resteasy + jaxrs-api + org.jboss.resteasy resteasy-jaxb-provider diff --git a/services/client/src/main/java/org/collectionspace/services/client/test/AbstractServiceTestImpl.java b/services/client/src/main/java/org/collectionspace/services/client/test/AbstractServiceTestImpl.java index d6da10add..8d2dc3eb1 100644 --- a/services/client/src/main/java/org/collectionspace/services/client/test/AbstractServiceTestImpl.java +++ b/services/client/src/main/java/org/collectionspace/services/client/test/AbstractServiceTestImpl.java @@ -23,13 +23,13 @@ */ package org.collectionspace.services.client.test; -import java.util.List; +//import java.util.List; import javax.ws.rs.core.Response; import org.collectionspace.services.jaxb.AbstractCommonList; import org.collectionspace.services.client.CollectionSpaceClient; -import org.collectionspace.services.client.AbstractServiceClientImpl; +//import org.collectionspace.services.client.AbstractServiceClientImpl; import org.jboss.resteasy.client.ClientResponse; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -50,6 +50,7 @@ public abstract class AbstractServiceTestImpl extends BaseServiceTest implements /** The Constant DEFAULT_LIST_SIZE. */ static protected final int DEFAULT_LIST_SIZE = 10; + static protected final int DEFAULT_PAGINATEDLIST_SIZE = 10; // // Success outcomes // /* (non-Javadoc) @@ -243,7 +244,6 @@ public abstract class AbstractServiceTestImpl extends BaseServiceTest implements ClientResponse response = (ClientResponse)client.readList(Long.toString(pageSize), Long.toString(pageNumber)); - AbstractCommonList list = this.getAbstractCommonList(response); int statusCode = response.getStatus(); // Check the status code of the response: does it match @@ -254,44 +254,115 @@ public abstract class AbstractServiceTestImpl extends BaseServiceTest implements Assert.assertTrue(this.REQUEST_TYPE.isValidStatusCode(statusCode), invalidStatusCodeMessage(this.REQUEST_TYPE, statusCode)); Assert.assertEquals(statusCode, this.EXPECTED_STATUS_CODE); - + + AbstractCommonList list = this.getAbstractCommonList(response); return list; } + /** + * Creates the list. + * + * @param testName the test name + * @param listSize the list size + * @throws Exception the exception + */ + protected void createPaginatedList(String testName, int listSize) throws Exception { + for (int i = 0; i < listSize; i++) { + create(testName); + } + } + + /*@Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class) + public void leafCeate(String testName) throws Exception { + this.create(testName); + }*/ + + private void assertPaginationInfo(String testName, + AbstractCommonList list, + long expectedPageNum, + long expectedPageSize, + long expectedListSize, + long expectedTotalItems) { + Assert.assertNotNull(list); + + long pageNum = list.getPageNum(); + Assert.assertEquals(pageNum, expectedPageNum); + if (getLogger().isDebugEnabled() == true) { + getLogger().debug(testName + ":" + "page number is " + pageNum); + } + + long pageSizeReturned = list.getPageSize(); + Assert.assertEquals(pageSizeReturned, expectedPageSize); + if (getLogger().isDebugEnabled() == true) { + getLogger().debug(testName + ":" + "page size is " + list.getPageSize()); + } + + long itemsInPage = list.getItemsInPage(); + Assert.assertEquals(itemsInPage, expectedListSize); + if (getLogger().isDebugEnabled() == true) { + getLogger().debug(testName + ":" + "actual items in page was/were " + itemsInPage); + } + + long totalItemsReturned = list.getTotalItems(); + Assert.assertEquals(totalItemsReturned, expectedTotalItems); + if (getLogger().isDebugEnabled() == true) { + getLogger().debug(testName + ":" + "total number of items is " + list.getTotalItems()); + } + } + /** * Read paginated list. * * @param testName the test name * @throws Exception the exception */ - @Test(dataProvider = "testName") + @Test(dataProvider = "testName") /*, dataProviderClass = AbstractServiceTestImpl.class, + dependsOnMethods = {"leafCeate"}) */ public void readPaginatedList(String testName) throws Exception { - // Perform setup. setupReadList(testName); - - long pageSize = DEFAULT_LIST_SIZE / 3; //create 3 pages to iterate over CollectionSpaceClient client = this.getClientInstance(); - AbstractCommonList list = this.readList(testName, client, pageSize, 0); - long totalItems = list.getTotalItems(); - long pagesTotal = totalItems / pageSize; + + // Get the current total number of items. + // If there are no items then create some + AbstractCommonList list = this.readList(testName, client, 1 /*pgSz*/, 0 /*pgNum*/); + if (list == null || list.getTotalItems() == 0) { + this.createPaginatedList(testName, DEFAULT_PAGINATEDLIST_SIZE); + list = this.readList(testName, client, 1 /*pgSz*/, 0 /*pgNum*/); + } + + // Print out the current list size to be paginated + Assert.assertNotNull(list); + long totalItems = list.getTotalItems(); + Assert.assertFalse(totalItems == 0); + if (getLogger().isDebugEnabled() == true) { + getLogger().debug(testName + ":" + "created list of " + + totalItems + " to be paginated."); + } + + long pageSize = totalItems / 3; //create up to 3 pages to iterate over + long pagesTotal = pageSize > 0 ? (totalItems / pageSize) : 0; for (int i = 0; i < pagesTotal; i++) { list = this.readList(testName, client, pageSize, i); - if (getLogger().isDebugEnabled() == true) { - getLogger().debug(testName + ":" + "page number is " + list.getPageNum()); - getLogger().debug(testName + ":" + "page size is " + list.getPageSize()); - getLogger().debug(testName + ":" + "total number of items is " + list.getTotalItems()); - } + assertPaginationInfo(testName, + list, + i, //expected page number + pageSize, //expected page size + pageSize, //expected num of items in page + totalItems);//expected total num of items } + // if there are any remainders be sure to paginate them as well long mod = totalItems % pageSize; if (mod != 0) { list = this.readList(testName, client, pageSize, pagesTotal); - getLogger().debug(testName + ":" + "page number is " + list.getPageNum()); - getLogger().debug(testName + ":" + "page size is " + list.getPageSize()); - getLogger().debug(testName + ":" + "total number of items is " + list.getTotalItems()); + assertPaginationInfo(testName, + list, + pagesTotal, //expected page number + pageSize, //expected page size + mod, //expected num of items in page + totalItems);//expected total num of items } - } // --------------------------------------------------------------- diff --git a/services/client/src/main/java/org/collectionspace/services/client/test/BaseServiceTest.java b/services/client/src/main/java/org/collectionspace/services/client/test/BaseServiceTest.java index bf87cd4a6..0f2f42ac0 100644 --- a/services/client/src/main/java/org/collectionspace/services/client/test/BaseServiceTest.java +++ b/services/client/src/main/java/org/collectionspace/services/client/test/BaseServiceTest.java @@ -66,6 +66,9 @@ import org.collectionspace.services.jaxb.AbstractCommonList; */ public abstract class BaseServiceTest { + //Maven's base directory -i.e., the one containing the current pom.xml + static protected final String MAVEN_BASEDIR_PROPERTY = "maven.basedir"; + /** The Constant logger. */ static protected final Logger logger = LoggerFactory.getLogger(BaseServiceTest.class); diff --git a/services/collectionobject/client/src/test/java/org/collectionspace/services/client/test/CollectionObjectServiceTest.java b/services/collectionobject/client/src/test/java/org/collectionspace/services/client/test/CollectionObjectServiceTest.java index f1861d2c6..f993942db 100644 --- a/services/collectionobject/client/src/test/java/org/collectionspace/services/client/test/CollectionObjectServiceTest.java +++ b/services/collectionobject/client/src/test/java/org/collectionspace/services/client/test/CollectionObjectServiceTest.java @@ -27,7 +27,7 @@ import java.util.List; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; -import org.collectionspace.services.client.AbstractServiceClientImpl; +//import org.collectionspace.services.client.AbstractServiceClientImpl; import org.collectionspace.services.client.CollectionObjectClient; import org.collectionspace.services.client.CollectionSpaceClient; import org.collectionspace.services.collectionobject.CollectionobjectsCommon; @@ -64,7 +64,7 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl { private String knownResourceId = null; /** The all resource ids created. */ - private List allResourceIdsCreated = new ArrayList(); + private List allResourceIdsCreated = new ArrayList(); /** The multivalue. */ private boolean multivalue; //toggle @@ -260,7 +260,7 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl { } testSubmitRequest(newId); } - + /* (non-Javadoc) * @see org.collectionspace.services.client.test.ServiceTest#createList() */ @@ -268,9 +268,7 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl { @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class, dependsOnMethods = {"create"}) public void createList(String testName) throws Exception { - for (int i = 0; i < DEFAULT_LIST_SIZE; i++) { - create(testName); - } + this.createPaginatedList(testName, DEFAULT_LIST_SIZE); } // Failure outcomes @@ -282,6 +280,7 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl { @Override @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class) public void createWithEmptyEntityBody(String testName) throws Exception { + //FIXME: Should this test really be empty? } /** @@ -304,6 +303,7 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl { @Override @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class) public void createWithWrongXmlSchema(String testName) throws Exception { + //FIXME: Should this test really be empty? } @@ -399,6 +399,7 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl { * @param testName The name of this test method. This name is supplied * automatically, via reflection, by a TestNG 'data provider' in * a base class. + * @throws Exception */ @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class) public void createWithRequiredValuesNullOrEmpty(String testName) throws Exception { @@ -689,6 +690,7 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl { @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class, dependsOnMethods = {"read"}) public void updateWithEmptyEntityBody(String testName) throws Exception { + //FIXME: Should this test really be empty? } /** @@ -703,6 +705,7 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl { @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class, dependsOnMethods = {"read"}) public void updateWithMalformedXml(String testName) throws Exception { + //FIXME: Should this test really be empty? } /* (non-Javadoc) @@ -712,6 +715,7 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl { @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class, dependsOnMethods = {"read"}) public void updateWithWrongXmlSchema(String testName) throws Exception { + //FIXME: Should this test really be empty? } /* @@ -839,6 +843,7 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl { * @param testName The name of this test method. This name is supplied * automatically, via reflection, by a TestNG 'data provider' in * a base class. + * @throws Exception */ @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class, dependsOnMethods = {"read"}) @@ -944,6 +949,7 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl { /** * Tests the code for manually submitting data that is used by several * of the methods above. + * @throws Exception */ @Test(dependsOnMethods = {"create", "read"}) diff --git a/services/collectionobject/service/src/main/java/org/collectionspace/services/collectionobject/CollectionObjectResource.java b/services/collectionobject/service/src/main/java/org/collectionspace/services/collectionobject/CollectionObjectResource.java index ef0bf24c2..021879c4d 100644 --- a/services/collectionobject/service/src/main/java/org/collectionspace/services/collectionobject/CollectionObjectResource.java +++ b/services/collectionobject/service/src/main/java/org/collectionspace/services/collectionobject/CollectionObjectResource.java @@ -238,7 +238,7 @@ public class CollectionObjectResource public CollectionobjectsCommonList getCollectionObjectList(@Context UriInfo ui, @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords) { CollectionobjectsCommonList result = null; - MultivaluedMap queryParams = ui.getQueryParameters(); + MultivaluedMap queryParams = ui.getQueryParameters(); if (keywords != null) { result = searchCollectionObjects(queryParams, keywords); } else { @@ -251,7 +251,7 @@ public class CollectionObjectResource /** * Gets the collection object list. */ - private CollectionobjectsCommonList getCollectionObjectList(MultivaluedMap queryParams) { + private CollectionobjectsCommonList getCollectionObjectList(MultivaluedMap queryParams) { CollectionobjectsCommonList collectionObjectList; try { ServiceContext ctx = createServiceContext(queryParams); @@ -385,6 +385,7 @@ public class CollectionObjectResource public IntakesCommonList getIntakesCommonList(@Context UriInfo ui, @PathParam("csid") String csid) { IntakesCommonList result = null; + MultivaluedMap queryParams = ui.getQueryParameters(); try { // @@ -393,8 +394,9 @@ public class CollectionObjectResource String subjectCsid = csid; String predicate = RelationshipType.COLLECTIONOBJECT_INTAKE.value(); String objectCsid = null; - NewRelationResource relationResource = new NewRelationResource(); - RelationsCommonList relationsCommonList = relationResource.getRelationList(subjectCsid, predicate, objectCsid); + NewRelationResource relationResource = new NewRelationResource(); + RelationsCommonList relationsCommonList = relationResource.getRelationList(queryParams, + subjectCsid, predicate, objectCsid); // // Create an array of Intake csid's @@ -438,7 +440,8 @@ public class CollectionObjectResource @Context UriInfo ui) { AuthorityRefList authRefList = null; try { - ServiceContext ctx = createServiceContext(); + MultivaluedMap queryParams = ui.getQueryParameters(); + ServiceContext ctx = createServiceContext(queryParams); DocumentWrapper docWrapper = getRepositoryClient(ctx).getDoc(ctx, csid); DocumentModelHandler docHandler = @@ -501,7 +504,7 @@ public class CollectionObjectResource @Produces("application/xml") public CollectionobjectsCommonList keywordsSearchCollectionObjects(@Context UriInfo ui, @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS) String keywords) { - MultivaluedMap queryParams = ui.getQueryParameters(); + MultivaluedMap queryParams = ui.getQueryParameters(); return searchCollectionObjects(queryParams, keywords); } diff --git a/services/common/src/main/java/org/collectionspace/services/common/context/AbstractServiceContextImpl.java b/services/common/src/main/java/org/collectionspace/services/common/context/AbstractServiceContextImpl.java index 4a11f52e9..54d821bf4 100644 --- a/services/common/src/main/java/org/collectionspace/services/common/context/AbstractServiceContextImpl.java +++ b/services/common/src/main/java/org/collectionspace/services/common/context/AbstractServiceContextImpl.java @@ -29,8 +29,6 @@ import java.util.List; import java.util.Map; import javax.ws.rs.core.MultivaluedMap; -import org.collectionspace.authentication.AuthN; - import org.collectionspace.services.common.ClientType; import org.collectionspace.services.common.ServiceMain; import org.collectionspace.services.common.config.PropertyItemUtils; @@ -89,9 +87,15 @@ public abstract class AbstractServiceContextImpl /** security context */ private SecurityContext securityContext; + /** + * Instantiates a new abstract service context impl. + */ private AbstractServiceContextImpl() { - } // private constructor for singleton pattern + // private constructor for singleton pattern + } + // request query params + /** The query params. */ private MultivaluedMap queryParams; /** @@ -133,18 +137,16 @@ public abstract class AbstractServiceContextImpl } } - /** - * getCommonPartLabel get common part label - * @return + /* (non-Javadoc) + * @see org.collectionspace.services.common.context.ServiceContext#getCommonPartLabel() */ @Override public String getCommonPartLabel() { return getCommonPartLabel(getServiceName()); } - /** - * getCommonPartLabel get common part label - * @return + /* (non-Javadoc) + * @see org.collectionspace.services.common.context.ServiceContext#getCommonPartLabel(java.lang.String) */ public String getCommonPartLabel(String schemaName) { return schemaName.toLowerCase() + PART_LABEL_SEPERATOR + PART_COMMON_LABEL; @@ -316,11 +318,17 @@ public abstract class AbstractServiceContextImpl overrideDocumentType = docType; } + /* (non-Javadoc) + * @see org.collectionspace.services.common.context.ServiceContext#getSecurityContext() + */ @Override public SecurityContext getSecurityContext() { return securityContext; } + /* (non-Javadoc) + * @see org.collectionspace.services.common.context.ServiceContext#getUserId() + */ @Override public String getUserId() { return securityContext.getUserId(); @@ -422,7 +430,7 @@ public abstract class AbstractServiceContextImpl */ private DocumentHandler createDocumentHandlerInstance() throws Exception { ClassLoader tccl = Thread.currentThread().getContextClassLoader(); - Class c = tccl.loadClass(getDocumentHandlerClass()); + Class c = tccl.loadClass(getDocumentHandlerClass()); if (DocumentHandler.class.isAssignableFrom(c)) { docHandler = (DocumentHandler) c.newInstance(); } else { @@ -495,7 +503,7 @@ public abstract class AbstractServiceContextImpl ClassLoader tccl = Thread.currentThread().getContextClassLoader(); for (String clazz : handlerClazzes) { clazz = clazz.trim(); - Class c = tccl.loadClass(clazz); + Class c = tccl.loadClass(clazz); if (ValidatorHandler.class.isAssignableFrom(c)) { handlers.add((ValidatorHandler) c.newInstance()); } @@ -524,13 +532,19 @@ public abstract class AbstractServiceContextImpl return msg.toString(); } + /* (non-Javadoc) + * @see org.collectionspace.services.common.context.ServiceContext#getQueryParams() + */ @Override public MultivaluedMap getQueryParams() { return this.queryParams; } + /* (non-Javadoc) + * @see org.collectionspace.services.common.context.ServiceContext#setQueryParams(javax.ws.rs.core.MultivaluedMap) + */ @Override - public void setQueryParams(MultivaluedMap queryParams) { - this.queryParams = queryParams; + public void setQueryParams(MultivaluedMap theQueryParams) { + this.queryParams = theQueryParams; } } diff --git a/services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/RemoteDocumentModelHandlerImpl.java b/services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/RemoteDocumentModelHandlerImpl.java index dbcb98eb5..22eaa36b9 100644 --- a/services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/RemoteDocumentModelHandlerImpl.java +++ b/services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/RemoteDocumentModelHandlerImpl.java @@ -120,8 +120,10 @@ public abstract class RemoteDocumentModelHandlerImpl // set the page size and page numer commonList.setPageNum(pageNum); commonList.setPageSize(pageSize); - // set the total result size DocumentModelList docList = wrapDoc.getWrappedObject(); + // Set num of items in list. this is useful to our testing framework. + commonList.setItemsInPage(docList.size()); + // set the total result size commonList.setTotalItems(docList.totalSize()); return (TL)commonList; diff --git a/services/contact/client/src/main/java/org/collectionspace/services/client/ContactClient.java b/services/contact/client/src/main/java/org/collectionspace/services/client/ContactClient.java index a5c2da88b..d0615a843 100644 --- a/services/contact/client/src/main/java/org/collectionspace/services/client/ContactClient.java +++ b/services/contact/client/src/main/java/org/collectionspace/services/client/ContactClient.java @@ -46,7 +46,7 @@ public class ContactClient extends AbstractServiceClientImpl { /** * */ - private static final ContactClient instance = new ContactClient(); +// private static final ContactClient instance = new ContactClient(); /** * @@ -87,9 +87,9 @@ public class ContactClient extends AbstractServiceClientImpl { * * @return */ - public static ContactClient getInstance() { - return instance; - } +// public static ContactClient getInstance() { +// return instance; +// } /** * @return diff --git a/services/contact/service/src/main/java/org/collectionspace/services/contact/ContactResource.java b/services/contact/service/src/main/java/org/collectionspace/services/contact/ContactResource.java index 0a4d89826..438e59e00 100644 --- a/services/contact/service/src/main/java/org/collectionspace/services/contact/ContactResource.java +++ b/services/contact/service/src/main/java/org/collectionspace/services/contact/ContactResource.java @@ -33,6 +33,7 @@ import javax.ws.rs.PUT; import javax.ws.rs.PathParam; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.Context; +import javax.ws.rs.core.MultivaluedMap; import javax.ws.rs.core.Response; import javax.ws.rs.core.UriBuilder; import javax.ws.rs.core.UriInfo; @@ -40,8 +41,6 @@ import javax.ws.rs.core.UriInfo; import org.collectionspace.services.common.AbstractMultiPartCollectionSpaceResourceImpl; import org.collectionspace.services.common.ClientType; import org.collectionspace.services.common.ServiceMain; -import org.collectionspace.services.common.context.MultipartServiceContext; -import org.collectionspace.services.common.context.MultipartServiceContextFactory; import org.collectionspace.services.common.context.ServiceContext; import org.collectionspace.services.common.document.DocumentNotFoundException; import org.collectionspace.services.common.document.DocumentHandler; @@ -206,11 +205,12 @@ public class ContactResource extends @GET @Produces("application/xml") public ContactsCommonList getContactList(@Context UriInfo ui) { + MultivaluedMap queryParams = ui.getQueryParameters(); ContactsCommonList contactObjectList = new ContactsCommonList(); try { - ServiceContext ctx = createServiceContext(); + ServiceContext ctx = createServiceContext(queryParams); DocumentHandler handler = createDocumentHandler(ctx); - getRepositoryClient(ctx).getAll(ctx, handler); + getRepositoryClient(ctx).getFiltered(ctx, handler); contactObjectList = (ContactsCommonList) handler.getCommonPartList(); } catch (Exception e) { if (logger.isDebugEnabled()) { diff --git a/services/dimension/client/src/main/java/org/collectionspace/services/client/DimensionClient.java b/services/dimension/client/src/main/java/org/collectionspace/services/client/DimensionClient.java index ab26a2e5d..9d42e934f 100644 --- a/services/dimension/client/src/main/java/org/collectionspace/services/client/DimensionClient.java +++ b/services/dimension/client/src/main/java/org/collectionspace/services/client/DimensionClient.java @@ -55,7 +55,7 @@ public class DimensionClient extends AbstractServiceClientImpl { /** * */ - private static final DimensionClient instance = new DimensionClient(); +// private static final DimensionClient instance = new DimensionClient(); /** * @@ -96,9 +96,9 @@ public class DimensionClient extends AbstractServiceClientImpl { * * @return */ - public static DimensionClient getInstance() { - return instance; - } +// public static DimensionClient getInstance() { +// return instance; +// } /** * @return diff --git a/services/dimension/client/src/test/java/org/collectionspace/services/client/test/DimensionServiceTest.java b/services/dimension/client/src/test/java/org/collectionspace/services/client/test/DimensionServiceTest.java index e0898e788..2f195dcb6 100644 --- a/services/dimension/client/src/test/java/org/collectionspace/services/client/test/DimensionServiceTest.java +++ b/services/dimension/client/src/test/java/org/collectionspace/services/client/test/DimensionServiceTest.java @@ -60,7 +60,7 @@ public class DimensionServiceTest extends AbstractServiceTestImpl { // Instance variables specific to this test. final String SERVICE_PATH_COMPONENT = "dimensions"; private String knownResourceId = null; - private List allResourceIdsCreated = new ArrayList(); + private List allResourceIdsCreated = new ArrayList(); /* (non-Javadoc) * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance() diff --git a/services/dimension/service/src/main/java/org/collectionspace/services/dimension/DimensionResource.java b/services/dimension/service/src/main/java/org/collectionspace/services/dimension/DimensionResource.java index d3cec99b8..65c6ece81 100644 --- a/services/dimension/service/src/main/java/org/collectionspace/services/dimension/DimensionResource.java +++ b/services/dimension/service/src/main/java/org/collectionspace/services/dimension/DimensionResource.java @@ -212,7 +212,7 @@ public class DimensionResource extends try { ServiceContext ctx = createServiceContext(queryParams); DocumentHandler handler = createDocumentHandler(ctx); - getRepositoryClient(ctx).getAll(ctx, handler); + getRepositoryClient(ctx).getFiltered(ctx, handler); dimensionObjectList = (DimensionsCommonList) handler.getCommonPartList(); } catch (Exception e) { if (logger.isDebugEnabled()) { diff --git a/services/intake/client/src/main/java/org/collectionspace/services/client/IntakeClient.java b/services/intake/client/src/main/java/org/collectionspace/services/client/IntakeClient.java index cb215bec2..93daec817 100644 --- a/services/intake/client/src/main/java/org/collectionspace/services/client/IntakeClient.java +++ b/services/intake/client/src/main/java/org/collectionspace/services/client/IntakeClient.java @@ -57,7 +57,7 @@ public class IntakeClient extends AbstractServiceClientImpl { /** * */ - private static final IntakeClient instance = new IntakeClient(); +// private static final IntakeClient instance = new IntakeClient(); /** * */ @@ -97,9 +97,9 @@ public class IntakeClient extends AbstractServiceClientImpl { * * @return */ - public static IntakeClient getInstance() { - return instance; - } +// public static IntakeClient getInstance() { +// return instance; +// } /** * @return diff --git a/services/intake/client/src/test/java/org/collectionspace/services/client/test/PersonAuthRefDocsTest.java b/services/intake/client/src/test/java/org/collectionspace/services/client/test/PersonAuthRefDocsTest.java index 7577b9e84..22bc83728 100644 --- a/services/intake/client/src/test/java/org/collectionspace/services/client/test/PersonAuthRefDocsTest.java +++ b/services/intake/client/src/test/java/org/collectionspace/services/client/test/PersonAuthRefDocsTest.java @@ -288,16 +288,18 @@ public class PersonAuthRefDocsTest extends BaseServiceTest { logger.debug("Cleaning up temporary resources created for testing ..."); } IntakeClient intakeClient = new IntakeClient(); - PersonAuthorityClient personAuthClient = new PersonAuthorityClient(); // Note: Any non-success responses are ignored and not reported. for (String resourceId : intakeIdsCreated) { ClientResponse res = intakeClient.delete(resourceId); } // Delete persons before PersonAuth + PersonAuthorityClient personAuthClient = new PersonAuthorityClient(); for (String resourceId : personIdsCreated) { ClientResponse res = personAuthClient.deleteItem(personAuthCSID, resourceId); } - ClientResponse res = personAuthClient.delete(personAuthCSID); + if (personAuthCSID != null) { + personAuthClient.delete(personAuthCSID); + } } // --------------------------------------------------------------- diff --git a/services/intake/service/src/main/java/org/collectionspace/services/intake/IntakeResource.java b/services/intake/service/src/main/java/org/collectionspace/services/intake/IntakeResource.java index 797b8aa5b..18a0a43cd 100644 --- a/services/intake/service/src/main/java/org/collectionspace/services/intake/IntakeResource.java +++ b/services/intake/service/src/main/java/org/collectionspace/services/intake/IntakeResource.java @@ -59,6 +59,7 @@ 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; @@ -255,7 +256,7 @@ public class IntakeResource extends try { ServiceContext ctx = createServiceContext(queryParams); DocumentHandler handler = createDocumentHandler(ctx); - getRepositoryClient(ctx).getAll(ctx, handler); + getRepositoryClient(ctx).getFiltered(ctx, handler); intakeObjectList = (IntakesCommonList) handler.getCommonPartList(); } catch (UnauthorizedException ue) { Response response = Response.status( @@ -292,8 +293,8 @@ public class IntakeResource extends ServiceContext ctx = createServiceContext(queryParams); DocumentWrapper docWrapper = getRepositoryClient(ctx).getDoc(ctx, csid); - RemoteDocumentModelHandlerImpl handler - = (RemoteDocumentModelHandlerImpl)createDocumentHandler(ctx); + DocumentModelHandler handler + = (DocumentModelHandler)createDocumentHandler(ctx); List authRefFields = ((MultipartServiceContextImpl)ctx).getCommonPartPropertyValues( ServiceBindingUtils.AUTH_REF_PROP, ServiceBindingUtils.QUALIFIED_PROP_NAMES); @@ -474,13 +475,10 @@ public class IntakeResource extends documentFilter.setWhereClause(whereClause); if (logger.isDebugEnabled()) { logger.debug("The WHERE clause is: " + documentFilter.getWhereClause()); - } - getRepositoryClient(ctx).getFiltered(ctx, handler); - } else { - getRepositoryClient(ctx).getAll(ctx, handler); - } - intakesObjectList = (IntakesCommonList) handler.getCommonPartList(); - + } + } + getRepositoryClient(ctx).getFiltered(ctx, handler); + intakesObjectList = (IntakesCommonList) handler.getCommonPartList(); } catch (UnauthorizedException ue) { Response response = Response.status( Response.Status.UNAUTHORIZED).entity("Index failed reason " + ue.getErrorReason()).type("text/plain").build(); diff --git a/services/jaxb/src/main/resources/AbstractCommonList.xsd b/services/jaxb/src/main/resources/AbstractCommonList.xsd index f71f4927d..947f111a5 100644 --- a/services/jaxb/src/main/resources/AbstractCommonList.xsd +++ b/services/jaxb/src/main/resources/AbstractCommonList.xsd @@ -17,10 +17,11 @@ + + - - + \ No newline at end of file diff --git a/services/loanin/client/src/main/java/org/collectionspace/services/client/LoaninClient.java b/services/loanin/client/src/main/java/org/collectionspace/services/client/LoaninClient.java index 405448e9b..1e6ebeeae 100644 --- a/services/loanin/client/src/main/java/org/collectionspace/services/client/LoaninClient.java +++ b/services/loanin/client/src/main/java/org/collectionspace/services/client/LoaninClient.java @@ -48,7 +48,7 @@ public class LoaninClient extends AbstractServiceClientImpl { /** * */ - private static final LoaninClient instance = new LoaninClient(); +// private static final LoaninClient instance = new LoaninClient(); /** * */ @@ -88,9 +88,9 @@ public class LoaninClient extends AbstractServiceClientImpl { * * @return */ - public static LoaninClient getInstance() { - return instance; - } +// public static LoaninClient getInstance() { +// return instance; +// } /** * @return diff --git a/services/loanin/client/src/test/java/org/collectionspace/services/client/test/LoaninAuthRefsTest.java b/services/loanin/client/src/test/java/org/collectionspace/services/client/test/LoaninAuthRefsTest.java index db34e6b4f..5ccf8709b 100644 --- a/services/loanin/client/src/test/java/org/collectionspace/services/client/test/LoaninAuthRefsTest.java +++ b/services/loanin/client/src/test/java/org/collectionspace/services/client/test/LoaninAuthRefsTest.java @@ -36,10 +36,10 @@ import org.collectionspace.services.client.LoaninClient; import org.collectionspace.services.client.PersonAuthorityClient; import org.collectionspace.services.client.PersonAuthorityClientUtils; import org.collectionspace.services.common.authorityref.AuthorityRefList; -import org.collectionspace.services.common.authorityref.AuthorityRefList.AuthorityRefItem; +//import org.collectionspace.services.common.authorityref.AuthorityRefList.AuthorityRefItem; import org.collectionspace.services.jaxb.AbstractCommonList; import org.collectionspace.services.loanin.LoansinCommon; -import org.collectionspace.services.loanin.LoansinCommonList; +//import org.collectionspace.services.loanin.LoansinCommonList; import org.jboss.resteasy.client.ClientResponse; @@ -69,8 +69,8 @@ public class LoaninAuthRefsTest extends BaseServiceTest { final String SERVICE_PATH_COMPONENT = "loansin"; final String PERSON_AUTHORITY_NAME = "TestPersonAuth"; private String knownResourceId = null; - private List loaninIdsCreated = new ArrayList(); - private List personIdsCreated = new ArrayList(); + private List loaninIdsCreated = new ArrayList(); + private List personIdsCreated = new ArrayList(); private int CREATED_STATUS = Response.Status.CREATED.getStatusCode(); private int OK_STATUS = Response.Status.OK.getStatusCode(); private String personAuthCSID = null; @@ -304,19 +304,22 @@ public class LoaninAuthRefsTest extends BaseServiceTest { } PersonAuthorityClient personAuthClient = new PersonAuthorityClient(); // Delete Person resource(s) (before PersonAuthority resources). - ClientResponse res; + for (String resourceId : personIdsCreated) { // Note: Any non-success responses are ignored and not reported. - res = personAuthClient.deleteItem(personAuthCSID, resourceId); + personAuthClient.deleteItem(personAuthCSID, resourceId); } + // Delete PersonAuthority resource(s). // Note: Any non-success response is ignored and not reported. - res = personAuthClient.delete(personAuthCSID); - // Delete Loans In resource(s). - LoaninClient loaninClient = new LoaninClient(); - for (String resourceId : loaninIdsCreated) { - // Note: Any non-success responses are ignored and not reported. - res = loaninClient.delete(resourceId); + if (personAuthCSID != null) { + personAuthClient.delete(personAuthCSID); + // Delete Loans In resource(s). + LoaninClient loaninClient = new LoaninClient(); + for (String resourceId : loaninIdsCreated) { + // Note: Any non-success responses are ignored and not reported. + loaninClient.delete(resourceId); + } } } diff --git a/services/loanin/service/src/main/java/org/collectionspace/services/loanin/LoaninResource.java b/services/loanin/service/src/main/java/org/collectionspace/services/loanin/LoaninResource.java index de642b32c..cdef47adc 100644 --- a/services/loanin/service/src/main/java/org/collectionspace/services/loanin/LoaninResource.java +++ b/services/loanin/service/src/main/java/org/collectionspace/services/loanin/LoaninResource.java @@ -58,6 +58,7 @@ 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; @@ -253,7 +254,7 @@ public class LoaninResource extends try { ServiceContext ctx = createServiceContext(queryParams); DocumentHandler handler = createDocumentHandler(ctx); - getRepositoryClient(ctx).getAll(ctx, handler); + getRepositoryClient(ctx).getFiltered(ctx, handler); loaninObjectList = (LoansinCommonList) handler.getCommonPartList(); } catch (UnauthorizedException ue) { Response response = Response.status( @@ -290,8 +291,8 @@ public class LoaninResource extends ServiceContext ctx = createServiceContext(queryParams); DocumentWrapper docWrapper = getRepositoryClient(ctx).getDoc(ctx, csid); - RemoteDocumentModelHandlerImpl handler - = (RemoteDocumentModelHandlerImpl)createDocumentHandler(ctx); + DocumentModelHandler handler + = (DocumentModelHandler)createDocumentHandler(ctx); List authRefFields = ((MultipartServiceContextImpl)ctx).getCommonPartPropertyValues( ServiceBindingUtils.AUTH_REF_PROP, ServiceBindingUtils.QUALIFIED_PROP_NAMES); @@ -441,7 +442,8 @@ public class LoaninResource extends * * @return the loansin common list */ - private LoansinCommonList searchLoansin(MultivaluedMap queryParams, + private LoansinCommonList searchLoansin( + MultivaluedMap queryParams, String keywords) { LoansinCommonList loansinObjectList; try { @@ -456,12 +458,9 @@ public class LoaninResource extends if (logger.isDebugEnabled()) { logger.debug("The WHERE clause is: " + documentFilter.getWhereClause()); } - getRepositoryClient(ctx).getFiltered(ctx, handler); - } else { - getRepositoryClient(ctx).getAll(ctx, handler); - } - loansinObjectList = (LoansinCommonList) handler.getCommonPartList(); - + } + getRepositoryClient(ctx).getFiltered(ctx, handler); + loansinObjectList = (LoansinCommonList) handler.getCommonPartList(); } catch (UnauthorizedException ue) { Response response = Response.status( Response.Status.UNAUTHORIZED).entity("Index failed reason " + ue.getErrorReason()).type("text/plain").build(); diff --git a/services/loanout/client/src/main/java/org/collectionspace/services/client/LoanoutClient.java b/services/loanout/client/src/main/java/org/collectionspace/services/client/LoanoutClient.java index 8771e1ae1..914451351 100644 --- a/services/loanout/client/src/main/java/org/collectionspace/services/client/LoanoutClient.java +++ b/services/loanout/client/src/main/java/org/collectionspace/services/client/LoanoutClient.java @@ -48,7 +48,7 @@ public class LoanoutClient extends AbstractServiceClientImpl { /** * */ - private static final LoanoutClient instance = new LoanoutClient(); +// private static final LoanoutClient instance = new LoanoutClient(); /** * */ @@ -88,9 +88,9 @@ public class LoanoutClient extends AbstractServiceClientImpl { * * @return */ - public static LoanoutClient getInstance() { - return instance; - } +// public static LoanoutClient getInstance() { +// return instance; +// } /** * @return diff --git a/services/loanout/client/src/test/java/org/collectionspace/services/client/test/LoanoutAuthRefsTest.java b/services/loanout/client/src/test/java/org/collectionspace/services/client/test/LoanoutAuthRefsTest.java index ef19f4c5f..bec4f9940 100644 --- a/services/loanout/client/src/test/java/org/collectionspace/services/client/test/LoanoutAuthRefsTest.java +++ b/services/loanout/client/src/test/java/org/collectionspace/services/client/test/LoanoutAuthRefsTest.java @@ -36,10 +36,10 @@ import org.collectionspace.services.client.LoanoutClient; import org.collectionspace.services.client.PersonAuthorityClient; import org.collectionspace.services.client.PersonAuthorityClientUtils; import org.collectionspace.services.common.authorityref.AuthorityRefList; -import org.collectionspace.services.common.authorityref.AuthorityRefList.AuthorityRefItem; +//import org.collectionspace.services.common.authorityref.AuthorityRefList.AuthorityRefItem; import org.collectionspace.services.jaxb.AbstractCommonList; import org.collectionspace.services.loanout.LoansoutCommon; -import org.collectionspace.services.loanout.LoansoutCommonList; +//import org.collectionspace.services.loanout.LoansoutCommonList; import org.jboss.resteasy.client.ClientResponse; @@ -69,8 +69,8 @@ public class LoanoutAuthRefsTest extends BaseServiceTest { final String SERVICE_PATH_COMPONENT = "loansout"; final String PERSON_AUTHORITY_NAME = "TestPersonAuth"; private String knownResourceId = null; - private List loanoutIdsCreated = new ArrayList(); - private List personIdsCreated = new ArrayList(); + private List loanoutIdsCreated = new ArrayList(); + private List personIdsCreated = new ArrayList(); private int CREATED_STATUS = Response.Status.CREATED.getStatusCode(); private int OK_STATUS = Response.Status.OK.getStatusCode(); private String personAuthCSID = null; @@ -300,19 +300,20 @@ public class LoanoutAuthRefsTest extends BaseServiceTest { } PersonAuthorityClient personAuthClient = new PersonAuthorityClient(); // Delete Person resource(s) (before PersonAuthority resources). - ClientResponse res; for (String resourceId : personIdsCreated) { // Note: Any non-success responses are ignored and not reported. - res = personAuthClient.deleteItem(personAuthCSID, resourceId); + personAuthClient.deleteItem(personAuthCSID, resourceId); } // Delete PersonAuthority resource(s). // Note: Any non-success response is ignored and not reported. - res = personAuthClient.delete(personAuthCSID); - // Delete Loans In resource(s). - LoanoutClient loanoutClient = new LoanoutClient(); - for (String resourceId : loanoutIdsCreated) { - // Note: Any non-success responses are ignored and not reported. - res = loanoutClient.delete(resourceId); + if (personAuthCSID != null) { + personAuthClient.delete(personAuthCSID); + // Delete Loans In resource(s). + LoanoutClient loanoutClient = new LoanoutClient(); + for (String resourceId : loanoutIdsCreated) { + // Note: Any non-success responses are ignored and not reported. + loanoutClient.delete(resourceId); + } } } diff --git a/services/loanout/service/src/main/java/org/collectionspace/services/loanout/LoanoutResource.java b/services/loanout/service/src/main/java/org/collectionspace/services/loanout/LoanoutResource.java index bf6ef7c56..36350a669 100644 --- a/services/loanout/service/src/main/java/org/collectionspace/services/loanout/LoanoutResource.java +++ b/services/loanout/service/src/main/java/org/collectionspace/services/loanout/LoanoutResource.java @@ -45,8 +45,6 @@ import org.collectionspace.services.common.AbstractMultiPartCollectionSpaceResou 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; @@ -57,7 +55,7 @@ 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; @@ -253,7 +251,7 @@ public class LoanoutResource extends try { ServiceContext ctx = createServiceContext(queryParams); DocumentHandler handler = createDocumentHandler(ctx); - getRepositoryClient(ctx).getAll(ctx, handler); + getRepositoryClient(ctx).getFiltered(ctx, handler); loanoutObjectList = (LoansoutCommonList) handler.getCommonPartList(); } catch (UnauthorizedException ue) { Response response = Response.status( @@ -290,8 +288,8 @@ public class LoanoutResource extends ServiceContext ctx = createServiceContext(queryParams); DocumentWrapper docWrapper = getRepositoryClient(ctx).getDoc(ctx, csid); - RemoteDocumentModelHandlerImpl handler - = (RemoteDocumentModelHandlerImpl)createDocumentHandler(ctx); + DocumentModelHandler handler + = (DocumentModelHandler)createDocumentHandler(ctx); List authRefFields = ((MultipartServiceContextImpl)ctx).getCommonPartPropertyValues( ServiceBindingUtils.AUTH_REF_PROP, ServiceBindingUtils.QUALIFIED_PROP_NAMES); @@ -456,12 +454,9 @@ public class LoanoutResource extends if (logger.isDebugEnabled()) { logger.debug("The WHERE clause is: " + documentFilter.getWhereClause()); } - getRepositoryClient(ctx).getFiltered(ctx, handler); - } else { - getRepositoryClient(ctx).getAll(ctx, handler); - } + } + getRepositoryClient(ctx).getFiltered(ctx, handler); loansoutObjectList = (LoansoutCommonList) handler.getCommonPartList(); - } catch (UnauthorizedException ue) { Response response = Response.status( Response.Status.UNAUTHORIZED).entity("Index failed reason " + ue.getErrorReason()).type("text/plain").build(); diff --git a/services/organization/client/src/main/java/org/collectionspace/services/client/OrgAuthorityClient.java b/services/organization/client/src/main/java/org/collectionspace/services/client/OrgAuthorityClient.java index 95b2195a1..5894be657 100644 --- a/services/organization/client/src/main/java/org/collectionspace/services/client/OrgAuthorityClient.java +++ b/services/organization/client/src/main/java/org/collectionspace/services/client/OrgAuthorityClient.java @@ -1,6 +1,32 @@ +/** + * OrgAuthorityClient.java + * + * {Purpose of This Class} + * + * {Other Notes Relating to This Class (Optional)} + * + * $LastChangedBy: $ + * $LastChangedRevision: $ + * $LastChangedDate: $ + * + * 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 {Contributing Institution} + * + * 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.client; -import javax.ws.rs.PathParam; +//import javax.ws.rs.PathParam; import javax.ws.rs.core.Response; import org.collectionspace.services.common.authorityref.AuthorityRefList; @@ -16,9 +42,7 @@ import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput; import org.jboss.resteasy.spi.ResteasyProviderFactory; /** - * A OrgAuthorityClient. - - * @version $Revision:$ + * The Class OrgAuthorityClient. */ public class OrgAuthorityClient extends AbstractServiceClientImpl { @@ -30,22 +54,23 @@ public class OrgAuthorityClient extends AbstractServiceClientImpl { return "orgauthorities"; } - public String getItemCommonPartName() { - return getCommonPartName("organizations"); - } - /** - * - */ - private static final OrgAuthorityClient instance = new OrgAuthorityClient(); /** + * Gets the item common part name. * + * @return the item common part name */ + public String getItemCommonPartName() { + return getCommonPartName("organizations"); + } + + /** The Constant instance. */ //FIXME: This is wrong. There should NOT be a static instance of the OrgAuthorityClient class +// private static final OrgAuthorityClient instance = new OrgAuthorityClient(); + + /** The org authority proxy. */ private OrgAuthorityProxy orgAuthorityProxy; /** - * - * Default constructor for OrgAuthorityClient class. - * + * Instantiates a new org authority client. */ public OrgAuthorityClient() { ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance(); @@ -53,13 +78,16 @@ public class OrgAuthorityClient extends AbstractServiceClientImpl { setProxy(); } + /* (non-Javadoc) + * @see org.collectionspace.services.client.CollectionSpaceClient#getProxy() + */ @Override public CollectionSpaceProxy getProxy() { return this.orgAuthorityProxy; } /** - * allow to reset proxy as per security needs + * Sets the proxy. */ public void setProxy() { if (useAuth()) { @@ -72,54 +100,59 @@ public class OrgAuthorityClient extends AbstractServiceClientImpl { } /** - * FIXME Comment this + * Gets the single instance of OrgAuthorityClient. * - * @return + * @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; - } +// public static OrgAuthorityClient getInstance() { +// return instance; +// } /** - * @return - * @see org.collectionspace.services.client.OrgAuthorityProxy#readList() + * Read list. + * + * @return the client response */ public ClientResponse readList() { return orgAuthorityProxy.readList(); } /** - * @param csid - * @return - * @see org.collectionspace.services.client.OrgAuthorityProxy#read(java.lang.String) + * Read. + * + * @param csid the csid + * @return the client response */ public ClientResponse read(String csid) { return orgAuthorityProxy.read(csid); } /** - * @param name - * @return - * @see org.collectionspace.services.client.OrgAuthorityProxy#readByName(java.lang.String) + * Read by name. + * + * @param name the name + * @return the client response */ public ClientResponse readByName(String name) { return orgAuthorityProxy.readByName(name); } /** - * @param orgAuthority - * @return - * @see org.collectionspace.services.client.OrgAuthorityProxy#createOrgAuthority(org.collectionspace.hello.OrgAuthority) + * Creates the. + * + * @param multipart the multipart + * @return the client response */ public ClientResponse create(MultipartOutput multipart) { return orgAuthorityProxy.create(multipart); } /** - * @param csid - * @param orgAuthority - * @return - * @see org.collectionspace.services.client.OrgAuthorityProxy#updateOrgAuthority(java.lang.Long, org.collectionspace.hello.OrgAuthority) + * Update. + * + * @param csid the csid + * @param multipart the multipart + * @return the client response */ public ClientResponse update(String csid, MultipartOutput multipart) { return orgAuthorityProxy.update(csid, multipart); @@ -127,57 +160,75 @@ public class OrgAuthorityClient extends AbstractServiceClientImpl { } /** - * @param csid - * @return - * @see org.collectionspace.services.client.OrgAuthorityProxy#deleteOrgAuthority(java.lang.Long) + * Delete. + * + * @param csid the csid + * @return the client response */ public ClientResponse delete(String csid) { return orgAuthorityProxy.delete(csid); } /** - * @return - * @see org.collectionspace.services.client.OrgAuthorityProxy#readItemList() + * Read item list. + * + * @param vcsid the vcsid + * @return the client response */ public ClientResponse readItemList(String vcsid) { return orgAuthorityProxy.readItemList(vcsid); } /** - * @return - * @see org.collectionspace.services.client.OrgAuthorityProxy#readItemListForNamedAuthority() + * Read item list for named authority. + * + * @param specifier the specifier + * @return the client response */ public ClientResponse readItemListForNamedAuthority(String specifier) { return orgAuthorityProxy.readItemListForNamedAuthority(specifier); } + /** + * Gets the item authority refs. + * + * @param parentcsid the parentcsid + * @param csid the csid + * @return the item authority refs + */ public ClientResponse getItemAuthorityRefs(String parentcsid, String csid) { return orgAuthorityProxy.getItemAuthorityRefs(parentcsid, csid); } /** - * @param csid - * @return - * @see org.collectionspace.services.client.OrgAuthorityProxy#read(java.lang.String) + * Read item. + * + * @param vcsid the vcsid + * @param csid the csid + * @return the client response */ public ClientResponse readItem(String vcsid, String csid) { return orgAuthorityProxy.readItem(vcsid, csid); } /** - * @param orgAuthority - * @return - * @see org.collectionspace.services.client.OrgAuthorityProxy#createOrgAuthority(org.collectionspace.hello.OrgAuthority) + * Creates the item. + * + * @param vcsid the vcsid + * @param multipart the multipart + * @return the client response */ public ClientResponse createItem(String vcsid, MultipartOutput multipart) { return orgAuthorityProxy.createItem(vcsid, multipart); } /** - * @param csid - * @param orgAuthority - * @return - * @see org.collectionspace.services.client.OrgAuthorityProxy#updateOrgAuthority(java.lang.Long, org.collectionspace.hello.OrgAuthority) + * Update item. + * + * @param vcsid the vcsid + * @param csid the csid + * @param multipart the multipart + * @return the client response */ public ClientResponse updateItem(String vcsid, String csid, MultipartOutput multipart) { return orgAuthorityProxy.updateItem(vcsid, csid, multipart); @@ -185,34 +236,76 @@ public class OrgAuthorityClient extends AbstractServiceClientImpl { } /** - * @param csid - * @return - * @see org.collectionspace.services.client.OrgAuthorityProxy#deleteOrgAuthority(java.lang.Long) + * Delete item. + * + * @param vcsid the vcsid + * @param csid the csid + * @return the client response */ public ClientResponse deleteItem(String vcsid, String csid) { return orgAuthorityProxy.deleteItem(vcsid, csid); } + /** + * Creates the contact. + * + * @param parentcsid the parentcsid + * @param itemcsid the itemcsid + * @param multipart the multipart + * @return the client response + */ public ClientResponse createContact(String parentcsid, String itemcsid, MultipartOutput multipart) { return orgAuthorityProxy.createContact(parentcsid, itemcsid, multipart); } + /** + * Read contact. + * + * @param parentcsid the parentcsid + * @param itemcsid the itemcsid + * @param csid the csid + * @return the client response + */ public ClientResponse readContact(String parentcsid, String itemcsid, String csid) { return orgAuthorityProxy.readContact(parentcsid, itemcsid, csid); } + /** + * Read contact list. + * + * @param parentcsid the parentcsid + * @param itemcsid the itemcsid + * @return the client response + */ public ClientResponse readContactList(String parentcsid, String itemcsid) { return orgAuthorityProxy.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 updateContact(String parentcsid, String itemcsid, String csid, MultipartOutput multipart) { return orgAuthorityProxy.updateContact(parentcsid, itemcsid, csid, multipart); } + /** + * Delete contact. + * + * @param parentcsid the parentcsid + * @param itemcsid the itemcsid + * @param csid the csid + * @return the client response + */ public ClientResponse deleteContact(String parentcsid, String itemcsid, String csid) { return orgAuthorityProxy.deleteContact(parentcsid, diff --git a/services/person/client/src/main/java/org/collectionspace/services/client/PersonAuthorityClient.java b/services/person/client/src/main/java/org/collectionspace/services/client/PersonAuthorityClient.java index 782743beb..c34e5ca9a 100644 --- a/services/person/client/src/main/java/org/collectionspace/services/client/PersonAuthorityClient.java +++ b/services/person/client/src/main/java/org/collectionspace/services/client/PersonAuthorityClient.java @@ -1,9 +1,35 @@ +/** + * PersonAuthorityClient.java + * + * {Purpose of This Class} + * + * {Other Notes Relating to This Class (Optional)} + * + * $LastChangedBy: $ + * $LastChangedRevision: $ + * $LastChangedDate: $ + * + * 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 {Contributing Institution} + * + * 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.client; import javax.ws.rs.PathParam; import javax.ws.rs.core.Response; -import org.collectionspace.services.common.authorityref.AuthorityRefList; +//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; @@ -18,9 +44,7 @@ import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput; import org.jboss.resteasy.spi.ResteasyProviderFactory; /** - * A PersonAuthorityClient. - - * @version $Revision:$ + * The Class PersonAuthorityClient. */ public class PersonAuthorityClient extends AbstractServiceClientImpl { @@ -32,23 +56,25 @@ public class PersonAuthorityClient extends AbstractServiceClientImpl { return "personauthorities"; } + /** + * Gets the item common part name. + * + * @return the item common part name + */ public String getItemCommonPartName() { return getCommonPartName("persons"); } - /** - * - */ - private static final PersonAuthorityClient instance = new PersonAuthorityClient(); + /** The person authority proxy. */ +// private static final PersonAuthorityClient instance = new PersonAuthorityClient(); + /** * */ private PersonAuthorityProxy personAuthorityProxy; /** - * - * Default constructor for PersonAuthorityClient class. - * + * Instantiates a new person authority client. */ public PersonAuthorityClient() { ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance(); @@ -56,13 +82,16 @@ public class PersonAuthorityClient extends AbstractServiceClientImpl { setProxy(); } + /* (non-Javadoc) + * @see org.collectionspace.services.client.CollectionSpaceClient#getProxy() + */ @Override public CollectionSpaceProxy getProxy() { return this.personAuthorityProxy; } /** - * allow to reset proxy as per security needs + * Sets the proxy. */ public void setProxy() { if (useAuth()) { @@ -75,16 +104,16 @@ public class PersonAuthorityClient extends AbstractServiceClientImpl { } /** - * FIXME Comment this + * Read list. * - * @return + * @return the client response */ - public static PersonAuthorityClient getInstance() { - return instance; - } +// public static PersonAuthorityClient getInstance() { +// return instance; +// } /** - * @return + * @return list * @see org.collectionspace.services.client.PersonAuthorityProxy#readList() */ public ClientResponse readList() { @@ -92,37 +121,41 @@ public class PersonAuthorityClient extends AbstractServiceClientImpl { } /** - * @param csid - * @return - * @see org.collectionspace.services.client.PersonAuthorityProxy#read(java.lang.String) + * Read. + * + * @param csid the csid + * @return the client response */ public ClientResponse read(String csid) { return personAuthorityProxy.read(csid); } /** - * @param name - * @return - * @see org.collectionspace.services.client.PersonAuthorityProxy#readByName(java.lang.String) + * Read by name. + * + * @param name the name + * @return the client response */ public ClientResponse readByName(String name) { return personAuthorityProxy.readByName(name); } /** - * @param personAuthority - * @return - * @see org.collectionspace.services.client.PersonAuthorityProxy#createPersonAuthority(org.collectionspace.hello.PersonAuthority) + * Creates the. + * + * @param multipart the multipart + * @return the client response */ public ClientResponse create(MultipartOutput multipart) { return personAuthorityProxy.create(multipart); } /** - * @param csid - * @param personAuthority - * @return - * @see org.collectionspace.services.client.PersonAuthorityProxy#updatePersonAuthority(java.lang.Long, org.collectionspace.hello.PersonAuthority) + * Update. + * + * @param csid the csid + * @param multipart the multipart + * @return the client response */ public ClientResponse update(String csid, MultipartOutput multipart) { return personAuthorityProxy.update(csid, multipart); @@ -130,62 +163,75 @@ public class PersonAuthorityClient extends AbstractServiceClientImpl { } /** - * @param csid - * @return - * @see org.collectionspace.services.client.PersonAuthorityProxy#deletePersonAuthority(java.lang.Long) + * Delete. + * + * @param csid the csid + * @return the client response */ public ClientResponse delete(String csid) { return personAuthorityProxy.delete(csid); } /** - * @return - * @see org.collectionspace.services.client.PersonAuthorityProxy#readItemList() + * Read item list. + * + * @param vcsid the vcsid + * @return the client response */ public ClientResponse readItemList(String vcsid) { return personAuthorityProxy.readItemList(vcsid); } /** - * @param csid - * @return - * @see org.collectionspace.services.client.IntakeProxy#getAuthorityRefs(java.lang.String) + * Gets the referencing objects. + * + * @param parentcsid the parentcsid + * @param csid the csid + * @return the referencing objects */ public ClientResponse getReferencingObjects(String parentcsid, String csid) { return personAuthorityProxy.getReferencingObjects(parentcsid, csid); } /** - * @return - * @see org.collectionspace.services.client.PersonAuthorityProxy#readItemListForNamedAuthority() + * Read item list for named authority. + * + * @param specifier the specifier + * @return the client response */ public ClientResponse readItemListForNamedAuthority(String specifier) { return personAuthorityProxy.readItemListForNamedAuthority(specifier); } /** - * @param csid - * @return - * @see org.collectionspace.services.client.PersonAuthorityProxy#read(java.lang.String) + * Read item. + * + * @param vcsid the vcsid + * @param csid the csid + * @return the client response */ public ClientResponse readItem(String vcsid, String csid) { return personAuthorityProxy.readItem(vcsid, csid); } /** - * @param personAuthority - * @return - * @see org.collectionspace.services.client.PersonAuthorityProxy#createPersonAuthority(org.collectionspace.hello.PersonAuthority) + * Creates the item. + * + * @param vcsid the vcsid + * @param multipart the multipart + * @return the client response */ public ClientResponse createItem(String vcsid, MultipartOutput multipart) { return personAuthorityProxy.createItem(vcsid, multipart); } /** - * @param csid - * @param personAuthority - * @return - * @see org.collectionspace.services.client.PersonAuthorityProxy#updatePersonAuthority(java.lang.Long, org.collectionspace.hello.PersonAuthority) + * Update item. + * + * @param vcsid the vcsid + * @param csid the csid + * @param multipart the multipart + * @return the client response */ public ClientResponse updateItem(String vcsid, String csid, MultipartOutput multipart) { return personAuthorityProxy.updateItem(vcsid, csid, multipart); @@ -193,34 +239,76 @@ public class PersonAuthorityClient extends AbstractServiceClientImpl { } /** - * @param csid - * @return - * @see org.collectionspace.services.client.PersonAuthorityProxy#deletePersonAuthority(java.lang.Long) + * Delete item. + * + * @param vcsid the vcsid + * @param csid the csid + * @return the client response */ public ClientResponse deleteItem(String vcsid, String csid) { return personAuthorityProxy.deleteItem(vcsid, csid); } + /** + * Creates the contact. + * + * @param parentcsid the parentcsid + * @param itemcsid the itemcsid + * @param multipart the multipart + * @return the client response + */ public ClientResponse createContact(String parentcsid, String itemcsid, MultipartOutput multipart) { return personAuthorityProxy.createContact(parentcsid, itemcsid, multipart); } + /** + * Read contact. + * + * @param parentcsid the parentcsid + * @param itemcsid the itemcsid + * @param csid the csid + * @return the client response + */ public ClientResponse readContact(String parentcsid, String itemcsid, String csid) { return personAuthorityProxy.readContact(parentcsid, itemcsid, csid); } + /** + * Read contact list. + * + * @param parentcsid the parentcsid + * @param itemcsid the itemcsid + * @return the client response + */ public ClientResponse readContactList(String parentcsid, String itemcsid) { return personAuthorityProxy.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 updateContact(String parentcsid, String itemcsid, String csid, MultipartOutput multipart) { return personAuthorityProxy.updateContact(parentcsid, itemcsid, csid, multipart); } + /** + * Delete contact. + * + * @param parentcsid the parentcsid + * @param itemcsid the itemcsid + * @param csid the csid + * @return the client response + */ public ClientResponse deleteContact(String parentcsid, String itemcsid, String csid) { return personAuthorityProxy.deleteContact(parentcsid, diff --git a/services/pom.xml b/services/pom.xml index 758598c56..58a77a9b5 100644 --- a/services/pom.xml +++ b/services/pom.xml @@ -66,6 +66,10 @@ log4j.configuration file:${project.build.directory}/test-classes/log4j.properties + + maven.basedir + ${basedir} + diff --git a/services/relation/client/src/test/java/org/collectionspace/services/client/test/RelationServiceTest.java b/services/relation/client/src/test/java/org/collectionspace/services/client/test/RelationServiceTest.java index 13f158366..09b34a2ec 100644 --- a/services/relation/client/src/test/java/org/collectionspace/services/client/test/RelationServiceTest.java +++ b/services/relation/client/src/test/java/org/collectionspace/services/client/test/RelationServiceTest.java @@ -55,11 +55,17 @@ import org.slf4j.LoggerFactory; */ public class RelationServiceTest extends AbstractServiceTestImpl { + /** The logger. */ private final Logger logger = LoggerFactory.getLogger(RelationServiceTest.class); + /** The SERVIC e_ pat h_ component. */ final String SERVICE_PATH_COMPONENT = "relations"; + + /** The known resource id. */ private String knownResourceId = null; + + /** The all resource ids created. */ private List allResourceIdsCreated = new ArrayList(); /* (non-Javadoc) @@ -83,6 +89,9 @@ public class RelationServiceTest extends AbstractServiceTestImpl { // CRUD tests : CREATE tests // --------------------------------------------------------------- // Success outcomes + /* (non-Javadoc) + * @see org.collectionspace.services.client.test.ServiceTest#create(java.lang.String) + */ @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class) @Override public void create(String testName) throws Exception { @@ -125,6 +134,9 @@ public class RelationServiceTest extends AbstractServiceTestImpl { allResourceIdsCreated.add(extractId(res)); } + /* (non-Javadoc) + * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#createList(java.lang.String) + */ @Override @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class, dependsOnMethods = {"create"}) @@ -137,13 +149,28 @@ public class RelationServiceTest extends AbstractServiceTestImpl { // Failure outcomes // Placeholders until the three tests below can be uncommented. // See Issue CSPACE-401. + /* (non-Javadoc) + * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#createWithEmptyEntityBody(java.lang.String) + */ + @Override public void createWithEmptyEntityBody(String testName) throws Exception { + //Should this test really be empty? } + /* (non-Javadoc) + * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#createWithMalformedXml(java.lang.String) + */ + @Override public void createWithMalformedXml(String testName) throws Exception { + //Should this test really be empty? } + /* (non-Javadoc) + * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#createWithWrongXmlSchema(java.lang.String) + */ + @Override public void createWithWrongXmlSchema(String testName) throws Exception { + //Should this test really be empty? } /* @@ -230,6 +257,9 @@ public class RelationServiceTest extends AbstractServiceTestImpl { // CRUD tests : READ tests // --------------------------------------------------------------- // Success outcomes + /* (non-Javadoc) + * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#read(java.lang.String) + */ @Override @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class, dependsOnMethods = {"create"}) @@ -261,6 +291,9 @@ public class RelationServiceTest extends AbstractServiceTestImpl { } // Failure outcomes + /* (non-Javadoc) + * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#readNonExistent(java.lang.String) + */ @Override @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class, dependsOnMethods = {"read"}) @@ -284,10 +317,26 @@ public class RelationServiceTest extends AbstractServiceTestImpl { Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE); } + /* (non-Javadoc) + * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#readPaginatedList(java.lang.String) + */ + @Test(dataProvider = "testName") + /* + * FIXME: Until the Relation service uses NXQL queries to get results, + * we need to skip the pagination tests + */ + @Override + public void readPaginatedList(String testName) throws Exception { + //Override and skip the pagination tests + } + // --------------------------------------------------------------- // CRUD tests : READ_LIST tests // --------------------------------------------------------------- // Success outcomes + /* (non-Javadoc) + * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#readList(java.lang.String) + */ @Override @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class, dependsOnMethods = {"createList", "read"}) @@ -336,6 +385,9 @@ public class RelationServiceTest extends AbstractServiceTestImpl { // --------------------------------------------------------------- // Success outcomes + /* (non-Javadoc) + * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#update(java.lang.String) + */ @Override @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class, dependsOnMethods = {"read"}) @@ -407,13 +459,28 @@ public class RelationServiceTest extends AbstractServiceTestImpl { // Failure outcomes // Placeholders until the three tests below can be uncommented. // See Issue CSPACE-401. + /* (non-Javadoc) + * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#updateWithEmptyEntityBody(java.lang.String) + */ + @Override public void updateWithEmptyEntityBody(String testName) throws Exception { + //Should this test really be empty? } + /* (non-Javadoc) + * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#updateWithMalformedXml(java.lang.String) + */ + @Override public void updateWithMalformedXml(String testName) throws Exception { + //Should this test really be empty? } + /* (non-Javadoc) + * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#updateWithWrongXmlSchema(java.lang.String) + */ + @Override public void updateWithWrongXmlSchema(String testName) throws Exception { + //Should this test really be empty? } /* @@ -496,6 +563,9 @@ public class RelationServiceTest extends AbstractServiceTestImpl { } */ + /* (non-Javadoc) + * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#updateNonExistent(java.lang.String) + */ @Override @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class, dependsOnMethods = {"update", "testSubmitRequest"}) @@ -527,6 +597,9 @@ public class RelationServiceTest extends AbstractServiceTestImpl { // CRUD tests : DELETE tests // --------------------------------------------------------------- // Success outcomes + /* (non-Javadoc) + * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#delete(java.lang.String) + */ @Override @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class, dependsOnMethods = {"create", "readList", "testSubmitRequest", "update"}) @@ -551,6 +624,9 @@ public class RelationServiceTest extends AbstractServiceTestImpl { } // Failure outcomes + /* (non-Javadoc) + * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#deleteNonExistent(java.lang.String) + */ @Override @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class, dependsOnMethods = {"delete"}) @@ -577,8 +653,12 @@ public class RelationServiceTest extends AbstractServiceTestImpl { // --------------------------------------------------------------- // RELATE_OBJECT tests // --------------------------------------------------------------- + /** + * Relate objects. + */ @Test(dependsOnMethods = {"create"}) public void relateObjects() { + //Should this test really be empty? } // --------------------------------------------------------------- @@ -643,11 +723,20 @@ public class RelationServiceTest extends AbstractServiceTestImpl { // --------------------------------------------------------------- // Utility methods used by tests above // --------------------------------------------------------------- + /* (non-Javadoc) + * @see org.collectionspace.services.client.test.BaseServiceTest#getServicePathComponent() + */ @Override public String getServicePathComponent() { return SERVICE_PATH_COMPONENT; } + /** + * Creates the relation instance. + * + * @param identifier the identifier + * @return the multipart output + */ private MultipartOutput createRelationInstance(String identifier) { RelationsCommon relation = new RelationsCommon(); fillRelation(relation, identifier); @@ -665,10 +754,9 @@ public class RelationServiceTest extends AbstractServiceTestImpl { /** * Fills the relation. - * + * + * @param relation the relation * @param identifier the identifier - * - * @return the relation */ private void fillRelation(RelationsCommon relation, String identifier) { fillRelation(relation, "Subject-" + identifier, @@ -680,14 +768,13 @@ public class RelationServiceTest extends AbstractServiceTestImpl { /** * Fills the relation. - * + * + * @param relation the relation * @param documentId1 the document id1 * @param documentType1 the document type1 * @param documentId2 the document id2 * @param documentType2 the document type2 * @param rt the rt - * - * @return the relation */ private void fillRelation(RelationsCommon relation, String documentId1, String documentType1, diff --git a/services/relation/service/src/main/java/org/collectionspace/services/relation/NewRelationResource.java b/services/relation/service/src/main/java/org/collectionspace/services/relation/NewRelationResource.java index eeaa84c0f..b57cdea49 100644 --- a/services/relation/service/src/main/java/org/collectionspace/services/relation/NewRelationResource.java +++ b/services/relation/service/src/main/java/org/collectionspace/services/relation/NewRelationResource.java @@ -38,6 +38,7 @@ import javax.ws.rs.PUT; import javax.ws.rs.PathParam; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.Context; +import javax.ws.rs.core.MultivaluedMap; import javax.ws.rs.core.Response; import javax.ws.rs.core.UriBuilder; import javax.ws.rs.core.UriInfo; @@ -151,14 +152,16 @@ public class NewRelationResource extends /** * Gets the relation. - * + * + * @param ui the ui * @param csid the csid - * * @return the relation */ @GET @Path("{csid}") - public MultipartOutput getRelation(@PathParam("csid") String csid) { + public MultipartOutput getRelation(@Context UriInfo ui, + @PathParam("csid") String csid) { + MultivaluedMap queryParams = ui.getQueryParameters(); if (logger.isDebugEnabled()) { logger.debug("getRelation with csid=" + csid); } @@ -171,7 +174,7 @@ public class NewRelationResource extends } MultipartOutput result = null; try { - ServiceContext ctx = createServiceContext(); + ServiceContext ctx = createServiceContext(queryParams); DocumentHandler handler = createDocumentHandler(ctx); getRepositoryClient(ctx).get(ctx, csid, handler); result = (MultipartOutput) ctx.getOutput(); @@ -222,7 +225,8 @@ public class NewRelationResource extends @GET @Produces("application/xml") public RelationsCommonList getRelationList(@Context UriInfo ui) { - return this.getRelationList(null, null, null); + MultivaluedMap queryParams = ui.getQueryParameters(); + return this.getRelationList(queryParams, null, null, null); } /** @@ -238,7 +242,8 @@ public class NewRelationResource extends @Produces("application/xml") public RelationsCommonList getRelationList_S(@Context UriInfo ui, @PathParam("subjectCsid") String subjectCsid) { - return this.getRelationList(subjectCsid, null, null); + MultivaluedMap queryParams = ui.getQueryParameters(); + return this.getRelationList(queryParams, subjectCsid, null, null); } /** @@ -254,7 +259,8 @@ public class NewRelationResource extends @Produces("application/xml") public RelationsCommonList getRelationList_P(@Context UriInfo ui, @PathParam("predicate") String predicate) { - return this.getRelationList(null, predicate, null); + MultivaluedMap queryParams = ui.getQueryParameters(); + return this.getRelationList(queryParams, null, predicate, null); } /** @@ -270,7 +276,8 @@ public class NewRelationResource extends @Produces("application/xml") public RelationsCommonList getRelationList_O(@Context UriInfo ui, @PathParam("objectCsid") String objectCsid) { - return this.getRelationList(null, null, objectCsid); + MultivaluedMap queryParams = ui.getQueryParameters(); + return this.getRelationList(queryParams, null, null, objectCsid); } /** @@ -288,7 +295,8 @@ public class NewRelationResource extends public RelationsCommonList getRelationList_PS(@Context UriInfo ui, @PathParam("predicate") String predicate, @PathParam("subjectCsid") String subjectCsid) { - return this.getRelationList(subjectCsid, predicate, null); + MultivaluedMap queryParams = ui.getQueryParameters(); + return this.getRelationList(queryParams, subjectCsid, predicate, null); } /** @@ -306,7 +314,8 @@ public class NewRelationResource extends public RelationsCommonList getRelationList_SP(@Context UriInfo ui, @PathParam("subjectCsid") String subjectCsid, @PathParam("predicate") String predicate) { - return this.getRelationList(subjectCsid, predicate, null); + MultivaluedMap queryParams = ui.getQueryParameters(); + return this.getRelationList(queryParams, subjectCsid, predicate, null); } /** @@ -324,7 +333,8 @@ public class NewRelationResource extends public RelationsCommonList getRelationList_PO(@Context UriInfo ui, @PathParam("predicate") String predicate, @PathParam("objectCsid") String objectCsid) { - return this.getRelationList(null, predicate, objectCsid); + MultivaluedMap queryParams = ui.getQueryParameters(); + return this.getRelationList(queryParams, null, predicate, objectCsid); } /** @@ -342,7 +352,8 @@ public class NewRelationResource extends public RelationsCommonList getRelationList_OP(@Context UriInfo ui, @PathParam("objectCsid") String objectCsid, @PathParam("predicate") String predicate) { - return this.getRelationList(null, predicate, objectCsid); + MultivaluedMap queryParams = ui.getQueryParameters(); + return this.getRelationList(queryParams, null, predicate, objectCsid); } /** @@ -362,7 +373,8 @@ public class NewRelationResource extends @PathParam("predicate") String predicate, @PathParam("subjectCsid") String subjectCsid, @PathParam("objectCsid") String objectCsid) { - return this.getRelationList(subjectCsid, predicate, objectCsid); + MultivaluedMap queryParams = ui.getQueryParameters(); + return this.getRelationList(queryParams, subjectCsid, predicate, objectCsid); } /** @@ -382,7 +394,8 @@ public class NewRelationResource extends @PathParam("subjectCsid") String subjectCsid, @PathParam("predicate") String predicate, @PathParam("objectCsid") String objectCsid) { - return this.getRelationList(subjectCsid, predicate, objectCsid); + MultivaluedMap queryParams = ui.getQueryParameters(); + return this.getRelationList(queryParams, subjectCsid, predicate, objectCsid); } /* @@ -487,23 +500,29 @@ public class NewRelationResource extends } /** - * Gets the relation list request. - * - * @return the relation list request - * - * @throws WebApplicationException - * the web application exception + * Gets the relation list. + * + * @param queryParams the query params + * @param subjectCsid the subject csid + * @param predicate the predicate + * @param objectCsid the object csid + * @return the relation list + * @throws WebApplicationException the web application exception */ - public RelationsCommonList getRelationList(String subjectCsid, - String predicate, String objectCsid) throws WebApplicationException { + public RelationsCommonList getRelationList( + MultivaluedMap queryParams, + String subjectCsid, + String predicate, + String objectCsid) throws WebApplicationException { RelationsCommonList relationList = new RelationsCommonList(); try { - ServiceContext ctx = createServiceContext(); + ServiceContext ctx = createServiceContext(queryParams); DocumentHandler handler = createDocumentHandler(ctx); Map propsFromPath = handler.getProperties(); propsFromPath.put(IRelationsManager.SUBJECT, subjectCsid); propsFromPath.put(IRelationsManager.PREDICATE, predicate); propsFromPath.put(IRelationsManager.OBJECT, objectCsid); + // Until we replace this with a search, "getAll()" is better then "getFiltered" getRepositoryClient(ctx).getAll(ctx, handler); relationList = (RelationsCommonList) handler.getCommonPartList(); } catch (UnauthorizedException ue) { diff --git a/services/vocabulary/client/src/main/java/org/collectionspace/services/client/VocabularyClient.java b/services/vocabulary/client/src/main/java/org/collectionspace/services/client/VocabularyClient.java index 94d9af755..a5f3fb537 100644 --- a/services/vocabulary/client/src/main/java/org/collectionspace/services/client/VocabularyClient.java +++ b/services/vocabulary/client/src/main/java/org/collectionspace/services/client/VocabularyClient.java @@ -1,3 +1,29 @@ +/** + * VocabularyClient.java + * + * {Purpose of This Class} + * + * {Other Notes Relating to This Class (Optional)} + * + * $LastChangedBy: $ + * $LastChangedRevision: $ + * $LastChangedDate: $ + * + * 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 {Contributing Institution} + * + * 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.client; import javax.ws.rs.core.Response; @@ -14,9 +40,7 @@ import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput; import org.jboss.resteasy.spi.ResteasyProviderFactory; /** - * A VocabularyClient. - - * @version $Revision:$ + * The Class VocabularyClient. */ public class VocabularyClient extends AbstractServiceClientImpl { @@ -28,22 +52,23 @@ public class VocabularyClient extends AbstractServiceClientImpl { return "vocabularies"; } - public String getItemCommonPartName() { - return getCommonPartName("vocabularyitems"); - } - /** - * - */ - private static final VocabularyClient instance = new VocabularyClient(); /** + * Gets the item common part name. * + * @return the item common part name */ + public String getItemCommonPartName() { + return getCommonPartName("vocabularyitems"); + } + + /** 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; /** - * - * Default constructor for VocabularyClient class. - * + * Instantiates a new vocabulary client. */ public VocabularyClient() { ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance(); @@ -51,13 +76,16 @@ public class VocabularyClient extends AbstractServiceClientImpl { setProxy(); } + /* (non-Javadoc) + * @see org.collectionspace.services.client.CollectionSpaceClient#getProxy() + */ @Override public CollectionSpaceProxy getProxy() { return this.vocabularyProxy; } /** - * allow to reset proxy as per security needs + * Sets the proxy. */ public void setProxy() { if (useAuth()) { @@ -68,45 +96,49 @@ public class VocabularyClient extends AbstractServiceClientImpl { } /** - * FIXME Comment this + * Gets the single instance of VocabularyClient. * - * @return + * @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; - } +// public static VocabularyClient getInstance() { +// return instance; +// } /** - * @return - * @see org.collectionspace.services.client.VocabularyProxy#readList() + * Read list. + * + * @return the client response */ public ClientResponse readList() { return vocabularyProxy.readList(); } /** - * @param csid - * @return - * @see org.collectionspace.services.client.VocabularyProxy#read(java.lang.String) + * Read. + * + * @param csid the csid + * @return the client response */ public ClientResponse read(String csid) { return vocabularyProxy.read(csid); } /** - * @param vocabulary - * @return - * @see org.collectionspace.services.client.VocabularyProxy#createVocabulary(org.collectionspace.hello.Vocabulary) + * Creates the. + * + * @param multipart the multipart + * @return the client response */ public ClientResponse create(MultipartOutput multipart) { return vocabularyProxy.create(multipart); } /** - * @param csid - * @param vocabulary - * @return - * @see org.collectionspace.services.client.VocabularyProxy#updateVocabulary(java.lang.Long, org.collectionspace.hello.Vocabulary) + * Update. + * + * @param csid the csid + * @param multipart the multipart + * @return the client response */ public ClientResponse update(String csid, MultipartOutput multipart) { return vocabularyProxy.update(csid, multipart); @@ -114,45 +146,54 @@ public class VocabularyClient extends AbstractServiceClientImpl { } /** - * @param csid - * @return - * @see org.collectionspace.services.client.VocabularyProxy#deleteVocabulary(java.lang.Long) + * Delete. + * + * @param csid the csid + * @return the client response */ public ClientResponse delete(String csid) { return vocabularyProxy.delete(csid); } /** - * @return - * @see org.collectionspace.services.client.VocabularyProxy#readItemList() + * Read item list. + * + * @param vcsid the vcsid + * @return the client response */ public ClientResponse readItemList(String vcsid) { return vocabularyProxy.readItemList(vcsid); } /** - * @param csid - * @return - * @see org.collectionspace.services.client.VocabularyProxy#read(java.lang.String) + * Read item. + * + * @param vcsid the vcsid + * @param csid the csid + * @return the client response */ public ClientResponse readItem(String vcsid, String csid) { return vocabularyProxy.readItem(vcsid, csid); } /** - * @param vocabulary - * @return - * @see org.collectionspace.services.client.VocabularyProxy#createVocabulary(org.collectionspace.hello.Vocabulary) + * Creates the item. + * + * @param vcsid the vcsid + * @param multipart the multipart + * @return the client response */ public ClientResponse createItem(String vcsid, MultipartOutput multipart) { return vocabularyProxy.createItem(vcsid, multipart); } /** - * @param csid - * @param vocabulary - * @return - * @see org.collectionspace.services.client.VocabularyProxy#updateVocabulary(java.lang.Long, org.collectionspace.hello.Vocabulary) + * Update item. + * + * @param vcsid the vcsid + * @param csid the csid + * @param multipart the multipart + * @return the client response */ public ClientResponse updateItem(String vcsid, String csid, MultipartOutput multipart) { return vocabularyProxy.updateItem(vcsid, csid, multipart); @@ -160,9 +201,11 @@ public class VocabularyClient extends AbstractServiceClientImpl { } /** - * @param csid - * @return - * @see org.collectionspace.services.client.VocabularyProxy#deleteVocabulary(java.lang.Long) + * Delete item. + * + * @param vcsid the vcsid + * @param csid the csid + * @return the client response */ public ClientResponse deleteItem(String vcsid, String csid) { return vocabularyProxy.deleteItem(vcsid, csid); -- 2.47.3