Fórumok

override 'com.liferay.portlet.assetpublisher.action.Configuration

Adrien Olivier, módosítva 13 év-val korábban

override 'com.liferay.portlet.assetpublisher.action.Configuration

New Member Bejegyzések: 2 Csatlakozás dátuma: 2011.03.22. Legújabb bejegyzések
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 :

import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
import javax.portlet.PortletConfig;
import com.liferay.portlet.assetpublisher.action.ConfigurationActionImpl;

/**
 * Portlet implementation class NewPortlet
 */
public class PersoAssetPublisherAction extends ConfigurationActionImpl {

	@Override
	public void processAction(PortletConfig portletConfig,
			ActionRequest actionRequest, ActionResponse actionResponse)
	throws Exception {
		/* my actions ...  */
		super.processAction(portletConfig, actionRequest, actionResponse);
	}


}




My problem is I have this error :

[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
thumbnail
jelmer kuperus, módosítva 13 év-val korábban

RE: override 'com.liferay.portlet.assetpublisher.action.Configuration (Válasz)

Liferay Legend Bejegyzések: 1191 Csatlakozás dátuma: 2010.03.10. Legújabb bejegyzések
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, módosítva 13 év-val korábban

RE: override 'com.liferay.portlet.assetpublisher.action.Configuration

New Member Bejegyzések: 2 Csatlakozás dátuma: 2011.03.22. Legújabb bejegyzések
OK thank you Jelmer for this explanation, I will change my implementation.

Bests
Adrien Olivier
Elena Fernandez, módosítva 11 év-val korábban

RE: override 'com.liferay.portlet.assetpublisher.action.Configuration

New Member Bejegyzések: 19 Csatlakozás dátuma: 2011.02.07. Legújabb bejegyzések
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!
thumbnail
Antoine Comble, módosítva 10 év-val korábban

RE: override 'com.liferay.portlet.assetpublisher.action.Configuration

Regular Member Bejegyzések: 232 Csatlakozás dátuma: 2012.09.07. Legújabb bejegyzések
Hi all,

I've the same problem.

Could you help me ?

Antoine
thumbnail
Antoine Comble, módosítva 10 év-val korábban

RE: override 'com.liferay.portlet.assetpublisher.action.Configuration

Regular Member Bejegyzések: 232 Csatlakozás dátuma: 2012.09.07. Legújabb bejegyzések
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 :

<portlet>
<portlet-name>101</portlet-name>
<configuration-action-class>com.test.ConfigurationActionImpl</configuration-action-class>
</portlet>


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

And it works fine !

Regards,

Antoine