for (int i=0; i<types.length; i++) {
wfResultItem.addLogInfo("type[" + i + "]: " + types[i]);
}
if (types[0] != null) {
Event eIdentifyFormat = buildEvent(URI.create(types[0].toString()), IDENTIFY_EVENT);
dgoB = addEvent(dgoB, eIdentifyFormat, URI.create(types[0]), false);
}
}
// Update digital object in JCR repository
wfResultItem.addLogInfo("STEP 3: Update digital object in JCR repository. initial digital object: " +
dgoB.toString());
dgoB = dodm.updateDigitalObject(dgoB, false);
wfResultItem.addLogInfo("Completed update in JCR repository. result digital object: " + dgoB.toString());
// Migration service
DigitalObject dgoC = null;
wfResultItem.addLogInfo("STEP 4: Starting migration");
wfResultItem.addLogInfo("processingDigo.getPermanentUri(): " + processingDigo.getPermanentUri() +
", dgoB.getPermanentUri(): " + dgoB.getPermanentUri());
DataRegistry dataRegistry = DataRegistryFactory.getDataRegistry();
URI baseUri = DataRegistryFactory.createDataRegistryIdFromName(DOJCRConstants.REGISTRY_NAME);
wfResultItem.addLogInfo("base URI: " + baseUri);
URI resUri = URI.create(baseUri.toString() + dgoB.getPermanentUri().toString());
wfResultItem.addLogInfo("resUri: " + resUri);
URI dgoCRef = runMigration(migrate, resUri, true);
wfResultItem.addLogInfo("Completed migration. URI: " + dgoCRef);
// Add migration resulting text to metadata
if (dgoCRef != null) {
try {
baseUri = new PDURI(dgoCRef.normalize()).formDataRegistryRootURI();
wfResultItem.addLogInfo("migration base URI: " + baseUri);
dgoC = dataRegistry.getDigitalObjectManager(baseUri).retrieve(dgoCRef);
wfResultItem.addLogInfo("dgoC: " + dgoC.toString());
if (dgoC != null && dgoB.getPermanentUri() != null) {
Event eMigration = buildEvent(dgoB.getPermanentUri(), MIGRATE_EVENT);
dgoC = addEvent(dgoC, eMigration, null, true);
}
} catch (Exception e) {
wfResultItem.addLogInfo("migration error: " + e.getMessage());