Profile

Recent Bloggers

Neil Griffin Posts: 20
Stars: 59
Date: 7/30/10
Jorge Ferrer Posts: 34
Stars: 157
Date: 7/30/10
Alice Cheng Posts: 155
Stars: 13
Date: 7/29/10
Ronald Sarayudej Posts: 118
Stars: 275
Date: 7/29/10
Stephen Wilburn Posts: 1
Stars: 3
Date: 7/28/10
Samuel Liu Posts: 3
Stars: 2
Date: 7/27/10
Juan Fernández Posts: 8
Stars: 22
Date: 7/26/10
Ray Augé Posts: 46
Stars: 201
Date: 7/24/10
Brian Chan Posts: 33
Stars: 214
Date: 7/23/10
Nate Cavanaugh Posts: 33
Stars: 115
Date: 7/20/10

Blogs

Building jQuery based plugins in Liferay 6

jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript. Refer to http://jquery.com/

Liferay portal 6 uses Alloy UI instead of jQuery, which means YUI3 (http://developer.yahoo.com/yui/3/) is included as core part, and jQuery is not included as core part anymore.  Ideally you can use whatever version of jQuery you need for your custom developments, refering to the blog post Can I have different jQuery versions in Liferay? and ticket LPS-10872.

This article will introduce how to build jQuery based plugins in Liferay 6. Hope that this article would be helpful to upgrade custom portlets from 5.1.x or 5.2.x to 6.x.

Build jQuery based plugins
Here I use Liferay 6.0.3 GA (revision 57559) and plugins SDK.

  • Build a project called “sample-jquery-portlet” with folder “docroot” and build.xml
  • Add CSS under the folder /docroot/css
  • Add images under the folder /docroot/css
  • Add jquery under the folder /docroot/js
  • Add liferay-display.xml, liferay-plugin-package.properties, liferay-portlet.xml, portlet.xml under the folder /docroot/WEB-INF

Especially, add following lines, for example, in the file liferay-portlet.xml.
<portlet>
    <portlet-name>1</portlet-name>
    <icon>/images/world.png</icon>
    <header-portlet-css>/css/style.css</header-portlet-css>
    <header-portlet-javascript>/js/jquery.js</header-portlet-javascript>
    <footer-portlet-javascript>/js/jquery-ui-custom.js</footer-portlet-javascript>
    <css-class-wrapper>sample-jquery-portlet</css-class-wrapper>
</portlet>

Note that the property header-portal-javascript sets the path of JavaScript that will be referenced in the page's header relative to the portal's context path; and the property footer-portal-javascript sets the path of JavaScript that will be referenced in the page's footer relative to the portal's context path.

  • Add JSP files under the folder /docroot/jsp.

Note that you may include addition JavaScript at JSP file like

<script type='text/javascript' src='js/jquery_1.4.2.js'></script>

Sample Screenshots

Testing environment: Liferay portal 6.0.2.and 6.0 GA (6.0.3 - revision 57559)

A few jQuery examples:

Fade in

Animate

Fade out

Do it yourself
You can download the WAR with source code at:

http://liferay.cignex.com/palm_tree/book/0387/chapter11/sample-jquery-portlet-6.0.2.1.war

and drop it to $PORTAL_HOME/deploy or use UI "Plugins Installation" under Control Panel. For more details, you may refer to the book Liferay Portal 6 Enterprise Intranets.

If you want to use different jQuery version other than 1.4.2, you can go to the fodler ${sample.jquery.portlet.war}/js and update jquery.js with expected version.

Migration

Supposed that you have custom portlets heavily using jQuery in 5.1 or 5.2, now you are planning to migrate to 6.x.  You can simply add different version of jQuery jquery.js in portlet specification liferay-portlet.xml as follows.

<header-portlet-css>/css/style.css</header-portlet-css>
<header-portlet-javascript>/js/jquery.js</header-portlet-javascript>
<footer-portlet-javascript>/js/jquery-ui-custom.js</footer-portlet-javascript>

That's it. It is simple, isn't it? your comments?

Applying workflow on any assets in Liferay 6

Liferay 6 integrates workflow engines like jBPM or Kaleo on any assets finally. This feature has been expected for a while.  By this feature, users are able to manage the content creation process with a workflow. Especially, this feature helps content creators collaborate and go through the necessary steps in order to produce better and more accurate content like assets. Within a workflow, any type of assets like Document Library document, wiki entry or web content can go through review-approval processes.

In this article, I am going to show this feature with examples. Asset here refers to Liferay core content types: like Document Library document, Image Gallery image, Message Boards message, Web Content, Wiki page, comments, Blogs entry. Logically, workflow should be available for any assets like Image Gallery image, Calendar event, layout page, Bookmarks entry, user, organization, etc. (Abstracted from the book: Liferay Portal 6 Enterprise Intranets)

Note that complete workflow functions would be available in Liferay 6.0 GA version or higher. This article will be updated when liferay 6.0 GA version is ready. 

Install Workflow engine

First prepare Liferay portal. Here I use Liferay 6.0.3 GA (revision 55391). Liferay 6.0.2 RC 2 would be OK, too.  Install the portal and you would have a folder $PORTAL_HOME and deploy-folder $PORTAL_HOME/deploy.  Then start the portal. 

When the portal is running, deploy the workflow engine – that is, drop the WAR ${workflow-web-6.0.2.1}.war to the folder $PORTAL_HOME/deploy. You can use either jbpm-web or kaleo-web. Kaleo is Liferay custom Workflow plugin.  Here I use kaleo-web. 

You can download kaleo-web from 

http://liferay.cignex.com/palm_tree/book/0387/chapter09/kaleo-web-6.0.2.1.war.

Note that you can find example workflow single-approver-definition.xml at 

/kaleo-web/WEB-INF/classes/META-INF/definitions.

Of course, you can download example at 

http://liferay.cignex.com/palm_tree/book/0387/chapter09/definitions.

Configure workflow on any assets

Now you can configure workflow now. I use asset Blog Entry as an example.

Create two users: David Berger – a content creator; Lotti Stein – a content reviewer. And assign them as members of community Guest.

Login as admin and go to Control panel | Liferay.com| Workflow Configuration

Locate Blogs Entry and select “Single Approver” workflow and save it.

Go to Control panel | Portal| Communities and assign user roles of community guest; note that you can apply  workflow on any assets of any groups (communities and organizations). Here I  use the group Guest as an example.

Assign roles (community or organization content reviewer – Auto-generated role from workflow definition) to users (David Berger and Lotti Stein).

 

Go through workflow

Assign proper permissions to users David Berger and Lotti Stein that they can manage pages and create blogs entries in community Guest;

Login as David Berger and create a blog called “Liferay Portal 6 Enterprise Intranets”; you would see that the asset Blog entry goes workflow and it states as “Pending Approval”;

 

Login as Lotti Stein and go to Control Panel | Lotti Stein | My Workflow Tasks; you would see tabs: Assigned to Me, Assigned to My Roles, My Completed Tasks. Under the tab Assigned to My Roles, you would see the workflow task “Liferay Portal 6 Enterprise Intranets”.

 
Click on the workflow task and assign this to yourself “Lotti Stein”; and add comment “Please review”; as you can see, the workflow task is moved to the tab “Assigned to Me”;
 

 

Click on the workflow task under the tab “Assigned to Me”; and you can either reject it or approve it; you can click on “Approve Asset” and add comment “looks good” as well; 

 

As you can see, the workflow task is move to the tab “My Completed Tasks”;

 

After approved, the blog entry “Liferay Portal 6 Enterprise Intranets” would be visible for end users.

Summary

As you can see, Liferay 6 integrates workflow engine either jBPM or Kaleo smoothly. Thus you can manage easily workflow definitions, instances and tasks in one place, that is, Control Panel. In brief, this integration has following beauties

  • ability to integrate many workflow engines like jBPM | Kaleo; 

  • ability to have configurable workflow definitions;

  • ability to apply workflow on any assets like Blogs Entry, Bookmarks Entry, Calendar Event, Document Library Document, Image Gallery Image, Web Content, Wiki Page, etc.

Last but not least, I'd like to send a ton of thanks to Brian Chan, Jorge Ferrer, Julio Camarero, Raymond Auge, Bruno Farache, Shuyang Zhou, Michael Han, Marcellus Tavares, etc. who did an amazing job to make Asset Workflow a reality. This is big and long-time expected feature.

What’s next?

What’s next? You should be able to apply workflow on any custom assets in Liferay 6 like Knowledge Base articles. Right? I will address details in next blogs post. 

 

Alfresco 3.3 delivers CMIS support, integration with Liferay 6

Alfresco 3.3 with implementation of CMIS provides interoperability of its enterprise content management system with Liferay 6. In previous blogs Integrating Alfresco through CMIS in Liferay and the book: Liferay Portal 6 Enterprise Intranets, we have discussed how to integrate Alfresco 3.2 through CMIS 1.0 in Liferay 6. In this article, we are going to introduce how to integrate Alfresco 3.3 through CMIS 1.0 in Liferay 6. 

This article will use Alfresco 3.3 E and Liferay portal 6.0.2 to show how to integrate Alfresco through CMIS in Liferay.  Of course, you can do the same for Alfresco 3.3 or above community (or enterprise) version.

Integration

You should be able to integrate Alfresco through CMIS in following steps

  • Install Liferay portal 6.0.2 (revision 54489) or above at $LIFERAY_HOME; Liferay-Tomcat bundle is expressed as $TOMCAT_AS_DIR; and $PORTAL_ROOT_HOME = $TOMCAT_AS_DIR/webapps/ROOT;
  • Locate Alfresco 3.3 WAR ${alfresco.war} and Share WAR ${shared.war} at $ALFRESCO_INSTALLATION/ tomcat/webapps
  • Drop ${alfresco.war} and ${shared.war} to $TOMCAT_AS_DIR/webapps;
  • Create a database alfresco in MySQL.
    drop database if exists alfresco;
    create database alfresco character set utf8;
    grant all on alfresco.* to 'alfresco'@'localhost' identified by 'alfresco' with grant option;
    grant all on alfresco.* to 'alfresco'@'localhost.localdomain' identified by 'alfresco' with grant option;

  • Optionally, create database lportal in MySQL
    drop database if exists lportal;
    create database lportal character set utf8;
    grant all on lportal.* to 'lportal'@'localhost' identified by 'lportal' with grant option;
    grant all on lportal.* to 'lportal'@'localhost.localdomain' identified by 'lportal' with grant option;

  • Create a file named portal-ext.properties at $PORTAL_ROOT_HOME/WEB-INF/classes and add following lines in portal-ext.properties.
    dl.hook.impl=com.liferay.documentlibrary.util.CMISHook
    cmis.credentials.username=admin
    cmis.credentials.password=admin
    cmis.repository.url=http://localhost:8080/alfresco/service/api/cmis
    cmis.repository.version=1.0
    cmis.system.root.dir=Liferay Home

  • Optionally, add database connection in portal-ext.properties.
    ## MySQL
    jdbc.default.driverClassName=com.mysql.jdbc.Driver
    jdbc.default.url=jdbc:mysql://localhost:3306/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
    jdbc.default.username=lportal
    jdbc.default.password=lportal

Of course, you can use different database systems.

  • Start the portal

By the way, you can download Alfresco 3.3 E WAR and Share WAR directly from

http://liferay.cignex.com/palm_tree/book/0387/chapter12/cmis/1.0/

Of course, you can get the latest WAR of Alfresco Community version or Enterprise (Trial) version from Alfresco website

http://www.alfresco.com/try/

Results

In Control panel of Liferay portal, select default community “liferay.com”; 

going to Content->Document Library, create a folder "Liferay Home" and upload a document under this folder as shown in following screenshot.

Logging in Alfresco as "admin/admin", you would see the folder "Liferay Home" and the document as shown in following screenshot. That is, Alfresco becomes direct repository of Liferay Document Library via CMIS. All real content is stored in Alfresco, while all metadata is stored in Liferay database.

In brief, Liferay supports CMIS 1.0 100%. Isn’t it? You can integrate other ECM or related systems easily via CMIS in Liferay portal, like Dennis Hamilton, EMC, FatWire, IBM, Microsoft, Open Text, Oracle and SAP, etc.

Liferay 6 and Semantic Web

 The Semantic Web is an evolving development of the World Wide Web in which the meaning (that is, semantics) of information and services on the web is defined, making it possible for the web to understand and satisfy the requests of people and machines to use the web content.

Liferay goes Semantic Web! See ticket: Support RDF - Semantic Web.

The portal tagging system allows us to tag web content, documents, message board threads, and more and dynamically publish assets by tags. Tags provide a way of organizing and aggregating content. Basically, the tag administration determines which tags are available for use. The users use these tags on their content. Any content that is tagged can be grouped or aggregated.

The following figure depicts an overview of tags, categories, and assets:

Abstracted from the book: Liferay Portal 6 Enterprise Intranets

Folksonomies

Folksonomies are a user-driven approach to organizing content through tags, cooperative classification, and communication through shared metadata. The portal implements folksonomies through tags. A tag may be associated with many assets, whereas an asset may have many tags associated with it. This is what we called tagging content. Also, a tag may have many properties. Each property is made up of name-value pair.

A tag may be associated with content. Using tags, you can tag almost anything: Bookmarks' entries, Blogs' entries, Wiki articles, Document Library documents, Image Gallery images, Journal articles and Message Board threads, and so on. You can also use these tags to pull content within the Asset Publisher portlet.

Taxonomies

Taxonomies are a hierarchical structure used in scientific classification schemes. Although taxonomies are common, it can be difficult to implement them. The portal implements taxonomies as "vocabularies and category tree" in order to tag contents and classify them.

You can have more than one vocabulary, which forms a top-level item of the hierarchy. Each vocabulary may have many categories. That is, a category cannot be a top-level item of the hierarchy. However, a category can have other categories as its child or siblings. Therefore, vocabulary and categories form a hierarchical tree structure.

In the same way, a category may have many properties. Each property is made up of a name and a value.

In addition, a predefined category will be applied to any asset. In a word, assets could be managed and grouped by categories.

Category Tree

It is very useful that parent categories can have multiple child categories. This parent-child relationship forms a hierarchical structure. However, categories don't have siblings, for example, left-side category and right-side category. Parent-child relationship plus left-side category and right-side category form a tree called Category Tree. This feature will come out soon.

Why it doesn't merge both kinds of tags using ontology

As you can see, there are two kinds of tags: taxonomies and folksonomies. Both of them can be used as a way of organizing and aggregating content. Folksonomy is a way of classification, creating, and managing tags to annotate and categorize content, whereas taxonomy is a hierarchical structure only for classification.

In fact, taxonomies and folksonomies are different. Taxonomies are a closed set of categories (also called tags) and the vocabulary, created and organized in a hierarchical structure. It helps standardization, especially when you store it in the Shared Global group to standardize categorization through all of the organizations. In a word, folksonomies are an open set of tags, which are extended by the end user.

Why can't we merge both of them through ontology? Ontology—the study of entities and their relations—is less concerned with what "is" than with what is possible. The answer would be "yes".

What's next?

  • Ontology support.

Merge tags and categories through ontology.

  • RDF - Sematic Web (Web 3.0) - support

RDF is a standard model for data interchange on the Web. RDF has features that facilitate data merging even if the underlying schemas differ, and it specifically supports the evolution of schemas over time without requiring all the data consumers to be changed.

RDF extends the linking structure of the Web to use URIs to name the relationship between things as well as the two ends of the link (this is usually referred to as a "triple"). Using this simple model, it allows structured and semi-structured data to be mixed, exposed, and shared across different applications.

This linking structure forms a directed, labeled graph, where the edges represent the named link between two resources, represented by the graph nodes. This graph view is the easiest possible mental model for RDF and is often used in easy-to-understand visual explanations.

See details of RDF at http://www.w3.org/RDF/

 

Your suggestions or comments or vision?

Liferay is shining in publishing

Liferay Portal is an enterprise web platform for building business solutions that deliver immediate results and long-term value; and Liferay Social Office is a social collaboration solution for the enterprise.

As you can see, Liferay is becoming increasingly popular, developing features to compare with commercial rivals, and finding increased usage in professional channels.

Liferay is shining in publishing. A ton of thanks to all Liferay fanatics and evangelists!  

Here I am happy to post this special invitation from Packt Publishing, which is calling all Liferay Fanatics to write for Packt!

Packt aims to publish books that will make Liferay applications accessible. The topics would cover following, but not limited.

  • Security
  • System Administration
  • Multimedia
  • Ecommerce
  • Project Implementation
  • Cookbooks for developers

For more details, you can refer to Calling all Liferay Fanatics to write for Packt!

Showing 1 - 5 of 24 results.
Items: 5
Page: of 5