Forums

Home » Liferay IDE » English

Combination View Flat View Tree View
Threads [ Previous | Next ]
Gregory Amerson
how to modify portlet wizard to support struts 2
June 23, 2010 6:59 AM
Answer

Gregory Amerson

LIFERAY STAFF

Rank: Liferay Master

Posts: 911

Join Date: February 16, 2010

Recent Posts

Jack Bakker:
I do portlets with Struts2 ; is there a way of modifying 'creation' (via IDE) of portlets to customize for such ?


There is a way to do this but its not user friendly. I hope to add an ability to customize these templates directly from the UI very soon, but for now the only process available is manual. Also the only thing that you will be able to easily modify is the content of the portlet mode JSPs that are created.

1. Go to your eclipse/plugins where you have Liferay IDE installed. You should see a directory that has this name:
com.liferay.ide.eclipse.portlet.ui_1.0.0.v201006141713

2. Go into this folder and then open the sub-directory called "templates"

3. In side this folder is a file naemd portlet-jsp-templates.properties

If you look at this file you will see that it defines the contents of all of the portlet modes JSPs that get created by the portlet wizard. You could modify this file to add the struts2 specific JSPs that would be generated by the portlet wizard.

A couple of notes would be to be sure and backup the existing file incase you run into problems. The format of that file is pretty tricky with all of the escaping and newlines but if you just make the new edits similar to the existing ones you should be fine.
Jack Bakker
RE: how to modify portlet wizard to support struts 2
June 23, 2010 6:54 AM
Answer

Jack Bakker

Rank: Liferay Master

Posts: 512

Join Date: January 3, 2010

Recent Posts

Thanks ; found portlet-jsp-templates.properties in com.liferay.ide.eclipse.portlet.ui_1.0.0.v201006141713 (your #1 references com.liferay.ide.eclipse.portlet.core* not com.liferay.ide.eclipse.portlet.ui*)
Gregory Amerson
RE: how to modify portlet wizard to support struts 2
June 23, 2010 6:58 AM
Answer

Gregory Amerson

LIFERAY STAFF

Rank: Liferay Master

Posts: 911

Join Date: February 16, 2010

Recent Posts

Ah, your correct, I had that wrong. I've updated my original post, thanks for the note.
Jack Bakker
RE: how to modify portlet wizard to support struts 2
July 18, 2010 9:31 AM
Answer

Jack Bakker

Rank: Liferay Master

Posts: 512

Join Date: January 3, 2010

Recent Posts

then there are mods to web.xml ; inclusion of struts jars and tld ; and so on ; currently 'manual' for me which is fine ; just trying to contribute...

for a future version of the IDE perhaps ; I know you have enough tall orders on your plate (layout templates gui very cool btw) ; some brilliant stuff going on there
Gregory Amerson
RE: how to modify portlet wizard to support struts 2
July 19, 2010 6:09 AM
Answer

Gregory Amerson

LIFERAY STAFF

Rank: Liferay Master

Posts: 911

Join Date: February 16, 2010

Recent Posts

You should be able to add the struts jars by editing the liferay-plugin-package.properties and switch to the dependencies tab and in both columns add struts jars and tlds.

Also I'm going to try to expose the velocity templates that are used to generate all resources with the wizard. Also perhaps we could make it so users could contribute their own wizard templates (that you could customize to be struts1, struts2, etc) and let you select template when you execute the wizard.
Dave Weitzel
RE: how to modify portlet wizard to support struts 2
August 2, 2010 6:47 AM
Answer

Dave Weitzel

Rank: Regular Member

Posts: 169

Join Date: November 18, 2009

Recent Posts

Gregory
Any idea when the next release of the IDE will be and will struts portlets be a standard feature?
It seems that struts is the preferred way of developing portlets yet the IDE doesn't allow it and these instructions aren't very friendly.
Making an update release of the IDE would be the preferred way forward, especially as you have the webinar with a newer build which we cant yet get to.

Thanks

Dave

BTW the web site needs much better structuring to find up to date info regarding all releases as well as forums and wiki articles. for instance I see references to 6.0.5. GA2 but this isn't in sourceforge yet. I dont want o report bugs in 6.0.4 when they may already be cleared.
Jack Bakker
RE: how to modify portlet wizard to support struts 2
August 2, 2010 8:51 AM
Answer

Jack Bakker

Rank: Liferay Master

Posts: 512

Join Date: January 3, 2010

Recent Posts

I just subscribed to the whole IDE category as I seem to be missing useful posts.

Doesn't liferay-plugin-package.properties dependencies just list jars that are in ROOT/WEB-INF/lib ? Unless you are suggesting I put my needed jars there and then reference ? However, for better isolation per portlet ; I just have a user library for what I want from struts-2.1.8 and also copy such into a portlets WEB-INF/lib so it gets deployed

cool idea on the exposing velocity templates ; note that while I am appreciating speed for initial 'generation' of say a portlet project, then adding what I want ; refactoring (even just liferay project name) seems to incur some extra steps). seems like a liferay specific refactoring option might be attractive though now I don't really know what I am talking about
Gregory Amerson
RE: how to modify portlet wizard to support struts 2
August 3, 2010 5:48 AM
Answer

Gregory Amerson

LIFERAY STAFF

Rank: Liferay Master

Posts: 911

Join Date: February 16, 2010

Recent Posts

I do hope to add some liferay specific refactoring support eventually especially for descriptor files being the most obvious place to support first.
Jack Bakker
RE: how to modify portlet wizard to support struts 2
August 3, 2010 7:01 AM
Answer

Jack Bakker

Rank: Liferay Master

Posts: 512

Join Date: January 3, 2010

Recent Posts

Sounds good

For me when I go to refactor a portlet project name, the name changes, but the filesystem path doesn't, and as such on deploy, war has old name ; awkward for inter-portlet references
Jack Bakker
RE: how to modify portlet wizard to support struts 2
August 10, 2010 6:36 AM
Answer

Jack Bakker

Rank: Liferay Master

Posts: 512

Join Date: January 3, 2010

Recent Posts

I'm finding Struts2 in Liferay is a waste of time given:

- lack of JSR 286 support

- power of AlloyUI over and above struts2 libraries, dojo/etc.

- all the goodies your IDE is supporting

Looks like I am going to phase out Struts like I phased out ColdFusion back when Allaire went towards Neo and then was bought by Macromedia.

I'm feeling a loss but I'll get over it.

Rich Sezov's "Liferay in Action" is an excellent resource.
Jack Bakker
RE: how to modify portlet wizard to support struts 2
August 14, 2012 4:54 PM
Answer

Jack Bakker

Rank: Liferay Master

Posts: 512

Join Date: January 3, 2010

Recent Posts

I am looking at upgrading a LR v5.2.3 with legacy Struts2 portlets up to LR v6.0.6 (as an aside, any newly introduced portlets would use Vaadin or MVCPortlet)

any new guidance on possibilities of using IDE for Struts2 ?