portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Glenn Golden <ggol...@umich.edu>
Subject RE: [PATCH] org.apache.jetspeed.portal.BasePortletSet.sortPortlet Set()
Date Wed, 03 Apr 2002 21:05:51 GMT
Ok - the BasePortletSet sorts only once for the lifetime of the
BasePortletSet, which lives I don't know how long.

It has to sort.  Otherwise there is no order of panes, and we need the panes
(menu entries, tabs, and list in the customizer) ordered.

It may be that the RowColumnControllerAction need not sort, as the portlets
are always going to be sorted, but it mixes portlets with panes, it seems,
so...  Who knows!

But I don't see optional sorting as an option.

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


> -----Original Message-----
> From: David Sean Taylor [mailto:david@bluesunrise.com] 
> Sent: Wednesday, April 03, 2002 1:00 PM
> To: 'Jetspeed Developers List'
> Subject: RE: [PATCH] 
> org.apache.jetspeed.portal.BasePortletSet.sortPortletSet()
> 
> 
> 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/
> --------------------------------------------
> 
>  
> 
> 

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


Mime
View raw message