From d86a18d67e94df090343f6350b59d14d7ad8085d Mon Sep 17 00:00:00 2001 From: Richard Millet Date: Tue, 28 Apr 2020 16:19:55 -0700 Subject: [PATCH] DRYD-841, DRYD-855: Merging in UCB contributions to post-v6.0 master branch. --- .../services/batch/nuxeo/AbstractBatchJob.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/services/batch/service/src/main/java/org/collectionspace/services/batch/nuxeo/AbstractBatchJob.java b/services/batch/service/src/main/java/org/collectionspace/services/batch/nuxeo/AbstractBatchJob.java index 497de9e07..a77b10c65 100644 --- a/services/batch/service/src/main/java/org/collectionspace/services/batch/nuxeo/AbstractBatchJob.java +++ b/services/batch/service/src/main/java/org/collectionspace/services/batch/nuxeo/AbstractBatchJob.java @@ -476,7 +476,7 @@ public abstract class AbstractBatchJob extends AbstractBatchInvocable { return csids; } - protected List findReferencingObjects(String serviceName, String csid, String type, String sourceField) throws Exception { + protected List findReferencingObjects(String serviceName, String csid, String type, String sourceField) throws URISyntaxException, Exception { logger.debug("findReferencingObjects serviceName=" + serviceName + " csid=" + csid + " type=" + type + " sourceField=" + sourceField); List vocabularyCsids = getVocabularyCsids(serviceName); @@ -487,7 +487,13 @@ public abstract class AbstractBatchJob extends AbstractBatchInvocable { } else { for (String vocabularyCsid : vocabularyCsids) { - PoxPayloadOut itemPayload = findAuthorityItemByCsid(serviceName, vocabularyCsid, csid); + PoxPayloadOut itemPayload = null; + + try { + itemPayload = findAuthorityItemByCsid(serviceName, vocabularyCsid, csid); + } catch(Exception e) { + itemPayload = null; + } if (itemPayload != null) { parentCsid = vocabularyCsid; @@ -499,11 +505,11 @@ public abstract class AbstractBatchJob extends AbstractBatchInvocable { return findReferencingObjects(serviceName, parentCsid, csid, type, sourceField); } - protected List findReferencingCollectionObjects(String serviceName, String csid, String sourceField) throws Exception { + protected List findReferencingCollectionObjects(String serviceName, String csid, String sourceField) throws URISyntaxException, Exception { return findReferencingObjects(serviceName, csid, ServiceBindingUtils.SERVICE_TYPE_OBJECT, sourceField); } - protected List findReferencingCollectionObjects(String serviceName, String vocabularyShortId, String csid, String sourceField) throws Exception { + protected List findReferencingCollectionObjects(String serviceName, String vocabularyShortId, String csid, String sourceField) throws URISyntaxException, DocumentException, Exception { return findReferencingObjects(serviceName, "urn:cspace:name(" + vocabularyShortId + ")", csid, ServiceBindingUtils.SERVICE_TYPE_OBJECT, sourceField); } -- 2.47.3