-
1. Re: Universal per portlet instance configuration for all use
theute Jul 1, 2008 9:30 AM (in response to michaelchan)Portlet preferences at the instance level are shared by anyone, there is no scoping per role.
There are 3 scopes:
- portlet
- portlet instance
- user -
2. Re: Universal per portlet instance configuration for all use
michaelchan Jul 1, 2008 11:08 AM (in response to michaelchan)How do I specify which preference to which scope? I just want to do portlet instance scope. I know for sure that different portlet instances of the same portlet definition can have different preferences. But those preferences varies for different users......thanks and please help
-
3. Re: Universal per portlet instance configuration for all use
theute Jul 1, 2008 11:28 AM (in response to michaelchan)The doc is made to help you
http://docs.jboss.com/jbportal/v2.6.5/referenceGuide/html/xmldescriptors.html#desc_instancesxml
You can also use the admin portlet. -
4. Re: Universal per portlet instance configuration for all use
michaelchan Jul 1, 2008 3:20 PM (in response to michaelchan)I have already tried to do that, but nothing really work the way i wanted.
e.g. in the news portlet, i have set it to read rss feed from yahoo, in admin mode. But when i logout, the news portlet return to default. So i edit security settings..... but nothing helps.... -
5. Re: Universal per portlet instance configuration for all use
theute Jul 1, 2008 3:44 PM (in response to michaelchan)If you go to the instances tab of the admin portlet change the preference, all users will see that new preference unless they overrided the value by a personal (user scope) preference.
-
6. Re: Universal per portlet instance configuration for all use
michaelchan Jul 1, 2008 4:42 PM (in response to michaelchan)Good, i finally get it now, I used edit mode before, and I think that's why. I did not use the instances tab. Thanks very much!!!!!
-
7. Re: Universal per portlet instance configuration for all use
michaelchan Jul 4, 2008 11:38 AM (in response to michaelchan)What if i need some logic to translate information from database into human readable form??
say if I want a portlet to display some user in a usergroup, I cannot ask the admin to input the groupID directly, a drop down box should be there to provide such selection. With edit and admin mode, the preference are not stored on a per / portlet instance basis. It only happens if i use the instance configuration in the admin portlet..... can anyone help?? -
8. Re: Universal per portlet instance configuration for all use
mrostan Dec 16, 2008 3:21 PM (in response to michaelchan)Hi, somebody knows a way to solve this ?
I mean, how can I customize the editor to set the preferences for all the users?
Thanks in advance
Martin -
9. Re: Universal per portlet instance configuration for all use
mrostan Dec 19, 2008 12:44 PM (in response to michaelchan)Hi,
we have implemented a new CustomizationManager (by extending the default CustomizationManagerService), we have defined "scopes" associated to the instances, if the scope is 'window' the customization is associated to the window (and not the user), so you can edit the preferences (with the customized portlet editor) for a window, and everybody that access that window will see the portlet customized with the same preferences.
We need this feature to allow portal managers to define portlets (and portals) that will be accessed by anonymous users.
Here is our code:public class ScopeCustomizationManager extends CustomizationManagerService { @Override public Instance getInstance(Window window, User user) throws IllegalArgumentException { if (window == null) { throw new IllegalArgumentException("No window provided"); } Content content = window.getContent(); String instanceId = ((PortletContent) content).getInstanceRef(); if (instanceId == null) { return null; } Instance instance = getInstanceContainer().getDefinition(instanceId); if (instance != null) { String scope = null; try { Object scopePropertyValue = instance.getProperties().get("sharingScope"); if (scopePropertyValue != null && (scopePropertyValue instanceof List)) { List valuesList = (List) scopePropertyValue; if (valuesList.size() > 0) { Object v = valuesList.get(0); if (v instanceof String) { scope = (String) v; } } } } catch (PortletInvokerException e) { e.printStackTrace(); } if (scope == null || scope.equals("user")) { return super.getInstance(window, user); } if (user != null && isDashboard(window, user)) { String dashboardId = window.getId().toString(); instance = instance.getCustomization(dashboardId); } else if (scope.equals("window")) { instance = instance.getCustomization(window.getId().toString()); } else if (scope.equals("portal")) { instance = instance.getCustomization(window.getPage().getPortal().getId().toString()); } else { instance = super.getInstance(window, user); } } return instance; } }
Maybe somebody on the JBoss Portal Team may give us an opinion about this feature, and our implementation, we think it's a very important feature for an enterprise portal.
Thanks in advance,
Martin