use of com.emc.metalnx.core.domain.entity.DataGridTemplateField in project metalnx-web by irods-contrib.
the class TemplateController method removeFieldFromDB.
@RequestMapping(value = "/removeFieldFromDB")
@ResponseStatus(value = HttpStatus.OK)
public void removeFieldFromDB(@RequestParam("templateFieldsIDList") final long[] templateFieldsIDList) {
for (long templateFieldID : templateFieldsIDList) {
DataGridTemplateField dataGridField = templateFieldService.findById(templateFieldID);
TemplateFieldForm field = this.mapDataGridTempToFieldForm(dataGridField);
if (addTemplateFields.contains(field)) {
addTemplateFields.remove(field);
}
// adding the field to the list that is needed to be removed from a template
if (!removeTemplateFields.contains(field)) {
removeTemplateFields.add(field);
}
}
}
use of com.emc.metalnx.core.domain.entity.DataGridTemplateField in project metalnx-web by irods-contrib.
the class TemplateServiceImpl method mapDataGridTemplateToXml.
@Override
public MlxMetadataTemplate mapDataGridTemplateToXml(DataGridTemplate template) {
// Mapping DB entity to XML entity
MlxMetadataTemplate t = new MlxMetadataTemplate();
t.setName(template.getTemplateName());
t.setDescription(template.getDescription());
t.setUsageInfo(template.getUsageInformation());
t.setAccessType(template.getAccessType());
for (DataGridTemplateField field : template.getFields()) {
MlxMetadataAVU avu = new MlxMetadataAVU();
avu.setAttribute(field.getAttribute());
avu.setValue(field.getValue());
avu.setUnit(field.getUnit());
t.getMetadatas().add(avu);
}
return t;
}
Aggregations