You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by bu...@apache.org on 2003/04/16 22:30:07 UTC

DO NOT REPLY [Bug 19091] New: - [Proposal] allow different navigation styles when adding portlets in the customizer

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19091>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19091

[Proposal] allow different navigation styles when adding portlets in the customizer

           Summary: [Proposal] allow different navigation styles when adding
                    portlets in the customizer
           Product: Jetspeed
           Version: 1.4b4-dev /CVS
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Customizer
        AssignedTo: jetspeed-dev@jakarta.apache.org
        ReportedBy: caius1440@hotmail.com


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/actions/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/customizer-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