public void addBody(Body body) throws WingException, SQLException, AuthorizeException
{
int collectionID = parameters.getParameterAsInteger("collectionID", -1);
Collection thisCollection = Collection.find(context, collectionID);
Request request = ObjectModelHelper.getRequest(objectModel);
HarvestedCollection hc = HarvestedCollection.find(context, collectionID);
String baseURL = contextPath + "/admin/collection?administrative-continue=" + knot.getId();
String errorString = parameters.getParameter("errors",null);
String[] errors = errorString.split(",");
HashMap<String,String> errorMap = new HashMap<String,String>();
for (String error : errors) {
//System.out.println(errorString);
String[] errorPieces = error.split(":",2);
if (errorPieces.length > 1)
errorMap.put(errorPieces[0], errorPieces[1]);
else
errorMap.put(errorPieces[0], errorPieces[0]);
}
String oaiProviderValue;
String oaiSetIdValue;
String metadataFormatValue;
int harvestLevelValue;
if (hc != null && request.getParameter("submit_test") == null) {
oaiProviderValue = hc.getOaiSource();
oaiSetIdValue = hc.getOaiSetId();
metadataFormatValue = hc.getHarvestMetadataConfig();
harvestLevelValue = hc.getHarvestType();
}
else {
oaiProviderValue = parameters.getParameter("oaiProviderValue", "");
oaiSetIdValue = parameters.getParameter("oaiSetAll", "");
if(!"all".equals(oaiSetIdValue))
oaiSetIdValue = parameters.getParameter("oaiSetIdValue", null);
metadataFormatValue = parameters.getParameter("metadataFormatValue", "");
String harvestLevelString = parameters.getParameter("harvestLevelValue","0");
if (harvestLevelString.length() == 0)
harvestLevelValue = 0;
else
harvestLevelValue = Integer.parseInt(harvestLevelString);
}
// DIVISION: main
Division main = body.addInteractiveDivision("collection-harvesting-setup",contextPath+"/admin/collection",Division.METHOD_MULTIPART,"primary administrative collection");
main.setHead(T_main_head.parameterize(thisCollection.getMetadata("name")));
List options = main.addList("options",List.TYPE_SIMPLE,"horizontal");
options.addItem().addXref(baseURL+"&submit_metadata",T_options_metadata);
options.addItem().addXref(baseURL+"&submit_roles",T_options_roles);
options.addItem().addHighlight("bold").addXref(baseURL+"&submit_harvesting",T_options_harvest);