/** * Gets a list of all calendars with full access of the current logged-in user as well as the calendars owned by the * current logged-in user. * * @return */ public List<TeamCalDO> getAllCalendarsWithFullAccess() { final TeamCalFilter filter = new TeamCalFilter(); filter.setOwnerType(OwnerType.ALL); filter.setFullAccess(true).setReadonlyAccess(false).setMinimalAccess(false); return getList(filter); }
/** * @see org.projectforge.web.wicket.AbstractListForm#newSearchFilterInstance() */ @Override protected TeamCalFilter newSearchFilterInstance() { return new TeamCalFilter(); }
public Collection<TeamCalDO> getCalendars(final Collection<Integer> calIds) { final Set<TeamCalDO> set = new TreeSet<TeamCalDO>(new TeamCalsComparator()); if (calIds != null) { for (final Integer calId : calIds) { final TeamCalDO cal = getCalendar(calId); if (cal == null) { log.warn("Calendar with id " + calId + " not found in cache."); continue; } if (teamCalRight.hasSelectAccess(ThreadLocalUserContext.getUser()) == true) { set.add(cal); } } } return set; }
/** * Get ordered calendars (by title and id). * * @return All accessible calendars of the context user (as owner or with full, read-only or minimal access). */ public Collection<TeamCalDO> getAllAccessibleCalendars() { checkRefresh(); final Set<TeamCalDO> set = new TreeSet<TeamCalDO>(new TeamCalsComparator()); final PFUserDO loggedInUser = ThreadLocalUserContext.getUser(); for (final TeamCalDO cal : calendarMap.values()) { if (teamCalRight.hasSelectAccess(loggedInUser, cal) == true && cal.isDeleted() == false) { set.add(cal); } } return set; }
/** * Get ordered calendars (by title and id). * * @return All accessible calendars of the context user (as owner or with full, read-only or minimal access). */ public Collection<TeamCalDO> getAllOwnCalendars() { checkRefresh(); final Set<TeamCalDO> set = new TreeSet<TeamCalDO>(new TeamCalsComparator()); final Integer loggedInUserId = ThreadLocalUserContext.getUserId(); for (final TeamCalDO cal : calendarMap.values()) { if (teamCalRight.isOwner(loggedInUserId, cal) == true) { set.add(cal); } } return set; }
@Override public TeamCalDO getVacationCalendar() { return teamCalCache.getCalendar((Integer) configDao.getValue(ConfigurationParam.VACATION_CAL_ID)); }
private DataobjectAccessType getAccessType(final Integer calendarId, final Integer userId) { final TeamCalDO cal = teamCalCache.getCalendar(calendarId); return getTeamCalRight().getAccessType(cal, userId); }
@Override protected void afterSave(final TeamCalDO obj) { super.afterSave(obj); if (obj.isExternalSubscription() == true) { getTeamEventExternalSubscriptionCache().updateCache(obj); } }
private Collection<TeamCalDO> getCalendarList() { Collection<TeamCalDO> result = null; if (onlyFullAccessCalendar) { result = teamCalCache.getAllFullAccessCalendars(); } else { result = teamCalCache.getAllAccessibleCalendars(); } if (this.additionalCalendarList != null && this.additionalCalendarList.size() > 0) { result.addAll(this.additionalCalendarList); } return result; }
@Override public final void onSubmit() { final Collection<TeamCalDO> assignedItems = teamCalCache.getAllAccessibleCalendars(); calendarsListHelper.setAssignedItems(assignedItems); } }, getString("selectAll"), SingleButtonPanel.NORMAL));
@Override public final void onSubmit() { final Collection<TeamCalDO> assignedItems = teamCalCache.getAllOwnCalendars(); calendarsListHelper.setAssignedItems(assignedItems); } }, getString("plugins.teamcal.own"), SingleButtonPanel.NORMAL));
/** * @see org.apache.wicket.Component#isVisible() */ @Override public boolean isVisible() { return getSearchFilter().isDeleted() == false; } };
public TeamCalImportPage(final PageParameters parameters) { super(parameters); form = new TeamCalImportForm(this); body.add(form); final Integer calId = WicketUtils.getAsInteger(parameters, PARAM_KEY_TEAM_CAL_ID); if (calId != null) { form.calendar = teamCalDao.getById(calId); } form.init(); }
public TeamCalDO getCalendar(final Integer calendarId) { checkRefresh(); return calendarMap.get(calendarId); }
/** * Calls {@link TeamCalCache#setExpired()}. * * @see org.projectforge.framework.persistence.api.BaseDao#afterSaveOrModify(org.projectforge.core.ExtendedBaseDO) */ @Override protected void afterSaveOrModify(final TeamCalDO obj) { super.afterSaveOrModify(obj); teamCalCache.setExpired(); }
/** * @param teamEvent * @param teamCalendarId If null, then team calendar will be set to null; * @see BaseDao#getOrLoad(Integer) */ public void setCalendar(final TeamEventDO teamEvent, final Integer teamCalendarId) { final TeamCalDO teamCal = teamCalDao.getOrLoad(teamCalendarId); teamEvent.setCalendar(teamCal); }
public static List<TeamCalDO> getCalList(TeamCalCache teamCalCache, final Collection<Integer> teamCalIds) { final List<TeamCalDO> list = new ArrayList<>(); if (teamCalIds != null) { for (final Integer calId : teamCalIds) { final TeamCalDO cal = teamCalCache.getCalendar(calId); if (cal != null) { list.add(cal); } else { log.warn("Calendar with id " + calId + " not found in cache."); } } } return list; }
public void setCalendar(final Integer calendarId) { if (calendarId != null) { setCalendar(teamCalCache.getCalendar(calendarId)); } else { setCalendar((TeamCalDO) null); } }