map.put("derivatives", request.getParameter("derivatives_chooser"));
} else if (licenseclass.equals("recombo")) {
map.put("sampling", request.getParameter("sampling_chooser"));
}
map.put("jurisdiction", jurisdiction);
CCLookup ccLookup = new CCLookup();
CreativeCommons.MdField uriField = CreativeCommons.getCCField("uri");
CreativeCommons.MdField nameField = CreativeCommons.getCCField("name");
ccLookup.issue(licenseclass, map, ConfigurationManager.getProperty("cc.license.locale"));
Item item = subInfo.getSubmissionItem().getItem();
if (licenseclass.equals("xmlui.Submission.submit.CCLicenseStep.no_license"))
{
// only remove any previous licenses
String licenseUri = uriField.ccItemValue(item);
if (licenseUri != null) {
uriField.removeItemValue(item, licenseUri);
if (ConfigurationManager.getBooleanProperty("cc.submit.setname"))
{
String licenseName = nameField.keyedItemValue(item, licenseUri);
nameField.removeItemValue(item, licenseName);
}
if (ConfigurationManager.getBooleanProperty("cc.submit.addBitstream"))
{
CreativeCommons.removeLicense(context, item);
}
item.update();
context.commit();
removeRequiredAttributes(session);
}
return STATUS_COMPLETE;
}
else if (licenseclass.equals("xmlui.Submission.submit.CCLicenseStep.select_change"))
{
removeRequiredAttributes(session);
return STATUS_COMPLETE;
}
else if (ccLookup.isSuccess())
{
uriField.addItemValue(item, ccLookup.getLicenseUrl());
if (ConfigurationManager.getBooleanProperty("cc.submit.addbitstream")) {
CreativeCommons.setLicenseRDF(context, item, ccLookup.getRdf());
}
if (ConfigurationManager.getBooleanProperty("cc.submit.setname")) {
nameField.addItemValue(item, ccLookup.getLicenseName());
}
item.update();
context.commit();
removeRequiredAttributes(session);
session.removeAttribute("inProgress");
}
else
{
request.getSession().setAttribute("ccError", ccLookup.getErrorMessage());
String licenseUri = uriField.ccItemValue(item);
if (licenseUri != null)
{
uriField.removeItemValue(item, licenseUri);
}