]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-5130,CSPACE-5124: Revised Place authority item schema to reflect repeatable...
authorAron Roberts <aron@socrates.berkeley.edu>
Tue, 8 May 2012 00:52:07 +0000 (17:52 -0700)
committerAron Roberts <aron@socrates.berkeley.edu>
Tue, 8 May 2012 00:52:07 +0000 (17:52 -0700)
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/LocationAuthorityClientUtils.java
services/location/service/src/main/java/org/collectionspace/services/location/LocationAuthorityResource.java
services/organization/client/src/main/java/org/collectionspace/services/client/OrgAuthorityClientUtils.java
services/organization/service/src/main/java/org/collectionspace/services/organization/OrgAuthorityResource.java
services/person/service/src/main/java/org/collectionspace/services/person/PersonAuthorityResource.java
services/place/3rdparty/nuxeo-platform-cs-place/src/main/resources/schemas/places_common.xsd
services/place/client/src/main/java/org/collectionspace/services/client/PlaceAuthorityClient.java
services/place/client/src/main/java/org/collectionspace/services/client/PlaceAuthorityClientUtils.java
services/place/client/src/test/java/org/collectionspace/services/client/test/PlaceAuthorityServiceTest.java
services/place/jaxb/src/main/resources/place_common.xsd
services/place/service/src/main/java/org/collectionspace/services/place/PlaceAuthorityResource.java

index 9fe643945ed76b0abb71c9f873e22c75f3e93275..1a4c76e9abe0af4435854c88abc2e8f97abbea14 100644 (file)
@@ -1,19 +1,13 @@
 /**
  * LocationAuthorityClient.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}
+ * Copyright © 2009 The Regents of the University of California
  *
  * Licensed under the Educational Community License (ECL), Version 2.0. You may
  * not use this file except in compliance with this License.
index 41f51447044b430520c120799a0a541df290df92..e8ae69ad01207ad654bbfbda7d8e8111457d2217 100644 (file)
@@ -125,7 +125,7 @@ public class LocationAuthorityClientUtils {
        ServiceRequestType REQUEST_TYPE = ServiceRequestType.CREATE;\r
         \r
         String displayName = "";\r
-        if (terms !=null && terms.size() > 0) {\r
+        if ((terms !=null) && (! terms.isEmpty())) {\r
             displayName = terms.get(0).getTermDisplayName();\r
         }\r
        \r
index 0345d378d2496312977d7e97f6bf5de0449e7c67..dc6e7c158e1d62fdb970e2b704a6e97ae95abe5f 100644 (file)
  */
 package org.collectionspace.services.location;
 
+import javax.ws.rs.Consumes;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
 import org.collectionspace.services.client.LocationAuthorityClient;
 import org.collectionspace.services.common.vocabulary.AuthorityResource;
 import org.collectionspace.services.location.nuxeo.LocationDocumentModelHandler;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import javax.ws.rs.Consumes;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-
+/**
+ * LocationAuthorityResource
+ *
+ * Handles, dispatches, and returns responses to RESTful requests related to
+ * Location authority-related resources.
+ */
 @Path(LocationAuthorityClient.SERVICE_PATH)
 @Consumes("application/xml")
 @Produces("application/xml")
 public class LocationAuthorityResource
         extends AuthorityResource<LocationauthoritiesCommon, LocationDocumentModelHandler> {
 
-    private final static String locationAuthorityServiceName = "locationauthorities";
-    private final static String LOCATIONAUTHORITIES_COMMON = "locationauthorities_common";
-    private final static String locationServiceName = "locations";
-    private final static String LOCATIONS_COMMON = "locations_common";
     final Logger logger = LoggerFactory.getLogger(LocationAuthorityResource.class);
 
     public LocationAuthorityResource() {
         super(LocationauthoritiesCommon.class, LocationAuthorityResource.class,
-                LOCATIONAUTHORITIES_COMMON, LOCATIONS_COMMON);
+                LocationAuthorityClient.SERVICE_COMMON_PART_NAME, LocationAuthorityClient.SERVICE_ITEM_COMMON_PART_NAME);
     }
 
     @Override
     public String getServiceName() {
-        return locationAuthorityServiceName;
-    }
-
-    public String getItemServiceName() {
-        return locationServiceName;
+        return LocationAuthorityClient.SERVICE_NAME;
     }
 
     @Override
-    public Class<LocationauthoritiesCommon> getCommonPartClass() {
-        return LocationauthoritiesCommon.class;
+    public String getItemServiceName() {
+        return LocationAuthorityClient.SERVICE_ITEM_NAME;
     }
 
     @Override
index 7ada74135ffcdb55f55ddaf15cf9dd11c8bf74dc..e336b542465b61fe43c2b92e5190d36df80f0b63 100644 (file)
@@ -162,7 +162,7 @@ public class OrgAuthorityClientUtils {
        ServiceRequestType REQUEST_TYPE = ServiceRequestType.CREATE;\r
 \r
         String displayName = "";\r
-        if (terms !=null && terms.size() > 0) {\r
+        if ((terms !=null) && (! terms.isEmpty())) {\r
             displayName = terms.get(0).getTermDisplayName();\r
         }\r
 \r
index 51366f1613dca31469552268f0978bfce32c93d9..40373aa9160d4550b7593ecd3e256bf17aad1e9c 100644 (file)
  */
 package org.collectionspace.services.organization;
 
+import javax.ws.rs.Consumes;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
 import org.collectionspace.services.client.OrgAuthorityClient;
-import org.collectionspace.services.client.PersonAuthorityClient;
 import org.collectionspace.services.contact.AuthorityResourceWithContacts;
 import org.collectionspace.services.organization.nuxeo.OrganizationDocumentModelHandler;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import javax.ws.rs.Consumes;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
+/**
+ * OrgAuthorityResource
+ * 
+ * Handles, dispatches, and returns responses to RESTful requests
+ * related to Organization authority-related resources.
+ */
 
-@Path("/" + OrgAuthorityClient.SERVICE_PATH_COMPONENT)
+@Path(OrgAuthorityClient.SERVICE_PATH)
 @Consumes("application/xml")
 @Produces("application/xml")
 public class OrgAuthorityResource extends
-       AuthorityResourceWithContacts<OrgauthoritiesCommon, OrganizationDocumentModelHandler> {
+    AuthorityResourceWithContacts<OrgauthoritiesCommon, OrganizationDocumentModelHandler> {
 
-    private final static String orgAuthorityServiceName = OrgAuthorityClient.SERVICE_NAME;
-       private final static String ORGAUTHORITIES_COMMON = "orgauthorities_common";
-    
-    private final static String organizationServiceName = "organizations";
-       private final static String ORGANIZATIONS_COMMON = "organizations_common";
-    
     final Logger logger = LoggerFactory.getLogger(OrgAuthorityResource.class);
     
     public OrgAuthorityResource() {
-               super(OrgauthoritiesCommon.class, OrgAuthorityResource.class,
-                               ORGAUTHORITIES_COMMON, ORGANIZATIONS_COMMON);
+        super(OrgauthoritiesCommon.class, OrgAuthorityResource.class,
+                OrgAuthorityClient.SERVICE_COMMON_PART_NAME, OrgAuthorityClient.SERVICE_ITEM_COMMON_PART_NAME);
     }
 
     @Override
     public String getServiceName() {
-        return orgAuthorityServiceName;
-    }
-    
-    public String getItemServiceName() {
-        return organizationServiceName;
+        return OrgAuthorityClient.SERVICE_NAME;
     }
 
     @Override
-    public Class<OrgauthoritiesCommon> getCommonPartClass() {
-       return OrgauthoritiesCommon.class;
+    public String getItemServiceName() {
+        return OrgAuthorityClient.SERVICE_ITEM_NAME;
     }
-    
+
     @Override
     public String getItemTermInfoGroupXPathBase() {
         return OrgAuthorityClient.TERM_INFO_GROUP_XPATH_BASE;
index 7da7f28282acfacc70577edd1589c3aa2ff017e5..2724e8be8d4519efde1607779c73ff78bf61335c 100644 (file)
@@ -1,49 +1,52 @@
 /**
- *  This document is a part of the source code and related artifacts
- *  for CollectionSpace, an open source collections management system
- *  for museums and related institutions:
-
- *  http://www.collectionspace.org
- *  http://wiki.collectionspace.org
-
- *  Copyright 2009 University of California at Berkeley
-
- *  Licensed under the Educational Community License (ECL), Version 2.0.
- *  You may not use this file except in compliance with this License.
-
- *  You may obtain a copy of the ECL 2.0 License at
-
- *  https://source.collectionspace.org/collection-space/LICENSE.txt
-
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
+ * This document is a part of the source code and related artifacts for
+ * CollectionSpace, an open source collections management system for museums and
+ * related institutions:
+ *
+ * http://www.collectionspace.org http://wiki.collectionspace.org
+ *
+ * Copyright 2009 University of California at Berkeley
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0. You may
+ * not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ *
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
  */
 package org.collectionspace.services.person;
 
+import javax.ws.rs.Consumes;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
 import org.collectionspace.services.client.PersonAuthorityClient;
 import org.collectionspace.services.contact.AuthorityResourceWithContacts;
 import org.collectionspace.services.person.nuxeo.PersonDocumentModelHandler;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import javax.ws.rs.Consumes;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-
+/**
+ * PersonAuthorityResource
+ *
+ * Handles, dispatches, and returns responses to RESTful requests related to
+ * Person authority-related resources.
+ */
 @Path(PersonAuthorityClient.SERVICE_PATH)
 @Consumes("application/xml")
 @Produces("application/xml")
-public class PersonAuthorityResource extends
-       AuthorityResourceWithContacts<PersonauthoritiesCommon, PersonDocumentModelHandler> {
+public class PersonAuthorityResource extends AuthorityResourceWithContacts<PersonauthoritiesCommon, PersonDocumentModelHandler> {
 
     final Logger logger = LoggerFactory.getLogger(PersonAuthorityResource.class);
 
     public PersonAuthorityResource() {
-               super(PersonauthoritiesCommon.class, PersonAuthorityResource.class,
-                               PersonAuthorityClient.SERVICE_COMMON_PART_NAME, PersonAuthorityClient.SERVICE_ITEM_COMMON_PART_NAME);
+        super(PersonauthoritiesCommon.class, PersonAuthorityResource.class,
+                PersonAuthorityClient.SERVICE_COMMON_PART_NAME, PersonAuthorityClient.SERVICE_ITEM_COMMON_PART_NAME);
     }
 
     @Override
@@ -55,7 +58,7 @@ public class PersonAuthorityResource extends
     public String getItemServiceName() {
         return PersonAuthorityClient.SERVICE_ITEM_NAME;
     }
-    
+
     @Override
     public String getItemTermInfoGroupXPathBase() {
         return PersonAuthorityClient.TERM_INFO_GROUP_XPATH_BASE;
@@ -63,7 +66,6 @@ public class PersonAuthorityResource extends
 
     @Override
     public Class<PersonauthoritiesCommon> getCommonPartClass() {
-       return PersonauthoritiesCommon.class;
+        return PersonauthoritiesCommon.class;
     }
-    
 }
index 393891143e491c1915da2637b86fa04ca1d7cce4..3fbf0ecf67ad4799d8820eca4e0e6d05cf40d415 100644 (file)
 -->
 
 <xs:schema 
-  xmlns:xs="http://www.w3.org/2001/XMLSchema"
-  xmlns:ns="http://collectionspace.org/services/place"
-  xmlns="http://collectionspace.org/services/place"
-  targetNamespace="http://collectionspace.org/services/place"
-  version="0.1"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:ns="http://collectionspace.org/services/place"
+    xmlns="http://collectionspace.org/services/place"
+    targetNamespace="http://collectionspace.org/services/place"
+    version="0.1"
 >
 <!-- See http://wiki.collectionspace.org/display/collectionspace/Place+Service+Home -->    
     <!--  Place Information Group -->
     <xs:element name="inAuthority" type="xs:string" />
     <xs:element name="shortIdentifier" type="xs:string"/>
     <xs:element name="refName" type="xs:string"/>
-    <xs:element name="termStatus" type="xs:string"/>
-    <xs:element name="displayName" type="xs:string"/>
-    <xs:element name="displayNameComputed" type="xs:boolean"/>
-    <xs:element name="shortDisplayName" type="xs:string"/>
-    <xs:element name="shortDisplayNameComputed" type="xs:boolean"/>
+    
+    <!-- Term Information repeatable group -->
+    <xs:element name="placeTermGroupList" type="placeTermGroupList"/>
+        
+    <!-- Does this pertain to the item or to individual terms? -->
     <xs:element name="placeType" type="xs:string" />
+    
     <xs:element name="placeRecordAdminStatus" type="xs:string" />
+    
+    <!-- Should this have been placeID? -->
     <xs:element name="placeIdentifier" type="xs:string" />
-    <xs:element name="placeNameGroupList" type="placeNameGroupList"/>
+    
+    <!-- xs:element name="placeNameGroupList" type="placeNameGroupList"/ -->
+    
     <xs:element name="placeOwnerGroupList" type="placeOwnerGroupList"/>
     <xs:element name="note" type="xs:string"/>
-    <xs:element name="source" type="xs:string"/>
-    <xs:element name="sourcePage" type="xs:string"/>
 
-               <!-- Locality Information  -->
+    <!-- Locality Information  -->
     <xs:element name="vCoordinates" type="xs:string"/>
     <xs:element name="vLatitude" type="xs:string"/>
     <xs:element name="vLongitude" type="xs:string"/>
@@ -59,7 +62,7 @@
 
     <xs:element name="placeGeoRefGroupList" type="placeGeoRefGroupList"/>
 
-
+    <!--
     <xs:complexType name="placeNameGroupList">
         <xs:sequence>
             <xs:element name="placeNameGroup" type="placeNameGroup" minOccurs="0" maxOccurs="unbounded"/>
 
     <xs:complexType name="placeNameGroup">
         <xs:sequence>
-                       <xs:element name="placeName" type="xs:string"/>
-                       <xs:element name="nameQualifiedName" type="xs:string"/>
-                       <xs:element name="nameLanguage" type="xs:string"/>
-                       <xs:element name="nameAbbrev" type="xs:string"/>
-                       <xs:element name="nameType" type="xs:string"/>
-                       <xs:element name="nameStatus" type="xs:string"/>
-                       <xs:element name="nameSource" type="xs:string"/>
-                       <xs:element name="nameSourceDetail" type="xs:string"/>
-                       <xs:element name="nameSourceRefId" type="xs:string"/>
-                       <xs:element name="nameNote" type="xs:string"/>
-                       <xs:element name="nameDateGroup" type="structuredDateGroup"/>
-                       <xs:element name="nameAdminStatus" type="xs:string"/>
+            <xs:element name="placeName" type="xs:string"/>
+            <xs:element name="nameQualifiedName" type="xs:string"/>
+            <xs:element name="nameLanguage" type="xs:string"/>
+            <xs:element name="nameAbbrev" type="xs:string"/>
+            <xs:element name="nameType" type="xs:string"/>
+            <xs:element name="nameStatus" type="xs:string"/>
+            <xs:element name="nameSource" type="xs:string"/>
+            <xs:element name="nameSourceDetail" type="xs:string"/>
+            <xs:element name="nameSourceRefId" type="xs:string"/>
+            <xs:element name="nameNote" type="xs:string"/>
+            <xs:element name="nameDateGroup" type="structuredDateGroup"/>
+            <xs:element name="nameAdminStatus" type="xs:string"/>
         </xs:sequence>
     </xs:complexType>
+    -->
     
     <xs:complexType name="placeOwnerGroupList">
         <xs:sequence>
@@ -91,9 +95,9 @@
 
     <xs:complexType name="placeOwnerGroup">
         <xs:sequence>
-                       <xs:element name="owner" type="xs:string"/>
-                       <xs:element name="ownershipDateGroup" type="structuredDateGroup"/>
-                       <xs:element name="ownershipNote" type="xs:string"/>
+            <xs:element name="owner" type="xs:string"/>
+            <xs:element name="ownershipDateGroup" type="structuredDateGroup"/>
+            <xs:element name="ownershipNote" type="xs:string"/>
         </xs:sequence>
     </xs:complexType>
     
             <xs:element name="geoRefVerificationStatus" type="xs:string"/>
             <xs:element name="geoRefRemarks" type="xs:string"/>
             <xs:element name="geoRefPlaceName" type="xs:string"/>
-       </xs:sequence>
+        </xs:sequence>
     </xs:complexType>
 
     <!-- IMPORTANT: This structuredDateGroup MUST MATCH EXACTLY structuredDateGroups in other services, for example collectionobject.
             <xs:element name="scalarValuesComputed" type="xs:boolean"/>
         </xs:sequence>
     </xs:complexType>
+    
+    <xs:complexType name="placeTermGroupList">
+        <xs:sequence>
+            <xs:element name="placeTermGroup" type="placeTermGroup" minOccurs="0" maxOccurs="unbounded"/>
+        </xs:sequence>
+    </xs:complexType>
+
+    <xs:complexType name="placeTermGroup">
+        <xs:sequence>
+                <!-- Common across all authority item terms -->
+            <xs:element name="termDisplayName" type="xs:string"/>
+            <xs:element name="termName" type="xs:string"/>
+            <xs:element name="termType" type="xs:string"/>
+            <xs:element name="termStatus" type="xs:string"/>
+            <xs:element name="termQualifier" type="xs:string"/>
+            <xs:element name="termLanguage" type="xs:string"/>
+            <xs:element name="termPrefForLang" type="xs:boolean"/>
+            <xs:element name="termSource" type="xs:string"/>
+            <xs:element name="termSourceDetail" type="xs:string"/>
+            <xs:element name="termSourceID" type="xs:string"/>
+            <xs:element name="termSourceNote" type="xs:string"/>
+            <!-- Specific to Place terms -->
+            <xs:element name="nameAbbrev" type="xs:string"/>
+            <xs:element name="nameType" type="xs:string"/>
+            <xs:element name="nameNote" type="xs:string"/>
+            <xs:element name="nameDateGroup" type="structuredDateGroup"/>
+        </xs:sequence>
+    </xs:complexType>
+    
 </xs:schema>
 
index 403969746fb825aed72f08e20251e7092b14b2a7..6845c36ee5eae747d9ff7d0ff5312d09bf668d9d 100644 (file)
@@ -1,25 +1,14 @@
-/**    
- * PlaceAuthorityClient.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:
+/**
+ * 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
+ * http://www.collectionspace.org http://wiki.collectionspace.org
  *
- * Copyright © 2009 {Contributing Institution}
+ * Copyright © 2009 The Regents of the University of California
  *
- * Licensed under the Educational Community License (ECL), Version 2.0.
- * You may not use this file except in compliance with this License.
+ * 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 org.collectionspace.services.place.PlacesCommon;
+
 /**
  * The Class PlaceAuthorityClient.
  */
 public class PlaceAuthorityClient extends AuthorityClientImpl<PlacesCommon, PlaceAuthorityProxy> {
-       public static final String SERVICE_NAME = "placeauthorities";
-       public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;       
-       public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT;
-       public static final String SERVICE_PAYLOAD_NAME = SERVICE_NAME;
-    public static final String TERM_INFO_GROUP_XPATH_BASE = "placeTermGroup";
-       //
-       // Subitem constants
-       //
-       public static final String SERVICE_ITEM_NAME = "places";
-       public static final String SERVICE_ITEM_PAYLOAD_NAME = SERVICE_ITEM_NAME;
-       //
-       // Payload Part/Schema part names
-       //
-       public static final String SERVICE_COMMON_PART_NAME = SERVICE_NAME + 
-               PART_LABEL_SEPARATOR + PART_COMMON_LABEL;
-       public static final String SERVICE_ITEM_COMMON_PART_NAME = SERVICE_ITEM_NAME + 
-               PART_LABEL_SEPARATOR + PART_COMMON_LABEL;
-       
-       @Override
-       public String getServiceName() {
-               return SERVICE_NAME;
-       }
+
+    public static final String SERVICE_NAME = "placeauthorities";
+    public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;
+    public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT;
+    public static final String SERVICE_PAYLOAD_NAME = SERVICE_NAME;
+    public static final String TERM_INFO_GROUP_XPATH_BASE = "placeTermGroupList";
+    //
+    // Subitem constants
+    //
+    public static final String SERVICE_ITEM_NAME = "places";
+    public static final String SERVICE_ITEM_PAYLOAD_NAME = SERVICE_ITEM_NAME;
+    //
+    // Payload Part/Schema part names
+    //
+    public static final String SERVICE_COMMON_PART_NAME = SERVICE_NAME
+            + PART_LABEL_SEPARATOR + PART_COMMON_LABEL;
+    public static final String SERVICE_ITEM_COMMON_PART_NAME = SERVICE_ITEM_NAME
+            + PART_LABEL_SEPARATOR + PART_COMMON_LABEL;
+
+    @Override
+    public String getServiceName() {
+        return SERVICE_NAME;
+    }
 
     @Override
     public String getServicePathComponent() {
@@ -66,16 +57,16 @@ public class PlaceAuthorityClient extends AuthorityClientImpl<PlacesCommon, Plac
 
     @Override
     public Class<PlaceAuthorityProxy> getProxyClass() {
-            return PlaceAuthorityProxy.class;
+        return PlaceAuthorityProxy.class;
     }
 
     @Override
     public String getInAuthority(PlacesCommon item) {
-            return item.getInAuthority();
+        return item.getInAuthority();
     }
 
     @Override
     public void setInAuthority(PlacesCommon item, String inAuthorityCsid) {
-            item.setInAuthority(inAuthorityCsid);
+        item.setInAuthority(inAuthorityCsid);
     }
 }
index 75a6138a4f9be650a71160616290002e0d46d85d..7341c4b3c153a714c1037c929180b5c274cdc968 100644 (file)
@@ -2,20 +2,19 @@ package org.collectionspace.services.client;
 
 import java.io.File;
 import java.util.ArrayList;
-import java.util.Arrays;
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
-
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.MultivaluedMap;
 import javax.ws.rs.core.Response;
-
 import org.apache.commons.io.FileUtils;
 import org.collectionspace.services.PlaceJAXBSchema;
 import org.collectionspace.services.client.test.ServiceRequestType;
+import org.collectionspace.services.common.api.Tools;
+import org.collectionspace.services.place.PlaceTermGroup;
+import org.collectionspace.services.place.PlaceTermGroupList;
 import org.collectionspace.services.place.PlaceauthoritiesCommon;
-import org.collectionspace.services.place.PlaceNameGroup;
-import org.collectionspace.services.place.PlaceNameGroupList;
 import org.collectionspace.services.place.PlacesCommon;
 import org.dom4j.DocumentException;
 import org.jboss.resteasy.client.ClientResponse;
@@ -62,37 +61,19 @@ public class PlaceAuthorityClientUtils {
      */
     public static PoxPayloadOut createPlaceInstance( 
                String placeAuthRefName, Map<String, String> placeInfo, 
-                               String headerLabel){
+               List<PlaceTermGroup> terms, String headerLabel){
         PlacesCommon place = new PlacesCommon();
        String shortId = placeInfo.get(PlaceJAXBSchema.SHORT_IDENTIFIER);
-       String displayName = placeInfo.get(PlaceJAXBSchema.DISPLAY_NAME);
        place.setShortIdentifier(shortId);
-       String placeRefName = createPlaceRefName(placeAuthRefName, shortId, displayName);
-               place.setRefName(placeRefName);
-               String value = null;
-       value = placeInfo.get(PlaceJAXBSchema.DISPLAY_NAME_COMPUTED);
-       boolean displayNameComputed = (value==null) || value.equalsIgnoreCase("true"); 
-       place.setDisplayNameComputed(displayNameComputed);
-                       if((value = (String)placeInfo.get(PlaceJAXBSchema.DISPLAY_NAME))!=null)
-                               place.setDisplayName(value);
-       value = placeInfo.get(PlaceJAXBSchema.DISPLAY_NAME_COMPUTED);
-       displayNameComputed = (value==null) || value.equalsIgnoreCase("true"); 
-                       place.setDisplayNameComputed(displayNameComputed);
-        /* TODO - think about how much to support. This approach to the client
-        * does not scale! We should really favor the document/payload approach. */
-        if((value = (String)placeInfo.get(PlaceJAXBSchema.PLACE_NAME))!=null) {
-            PlaceNameGroupList placeNameGroupList = new PlaceNameGroupList();
-            List<PlaceNameGroup> placeNameGroups = placeNameGroupList.getPlaceNameGroup();
-            PlaceNameGroup placeNameGroup = new PlaceNameGroup();
-            placeNameGroup.setPlaceName(value);
-            placeNameGroups.add(placeNameGroup);
-            place.setPlaceNameGroupList(placeNameGroupList);
+
+        // Set values in the Term Information Group
+        PlaceTermGroupList termList = new PlaceTermGroupList();
+        if (terms == null || terms.isEmpty()) {
+            terms = getTermGroupInstance(getGeneratedIdentifier());
         }
+        termList.getPlaceTermGroup().addAll(terms); 
+        place.setPlaceTermGroupList(termList);
         
-                                       
-        if((value = (String)placeInfo.get(PlaceJAXBSchema.TERM_STATUS))!=null)
-               place.setTermStatus(value);
-
         PoxPayloadOut multipart = new PoxPayloadOut(PlaceAuthorityClient.SERVICE_ITEM_PAYLOAD_NAME);
         PayloadOutputPart commonPart = multipart.addPart(place,
             MediaType.APPLICATION_XML_TYPE);
@@ -106,7 +87,7 @@ public class PlaceAuthorityClientUtils {
     }
     
     /**
-     * @param vcsid CSID of the authority to create a new placplace
+     * @param vcsid CSID of the authority to create a new place
      * @param placeAuthorityRefName The refName for the authority
      * @param placeMap the properties for the new Place
      * @param client the service client
@@ -114,34 +95,23 @@ public class PlaceAuthorityClientUtils {
      */
     public static String createItemInAuthority(String vcsid, 
                String placeAuthorityRefName, Map<String,String> placeMap,
-               PlaceAuthorityClient client ) {
+               List<PlaceTermGroup> terms, PlaceAuthorityClient client ) {
        // Expected status code: 201 Created
        int EXPECTED_STATUS_CODE = Response.Status.CREATED.getStatusCode();
        // Type of service request being tested
        ServiceRequestType REQUEST_TYPE = ServiceRequestType.CREATE;
        
-       String displayName = placeMap.get(PlaceJAXBSchema.DISPLAY_NAME);
-       String displayNameComputedStr = placeMap.get(PlaceJAXBSchema.DISPLAY_NAME_COMPUTED);
-       boolean displayNameComputed = (displayNameComputedStr==null) || displayNameComputedStr.equalsIgnoreCase("true");
-       if( displayName == null ) {
-               if(!displayNameComputed) {
-                       throw new RuntimeException(
-                       "CreateItem: Must supply a displayName if displayNameComputed is set to false.");
-               }
-                               /* Could try to pull name out of first placeNameGroup
-               displayName = 
-                       prepareDefaultDisplayName(
-                       placeMap.get(PlaceJAXBSchema.PLACE_NAME));
-                                                       */
-       }
-       
+       String displayName = "";
+        if ((terms !=null) && (! terms.isEmpty())) {
+            displayName = terms.get(0).getTermDisplayName();
+        }
        if(logger.isDebugEnabled()){
-               logger.debug("Import: Create Item: \""+displayName
-                               +"\" in placeAuthority: \"" + placeAuthorityRefName +"\"");
+               logger.debug("Creating item with display name: \"" + displayName
+                               +"\" in locationAuthority: \"" + vcsid +"\"");
        }
        PoxPayloadOut multipart = 
                createPlaceInstance( placeAuthorityRefName,
-                       placeMap, client.getItemCommonPartName() );
+                       placeMap, terms, client.getItemCommonPartName() );
        String newID = null;
        ClientResponse<Response> res = client.createItem(vcsid, multipart);
         try {
@@ -305,6 +275,20 @@ public class PlaceAuthorityClientUtils {
                return newStr.toString();
     }
     
-
-
+    public static List<PlaceTermGroup> getTermGroupInstance(String identifier) {
+        if (Tools.isBlank(identifier)) {
+            identifier = getGeneratedIdentifier();
+        }
+        List<PlaceTermGroup> terms = new ArrayList<PlaceTermGroup>();
+        PlaceTermGroup term = new PlaceTermGroup();
+        term.setTermDisplayName(identifier);
+        term.setTermName(identifier);
+        terms.add(term);
+        return terms;
+    }
+    
+    private static String getGeneratedIdentifier() {
+        return "id" + new Date().getTime(); 
+   }
+    
 }
index 39cdd129711cee7d8ce0e8df3f040556868d30c1..07c45e14b2b83b406429c8eb16943c48ead31a14 100644 (file)
@@ -25,7 +25,6 @@ package org.collectionspace.services.client.test;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-
 import org.collectionspace.services.PlaceJAXBSchema;
 import org.collectionspace.services.client.AbstractCommonListUtils;
 import org.collectionspace.services.client.AuthorityClient;
@@ -38,14 +37,9 @@ import org.collectionspace.services.client.PlaceAuthorityClientUtils;
 import org.collectionspace.services.jaxb.AbstractCommonList;
 import org.collectionspace.services.place.PlaceauthoritiesCommon;
 import org.collectionspace.services.place.PlacesCommon;
-import org.collectionspace.services.place.PlaceNameGroup;
-import org.collectionspace.services.place.PlaceNameGroupList;
-
 import org.jboss.resteasy.client.ClientResponse;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-
 import org.testng.Assert;
 import org.testng.annotations.AfterClass;
 import org.testng.annotations.Test;
@@ -140,7 +134,7 @@ public class PlaceAuthorityServiceTest extends AbstractAuthorityServiceTest<Plac
         sanjoseMap.put(PlaceJAXBSchema.TERM_STATUS, TEST_STATUS);
         
         String newID = PlaceAuthorityClientUtils.createItemInAuthority(vcsid,
-                       authRefName, sanjoseMap, client );    
+                       authRefName, sanjoseMap, terms client );    
 
         // Store the ID returned from the first item resource created
         // for additional tests below.
@@ -159,134 +153,13 @@ public class PlaceAuthorityServiceTest extends AbstractAuthorityServiceTest<Plac
         return newID;
     }
 
-    /**
-     * Verify item display name.
-     *
-     * @param testName the test name
-     * @throws Exception the exception
-     */
-    @Test(dataProvider="testName", 
-        dependsOnMethods = {"readItem", "updateItem"})
-    public void verifyItemDisplayName(String testName) throws Exception {
-        // Perform setup.
-        setupRead();
-        //
-        // First, read our known item resource
-        //
-        PlaceAuthorityClient client = new PlaceAuthorityClient();
-        ClientResponse<String> res = client.readItem(knownResourceId, knownItemResourceId);
-        PlacesCommon place = null;
-        try {
-            assertStatusCode(res, testName);
-               // Check whether place has expected displayName.
-               PoxPayloadIn input = new PoxPayloadIn(res.getEntity());
-               place = (PlacesCommon) extractPart(input,
-                       client.getItemCommonPartName(), PlacesCommon.class);
-               Assert.assertNotNull(place);
-        } finally {
-               if (res != null) {
-                res.releaseConnection();
-            }
-        }
-        //
-        // Now prepare an updated payload.
-        //
-        String displayName = place.getDisplayName();
-        // Make sure displayName matches computed form
-        String expectedDisplayName = 
-            PlaceAuthorityClientUtils.prepareDefaultDisplayName(TEST_NAME);
-        Assert.assertNotNull(displayName, expectedDisplayName);
-        
-        // Update the shortName and verify the computed name is updated.
-        place.setCsid(null);
-        place.setDisplayNameComputed(true);
-        
-         // Verify the contents of this resource
-        PlaceNameGroupList placeNameGroupList = place.getPlaceNameGroupList();
-        Assert.assertNotNull(placeNameGroupList);
-        List<PlaceNameGroup> placeNameGroups = placeNameGroupList.getPlaceNameGroup();
-        Assert.assertNotNull(placeNameGroups);
-        Assert.assertTrue(placeNameGroups.size() > 0);
-        String placeName = placeNameGroups.get(0).getPlaceName();
-        Assert.assertNotNull(placeName);
-
-        // Update the contents of this resource.
-        final String PLACE_NAME_ADDITION = "verify-item-place-name-updated";
-        placeNameGroups.get(0).setPlaceName(PLACE_NAME_ADDITION + TEST_NAME);
-        place.setPlaceNameGroupList(placeNameGroupList);
-        if (logger.isDebugEnabled()) {
-            logger.debug("to be updated Place");
-            logger.debug(objectAsXmlString(place,
-                    PlacesCommon.class));
-        }
-        expectedDisplayName = 
-            PlaceAuthorityClientUtils.prepareDefaultDisplayName(PLACE_NAME_ADDITION + TEST_NAME);
-
-        // Submit the updated resource to the service and store the response.
-        PoxPayloadOut output = new PoxPayloadOut(PlaceAuthorityClient.SERVICE_ITEM_PAYLOAD_NAME);
-        PayloadOutputPart commonPart = output.addPart(client.getItemCommonPartName(), place);
-
-        setupUpdate();        
-        res = client.updateItem(knownResourceId, knownItemResourceId, output);
-        PlacesCommon updatedPlace = null;
-        try {
-               assertStatusCode(res, testName);
-               // Retrieve the updated resource and verify that its contents exist.
-               PoxPayloadIn input = new PoxPayloadIn(res.getEntity());
-               updatedPlace = (PlacesCommon) extractPart(input,
-                               client.getItemCommonPartName(), PlacesCommon.class);
-               Assert.assertNotNull(updatedPlace);
-        } finally {
-               if (res != null) {
-                res.releaseConnection();
-            }
-        }
-
-        // Verify that the updated resource computes the right displayName.
-        Assert.assertEquals(updatedPlace.getDisplayName(), expectedDisplayName,
-            "Updated DisplayName in Place not reflected in computed DisplayName.");
-        //
-        // Now Update the displayName, not computed and verify the computed name is overriden.
-        //
-        place.setDisplayNameComputed(false);
-        expectedDisplayName = "TestName";
-        place.setDisplayName(expectedDisplayName);
-
-        // Submit the updated resource to the service and store the response.
-        output = new PoxPayloadOut(PlaceAuthorityClient.SERVICE_ITEM_PAYLOAD_NAME);
-        commonPart = output.addPart(client.getItemCommonPartName(), place);
-        setupUpdate();        
-        res = client.updateItem(knownResourceId, knownItemResourceId, output);
-        try {
-               assertStatusCode(res, testName);
-               // Retrieve the updated resource and verify that its contents exist.
-               PoxPayloadIn input = new PoxPayloadIn(res.getEntity());
-               updatedPlace = (PlacesCommon) extractPart(input,
-                               client.getItemCommonPartName(), PlacesCommon.class);
-               Assert.assertNotNull(updatedPlace);
-        } finally {
-               if (res != null) {
-                res.releaseConnection();
-            }
-        }
-
-        // Verify that the updated resource received the correct data.
-        Assert.assertEquals(updatedPlace.isDisplayNameComputed(), false,
-                "Updated displayNameComputed in Place did not match submitted data.");
-        // Verify that the updated resource computes the right displayName.
-        Assert.assertEquals(updatedPlace.getDisplayName(),
-                       expectedDisplayName,
-                "Updated DisplayName (not computed) in Place not stored.");
-    }
-
     /**
      * Verify illegal item display name.
      *
      * @param testName the test name
      * @throws Exception the exception
      */
-    @Test(dataProvider="testName",
-            dependsOnMethods = {"verifyItemDisplayName"})
+    @Test(dataProvider="testName")
     public void verifyIllegalItemDisplayName(String testName) throws Exception {
         // Perform setup for read.
         setupRead();
index ca9e6219be94b29804f9b49f9e0b534d7a60dece..36257ecdacdd1a8dbf5280328b7e33745ede36f3 100644 (file)
@@ -7,7 +7,7 @@
     xmlns="http://collectionspace.org/services/place"
     targetNamespace="http://collectionspace.org/services/place"
     version="0.1"
-    >
+>
     
     
     <!-- avoid XmlRootElement nightnmare, see http://weblogs.java.net/blog/kohsuke/archive/2006/03/why_does_jaxb_p.html-->
         <xs:complexType>
             <xs:sequence>
               <!--  Common identifier -->
-              <xs:element name="csid" type="xs:string" />
+                <xs:element name="csid" type="xs:string" />
                 
                     <!--  Place Information Group -->
                     <!--  inAuthority is the csid of the owning PlaceAuthority -->
-                    <xs:element name="inAuthority" type="xs:string" />
-                    <xs:element name="shortIdentifier" type="xs:string"/>
-                    <xs:element name="refName" type="xs:string"/>
-                    <xs:element name="termStatus" type="xs:string"/>
-                    <xs:element name="displayName" type="xs:string"/>
-                    <xs:element name="displayNameComputed" type="xs:boolean"/>
-                    <xs:element name="shortDisplayName" type="xs:string"/>
-                    <xs:element name="shortDisplayNameComputed" type="xs:boolean"/>
-                    <xs:element name="placeType" type="xs:string" />
-                    <xs:element name="placeRecordAdminStatus" type="xs:string" />
-                    <xs:element name="placeIdentifier" type="xs:string" />
-                    <xs:element name="placeNameGroupList" type="placeNameGroupList"/>
-                    <xs:element name="placeOwnerGroupList" type="placeOwnerGroupList"/>
-                    <xs:element name="note" type="xs:string"/>
-                    <xs:element name="source" type="xs:string"/>
-                    <xs:element name="sourcePage" type="xs:string"/>
+                <xs:element name="inAuthority" type="xs:string" />
+                <xs:element name="shortIdentifier" type="xs:string"/>
+                <xs:element name="refName" type="xs:string"/>
+                    
+                    <!-- Term Information repeatable group -->
+                <xs:element name="placeTermGroupList" type="placeTermGroupList"/>                    
+                    
+                <xs:element name="placeType" type="xs:string" />
+                <xs:element name="placeRecordAdminStatus" type="xs:string" />
+                <xs:element name="placeIdentifier" type="xs:string" />
+                    
+                    <!-- xs:element name="placeNameGroupList" type="placeNameGroupList"/ -->
+                    
+                <xs:element name="placeOwnerGroupList" type="placeOwnerGroupList"/>
+                <xs:element name="note" type="xs:string"/>
 
                     <!-- Locality Information  -->
-                    <xs:element name="vCoordinates" type="xs:string"/>
-                    <xs:element name="vLatitude" type="xs:string"/>
-                    <xs:element name="vLongitude" type="xs:string"/>
-                    <xs:element name="vCoordSys" type="xs:string"/>
-                    <xs:element name="vSpatialReferenceSystem" type="xs:string"/>
-                    <xs:element name="vCoordSource" type="xs:string"/>
-                    <xs:element name="vCoordSourceRefId" type="xs:string"/>
-                    <xs:element name="vUnitofMeasure" type="xs:string"/>
-                    <xs:element name="vElevation" type="xs:string"/>
-                    <xs:element name="minElevationInMeters" type="xs:decimal"/>
-                    <xs:element name="maxElevationInMeters" type="xs:decimal"/>
-                    <xs:element name="vDepth" type="xs:string"/>
-                    <xs:element name="minDepthInMeters" type="xs:decimal"/>
-                    <xs:element name="maxDepthInMeters" type="xs:decimal"/>
-                    <xs:element name="vDistanceAboveSurface" type="xs:string"/>
-                    <xs:element name="minDistanceAboveSurfaceInMeters" type="xs:decimal"/>
-                    <xs:element name="maxDistanceAboveSurfaceInMeters" type="xs:decimal"/>
+                <xs:element name="vCoordinates" type="xs:string"/>
+                <xs:element name="vLatitude" type="xs:string"/>
+                <xs:element name="vLongitude" type="xs:string"/>
+                <xs:element name="vCoordSys" type="xs:string"/>
+                <xs:element name="vSpatialReferenceSystem" type="xs:string"/>
+                <xs:element name="vCoordSource" type="xs:string"/>
+                <xs:element name="vCoordSourceRefId" type="xs:string"/>
+                <xs:element name="vUnitofMeasure" type="xs:string"/>
+                <xs:element name="vElevation" type="xs:string"/>
+                <xs:element name="minElevationInMeters" type="xs:decimal"/>
+                <xs:element name="maxElevationInMeters" type="xs:decimal"/>
+                <xs:element name="vDepth" type="xs:string"/>
+                <xs:element name="minDepthInMeters" type="xs:decimal"/>
+                <xs:element name="maxDepthInMeters" type="xs:decimal"/>
+                <xs:element name="vDistanceAboveSurface" type="xs:string"/>
+                <xs:element name="minDistanceAboveSurfaceInMeters" type="xs:decimal"/>
+                <xs:element name="maxDistanceAboveSurfaceInMeters" type="xs:decimal"/>
 
-                    <xs:element name="placeGeoRefGroupList" type="placeGeoRefGroupList"/>
+                <xs:element name="placeGeoRefGroupList" type="placeGeoRefGroupList"/>
             </xs:sequence>
         </xs:complexType>
     </xs:element>
     
+    <!--
     <xs:complexType name="placeNameGroupList">
         <xs:sequence>
             <xs:element name="placeNameGroup" type="placeNameGroup" minOccurs="0" maxOccurs="unbounded"/>
@@ -85,6 +85,7 @@
             <xs:element name="nameAdminStatus" type="xs:string"/>
         </xs:sequence>
     </xs:complexType>
+    -->
     
     <xs:complexType name="placeOwnerGroupList">
         <xs:sequence>
             <xs:element name="geoRefVerificationStatus" type="xs:string"/>
             <xs:element name="geoRefRemarks" type="xs:string"/>
             <xs:element name="geoRefPlaceName" type="xs:string"/>
-       </xs:sequence>
+        </xs:sequence>
     </xs:complexType>
 
     <!-- IMPORTANT: This structuredDateGroup MUST MATCH EXACTLY structuredDateGroups in other services, for example collectionobject.
             <xs:element name="scalarValuesComputed" type="xs:boolean"/>
         </xs:sequence>
     </xs:complexType>
+    
+    <xs:complexType name="placeTermGroupList">
+        <xs:sequence>
+            <xs:element name="placeTermGroup" type="placeTermGroup" minOccurs="0" maxOccurs="unbounded"/>
+        </xs:sequence>
+    </xs:complexType>
+
+    <xs:complexType name="placeTermGroup">
+        <xs:sequence>
+                <!-- Common across all authority item terms -->
+            <xs:element name="termDisplayName" type="xs:string"/>
+            <xs:element name="termName" type="xs:string"/>
+            <xs:element name="termType" type="xs:string"/>
+            <xs:element name="termStatus" type="xs:string"/>
+            <xs:element name="termQualifier" type="xs:string"/>
+            <xs:element name="termLanguage" type="xs:string"/>
+            <xs:element name="termPrefForLang" type="xs:boolean"/>
+            <xs:element name="termSource" type="xs:string"/>
+            <xs:element name="termSourceDetail" type="xs:string"/>
+            <xs:element name="termSourceID" type="xs:string"/>
+            <xs:element name="termSourceNote" type="xs:string"/>
+            <!-- Specific to Place terms -->
+            <xs:element name="nameAbbrev" type="xs:string"/>
+            <xs:element name="nameType" type="xs:string"/>
+            <xs:element name="nameNote" type="xs:string"/>
+            <xs:element name="nameDateGroup" type="structuredDateGroup"/>
+        </xs:sequence>
+    </xs:complexType>
 
 </xs:schema>
 
index 9f63d0b1dcd0d69458624b5dedebea0db0b5c83e..0e432f05637b398795892f12867667d16a4c0e9e 100644 (file)
@@ -1,74 +1,69 @@
 /**
- *  This document is a part of the source code and related artifacts
- *  for CollectionSpace, an open source collections management system
- *  for museums and related institutions:
-
- *  http://www.collectionspace.org
- *  http://wiki.collectionspace.org
-
- *  Copyright 2009 University of California at Berkeley
-
- *  Licensed under the Educational Community License (ECL), Version 2.0.
- *  You may not use this file except in compliance with this License.
-
- *  You may obtain a copy of the ECL 2.0 License at
-
- *  https://source.collectionspace.org/collection-space/LICENSE.txt
-
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
+ * This document is a part of the source code and related artifacts for
+ * CollectionSpace, an open source collections management system for museums and
+ * related institutions:
+ *
+ * http://www.collectionspace.org http://wiki.collectionspace.org
+ *
+ * Copyright 2009 University of California at Berkeley
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0. You may
+ * not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ *
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
  */
 package org.collectionspace.services.place;
 
+import javax.ws.rs.Consumes;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
 import org.collectionspace.services.client.PlaceAuthorityClient;
 import org.collectionspace.services.common.vocabulary.AuthorityResource;
 import org.collectionspace.services.place.nuxeo.PlaceDocumentModelHandler;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import javax.ws.rs.Consumes;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
+/**
+ * PlaceAuthorityResource
+ * 
+ * Handles, dispatches, and returns responses to RESTful requests
+ * related to Place authority-related resources.
+ */
 
 @Path(PlaceAuthorityClient.SERVICE_PATH)
 @Consumes("application/xml")
 @Produces("application/xml")
-public class PlaceAuthorityResource 
-       extends AuthorityResource<PlaceauthoritiesCommon, 
-                                                               PlaceDocumentModelHandler> {
+public class PlaceAuthorityResource
+        extends AuthorityResource<PlaceauthoritiesCommon, PlaceDocumentModelHandler> {
 
-    private final static String placeAuthorityServiceName = "placeauthorities";
-       private final static String PLACEAUTHORITIES_COMMON = "placeauthorities_common";
-    
-    private final static String placeServiceName = "places";
-       private final static String PLACES_COMMON = "places_common";
-    
     final Logger logger = LoggerFactory.getLogger(PlaceAuthorityResource.class);
 
     public PlaceAuthorityResource() {
-               super(PlaceauthoritiesCommon.class, PlaceAuthorityResource.class,
-                               PLACEAUTHORITIES_COMMON, PLACES_COMMON);
+        super(PlaceauthoritiesCommon.class, PlaceAuthorityResource.class,
+                PlaceAuthorityClient.SERVICE_COMMON_PART_NAME, PlaceAuthorityClient.SERVICE_ITEM_COMMON_PART_NAME);
     }
 
     @Override
     public String getServiceName() {
-        return placeAuthorityServiceName;
+        return PlaceAuthorityClient.SERVICE_NAME;
     }
 
+    @Override
     public String getItemServiceName() {
-        return placeServiceName;
+        return PlaceAuthorityClient.SERVICE_ITEM_NAME;
     }
 
     @Override
-    public Class<PlaceauthoritiesCommon> getCommonPartClass() {
-       return PlaceauthoritiesCommon.class;
+    public String getItemTermInfoGroupXPathBase() {
+        return PlaceAuthorityClient.TERM_INFO_GROUP_XPATH_BASE;
     }
 
-       @Override
-       public String getItemTermInfoGroupXPathBase() {
-        return PlaceAuthorityClient.TERM_INFO_GROUP_XPATH_BASE;
-       }
 }