Search in sources :

Example 1 with ScriptComponent

use of com.serotonin.m2m2.gviews.component.ScriptComponent in project ma-modules-public by infiniteautomation.

the class GraphicalViewDwr method saveScriptComponent.

@DwrPermission(user = true)
public ProcessResult saveScriptComponent(String viewComponentId, String script) {
    ProcessResult response = new ProcessResult();
    // Validate
    if (StringUtils.isBlank(script))
        response.addContextualMessage("graphicRendererScriptScript", "viewEdit.graphic.missingScript");
    if (!response.getHasMessages()) {
        ScriptComponent c = (ScriptComponent) getViewComponent(viewComponentId);
        c.setScript(script);
        resetPointComponent(c);
    }
    return response;
}
Also used : ScriptComponent(com.serotonin.m2m2.gviews.component.ScriptComponent) ProcessResult(com.serotonin.m2m2.i18n.ProcessResult) DwrPermission(com.serotonin.m2m2.web.dwr.util.DwrPermission)

Aggregations

ScriptComponent (com.serotonin.m2m2.gviews.component.ScriptComponent)1 ProcessResult (com.serotonin.m2m2.i18n.ProcessResult)1 DwrPermission (com.serotonin.m2m2.web.dwr.util.DwrPermission)1