* @see org.apache.pluto.om.entity.PortletEntity#getPreferenceSet()
* @return
*/
public PreferenceSet getPreferenceSet()
{
PrefsPreferenceSetImpl preferenceSet = (PrefsPreferenceSetImpl) preferenceSetRef.get();
try
{
if (preferenceSet == null || !dirty)
{
Principal currentUser = getPrincipal();
//TODO: need to be setting this from PortletEntityAccessComponent until then it will always be null.
if (currentUser == null)
{
currentUser = new PortletEntityUserPrincipal(NO_PRINCIPAL);
}
String prefNodePath = MutablePortletEntity.PORTLET_ENTITY_ROOT + "/" + getId() +"/"+ currentUser.getName() +"/"
+ PrefsPreference.PORTLET_PREFERENCES_ROOT;
Preferences prefNode = Preferences.userRoot().node(prefNodePath);
preferenceSet = new PrefsPreferenceSetImpl(prefNode);
preferenceSetRef.set(preferenceSet);
backupValues(preferenceSet);
dirty = true;
}
}