String idsString = parameters.getParameter("fieldIDs", null);
ArrayList<MetadataField> fields = new ArrayList<MetadataField>();
for (String id : idsString.split(","))
{
MetadataField field = MetadataField.find(context,Integer.valueOf(id));
fields.add(field);
}
// DIVISION: metadata-field-confirm-delete
Division deleted = body.addInteractiveDivision("metadata-field-confirm-delete",contextPath+"/admin/metadata-registry",Division.METHOD_POST,"primary administrative metadata-registry");
deleted.setHead(T_head);
deleted.addPara(T_para1);
Para warning = deleted.addPara();
warning.addHighlight("bold").addContent(T_warning);
warning.addContent(T_para2);
Table table = deleted.addTable("field-confirm-delete",fields.size() + 1, 3);
Row header = table.addRow(Row.ROLE_HEADER);
header.addCell().addContent(T_column1);
header.addCell().addContent(T_column2);
header.addCell().addContent(T_column3);
for (MetadataField field : fields)
{
if (field == null)
{
continue;
}
String fieldID = String.valueOf(field.getFieldID());
String fieldEelement = field.getElement();
String fieldQualifier = field.getQualifier();
MetadataSchema schema = MetadataSchema.find(context, field.getSchemaID());
String schemaName = schema.getName();
StringBuilder fieldName = new StringBuilder()
.append(schemaName)
.append(".")
.append(fieldEelement);
if (fieldQualifier != null && fieldQualifier.length() > 0)
{
fieldName.append(".").append(fieldQualifier);
}
String fieldScopeNote = field.getScopeNote();
Row row = table.addRow();
row.addCell().addContent(fieldID);
row.addCell().addContent(fieldName.toString());
row.addCell().addContent(fieldScopeNote);