Wednesday, September 7, 2011

liferay-portlet.xml configuration

Share |
You can find liferay-portlet.xml file located at <PORTLET Project Directoy>/docroot/WEB-INF/liferay-portlet.xml. Following is sample portlet.xml file form sample portlet project
liferay-portlet.xml


 
<?xml version="1.0"?>
<!DOCTYPE liferay-portlet-app PUBLIC "-//Liferay//DTD Portlet Application 6.0.0//EN" "http://www.liferay.com/dtd/liferay-portlet-app_6_0_0.dtd">

<liferay-portlet-app>
    <portlet>
        <portlet-name>hello-word</portlet-name>
        <icon>/icon.png</icon>
        <instanceable>true</instanceable>
        <header-portlet-css>/css/main.css</header-portlet-css>
        <footer-portlet-javascript>/js/main.js</footer-portlet-javascript>
        <css-class-wrapper>hello-word-portlet</css-class-wrapper>
    </portlet>
    <role-mapper>
        <role-name>administrator</role-name>
        <role-link>Administrator</role-link>
    </role-mapper>
    <role-mapper>
        <role-name>guest</role-name>
        <role-link>Guest</role-link>
    </role-mapper>
    <role-mapper>
        <role-name>power-user</role-name>
        <role-link>Power User</role-link>
    </role-mapper>
    <role-mapper>
        <role-name>user</role-name>
        <role-link>User</role-link>
    </role-mapper>
</liferay-portlet-app>



Following are descriptions for various elements of liferay-portlet.xml


portlet-name - The portlet-name element contains the canonical name of the portlet. This needs to be the same as the portletname given in portlet.xml

icon - Path to icon image for this portlet.

instanceable - Indicates if multiple instances of this portlet can appear on the same page.

headerportlet-css - The path to the .css file for this portlet to be included in the <head> of the page

footerportletjavascript - The path to the .js file for this portlet, to be included at the end of the page before </body>
Share |

No comments:

Post a Comment