1) Go to File → New → Liferay Project
2) Next, go through the following steps to setup your new portlet:
- Fill in the Project and Display names with my-greeting-portlet and My Greeting, respectively
- Select the Liferay Plugins SDK and Portal Runtime that you’ve configured
- Select Portlet as your Plugin type
- Click Finish
Deploying the Portlet
Liferay provides a mechanism called auto-deploy that makes deploying portlets (and any other plugin types) a breeze. All you need to do is drop the plugin’s WAR file into a directory and the portal will take care of making any necessary changes specific to Liferay and then deploy the plugin to the application server.
To deploy in Eclipse - Simply drag your portlet project onto your server. Upon deploying your plugin, your server will output messages indicating that your plugin was read, registered and is now available for use.
Reading plugin package for my-greeting-portlet Registering portlets for my-greeting-portlet 1 portlet for my-greeting-portlet is available for use
If at any time you need to redeploy your portlet while in Developer Studio, right click your portlet located underneath your server and select Redeploy.
You should get a BUILD SUCCESSFUL message, which means that your portlet is now being deployed. If you switch to the terminal window running Liferay, and wait for a few seconds, you should see the message 1 portlet for my-greeting-portlet is available for use. If not, something is wrong and you should double-check your configuration.
Go to your web browser and login to the portal as explained earlier. Then, hover over Add at the top of the page, and click on More. Select the Sample category, and then click Add next to My Greeting. Your portlet should appear in the page below.
No comments:
Post a Comment