Saturday, 25 October 2014

ECJ solution in Liferay eclipse

ECJ solution in Liferay eclipse

When we use JDT compiler in eclipse then It will expect ecj.jar should be available in global ant runtime path.

So we need to add ecj.jar file to ANT global class path as follows

Go to eclipse windows preferences


Select ANT run time as follows




Now add jar file to ant global class path. Select external jar file button then browsecj.jar file

Note:

ecj.jar file available in Plugins SDK lib directory (liferay-plugins-sdk-6.2.0/lib)



Thursday, 23 October 2014

Liferay intalation

Getting Started with Liferay IDE
  1. Getting Started with Liferay IDE
    1. Introduction
    2. Requirements
    3. Liferay Plugins SDK Setup in Eclipse
    4. Liferay Tomcat Server Setup
    5. Testing/Launching Liferay Tomcat Server
    6. Creating New Liferay Projects
    7. Deploying New Liferay Projects to Liferay Server
Introduction
NOTICE If you are using Liferay Developer Studio, please note there is a more appropriate tutorial for getting started with that product located here: Getting Started with Liferay Developer Studio
Liferay IDE is an extension for the Eclipse platform that supports development of plug-in projects for the Liferay Portal platform. Its available as a set of Eclipse plug-ins installable from an update-site. The latest version supports developing 5 Liferay plug-in types: portlets, hooks, layout templates, themes, and EXT-style plug-ins. Liferay IDE requires the Eclipse Helios Java EE developer package.
Requirements
Before getting started:
  1. Liferay Portal 6.0 (6.0.5 or greater) downloaded and unzipped
  2. Liferay Plug-ins SDK 6.0 (6.0.5 or greater) downloaded and unzipped
  3. Eclipse Helios Java EE for developers + Liferay IDE – see the Liferay IDE Installation Guide for more information.
Note: earlier versions of Liferay, e.g. 5.x, are not supported yet by the Liferay IDE
Liferay Plugins SDK Setup in Eclipse
Before you can begin creating new Liferay plug-in projects, a Liferay Plug-ins SDK and Liferay Portal must be installed and configured in the IDE.
  1. Open Eclipse with Liferay IDE installed.
  2. Open Preference page for Liferay > Installed SDKs (Go to Window > Preferences > Liferay > Installed SDKs)

    http://127.0.0.1:49958/help/topic/com.liferay.ide.eclipse.doc/help/gettingstarted/images/lide_getting_started_1.png
  3. Add your SDK using the Add button which brings up the Add SDK Dialog.

    http://127.0.0.1:49958/help/topic/com.liferay.ide.eclipse.doc/help/gettingstarted/images/lide_getting_started_3.png
  4. Browse to the location of your Plug-ins SDK installation.
  5. The default name is the name of the directory but you can change it if you wish.
  6. Select OK and you should see your SDK in the list of Installed SDKs.

    http://127.0.0.1:49958/help/topic/com.liferay.ide.eclipse.doc/help/gettingstarted/images/lide_getting_started_4.png
Note: Multiple SDKs can be added to the preferences but you will need to select at least one SDK to be the default which is represented by the SDK that has the checkbox selected.
Liferay Tomcat Server Setup
  1. In Eclipse open the Runtime environments preference page (Go to Window > Preferences > Server > Runtime environments)

    http://127.0.0.1:49958/help/topic/com.liferay.ide.eclipse.doc/help/gettingstarted/images/lide_getting_started_5.png
  2. Click Add to add a new Liferay runtime and find Liferay v6 Tomcat under the Liferay, Inc. category and click Next.

    http://127.0.0.1:49958/help/topic/com.liferay.ide.eclipse.doc/help/gettingstarted/images/lide_getting_started_6.png
  3. Click Browse and select the location of the liferay-portal-6.0.x directory.

    http://127.0.0.1:49958/help/topic/com.liferay.ide.eclipse.doc/help/gettingstarted/images/lide_getting_started_8.png
  4. Once you have selected the Liferay portal directory if it has a bundled JRE then that bundled JRE will be automatically selected as the JRE to use for launching the server. However, if there is no bundled JRE (Mac and Linux users) then you will need to select the JRE to use for launch.

    http://127.0.0.1:49958/help/topic/com.liferay.ide.eclipse.doc/help/gettingstarted/images/lide_getting_started_8a.png
  5. Click finish and you should see the Liferay portal runtime in the list of runtimes in the preference page.

    http://127.0.0.1:49958/help/topic/com.liferay.ide.eclipse.doc/help/gettingstarted/images/lide_getting_started_9.png
  6. Click OK to save the runtime preferences.
  7. If you didn’t choose to create a server you will need to create one from the servers view before you can test the server.

    http://127.0.0.1:49958/help/topic/com.liferay.ide.eclipse.doc/help/gettingstarted/images/lide_getting_started_9a.png
  8. Find the Liferay, Inc category and select the Liferay v6 Server and choose the Liferay v6 Runtime that you had previously created.

    http://127.0.0.1:49958/help/topic/com.liferay.ide.eclipse.doc/help/gettingstarted/images/lide_getting_started_9b.png
Testing/Launching Liferay Tomcat Server
  1. Once your Liferay Portal Server setup is complete you can launch the server from the servers tab of Eclipse. Simply select the server and then click on the green “Start the Server button.” Once the server is running a red “Terminate” button will appear which you can use to stop the server.

    http://127.0.0.1:49958/help/topic/com.liferay.ide.eclipse.doc/help/gettingstarted/images/lide_getting_started_10a.png

    http://127.0.0.1:49958/help/topic/com.liferay.ide.eclipse.doc/help/gettingstarted/images/lide_getting_started_10b.png
  1. Alternatively, you can start/stop the server by selecting “Run” or “Terminate” from the Run menu of Eclipse.
  2. Once the server is finish launching you can open the portal home from the context menu of the Liferay Tomcat server in the Servers view:

    http://127.0.0.1:49958/help/topic/com.liferay.ide.eclipse.doc/help/gettingstarted/images/lide_getting_started_10c.png
Creating New Liferay Projects
  1. Now that an SDK and portal server have been configured you can create a new Liferay plug-in project. Go to File > New Project... > Liferay > Liferay Plug-in Project.

    http://127.0.0.1:49958/help/topic/com.liferay.ide.eclipse.doc/help/gettingstarted/images/lide_getting_started_11a.png
  2. In the Liferay project wizard page, the newly configured SDK and Liferay Runtime should be pre-selected. Also the plugin type “portlet” is the default. Simply time in a project name and corresponding display name and click Finish.

    http://127.0.0.1:49958/help/topic/com.liferay.ide.eclipse.doc/help/gettingstarted/images/lide_getting_started_12a.png
  3. If it worked you should see a new plugin project in the package explorer.

    http://127.0.0.1:49958/help/topic/com.liferay.ide.eclipse.doc/help/gettingstarted/images/lide_getting_started_13a.png
Deploying New Liferay Projects to Liferay Server
  1. Now with the newly created project, right-click the Liferay Server in the Servers view and select “Add and Remove...”

    http://127.0.0.1:49958/help/topic/com.liferay.ide.eclipse.doc/help/gettingstarted/images/lide_getting_started_14a.png
  2. Select the new project and click “Add” to move it to be deployed to the server.

    http://127.0.0.1:49958/help/topic/com.liferay.ide.eclipse.doc/help/gettingstarted/images/lide_getting_started_14b.png

    and then click "Finish"
  3. You should see the project get deployed to Liferay Tomcat server and in the console see a message about 1 new portlet being available:

    http://127.0.0.1:49958/help/topic/com.liferay.ide.eclipse.doc/help/gettingstarted/images/lide_getting_started_14c.png
  4. Open Liferay Portal Home http://localhost:8080/ in most cases
  5. Log in with test account:
    1. user is test@liferay.com
    2. password is test
  6. Click Add > More...
  7. Expand the Sample category and click the “Add” click next to the “Demo” application
  8. You should see the correctly deployed portlet on the page

    http://127.0.0.1:49958/help/topic/com.liferay.ide.eclipse.doc/help/gettingstarted/images/lide_getting_started_15a.png