An use of single tag can provide you many predefined objects in your JSP. For liferay developer one most widely used tag is theme:defineObjects. It does not have any body and attributes.An use of this tag gives a certain numbers of ready to use objects in your JSP. This article explains the various objects provided by this tag. For liferay beginners this article can be a good reference.
How to use this tag: Your JSP should have only two lines of code.
<%@ taglib uri="http://liferay.com/tld/theme" prefix="theme" %> <theme:defineObjects/>
Use of this tag provides the following ojects in your JSP
To get the current User object you can use this object.
Java provides time zone. To get current user’s time zone we can use this object.
A runtime object which contains many useful items such as the logged-in user, the layout, logo information, paths, and much more.
This object represents the current theme that is being rendered by the portal.
By default this object contains the groupId for the community or organization in which the portlet resides.
When an administrator is impersonate a user, this variable tracks the administrator’s User object.
An object that gives the programmer access to many attributes of the current portlet including the portlet name, the portlet mode, the ID of the column on the layout in which it resides and more.
Every page in liferay has unique ID.This is called portal layout ID. This is a unique identifier for any page that exists in the portal across all portal instances.
An object that can determine-given a particular resource-whether the current user has a particular permission for that resource.
The current user’s locale which is defined by Java.
This object can be used programmatically to add or remove portlets from a page.
The layout object represents the page to which the user has currently navigated.
This is user’s Contact object. This object maps to the Contact table in the Liferay database.
The current Company object. This represents the portal instance on which the user is currently navigating.
An object representing the current color scheme in the theme that is being rendered by the portal.
The user’s Account object. This object maps to the Account table in the Liferay database.
The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.