From: Aron Roberts Date: Thu, 19 Jul 2012 22:07:08 +0000 (-0700) Subject: CSPACE-5406: Updated comments re post-CSPACE-5406 steps to incorporate a URL building... X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=f178bcd6804dd206b64a5c24e33a1937b25bcdea;p=tmp%2Fjakarta-migration.git CSPACE-5406: Updated comments re post-CSPACE-5406 steps to incorporate a URL building registry. --- diff --git a/services/common/src/main/java/org/collectionspace/services/common/vocabulary/RefNameServiceUtils.java b/services/common/src/main/java/org/collectionspace/services/common/vocabulary/RefNameServiceUtils.java index e3bc6afd1..ab3b57c78 100644 --- a/services/common/src/main/java/org/collectionspace/services/common/vocabulary/RefNameServiceUtils.java +++ b/services/common/src/main/java/org/collectionspace/services/common/vocabulary/RefNameServiceUtils.java @@ -593,7 +593,6 @@ public class RefNameServiceUtils { } catch (Exception e) { logger.error("Error getting core values for doc [" + csid + "]: " + e.getLocalizedMessage()); } - // The id and URI are the same on all doctypes ilistItem.setDocType(docType); ilistItem.setDocNumber( ServiceBindingUtils.getMappedFieldInDoc(sb, ServiceBindingUtils.OBJ_NUMBER_PROP, docModel)); diff --git a/services/config/src/main/java/org/collectionspace/services/common/config/URIUtils.java b/services/config/src/main/java/org/collectionspace/services/common/config/URIUtils.java index 94307f438..fcd035504 100644 --- a/services/config/src/main/java/org/collectionspace/services/common/config/URIUtils.java +++ b/services/config/src/main/java/org/collectionspace/services/common/config/URIUtils.java @@ -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 docTypeSvcNameRegistry = new HashMap(); + 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 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; }