use of com.emc.metalnx.modelattribute.metadatatemplate.MetadataTemplateForm in project metalnx-web by irods-contrib.
the class TemplateController method showModifyTemplate.
@RequestMapping(value = "modify/")
public String showModifyTemplate(final Model model, final HttpServletRequest request) {
// DataGridTemplate template =
// templateService.findById(selectedTemplates.iterator().next());
DataGridTemplate template = templateService.findById(Long.parseLong(request.getParameter("templateId")));
if (template == null) {
return "redirect:/templates/";
}
MetadataTemplateForm templateForm = new MetadataTemplateForm();
templateForm.setId(template.getId());
templateForm.setTemplateName(template.getTemplateName());
templateForm.setDescription(template.getDescription());
templateForm.setUsageInformation(template.getUsageInformation());
templateForm.setOwner(template.getOwner());
templateForm.setAccessType(template.getAccessType());
templateForm.setVersion(template.getVersion());
TemplateFieldForm templateFieldForm = new TemplateFieldForm();
model.addAttribute("uiMode", request.getSession().getAttribute("uiMode"));
model.addAttribute("accessTypes", MetadataTemplateAccessType.values());
model.addAttribute("metadataTemplateForm", templateForm);
model.addAttribute("templateFieldForm", templateFieldForm);
model.addAttribute("requestMapping", "/templates/modify/action/");
return "template/templateForm";
}
use of com.emc.metalnx.modelattribute.metadatatemplate.MetadataTemplateForm in project metalnx-web by irods-contrib.
the class TemplateController method newTemplate.
@RequestMapping(value = "add/")
public String newTemplate(final Model model, final HttpServletRequest request) {
MetadataTemplateForm templateForm = new MetadataTemplateForm();
TemplateFieldForm templateFieldForm = new TemplateFieldForm();
if (addTemplateFields == null) {
addTemplateFields = new ArrayList<TemplateFieldForm>();
}
templateForm.setOwner(loggedUserUtils.getLoggedDataGridUser().getUsername());
model.addAttribute("uiMode", request.getSession().getAttribute("uiMode"));
model.addAttribute("accessTypes", MetadataTemplateAccessType.values());
model.addAttribute("metadataTemplateForm", templateForm);
model.addAttribute("templateFieldForm", templateFieldForm);
model.addAttribute("requestMapping", "/templates/add/action/");
model.addAttribute("requestMappingForTemplateField", "/templates/addFieldToCurrentTemplate");
return "template/templateForm";
}
use of com.emc.metalnx.modelattribute.metadatatemplate.MetadataTemplateForm in project metalnx-web by irods-contrib.
the class TemplateController method listTemplateFieldsForCollections.
@RequestMapping(value = "/listTemplateFieldsForCollections", method = RequestMethod.POST)
public String listTemplateFieldsForCollections(final Model model, @RequestParam("templateIDsList") final long[] templateIDsList) {
MetadataTemplateForm templateForm = new MetadataTemplateForm();
List<TemplateFieldForm> templateFields = new ArrayList<TemplateFieldForm>();
List<DataGridTemplateField> dataGridTemplateFields = new ArrayList<DataGridTemplateField>();
if (templateIDsList.length > 0) {
for (long id : templateIDsList) {
dataGridTemplateFields.addAll(templateService.listTemplateFields(id));
}
templateFields = this.mapDataGridTempToFieldForm(dataGridTemplateFields);
}
model.addAttribute("templateForm", templateForm);
model.addAttribute("requestMapping", "/browse/applyTemplatesToCollections/");
model.addAttribute("templateFields", templateFields);
model.addAttribute("resultSize", templateFields.size());
model.addAttribute("foundTemplateFields", templateFields.size() > 0);
return "collections/templateFieldListForCollections";
}
Aggregations