@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));
}
ph.parseEmptyFolders();
WatchList watchList = new WatchListDao().getSelectedWatchList(user.getId());
prepareWatchList(watchList, user);
setWatchList(user, watchList);
data.put("pointFolder", ph.getRoot());
data.put("shareUsers", getShareUsers(user));
data.put("selectedWatchList", getWatchListData(user, watchList));
return data;
}