main.setHead(T_head2.parameterize(nameValue));
main.addPara(T_para1);
List form = main.addList("edit-bitstream-format",List.TYPE_FORM);
Text name = form.addItem().addText("short_description");
name.setRequired();
name.setLabel(T_name);
name.setHelp(T_name_help);
name.setValue(nameValue);
name.setSize(35);
if (errors.contains("short_description"))
name.addError(T_name_error);
Text mimeType = form.addItem().addText("mimetype");
mimeType.setLabel(T_mimetype);
mimeType.setHelp(T_mimetype_help);
mimeType.setValue(mimetypeValue);
mimeType.setSize(35);
// Do not allow anyone to change the name of the unknown format.
if (format != null && format.getID() == 1)
name.setDisabled();
TextArea description = form.addItem().addTextArea("description");
description.setLabel(T_description);
description.setValue(descriptionValue);
description.setSize(3, 35);
Select supportLevel = form.addItem().addSelect("support_level");
supportLevel.setLabel(T_support);
supportLevel.setHelp(T_support_help);
supportLevel.addOption(0,T_support_0);
supportLevel.addOption(1,T_support_1);
supportLevel.addOption(2,T_support_2);
supportLevel.setOptionSelected(supportLevelValue);
CheckBox internal = form.addItem().addCheckBox("internal");
internal.setLabel(T_internal);
internal.setHelp(T_internal_help);
internal.addOption((internalValue != null),"true");
Text extensions = form.addItem().addText("extensions");
extensions.setLabel(T_extensions);
extensions.setHelp(T_extensions_help);
extensions.enableAddOperation();
extensions.enableDeleteOperation();
for (String extensionValue : extensionValues)
{
extensions.addInstance().setValue(extensionValue);
}
Item actions = form.addItem();
actions.addButton("submit_save").setValue(T_submit_save);
actions.addButton("submit_cancel").setValue(T_submit_cancel);