jford       2004/09/02 09:10:58

  Modified:    applications/pam/src/java/org/apache/jetspeed/portlets/pam
                        PortletApplicationBrowser.java
  Log:
  Do not cache action urls
  
  PR: JIRA #JS2-108
  
  Revision  Changes    Path
  1.6       +7 -14     
jakarta-jetspeed-2/applications/pam/src/java/org/apache/jetspeed/portlets/pam/PortletApplicationBrowser.java
  
  Index: PortletApplicationBrowser.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jetspeed-2/applications/pam/src/java/org/apache/jetspeed/portlets/pam/PortletApplicationBrowser.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- PortletApplicationBrowser.java    6 Jul 2004 16:11:25 -0000       1.5
  +++ PortletApplicationBrowser.java    2 Sep 2004 16:10:58 -0000       1.6
  @@ -27,7 +27,6 @@
   import javax.portlet.PortletContext;
   import javax.portlet.PortletException;
   import javax.portlet.PortletSession;
  -import javax.portlet.PortletURL;
   import javax.portlet.RenderRequest;
   import javax.portlet.RenderResponse;
   
  @@ -48,6 +47,7 @@
    */
   public class PortletApplicationBrowser extends ServletPortlet
   {
  +    private static final String PORTLET_URL = "portlet_url";
       private String template;
       private PortletContext context;
       private PortletRegistryComponent registry;
  @@ -73,8 +73,7 @@
           TreeControl control = (TreeControl) 
request.getPortletSession().getAttribute("j2_tree");
           if(control == null)
           {
  -            PortletURL actionURL = response.createActionURL();
  -             control = buildTree(apps, actionURL);
  +             control = buildTree(apps);
                request.getPortletSession().setAttribute("j2_tree", control);
           }
           request.setAttribute("j2_tree", control);
  @@ -86,8 +85,6 @@
       
        public void processAction(ActionRequest actionRequest, ActionResponse 
actionResponse) throws PortletException, IOException
        {
  -             System.out.println("PorletApplicationBrowser: processAction()");
  -             
                TreeControl control = (TreeControl) 
actionRequest.getPortletSession().getAttribute("j2_tree");
                //assert control != null
                
  @@ -113,30 +110,26 @@
                }       
        }
        
  -     private TreeControl buildTree(List apps, PortletURL actionURL) {
  -         
  +     private TreeControl buildTree(List apps) {
            
  -         actionURL.setParameter(PortletApplicationResources.REQUEST_SELECT_NODE, 
"ROOT-NODE");
                TreeControlNode root =
               new TreeControlNode("ROOT-NODE",
                                   null, "J2_ROOT",
  -                                actionURL.toString(),
  +                                PORTLET_URL,
                                   null, true, "J2_DOMAIN");
                
                TreeControl control = new TreeControl(root);
                
                
  -             
actionURL.setParameter(PortletApplicationResources.REQUEST_SELECT_NODE, "APP_ROOT");
                TreeControlNode portletApps = 
  -                     new TreeControlNode("APP-NODE", null, "APP_ROOT", 
actionURL.toString(), null, false, "J2_DOMAIN");
  +                     new TreeControlNode("APP_ROOT", null, "APP_ROOT", PORTLET_URL, 
null, false, "J2_DOMAIN");
                root.addChild(portletApps);
                
                Iterator it = apps.iterator();
           while (it.hasNext())
           {
               MutablePortletApplication pa = (MutablePortletApplication)it.next();
  -            actionURL.setParameter(PortletApplicationResources.REQUEST_SELECT_NODE, 
pa.getName());
  -            TreeControlNode appNode = new TreeControlNode(pa.getName(), null, 
pa.getName(), actionURL.toString(), null, false, "PA_APP_DOMAIN"  );
  +            TreeControlNode appNode = new TreeControlNode(pa.getName(), null, 
pa.getName(), PORTLET_URL, null, false, "PA_APP_DOMAIN"  );
               portletApps.addChild(appNode);
           }
                
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to