Package com.serotonin.m2m2.i18n

Examples of com.serotonin.m2m2.i18n.ProcessResult.addContextualMessage()


        if (min >= max)
            response.addContextualMessage("graphicRendererDynamicMin", "viewEdit.graphic.invalidMinMax");

        DynamicImage dynamicImage = getDynamicImage(dynamicImageId);
        if (dynamicImage == null)
            response.addContextualMessage("graphicRendererDynamicImage", "viewEdit.graphic.missingDynamicImage");

        if (!response.getHasMessages()) {
            DynamicGraphicComponent c = (DynamicGraphicComponent) getViewComponent(viewComponentId);
            c.setMin(min);
            c.setMax(max);
View Full Code Here


        ProcessResult response = new ProcessResult();

        // Validate
        ImageSet imageSet = getImageSet(imageSetId);
        if (imageSet == null)
            response.addContextualMessage("graphicRendererMultistateImageSet", "viewEdit.graphic.missingImageSet");

        if (!response.getHasMessages()) {
            MultistateGraphicComponent c = (MultistateGraphicComponent) getViewComponent(viewComponentId);
            c.setImageStateList(imageStates);
            c.setDefaultImage(defaultImage);
View Full Code Here

    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);
View Full Code Here

    public ProcessResult saveThumbnailComponent(String viewComponentId, int scalePercent) {
        ProcessResult response = new ProcessResult();

        // Validate
        if (scalePercent < 1)
            response.addContextualMessage("graphicRendererThumbnailScalePercent", "viewEdit.graphic.invalidScale");

        if (!response.getHasMessages()) {
            ThumbnailComponent c = (ThumbnailComponent) getViewComponent(viewComponentId);
            c.setScalePercent(scalePercent);
            resetPointComponent(c);
View Full Code Here

                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);
View Full Code Here

            int durationType, int durationPeriods, List<StringStringPair> childPointIds) {
        ProcessResult response = new ProcessResult();

        validateCompoundComponent(response, name);
        if (width < 1)
            response.addContextualMessage("imageChartWidth", "validate.greaterThanZero");
        if (height < 1)
            response.addContextualMessage("imageChartHeight", "validate.greaterThanZero");
        if (!Common.TIME_PERIOD_CODES.isValidId(durationType))
            response.addContextualMessage("imageChartDurationType", "validate.invalidValue");
        if (durationPeriods <= 0)
View Full Code Here

        validateCompoundComponent(response, name);
        if (width < 1)
            response.addContextualMessage("imageChartWidth", "validate.greaterThanZero");
        if (height < 1)
            response.addContextualMessage("imageChartHeight", "validate.greaterThanZero");
        if (!Common.TIME_PERIOD_CODES.isValidId(durationType))
            response.addContextualMessage("imageChartDurationType", "validate.invalidValue");
        if (durationPeriods <= 0)
            response.addContextualMessage("imageChartDurationPeriods", "validate.greaterThanZero");
View Full Code Here

        if (width < 1)
            response.addContextualMessage("imageChartWidth", "validate.greaterThanZero");
        if (height < 1)
            response.addContextualMessage("imageChartHeight", "validate.greaterThanZero");
        if (!Common.TIME_PERIOD_CODES.isValidId(durationType))
            response.addContextualMessage("imageChartDurationType", "validate.invalidValue");
        if (durationPeriods <= 0)
            response.addContextualMessage("imageChartDurationPeriods", "validate.greaterThanZero");

        if (!response.getHasMessages()) {
            ImageChartComponent c = (ImageChartComponent) getViewComponent(viewComponentId);
View Full Code Here

        if (height < 1)
            response.addContextualMessage("imageChartHeight", "validate.greaterThanZero");
        if (!Common.TIME_PERIOD_CODES.isValidId(durationType))
            response.addContextualMessage("imageChartDurationType", "validate.invalidValue");
        if (durationPeriods <= 0)
            response.addContextualMessage("imageChartDurationPeriods", "validate.greaterThanZero");

        if (!response.getHasMessages()) {
            ImageChartComponent c = (ImageChartComponent) getViewComponent(viewComponentId);
            c.setName(name);
            c.setWidth(width);
View Full Code Here

        ProcessResult response = new ProcessResult();
        MaintenanceEventDao maintenanceEventDao = new MaintenanceEventDao();

        if (StringUtils.isBlank(xid))
            response.addContextualMessage("xid", "validate.required");
        else if (!maintenanceEventDao.isXidUnique(xid, id))
            response.addContextualMessage("xid", "validate.xidUsed");

        e.validate(response);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.