Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Cameron McBride
Overriding Action class using zeep-o-tron?
January 13, 2012 12:49 PM
Answer

Cameron McBride

Rank: Expert

Posts: 273

Join Date: February 8, 2011

Recent Posts

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.
Cameron McBride
RE: Overriding Action class using zeep-o-tron?
January 13, 2012 1:51 PM
Answer

Cameron McBride

Rank: Expert

Posts: 273

Join Date: February 8, 2011

Recent Posts

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.
David H Nebinger
RE: Overriding Action class using zeep-o-tron?
January 13, 2012 2:24 PM
Answer

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 9480

Join Date: September 1, 2006

Recent Posts

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...
Cameron McBride
RE: Overriding Action class using zeep-o-tron?
January 14, 2012 9:18 AM
Answer

Cameron McBride

Rank: Expert

Posts: 273

Join Date: February 8, 2011

Recent Posts

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
RE: Overriding Action class using zeep-o-tron?
August 7, 2012 5:25 AM
Answer

Oluwasegun Diyan

Rank: New Member

Posts: 4

Join Date: August 7, 2012

Recent Posts

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
RE: Overriding Action class using zeep-o-tron?
August 7, 2012 10:31 AM
Answer

Oluwasegun Diyan

Rank: New Member

Posts: 4

Join Date: August 7, 2012

Recent Posts

Hello,

Don't bother anymore!

I got it resolved already.

Thanks anyway.
David H Nebinger
RE: Overriding Action class using zeep-o-tron?
August 7, 2012 10:44 AM
Answer

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 9480

Join Date: September 1, 2006

Recent Posts

So how did you solve it, in case someone like yourself comes looking for a solution for this in the future?