Book Image

Liferay User Interface Development

By : Jonas X. Yuan, Xinsheng Chen, Frank Yu
Book Image

Liferay User Interface Development

By: Jonas X. Yuan, Xinsheng Chen, Frank Yu

Overview of this book

<p>Liferay employs a specialized theming system, which allows you to change the look and feel of the user interfaces. As a developer, by using the right tools to create and manipulate themes with Liferay Portal, you can get your site to look any way you want it to; but the Liferay theming system can be difficult to get started with. This practical guide provides you with a well organized manual for working with Liferay as a programmer to help you get started.<br /><br />Liferay User Interface Development is a pioneer in explaining Liferay's powerful theming system by taking you through examples to get you to create your own themes as quickly as possible. It focuses on how portal pages are created and styled and also discusses some simple configuration and customization to change the look and feel of a portal page. Its explicit instructions are accompanied by plenty of source code. With the open source nature of Liferay, you will find a user-friendly environment to design themes with the latest user interface technologies.<br /><br />Liferay User Interface Development unlocks the potential of using Liferay as a framework to develop a rich user interface.</p> <p>The book starts off with how you should go about structuring a Liferay Portal web page. It identifies the components of a portal page: theme, layout, and portlets. This hands-on tutorial explains themes, portlets, and Alloy UI, which is the latest output from the Alloy Project of Liferay, in an easy-to-understand way. It covers all aspects of a theme from its inception and rendering through its consumption by an end user, with in-depth discussion.<br /><br />By the end of this book, you will clearly understand themes, layouts, and the Alloy API. Most importantly you will obtain the skills to write a theme and layout templates, apply them to a portal, and also control the portlet UI through different mechanisms.</p> <p>This clear, concise, and practical tutorial will ensure that you have developed skills to become a competent Liferay themer. The detailed text is accompanied with source code that allows you to play with the examples, update the code, and add custom features.</p>
Table of Contents (12 chapters)
11
Index

Leveraging framework and architecture for user interface development

Liferay portal architecture supports high availability for mission-critical applications using clustering fully–distributed cache and replication support across multiple servers. The following figure depicts the various architectural layers and functionality of portlets.

Leveraging framework and architecture for user interface development

Service Oriented Architecture

Liferay portal uses Service Oriented Architecture (SOA) design principles throughout and provides the tools and framework to extend SOA to other enterprise applications. Under the Liferay enterprise architecture, not only can the users access the portal from traditional and / or wireless devices, but the developers can also access it from the exposed APIs via REST, SOAP, RMI, XML-RPC, XML, JSON, Hessian, Burlap, and custom-tunnel classes.

Liferay portal is designed to deploy portlets that adhere to the portlet API compliant with both JSR-168 and JSR-286. A set of useful portlets are bundled with the portal such as Image Gallery, Document Library, Calendar, Message Boards, Blogs, Wikis, and so on. They can be used as examples for adding custom portlets.

In a nutshell, the key features of Liferay include using SOA design principles throughout, such as reliable security, integrating with SSO and LDAP, multitier and limitless clustering, high availability, caching pages, dynamic virtual hosting, and so on. 

Enterprise Service Bus

The Enterprise Service Bus (ESB) is a central connection manager that allows applications and services to be added quickly to an enterprise infrastructure. When an application needs to be replaced, it can be easily disconnected from the bus at a single point. Liferay portal could use Mule or ServiceMix as ESB.

Through ESB, the portal could integrate with SharePoint, BPM (such as jBPM workflow engine, Intalio | BPMS engine), rule engine, BI Xforms reporting, JCR repository, and so on. It supports JSR 170 for Content Management Systems with the integration of JCR repositories such as Jackrabbit. It also uses Hibernate and JDBC to connect to any database. Furthermore, it supports events' system with asynchronous messaging and lightweight message bus.

Liferay portal uses the Spring framework for its business and data services layers. It also uses the Spring framework for its transaction management. Based on service interfaces (Spring framework), portal-implementation is implemented and exposed only for the internal usage—for example, they are used for the extension environment or ext plugins. portal-kernel and portal-service (these two are merged into one package, called portal-service) are provided for the external usage (or for the internal usage)—for example, they are used for the Plugins SDK environment. Custom portlets, both JSR-168 and JSR-286, and web services can be built based on portal-kernel and portal-service.

In addition, Web 2.0 Mail portlet and Chat portlet are supported as well. More interestingly, scheduled staging and remote staging, and publishing serve as a foundation through tunnel web for web content management and publishing.

Liferay portal supports web services to make it easy for different applications in an enterprise to communicate with each other. Java, .NET, and proprietary applications can work together easily because web services use XML standards. It also supports REST-style JSON Web Services for lightweight, maintainable code, and furthermore, it supports AJAX-based user interfaces.

Liferay portal uses industry-standard, government-grade encryption technologies, including advanced algorithms such as DES, MD5, and RSA. Liferay was benchmarked as one of the most secure portal platforms using LogicLibrary's Logiscan suite. Liferay offers customizable single sign-on with Yale CAS, JAAS, LDAP, NTLM, Netegrity, Microsoft Exchange, Facebook, and more. Open ID, OpenAuth, Yale CAS, Facebook, Siteminder, and OpenSSO (renamed as OpenAM) integration are offered by the portal out of the box.

In short, Liferay portal uses the ESB in general, in order to provide an abstraction layer on top of an implementation of an enterprise messaging system. It allows integration architects to exploit the value of messaging without writing code. As you can see, understanding the framework and architecture would be helpful if you would want to customize the user interface in a proper way.

Standards

Liferay portal is built based on "Standards". This is a more technical benefit, however, a very useful one if you ever want to use Liferay in a more specialized way.

Liferay is developed based on standard technologies that are popular with developers and other IT experts. The features of Liferay are listed as follows:

  • Built using Java: Java is a popular programming language that can run on just about any computer. There are millions of Java programmers in the world, so it won't be too hard to find developers who can customize Liferay.
  • Based on tried and tested components: With any tool, there's the danger of bugs. Liferay uses lots of well known, widely tested components to minimize the likelihood of bugs creeping in. If you are interested, here are some of the more well-known components and technologies used by Liferay—Apache ServiceMix, Mule, ehcache, Hibernate, ICEfaces, Java J2EE/JEE, jBPM, Intalio | BPMS, JGroups, Alloy UI, Lucene, PHP, Ruby, Seam, Spring and AOP, Struts and Tiles, Tapestry, Vaadin, Velocity, and FreeMarker.
  • Uses standard ways to communicate with other software: There are various standards established for sharing data between pieces of software. Liferay uses these so that you can easily get information from Liferay into other systems. The standards implemented by Liferay include AJAX, iCalendar, and Microformat, JSR-168, JSR-127, JSR-170, JSR-286 (Portlet 2.0), and JSR-314 (JSF 2.0), OpenSearch, Open platform with support for web services (including JSON, Hessian, Burlap, REST, RMI, and WSRP), WebDAV, and CalDAV.
  • Makes publication and collaboration tools WCAG 2.0 (Web Content Accessibility Guidelines) compliant: The new W3C Recommendation to make web content accessible to a wide range of people with disabilities, including blindness and low vision, deafness and hearing loss, learning disabilities, cognitive limitations, limited movement, speech disabilities, photosensitivity, and combinations of these. For example, the portal integrates CKEditor—standards support: W3C (WAI-AA and WCAG), 508 (Section 508).
  • Alloy UI: Supports HTML 5, CSS 3, and YUI 3 (Yahoo! User Interface Library).
  • Supports Apache Ant 1.8 and Maven 2: Liferay portal could be built through Apache Ant by default, where you can build services, clean, compile, build JavaScript CMD, build language native to ASCII, deploy, fast deploy, and so on. Moreover, Liferay supports Maven 2 SDK, providing Community Edition (CE) releases through public maven repositories as well as Enterprise Edition (EE) customers to install maven artifacts in their local maven repository.

Many of these standards are things that you will never need to know much about, so don't worry if you've never heard of them. Liferay is better for using them, but mostly, you won't even know they are there. Of course, the user interface could be standardized, too. Therefore when developing and / or customizing user interface, you can leverage these standards.