<artifactId>org.collectionspace.services.batch.client</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.collectionspace.services</groupId>
+ <artifactId>org.collectionspace.services.loanout.client</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.collectionspace.services</groupId>
+ <artifactId>org.collectionspace.services.relation.client</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<dependency>
<groupId>org.collectionspace.services</groupId>
<artifactId>org.collectionspace.services.batch.jaxb</artifactId>
import org.collectionspace.services.common.datetime.GregorianCalendarDateTimeUtils;
import org.collectionspace.services.common.invocable.InvocationContext;
import org.collectionspace.services.common.invocable.InvocationResults;
+import org.collectionspace.services.client.LoanoutClient;
+import org.collectionspace.services.client.RelationClient;
public class CreateAndLinkLoanOutBatchJob implements BatchInvocable {
+"</ns2:loansout_common></document>";
// First, create the Loanout
- ResourceBase resource =
- resourceMap.get("org.collectionspace.services.loanout.LoanoutResource");
+ // We fetch the resource class by service name
+ ResourceBase resource = resourceMap.get( LoanoutClient.SERVICE_NAME);
Response response = resource.create(null, loanoutPayload);
if(response.getStatus() != CREATED_STATUS) {
completionStatus = STATUS_ERROR;
+ "<relationshipType>"+RELATION_TYPE+"</relationshipType>"
+ "<predicateDisplayName>"+RELATION_PREDICATE_DISP+"</predicateDisplayName>"
+ "</ns2:relations_common></document>";
- ResourceBase resource =
- resourceMap.get("org.collectionspace.services.relation.RelationResource");
+ ResourceBase resource = resourceMap.get(RelationClient.SERVICE_NAME);
Response response = resource.create(null, relationPayload);
if(response.getStatus() != CREATED_STATUS) {
completionStatus = STATUS_ERROR;