xwalkName = parts[1];
}
else
xwalkName = metsName = dmdTypes[i];
DisseminationCrosswalk xwalk = (DisseminationCrosswalk)
PluginManager.getNamedPlugin(DisseminationCrosswalk.class, xwalkName);
if (xwalk == null)
throw new PackageValidationException("Cannot find "+dmdTypes[i]+" crosswalk plugin!");
else
crosswalkToMets(xwalk, item, xmlData);
DmdSec dmdSec = new DmdSec();
dmdSec.setID(dmdId[i]);
dmdSec.setGROUPID(dmdGroup);
MdWrap mdWrap = new MdWrap();
setMdType(mdWrap, metsName);
mdWrap.getContent().add(xmlData);
dmdSec.getContent().add(mdWrap);
mets.getContent().add(dmdSec);
}
// Only add license AMD section if there are any licenses.
// Catch authorization failures accessing license bitstreams
// only if we are skipping unauthorized bitstreams.
String licenseID = null;
try
{
AmdSec amdSec = new AmdSec();
addRightsMd(context, item, amdSec);
if (amdSec.getContent().size() > 0)
{
licenseID = gensym("license");
amdSec.setID(licenseID);
mets.getContent().add(amdSec);
}
}
catch (AuthorizeException e)
{
String unauth = (params == null) ? null : params.getProperty("unauthorized");
if (!(unauth != null && unauth.equalsIgnoreCase("skip")))
throw e;
else
log.warn("Skipping license metadata because of access failure: "+e.toString());
}
// FIXME: History data???? Nooooo!!!!
// fileSec - all non-metadata bundles go into fileGrp,
// and each bitstream therein into a file.
// Create the bitstream-level techMd and div's for structmap
// at the same time so we can connec the IDREFs to IDs.
FileSec fileSec = new FileSec();
String techMdType = getTechMdType(params);
String parts[] = techMdType.split(":", 2);
String xwalkName, metsName;
if (parts.length > 1)
{
metsName = parts[0];
xwalkName = parts[1];
}
else
xwalkName = metsName = techMdType;
DisseminationCrosswalk xwalk = (DisseminationCrosswalk)
PluginManager.getNamedPlugin(DisseminationCrosswalk.class, xwalkName);
if (xwalk == null)
throw new PackageValidationException("Cannot find "+xwalkName+" crosswalk plugin!");
// log the primary bitstream for structmap