Package com.serotonin.m2m2.view

Examples of com.serotonin.m2m2.view.ImplDefinition


    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

    public View handleRequest(HttpServletRequest request, HttpServletResponse response, final Map<String, Object> model)
            throws Exception {
        Permissions.ensureAdmin(request);

        if (ServletFileUpload.isMultipartContent(request)) {
            Translations translations = ControllerUtils.getTranslations(request);

            ServletFileUpload upload = new ServletFileUpload(new DiskFileItemFactory(100, null));
            List<FileItem> items;
            try {
                items = upload.parseRequest(request);
View Full Code Here

    public int getId() {
        return id;
    }

    public JspComponentState createState(RuntimeManager rtm, HttpServletRequest request) {
        JspComponentState state = new JspComponentState();
        state.setId(id);
        createStateImpl(rtm, request, state);
        return state;
    }
View Full Code Here

TOP

Related Classes of com.serotonin.m2m2.view.ImplDefinition

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.