Hi,
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
</select>
#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
</select>
#end
#else
<input type="text" name="$param.Name" value="$!param.Value" >
#end
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:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>