Portlet Development with Tomcat and Eclipse - eclipse

I'm starting to learn some portlet development. I'm wondering if there are any good (preferably recent since many of the guides I saw date back a few years) Hello Portlet or beginners guides. I have eclipse set up but I'm not sure what plugins/libraries/etc I need to start developing portlets for a Tomcat server.
Any help would be appreciated!

Liferay Portal (open source portal) has a set of eclipse plugins called Liferay IDE. If you set it up and also setup a Liferay Plugin SDK (zip download), then use the New Liferay Project wizard after installing the Liferay IDE plugins you will have everything you need. You can see the Liferay IDE Getting Started guide for how to deploy your first portlet to Liferay.

Related

Not able to create Liferay Plugin Project in Eclipse

I am new to liferay and i am trying to create a new Liferay Plugin Project.
I did a right click on package explorer and clicked on 'New Liferay Plugin Project'.
After that i entered the Project and Display name then i selected the Liferay MVC as my portlet framework and i clicked finish.
As soon i click on finish, it shows "Error creating Liferay Plugin Project: Please see eclipse error log for the details".
After this i changed ivy.jar.url in build.properties file from "http://repo1.maven.org/maven2/org/apache/ivy/ivy/2.3.0/ivy- 2.3.0.jar"
to "=C:\Rahul13615\liferay\plugins.ivy\ivy-2.3.0.jar".
I did and still i am getting the same error.
Maybe it's not exact answer to your question, but for Liferay 6.2 development I recommend using Apache Maven 3 as build tool.
Download Maven separately https://maven.apache.org/ and install.
Then at command line run command (https://dev.liferay.com/develop/tutorials/-/knowledge_base/6-2/creating-liferay-maven-plugins-from-the-command-lin)
mvn archetype:generate -DarchetypeCatalog=https://repository.liferay.com/nexus/content/groups/liferay-ce
and choose desired plugin through wizard.
After that import that project as an Maven project to Eclipse IDE.
As you mentioned that you are new to Liferay development I recommend offical Liferay documentation but instead of Liferay MVC I recommend Spring MVC Portlet due to bigger community and documentation. Resources related to Spring development in Liferay couldn't be found at official Liferay documentation so it's better to Google for blog articles etc. I develop at Liferay 6.2, Spring, Spring Webflow, Spring MVC, Thymeleaf, Maven stack and I have few articles related to problems which I came across at my blog http://lukasgrygar.com
Office Network not allowed(Blocking) to create new liferay workspace Project
We are facing some issues while trying to create new workspace in Liferay, When we are in Office network it fails. It's not accepting to auto download eclipse liferay projects's plugins. These repository sites are giving errors on eclipse connection time out.
Note: when we are in Citrix VM or open networks it works perfectly. Browser able to reach, If you hit below mentioned URL in browser.. But Its failing to reach at Eclipse level. https://cdn.lfrs.sl/repository.liferay.com/nexus/content/groups/public/com/liferay/com.liferay.gradle.plugins.workspace/1.5.0/com.liferay.gradle.plugins.workspace-1.5.0.pom
Eclipse Version:Eclipse neon
Liferay Version:7.1

Liferay portlet development on JBoss AS 6

I am trying to create a new Portlet project (basically a portlet for Liferay) in Eclipse (Helios with Liferay SDK installed). I use JBoss AS 6.10.final and Liferay 6.05.
The problem is that everytime I try to create new portlet, it asks me for Runtime Enviroment. I want this enviroment to be JBoss AS, but Eclipse only suggests different Tomcat distributions. I dont have Tomcat bundle installed and I am not going to since it will run on JBoss AS.
Liferay is already installed on JBoss and running (when I start the JBoss AS, I can access the liferay portal page - it has all jars and wars on correct places in AS).
I havent found any tutorial how to make this work. Could someone perhaps provide some step by step guide or direct me to any existing one? Thank you!
PS: I hope that my question is not too confusing, if so, I will try to edit it and make myself clearer...
I have finally figured it out:
I changed the build.username.properties file
app.server.portal.dir=c:\\Programs\\jboss-6.1.0.Final-ESB-4.12\\server\\default\\deploy\\liferay-portal-6.0.5.war
app.server.lib.global.dir=c:\\Programs\\jboss-6.1.0.Final-ESB-4.12\\common\\lib
app.server.deploy.dir=c:\\Programs\\jboss-6.1.0.Final-ESB-4.12\\server\\default\\deploy
app.server.type=jboss
app.server.dir=c:\\Programs\\jboss-6.1.0.Final-ESB-4.12
so it points to the directory with liferay war files. Then I had to check in Eclipse that I do not want this file to be overwritten again and it works just fine. I can deploy all projects to JBoss using Liferay SDK!

Tutorial for creating own portlet in liferay with eclipse

I want to create My Own Portlet With the Eclipse JUNO for Liferay. I have googled a lot but that's provide me only for using with netbeans so can anyone guide me or give me link of the tutorial for the creating portlet from scratch in eclipse.
I have tried with the following
ADD-> new Liferay Projects
And then its not showing in a liferay the portlet which i have created
I have successfully installed liferay in my windows7 as well as i have also integrated ready made books portlet but just having while creating simple hello world portlet of my own
very before i have even follow this link http://www.youtube.com/watch?v=-EbyIbMWrCI
but its showing my portlet in update manager option in admin account as a status is "UNKNOWN"
For creating a portlet at Eclipse please have a look at Liferay development in Eclipse .
For getting ready portlet visible on Liferay you could find instructions for example on this: How to deploy portlets to Liferay?
Here is the installation guide and getting started tutorial.

How to develop Liferay project in Eclipsce juno and built it on on Jboss

I have downloaded the Liferay 6.1 with jboss 7.1.1 Bundle and Liferay IDE(Eclipsce Juno).All I have to do is to develop Liferay Project and running it on Jboss server.
I can able to run and open liferay portal in localhost:8080/
I am having issues in developing Liferay portal project.As default server adapter for Liferay in IDE is Tomcat 7.0 and I couldn't able to find Jboss server adapter.I tried by running and deploy it on Tomcat and running the Jboss server by running standalone.bat file.
Please advise and help in develop and running Liferay project on Jboss
There's guide in Liferay Wiki about developing with non-Tomcat Liferay bundles. There you can read about the disadvantages of that kind of development and how to do it if you still want.
But I agree, developing with Tomcat is definetely the better idea.
Liferay IDE is meant for development with Tomcat only since tomcat's start-up time, its simple structure and comparatively easy configuration makes it ideal for a development environment.
If you are development plugin projects like themes, portlets, hook, layouts etc then if it works on tomcat it would work on any other server running with Liferay, so during development you can use tomcat and then when you have completed your development iteration (i.e. when your project is ready to be deployed for testing or for stage environments) you can deploy the WAR to Jboss for testing and can do some testing to see if it works fine.
Since the plugins are made in such a way as to be independent of the underlying Server, there should not be any issues developing them on Tomcat and then running them on Jboss.
Hope this helps.
I achieved it through a work around, steps mentioned # https://www.liferay.com/community/forums/-/message_boards/message/17864836
Benefits of Liferay IDE plugin+ JBoss as runtime configured in IDE.
Only issue is you'll need to use any other eclipse based IDE which supports JBoss AS 7.1.1 as normal server/runtime (like JBoss Developer Studio).

Is it possible to integrate Glassfish support into Liferay IDE yet?

I am looking for a bit of Liferay/Glassfish assistance here.
I am currently using a Liferay 6.0.6 portal running on Glassfish 3.0.1 and developing in Eclipse 3.7 (Indigo). I have downloaded the Liferay IDE for Eclipse as well.
The trouble I am having is in actually developing in Eclipse against a Glassfish server. I cannot create an actual Liferay project in Eclipse because the wizard requires me to specify a Liferay-Tomcat runtime environment.
Now I realize that this is the only server that is supported for the Liferay IDE as it is clearly documented in multiple places on the Liferay website and various forums around the web. However, I seem to recall one site (which, of course, I didn't bookmark :/ ) that gave instructions on a workaround for using Glassfish within the Liferay IDE. I believe it had something to do with creating the initial project as a Tomcat project, then going behind the scenes and changing some configuration files' Tomcat references to point to my Glassfish server.
I have set up my Liferay SDK environment correctly, including the build.username.properties file. I have this file pointing to my Glassfish server.
#
# Specify the paths to an unzipped Glassfish bundle.
#
project.dir=C:\\DEV\\myworkspace
app.server.type=glassfish
app.server.dir=${project.dir}\\..\\bundles\\liferay-portal-6.0.6\\glassfish-3.0.1
app.server.deploy.dir=${app.server.dir}\\autodeploy
app.server.lib.global.dir=${app.server.dir}\\domains\\domain1\\lib
app.server.portal.dir=${app.server.dir}\\domains\\domain1\\applications\\liferay-portal
However, everytime I try to do a deploy through Eclipse...
...this build.username.properties file gets overwritten with Tomcat settings from the runtime environment.
app.server.type = tomcat
app.server.dir = C:\\DEV\\bundles\\liferay-tomcat-6.0.6\\tomcat-6.0.29
app.server.deploy.dir = C:\\DEV\\bundles\\liferay-tomcat-6.0.6\\tomcat-6.0.29\\webapps
app.server.lib.global.dir = C:\\DEV\\bundles\\liferay-tomcat-6.0.6\\tomcat-6.0.29\\lib\\ext
app.server.portal.dir = C:\\DEV\\bundles\\liferay-tomcat-6.0.6\\tomcat-6.0.29\\webapps\\ROOT
Is there somewhere else that I need to make a change in order to get Eclipse to recognize my Glassfish server?
Any help or tips would be greatly appreciated.
It is not currently possible to use a Liferay+Glassfish bundle directly as a runtime or server adapter in Eclipse with the Liferay IDE plugins. As you pointed out the only runtime and server adapters for Liferay IDE are the tomcat bundles. However, you can still use Liferay IDE to develop with Glassfish by using the following receipe with version 6.0.6 and current version of Liferay IDE.
Download Liferay+tomcat bundle
Configure it as a Liferay runtime
Create the project pointing to Liferay runtime
Go to Window > Preferences > Liferay > Installed SDKs, switch "update build.properties" option to Never
Launch Glashfish externally using startup script
Modify the build.properties in your SDK to point to Glasshfish as runtime
For deployment use the SDK deploy action just as you showed and it should be deployed to glassfish.
This should work for now. In the future, we will be adding support for Glassfish server to our Server Manager plugin that can be using with Liferay IDE and Liferay 6.1 for remote deployment and development, so it will work just like a local tomcat instance except it will be remote Liferay running on glassfish or jboss, or whatever you like. But right now the Server manager plugin in 6.1 beta4 only supports Tomcat6/7 and Jboss7. We hope to add Glassfish very soon.