portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jefferson Uy" <jefferson...@islanddata.com>
Subject Add selection type to portlet parameter for more flexible portlet customization
Date Thu, 02 May 2002 20:29:49 GMT
Sorry for the cross post.... I figured that maybe my question has more interest to Jetspeed
developers than users :)

Any idea whether my requirement below is already being developed into Jetspeed?

In portlet customization, I have a need to add a parameter type for a given portlet in the
form of a selection list/box. Right now, Jetspeed only has 2 types: boolean (allows you to
choose true/false) and text (requires you to enter the attribute for the specific parameter).
Is there a plan to expand this to include a selection list/box?  

Basically what I want to do is add a drop down selection list in the portlet customization
page, so that the user can select a portlet option based on a prepopulated list of attributes.
This is important since it will make portlet customization flexible and user friendly. The
user just needs to select an option from the list instead of typing it on the text box.

I am looking at 2 possible solutions: (but if there is already one in the works, then maybe
its better than mine below? ;) 
1) Add a new parameter type value called "select" and a new parameter in the portlets xreg
file called "list" which will contain all possible values for the said parameter. Then modify
customizer-portlet.vm to parse the list and show them as options in a drop down box. The problem
I have with this approach is I don't know how to parse the list using velocity. Is it possible
to do such thing in velocity?

2) A quick and dirty way is to add a new parameter type called "select" and then modify customer-portlet.vm
to key in on the type, name and value. The actual value list will be in customizer-portlet.vm
file. The code will look like this. Drawback of this is that it looks like a hack and too
cumbersome if your portlet customization uses lots of selection type parameter.

	      #if ($param.Type == "boolean")
	        <select name="$param.Name">
	          <option #if ($config.getInitParameter($param.Name) == "false") SELECTED #end>false
	          <option #if ($config.getInitParameter($param.Name) == "true") SELECTED #end>true
	      #elseif ($param.Type == "select")
	        #if (($param.Name == "node") && ($!param.Value == "acme"))
	            <select name="$param.Name">
	             <option value=acme SELECTED>acme
	             <option value=abc>abc company
	             <option value=xyz>xyz.com
	        <input type="text" name="$param.Name" value="$!param.Value" >

If Jetspeed expands the parameter type to include selection, then portlet customization will
be more powerful and more flexible. What do you think?

thanks.. jeff

To unsubscribe, e-mail:   <mailto:jetspeed-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:jetspeed-dev-help@jakarta.apache.org>

View raw message