Search in sources :

Example 6 with BwAuthUserPrefs

use of org.bedework.calfacade.svc.prefs.BwAuthUserPrefs in project bw-calendar-engine by Bedework.

the class AuthUserFieldRule method getCalendarPrefs.

private CalendarPref getCalendarPrefs(final BwAuthUser au) {
    BwAuthUserPrefs aup = getPrefs(au);
    CalendarPref p = aup.getCalendarPrefs();
    if (p == null) {
        p = new CalendarPref();
        aup.setCalendarPrefs(p);
    }
    return p;
}
Also used : CalendarPref(org.bedework.calfacade.svc.prefs.CalendarPref) BwAuthUserPrefs(org.bedework.calfacade.svc.prefs.BwAuthUserPrefs)

Example 7 with BwAuthUserPrefs

use of org.bedework.calfacade.svc.prefs.BwAuthUserPrefs in project bw-calendar-engine by Bedework.

the class AuthUserRule method begin.

@Override
public void begin(final String ns, final String name, final Attributes att) throws Exception {
    super.begin(ns, name, att);
    BwAuthUser au = (BwAuthUser) top();
    BwAuthUserPrefs prefs = au.getPrefs();
    if (prefs == null) {
        prefs = new BwAuthUserPrefs();
        au.setPrefs(prefs);
    }
    if (prefs.getCalendarPrefs() == null) {
        prefs.setCalendarPrefs(new CalendarPref());
    }
    if (prefs.getContactPrefs() == null) {
        prefs.setContactPrefs(new ContactPref());
    }
    if (prefs.getLocationPrefs() == null) {
        prefs.setLocationPrefs(new LocationPref());
    }
    if (prefs.getCategoryPrefs() == null) {
        prefs.setCategoryPrefs(new CategoryPref());
    }
}
Also used : BwAuthUser(org.bedework.calfacade.svc.BwAuthUser) CategoryPref(org.bedework.calfacade.svc.prefs.CategoryPref) ContactPref(org.bedework.calfacade.svc.prefs.ContactPref) CalendarPref(org.bedework.calfacade.svc.prefs.CalendarPref) BwAuthUserPrefs(org.bedework.calfacade.svc.prefs.BwAuthUserPrefs) LocationPref(org.bedework.calfacade.svc.prefs.LocationPref)

Example 8 with BwAuthUserPrefs

use of org.bedework.calfacade.svc.prefs.BwAuthUserPrefs in project bw-calendar-engine by Bedework.

the class BwAuthUser method clone.

@Override
public Object clone() {
    final BwAuthUser au = new BwAuthUser();
    au.setUserHref(getUserHref());
    au.setUsertype(getUsertype());
    BwAuthUserPrefs aup = getPrefs();
    if (aup != null) {
        aup = (BwAuthUserPrefs) aup.clone();
        au.setPrefs(aup);
    }
    return au;
}
Also used : BwAuthUserPrefs(org.bedework.calfacade.svc.prefs.BwAuthUserPrefs)

Aggregations

BwAuthUserPrefs (org.bedework.calfacade.svc.prefs.BwAuthUserPrefs)8 BwAuthUser (org.bedework.calfacade.svc.BwAuthUser)2 CalendarPref (org.bedework.calfacade.svc.prefs.CalendarPref)2 CategoryPref (org.bedework.calfacade.svc.prefs.CategoryPref)2 ContactPref (org.bedework.calfacade.svc.prefs.ContactPref)2 LocationPref (org.bedework.calfacade.svc.prefs.LocationPref)2