Package com.serotonin.m2m2.rt.script

Examples of com.serotonin.m2m2.rt.script.ScriptExecutor


    return KEY;
  }

  @Override
  public ChangeTypeRT createRuntime() {
    return new SinusoidalChangeRT(this);
  }
View Full Code Here


        return Common.getPeriodDescription(updatePeriodType, updatePeriods);
    }

    @Override
    public DataSourceRT createDataSourceRT() {
        return new VirtualDataSourceRT(this);
    }
View Full Code Here

      if (startValue == null)
        startObject = new AlphanumericValue("");
      else
        startObject = new AlphanumericValue(startValue);
    }
    return new VirtualPointLocatorRT(changeType, startObject, isSettable());
  }
View Full Code Here

   * @see com.serotonin.json.spi.JsonSerializable#jsonWrite(com.serotonin.json.ObjectWriter)
   */
  @Override
  public void jsonWrite(ObjectWriter writer) throws IOException, JsonException {
   
    DataPointVO vo = DataPointDao.instance.get(pointId);
    if(vo != null)
      writer.writeEntry("pointXid", vo.getXid());
   
  }
View Full Code Here

        report.setName(new TranslatableMessage("common.copyPrefix", name).translate(getTranslations()));
        report.setXid(Common.generateXid("REP_"));
        DataPointDao dataPointDao = new DataPointDao();
        for (int id : dataPointIds) {
            DataPointVO dp = dataPointDao.getDataPoint(id);
            if (dp == null || !Permissions.hasDataPointReadPermission(user, dp))
                continue;

            ReportPointVO rp = new ReportPointVO();
            rp.setPointId(dp.getId());
            rp.setPointKey("p" + dp.getId());
            rp.setColour(dp.getChartColour());
            rp.setConsolidatedChart(true);
            rp.setPlotType(dp.getPlotType());
            report.getPoints().add(rp);
        }

        return report;
    }
View Full Code Here

        return view;
    }

    protected DataPointVO getDataPointVO(JspView view, String xid) throws JspException {
        // Find the point.
        DataPointVO dataPointVO = new DataPointDao().getDataPoint(xid);
        if (dataPointVO == null)
            throw new JspException("Point with XID '" + xid + "' not found");

        // Check that the authorizing user has access to the point.
        Permissions.ensureDataPointReadPermission(view.getAuthorityUser(), dataPointVO);
View Full Code Here

        for (int i = 1; i < nextLine.length; i++) {
            if (StringUtils.isBlank(nextLine[i]))
                throw new TranslatableException(new TranslatableMessage("dataImport.import.badXid", i));

            DataPointVO vo = dataPointDao.getDataPoint(nextLine[i]);
            if (vo == null)
                throw new TranslatableException(new TranslatableMessage("dataImport.import.xidNotFound", nextLine[i]));

            vos[i - 1] = vo;
        }
View Full Code Here

public class ReportsDwr extends ModuleDwr {
    @DwrPermission(user = true)
    public ProcessResult init() {
        ProcessResult response = new ProcessResult();
        ReportDao reportDao = new ReportDao();
        User user = Common.getUser();

        response.addData("points", getReadablePoints());
        response.addData("mailingLists", new MailingListDao().getMailingLists());
        response.addData("users", new UserDao().getUsers());
        if(user.isAdmin()) {
          response.addData("reports", reportDao.getReports());
          response.addData("instances", getReportInstances(user));
      }
        else {
          response.addData("reports", reportDao.getReports(user.getId()));
          response.addData("instances", getReportInstances(user));
      }
        response.addData("templates", getTemplateList());

        return response;
View Full Code Here

            response.addContextualMessage("recipients", "reports.validate.needRecip");

        if (response.getHasMessages())
            return response;

        User user = Common.getUser();
        ReportDao reportDao = new ReportDao();
        ReportVO report;
        if (id == Common.NEW_ID) {
            report = new ReportVO();
            report.setUserId(user.getId());
        }
        else
            report = reportDao.getReport(id);
       
        ReportCommon.ensureReportPermission(user, report);
View Full Code Here

        if (previousPeriodCount < 1)
            response.addContextualMessage("previousPeriodCount", "reports.validate.periodCountLessThan1");
        if (pastPeriodCount < 1)
            response.addContextualMessage("pastPeriodCount", "reports.validate.periodCountLessThan1");

        User user = Common.getUser();
        DataPointDao dataPointDao = new DataPointDao();
        for (ReportPointVO point : points) {
            Permissions.ensureDataPointReadPermission(user, dataPointDao.getDataPoint(point.getPointId()));

            try {
View Full Code Here

TOP

Related Classes of com.serotonin.m2m2.rt.script.ScriptExecutor

Copyright © 2018 www.massapicom. 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.