Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Adrien Olivier
override 'com.liferay.portlet.assetpublisher.action.Configuration
March 28, 2011 8:09 AM
Answer

Adrien Olivier

Rank: New Member

Posts: 2

Join Date: March 22, 2011

Recent Posts

Hi everybody,

First I use Liferay portal 6.0.6 from the tomcat bundle


I fallowed this tutorial to make 2 of my portlet communicate.


Now I try to send an event from the AssetPublisher (modified with a hook) on of my own portlet.

Thus I need to add some line of code in com.liferay.portlet.assetpublisher.action.ConfigurationActionImpl

So I created a class, in my portlet project, which extend this action class and override the method to add my codes then call the method of the super class as follow :

 1import javax.portlet.ActionRequest;
 2import javax.portlet.ActionResponse;
 3import javax.portlet.PortletConfig;
 4import com.liferay.portlet.assetpublisher.action.ConfigurationActionImpl;
 5
 6/**
 7 * Portlet implementation class NewPortlet
 8 */
 9public class PersoAssetPublisherAction extends ConfigurationActionImpl {
10
11    @Override
12    public void processAction(PortletConfig portletConfig,
13            ActionRequest actionRequest, ActionResponse actionResponse)
14    throws Exception {
15        /* my actions ...  */
16        super.processAction(portletConfig, actionRequest, actionResponse);
17    }
18
19
20}




My problem is I have this error :

1[PortletBagFactory:115] java.lang.NoClassDefFoundError com/liferay/portlet/assetpublisher/action/ConfigurationActionImpl


So I tried to put the "portal-impl.jar" in may Tomcat library folder, I also tried to add it the library folder of my portlet but in the first case it's doesn't work and in the second I have a message when I run the ant script which explain to my I cannot duplicate "portal-impl.jar".

So how can I re-write the processAction method of AssetPublisher ?

I hope it was enough clear ...

Bests,

Adrien Olivier
Jelmer Kuperus
RE: override 'com.liferay.portlet.assetpublisher.action.Configuration
March 28, 2011 2:09 PM
Answer

Jelmer Kuperus

Rank: Liferay Legend

Posts: 1190

Join Date: March 10, 2010

Recent Posts

You can only do this in an ext plugin. Your hook and the portal live in different servletcontext's and can't see each others classes, classes you define in ext-impl will be added to the classpath of portal
Adrien Olivier
RE: override 'com.liferay.portlet.assetpublisher.action.Configuration
March 29, 2011 1:32 AM
Answer

Adrien Olivier

Rank: New Member

Posts: 2

Join Date: March 22, 2011

Recent Posts

OK thank you Jelmer for this explanation, I will change my implementation.

Bests
Adrien Olivier
Elena Fernandez
RE: override 'com.liferay.portlet.assetpublisher.action.Configuration
May 24, 2012 3:55 AM
Answer

Elena Fernandez

Rank: New Member

Posts: 17

Join Date: February 7, 2011

Recent Posts

Hi everybody:

I'm trying to do exactly the same (override assetPublisher's ConfigurationAction) so after trying doing it on a hook (I'm working with liferay 6.1) I realized I couldn't do it so I created an ext-plugin.

After reading your post, I made the following:

  • Create a plugin ext
  • Create a NewConfigurationAction class extending ConfigurationActionImpl and overriding the methods I need to override
  • Modify on liferay-portlet-ext.xml, <configuration-action-class>com.liferay.portlet.assetpublisher.nuevo.action.NewConfigurationActionImpl</configuration-action-class>


Then I´ve deployed my ext plugin, but when I debug it to see every steps, nothing change, the execution doesn't take NewConfigurationActionImpl.

What am I doing wrong?
How did you do this finally?

Thank you so much!
Antoine Comble
RE: override 'com.liferay.portlet.assetpublisher.action.Configuration
July 9, 2013 8:55 AM
Answer

Antoine Comble

Rank: Regular Member

Posts: 201

Join Date: September 7, 2012

Recent Posts

Hi all,

I've the same problem.

Could you help me ?

Antoine
Antoine Comble
RE: override 'com.liferay.portlet.assetpublisher.action.Configuration
July 11, 2013 3:20 AM
Answer

Antoine Comble

Rank: Regular Member

Posts: 201

Join Date: September 7, 2012

Recent Posts

Hi all,

I've solved my issue.

i created a class ConfigurationActionImpl extending com.liferay.portal.kernel.portlet.DefaultConfigurationAction.
i copy/paste all java code from com.liferay.portlet.assetpublisher.action.ConfigurationActionImpl to my class.

i added foolowing lines in liferay-portlet-ext.xml in tomcat/webapps/ROOT/WEB-INF :
1
2<portlet>
3<portlet-name>101</portlet-name>
4<configuration-action-class>com.test.ConfigurationActionImpl</configuration-action-class>
5</portlet>


I export my project as jar containing my ConfigurationActionImpl class and put it in tomcat/lib/ext.

And it works fine !

Regards,

Antoine