portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject cvs commit: jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/portlets/pam PortletApplicationBrowser.java
Date Sat, 03 Apr 2004 01:06:40 GMT
taylor      2004/04/02 17:06:40

  Modified:    portal/src/java/org/apache/jetspeed/portlets/pam
                        PortletApplicationBrowser.java
  Log:
  Get PAs from the registry (start)
  CVS: ----------------------------------------------------------------------
  CVS: PR:
  CVS:   If this change addresses a PR in the problem report tracking
  CVS:   database, then enter the PR number(s) here.
  CVS: Obtained from:
  CVS:   If this change has been taken from another system, such as NCSA,
  CVS:   then name the system in this line, otherwise delete it.
  CVS: Submitted by:
  CVS:   If this code has been contributed to Apache by someone else; i.e.,
  CVS:   they sent us a patch or a new module, then include their name/email
  CVS:   address here. If this is your work then delete this line.
  CVS: Reviewed by:
  CVS:   If we are doing pre-commit code reviews and someone else has
  CVS:   reviewed your changes, include their name(s) here.
  CVS:   If you have not had it reviewed then delete this line.
  
  Revision  Changes    Path
  1.2       +16 -53    jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/portlets/pam/PortletApplicationBrowser.java
  
  Index: PortletApplicationBrowser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/portlets/pam/PortletApplicationBrowser.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- PortletApplicationBrowser.java	2 Apr 2004 18:43:04 -0000	1.1
  +++ PortletApplicationBrowser.java	3 Apr 2004 01:06:40 -0000	1.2
  @@ -16,21 +16,21 @@
   package org.apache.jetspeed.portlets.pam;
   
   import java.io.IOException;
  +import java.util.List;
   //import java.io.InputStream;
   
   import javax.portlet.ActionRequest;
   import javax.portlet.ActionResponse;
   
  -import javax.portlet.GenericPortlet;
   import javax.portlet.PortletConfig;
   import javax.portlet.PortletContext;
   import javax.portlet.PortletException;
  -import javax.portlet.PortletMode;
  -import javax.portlet.PortletRequestDispatcher;
  -import javax.portlet.PortletURL;
   import javax.portlet.RenderRequest;
   import javax.portlet.RenderResponse;
  -import javax.portlet.WindowState;
  +
  +import org.apache.jetspeed.Jetspeed;
  +import org.apache.jetspeed.components.portletregistry.PortletRegistryComponent;
  +import org.apache.jetspeed.portlet.ServletPortlet;
   
   //import org.apache.jetspeed.cps.util.Streams;
   
  @@ -38,72 +38,35 @@
    * This portlet is a browser over all the portlet applications in the system.
    *
    * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
  + * @author <a href="mailto:ccardona@gluecode.com">Chris Cardona</a>
  + * 
    * @version $Id$
    */
  -public class PortletApplicationBrowser extends GenericPortlet
  +public class PortletApplicationBrowser extends ServletPortlet
   {
  +    private String template;
       
       public void init(PortletConfig config)
       throws PortletException 
       {
  -        System.out.println("ApplicationBrowserPortlet: initializing portlet, config = "
+ config.getPortletName());
  -        System.out.println("[MHL] Ready for action...");
           super.init(config);
       }
       
  -    /*
  -     * The content is generated by <pre>/WEB-INF/hello.jsp</pre>
  -     */
  -    public void doEdit(RenderRequest request, RenderResponse response)
  -    throws PortletException, IOException
  -    {
  -        PortletContext context = getPortletContext();
  -        PortletRequestDispatcher rd = context.getRequestDispatcher("/hello.jsp");
  -        rd.include(request,response);
  -    }
  -    
  -    public void doHelp(RenderRequest request, RenderResponse response)
  -    throws PortletException, IOException
  -    {
  -        PortletContext context = getPortletContext();
  -        PortletRequestDispatcher rd = context.getRequestDispatcher("/hello.jsp");
  -        rd.include(request,response);
  -    }
  -
       public void doView(RenderRequest request, RenderResponse response)
       throws PortletException, IOException
       {
           PortletContext context = getPortletContext();
           response.setContentType("text/html");
  +        PortletRegistryComponent registry = (PortletRegistryComponent)Jetspeed.getComponentManager().getComponent(PortletRegistryComponent.class);
 
  +        List apps = registry.getPortletApplications();
  +        request.setAttribute("apps", apps);
  +        super.doView(request, response);
           
  -        PortletURL url = response.createRenderURL();
  -        PortletURL actionUrl = response.createActionURL();
  -        url.setWindowState(WindowState.MAXIMIZED);
  -        actionUrl.setPortletMode(PortletMode.EDIT);
  -        
  -        // url.addParameter("test", "value");
  -        
  -        response.getWriter().println("<br/><b>Init Param 'Template' = " + this.getInitParameter("template")
+  "</b>");
  -        response.getWriter().println("<br/><b>Render URL = <a href='" +
url +  "'>" + url + "</a></b>");
  -        response.getWriter().println("<br/><b>Action URL = <a href='" +
actionUrl +  "'>" + actionUrl + "</a></b>");
  -        
  -        response.getWriter().println("<br/><b>Request dispatching now</b>");
  -        
  -        PortletRequestDispatcher rd = context.getRequestDispatcher("/hello.jsp");
  -        rd.include(request, response);
  -        
  -//        InputStream is = context.getResourceAsStream("/snipet.html");
  -//        if (is != null)
  -//        {
  -//            Streams.drain(is, response.getWriter());
  -//        }
  -        
  -        response.getWriter().println("<br/><b>Done Request dispatching.</b>");
       }
   
       
   	public void processAction(ActionRequest actionRequest, ActionResponse actionResponse)
throws PortletException, IOException
   	{
  -		System.out.println("[MHL] Napindot ako!!!");
  +		System.out.println("PorletApplicationBrowser: processAction()");
   	}
  -}
  +}
  \ No newline at end of file
  
  
  

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


Mime
View raw message