Package com.serotonin.m2m2.gviews.component

Examples of com.serotonin.m2m2.gviews.component.PointComponent


    private TranslatableMessage weekday(boolean active) {
        int day = activeDay;
        if (!active)
            day = inactiveDay;
        return new TranslatableMessage(weekdays[day]);
    }
View Full Code Here


        if (!active)
            day = inactiveDay;

        if (day == -3)
            return new TranslatableMessage("common.day.thirdLast");
        if (day == -2)
            return new TranslatableMessage("common.day.secondLastLast");
        if (day == -1)
            return new TranslatableMessage("common.day.last");
        if (day != 11 && day % 10 == 1)
            return new TranslatableMessage("common.counting.st", Integer.toString(day));
        if (day != 12 && day % 10 == 2)
            return new TranslatableMessage("common.counting.nd", Integer.toString(day));
        if (day != 13 && day % 10 == 3)
            return new TranslatableMessage("common.counting.rd", Integer.toString(day));
        return new TranslatableMessage("common.counting.th", Integer.toString(day));
    }
View Full Code Here

    private TranslatableMessage month(boolean active) {
        int day = activeDay;
        if (!active)
            day = inactiveDay;
        return new TranslatableMessage(months[day]);
    }
View Full Code Here

            return squwkException;
        }
    }

    private TranslatableMessage toTranslatableMessage(SquwkException e) {
        return new TranslatableMessage("common.default", e.getMessage());
    }
View Full Code Here

                for (FileItem item : items) {
                    if ("uploadFile".equals(item.getFieldName())) {
                        try {
                            int count = importCsv(item);
                            model.put("result", new TranslatableMessage("dataImport.import.imported", count)
                                    .translate(translations));
                        }
                        catch (TranslatableException e) {
                            model.put("error", e.getTranslatableMessage().translate(translations));
                        }
                    }
                }
            }
            catch (Exception e) {
                model.put("error",
                        new TranslatableMessage("dataImport.upload.exception", e.getMessage()).translate(translations));
            }
        }

        return null;
    }
View Full Code Here

        DateTimeFormatter dtf = DateTimeFormat.forPattern("yyyy/MM/dd HH:mm:ss");

        // Basic validation
        String[] nextLine = csvReader.readNext();
        if (nextLine == null)
            throw new TranslatableException(new TranslatableMessage("dataImport.import.noData"));
        if (nextLine.length < 2)
            throw new TranslatableException(new TranslatableMessage("dataImport.import.noPoints"));

        // Find the points by XID
        DataPointVO[] vos = new DataPointVO[nextLine.length - 1];

        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;
        }

        // Find the RTs for the points if they are enabled
View Full Code Here

public class SquwkSenderVO extends PublisherVO<SquwkPointVO> {
    @Override
    protected void getEventTypesImpl(List<EventTypeVO> eventTypes) {
        eventTypes.add(new EventTypeVO(EventType.EventTypeNames.PUBLISHER, null, getId(),
                SquwkSenderRT.REQUEST_EXCEPTION_EVENT, new TranslatableMessage("event.pb.squwk.request"),
                AlarmLevels.URGENT));
        eventTypes.add(new EventTypeVO(EventType.EventTypeNames.PUBLISHER, null, getId(),
                SquwkSenderRT.SERVICE_EXCEPTION_EVENT, new TranslatableMessage("event.pb.squwk.service"),
                AlarmLevels.URGENT));
    }
View Full Code Here

        return EVENT_CODES;
    }

    @Override
    public TranslatableMessage getConfigDescription() {
        return new TranslatableMessage("common.noMessage");
    }
View Full Code Here

      List<ReportInstance> result;
      if(user.isAdmin())
        result = new ReportDao().getReportInstances();
      else
        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)
View Full Code Here

        ReportCommon.ensureReportInstancePermission(Common.getUser(request), instance);

        // Stream the content.
        response.setContentType("text/csv");

        Translations translations = Common.getTranslations();
        if (content == CONTENT_REPORT) {
            ExportCsvStreamer creator = new ExportCsvStreamer(response.getWriter(), translations);
            if(Common.databaseProxy.getNoSQLProxy() == null)
              reportDao.reportInstanceDataSQL(instanceId, creator);
            else
View Full Code Here

TOP

Related Classes of com.serotonin.m2m2.gviews.component.PointComponent

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.