Examples of WatchListDao


Examples of com.serotonin.m2m2.watchlist.WatchListDao

    public static final String KEY_WATCHLIST_DATA = "watchListData";

    @Override
    public View handleRequest(HttpServletRequest request, HttpServletResponse response, Map<String, Object> model) {
        User user = Common.getUser(request);
        WatchListDao watchListDao = new WatchListDao();

        // Check for a watchlist id parameter. If given, update the user.
        try {
            int watchListId = Integer.parseInt(request.getParameter("watchListId"));

            WatchList watchList = watchListDao.getWatchList(watchListId);
            WatchListCommon.ensureWatchListPermission(user, watchList);
            watchListDao.saveSelectedWatchList(user.getId(), watchList.getId());
        }
        catch (NumberFormatException e) {
            // no op
        }

        prepareModel(request, model, user);

        // Get the selected watchlist.
        int watchListId = (Integer) model.get(KEY_SELECTED_WATCHLIST);

        // Get the point data.
        List<MobileWatchListState> states = new ArrayList<MobileWatchListState>();
        for (DataPointVO pointVO : watchListDao.getWatchList(watchListId).getPointList()) {
            MobileWatchListState state = createState(request, pointVO);
            states.add(state);
        }

        model.put(KEY_WATCHLIST_DATA, states);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.