return getPreferenceSet(currentUser);
}
public PreferenceSet getPreferenceSet(Principal principal)
{
PrefsPreferenceSetImpl preferenceSet = (PrefsPreferenceSetImpl) perPrincipalPrefs.get(principal);
try
{
if (preferenceSet == null || !dirty)
{
//TODO: need to be setting this from PortletEntityAccessComponent until then it will always be null.
String prefNodePath = MutablePortletEntity.PORTLET_ENTITY_ROOT + "/" + getId() +"/"+ principal.getName() +"/"
+ PrefsPreference.PORTLET_PREFERENCES_ROOT;
Preferences prefNode = Preferences.userRoot().node(prefNodePath);
// NO_PRINCIPAL is actually the defa
if(principal.getName().equals(ENTITY_DEFAULT_PRINCIPAL))
{
preferenceSet = new PrefsPreferenceSetImpl(prefNode);
}
else
{
preferenceSet = new PrefsPreferenceSetImpl(prefNode, (PreferenceSetComposite) getPreferenceSet(new PortletEntityUserPrincipal(ENTITY_DEFAULT_PRINCIPAL)) );
}
perPrincipalPrefs.put(principal, preferenceSet);
backupValues(preferenceSet);
dirty = true;
}