]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-5406: Updated comments re post-CSPACE-5406 steps to incorporate a URL building...
authorAron Roberts <aron@socrates.berkeley.edu>
Thu, 19 Jul 2012 22:07:08 +0000 (15:07 -0700)
committerAron Roberts <aron@socrates.berkeley.edu>
Thu, 19 Jul 2012 22:07:08 +0000 (15:07 -0700)
services/common/src/main/java/org/collectionspace/services/common/vocabulary/RefNameServiceUtils.java
services/config/src/main/java/org/collectionspace/services/common/config/URIUtils.java

index e3bc6afd19f1cc51e843109cf53e92cd1d9aaf0c..ab3b57c78d5d7bde061925de4183b028c4fd6921 100644 (file)
@@ -593,7 +593,6 @@ public class RefNameServiceUtils {
                 } catch (Exception e) {\r
                     logger.error("Error getting core values for doc [" + csid + "]: " + e.getLocalizedMessage());\r
                 }\r
-                // The id and URI are the same on all doctypes\r
                 ilistItem.setDocType(docType);\r
                 ilistItem.setDocNumber(\r
                         ServiceBindingUtils.getMappedFieldInDoc(sb, ServiceBindingUtils.OBJ_NUMBER_PROP, docModel));\r
index 94307f438e54e2d7ee02333d8dc527f4d70c917b..fcd0355044d8b17fb477727cb764c5ceea8642ee 100644 (file)
@@ -1,33 +1,35 @@
 package org.collectionspace.services.common.config;
 
+// client module is built after this config module, so we can't currently include this
 // import org.collectionspace.services.client.AuthorityClient;
 import java.util.HashMap;
 import java.util.Map;
 
-// Hack for CSPACE-5
+// This class is a hack for CSPACE-5406
 
 public class URIUtils {
 
     private static Map<String, String> docTypeSvcNameRegistry = new HashMap<String, String>();
+    private static final String ITEMS_PATH_COMPONENT = "items";
     
     // FIXME: This is a quick hack, which assumes that URI construction
     // behaviors are bound to categories of services.  Those behaviors
     // should instead be specified on a per-service basis via a registry,
-    // the mechanism we are intending to use in v2.5.  (See comments below
-    // for more details.) - ADR 2012-05-24
+    // mechanism.  (See comments below for more details.) - ADR 2012-05-24
     public static final String AUTHORITY_SERVICE_CATEGORY = "authority";
     public static final String OBJECT_SERVICE_CATEGORY = "object";
     public static final String PROCEDURE_SERVICE_CATEGORY = "procedure";
 
     // FIXME: This is a quick hack; a stub / mock of a registry of
     // authority document types and their associated parent authority
-    // service names. This MUST be replaced by a more general mechanism
-    // in v2.5. 
+    // service names. This MUST be replaced by a more general registry mechanism.
+    // If not, the manually-entered values below represent a DRY violation,
+    // and risk falling out of sync with comparable values elsewhere.
     // 
-    // Per Patrick, this registry needs to be available system-wide, not
-    // just here in the Imports service; extend to all relevant record types;
-    // and be automatically built in some manner, such as via per-resource
-    // registration, from configuration, etc. - ADR 2012-05-24
+    // Per Patrick, this registry needs to be available system-wide;
+    // extend to all relevant record types; and be automatically built
+    // in some manner, such as via per-resource registration, from
+    // existing configuration, etc. - ADR 2012-05-24
     private static Map<String, String> getDocTypeSvcNameRegistry() {
         if (docTypeSvcNameRegistry.isEmpty()) {
             docTypeSvcNameRegistry.put("Conceptitem", "Conceptauthorities");
@@ -59,7 +61,7 @@ public class URIUtils {
     public static String getAuthorityItemUri(String authorityServiceName, String inAuthorityID, String docID) {
         return "/" + authorityServiceName.toLowerCase()
                 + '/' + inAuthorityID
-                + '/' + "items" // AuthorityClient.ITEMS
+                + '/' + ITEMS_PATH_COMPONENT // AuthorityClient.ITEMS
                 + '/' + docID;
     }