留言板

how to modify portlet wizard to support struts 2

thumbnail
Gregory Amerson,修改在13 年前。

how to modify portlet wizard to support struts 2

Liferay Legend 帖子: 1123 加入日期: 10-2-16 最近的帖子
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.
thumbnail
Jack Bakker,修改在13 年前。

RE: how to modify portlet wizard to support struts 2

Liferay Master 帖子: 978 加入日期: 10-1-3 最近的帖子
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*)
thumbnail
Gregory Amerson,修改在13 年前。

RE: how to modify portlet wizard to support struts 2

Liferay Legend 帖子: 1123 加入日期: 10-2-16 最近的帖子
Ah, your correct, I had that wrong. I've updated my original post, thanks for the note.
thumbnail
Jack Bakker,修改在13 年前。

RE: how to modify portlet wizard to support struts 2

Liferay Master 帖子: 978 加入日期: 10-1-3 最近的帖子
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
thumbnail
Gregory Amerson,修改在13 年前。

RE: how to modify portlet wizard to support struts 2

Liferay Legend 帖子: 1123 加入日期: 10-2-16 最近的帖子
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.
thumbnail
Dave Weitzel,修改在13 年前。

RE: how to modify portlet wizard to support struts 2

Regular Member 帖子: 208 加入日期: 09-11-18 最近的帖子
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.
thumbnail
Jack Bakker,修改在13 年前。

RE: how to modify portlet wizard to support struts 2

Liferay Master 帖子: 978 加入日期: 10-1-3 最近的帖子
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
thumbnail
Gregory Amerson,修改在13 年前。

RE: how to modify portlet wizard to support struts 2

Liferay Legend 帖子: 1123 加入日期: 10-2-16 最近的帖子
I do hope to add some liferay specific refactoring support eventually especially for descriptor files being the most obvious place to support first.
thumbnail
Jack Bakker,修改在13 年前。

RE: how to modify portlet wizard to support struts 2

Liferay Master 帖子: 978 加入日期: 10-1-3 最近的帖子
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
thumbnail
Jack Bakker,修改在13 年前。

RE: how to modify portlet wizard to support struts 2

Liferay Master 帖子: 978 加入日期: 10-1-3 最近的帖子
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.
thumbnail
Jack Bakker,修改在11 年前。

RE: how to modify portlet wizard to support struts 2

Liferay Master 帖子: 978 加入日期: 10-1-3 最近的帖子
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 ?