portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Sean Taylor" <da...@bluesunrise.com>
Subject RE: [PATCH] org.apache.jetspeed.portal.BasePortletSet.sortPortletSet()
Date Wed, 03 Apr 2002 17:59:36 GMT
Why do we have to sort twice?
We are sorting in BasePortletSet and RowColumnControllerAction
 
A good optimization would be to make sorting optional.
Also, if the customizer always put entries in the correct order so that
they didn't need to be sorted with every request.
It seems wasteful to sort with every request.
 
-----Original Message-----
From: Glenn Golden [mailto:ggolden@umich.edu] 
Sent: Wednesday, April 03, 2002 7:51 AM
To: 'Jetspeed-Dev'
Subject: [PATCH]
org.apache.jetspeed.portal.BasePortletSet.sortPortletSet()



I hate sorting.  So apparently does the BasePortletSet's
sortPortletSet().
 
In short, it does not sort the portlets properly by the layout position.
You can see this by comparing the order of the tabs or menus with the
position of the panes listed in the customizer.  If the order from the
psml file does not match the layout positions, you will see a
difference. RowColumnControllerAction takes care of the customizer's
sorting, and does it properly.  BasePortleSet takes care of sorting the
portlets for the normal display, and does not.
 
The method of walking the elements of a vector by position, and
modifying the vector by moving elements into different positions as you
go is not a good one.  In my test case, the very first element [0] had a
layout of "1".  So it was removed from the vector (sliding all else
down) and inserted at position #1.  Note that the [1] element before is
now the [0] element.
 
The next time through the loop, we look at the vector at [1].  Oops, we
forget to look at the portlet now sitting at [0]!  Again we look at that
previously first portlet, which is now happy at [1], and go on.
 
Instead of modifying a vector / list in place, RowColumnControllerAction
builds up a new one, looking at each portlet's layout position as the
index into the new list.  Those without layout values are placed, in
order of finding them, into the list in the holes or at the end.
 
I've fixed BasePortletSet to do the same.
 
David - could you apply this patch?
 
Thanks.
 
- Glenn 
 
--------------------------------------------
Glenn R. Golden, Systems Research Programmer
University of Michigan School of Information
ggolden@umich.edu               734-615-1419
http://www-personal.si.umich.edu/~ggolden/
--------------------------------------------

 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message