Extracting different types of Portlet Preferences
1.
Personal or User
Level (Edit Mode) preferences : Preferences set in the edit mode is called
user level preferences. These preferences are scope to only that particular instance of portlet (If
same page has more than one instance of this portlet, each instance will their
own copy) . You can view all user level preferences in
page XMLAccess export.
<portletinstance
action="update" domain="rel"
objectid="Z5_SIB0OKE1GON2E0IT6I9LS520O5"
portletref="Z3_SIB0OKE1GON2E0IT6I9LS52084"/>
<portletinstance
action="update" domain="cust" objectid="Z5_SIB0OKE1GON2E0IT6I9LS520O3"
owner="uid=wpsadmin,o=defaultWIMFileBasedRealm"
parentref="Z5_SIB0OKE1GON2E0IT6I9LS520O5"
portletref="Z3_SIB0OKE1GON2E0IT6I9LS52084">
<preferences
name=".SivaPortletEditKey" update="set">
<value><![CDATA[TestEditPreference]]></value>
</preferences>
</portletinstance>
NOTE: domain=”cust” indicates that these preferences
will go to the customization schema
(that is where all user customizations stored). Actucal portlet instance
related will go the release schema (that is all portal resources gets stored).
2.
Shared (Edit
Defaults Mode) Preferences : Preferences set in the “Edit Defaults”
mode is applicable only for this instances of the portlet for all users. You
can get these preferences also from the page XMLAccess export.
<portletinstance action="update" domain="rel" objectid="Z5_AAAAA"
portletref="Z3_SIB0OKE1GON2E0IT6I9LS52084">
<preferences
name=".SivaPortletEditDefaultsKey" update="set">
<value><![CDATA[TestSharedPreference]]></value>
</preferences>
</portletinstance>
Note: Above sample XML snippet contains
shared preference that gets stored in the release schema. These preferences are
not associated with any owner as user level preferences.
There are scenarios where you may see same
preference key in the user level and
also at the edit shared preferences (Ex: like No.of results to display
portlet…etc . Requirements like Editors should able set default value for this instance
(for all users) and let end users to configured their preferred number). Sample page XMLAcess export will look like below.
<portletinstance
action="update" domain="rel" objectid="Z5_SIB0OKE1GON2E0IT6I9LS520O5"
portletref="Z3_SIB0OKE1GON2E0IT6I9LS52084">
<preferences
name="Common-Pref-Key"
update="set">
<value><![CDATA[TestSharedPreference]]></value>
</preferences>
</portletinstance>
<portletinstance
action="update" domain="cust"
objectid="Z5_SIB0OKE1GON2E0IT6I9LS520O3" owner="uid=wpsadmin,o=defaultWIMFileBasedRealm"
parentref="Z5_SIB0OKE1GON2E0IT6I9LS520O5"
portletref="Z3_SIB0OKE1GON2E0IT6I9LS52084">
<preferences name="Common-Pref-Key"
update="set">
<value><![CDATA[TestEditPreference]]></value>
</preferences>
</portletinstance>
3.
Global or Admin (Config
Mode) Preferences : Preferences set
in the “Config” mode is applicable to all instances of this portlet on all
pages for all users . As these preferences are not specific to any page, we can’t retrieve them using page XMLAccess
export. You can retrieve these
preferences from the portlet XMLAccess export.
<portlet
action="update" active="true" defaultlocale="en"
domain="rel" name="SivaPortlet"
objectid="Z3_SIB0OKE1GON2E0IT6I9LS52084" provided="false"
servletref="ZV_SIB0OKE1GON2E0IT6I9LS52080">
<preferences
name=".SivaPortletConfigKey" update="set">
<value><![CDATA[TestConfigPreference]]></value>
</preferences>
<access-control
externalized="false" owner="uid=wpsadmin,o=defaultwimfilebasedrealm"
private="false"/>
</portlet>
Another
way of inspecting these admin level preferences is using the portal admin console --> portlets
-->configure
Resources