]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
NOJIRA - cleaned up the Vocab/Authority client and proxy classes to reflect the parti...
authorPatrick Schmitz <pschmitz@berkeley.edu>
Tue, 6 Jul 2010 17:10:48 +0000 (17:10 +0000)
committerPatrick Schmitz <pschmitz@berkeley.edu>
Tue, 6 Jul 2010 17:10:48 +0000 (17:10 +0000)
12 files changed:
services/location/client/src/main/java/org/collectionspace/services/client/LocationAuthorityClient.java
services/location/client/src/main/java/org/collectionspace/services/client/LocationAuthorityProxy.java
services/location/client/src/test/java/org/collectionspace/services/client/test/LocationAuthorityServiceTest.java
services/organization/client/src/main/java/org/collectionspace/services/client/OrgAuthorityClient.java
services/organization/client/src/main/java/org/collectionspace/services/client/OrgAuthorityProxy.java
services/organization/client/src/test/java/org/collectionspace/services/client/test/OrgAuthorityServiceTest.java
services/person/client/src/main/java/org/collectionspace/services/client/PersonAuthorityClient.java
services/person/client/src/main/java/org/collectionspace/services/client/PersonAuthorityProxy.java
services/person/client/src/test/java/org/collectionspace/services/client/test/PersonAuthorityServiceTest.java
services/vocabulary/client/src/main/java/org/collectionspace/services/client/VocabularyClient.java
services/vocabulary/client/src/main/java/org/collectionspace/services/client/VocabularyProxy.java
services/vocabulary/client/src/test/java/org/collectionspace/services/client/test/VocabularyServiceTest.java

index 5f3e77d136e842a415d19e2bf4246725e5d5c65b..5613d9ba226866c2dd7c2ef609db6537785660c7 100644 (file)
@@ -173,13 +173,20 @@ public class LocationAuthorityClient extends AbstractServiceClientImpl {
     }
 
     /**
-     * Read item list.
+     * Read item list, filtering by partial term match, or keywords. Only one of
+     * partialTerm or keywords should be specified. If both are specified, keywords
+     * will be ignored.
      *
-     * @param vcsid the vcsid
+     * @param inAuthority the parent authority
+     * @param partialTerm A partial term on which to match,
+     *     which will filter list results to return only matched resources.
+     * @param keywords A set of keywords on which to match,
+     *     which will filter list results to return only matched resources.
      * @return the client response
      */
-    public ClientResponse<LocationsCommonList> readItemList(String vcsid) {
-        return locationAuthorityProxy.readItemList(vcsid);
+    public ClientResponse<LocationsCommonList> 
+               readItemList(String inAuthority, String partialTerm, String keywords) {
+        return locationAuthorityProxy.readItemList(inAuthority, partialTerm, keywords);
     }
 
     /**
@@ -194,13 +201,20 @@ public class LocationAuthorityClient extends AbstractServiceClientImpl {
     }
 
     /**
-     * Read item list for named authority.
+     * Read item list for named vocabulary, filtering by partial term match, or keywords. Only one of
+     * partialTerm or keywords should be specified. If both are specified, keywords
+     * will be ignored.
      *
      * @param specifier the specifier
+     * @param partialTerm A partial term on which to match,
+     *     which will filter list results to return only matched resources.
+     * @param keywords A set of keywords on which to match,
+     *     which will filter list results to return only matched resources.
      * @return the client response
      */
-    public ClientResponse<LocationsCommonList> readItemListForNamedAuthority(String specifier) {
-        return locationAuthorityProxy.readItemListForNamedAuthority(specifier);
+    public ClientResponse<LocationsCommonList> 
+               readItemListForNamedAuthority(String specifier, String partialTerm, String keywords) {
+        return locationAuthorityProxy.readItemListForNamedAuthority(specifier, partialTerm, keywords);
     }
 
     /**
index 863265bd0a818fb51bf436d4d8838830696324c2..d577d69f3e021a3b7336be1a7157fa5bae8ef5da 100644 (file)
@@ -8,8 +8,10 @@ import javax.ws.rs.PUT;
 import javax.ws.rs.Path;
 import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
 import javax.ws.rs.core.Response;
 
+import org.collectionspace.services.common.query.IQueryManager;
 import org.collectionspace.services.common.authorityref.AuthorityRefDocList;
 import org.collectionspace.services.contact.ContactsCommonList;
 import org.collectionspace.services.location.LocationauthoritiesCommonList;
@@ -55,11 +57,14 @@ public interface LocationAuthorityProxy extends CollectionSpaceProxy {
     @Path("/{csid}")
     ClientResponse<Response> delete(@PathParam("csid") String csid);
 
-    // List Items
+    // List Items matching a partial term or keywords.
     @GET
     @Produces({"application/xml"})
     @Path("/{vcsid}/items/")
-    ClientResponse<LocationsCommonList> readItemList(@PathParam("vcsid") String vcsid);
+    ClientResponse<LocationsCommonList> readItemList(
+               @PathParam("vcsid") String vcsid,
+            @QueryParam (IQueryManager.SEARCH_TYPE_PARTIALTERM) String partialTerm,
+            @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords);
 
     /**
      * @param csid
@@ -73,11 +78,14 @@ public interface LocationAuthorityProxy extends CollectionSpaceProxy {
             @PathParam("csid") String parentcsid,
             @PathParam("itemcsid") String itemcsid);
 
-    // List Items for a named authority
+    // List Items for a named authority matching a partial term or keywords.
     @GET
     @Produces({"application/xml"})
     @Path("/urn:cspace:name({specifier})/items/")
-    ClientResponse<LocationsCommonList> readItemListForNamedAuthority(@PathParam("specifier") String specifier);
+    ClientResponse<LocationsCommonList> readItemListForNamedAuthority(
+               @PathParam("specifier") String specifier,
+            @QueryParam (IQueryManager.SEARCH_TYPE_PARTIALTERM) String partialTerm,
+            @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords);
 
     //(C)reate Item
     @POST
index e6de389dd040765056c7dbdad6a6b3bf34f8470f..c9aefb2dba316be2c45c633ff0cacc5300115fef 100644 (file)
@@ -807,9 +807,9 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl {
         LocationAuthorityClient client = new LocationAuthorityClient();
         ClientResponse<LocationsCommonList> res = null;
         if(vcsid!= null) {
-               res = client.readItemList(vcsid);
+               res = client.readItemList(vcsid, null, null);
         } else if(shortId!= null) {
-               res = client.readItemListForNamedAuthority(shortId);
+               res = client.readItemListForNamedAuthority(shortId, null, null);
         } else {
                Assert.fail("readItemList passed null csid and name!");
         }
index b826dac194efe5702dd4faf210e69b46c6616d51..612c0866647527e816272945dbfc4ef21c6137b0 100644 (file)
@@ -172,13 +172,20 @@ public class OrgAuthorityClient extends AbstractServiceClientImpl {
     }
 
     /**
-     * Read item list.
+     * Read item list, filtering by partial term match, or keywords. Only one of
+     * partialTerm or keywords should be specified. If both are specified, keywords
+     * will be ignored.
      *
-     * @param vcsid the vcsid
+     * @param inAuthority the parent authority
+     * @param partialTerm A partial term on which to match,
+     *     which will filter list results to return only matched resources.
+     * @param keywords A set of keywords on which to match,
+     *     which will filter list results to return only matched resources.
      * @return the client response
      */
-    public ClientResponse<OrganizationsCommonList> readItemList(String vcsid) {
-        return orgAuthorityProxy.readItemList(vcsid);
+    public ClientResponse<OrganizationsCommonList> 
+               readItemList(String inAuthority, String partialTerm, String keywords) {
+        return orgAuthorityProxy.readItemList(inAuthority, partialTerm, keywords);
     }
     
     /**
@@ -194,13 +201,20 @@ public class OrgAuthorityClient extends AbstractServiceClientImpl {
     
 
     /**
-     * Read item list for named authority.
+     * Read item list for named vocabulary, filtering by partial term match, or keywords. Only one of
+     * partialTerm or keywords should be specified. If both are specified, keywords
+     * will be ignored.
      *
      * @param specifier the specifier
+     * @param partialTerm A partial term on which to match,
+     *     which will filter list results to return only matched resources.
+     * @param keywords A set of keywords on which to match,
+     *     which will filter list results to return only matched resources.
      * @return the client response
      */
-    public ClientResponse<OrganizationsCommonList> readItemListForNamedAuthority(String specifier) {
-        return orgAuthorityProxy.readItemListForNamedAuthority(specifier);
+    public ClientResponse<OrganizationsCommonList> 
+               readItemListForNamedAuthority(String specifier, String partialTerm, String keywords) {
+        return orgAuthorityProxy.readItemListForNamedAuthority(specifier, partialTerm, keywords);
     }
 
     /**
index 32ca3dbd9073293d4c899dd0ddc9548c36ac846b..162c585723908a2d4f5b27b1a736c9e6d06820b3 100644 (file)
@@ -17,6 +17,7 @@ import org.collectionspace.services.common.authorityref.AuthorityRefList;
 import org.collectionspace.services.contact.ContactsCommonList;
 import org.collectionspace.services.organization.OrgauthoritiesCommonList;
 import org.collectionspace.services.organization.OrganizationsCommonList;
+import org.collectionspace.services.person.PersonsCommonList;
 import org.jboss.resteasy.client.ClientResponse;
 import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
 import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
@@ -58,12 +59,15 @@ public interface OrgAuthorityProxy extends CollectionSpaceProxy {
     @Path("/{csid}")
     ClientResponse<Response> delete(@PathParam("csid") String csid);
 
-    // List Items
+    // List Items with options for matching a partial term or keywords.
     @GET
-    @Produces({"application/xml"})
-    @Path("/{vcsid}/items/")
-    ClientResponse<OrganizationsCommonList> readItemList(@PathParam("vcsid") String vcsid);
-    
+    @Produces("application/xml")
+    @Path("/{csid}/items/")
+    ClientResponse<OrganizationsCommonList>readItemList(
+            @PathParam("csid") String parentcsid,
+            @QueryParam (IQueryManager.SEARCH_TYPE_PARTIALTERM) String partialTerm,
+            @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords);
+
     /**
      * @param parentcsid 
      * @param itemcsid 
@@ -78,20 +82,14 @@ public interface OrgAuthorityProxy extends CollectionSpaceProxy {
             @PathParam("csid") String parentcsid,
             @PathParam("itemcsid") String itemcsid);    
 
-    // List Items for a named authority
-    @GET
-    @Produces({"application/xml"})
-    @Path("/urn:cspace:name({specifier})/items/")
-    ClientResponse<OrganizationsCommonList> readItemListForNamedAuthority(
-               @PathParam("specifier") String specifier);
-
-    // List Items for a named authority matching a partial term.
+    // List Items for a named authority matching a partial term or keywords.
     @GET
     @Produces({"application/xml"})
     @Path("/urn:cspace:name({specifier})/items/")
     ClientResponse<OrganizationsCommonList> readItemListForNamedAuthority(
                @PathParam("specifier") String specifier,
-            @QueryParam (IQueryManager.SEARCH_TYPE_PARTIALTERM) String partialTerm);
+            @QueryParam (IQueryManager.SEARCH_TYPE_PARTIALTERM) String partialTerm,
+            @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords);
 
     // List Item Authority References
     @GET
index 5f29214faedd131de92fb179af47469a7630a2b8..d6527eb5f948c78cb5369a2aa9fa7a27d8163838 100644 (file)
@@ -1104,9 +1104,9 @@ public class OrgAuthorityServiceTest extends AbstractServiceTestImpl {
         OrgAuthorityClient client = new OrgAuthorityClient();
         ClientResponse<OrganizationsCommonList> res = null;
         if(vcsid!= null) {
-               res = client.readItemList(vcsid);
+               res = client.readItemList(vcsid, null, null);
         } else if(name!= null) {
-               res = client.readItemListForNamedAuthority(name);
+               res = client.readItemListForNamedAuthority(name, null, null);
         } else {
                Assert.fail("readItemList passed null csid and name!");
         }
index 695667c20e4283671812d4d44ba42b4c5cf26a53..b3fcc20b778fdbbf344cec7704de46062bee9544 100644 (file)
@@ -183,40 +183,38 @@ public class PersonAuthorityClient extends AbstractServiceClientImpl {
         return personAuthorityProxy.getReferencingObjects(parentcsid, csid);
     }
 
-    /**
-     * Read item list.
-     *
-     * @param vcsid the vcsid
-     * @return the client response
-     */
-    public ClientResponse<PersonsCommonList> readItemList(String vcsid) {
-        return personAuthorityProxy.readItemList(vcsid);
-    }
-
     /**
      * Read item list, filtering by partial term match, or keywords. Only one of
      * partialTerm or keywords should be specified. If both are specified, keywords
      * will be ignored.
      *
-     * @param vcsid the vcsid
+     * @param inAuthority the parent authority
      * @param partialTerm A partial term on which to match,
      *     which will filter list results to return only matched resources.
      * @param keywords A set of keywords on which to match,
      *     which will filter list results to return only matched resources.
      * @return the client response
      */
-    public ClientResponse<PersonsCommonList> readItemList(String vcsid, String partialTerm, String keywords) {
-        return personAuthorityProxy.readItemList(vcsid, partialTerm, keywords);
+    public ClientResponse<PersonsCommonList> 
+               readItemList(String inAuthority, String partialTerm, String keywords) {
+        return personAuthorityProxy.readItemList(inAuthority, partialTerm, keywords);
     }
 
     /**
-     * Read item list for named authority.
+     * Read item list for named vocabulary, filtering by partial term match, or keywords. Only one of
+     * partialTerm or keywords should be specified. If both are specified, keywords
+     * will be ignored.
      *
      * @param specifier the specifier
+     * @param partialTerm A partial term on which to match,
+     *     which will filter list results to return only matched resources.
+     * @param keywords A set of keywords on which to match,
+     *     which will filter list results to return only matched resources.
      * @return the client response
      */
-    public ClientResponse<PersonsCommonList> readItemListForNamedAuthority(String specifier) {
-        return personAuthorityProxy.readItemListForNamedAuthority(specifier);
+    public ClientResponse<PersonsCommonList> 
+               readItemListForNamedAuthority(String specifier, String partialTerm, String keywords) {
+        return personAuthorityProxy.readItemListForNamedAuthority(specifier, partialTerm, keywords);
     }
 
     /**
index ad3a0eaf013a02e03e1472dc0d77e2afa47cbc4c..8acd9e80b915547bb9eebd82d8caf29a1ccacaaa 100644 (file)
@@ -57,13 +57,7 @@ public interface PersonAuthorityProxy extends CollectionSpaceProxy {
     @Path("/{csid}")
     ClientResponse<Response> delete(@PathParam("csid") String csid);
 
-    // List Items
-    @GET
-    @Produces({"application/xml"})
-    @Path("/{vcsid}/items/")
-    ClientResponse<PersonsCommonList> readItemList(@PathParam("vcsid") String vcsid);
-
-    // List Items matching a partial term.
+    // List Items with options for matching a partial term or keywords.
     @GET
     @Produces("application/xml")
     @Path("/{csid}/items/")
@@ -86,20 +80,14 @@ public interface PersonAuthorityProxy extends CollectionSpaceProxy {
             @PathParam("csid") String parentcsid,
             @PathParam("itemcsid") String itemcsid);
 
-    // List Items for a named authority
-    @GET
-    @Produces({"application/xml"})
-    @Path("/urn:cspace:name({specifier})/items/")
-    ClientResponse<PersonsCommonList> readItemListForNamedAuthority(
-               @PathParam("specifier") String specifier);
-
-    // List Items for a named authority matching a partial term.
+    // List Items for a named authority matching a partial term or keywords.
     @GET
     @Produces({"application/xml"})
     @Path("/urn:cspace:name({specifier})/items/")
     ClientResponse<PersonsCommonList> readItemListForNamedAuthority(
                @PathParam("specifier") String specifier,
-            @QueryParam (IQueryManager.SEARCH_TYPE_PARTIALTERM) String partialTerm);
+            @QueryParam (IQueryManager.SEARCH_TYPE_PARTIALTERM) String partialTerm,
+            @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords);
 
     //(C)reate Item
     @POST
index ae1ac06361119ef9cebe73fc536f2c7939d31b6f..84b284cd8eaaf6d53369f37ad3de48360d70f1f7 100644 (file)
@@ -1163,9 +1163,9 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
         PersonAuthorityClient client = new PersonAuthorityClient();
         ClientResponse<PersonsCommonList> res = null;
         if (vcsid!= null) {
-               res = client.readItemList(vcsid);
+               res = client.readItemList(vcsid, null, null);
         } else if (name!= null) {
-               res = client.readItemListForNamedAuthority(name);
+               res = client.readItemListForNamedAuthority(name, null, null);
         } else {
                Assert.fail("readItemList passed null csid and name!");
         }
index 9b031f4d1c87f32a78b4831588342f48e6fbb89e..cb1177dc5258e3f518956ce29333827b664b22ea 100644 (file)
@@ -166,23 +166,37 @@ public class VocabularyClient extends AbstractServiceClientImpl {
     }
 
     /**
-     * Read item list.
+     * Read item list, filtering by partial term match, or keywords. Only one of
+     * partialTerm or keywords should be specified. If both are specified, keywords
+     * will be ignored.
      *
-     * @param vcsid the vcsid
+     * @param inAuthority the parent authority
+     * @param partialTerm A partial term on which to match,
+     *     which will filter list results to return only matched resources.
+     * @param keywords A set of keywords on which to match,
+     *     which will filter list results to return only matched resources.
      * @return the client response
      */
-    public ClientResponse<VocabularyitemsCommonList> readItemList(String vcsid) {
-        return vocabularyProxy.readItemList(vcsid);
+    public ClientResponse<VocabularyitemsCommonList> 
+               readItemList(String inAuthority, String partialTerm, String keywords) {
+        return vocabularyProxy.readItemList(inAuthority, partialTerm, keywords);
     }
 
     /**
-     * Read item list for named vocabulary.
+     * Read item list for named vocabulary, filtering by partial term match, or keywords. Only one of
+     * partialTerm or keywords should be specified. If both are specified, keywords
+     * will be ignored.
      *
      * @param specifier the specifier
+     * @param partialTerm A partial term on which to match,
+     *     which will filter list results to return only matched resources.
+     * @param keywords A set of keywords on which to match,
+     *     which will filter list results to return only matched resources.
      * @return the client response
      */
-    public ClientResponse<VocabularyitemsCommonList> readItemListForNamedVocabulary(String specifier) {
-        return vocabularyProxy.readItemListForNamedVocabulary(specifier);
+    public ClientResponse<VocabularyitemsCommonList> 
+               readItemListForNamedVocabulary(String specifier, String partialTerm, String keywords) {
+        return vocabularyProxy.readItemListForNamedVocabulary(specifier, partialTerm, keywords);
     }
 
     /**
index a9ff1eab2db095adb70575f17fa795485d3af710..6d8c29192049ea939f250475e5f18a00bf7ac095 100644 (file)
@@ -13,6 +13,7 @@ import javax.ws.rs.core.Context;
 import javax.ws.rs.core.Response;
 import javax.ws.rs.core.UriInfo;
 
+import org.collectionspace.services.common.query.IQueryManager;
 import org.collectionspace.services.vocabulary.VocabulariesCommonList;
 import org.collectionspace.services.vocabulary.VocabularyitemsCommonList;
 import org.jboss.resteasy.client.ClientResponse;
@@ -56,17 +57,23 @@ public interface VocabularyProxy extends CollectionSpaceProxy {
     @Path("/{csid}")
     ClientResponse<Response> delete(@PathParam("csid") String csid);
 
-    // List Items
+    // List Items matching a partial term or keywords.
     @GET
     @Produces({"application/xml"})
     @Path("/{vcsid}/items/")
-    ClientResponse<VocabularyitemsCommonList> readItemList(@PathParam("vcsid") String vcsid);
+    ClientResponse<VocabularyitemsCommonList> readItemList(
+               @PathParam("vcsid") String vcsid,
+            @QueryParam (IQueryManager.SEARCH_TYPE_PARTIALTERM) String partialTerm,
+            @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords);
     
-    // List Items using the name of the Vocab
+    // List Items for a named authority matching a partial term or keywords.
     @GET
     @Produces({"application/xml"})
     @Path("/urn:cspace:name({specifier})/items")
-    ClientResponse<VocabularyitemsCommonList> readItemListForNamedVocabulary(@PathParam("specifier") String specifier);
+    ClientResponse<VocabularyitemsCommonList> readItemListForNamedVocabulary(
+               @PathParam("specifier") String specifier,
+            @QueryParam (IQueryManager.SEARCH_TYPE_PARTIALTERM) String partialTerm,
+            @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords);
 
     //(C)reate Item
     @POST
index e47ff29f7f84ed0bd63f2bf3c5b3b6144b4b363e..d244e7b9d2d971f416860ecfa4806703a862fbf7 100644 (file)
@@ -710,9 +710,9 @@ public class VocabularyServiceTest extends AbstractServiceTestImpl {
         VocabularyClient client = new VocabularyClient();
         ClientResponse<VocabularyitemsCommonList> res = null;
         if(vcsid!=null) {
-            res = client.readItemList(vcsid);
+            res = client.readItemList(vcsid, null, null);
         } else if(shortId!=null) {
-            res = client.readItemListForNamedVocabulary(shortId);
+            res = client.readItemListForNamedVocabulary(shortId, null, null);
         } else {
                Assert.fail("Internal Error: readItemList both vcsid and shortId are null!");
         }