Update Public and Private User Pages

Tested on Liferay 6.0.5, Tomcat 6, Windows XP

Introduction #

Liferay promotes the concept of dynamic upgrades. But by default, User Pages are standalone personal copies. They are owned by the User, leaving the Administrator Role with few options to apply updates to the User Pages after they have been created. This techniques allows the Administrator to deploy Personalized Public and Private User Pages, and subsequently deploy upgrades to the User Pages for most of the elements.

NOTE: This technique works for new User Pages. It does not apply to User Pages which have already been created; it needs to be structured before the original User Pages are created.

Private Pages#

The greatest degree of flexibility in making updates to Private User Pages after they have been created is through the Community Private Pages.

This approach allows updates to the Private User Pages:

  • Layout
  • Theme
  • Portlets
  • Page Names, Order, and Number of Pages

Dockbar: Manage / Control Panel / Portal / Communities

Create a default Community for the entire site.

Within the new Community: Actions / Manage Pages / Private Pages

Create the desired Private Pages.

Dockbar: Manage / Control Panel / Portal / Settings / Users / Default User Associations

Add the new Community name in the Communities field and click the Save button. Ensure that the Apply to Existing Users checkbox is enabled.

Now all of the Users should have a set of Community Private Pages. These Pages can be updated at any time, and the changes will automatically show up on the Users Community Private Pages.

Alternatively, the technique described below for Public Pages can also be used for Private Pages for consistency, though it doesn't have the same level of access for updates.

Public Pages#

Public Community Pages are shared between Users, so the technique described in the Private Pages above would be unsuitable for the goal of Personalized Public User Pages.

The following technique for Personalized Public Pages allows for updates to:

  • Layout
  • Theme
  • Portlets
  1. Create a test user
  2. As the test user, Dockbar: Go To: My Public Pages
  3. Create the appropriate User Public Pages within My Public Pages
  4. Within in the ext environment, create a new Theme and deploy it
  5. Apply the new Theme to each of the User Public Pages within My Public Pages
  6. Within the ext environment, create 1 separate Layout per each User Public Page within My Public Pages
  7. Apply each respective Layout to each of the User Public Pages with My Public Pages
  8. In each Layout file (.tpl), add the appropriate column layouts (e.g. '<div class="portlet-column portlet-column-only aui-w50"></div>'), and add the necessary portlets (e.g. '$theme.runtime("XX")'). To find the portlet-name to use, look in the appropriate liferay-portlet.xml file
  9. Top Menu: Manage / Page / Export/Import / Export -> Select all of the applicable items except "Data" and save as a .lar file in the /deploy directory with a name like "UserPublicPage.lar"
  10. In portal-ext.properties add the following entry:

layout.user.public.layouts.enabled=true layout.user.public.layouts.auto.create=true default.user.public.layouts.lar=[PATH_TO_DEPLOY_DIRECTORY]
deploy
UserPublicPage.lar Note: The directory path above is for Windows and Liferay 6.0.5. The double-backslashes are appropriate for Windows, but different Liferay versions expect either an absolute path or a relative path including the variable "${resource.repositories.root}" or "${liferay.home}". Double-check the syntax for the above variables and your Liferay version using the appropriate Portal Properties reference Page

Now all newly created Users should have their Personalized Public User Page created for them, following the formatting of the .lar template above. It is important to note that these pages are copies of the .lar template pages, not references to it.

If changes need to be subsequently made to these Personalized Public User Pages, they can be made in the ext environment by re-deploying the: - Custom Theme for these pages - Custom Layouts for each of these pages - Portlets for each of these pages

But, this technique does not allow updates to the Page Names, Number of Pages, or Page Order, so these should be setup in advance for any expected future content, even as placeholders.

Conflict with User Group Pages#

User Groups can also add Public and Private pages for Users. This can present a conflict with the technique covered above (they supersede the .lar import step). If User Groups are not needed, they should not be associated with Users.

0 Attachments
29441 Views
Average (0 Votes)
The average rating is 0.0 stars out of 5.
Comments
Threaded Replies Author Date
I'm not sure I understand the purpose of this... Nicolas Forney July 12, 2011 12:25 AM

I'm not sure I understand the purpose of this wiki. Does it resolve the following problem :
http://www.liferay.com/community/forums/-/message_boards/view_message/4114435/ ?
Posted on 7/12/11 12:25 AM.