use of com.qcadoo.mes.technologies.dto.ModifyTechnologyResult in project mes by qcadoo.
the class ModifyTechnologyListeners method createTechnologies.
public void createTechnologies(final ViewDefinitionState view, final ComponentState componentState, final String[] args) {
componentState.performEvent(view, L_SAVE, args);
CheckBoxComponent generated = (CheckBoxComponent) view.getComponentByReference(L_GENERATED);
FormComponent formComponent = (FormComponent) view.getComponentByReference(QcadooViewConstants.L_FORM);
if (!formComponent.isValid()) {
return;
}
Entity mt = formComponent.getEntity().getDataDefinition().get(formComponent.getEntityId());
ModifyTechnologyResult modifyTechnologyResult = new ModifyTechnologyResult();
createModifiedTechnology(view, componentState, mt, modifyTechnologyResult);
if (!modifyTechnologyResult.getCreatedTechnologies().isEmpty()) {
view.addMessage("technologies.modifyTechnology.createdTechnologies", ComponentState.MessageType.SUCCESS, String.join(",", modifyTechnologyResult.getCreatedTechnologies()));
}
if (!modifyTechnologyResult.getNotCreatedTechnologies().isEmpty()) {
view.addMessage("technologies.modifyTechnology.notCreatedTechnologies", ComponentState.MessageType.FAILURE, String.join(",", modifyTechnologyResult.getNotCreatedTechnologies()));
}
generated.setChecked(true);
}
Aggregations