Perficient Portal Solutions Blog

Subscribe to RSS feed

Archives

Follow Portals and Social Business on Pinterest

Now you can generate portlets using XMLPF

XMLPF stands for XML Portlet Factory and is an open source tool that can build Liferay portlets from XML definition files.  The software creates database CRUD portlets based on the definitions contained in an XML file.  Here is a link to the project website: http://www.xmlportletfactory.org/

 

An example portlet is shown to the right.  XML Portlet Factory generated the entire user interface, made connections to the database and created the table of results.    While the user interface is not bad, you can go into the generated portlet code and make changes to the files directly.  However, once you make changes to the generated portlet, your changes are not reflected back into XML Portlet Factory.

Documentation on the project site is pretty good and installation is a breeze.  Here is a link to the documentation wiki: http://www.xmlportletfactory.org/web/guest/wiki  The system comes with ANT scripts to build the portlet and automatically deploy it to Liferay.

Below is a snippet of the XML file used to generate the portlet:

<classDef>

	<name>Users</name>
	<title>Users Maintenance</title>
	<mode>
        	<add>true</add>
		<delete>true</delete>
		<modify>true</modify>
		<browse>true</browse>
	</mode>
</classDef>
<fileDef>
	<name>users</name>
	<fields>
		<field>
		<name>usersId</name>
		<title>Id</title>
		<type>
			<long>
			<length>5</length>
			<signed>false</signed>
			<nullable>false</nullable>
			<order>true</order>
			</long>
			</type>
		<showFieldInView>true</showFieldInView>
		<required>true</required>
	</field>
...

Note:You may have heard of Portlet Factory in conjunction with IBM WebSphere Portal.  XML Portlet Factory is not that product.  IBM’s product has been renamed to Web Experience Factory.

Tags: , , , ,

Leave a Reply