Issue Details (XML | Word | Printable)

Key: JS1-282
Type: New Feature New Feature
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Unassigned
Reporter: Jeremy Ford
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Jetspeed

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

Created: 17/Apr/03 03:30 AM   Updated: 02/Apr/04 06:50 PM
Return to search
Component/s: Customizer
Affects Version/s: 1.4b4-dev / CVS
Fix Version/s: 1.5

Time Tracking:
Not Specified

Environment:
Operating System: All
Platform: All

Bugzilla Id: 19091


 Description  « Hide
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

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Jeremy Ford added a comment - 17/Apr/03 03:31 AM
I was hoping to get part of this in 1.4b4. If possible, could the following 2
lines be added to the CustomizeSetAction?

context.put("size", new Integer(size));
context.put("portlets", portlets);

See patch in previous comment for actual placement.

Mark Orciuch added a comment - 20/Apr/03 07:23 AM
Deferred to the next release.

Jeremy Ford added a comment - 31/Jul/03 01:03 AM
This was my original proposal. Any thoughts about the implementation? If no
objections, I'll commit this as is.

Mark Orciuch added a comment - 31/Jul/03 09:59 PM
Jeremy,

I originally deferred it past the final release because it's an enhancement.
The rationale was to stay away from enhancements and concentrate on bugs so we
can deliver not necessarily feature packed but stable final release. I leave it
up to you if you want to commit it.

Jeremy Ford added a comment - 31/Jul/03 10:42 PM
I was going to look at it due to the target milestone being 1.4b5. I'll changed
the target.

Jeremy Ford added a comment - 05/Nov/03 10:05 AM
Enhancement applied.

I felt that my original proposal was a little too complicated. Instead, I
turned the dynamic velocity parsing into a velocity macro. If you would like a
different navigation, just write a new navigation macro.