Saturday, July 27, 2013

How to create user library in Eclipse

User library allowed us to create reusable/shared libraries in Eclipse that can be used in multiple projects within the same workspace.

Steps:

Creating a User Library

1. Go to User Libraries
Window > Preferences > Java > Build Path > User Libraries

Wednesday, July 24, 2013

Reading and writing date value in excel with Apache POI

This post shows the code snippet on how to read and write java.util.Date object to an excel.
Writing date into excel is easy; 
Reading date value from excel we must make sure the cell type is date to avoid exception.

Reading date value from excel file

Cell cell = row.getCell(i);
Date dateValue = null;
if(cell.getCellType() == cell.CELL_TYPE_NUMERIC) {
    if (DateUtil.isCellDateFormatted(cell)) {
        dateValue = cell.getDateCellValue();
    }
}

Sunday, July 21, 2013

How to access Liferay Local Service API

Other than accessing Liferay Service through web service, Liferay provides local API as well for Liferay Portlet developers to access Liferay information locally.

To know more about what local services  Liferay exposed, please refer the javadoc.

This post will show a simple example on how to access Liferay local service.

Requirement:
1. Liferay Development environment has been setup.
2. Portlet created in Liferay

Accessing Liferay Web Service with Liferay Portal Client

During development, Liferay developers might want to access to Liferay information, eg, user details.
But it is not suppose to access to Liferay database directly.
thus, Liferay exposed a list Web Services for us to access through Liferay Portal Client

Liferay's services could be accessed through local API, for more details, please refer here.

Requirement:
1. Liferay Portal 6.1.1 ga2
2. Liferay Portal Client 6.1.1 ga2
3. Eclipse Juno
4. Liferay Development environment has been setup

Wednesday, July 17, 2013

How to create multiple lines message p:tooltip

From the PrimeFaces online demo, showing the usage of <p:tooltip /> component.
But all the samples displaying only single line message.
p:tooltip demo

Sometimes, the system requirements might need to display the message in multiple lines instead of just a long single line message.

this could be achieved by putting in a <h:panelGroup /> into the <p:tooltip /> component.
Then all content could be put inside the panelGroup, eg, <p:panel />, <p:graphicImage />, etc.

LinkWithin

Related Posts Plugin for WordPress, Blogger...