Foros de discusión

Overriding Action class using zeep-o-tron?

thumbnail
Cameron McBride, modificado hace 12 años.

Overriding Action class using zeep-o-tron?

Expert Mensajes: 269 Fecha de incorporación: 8/02/11 Mensajes recientes
I'm testing out this zeep-o-tron thing in Liferay 6.0.6 to override an action class. aigloss.blogspot.com/2011/07/zeep-otron-for-liferay-6.html

His example works great but I have noticed that his class uses this:
public class EditEventAction extends com.liferay.portlet.calendar.action.EditEventAction

Since you cannot include the portal-impl.jar in your war file, I assume he has either somehow compiled against it but not included it or he has deleted it.

In eclipse is there a way to tell it to include a jar file for compiling but not for the war deployment?

I'm now trying to make my own override of the LoginAction class, so far no luck.
thumbnail
Cameron McBride, modificado hace 12 años.

RE: Overriding Action class using zeep-o-tron?

Expert Mensajes: 269 Fecha de incorporación: 8/02/11 Mensajes recientes
Doing an ant war will even bomb out saying that you can't have that portal-impl.jar in there. The good news is that my override of the action class works great.

Looks like there are two separate issues to overcome here:

1. When eclipse builds and deploys it packages all the jars. How do exclude one.
- I have tried right clicking the project, properties, source tag, excluded portal-impl.jar
Drag the project down to the server and the jar is still deployed.

2. When the war file is built with ant we need to also exclude the jar and not fail with the error message about portal-impl.jar.
- I tried adding excludes="portal-impl.jar" to about 30 fileset lines in the various ant build xml files.
Made no difference.
thumbnail
David H Nebinger, modificado hace 12 años.

RE: Overriding Action class using zeep-o-tron?

Liferay Legend Mensajes: 14914 Fecha de incorporación: 2/09/06 Mensajes recientes
Well, in Eclipse you can add a jar as a build path item, just use the regular build path to add it, not the liferay-plugin-package.properties file. That will solve your Eclipse issue.

The ant issue is different. ant includes libraries defined in liferay-plugin-package.properties to the compile path, so portal-impl would need to be on there for the compile to work, but then it would have to come out before the war is built otherwise the hot deploy would try to pull it in during deployment, which would be a bad thing.

Does his example use the SDK for building? If so, does it compile and deploy cleanly w/ ant? If so, he might have already solved the problem. If it's a custom build script or done outside of the SDK, then perhaps you'd have to go the same route to get the compile to work...
thumbnail
Cameron McBride, modificado hace 12 años.

RE: Overriding Action class using zeep-o-tron?

Expert Mensajes: 269 Fecha de incorporación: 8/02/11 Mensajes recientes
He doesn't provide a guide to compiling and running it, just the example war file.

Overnight I dreamed up a solution to the problem. I took just created a new jar file with the one class I needed LoginAction.class. I also wanted to override CreateAccountAction.class so I included it too. I include that jar in eclipse and it's being packaged into the war file with no errors.

The zeep-o-tron thing works too. I'm overriding action classes in a hook plugin in CE 6.0.6. From what I read in EE SP2 or 6.1 you can do that out-of-the-box.
Oluwasegun Diyan, modificado hace 11 años.

RE: Overriding Action class using zeep-o-tron?

New Member Mensajes: 4 Fecha de incorporación: 7/08/12 Mensajes recientes
Hello Cameron,

I'm assuming you've resolved this issue!

I'm also trying to override the LoginAction class in my hook but obviously the portal-impl.jar restrictions are killing me (you obviously know this already).
Please can you explain in details (if possible with code and config snippets) how you went about your solution ...please!!!

I've been at it all day and no one seems to have a definite workable solution.

Thanks
Oluwasegun Diyan, modificado hace 11 años.

RE: Overriding Action class using zeep-o-tron?

New Member Mensajes: 4 Fecha de incorporación: 7/08/12 Mensajes recientes
Hello,

Don't bother anymore!

I got it resolved already.

Thanks anyway.
thumbnail
David H Nebinger, modificado hace 11 años.

RE: Overriding Action class using zeep-o-tron?

Liferay Legend Mensajes: 14914 Fecha de incorporación: 2/09/06 Mensajes recientes
So how did you solve it, in case someone like yourself comes looking for a solution for this in the future?