Package com.serotonin.m2m2.db.dao

Examples of com.serotonin.m2m2.db.dao.DataPointDao


        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) {
            DataPointVO dp = dataPointDao.getDataPoint(id);
            if (dp == null || !Permissions.hasDataPointReadPermission(user, dp))
                continue;

            ReportPointVO rp = new ReportPointVO();
            rp.setPointId(dp.getId());
View Full Code Here


        else
            out.writeInt(dataPoint.getId());
    }

    protected DataPointVO readDataPoint(ObjectInputStream in) throws IOException {
        return new DataPointDao().getDataPoint(in.readInt());
    }
View Full Code Here

    }

    protected void jsonReadDataPoint(JsonValue jsonXid, PointComponent comp) throws JsonException {
        if (jsonXid != null) {
            String xid = jsonXid.toString();
            DataPointVO dataPoint = new DataPointDao().getDataPoint(xid);
            if (dataPoint == null)
                throw new TranslatableJsonException("emport.error.missingPoint", xid);
            if (!comp.definition().supports(dataPoint.getPointLocator().getDataTypeId()))
                throw new TranslatableJsonException("emport.error.component.incompatibleDataType", xid, definition()
                        .getExportName());
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

import com.serotonin.m2m2.web.taglib.Functions;

public class WatchListDwr extends ModuleDwr {
    @DwrPermission(user = true)
    public Map<String, Object> init() {
        DataPointDao dataPointDao = new DataPointDao();
        Map<String, Object> data = new HashMap<String, Object>();

        PointHierarchy ph = dataPointDao.getPointHierarchy(true).copyFoldersOnly();
        User user = Common.getUser();
        List<DataPointVO> points = dataPointDao.getDataPoints(DataPointExtendedNameComparator.instance, false);
        for (DataPointVO point : points) {
            if (Permissions.hasDataPointReadPermission(user, point))
                ph.addDataPoint(point.getPointFolderId(), new DataPointSummary(point));
        }
View Full Code Here

    @DwrPermission(user = true)
    public WatchListState addToWatchList(int pointId) {
        HttpServletRequest request = WebContextFactory.get().getHttpServletRequest();
        User user = Common.getUser();
        DataPointVO point = new DataPointDao().getDataPoint(pointId);
        if (point == null)
            return null;
        WatchList watchList = getWatchList(user);

        // Check permissions.
View Full Code Here

        for (ImplDefinition impl : ViewComponent.getImplementations())
            components.add(new StringStringPair(impl.getName(), translate(impl.getNameKey())));
        result.put("componentTypes", components);

        // Available points
        List<DataPointVO> allPoints = new DataPointDao().getDataPoints(DataPointExtendedNameComparator.instance, false);
        List<DataPointBean> availablePoints = new ArrayList<DataPointBean>();
        for (DataPointVO dataPoint : allPoints) {
            if (Permissions.hasDataPointReadPermission(user, dataPoint))
                availablePoints.add(new DataPointBean(dataPoint));
        }
View Full Code Here

            boolean settable, String bkgdColorOverride, boolean displayControls, int x, int y) {
        ProcessResult response = new ProcessResult();
        PointComponent pc = (PointComponent) getViewComponent(pointComponentId);
        User user = Common.getUser();

        DataPointVO dp = new DataPointDao().getDataPoint(dataPointId);
        if (dp == null || !Permissions.hasDataPointReadPermission(user, dp))
            response.addContextualMessage("settingsPointInfo", "validate.required");

        if (x < 0)
            response.addContextualMessage("settingsX", "validate.cannotBeNegative");
View Full Code Here

            }
            catch (NumberFormatException e) {
                // no op
            }

            DataPointVO dp = new DataPointDao().getDataPoint(dataPointId);

            if (dp == null || !Permissions.hasDataPointReadPermission(user, dp))
                c.setDataPoint(kvp.getKey(), null);
            else
                c.setDataPoint(kvp.getKey(), dp);
View Full Code Here

        // Get the points for each of the watch lists.
        List<Integer> pointIds = queryForList(
                "select dataPointId from watchListPoints where watchListId=? order by sortOrder",
                new Object[] { watchList.getId() }, Integer.class);
        List<DataPointVO> points = watchList.getPointList();
        DataPointDao dataPointDao = new DataPointDao();
        for (Integer pointId : pointIds)
            points.add(dataPointDao.getDataPoint(pointId));

        setWatchListUsers(watchList);
    }
View Full Code Here

TOP

Related Classes of com.serotonin.m2m2.db.dao.DataPointDao

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.