Description

This was created as a result of LPS-5203. Tomas Polesovsky showed a really cool idea of how to make the Ext environment smaller. His idea was to create an "extlet". The actual implementation uses many of the same ideas with slight changes.

We created a new plugin type called "ext". So besides portlets, themes, layout templates, and hooks, you can now also create an "ext" plugin.

I've attached two samples, the first is "hello-world-ext.zip" which is the project files I used to create "hello-world-ext-5.3.0.1.war".

Use the latest /portal/trunk and /plugins/trunk as of rev 42007.

Unzip hello-world-ext.zip into "/plugins/trunk/ext" to see my project files. I basically created an ext that modified every possible piece of Liferay's core. This is actually more powerful than the old Ext environment because it provides for a standard for updating util-java, util-taglib as well (which didn't exist before).

You can unzip hello-world-ext (to see my project) or go to /plugins/trunk/ext and execute:

ext-web/docroot contains code that will override portal-web. Note that if you modify ext-web/docroot/WEB-INF/web.xml, those changes are merged into portal-web/WEB-INF/web.xml.

ext-web also contains /WEB-INF/*-ext.xml files that are used to override what is in portal-web.

It works very similarly to the old ext environment, but is now much smaller and lighter weight because the ext env itself did not have to contain the whole portal code, but now only contains the differences / deltas.

When you go to /plugins/trunk/ext/hello-world-ext, you should first run "ant clean"

If you run this task without setting up your environment variables, it'll give you a nice error message that looks like this:

The properties "app.server.dir", "app.server.zip.name", and "ext.work.dir" are
not properly specified.

The directory denoted by the property "ext.work.dir" will be deleted and the zip
file denoted by the property "app.server.zip.name" will be unzipped into this
directory. The property "app.server.dir" must point to the application server
directory that was unzipped into "ext.work.dir".

For example, if "ext.work.dir" points to "C:\ext-work", and
"app.server.zip.name" points to "C:\files\liferay-portal-tomcat-6.0-5.3.0.zip",
then "app.server.dir" should point to
"C:\ext-work\liferay-portal-5.3.0\tomcat-6.0.18".

—

Configure the proper settings and running "ant clean" will take a fresh bundle and unzip it for you. Once 5.3.0 is released, you can just download the bundle. To currently build a bundle, go to /portal/trunk and run "ant all" and then "ant -buildfile build-dist.xml zip-tomcat-6.0" and it'll make the zip file in /portal/dist/liferay-portal-tomcat-6.0-5.3.0.zip

Running "ant compile" in /plugins/ext/hello-world-ext will now compile all the necessary ext code.

Activity

More work will be done to allow multiple "ext" plugins to work in an environment (as suggested by Tomas to me in a different email).

Quoting him:

"In my company I use extlets because of one important feature - there can be more extlets in one running Liferay instance. We use extlets like some type of plugins (reusable component). We want extlets to be downloadable from SW Catalog to use it on multiple customer projects. "

Brian Chan
added a comment - 04/Dec/09 8:45 AM - Restricted to More work will be done to allow multiple "ext" plugins to work in an environment (as suggested by Tomas to me in a different email).
Quoting him:
"In my company I use extlets because of one important feature - there can be more extlets in one running Liferay instance. We use extlets like some type of plugins (reusable component). We want extlets to be downloadable from SW Catalog to use it on multiple customer projects. "

Thanks, it worked for me. Actually the real problem is to find out what is the logic behind those ant scripts. What actions do they perform besides compiling and jar'ing ext-* classes? What do those magical empty dependencies/jars mean?

Andrius Kurtinaitis
added a comment - 24/May/10 9:07 AM Thanks, it worked for me. Actually the real problem is to find out what is the logic behind those ant scripts. What actions do they perform besides compiling and jar'ing ext-* classes? What do those magical empty dependencies/jars mean?