portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vitaly Baranovsky (JIRA)" <jetspeed-...@portals.apache.org>
Subject [jira] Updated: (JS2-765) Developed solution to achieve strictly old way behaviour of portlet preferences in 2.1.2 version (like 2.0, preference per entity, not per user)
Date Mon, 03 Sep 2007 16:50:58 GMT

     [ https://issues.apache.org/jira/browse/JS2-765?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Vitaly Baranovsky updated JS2-765:
----------------------------------

    Attachment: JS2-765-1.diff

This is diff file of my changes, generated by linux diff command.
Also I have commented out backupValues call (because of https://issues.apache.org/jira/browse/JS2-777
(NullPointerException in PortletEntityImpl.backupValues() under high load)).

> Developed solution to achieve strictly old way behaviour of portlet preferences in 2.1.2
version (like 2.0, preference per entity, not per user)
> ------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: JS2-765
>                 URL: https://issues.apache.org/jira/browse/JS2-765
>             Project: Jetspeed 2
>          Issue Type: New Feature
>            Reporter: Vitaly Baranovsky
>         Attachments: jetspeed-registry-2.1.2-oldwayprefs.jar, JS2-765-1.diff, PortletEntityImpl.java
>
>
> Good day!
> There is a quote from the post:
> http://www.nabble.com/forum/ViewPost.jtp?post=9047332&framed=y:
> "
> Do you still want users to override these default prefs, or strictly   
> the "old way"? 
> If you want the old way, 
> what about if I changed the PortletEntityImpl.getPreferenceSet to use   
> a conditional configuration: 
> if (PREFS_PER_USER) 
>                  prefNodePath =   
> MutablePortletEntity.PORTLET_ENTITY_ROOT + "/" + getId() +"/"+   
> principal.getName() +"/" 
>                          + PrefsPreference.PORTLET_PREFERENCES_ROOT; 
> else 
>                  prefNodePath =   
> MutablePortletEntity.PORTLET_ENTITY_ROOT + "/" + getId() +"/"+   
> NO_PRINCIPAL +"/" 
>                          + PrefsPreference.PORTLET_PREFERENCES_ROOT; 
> "
> But there is one moment. If just make this changes into the code, call to method mergePreferencesSet
in method getPreferenceSet will take place anyway. This method makes big jetspeed performance
degradation in this situation. So, I've commented out call of this method.
> So, method PortletEntityImpl.getPreferenceSet has to be:
>     public PreferenceSet getPreferenceSet(Principal principal)
>     {
>         PrefsPreferenceSetImpl preferenceSet = (PrefsPreferenceSetImpl) perPrincipalPrefs.get(principal);
>         try
>         {
>             if (preferenceSet == null || !dirty)
>             {
>                 String principalName;
>                 
>                 if (pac.isMergeSharedPreferences())
>                 {
>                     principalName = NO_PRINCIPAL;
>                 }else{
>                     principalName = principal.getName();
>                 }
>                 String prefNodePath = MutablePortletEntity.PORTLET_ENTITY_ROOT + "/"
+ getId() +"/"+ principalName +"/"
>                         + PrefsPreference.PORTLET_PREFERENCES_ROOT;
>                 Preferences prefNode = Preferences.userRoot().node(prefNodePath);   
           
>                 preferenceSet = new PrefsPreferenceSetImpl(prefNode);
>                 perPrincipalPrefs.put(principal, preferenceSet);
>                 /*
>                 if (pac.isMergeSharedPreferences())
>                 {
>                     mergePreferencesSet(preferenceSet);
>                 }*/
>                 backupValues(preferenceSet);
>                 dirty = true;
>             }
>         }
>         catch (BackingStoreException e)
>         {
>             String msg = "Preference backing store failed: " + e.toString();
>             IllegalStateException ise = new IllegalStateException(msg);
>             ise.initCause(e);
>             throw ise;
>         }
>         return preferenceSet;
>     }
> This solution can turn back jetspeed to strictly old way behaviour of portlet preferences
in jetspeed 2.1.2. 
> So, preferences will be per entity, not per user, if setting up parameter to true in
the registry.xml spring assembly for the portletEntityAccessImpl component: 
>      <!-- 
>              All preferences were shared. With JS2-449, preferences   
> are now 
>              stored 'per user'. The username is stored in the   
> preferences FULL_PATH 
>              To turn on mergeSharedPreferences configure this   
> property to true 
>              This will NOT turn off per user prefs, 
>               but instead merge with them, where user prefs override. 
>              boolean 
>            --> 
>          <constructor-arg type="boolean"> 
>              <value>false</value> 
>          </constructor-arg> 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message