Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Read Preference of portlet placed on another page.
- *Example -1 : If Preferences of portlet is unique per layout
- */
- PortletPreferences pageCommentsPref = null;
- String portletId = PortletKeys.PAGE_COMMENTS;
- String defaultPreferences = null;
- long plid = GetterUtil.getLong(serviceContext.getPlid());//Plid of page where portlet is placed
- try {
- /*
- * Preferences are unique per layout . Preferences won't be shared between pages
- */
- pageCommentsPref = portletPreferencesLocalService.getPreferences(companyId, 0,
- PortletKeys.PREFS_OWNER_TYPE_LAYOUT, plid, portletId, defaultPreferences);
- } catch (SystemException e) {
- _log.error(e.getMessage());
- }
- /*
- * Read Preference of portlet placed on another page.
- * Example -2 : If Preference of portlet is unique per layout
- */
- PortletPreferences blogPreferences = null;
- long ownerId = groupId;
- String defaultPreferences = null;
- /*
- *Preferences are unique per group. If multiple blog portlet places in group at multiple pages
- then preferences will be shated between them.
- */
- String portletId = PortletKeys.BLOGS;
- long plid=PortletKeys.PREFS_PLID_SHARED //Plid 0 because preferences are unique per group
- try {
- blogPreferences = portletPreferencesLocalService.getPreferences(companyId, ownerId,
- PortletKeys.PREFS_OWNER_TYPE_GROUP, plid, portletId, defaultPreferences);
- } catch (SystemException e) {
- _log.error(e.getMessage());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement