Liferay is open source portal. Its source is freely available.Sometimes we need to refer of liferay source during development. Its convenient if we can configure Liferay source in eclipse.
- You need to refer Liferay class
- You are writing Liferay hook plugin and you want to override existing JSP.
- You want to debug existing Liferay classes in debug mode to understand the flow.
- You wan to see out of the box properties defined in portal.properties file
So let us see how to do it.
Configure Liferay Source
STEP 1. Right click at package / project explorer and choose Import.
STEP 2. Click on Existing Projects into Workspace.
STEP 3. Point the directory where you unzip liferay source from Browse button.
STEP 4. Once its imported, it will be available in project / package explorer in eclipse.
Brief about Liferay source
- definitions folder
- contains all dtd
- contains all liferay implementation java classes. They resides in portal-impl.jar under tomcat/webapps/Root/WEB-INF/lib folder at runtime.
- These classes are not accessible to portlets directly.
- all unit test cases for implementation classes
- Contains all liferay service java classes. They resides in portal-service.jar under tomca/lib/ext folder
- These classes are accessible to any plugin (Portlet, hook, theme etc)
- all unit test cases for service classes
- Contains all liferay utility classes
- Contains all portal / portlet jsp
- Contains all layout template used in liferay out of the box
- Contains portlet and liferay specific configuration files like portlet.xml, liferay-portlet.xml, struct-config.xml etc.
- Contains DB scripts for out of the box liferay functionality.
and its done. It’s good practice to configure Liferay source when you do development so that whenever you need to refer any out of the box code, it is readly available.
Feel free to ask questions / Suggestions
I would recommend looking at index page ‘A Complete Liferay Guide‘ to browse all topics about liferay.