Child pages
  • Crafter Social Integration
Skip to end of metadata
Go to start of metadata



This app integrates Liferay with the state of the art open source Crafter Social ( Crafter Social is a multi-tenant, platform independent user-generated content management system for handling all actions related to user-generated content (UGC), including the creation, updating and moderation of the content. 

It is built on MongoDB and uses Crafter Profile for profile, tenant, roles management, and authentication.  Crafter Social is highly scalable in terms of both the users & data, and secures the generated content using Crafter Profile and the Crafter Profile Security library.  As a headless, RESTful application, Crafter Social allows for loosely coupled integration with the vertical applications using it.

Crafter Social offers two editions: 

  • Community Edition: Fully featured, free and open source (GPL v3) with community support.
  • Enterprise Edition Commercial license and enterprise support for a low annual subscription cost.



Crafter Social Integration app consists of a group of events, listeners and a hook. 

There are two events, a post login and a post logout. The post login checks if the Liferay user exists on Crafter Profile, if not creates a new profile using the current data of the Liferay user. If the user has the Administrator role, the Crafter profile would be created also with the proper admin role, otherwise, a regular Crafter profile would be created. After that, an encrypted cookie is created containing the profile ticket, this is needed to tell the Crafter Social API who is using it. The post logout event just delete the crafter cookie from the browser.

About the listeners, there are also two of them, a User listener and a Trash Entry listener. The User listener, activate or deactivate a Crafter Profile as happens on Liferay Portal. The Trash Entry listener deletes all the Crafter Social activity associated to a web content, if this is deleted from the Portal.

Finally we have a hook plugin that overrides the Portal Settings to add a new menu item called "Crafter Profile". There are two fields inside (Username and Password) and the purpose is to let the Liferay Administrator set a profile administrator on Crafter Profile to use it in the background for delete the comments on the Trash Entry listener. 


The installation steps are as follows:

  1. Download Crafter Social Bundle 2.3.1 from
  2. Create an empty folder.
  3. Give execute permissions (chmod +x to
  4. In the empty folder run
  5. Say "yes" to all.
  6. On your empty folder you'll see a script named "", use it for view the status, stop or start MongoDB and the Apache server containing Crafter Social and Profile.
  7. Download Liferay portal CE GA2 from  Install CE GA2 under your choice of directory. 

  8. Obtain Crafter Social Integration app from the Liferay Marketplace.
  9. Deploy the app in your existing Liferay installation.

Socket Security

Why do we need it
  1. This app requires a connection to Crafter site to obtain the content. 
  2. Since the app is PACL enabled, the Crafter URL with which it connects need to be specified in of crafter-social-portlet.
  3. To understand Socket Security, click here
How to update the URL
  1. Go to the [Tomcat Home]/webapps/crafter-social-portlet/WEB-INF
  2. Replace the localhost ( with Crafter URL as show below in 

  3. Restart the tomcat upon saving the changes.


1.  Create Structures:  create any structure that you need.


2. Create templates: create corresponding templates related to the structures that you need. If we want any field to be commentable with Crafter Social we have to wrap it in a DIV and set the ID attribute with the following structure: "commentable-{article-id}-{fieldName}". If we have a repeatable field, we can add an extra indicator to differentiate them, like: "commentable-{article-id}-{fieldName}-{index}". Finally we need to load the "crafter-comments.js" on the template. Let's say we have a simple structure with a repeatable HTML field that we name "HTML_TestArea". The FreeMarker template could be:

<#list HTML_TestArea.getSiblings() as testArea>	
	<div id="commentable-${.vars['reserved-article-id'].data}-${testArea.getName()}-${testArea_index}">
<script src="/crafter-social-portlet/js/crafter-comments.js"></script>


And for the same structure the velocity template could be like:


#foreach( $testArea in $HTML_TestArea.getSiblings() )
<div id="commentable-${}-${}-${velocityCount}">$</div>
<script src="/crafter-social-portlet/js/crafter-comments.js"></script>


3. Create web contents: create a web content with the structures and the templates you have configured to use Crafter Social.


4. Add the web content to a page, refresh it, and then you'll see the Crafter Social feature available on the DIV's you have configured with the appropriate ID attribute. 

Other features

On the Crafter bundle you have previously install you can manage the profiles of Crafter Profile or the UGC's of Crafter Social with an administrator user that you can create it from Liferay. This user is also needed to delete the UGC's every time a web content is permanently deleted.

  1. First you go to Control Panel, Portal Settings, Crafter Profile. And set the fields


 2. Enter the URL of Crafter Apache server and look for the administration webapps, it would ask you to login, you can use the credentials you have just created. The administration for Crafter Profile is called "crafter-profile-admin-console" and the Crafter Social moderation dashboard is called "crafter-social-admin".

Crafter Profile Admin Console:

Crafter Social Moderation Dashboard:

Code repository

The latest source code is located at the following location:

Contact Us

We welcome feature/bug reports concerning Crafter Social Integration app. Discussion helps to clarify the ways the app can be used and also helps define directions for future development. Please post your concerns at

  • No labels