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 Ryan Christianson <ry...@echospace.com> on 2003/05/14 00:56:04 UTC

Proposal, rename method PanedPortletController.retrievePaneID

I spent a long time trying to figure out the best way to get the current 
selected pane/portlet id from PanedPortletController. My first solution 
was to use the method "isSelected", but then I noticed the odd'ly named 
method "retrievePaneID". It seems "retrievePaneID" actually returns the 
currently selected pane's id. Which is actually a portlet id right? I 
propose we rename "retrievePaneID" to "getSelectedPortletID" or 
"getSelectedPaneID".

If my proposal doesnt taste good, maybe we should atleast update the 
javadocs, so you can tell what the method does. Right now it reads 
"Returns the pane id of the parameter used for pane selection".

BTW, is there a better way to get the current selected pane/portlet id? 
Here is how I did it:


PanedPortletController controller = null;
PortletSet portlets = (PortletSet) getPortlet();
if (portlets.getController() instanceof PanedPortletController) {    
    controller = (PanedPortletController) portlets.getController();
}

if ( controller != null ) {
    selectedPaneID = controller.retrievePaneID( rundata, true );
    if ( selectedPaneID == null ) {
        selectedPaneID = controller.retrievePaneID( rundata, false );    
    }
}


Ryan Christianson
**


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


Re: Proposal, rename method PanedPortletController.retrievePaneID

Posted by David Sean Taylor <da...@bluesunrise.com>.
On Tuesday, May 13, 2003, at 03:56  PM, Ryan Christianson wrote:

> I spent a long time trying to figure out the best way to get the 
> current selected pane/portlet id from PanedPortletController. My first 
> solution was to use the method "isSelected", but then I noticed the 
> odd'ly named method "retrievePaneID". It seems "retrievePaneID" 
> actually returns the currently selected pane's id. Which is actually a 
> portlet id right? I propose we rename "retrievePaneID" to 
> "getSelectedPortletID" or "getSelectedPaneID".
>
> If my proposal doesnt taste good, maybe we should atleast update the 
> javadocs, so you can tell what the method does. Right now it reads 
> "Returns the pane id of the parameter used for pane selection".
>
> BTW, is there a better way to get the current selected pane/portlet 
> id? Here is how I did it:
>
>
> PanedPortletController controller = null;
> PortletSet portlets = (PortletSet) getPortlet();
> if (portlets.getController() instanceof PanedPortletController) {      
>  controller = (PanedPortletController) portlets.getController();
> }
>
> if ( controller != null ) {
>    selectedPaneID = controller.retrievePaneID( rundata, true );
>    if ( selectedPaneID == null ) {
>        selectedPaneID = controller.retrievePaneID( rundata, false );   
>     }
> }
>
>
> Ryan Christianson
> **
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org
>
>
>
Yes, the pane id is the portlet id.
The name you are proposing is better.

The code snipet above could be added as a method to tJetspeedTool and 
JetspeedPaneTag

--
David Sean Taylor
Bluesunrise Software
david@bluesunrise.com
+01 707 773-4646



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