Package com.serotonin.m2m2.vo

Examples of com.serotonin.m2m2.vo.DataPointVO


            name = SerializationHelper.readSafeUTF(in);

            int len = in.readInt();
            for (int i = 0; i < len; i++) {
                String childId = in.readUTF();
                DataPointVO dataPoint = readDataPoint(in);
                setDataPoint(childId, dataPoint);
            }
        }
    }
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

        }
    }

    @DwrPermission(user = true)
    public List<ReportInstance> deleteReportInstance(int instanceId) {
        User user = Common.getUser();
        ReportDao reportDao = new ReportDao();
        reportDao.deleteReportInstance(instanceId, user.getId());
        return getReportInstances(user);
    }
View Full Code Here

        result = new ReportDao().getReportInstances(user.getId());
        Translations translations = getTranslations();
        UserDao userDao = new UserDao();
        for (ReportInstance i : result){
            i.setTranslations(translations);
            User reportUser = userDao.getUser(i.getUserId());
            if(reportUser != null)
              i.setUsername(reportUser.getUsername());
            else
              i.setUsername(Common.translate("reports.validate.userDNE"));
           
        }
        return result;
View Full Code Here

    }

    @DwrPermission(user = true)
    public ReportVO createReportFromWatchlist(String name, int[] dataPointIds) {
        ReportVO report = new ReportVO();
        User user = Common.getUser();

        report.setName(new TranslatableMessage("common.copyPrefix", name).translate(getTranslations()));
        report.setXid(Common.generateXid("REP_"));
        DataPointDao dataPointDao = new DataPointDao();
        for (int id : dataPointIds) {
View Full Code Here

public class ReportLaunchServlet extends BaseInfoServlet{
  private static final long serialVersionUID = -1;
 
  @Override
  protected void doGet(HttpServletRequest request, HttpServletResponse response) {
    User user = Common.getUser(request);
    if(user != null) {
      ReportDao dao = new ReportDao();
      ReportVO report = null;
      int id = getIntRequestParameter(request, "reportId", -1);
      if(id != -1)
        report = dao.getReport(id);
      String xid = request.getParameter("reportXid");
      if(xid != null)
        report = dao.getReport(xid);
      if(report != null && (user.getId() == report.getUserId() || user.isAdmin())) {
        ReportJob.scheduleReportJob(report);
        try {
          response.getWriter().write("Report " + report.getName() + " scheduled");
        } catch(Exception e) {
          response.setStatus(500);
View Full Code Here

    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
        // The only place that should be calling this servlet is the report chart, generated by a Freemarker
        // template. The ReportChartCreator that controlled the generation put the generated image content into the
        // user object, so all i need to do is write that content to the response object.
        User user = Common.getUser(request);
        if (user != null) {
            @SuppressWarnings("unchecked")
            Map<String, byte[]> imageData = (Map<String, byte[]>) user.getAttribute(IMAGE_DATA_KEY);
            if (imageData != null) {
                String path = request.getPathInfo();

                // Path will be of the format "/<chartName>", so we need to ignore the first character.
                byte[] data = imageData.get(path.substring(1));
View Full Code Here

    private int inactiveSecond;
    @JsonProperty
    private String inactiveCron;

    public EventTypeVO getEventType() {
        return new EventTypeVO(ScheduledEventType.TYPE_NAME, null, id, 0, getDescription(), alarmLevel);
    }
View Full Code Here

TOP

Related Classes of com.serotonin.m2m2.vo.DataPointVO

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.