}
}
- public InvocationResults createVoucherFromCataloging(String collectionObjectCsid) throws Exception {
+ public InvocationResults createVoucherFromCataloging(String collectionObjectCsid) throws ResourceException, URISyntaxException, DocumentException, Exception {
return createVoucherFromCataloging(collectionObjectCsid, null);
}
- public InvocationResults createVoucherFromCataloging(String collectionObjectCsid, String movementCsid) throws Exception {
+ public InvocationResults createVoucherFromCataloging(String collectionObjectCsid, String movementCsid) throws ResourceException, URISyntaxException, DocumentException, Exception {
InvocationResults results = new InvocationResults();
PoxPayloadOut collectionObjectPayload = findCollectionObjectByCsid(collectionObjectCsid);
return results;
}
- private String getFieldCollectionNote(PoxPayloadOut collectionObjectPayload) throws Exception {
+ private String getFieldCollectionNote(PoxPayloadOut collectionObjectPayload) throws URISyntaxException, DocumentException, Exception {
String placeNote = "";
String reverseFieldCollectionPlace = getReverseFieldCollectionPlace(collectionObjectPayload);
return collectionNote;
}
- private String getReverseFieldCollectionPlace(PoxPayloadOut collectionObjectPayload) throws Exception {
+ private String getReverseFieldCollectionPlace(PoxPayloadOut collectionObjectPayload) throws URISyntaxException, DocumentException, Exception {
String reverseDisplayName = null;
String fieldCollectionPlaceRefName = getFieldValue(collectionObjectPayload, CollectionObjectBotGardenConstants.FIELD_COLLECTION_PLACE_SCHEMA_NAME,
CollectionObjectBotGardenConstants.FIELD_COLLECTION_PLACE_FIELD_NAME);
return annotation;
}
- public InvocationResults createVoucherFromCurrentLocation(String movementCsid) throws Exception {
+ public InvocationResults createVoucherFromCurrentLocation(String movementCsid) throws ResourceException, URISyntaxException, DocumentException, Exception {
long numAffected = 0;
String primaryUriCreated = null;
}
}
- public InvocationResults merge(String docType, String target, String sourceCsid) throws Exception {
+ public InvocationResults merge(String docType, String target, String sourceCsid) throws URISyntaxException, DocumentException, Exception {
return merge(docType, target, new LinkedHashSet<String>(Arrays.asList(sourceCsid)));
}
- public InvocationResults merge(String docType, String target, Set<String> sourceCsids) throws Exception {
+ public InvocationResults merge(String docType, String target, Set<String> sourceCsids) throws URISyntaxException, DocumentException, Exception {
logger.debug("Merging docType=" + docType + " target=" + target + " sourceCsids=" + StringUtils.join(sourceCsids, ","));
String serviceName = getAuthorityServiceNameForDocType(docType);
return merge(docType, targetItemPayload, sourceItemPayloads);
}
- private InvocationResults merge(String docType, PoxPayloadOut targetItemPayload, List<PoxPayloadOut> sourceItemPayloads) throws Exception {
+ private InvocationResults merge(String docType, PoxPayloadOut targetItemPayload, List<PoxPayloadOut> sourceItemPayloads) throws URISyntaxException, DocumentException, Exception {
int numAffected = 0;
List<String> userNotes = new ArrayList<String>();
return results;
}
- private InvocationResults updateReferences(String serviceName, String inAuthority, String sourceCsid, String sourceRefName, String targetRefName) throws Exception {
+ private InvocationResults updateReferences(String serviceName, String inAuthority, String sourceCsid, String sourceRefName, String targetRefName) throws URISyntaxException, DocumentException, Exception {
logger.debug("Updating references: serviceName=" + serviceName + " inAuthority=" + inAuthority + " sourceCsid=" + sourceCsid + " sourceRefName=" + sourceRefName + " targetRefName=" + targetRefName);
String sourceDisplayName = RefNameUtils.getDisplayName(sourceRefName);
String serviceName = getAuthorityServiceNameForDocType(docType);
AuthorityResource<?, ?> resource = (AuthorityResource<?, ?>) getResourceMap().get(serviceName);
- resource.updateAuthorityItem(getResourceMap(), createUriInfo(), inAuthority, csid, payload);
+ resource.updateAuthorityItem(getServiceContext(), getResourceMap(), createUriInfo(), inAuthority, csid, payload);
}
- private InvocationResults deleteAuthorityItem(String docType, String inAuthority, String csid, String refName) throws URISyntaxException {
+ private InvocationResults deleteAuthorityItem(String docType, String inAuthority, String csid, String refName) throws URISyntaxException, Exception {
int numAffected = 0;
List<String> userNotes = new ArrayList<String>();
String displayName = RefNameUtils.getDisplayName(refName);
logger.debug("Deleting hasBroader relation " + relationCsid);
- relationResource.delete(relationCsid);
+ relationResource.deleteWithParentCtx(getServiceContext(), relationCsid);
userNotes.add("Deleted the \"has broader\" relation from " + subjectDisplayName + " to " + objectDisplayName + ".");
numAffected++;
logger.debug("Soft deleting: docType=" + docType + " inAuthority=" + inAuthority + " csid=" + csid);
- resource.updateItemWorkflowWithTransition(null, inAuthority, csid, "delete");
+ resource.updateItemWorkflowWithTransition(getServiceContext(), createUriInfo(), inAuthority, csid, "delete");
userNotes.add("Deleted the source record, " + displayName + ".");
numAffected++;
//
@Override
protected List<String> findAllAuthorityItems(AuthorityResource<?, ?> resource, String vocabularyCsid, int pageSize, int pageNum, String sortBy)
- throws URISyntaxException, Exception {
+ throws URISyntaxException, DocumentException, Exception {
boolean tx = false;
if (TransactionHelper.isTransactionActive() == false) {
tx = TransactionHelper.startTransaction();
}
}
-
@Override
public void run() {
run(null);
*
* @param taxonCsid The csid of the taxon record
* @return
- * @throws Exception
+ * @throws URISyntaxException
+ * @throws DocumentException
*/
- public InvocationResults updateReferencingRareFlags(String taxonCsid, String vocabularyCsid) throws Exception {
+ public InvocationResults updateReferencingRareFlags(String taxonCsid, String vocabularyCsid) throws URISyntaxException, DocumentException, Exception {
PoxPayloadOut taxonPayload = vocabularyCsid == null
? findTaxonByCsid(taxonCsid)
: findTaxonByCsid(taxonCsid, vocabularyCsid);
*
* @param collectionObjectCsid The csid of the collectionobject
* @return
- * @throws Exception
+ * @throws URISyntaxException
+ * @throws DocumentException
*/
- public InvocationResults updateRareFlag(String collectionObjectCsid) throws Exception {
+ public InvocationResults updateRareFlag(String collectionObjectCsid) throws URISyntaxException, DocumentException, Exception {
PoxPayloadOut collectionObjectPayload = findCollectionObjectByCsid(collectionObjectCsid);
return updateRareFlag(collectionObjectPayload);
*
* @param collectionObjectPayload The payload representing the collectionobject
* @return
- * @throws Exception
+ * @throws URISyntaxException
+ * @throws DocumentException
*/
- public InvocationResults updateRareFlag(PoxPayloadOut collectionObjectPayload) throws Exception {
+ public InvocationResults updateRareFlag(PoxPayloadOut collectionObjectPayload) throws URISyntaxException, DocumentException, Exception {
InvocationResults results = new InvocationResults();
String uri = this.getFieldValue(collectionObjectPayload, CollectionObjectBotGardenConstants.URI_SCHEMA_NAME,
*
* @param collectionObjectCsids The csids of the collectionobjects
* @return
- * @throws Exception
+ * @throws URISyntaxException
+ * @throws DocumentException
*/
- public InvocationResults updateRareFlags(List<String> collectionObjectCsids) throws Exception {
+ public InvocationResults updateRareFlags(List<String> collectionObjectCsids) throws URISyntaxException, DocumentException, Exception {
int numSubmitted = collectionObjectCsids.size();
long numAffected = 0;
* Updates the rare flags of all collectionobjects.
*
* @return
- * @throws Exception
+ * @throws URISyntaxException
+ * @throws DocumentException
*/
- public InvocationResults updateAllRareFlags() throws Exception {
+ public InvocationResults updateAllRareFlags() throws URISyntaxException, DocumentException, Exception {
long numFound = 0;
long numAffected = 0;