Liferay 6.2-ce-ga5

Liferay 6.2-ce-ga5 Public API Documentation

The Liferay public API documentation describes the packages and classes used by portlet and plugin developers and provides a general overview of the API, best practices for using the API, and information about Liferay's ongoing Javadoc initiative; select the Description link below to continue reading this overview.

See:
          Description

Portal Services
com.liferay.counter This package defines the portal counter exceptions.
com.liferay.counter.model This package defines the portal counter model interfaces, classes, and wrappers.
com.liferay.counter.service This package defines the portal counter service local interfaces, utilities, and wrappers.
com.liferay.counter.service.persistence This package defines the portal counter service persistence interfaces and utilities.
com.liferay.mail.model This package defines the portal mail model classes.
com.liferay.mail.service This package defines the portal mail service interfaces and utilities.
com.liferay.mail.util This package defines the portal mail utility interfaces.
com.liferay.portal This package defines the common portal exceptions.
com.liferay.portal.lar This package defines the portal archiving interfaces, classes, and exceptions.
com.liferay.portal.layoutconfiguration.util  
com.liferay.portal.layoutconfiguration.util.xml  
com.liferay.portal.license This package defines the portal license classes.
com.liferay.portal.license.util This package defines the portal license utility interfaces and classes.
com.liferay.portal.model This package defines the portal model interfaces, classes, utilities, wrappers, and annotated types.
com.liferay.portal.model.impl This package defines the portal model implementation base classes.
com.liferay.portal.portletfilerepository  
com.liferay.portal.repository.proxy This package defines the portal repository proxy beans.
com.liferay.portal.security.ac  
com.liferay.portal.security.auth This package defines the portal security authentication interfaces, classes, utilities, wrappers, and exceptions.
com.liferay.portal.security.ldap This package defines the portal security LDAP interfaces and classes.
com.liferay.portal.security.membershippolicy  
com.liferay.portal.security.permission This package defines the portal security permission interfaces and classes.
com.liferay.portal.security.permission.comparator This package defines the portal security permission comparator classes.
com.liferay.portal.security.pwd  
com.liferay.portal.security.xml  
com.liferay.portal.service This package defines the portal service interfaces and classes.
com.liferay.portal.service.base This package defines the portal service local and remote base classes.
com.liferay.portal.service.permission This package defines the portal service permission interfaces and utilities.
com.liferay.portal.service.persistence This package defines the portal service persistence interfaces, classes, and utilities.
com.liferay.portal.service.persistence.impl This package defines the portal service persistence implementation base classes.
com.liferay.portal.theme This package defines the portal theme classes.
com.liferay.portal.util This package defines the portal utility interfaces and classes.
com.liferay.portal.util.comparator This package defines the portal comparator classes.
com.liferay.portal.webserver This package defines the portal web server interfaces and classes.

 

Portal Kernel
com.liferay.portal.kernel.annotation  
com.liferay.portal.kernel.atom  
com.liferay.portal.kernel.audit  
com.liferay.portal.kernel.backgroundtask  
com.liferay.portal.kernel.bean This package defines the kernel bean interfaces, classes, and annotation types.
com.liferay.portal.kernel.bi.reporting  
com.liferay.portal.kernel.bi.reporting.messaging  
com.liferay.portal.kernel.bi.reporting.servlet  
com.liferay.portal.kernel.bi.rules  
com.liferay.portal.kernel.cache  
com.liferay.portal.kernel.cache.cluster  
com.liferay.portal.kernel.cache.index  
com.liferay.portal.kernel.cache.key  
com.liferay.portal.kernel.cal  
com.liferay.portal.kernel.captcha  
com.liferay.portal.kernel.cluster  
com.liferay.portal.kernel.cluster.messaging  
com.liferay.portal.kernel.concurrent  
com.liferay.portal.kernel.configuration  
com.liferay.portal.kernel.dao.db  
com.liferay.portal.kernel.dao.jdbc  
com.liferay.portal.kernel.dao.jdbc.aop  
com.liferay.portal.kernel.dao.orm  
com.liferay.portal.kernel.dao.search  
com.liferay.portal.kernel.dao.shard  
com.liferay.portal.kernel.deploy  
com.liferay.portal.kernel.deploy.auto  
com.liferay.portal.kernel.deploy.auto.context  
com.liferay.portal.kernel.deploy.hot  
com.liferay.portal.kernel.deploy.sandbox  
com.liferay.portal.kernel.editor  
com.liferay.portal.kernel.events  
com.liferay.portal.kernel.exception This package defines the kernel exceptions.
com.liferay.portal.kernel.executor  
com.liferay.portal.kernel.facebook  
com.liferay.portal.kernel.flash  
com.liferay.portal.kernel.format  
com.liferay.portal.kernel.googleapps  
com.liferay.portal.kernel.googleapps.comparator  
com.liferay.portal.kernel.image  
com.liferay.portal.kernel.increment  
com.liferay.portal.kernel.io  
com.liferay.portal.kernel.io.unsync  
com.liferay.portal.kernel.javadoc  
com.liferay.portal.kernel.jmx  
com.liferay.portal.kernel.jmx.model  
com.liferay.portal.kernel.jndi  
com.liferay.portal.kernel.json  
com.liferay.portal.kernel.jsonwebservice  
com.liferay.portal.kernel.language  
com.liferay.portal.kernel.lar  
com.liferay.portal.kernel.ldap  
com.liferay.portal.kernel.lock  
com.liferay.portal.kernel.log  
com.liferay.portal.kernel.mail  
com.liferay.portal.kernel.management  
com.liferay.portal.kernel.management.jmx  
com.liferay.portal.kernel.memory  
com.liferay.portal.kernel.messaging  
com.liferay.portal.kernel.messaging.async  
com.liferay.portal.kernel.messaging.config  
com.liferay.portal.kernel.messaging.jmx  
com.liferay.portal.kernel.messaging.proxy  
com.liferay.portal.kernel.messaging.sender  
com.liferay.portal.kernel.metadata  
com.liferay.portal.kernel.microsofttranslator  
com.liferay.portal.kernel.mobile.device  
com.liferay.portal.kernel.mobile.device.rulegroup  
com.liferay.portal.kernel.mobile.device.rulegroup.action  
com.liferay.portal.kernel.mobile.device.rulegroup.rule  
com.liferay.portal.kernel.monitoring  
com.liferay.portal.kernel.monitoring.statistics  
com.liferay.portal.kernel.nio.charset  
com.liferay.portal.kernel.nio.intraband  
com.liferay.portal.kernel.nio.intraband.blocking  
com.liferay.portal.kernel.nio.intraband.cache  
com.liferay.portal.kernel.nio.intraband.mailbox  
com.liferay.portal.kernel.nio.intraband.messaging  
com.liferay.portal.kernel.nio.intraband.nonblocking  
com.liferay.portal.kernel.nio.intraband.rpc  
com.liferay.portal.kernel.nio.intraband.welder  
com.liferay.portal.kernel.nio.intraband.welder.fifo  
com.liferay.portal.kernel.nio.intraband.welder.socket  
com.liferay.portal.kernel.notifications  
com.liferay.portal.kernel.oauth  
com.liferay.portal.kernel.parsers.bbcode  
com.liferay.portal.kernel.patcher  
com.liferay.portal.kernel.plugin  
com.liferay.portal.kernel.poller  
com.liferay.portal.kernel.poller.comet  
com.liferay.portal.kernel.pop  
com.liferay.portal.kernel.portlet This package defines the kernel portlet interfaces and classes.
com.liferay.portal.kernel.portletdisplaytemplate  
com.liferay.portal.kernel.process  
com.liferay.portal.kernel.process.log  
com.liferay.portal.kernel.repository  
com.liferay.portal.kernel.repository.cmis  
com.liferay.portal.kernel.repository.cmis.search  
com.liferay.portal.kernel.repository.model  
com.liferay.portal.kernel.repository.search  
com.liferay.portal.kernel.resiliency  
com.liferay.portal.kernel.resiliency.mpi  
com.liferay.portal.kernel.resiliency.spi  
com.liferay.portal.kernel.resiliency.spi.agent  
com.liferay.portal.kernel.resiliency.spi.agent.annotation  
com.liferay.portal.kernel.resiliency.spi.provider  
com.liferay.portal.kernel.resiliency.spi.remote  
com.liferay.portal.kernel.resource  
com.liferay.portal.kernel.sanitizer  
com.liferay.portal.kernel.scheduler  
com.liferay.portal.kernel.scheduler.config  
com.liferay.portal.kernel.scheduler.messaging  
com.liferay.portal.kernel.scripting  
com.liferay.portal.kernel.search  
com.liferay.portal.kernel.search.facet  
com.liferay.portal.kernel.search.facet.collector  
com.liferay.portal.kernel.search.facet.config  
com.liferay.portal.kernel.search.facet.util  
com.liferay.portal.kernel.search.messaging  
com.liferay.portal.kernel.security  
com.liferay.portal.kernel.security.jaas  
com.liferay.portal.kernel.security.pacl  
com.liferay.portal.kernel.security.pacl.permission  
com.liferay.portal.kernel.servlet  
com.liferay.portal.kernel.servlet.filters.compoundsessionid  
com.liferay.portal.kernel.servlet.filters.invoker  
com.liferay.portal.kernel.servlet.taglib  
com.liferay.portal.kernel.servlet.taglib.aui  
com.liferay.portal.kernel.servlet.taglib.ui  
com.liferay.portal.kernel.servlet.taglib.util  
com.liferay.portal.kernel.spring.aop  
com.liferay.portal.kernel.spring.context  
com.liferay.portal.kernel.spring.util  
com.liferay.portal.kernel.staging  
com.liferay.portal.kernel.staging.permission  
com.liferay.portal.kernel.struts  
com.liferay.portal.kernel.systemevent  
com.liferay.portal.kernel.template  
com.liferay.portal.kernel.template.comparator  
com.liferay.portal.kernel.templateparser  
com.liferay.portal.kernel.test  
com.liferay.portal.kernel.test.plugins  
com.liferay.portal.kernel.transaction  
com.liferay.portal.kernel.trash  
com.liferay.portal.kernel.upgrade  
com.liferay.portal.kernel.upgrade.dao.orm  
com.liferay.portal.kernel.upgrade.util  
com.liferay.portal.kernel.upgrade.v6_2_0  
com.liferay.portal.kernel.upload  
com.liferay.portal.kernel.util This package defines the kernel utility interfaces and classes.
com.liferay.portal.kernel.uuid  
com.liferay.portal.kernel.webcache  
com.liferay.portal.kernel.webdav  
com.liferay.portal.kernel.webdav.methods  
com.liferay.portal.kernel.workflow  
com.liferay.portal.kernel.workflow.comparator  
com.liferay.portal.kernel.workflow.messaging  
com.liferay.portal.kernel.workflow.permission  
com.liferay.portal.kernel.xml  
com.liferay.portal.kernel.xml.simple  
com.liferay.portal.kernel.xmlrpc  
com.liferay.portal.kernel.xuggler  
com.liferay.portal.kernel.zip  

 

Portlet Services
com.liferay.portlet This package defines the common portlet interfaces, base classes, classes, factories, and utilities.
com.liferay.portlet.announcements  
com.liferay.portlet.announcements.model  
com.liferay.portlet.announcements.service  
com.liferay.portlet.announcements.service.persistence  
com.liferay.portlet.announcements.util  
com.liferay.portlet.asset  
com.liferay.portlet.asset.model  
com.liferay.portlet.asset.service This package defines the asset portlet service local and remote interfaces, utilities, and wrappers.
com.liferay.portlet.asset.service.persistence  
com.liferay.portlet.asset.util.comparator  
com.liferay.portlet.assetpublisher.util  
com.liferay.portlet.backgroundtask.util.comparator  
com.liferay.portlet.blogs  
com.liferay.portlet.blogs.model  
com.liferay.portlet.blogs.service  
com.liferay.portlet.blogs.service.persistence  
com.liferay.portlet.blogs.util.comparator  
com.liferay.portlet.bookmarks  
com.liferay.portlet.bookmarks.model  
com.liferay.portlet.bookmarks.service  
com.liferay.portlet.bookmarks.service.persistence  
com.liferay.portlet.bookmarks.util.comparator  
com.liferay.portlet.calendar  
com.liferay.portlet.calendar.model  
com.liferay.portlet.calendar.service  
com.liferay.portlet.calendar.service.persistence  
com.liferay.portlet.documentlibrary  
com.liferay.portlet.documentlibrary.antivirus  
com.liferay.portlet.documentlibrary.model  
com.liferay.portlet.documentlibrary.service This package defines the document library portlet service local and remote interfaces, utilities, and wrappers.
com.liferay.portlet.documentlibrary.service.persistence  
com.liferay.portlet.documentlibrary.store This package defines the document library portlet store interfaces, base classes, utilities, and wrappers.
com.liferay.portlet.documentlibrary.util This package defines the document library portlet utility interfaces and classes.
com.liferay.portlet.documentlibrary.util.comparator  
com.liferay.portlet.dynamicdatalists  
com.liferay.portlet.dynamicdatalists.model  
com.liferay.portlet.dynamicdatalists.service  
com.liferay.portlet.dynamicdatalists.service.persistence  
com.liferay.portlet.dynamicdatalists.util  
com.liferay.portlet.dynamicdatalists.util.comparator  
com.liferay.portlet.dynamicdatamapping  
com.liferay.portlet.dynamicdatamapping.model  
com.liferay.portlet.dynamicdatamapping.service  
com.liferay.portlet.dynamicdatamapping.service.persistence  
com.liferay.portlet.dynamicdatamapping.storage  
com.liferay.portlet.dynamicdatamapping.storage.query  
com.liferay.portlet.dynamicdatamapping.util  
com.liferay.portlet.dynamicdatamapping.util.comparator  
com.liferay.portlet.expando  
com.liferay.portlet.expando.model  
com.liferay.portlet.expando.service  
com.liferay.portlet.expando.service.permission  
com.liferay.portlet.expando.service.persistence  
com.liferay.portlet.expando.util  
com.liferay.portlet.flags.messaging  
com.liferay.portlet.flags.service  
com.liferay.portlet.journal  
com.liferay.portlet.journal.model  
com.liferay.portlet.journal.service  
com.liferay.portlet.journal.service.persistence  
com.liferay.portlet.journal.util  
com.liferay.portlet.journal.util.comparator  
com.liferay.portlet.journalcontent.util  
com.liferay.portlet.layoutsadmin.util  
com.liferay.portlet.messageboards  
com.liferay.portlet.messageboards.model  
com.liferay.portlet.messageboards.service  
com.liferay.portlet.messageboards.service.persistence  
com.liferay.portlet.messageboards.util.comparator  
com.liferay.portlet.mobiledevicerules  
com.liferay.portlet.mobiledevicerules.model  
com.liferay.portlet.mobiledevicerules.service  
com.liferay.portlet.mobiledevicerules.service.permission  
com.liferay.portlet.mobiledevicerules.service.persistence  
com.liferay.portlet.mobiledevicerules.util  
com.liferay.portlet.passwordpoliciesadmin.util  
com.liferay.portlet.polls  
com.liferay.portlet.polls.model  
com.liferay.portlet.polls.service  
com.liferay.portlet.polls.service.persistence  
com.liferay.portlet.portletconfiguration.util  
com.liferay.portlet.portletdisplaytemplate.util  
com.liferay.portlet.ratings  
com.liferay.portlet.ratings.model  
com.liferay.portlet.ratings.service  
com.liferay.portlet.ratings.service.persistence  
com.liferay.portlet.rolesadmin.util  
com.liferay.portlet.shopping  
com.liferay.portlet.shopping.model  
com.liferay.portlet.shopping.service  
com.liferay.portlet.shopping.service.persistence  
com.liferay.portlet.shopping.util.comparator  
com.liferay.portlet.sites.util  
com.liferay.portlet.social  
com.liferay.portlet.social.model  
com.liferay.portlet.social.model.impl  
com.liferay.portlet.social.service This package defines the social related portlet service local and remote interfaces, utilities, and wrappers.
com.liferay.portlet.social.service.permission  
com.liferay.portlet.social.service.persistence  
com.liferay.portlet.social.util  
com.liferay.portlet.social.util.comparator  
com.liferay.portlet.softwarecatalog  
com.liferay.portlet.softwarecatalog.model  
com.liferay.portlet.softwarecatalog.service  
com.liferay.portlet.softwarecatalog.service.persistence  
com.liferay.portlet.softwarecatalog.util.comparator  
com.liferay.portlet.trash  
com.liferay.portlet.trash.model  
com.liferay.portlet.trash.service  
com.liferay.portlet.trash.service.persistence  
com.liferay.portlet.trash.util  
com.liferay.portlet.trash.util.comparator  
com.liferay.portlet.usersadmin.util  
com.liferay.portlet.wiki  
com.liferay.portlet.wiki.model  
com.liferay.portlet.wiki.service  
com.liferay.portlet.wiki.service.persistence  
com.liferay.portlet.wiki.util.comparator  

 

Portlet Bridges
com.liferay.util.bridges.alloy  
com.liferay.util.bridges.bsf  
com.liferay.util.bridges.common  
com.liferay.util.bridges.freemarker  
com.liferay.util.bridges.groovy  
com.liferay.util.bridges.javascript  
com.liferay.util.bridges.jsp  
com.liferay.util.bridges.mvc  
com.liferay.util.bridges.php  
com.liferay.util.bridges.python  
com.liferay.util.bridges.ruby  
com.liferay.util.bridges.scripting  
com.liferay.util.bridges.struts  
com.liferay.util.bridges.wai  

 

Other Packages
com.liferay.util  
com.liferay.util.ant  
com.liferay.util.ant.bnd  
com.liferay.util.aspectj  
com.liferay.util.axis  
com.liferay.util.bean  
com.liferay.util.cal  
com.liferay.util.dao.orm  
com.liferay.util.dao.orm.hibernate  
com.liferay.util.derby  
com.liferay.util.diff  
com.liferay.util.format  
com.liferay.util.freemarker  
com.liferay.util.jazzy  
com.liferay.util.json  
com.liferay.util.ldap  
com.liferay.util.log4j  
com.liferay.util.lucene  
com.liferay.util.mail  
com.liferay.util.poi  
com.liferay.util.portlet  
com.liferay.util.resiliency.spi.provider  
com.liferay.util.service  
com.liferay.util.servlet  
com.liferay.util.servlet.filters  
com.liferay.util.sl4fj  
com.liferay.util.spring.transaction  
com.liferay.util.transport  
com.liferay.util.xml  
com.liferay.util.xml.descriptor  
org.slf4j.impl  

 

The Liferay public API documentation describes the packages and classes used by portlet and plugin developers and provides a general overview of the API, best practices for using the API, and information about Liferay's ongoing Javadoc initiative; select the Description link below to continue reading this overview.

The Liferay Public API Documentation

This documentation includes only those classes that should be used by portlet and plugin developers. These include:

Let's condsider each of these and look at examples of each.

Portal Models and Services

The portal models (e.g. User, UserGroup, Role, ResourcePermission, ... etc.) are used throughout Liferay portal and are leveraged by portlets and plugins via services.

Example - Get a user model object from the local service:

import com.liferay.portal.service.UserLocalServiceUtil;
import com.liferay.portal.model.User;
...
User test_user = UserLocalServiceUtil.getUserByEmailAddress("test@liferay.com");

Built-in Portlet Models and Services

A host of powerful portlets are provided with Liferay. They consume portal services and have their own models and services.

Example - Subscribe to a Wiki page:

import com.liferay.portlet.wiki.service.WikiPageServiceUtil;
...
long nodeId = ParamUtil.getLong(actionRequest, "nodeId");
String title = ParamUtil.getString(actionRequest, "title");
WikiPageServiceUtil.subscribePage(nodeId, title);

The Portal Kernel and Utilities

The portal kernel acts as a bridge connecting the models and services of the portal and portlets with the application server. The kernel leverages services supporting EJB, dependency injection (Spring), a persistence framework (Hibernate), and business logic and workflow (JBPM). It provides adapters to popular languages such as PHP, Python, and Ruby. Lastly, the Liferay comes with utilities used by Liferay portal, portlets, and plugins.

Example - Retrieve the list of available locales from a localizations XML fragment:

import com.liferay.portal.kernel.util.LocalizationUtil;
...
String xml;
String[] locales = LocalizationUtil.getAvailableLocales(xml);

Find out more ...

Continue reading for further description of ...

Best Practices Interfacing with the Liferay Kernel and Built-in Portlets

The hot-pluggable nature of Liferay portlets and plugins imposes certain restrictions on the parts of the Liferay core they can access. These limitations allow for the least disruptive upgrades to both the core and plugins while also allowing the greatest flexibility in modifying core Liferay features without requiring a portal restart.

Most classes in Liferay follow a simple, but extremely important hierarchy. The public methods are defined in an interface, such as "Portal". This interface is then implemented in a class of the same name but with the suffix "Impl" appended ("PortalImpl"). A single instance of this implementation class is then stored inside a static wrapper class with the suffix "Util" ("PortalUtil").

The hierarchy of different types of classes will often diverge significantly from this paradigm (particularly for models and services), the basic structure remains the same. The reasons for this system are explained in more detail later, but the end result is that whenever possible, classes should only be referenced by their interfaces and accessed via their utilities. If you are interested in a more detailed explanation keep reading, otherwise skip to the examples section.

The first cause for this pattern is that servlet containers (such as Apache Tomcat) place the core and plugins within separate class loaders. This means that any classes shared between the two must be placed in the global class loader for the servlet container. Classes within the global class loader cannot be reloaded without restarting the servlet container, whereas classes inside servlets (such as the Liferay kernel and plugins) are monitored for changes on disk and reloaded whenever necessary. Thus, flexibility mandates that as little as possible be placed in the global class loader. However, all the functionality of the core must still be accessible within portlets.

Liferay solves this problem using the class hierarchy. All the core interfaces and utilities are placed in the global class loader, while their implementations are placed inside the portal servlet. This allows the portal to be modified in place, while still maintaining a consistent interface for plugins.

One other reason for the separation between interface, implementation, and utility is that Liferay makes extensive use of the Spring framework to the support dynamic injection and replacement of implementation classes in utilities. This means that it is possible in Liferay to completely replace many built-in classes with your own implementations at runtime. By placing core classes within a static utility wrapper, you can dynamically modify Liferay's behavior without the portal or other plugins needing to do anything.

Liferay Javadoc Initiative

Liferay has started the process of writing high quality Javadoc that follows the Liferay Javadoc Guidelines to ensure that documentation is clear, comprehensive, and helpful to you.

Not all classes have been documented, but the number of classes is growing. Some of the most significant services and classes documented that you may need are the following packages:

For more information for using, administering, and developing using Liferay, please consult the resources found at Liferay Community Resources.


Liferay 6.2-ce-ga5