Upgrading Your EXT Environment to an EXT Plugin

Update: Please see the official documentation here:

www.liferay.com/documentation/liferay-portal/6.0/development/-/ai/ext-plugins

Now that we have EXT Plugins, the million dollar question is what will happen to the EXT Environment?

First, let's cover the bad news. The EXT Environment will no longer exist in Liferay 6.0.

For those of you that use the EXT Environment primarily to change core code, this is a good thing because EXT Plugins handle core customizations better than the EXT Environment. You'll spend less time deploying and maintaining your changes with EXT plugins. See Introducing EXT Plugins! for more information.

For those of you (like me) that have made heavy customizations in the EXT Environment including custom portlets and services, you're probably a little nervous about this change.

 

The good news is that we have a script to help migrate your EXT Environments to EXT Plugins.

You can find the build.xml script in the Plugins SDK in trunk in the "ext" directory:
svn://svn.liferay.com/repos/public/plugins/trunk/ext

What the script does is create an EXT Plugin from the ext.zip file and merge in your changes from your EXT Environment.

Let's take a look at how this works in practice.

Assuming that your EXT Environment is located in /Users/ed/projects/ext:
(The Windows equivalent would be C:/projects/ext)

We can run the following command to migrate the code from the EXT Environment to EXT Plugins:
ant upgrade-ext -Dext.dir=/Users/ed/projects/ext -Dext.name=hello-world -Dext.display.name="Hello World"

Where:
-Dext.dir is a command line argument to the location of the EXT Environment
-Dext.name is the name of the EXT Plugin that you want to create
-Dext.display.name is the display name (See liferay-plugin-package.properties)

This will create a hello-world-ext directory with the merged changes from your EXT Environment.

Both build-service (ServiceBuilder) and build-db (DBBuilder) have been ported to EXT Plugins to allow developers to regenerate their services and SQL code in EXT Plugins:

 

But as noted in the warning message, ServiceBuilder in EXT plugins will be deprecated in future versions, and custom services should be migrated to portlet plugins. Try to migrate your custom services to portlet plugins as soon as possible as this is the recommended practice.

Additional Notes:

1. "build-services" in the above example is a custom target. You can define custom targets like this in order to make them work properly with Service Builder:

 

<target name="build-service-test">

<antcall target="build-service">

<param name="service.file" value="docroot/WEB-INF/ext-impl/src/com/test/service.xml" />

</antcall>

</target>

2. If you're using a version of Liferay that uses ext-ejb instead of ext-impl, you must first upgrade to Liferay 5.2 before migrating your code to an EXT Plugin.

 

Blogs
I have a well structured build process in 5.2 that utilizes the Service Builder tooling against generated EXT images. The extended db and SOAP services behave well, and properly support plugins that utilize the EXTed services. My EXT project configuration also supports the upgrade process that follows the db upgrade patterns implemented in the kernel. The EXT framework has proven to be a reliable and robust feature of Liferay 5.x

With 6.x, I'm concerned that I lose the level of extensibility intregration available in 5.2. It's not a matter of adapting my ant tooling to the 6.x configuration, it's a question of limitations in 6.x plugins that are not present in 5.2 EXT.

Prior to using the Service Builder in EXT, I tried adding services via the 5.x plugins framework. I recall problems with invalid db sessions related to thread contexts, and schema management issues that made the plugin approach unattractive in comparison to the EXT option.


1) Is it necessary to drop the EXT framework?

2) Will the Service Builder tooling be fully supported in 6.x?

3) Will we be able to hook into the upgrade process as possible in EXT?

4) Will tests be performed to validate DB schema extensions and the wire services extensions such as SOAP and JSON? Will the tests be available to the community?

5) Does portal-ext.properties serve any purpose in 6.x?



Related forum thread: http://www.liferay.com/community/forums/-/message_boards/message/4533829
b v j, will respond to your questions in the forum thread.
hi,can any one help me with this ..
i got this error when i tried to use this command:
:ant build-services
BUILD FAILED
Target "build-services" does not exist in the project "ext".

and also got this error when i used the above command to run DBBuilder
ie..ant build-db

build-db:
[echo]
[echo] .
[echo]
[echo] WARNING: Support for ServiceBuilder in EXT plugins will be deprecated in future
[echo] versions. EXT plugins are designed to override the portal's core code that
[echo] cannot be done with hooks, layout templates, portlets, or themes. EXT plugins
[echo] are not meant to contain new custom services. Please migrate your service.xml to
[echo] a portlet plugin.
[echo]

BUILD FAILED

,i tried to find build-parent.xml file in ext-impl,but i didnt see any such thing there ,
Can anyone let me know,how are we suppose to generate Service builder and Db builber
and also what exactly the above given sentence mean:
Both build-service (ServiceBuilder) and build-db (DBBuilder) have been ported to EXT Plugins to allow developers to regenerate their services and SQL code in EXT Plugins:
hi Srikanth,

just go and find at (plugins\themes)what is exactly in the build-common-theme.xml either "service" or "services" and then run ant command. Ex:ant build-{service or services}. I think it will resolve.

Rgds
Hi simon,
thank you verymuch ,yes there is some mistake ,it printed as Services ,but when i gave the command service ,its working
Thank you very much
I saw that this is also included to Liferay 5.2 SP3. Is the plugin mature enough on to use on 5.2 SP3 instead of old ext.
For overriding core classes and anything within the portal source code, the plugin is mature enough to use. If you're just starting to use EXT Plugins, as mentioned above, do not use it to create custom services.
Hi, Edward,

I have some problem with the ext environment upgrade in Liferay 6.0.11. It is like this:

(1)

C:\aproject\workspace\liferay-plugins-sdk-6.0-ee-sp1\ext>ant upgrade-ext -Dext.dir=C:/aproject/downloads/LR6EE-CA/trunk/ext -Dext.name
=bprjct -Dext.display.name=bprjct
...
BUILD FAILED
C:\aproject\workspace\liferay-plugins-sdk-6.0-ee-sp1\ext\build.xml:6:
The following error occurred while executing this line:
C:\aproject\workspace\liferay-plugins-sdk-6.0-ee-sp1\build-common-plug
ins.xml:4: The following error occurred while executing this line:
C:\aproject\workspace\liferay-plugins-sdk-6.0-ee-sp1\build-common.xml:
72: .

Task cannot continue because ECJ is not installed.

ECJ was automatically installed. Please rerun your task.

(2) Now I re-run the command:

C:\aproject\workspace\liferay-plugins-sdk-6.0-ee-sp1\ext>ant upgrade-e
xt -Dext.dir=C:/aproject/downloads/LR6EE-CA/trunk/ext -Dext.name
=bprjct -Dext.display.name=bprjct
Buildfile: C:\aproject\workspace\liferay-plugins-sdk-6.0-ee-sp1\ext\build.xml
upgrade-ext:
create:
BUILD FAILED
C:\aproject\workspace\liferay-plugins-sdk-6.0-ee-sp1\ext\build.xml:79:
The following error occurred while executing this line:
C:\aproject\workspace\liferay-plugins-sdk-6.0-ee-sp1\ext\build.xml:31:
bprjct-ext already exists.
Total time: 3 seconds

The fact is the "bprjct-ext/" directory is not there. However, I cannot go on anymore.

Has anybody had a similar problem?

Thanks!
Hi,

I have an Liferay 5.2.3 EXT environment that I ran the upgrade to make it a Liferay 6 EXT Plugin, without including the source code for com.ext and com.liferay.portal.service packages from 5.2.3. When I deploy, I got the following error:

WARN [PortletLocalServiceImpl:553] Portlet with the name 51 is described in liferay-portlet.xml but does not have a matching entry in po
rtlet.xml
ERROR [PortletBagFactory:118] java.lang.ClassNotFoundException: com.ext.portlet.reports.ReportsPortlet

Do I need to include the old com.ext package from 5.2.3 to build, or is there a equivalent jar in Liferay 6?

Thanks!
[...] We should not build any services inside the EXT as of Liferay 6.0. The following link may help you understand more about EXT-plugins and how they are different from the previous EXT-environment:... [...] Read More