use of com.serotonin.m2m2.gviews.component.SimpleCompoundComponent in project ma-modules-public by infiniteautomation.
the class GraphicalViewDwr method saveSimpleCompoundComponent.
@DwrPermission(user = true)
public ProcessResult saveSimpleCompoundComponent(String viewComponentId, String name, String backgroundColour, List<StringStringPair> childPointIds) {
ProcessResult response = new ProcessResult();
validateCompoundComponent(response, name);
String leadPointId = null;
for (StringStringPair kvp : childPointIds) {
if (SimpleCompoundComponent.LEAD_POINT.equals(kvp.getKey())) {
leadPointId = kvp.getValue();
break;
}
}
if (NumberUtils.toInt(leadPointId, 0) <= 0)
response.addContextualMessage("compoundPointSelect" + SimpleCompoundComponent.LEAD_POINT, "dsEdit.validate.required");
if (!response.getHasMessages()) {
SimpleCompoundComponent c = (SimpleCompoundComponent) getViewComponent(viewComponentId);
c.setName(name);
c.setBackgroundColour(backgroundColour);
saveCompoundPoints(c, childPointIds);
}
return response;
}
Aggregations