use of org.bedework.calfacade.BwEventProperty in project bw-calendar-engine by Bedework.
the class AuthUserFieldRule method field.
/* (non-Javadoc)
* @see org.bedework.dumprestore.restore.rules.EntityFieldRule#field(java.lang.String)
*/
@Override
public void field(final String name) throws Throwable {
BwEventProperty ep = null;
BwCalendar cal = null;
try {
if (top() instanceof BwEventProperty) {
ep = (BwEventProperty) pop();
} else if (top() instanceof BwCalendar) {
cal = (BwCalendar) pop();
}
BwAuthUser au = (BwAuthUser) top();
if (name.equals("id") || name.equals("seq")) {
return;
}
if (name.equals("userHref")) {
au.setUserHref(Util.buildPath(false, stringFld()));
// } else if (name.equals("account")) { old?
// au.setUserHref(globals.rintf.getUser(stringFld()).getPrincipalRef());
// } else if (name.equals("user")) {
// // done above
} else if (name.equals("usertype")) {
int type = intFld();
au.setUsertype(type);
/* Prefs stuff next */
} else if (name.equals("autoAdd")) {
if (inCategoryPrefs) {
getCategoryPrefs(au).setAutoAdd(booleanFld());
} else if (inCollectionsPrefs) {
getCalendarPrefs(au).setAutoAdd(booleanFld());
} else if (inContactPrefs) {
getContactPrefs(au).setAutoAdd(booleanFld());
} else if (inLocationPrefs) {
getLocationPrefs(au).setAutoAdd(booleanFld());
} else {
error("Not in any prefs for autoAdd");
}
} else if (name.equals("category")) {
au.getPrefs().getCategoryPrefs().add((BwCategory) ep);
} else if (name.equals("collection")) {
au.getPrefs().getCalendarPrefs().add(cal);
} else if (name.equals("contact")) {
au.getPrefs().getContactPrefs().add((BwContact) ep);
} else if (name.equals("location")) {
au.getPrefs().getLocationPrefs().add((BwLocation) ep);
} else if (name.equals("categoryPrefs")) {
inCategoryPrefs = false;
} else if (name.equals("calendarPrefs")) {
inCollectionsPrefs = false;
} else if (name.equals("contactPrefs")) {
inContactPrefs = false;
} else if (name.equals("locationPrefs")) {
inLocationPrefs = false;
} else if (name.equals("prefs")) {
} else if (name.equals("byteSize")) {
} else {
unknownTag(name);
}
} catch (Throwable t) {
handleException(t);
}
}
Aggregations