Now, I'm still in the process of refining the method but here's a quick and dirty approach. You just have to remember:
Google Web Toolkit
*This should work on Liferay 5 as well but I haven't tried it.
First, if you're an experienced GWT developer then you already know how to build and compile your code. If you aren't, complete this tutorial first.
Once you've "compiled" your GWT project you'll need an empty Liferay portlet project to transplant your GWT project into. Go ahead and create one using the Liferay SDK.
Now that you have your empty Liferay portlet and your compiled GWT project, you have everything you need.
Suppose our project is called SuperPortlet.
- Copy your war/WEB-INF/appengine-web.xml and war/WEB-INF/logging.properties files into the empty portlet's WEB-INF folder.
- Copy your /SuperPortlet folder into the empty portlet's /docroot folder.
- Copy your SuperPortlet.css and SuperPortlet.html files into the portlet's docroot folder.
- Rename SuperPortlet.html to view.jsp
- In your view.jsp file, there are a few tags that need to go away. In portlets we don't need <html>, <body>, <title> or <head> tags. Blow them away.
- You don't need the <link> or <script> tags either. We're going to specify our .css and .js files elsewhere.
- Add this to the top of your view.jsp file:
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
- Now, open your liferay-portlet.xml file.
- In the <header-portlet-css> tag, add the path to the .css file. In this case the line would look like this:
*Note: This assumes the .css file is in the /docroot folder. If you have a subfolder with your .css just put it there and be sure the path is defined correctly in the above tag.
Again, adjusting that file path depending on how you organize your portlet.
Be sure to copy over any images or other .css and .js files you have (defining each in its own separate tag in the liferay-portlet.xml file) and you should be ready to rock & roll. I did this in Eclipse and exporting the project to a .war file gave me a deployable .war that worked great.