2013
22
March

Enterprise Liferay Concerns: Tips For Being Less Social

As a platform for portals, Liferay is inherently open to social activity. By default users have the ability to comment on pages, post on forums, have public profiles and connect to social networks. This blog will explore tips for ‘locking down’ Liferay for more limited social activity, which may be an important consideration for building business sites on Liferay.

Consider using Liferay to build a customer self-service site for commercial use, such as for a utility, city water department, cable company, etc. In this context, users should be able to maintain their accounts, see usage, make payments, etc. in a private manner. They have no reason to be aware of each other, nor need to interact with each other. Privacy of each user’s information is paramount in such applications.

Liferay User Isolation Tips

  • Disable profiles, meaning users can be created without profiles. By default users have profiles created. To change this, create a User Group, and in ControlPanel->User Groups->(Groupname) set ‘Public Pages’ to ‘None’ and ‘Private Pages’ to ‘None’. Thus, any users created in Liferay who are added to this user group have no profiles.
  • Restrict comment posting on pages with comments or message boards to registered users. In Control Panel->Message Boards->Permissions, uncheck any ‘Guest’ settings except ‘View’.
  • Hide user pictures and profile links from message board posts. By default, a picture placeholder and link to the user profile is created when a user posts a comment. This can be suppressed with a hook. Override the file (ROOT)/html/taglib/ui/discussion/page.jsp and change:
    	<liferay-ui:user-display
               userId="<%= message.getUserId() %>"
               userName="<%= HtmlUtil.escape(message.getUserName()) %>"
               displayStyle="<%= 2 %>"
            />
    

    to:

      <liferay-ui:user-display
               userId="<%= user.getUserId() %>"
               userName="<%= HtmlUtil.escape(PortalUtil.getUserName(user.getUserId(), StringPool.BLANK)) %>"
               displayStyle="<%= 2 %>
       />
    
  • Disable access to hidden profiles in Message board/comments — by default, clicking on a user name in a message board comment brings up the user’s profile. This can be disabled with portal-ext.properties settings. Add these settings to portal-ext.properties:
    layout.user.private.layouts.enabled=false
    layout.user.public.layouts.enabled=false
    
  • Limit access to user names in search results–by default, user names in the Liferay database are searchable. This can be disabled with a hook. To remove the user from the search criteria, override the file (ROOT)/html/portlet/search/init.jsp and change:
    sb.append("{className: 'com.liferay.portal.kernel.search.facet.AssetEntriesFacet', data: {frequencyThreshold: 1, values: ['com.liferay.portlet.bookmarks.model.BookmarksEntry','com.liferay.portlet.blogs.model.BlogsEntry','com.liferay.portlet.calendar.model.CalEvent','com.liferay.portlet.documentlibrary.model.DLFileEntry','com.liferay.portlet.journal.model.JournalArticle','com.liferay.portlet.messageboards.model.MBMessage','com.liferay.portlet.wiki.model.WikiPage','com.liferay.portal.model.User']}, displayStyle: 'asset_entries',fieldName: 'entryClassName', label: 'asset-type', order: 'OrderHitsDesc', static: false, weight: 1.5},");
    

    to:

    sb.append("{className: 'com.liferay.portal.kernel.search.facet.AssetEntriesFacet', data: {frequencyThreshold: 1,values: ['com.liferay.portlet.bookmarks.model.BookmarksEntry','com.liferay.portlet.blogs.model.BlogsEntry','com.liferay.portlet.calendar.model.CalEvent','com.liferay.portlet.documentlibrary.model.DLFileEntry','com.liferay.portlet.journal.model.JournalArticle','com.liferay.portlet.messageboards.model.MBMessage','com.liferay.portlet.wiki.model.WikiPage']}, displayStyle: 'asset_entries',fieldName: 'entryClassName', label: 'asset-type', order: 'OrderHitsDesc', static: false, weight: 1.5},");
    
  • Consider using a third-party workflow engine such as Kaleo Workflow to add moderation to commenting and message boards.

With a few simple changes, user visibility and awareness of other users can be locked down in Liferay.

Robert Hall applies his impressive research, implementation and support skills to customer engagements as a Senior Consultant for Isos Technology.

Robert Hall's development as a software engineer was built on a strong foundation in researching parallel and distributed systems over five years at Kent State and the University of Michigan.  He readily applied the skills garnered during this time to his career as a professional software engineer.  

Over the course of the following fifteen years, Robert Hall worked in fields including telecom, banking, insurance and aviation.  The profiles of the companies Robert has worked with range from small startups to large Fortune 500 companies.  Robert has been involved in all aspects of the software development lifecycle, with extensive experience in design, development, release and post-release support as both a team member and team lead.

With five years of software engineering research and fifteen years as a professional software engineer, Robert Hall has cultivated the versatility that is the hallmark of an accomplished software engineering consultant.

Tagged with: , , — Posted in Liferay
2 comments on “Enterprise Liferay Concerns: Tips For Being Less Social
  1. Oscar says:

    I would like to known about your comments application. I need to build a similar solution. Thanks

    • Robert Hall says:

      Hello, the tips in this blog article are referring to customizations to the standard Liferay commenting and blogging sub-systems. We didn’t have a 3rd party comments application.

Leave a Reply

Connect with:

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>