Liferay Frameworks

Introduction #

One of the most interesting benefits of the Liferay platform for developers is the availability of a number of frameworks that allow adding functionality easily to custom applications. These frameworks are also in use by Liferay's own applications which proves the readiness and also serve as a way for integrating.

The following sections describe the most relevan framework by topic.

UI & Frontend #

These frameworks are using when building the UI of an application

Alloy UI #

(Introduced in: Liferay 6.0. As of Liferay 6.2 the version 2.0 of Alloy is used)

AlloyUI is a framework built on top of YUI3 (JavaScript) that uses Bootstrap (HTML/CSS) to provide a simple API for building high scalable applications.

It was built as a need to develop the out of the box applications included with Liferay which needed of a rich set of components that offered a consistent UI with high performance.

Read More: http://alloyui.com/

Taglibs #

Liferay's portlets make use of several taglibs that are also available for custom applications.

Read More:

Application Display Templates (New in 6.2) #

Application Display Templates provides a site administrators the ability to customize the UI of an application through Freemarker or Velocity templates.

Portlet developers can use the PortletDisplayTemplate framework to add this functionality to any custom portlet. Besides the API, the framework includes a portlet that sits within Site Administration to allow site admins to administer the templates for all applications and a taglib that can be used in the configuration of a portlet to let the admin choose which of the available templates to use for each portlet instance.

Portal #

Permissions #

The Java portlet standard defines a simple security scheme using portlet roles and their mapping to portal roles. On top of this, Liferay provides a fine-grained permissions system that you can use to implement access security in your custom portlets. Here, we’ll give an overview of the standard Java security system, Liferay’s permission system, and how to use them in your own portlets.

Message Bus #

The Message Bus is a service level API used to exchange messages within Liferay. The Message Bus is a mechanism for sending message payloads to different components in Liferay, providing loose coupling between message producers and consumers to prevent class loading issues. It’s located in the global class loader, making it accessible to every deployed web application. Remote messaging isn’t supported, but messages are sent across a cluster when ClusterLink is enabled.

Read More: http://www.liferay.com/documentation/liferay-portal/6.2/development/-/ai/using-message-bus-liferay-portal-6-2-dev-guide-06-en

Scheduler Engine #

WCM & Search #

Asset Framework (Tags, Categories and more) #

The asset framework provides base functionality that most content types can benefit from. This includes:

  • Categorization (taxonomies)
  • Tagging (folksonomies)
  • Relationships among content

Apart from the APIs the Framework also offers two portlets to manage Categories and Tags respectively within Site Administration (or the Control Panel in versions 6.1 and before). It also provides a taglib to generate the edit and display UIs for custom content types.

This framework is also used as the basis for some other frameworks that add features on top of this.

It is leveraged by Liferay's Web Content, Documents, Blogs, Wiki, Forum, etc.

Read more: http://www.liferay.com/documentation/liferay-portal/6.2/development/-/ai/asset-framework-liferay-portal-6-2-dev-guide-06-en

Workflow #

The workflow framework allows adding workflow functionality to an application. This framework provides APIs to simplify its usage and offer an abstraction layer on top of the underlying workflow engine (Kaleo, Activity, ...).

Site Membership Policies (New in 6.2) #

This framework allows implementing automatic policies for making a user member of a site or a subsite. It also allows setting rules to determine bans of certains users within a site.

Liferay provides a default policy implementation that offers some parametrization through Site Settings. Developers can extend this policy or create custom ones by creating an implementation of SiteMembershipPolicy (actually, it's recommended to extend BaseSiteMembershipPolicy).

Data Handlers (Staging, export/import and more) #

When a site administrator enables staging a copy of the site is created where changes can be made and tested before making them public. The Site administrator can decide which type of content to stage and which to leave unstaged. This is possible for all of Liferay's out of the box content types and it is also possible to add support for this features to custom portlets by implementing Data Handlers.

The Data Handlers know how to export data from the database (or any other persistance mechanism used by the portlet) and import it back. This ability is used to support export/import into LAR files, to support publishing from staging to live and also to copy content from a site template when a site is first created based on that template.

Search #

The search framework allows adding search functionality to an application. This framework provides APIs and annotations to simplify its usage and offer an abstraction layer on top of the underlying search engine (Lucene, SOLR, ...).

Recycle Bin (New in 6.2) #

The Recycle Bin provides a mechanism to handle deleted files, allow restore of those files and automatic deletion after a configurable period of time.

The framework provides a set of APIs and a Recycle Bin application for Site Administrator.

Content Targeting (New in 6.2) #

The Content Targeting framework provides extension points that allow implementing content targeting capabilities through plugins. It consists on two parts:

  1. Access to user segmentation information. The framework reads cookies with the prefix "RP_" (RP stands for Remote Preferences) and makes the available through the User object with the methods getRemotePreferences() and getRemotePreference(String). By making this info available through the User object it is accessible from almost all of Liferay's APIs and extension points. The framework does not define how and when the cookies are added, it is entirely up to the implementors to decide how to do that.
  2. Filtering of the content displayed in Asset Publisher to customize them for the current user. Asset Publisher specifies the content to be displayed based on the portlet configuration through an AssetEntryQuery object. The Content Targeting framework allows defining AssetEntryQueryProcessor classes that can manipulate the object to customize it for the current user (or any other information) accessing its profile and remote preferences.

Misc #

Comments #

The comments framework allows adding commenting functionality to any custom portlet. It is extremely easy to use this framework. Developers just need to use the liferay-ui:discussion taglib and . Here is an example extracted from a custom portlet portlet:

<portlet:actionURL name="invokeTaglibDiscussion" var="discussionURL" />

<liferay-ui:discussion
	className="<%= FreezityEvent.class.getName() %>"
	classPK="<%= event.getEventId() %>"
	formAction="<%= discussionURL %>"
	formName="fm2"
	ratingsEnabled="true"
	redirect="<%= zity.getFullURL(themeDisplay) %>"
	subject="<%= event.getTitle() %>"
	userId="<%= event.getUserId() %>"
/>

Ratings #

The ratings framework allows adding rating functionality to any custom portlet. It is extremely easy to use this framework. Developers just need to use the liferay-ui:ratings taglib and . Here is an example extracted from Liferay's blog portlet:

<liferay-ui:ratings
	className="<%= BlogsEntry.class.getName() %>"
	classPK="<%= entry.getEntryId() %>"
/>

File Storage (New in 6.2) #

The File Storage framework provides portlets with an API to store files using the Documents & Media backend. It is specially useful for managing attachments. In fact the Message Boards and the Wiki portlets have been refactored to use this API to manage its attachments.

Look at PortletFileRepositoryUtil for more details.

Device Detection #

The Device Detection API detects the capabilities of any device making a request to your portal. It can also determine what mobile device or operating system was used to make a request, and then follows rules to make Liferay render pages based on the device. To use this feature, you first need to install the Device Recognition Provider app from Liferay Marketplace. Find more information on Device Recognition Provider CE app and Device Recognition Provider EE at Liferay Marketplace.

Read More: http://www.liferay.com/documentation/liferay-portal/6.2/development/-/ai/device-detection-liferay-portal-6-2-dev-guide-06-en

ServiceContext #

The ServiceContext class is a parameter class used for passing contextual information for a service. Using a parameter class lets you consolidate many different methods with different sets of optional parameters into a single, easier-to-use method. The class also aggregates information necessary for features used throughout Liferay’s core portlets, such as permissioning, tagging, categorization, and more.

Cache #

This is not a frameworks strictly speaking but provides a very useful APIs that can be used from custom developments to add caching and leverage all the configuration made to Liferay's caching system. The main classes that can be used are:

  • MultiVMPool: Use to store data that should be kept in sync across the nodes of a cluster
  • SingleVMPool: Use to store data that does not need to be kept in sync across the nodes of a cluster
0 Anhänge
11954 Angesehen
Durchschnitt (0 Stimmen)
Die durchschnittliche Bewertung ist 0.0 von max. 5 Sternen.
Kommentare