@Transient public String getUserPrefEntryAsString(final String parameter) { final UserPrefEntryDO entry = getUserPrefEntry(parameter); if (entry == null) { return null; } return entry.getValue(); }
/** * @see org.projectforge.web.fibu.ISelectCallerPage#unselect(java.lang.String) */ public void unselect(final String property) { final UserPrefEntryDO param = getData().getUserPrefEntry(property); if (param == null) { log.error("Property '" + property + "' not supported for un-selection."); } else { setValue(param, null); } }
/** * @see org.projectforge.web.fibu.ISelectCallerPage#select(java.lang.String, java.lang.Integer) */ public void select(final String property, final Object selectedValue) { final UserPrefEntryDO param = getData().getUserPrefEntry(property); if (param == null) { log.error("Property '" + property + "' not supported for selection."); } else { setValue(param, selectedValue); } }
public UserPrefEntryDO ensureAndGetAccessEntry(final String parameter) { if (this.prefEntries == null) { setUserPrefEntries(new TreeSet<UserPrefEntryDO>()); } UserPrefEntryDO entry = getUserPrefEntry(parameter); if (entry == null) { entry = new UserPrefEntryDO(); entry.setParameter(parameter); this.addUserPrefEntry(entry); } return entry; }
/** * Copies all values from the given src object excluding the values created and modified. Null values will be * excluded. * * @param src */ @Override public ModificationStatus copyValuesFrom(final BaseDO<? extends Serializable> source, final String... ignoreFields) { ModificationStatus modificationStatus = super.copyValuesFrom(source, ignoreFields); final UserPrefDO src = (UserPrefDO) source; if (src.getUserPrefEntries() != null) { for (final UserPrefEntryDO srcEntry : src.getUserPrefEntries()) { final UserPrefEntryDO destEntry = ensureAndGetAccessEntry(srcEntry.getParameter()); final ModificationStatus st = destEntry.copyValuesFrom(srcEntry); modificationStatus = getModificationStatus(modificationStatus, st); } final Iterator<UserPrefEntryDO> iterator = getUserPrefEntries().iterator(); while (iterator.hasNext()) { final UserPrefEntryDO destEntry = iterator.next(); if (src.getUserPrefEntry(destEntry.getParameter()) == null) { iterator.remove(); } } } return modificationStatus; }
assertEquals("Micromata", timesheet.getLocation()); assertEquals("Wrote a test case...", timesheet.getDescription()); userPref.getUserPrefEntry("location").setValue("At home"); userPrefDao.update(userPref); String[] names = userPrefDao.getPrefNames(UserPrefArea.TIMESHEET_TEMPLATE); assertEquals("test", names[0]); List<UserPrefEntryDO> dependents = userPref .getDependentUserPrefEntries(userPref.getUserPrefEntry("user").getParameter()); assertNull(dependents); dependents = userPref.getDependentUserPrefEntries(userPref.getUserPrefEntry("task").getParameter()); assertEquals(1, dependents.size()); assertEquals("kost2", dependents.get(0).getParameter());
groupSelectPanel.init(); } else if (Kost2DO.class.isAssignableFrom(param.getType()) == true) { final UserPrefEntryDO taskParam = data.getUserPrefEntry(param.getDependsOn()); Integer taskId = null; if (taskParam == null) {