portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremy Ford <jer...@sirsi.com>
Subject [Proposal] allow different navigation styles when adding portlets in the customizer
Date Tue, 15 Apr 2003 22:18:29 GMT
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/action
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


Mime
View raw message