portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Christopher <j...@animalsinneed.net>
Subject Re: [Proposal] allow different navigation styles when adding portlets in the customizer
Date Thu, 17 Apr 2003 14:01:01 GMT
I have added a contribution (bug 17839) that would play along with this. My patch gives the
administrator the 
ability to set a parse depth length in my.properties. This depth length would then coincide
with how .'s would be parsed
with the substring of each parse becoming a sort of subcategory. What this means, is when
a person clicked on say news.technology.opensource
in the category drop down list, the choices in the category list would be changed to say 

All Portlets, news, new.technology, news.technology.opensource 

if they set the parse depth to be 2. If they had set it to be 1 then only 

All Portlets, news, news.technology.opensource 

will be in the drop down list.

I did this because our site has numerous portlets and this allows a person to really get down
into the tree of the 
categories and then have a small list of portlets to sift through to get what they were looking
for. I wanted to do this 
as generically as possible so that it could be useful to others.

Thanks,
John

On Tuesday 15 April 2003 15:18, Jeremy Ford wrote:
> I would like to propose allowing different navigation styles when using the
> customizer to add portlets.  Currently, you have the option to either page
> forward or backward.  It would be nice if there was a way that allowed
> different types of navigations.  Using the following patches, I have
> created different navigations based on a parameter set in the
> PortletSetCustomizer registry entry.
>
> I have supplied the contents of 2 velocity files that perform 2 different
> navigations.  In one, you can browse the portlets via an alphabetical
> index. In the other, it allows you to go to each page based on the start
> number. These are 2 minimal examples.
>
> While the implementation may be debatable, I think that the feature itself
> would be beneficial.  Also, the change to the code is very minimal; it can
> be placed readily into 1.4b4.  If this is too late for 1.4b4, I would still
> like to see the patch for the CustomizeSetAction to be added (minus the
> navigation).  This should put into the context all of the information
> needed to create different navigations, regardless of whether there is a
> feature added to Jetspeed to do this.
>
> Thanks,
>
> Jeremy Ford
>
> P.S.  If needed, I can create a log in Bugzilla
>
>
> Index: CustomizeSetAction.java
> ===================================================================
> RCS file:
> /home/cvspublic/jakarta-jetspeed/src/java/org/apache/jetspeed/modules/actio
>n s/portlets/CustomizeSetAction.java,v
> retrieving revision 1.40
> diff -u -r1.40 CustomizeSetAction.java
> --- CustomizeSetAction.java     11 Apr 2003 13:20:51 -0000  1.40
> +++ CustomizeSetAction.java     15 Apr 2003 21:18:29 -0000
> @@ -310,8 +310,11 @@
>              }
>
>              context.put("browser", portlets.subList(start, end));
> -            context.put("size", String.valueOf(size));
> +            context.put("size", new Integer(size));
>              context.put(UI_PORTLETS_SELECTED, userSelections);
> +
> +                 context.put("portlets", portlets);
> +                 context.put("navigation",
> portlet.getPortletConfig().getInitParameter("navigation"));
>          }
>          else if ("addref".equals(mode))
>          {
>
> Index: admin.xreg
> ===================================================================
> RCS file: /home/cvspublic/jakarta-jetspeed/webapp/WEB-INF/conf/admin.xreg,v
> retrieving revision 1.35
> diff -u -r1.35 admin.xreg
> --- admin.xreg  15 Apr 2003 20:43:01 -0000      1.35
> +++ admin.xreg  15 Apr 2003 21:30:21 -0000
> @@ -69,6 +69,7 @@
>      <parameter name="addRefDisabled.style.template" value="Button.vm"
> hidden="false"/>
>      <parameter name="addRefDisabled.style.disabled" value="true"
> hidden="false"/>
>      <parameter name="addRefDisabled.style.no-access"
> value="addRefDisabled" hidden="false"/>
> +    <parameter name="navigation" value="navigation/page-numeric.vm"
> hidden="false"/>
>      <meta-info>
>        <title>Customize pane</title>
>      </meta-info>
>
>
> Index: customizer-portletset-add.vm
> ===================================================================
> RCS file:
> /home/cvspublic/jakarta-jetspeed/webapp/WEB-INF/templates/vm/portlets/html/
>c ustomizer-portletset-add.vm,v
> retrieving revision 1.15
> diff -u -r1.15 customizer-portletset-add.vm
> --- customizer-portletset-add.vm        27 Sep 2002 20:00:03 -0000    1.15
> +++ customizer-portletset-add.vm        15 Apr 2003 21:31:53 -0000
> @@ -134,6 +134,12 @@
>          #end
>          </td>
>        </tr>
> +      <tr>
> +         <td colspan="3">
> +         #set($nav = "portlets/html/${navigation}")
> +         #parse($nav)
> +         </td>
> +         </tr>
>      </table>
>    </center>
>
> navigation/alphabet.vm
> ===================================================================
>
> #set($lastChar = "0")
> #set($tempStart = 0)
> #foreach($portlet in $portlets)
>
>         #set($title = $portlet.title)
>         #if($title && $title.length() > 0)
>
>               #set($temp1 = $lastChar.charAt(0))
>               #set($temp2 = $title.charAt(0))
>
>               #if($temp1 != $temp2)
>                   <a
> href="$jslink.setTemplate("Customize").addPathInfo("start",$tempStart)">&lt
>; &lt;$temp2</a> &nbsp;
>               #end
>
>               #set($lastChar = $temp2.toString())
>         #end
>         #set($tempStart = $tempStart + 1)
> #end
>
>
> navigation/number.vm
> ===================================================================
>
> ##set($perPage = $size)
>
> #set($perPage = 15)
> #set($totalNum = $portlets.size())
>
> #set($numPages = $totalNum / $perPage)
>
> #foreach($page in [0..$numPages])
>         #set($tempStart = $page * $perPage)
>         <a
> href="$jslink.setTemplate("Customize").addPathInfo("start",$tempStart)">&lt
>; &lt;$tempStart</a> &nbsp;
> #end
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org


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


Mime
View raw message