Lets start with creating a demo portlet. Follow this link. If you hit any error during creation of portlet like Run-time JRE in invalid (snap).Just delete the server from work-space and create it again.
Note : Create your portlet inside the Plugin SDK folder. As per my setup “E:liferayliferay-plugins-sdk-6.1.0-ce-ga1-20120106155615760portlets” this is the folder to place portlet code,otherwise you won’t able deploy with ant build script.
Deploying Portlet into Liferay.
==> You can manually deploy using the information provided at this link
==> Deploying portlet by using build script. read below
- Right Click on build script and run the “Deploy Task”
- Unfortunately you may hit an error. saying “Task cannot continue because ECJ is not installed“. (snap) .Interesting lets fix it.
- You simply need to put the ecj.jar file into the lib directory of the Ant plugin directory in your Eclipse install
- Go to Window> Preferences> Ant> Runtime > Classpath (snap)
- Add External jar (E:liferayliferay-plugins-sdk-6.1.0-ce-ga1-20120106155615760libecj.jar) , i.e. ecj.jar located under your plugin sdk folder.
- Now Re-run the build script 🙂
Adding Your Portlet to Liferay
Login to liferay account (http://lcoahost:8080), remove all existing portlets and add yours (how to add).
Here is how it looks.
Don’t waste your time, you have many things to download, jump to this link and download liferay Server(Liferay Portal 6.1 bundled with Tomcat : approx 290 mb) and SDK(Plugin SDK : approx 15mb ) + Liferay IDE (link : approx 290) and choose IDE that suites you.You can skip Liferay IDE download if you have eclipse installed (Configure with this link ).
Note : You must have jdk 1.6 installed in your machine and should be configured with your IDE.
Extract all these downloads into one folder (say E:/liferay) .
Follow this link to setup Liferay Server and SDK in your IDE.
Great ! You have successfully installed liferay environment .
Follow here to start your liferay.Jump to localhost (http://localhost:8080) and I hope you like liferay face 🙂
- Click on “Finish Configuration” and wait till the completion of background process.
- “Go to My Portal” Now you on Liferay Default Page.
- Click on “Sign in ” present towards left top
- Log in with id – firstname.lastname@example.org password – test , then you will be prompted for change password and Password Hint. Do it.
- Congratulation! You are now logged in as liferay admin,go and play with UI (explore more).