]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
DRYD-90: Fixed problem with /servicegroupd/common/item/${csid} when csid pointed...
authorremillet <remillet@yahoo.com>
Sun, 26 Feb 2017 06:14:55 +0000 (22:14 -0800)
committerremillet <remillet@yahoo.com>
Sun, 26 Feb 2017 06:14:55 +0000 (22:14 -0800)
13 files changed:
services/common-api/src/main/java/org/collectionspace/services/common/api/RefName.java
services/common-api/src/main/java/org/collectionspace/services/common/api/RefNameUtils.java
services/common/src/main/java/org/collectionspace/services/common/NuxeoBasedResource.java
services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/DocumentModelHandler.java
services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/NuxeoDocumentModelHandler.java
services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/RemoteDocumentModelHandlerImpl.java
services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/RepositoryClientImpl.java
services/common/src/main/java/org/collectionspace/services/nuxeo/util/NuxeoUtils.java
services/relation/service/src/main/java/org/collectionspace/services/relation/nuxeo/RelationDocumentModelHandler.java
services/relation/service/src/main/java/org/collectionspace/services/relation/nuxeo/RelationValidatorHandler.java
services/servicegroup/service/pom.xml
services/servicegroup/service/src/main/java/org/collectionspace/services/servicegroup/ServiceGroupResource.java
services/servicegroup/service/src/main/java/org/collectionspace/services/servicegroup/nuxeo/ServiceGroupDocumentModelHandler.java

index 54b34ac21d870af2662db5b41683259405a4f94d..ee87e0bca90144f4d7d5baf55a5238656db103dd 100644 (file)
@@ -173,15 +173,12 @@ public class RefName {
         public String shortIdentifier = "";
         public String displayName = "";
 
-        public static AuthorityItem parse(String urn) {
+        public static AuthorityItem parse(String urn) throws IllegalArgumentException {
             AuthorityItem authorityItem = null;
-            try {
-                RefNameUtils.AuthorityTermInfo termInfo =
-                        RefNameUtils.parseAuthorityTermInfo(urn);
-                authorityItem = authorityItemFromTermInfo(termInfo);
-            } catch (IllegalArgumentException iae) {
-                return null;
-            }
+
+            RefNameUtils.AuthorityTermInfo termInfo = RefNameUtils.parseAuthorityTermInfo(urn);
+            authorityItem = authorityItemFromTermInfo(termInfo);
+
             return authorityItem;
         }
 
index 28b7494115a305b515536f1ce2c71cc7ff3cef47..e117600b087e17e6fc118c7b790b84cc224ace38 100644 (file)
@@ -203,13 +203,13 @@ public class RefNameUtils {
        return new AuthorityInfo(refNameTokens);
     }
 
-    public static AuthorityTermInfo parseAuthorityTermInfo(String refName)
-            throws IllegalArgumentException {
-       if(refName==null || !refName.startsWith(URN_PREFIX))
-               throw new IllegalArgumentException( "Null or invalid refName syntax");
-       String[] refNameTokens = refName.substring(URN_PREFIX_LEN).split(SEPARATOR, AUTH_ITEM_REFNAME_TOKENS);
-       return new AuthorityTermInfo(refNameTokens);
-    }
+       public static AuthorityTermInfo parseAuthorityTermInfo(String refName) throws IllegalArgumentException {
+               if (refName == null || !refName.startsWith(URN_PREFIX)) {
+                       throw new IllegalArgumentException("Null or invalid refName syntax");
+               }
+               String[] refNameTokens = refName.substring(URN_PREFIX_LEN).split(SEPARATOR, AUTH_ITEM_REFNAME_TOKENS);
+               return new AuthorityTermInfo(refNameTokens);
+       }
 
     public static String stripAuthorityTermDisplayName(String refName)
             throws IllegalArgumentException {
index 60697a9c4f0929ea2ccd0e37189de6bf6962458d..bdd234001f7602ab1759aea3cc613f834f5fc918 100644 (file)
@@ -642,9 +642,9 @@ public abstract class NuxeoBasedResource
      * for all inheriting resource classes. Just use ServiceContext.getResourceMap() to get
      * the map, and pass it in.
      */
-    public static DocumentModel getDocModelForRefName(CoreSessionInterface repoSession, String refName, ResourceMap resourceMap) 
+    public static DocumentModel getDocModelForRefName(ServiceContext ctx, String refName, ResourceMap resourceMap) 
                        throws Exception, DocumentNotFoundException {
-       return NuxeoUtils.getDocModelForRefName(repoSession, refName, resourceMap);
+       return NuxeoUtils.getDocModelForRefName(ctx, refName, resourceMap);
     }
 
     // This is ugly, but prevents us parsing the refName twice. Once we make refName a little more
index d26a52c670697d72084fe5926abae7793dcdcd2b..52675c71a95f7947c4428a280caba1e2beaf540d 100644 (file)
@@ -425,7 +425,7 @@ public abstract class DocumentModelHandler<T, TL>
        
        try {
                QueryContext queryContext = new QueryContext(ctx, selectClause, whereClause, orderByClause);
-               result = NuxeoUtils.buildNXQLQuery(ctx, queryContext);
+               result = NuxeoUtils.buildNXQLQuery(queryContext);
        } catch (DocumentException de) {
                throw de;
        } catch (Exception x) {
index 97256338e5909cca5d98f733a402133ac64b3fc3..064d12d10864a7d822b32c236efd279c4ca6b103 100644 (file)
@@ -278,7 +278,7 @@ public abstract class NuxeoDocumentModelHandler<T> extends RemoteDocumentModelHa
                                                        + NuxeoUtils.buildWorkflowNotDeletedWhereClause();
                                        QueryContext queryContext = new QueryContext(ctx, whereClause);
                                        queryContext.setDocType(IRelationsManager.DOC_TYPE);
-                                       String query = NuxeoUtils.buildNXQLQuery(ctx, queryContext);
+                                       String query = NuxeoUtils.buildNXQLQuery(queryContext);
                                        // Search for 1 relation that matches. 1 is enough to fail
                                        // the filter
                                        DocumentModelList docList = repoSession.query(query, null, 1, 0, false);
index 3d4b70687da0948f26310773a97c0ec7a5b2bdb8..5252a4d506cc24519965b88d8e72e82b0b4784d2 100644 (file)
@@ -717,7 +717,7 @@ public abstract class   RemoteDocumentModelHandlerImpl<T, TL>
        //
        String csid = null;
        try {
-                       DocumentModel docModel = NuxeoUtils.getDocModelForRefName(this.getRepositorySession(), refName, this.getServiceContext().getResourceMap());
+                       DocumentModel docModel = NuxeoUtils.getDocModelForRefName(getServiceContext(), refName, getServiceContext().getResourceMap());
                        csid = NuxeoUtils.getCsid(docModel);
                } catch (Exception e1) {
                        String msg = String.format("Could not find CSID for authority reference with refname = %s.", refName);
@@ -1319,7 +1319,7 @@ public abstract class   RemoteDocumentModelHandlerImpl<T, TL>
                                logger.trace("Fetching CSID for child with only refname: "+newChildRefName);
                             }
                                DocumentModel newChildDocModel = 
-                                       NuxeoBasedResource.getDocModelForRefName(this.getRepositorySession(), 
+                                       NuxeoBasedResource.getDocModelForRefName(getServiceContext(), 
                                                        newChildRefName, getServiceContext().getResourceMap());
                                newChildCsid = getCsid(newChildDocModel);
                                }
index bd6ba7b90a927e9a92079aafe9896382697e1e5e..32c7979b93a4d31a4b4e6d80e2daae73e681b39b 100644 (file)
@@ -412,7 +412,7 @@ public class RepositoryClientImpl implements RepositoryClient<PoxPayloadIn, PoxP
 
             DocumentModelList docList = null;
             // force limit to 1, and ignore totalSize
-            String query = NuxeoUtils.buildNXQLQuery(ctx, queryContext);
+            String query = NuxeoUtils.buildNXQLQuery(queryContext);
             docList = repoSession.query(query, null, 1, 0, false);
             if (docList.size() != 1) {
                 throw new DocumentNotFoundException("No document found matching filter params: " + query);
@@ -523,7 +523,7 @@ public class RepositoryClientImpl implements RepositoryClient<PoxPayloadIn, PoxP
             QueryContext queryContext = new QueryContext(ctx, whereClause);
             DocumentModelList docList = null;
             // force limit to 1, and ignore totalSize
-            String query = NuxeoUtils.buildNXQLQuery(ctx, queryContext);
+            String query = NuxeoUtils.buildNXQLQuery(queryContext);
             docList = repoSession.query(query,
                     null, //Filter
                     1, //limit
@@ -1013,7 +1013,7 @@ public class RepositoryClientImpl implements RepositoryClient<PoxPayloadIn, PoxP
                 docList = getFilteredCMIS(repoSession, ctx, handler, queryContext); //FIXME: REM - Need to deal with paging info in CMIS query
             // NXQL query
             } else {
-                String query = NuxeoUtils.buildNXQLQuery(ctx, queryContext);
+                String query = NuxeoUtils.buildNXQLQuery(queryContext);
                 if (logger.isDebugEnabled()) {
                     logger.debug("Executing NXQL query: " + query.toString());
                 }
index c1febcbbc797cf5814153e764132025527cf53d3..4afb237fc039731727e6542247ec85d75d9ddbbe 100644 (file)
@@ -634,7 +634,7 @@ public class NuxeoUtils {
      * @return an NXQL query
      * @throws Exception if supplied values in the query are invalid.
      */
-    static public final String buildNXQLQuery(ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx, QueryContext queryContext) throws Exception {
+    static public final String buildNXQLQuery(QueryContext queryContext) throws Exception {
         StringBuilder query = new StringBuilder(queryContext.getSelectClause());
         // Since we have a tenant qualification in the WHERE clause, we do not need 
         // tenant-specific doc types
@@ -709,7 +709,7 @@ public class NuxeoUtils {
         //
         // Since we're doing a query, we get back a list so we need to make sure there is only
         // a single result since CSID values are supposed to be unique.
-        String query = buildNXQLQuery(ctx, queryContext);
+        String query = buildNXQLQuery(queryContext);
         docModelList = repoSession.query(query);
         long resultSize = docModelList.totalSize();
         if (resultSize == 1) {
@@ -725,20 +725,40 @@ public class NuxeoUtils {
        return null;
     }
     
-    public static DocumentModel getDocModelForRefName(CoreSessionInterface repoSession, String refName, ResourceMap resourceMap)
+    /**
+     * The refname could be for an authority, an authority item/term, or a csid-form to an object or procedure record
+     * @param repoSession
+     * @param refName
+     * @param resourceMap
+     * @return
+     * @throws DocumentNotFoundException
+     * @throws Exception
+     */
+    public static DocumentModel getDocModelForRefName(ServiceContext<PoxPayloadIn,PoxPayloadOut> ctx, String refName, ResourceMap resourceMap)
                throws DocumentNotFoundException, Exception {
-       RefName.AuthorityItem item = RefName.AuthorityItem.parse(refName);
-       if (item != null) {
-               NuxeoBasedResource resource = (NuxeoBasedResource) resourceMap.get(item.inAuthority.resource);
-               return resource.getDocModelForAuthorityItem(repoSession, item);
+       RefName.AuthorityItem item = null;
+       CoreSessionInterface repoSession = (CoreSessionInterface)ctx.getCurrentRepositorySession();
+       //
+       // Let's see if our refname refers to an authority item/term.
+       //
+       try {
+               item = RefName.AuthorityItem.parse(refName);
+               if (item != null) {
+                       NuxeoBasedResource resource = (NuxeoBasedResource) resourceMap.get(item.inAuthority.resource);
+                       return resource.getDocModelForAuthorityItem(repoSession, item);
+               }
+       } catch (IllegalArgumentException e) {
+               // Ignore exception
        }
-       RefName.Authority authority = RefName.Authority.parse(refName);
-       // Handle case of objects refNames, which must be csid based.
-       if(authority != null && !Tools.isEmpty(authority.csid)) {
+       
+       //
+       // If we got this far, we know the refname doesn't refer to an authority item/term, so it might refer
+       // to an authority or an object or procedure.
+       //
+       RefName.Authority authority = RefName.Authority.parse(refName); // could be an authority or an object or procedure record
+       // Handle case of objects refNames, which MUST be csid based.
+       if (authority != null && !Tools.isEmpty(authority.csid)) {
                NuxeoBasedResource resource = (NuxeoBasedResource) resourceMap.get(authority.resource);
-            // Ensure we have the right context.
-            ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx = 
-                       resource.createServiceContext(authority.resource);
             // HACK - this really must be moved to the doc handler, not here. No Nuxeo specific stuff here!
             DocumentModel docModel = NuxeoUtils.getDocFromCsid(ctx, repoSession, authority.csid);
             return docModel;
@@ -780,7 +800,7 @@ public class NuxeoUtils {
                //
                // Since we're doing a query, we get back a list so we need to make sure there is only
                // a single result since CSID values are supposed to be unique.
-               String query = buildNXQLQuery(ctx, queryContext);
+               String query = buildNXQLQuery(queryContext);
                docModelList = repoSession.query(query);
                long resultSize = docModelList.totalSize();
                if (resultSize == 1) {
@@ -815,7 +835,7 @@ public class NuxeoUtils {
                //
                // Since we're doing a query, we get back a list so we need to make sure there is only
                // a single result since CSID values are supposed to be unique.
-               String query = buildNXQLQuery(ctx, queryContext);
+               String query = buildNXQLQuery(queryContext);
                docModelList = repoSession.query(query);
                long resultSize = docModelList.totalSize();
                if (resultSize == 1) {
index 745f87f6da1dd84ff5b09a1afde82401fe02bb2f..09f2a1d4a25e2757ef8081d3fffa704063829d7e 100644 (file)
@@ -404,7 +404,7 @@ public class RelationDocumentModelHandler
             try {
                refName = (String) relationDocModel.getProperty(commonPartLabel, 
                                (fSubject?RelationJAXBSchema.SUBJECT_REFNAME:RelationJAXBSchema.OBJECT_REFNAME));
-               docModel = NuxeoBasedResource.getDocModelForRefName(repoSession, refName, ctx.getResourceMap());
+               docModel = NuxeoBasedResource.getDocModelForRefName(ctx, refName, ctx.getResourceMap());
             } catch (Exception e) {
                 throw new InvalidDocumentException(
                         "Relation record must have a CSID or refName to identify the object of the relation.", e);
index dff09ae20a39463786d7677ee86fb84e93cc0fd4..90ffd2f0dc3b5056ecb6841f92cd261842317bb7 100644 (file)
@@ -102,18 +102,28 @@ public class RelationValidatorHandler extends ValidatorHandlerImpl<PoxPayloadIn,
         return hasRefName(objectRefName);
     }
 
+    /**
+     * Check to see if the refname is valid.  It can be a refname of either an authority, an authority item, or another record type.
+     * @param refName
+     * @return
+     */
     private boolean hasRefName(String refName) {
-        boolean hasRefname = false;
-        if (Tools.isBlank(refName)) {
-            return hasRefname;
-        } else {
-            Authority authority = Authority.parse(refName);
-            AuthorityItem authItem = AuthorityItem.parse(refName);
-            if (authority != null || authItem != null) {
-                hasRefname = true;
-            }
-            return hasRefname;
+        boolean result = false; // assume it's not a valid refname
+        
+        if (Tools.isBlank(refName) == false) {
+               try {
+                   Authority authority = Authority.parse(refName); // Will also parse refname to an object or procedure record
+                   if (authority != null) {
+                       result = true;
+                   } else {
+                       AuthorityItem authItem = AuthorityItem.parse(refName); // See if it is a refname to an authority item or vocabulary term
+                       result = authItem != null;
+                   }
+               } catch (IllegalArgumentException e) {
+                       // Ignore exception
+               }               
         }
 
+        return result;
     }
 }
index d872cb8f9e4fab501fef5d4ffce92c5d253e65f9..92a4080f115840ae149806c82b78e2bd798afec8 100644 (file)
             <groupId>org.collectionspace.services</groupId>
             <artifactId>org.collectionspace.services.common</artifactId>
         </dependency>
+        <dependency>
+               <groupId>org.collectionspace.services</groupId>
+               <artifactId>org.collectionspace.services.authority.service</artifactId>
+               <version>${project.version}</version>
+        </dependency>
         <dependency>
             <groupId>org.collectionspace.services</groupId>
             <artifactId>org.collectionspace.services.servicegroup.client</artifactId>
index 7361a90c3592bb11b5a6b1b3c620ad7c93fc4558..24098d35ea8249aea9947b6c3ee413358bd356d6 100644 (file)
@@ -207,7 +207,7 @@ public class ServiceGroupResource extends AbstractCollectionSpaceResourceImpl<Po
 
     @GET
     @Path("{csid}/items")
-    public AbstractCommonList getItemList(
+    public AbstractCommonList getResourceItemList(
             @Context UriInfo uriInfo,
             @PathParam("csid") String serviceGroupName) {
        UriInfoWrapper ui = new UriInfoWrapper(uriInfo);
@@ -271,7 +271,7 @@ public class ServiceGroupResource extends AbstractCollectionSpaceResourceImpl<Po
 
     @GET
     @Path("{csid}/items/{specifier}")
-    public byte[] getItem(
+    public byte[] getResourceItem(
                @Context ResourceMap resourceMap,
             @Context UriInfo uriInfo,
             @PathParam("csid") String serviceGroupName,
@@ -296,7 +296,7 @@ public class ServiceGroupResource extends AbstractCollectionSpaceResourceImpl<Po
             DocumentFilter myFilter = new NuxeoDocumentFilter(whereClause, 0, 1);
             handler.setDocumentFilter(myFilter);    
                
-            result = handler.getItemForCsid(ctx, groupsList, specifier);
+            result = handler.getResourceItemForCsid(ctx, groupsList, specifier);
         } catch (Exception e) {
             throw bigReThrow(e, ServiceMessages.READ_FAILED, serviceGroupName);
         }
index 32b319b23b0c6ea00b105124046ff10d6c4d605e..bab793a981e7df5a8aa155d20435723780d86323 100644 (file)
@@ -37,10 +37,10 @@ import org.collectionspace.services.nuxeo.client.java.CoreSessionInterface;
 import org.collectionspace.services.nuxeo.client.java.RepositoryClientImpl;
 import org.collectionspace.services.nuxeo.util.NuxeoUtils;
 import org.collectionspace.services.jaxb.AbstractCommonList;
+import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.client.IQueryManager;
 import org.collectionspace.services.client.PoxPayloadIn;
 import org.collectionspace.services.client.PoxPayloadOut;
-
 import org.collectionspace.services.common.NuxeoBasedResource;
 import org.collectionspace.services.common.CSWebApplicationException;
 import org.collectionspace.services.common.ServiceMain;
@@ -49,22 +49,26 @@ import org.collectionspace.services.common.StoredValuesUriTemplate;
 import org.collectionspace.services.common.UriTemplateFactory;
 import org.collectionspace.services.common.UriTemplateRegistry;
 import org.collectionspace.services.common.UriTemplateRegistryKey;
+import org.collectionspace.services.common.api.RefName;
+import org.collectionspace.services.common.api.RefNameUtils;
+import org.collectionspace.services.common.api.RefNameUtils.AuthorityTermInfo;
 import org.collectionspace.services.common.config.TenantBindingConfigReaderImpl;
 import org.collectionspace.services.common.context.ServiceBindingUtils;
 import org.collectionspace.services.common.context.ServiceContext;
 import org.collectionspace.services.common.document.DocumentException;
 import org.collectionspace.services.common.document.DocumentFilter;
+import org.collectionspace.services.common.document.DocumentNotFoundException;
 import org.collectionspace.services.common.document.DocumentWrapper;
 import org.collectionspace.services.common.security.SecurityUtils;
 import org.collectionspace.services.common.query.nuxeo.QueryManagerNuxeoImpl;
-
 import org.collectionspace.services.config.service.ServiceBindingType;
 import org.collectionspace.services.config.service.ServiceObjectType;
 import org.collectionspace.services.servicegroup.ServicegroupsCommon;
-
+import org.collectionspace.services.common.vocabulary.AuthorityResource;
+import org.collectionspace.services.common.vocabulary.RefNameServiceUtils.Specifier;
 import org.nuxeo.ecm.core.api.DocumentModel;
 import org.nuxeo.ecm.core.api.DocumentModelList;
-
+import org.nuxeo.ecm.core.api.PropertyException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -77,8 +81,26 @@ public class ServiceGroupDocumentModelHandler
     protected static final String DOC_TYPE_FIELD = "docType";
     protected static final String DOC_NUMBER_FIELD = "docNumber";
     protected static final String DOC_NAME_FIELD = "docName";
+    
+    //
+    // Returns a service payload for an authority item
+    //
+    private PoxPayloadOut getAuthorityItem(ServiceContext ctx, String termRefName) throws Exception {
+       PoxPayloadOut result = null;
+       
+       RefName.AuthorityItem item = RefName.AuthorityItem.parse(termRefName);
+       AuthorityResource authorityResource = (AuthorityResource) ctx.getResourceMap().get(item.inAuthority.resource);
+       
+       AuthorityTermInfo authorityTermInfo = RefNameUtils.parseAuthorityTermInfo(termRefName);
+       String parentIdentifier = Specifier.createShortIdURNValue(authorityTermInfo.inAuthority.name);
+       String itemIdentifier = Specifier.createShortIdURNValue(authorityTermInfo.name);
+       
+       result = authorityResource.getAuthorityItemWithExistingContext(ctx, parentIdentifier, itemIdentifier);
+       
+       return result;
+    }
 
-    public PoxPayloadOut getItemForCsid(ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx,
+    public PoxPayloadOut getResourceItemForCsid(ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx,
                List<String> serviceGroupNames,
                String csid) throws DocumentException {
        PoxPayloadOut result = null;
@@ -97,14 +119,22 @@ public class ServiceGroupDocumentModelHandler
                DocumentModelList docList = this.getDocListForGroup(ctx, serviceGroupNames, queriedServiceBindings,
                                repoSession, repoClient);
                if (docList == null) { // found no authRef fields - nothing to process
-                   //return list;
+                   throw new DocumentNotFoundException();
                }
                DocumentModel docModel = docList.get(0);
-                TenantBindingConfigReaderImpl bindingReader = ServiceMain.getInstance().getTenantBindingConfigReader();
-                String serviceName = ServiceBindingUtils.getServiceNameFromObjectName(bindingReader, ctx.getTenantId(),
-                               docModel.getDocumentType().getName());
-                NuxeoBasedResource resource = (NuxeoBasedResource) ctx.getResourceMap().get(serviceName);
-                result = resource.getWithParentCtx(ctx, csid);
+               //
+               // Determine if the docModel is an authority term, object, or some other procedure record.
+               //
+               String termRefName = (String) NuxeoUtils.getProperyValue(docModel, CollectionSpaceClient.COLLECTIONSPACE_CORE_REFNAME);
+               if (isAuthorityTermDocument(termRefName) == true) {
+                       result = getAuthorityItem(ctx, termRefName);
+               } else {                
+                       TenantBindingConfigReaderImpl bindingReader = ServiceMain.getInstance().getTenantBindingConfigReader();
+                       String serviceName = ServiceBindingUtils.getServiceNameFromObjectName(bindingReader, ctx.getTenantId(),
+                                       docModel.getDocumentType().getName());
+                       NuxeoBasedResource resource = (NuxeoBasedResource) ctx.getResourceMap().get(serviceName);
+                       result = resource.getWithParentCtx(ctx, csid);
+               }
                } catch (DocumentException de) {
                        throw de;
                } catch (Exception e) {
@@ -127,7 +157,21 @@ public class ServiceGroupDocumentModelHandler
         return result;
     }
     
-    private DocumentModelList getDocListForGroup(
+    private boolean isAuthorityTermDocument(String termRefName) {
+               boolean result = true;
+               
+               try {
+               //String inAuthorityCsid = (String) NuxeoUtils.getProperyValue(docModel, "inAuthority"); //docModel.getPropertyValue("inAuthority"); // AuthorityItemJAXBSchema.IN_AUTHORITY
+               //String refName = (String) NuxeoUtils.getProperyValue(docModel, CollectionSpaceClient.COLLECTIONSPACE_CORE_REFNAME);
+               RefName.AuthorityItem item = RefName.AuthorityItem.parse(termRefName);
+               } catch (IllegalArgumentException e) {
+                       result = false;
+               }
+               
+       return result;
+       }
+
+       private DocumentModelList getDocListForGroup(
                ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx,
                List<String> serviceGroupNames,
                Map<String, ServiceBindingType> queriedServiceBindings,
@@ -270,8 +314,7 @@ public class ServiceGroupDocumentModelHandler
             docType = ServiceBindingUtils.getUnqualifiedTenantDocType(docType);
             ServiceBindingType sb = queriedServiceBindings.get(docType);
             if (sb == null) {
-                throw new RuntimeException(
-                        "processDocList: No Service Binding for docType: " + docType);
+                throw new RuntimeException("processDocList: No Service Binding for docType: " + docType);
             }
             
             String csid = NuxeoUtils.getCsid(docModel);