• XML Configuration Files

    Posted on March 14, 2014 by Hamidul Islam in .

    XML Configuration Files 

    We should have clear understanding of below XML files before developing any portlet in Liferay.

    1) portlet.xml

    2) liferay-portlet.xml

    3) liferay-display.xml

    These three files are the backbone of liferay portlet. Lets explain each of the files


    This file basically contains portlet name, display name, portlet class, initialization parameters and many more. Some of the important tags of this file are <portlet-name/>, <display-name/>, <portlet-class>. For example

    <portlet-name>Sample Portlet</portlet-name>
    <display-name>Demo </display-name>

    The portlet-class tag may contain built in Liferay MVC Portlet or it can be our custom class. We can develop portlet by Liferay MVC or  by Spring MVC or by JSF and so on. By inspecting portlet-class tag we will be able to identify the nature of the portlet


    In this file we can define css, js files required for the portlet. We can also define whether a portlet is instanceable or not. Set the instanceable value to true if the portlet can appear multiple times on a page. If set to false, the portlet can only appear once on a page. The default value is false.

     liferay-display.xml : 

    This file is used for categorization of the portlet. We can create our own category as needed. For example

    <category name="Pro Liferay">
    <portlet id="sample" />

    Here the sample portlet will be listed in Liferay under "Pro Liferay" category.

%d bloggers like this:

By continuing to use the site, you agree to the use of cookies. more information

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.