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 Fri, 02 Apr 2004 18:43:04 GMT
taylor      2004/04/02 10:43:04

  Added:       portal/src/java/org/apache/jetspeed/portlets/pam
                        PortletApplicationBrowser.java
  Log:
  removing PAM PA 
moving PAM portlets into jetspeed PA, resolving classloader issues
  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.1                  jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/portlets/pam/PortletApplicationBrowser.java
  
  Index: PortletApplicationBrowser.java
  ===================================================================
  /*
   * Copyright 2000-2004 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  package org.apache.jetspeed.portlets.pam;
  
  import java.io.IOException;
  //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.cps.util.Streams;
  
  /**
   * This portlet is a browser over all the portlet applications in the system.
   *
   * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
   * @version $Id: PortletApplicationBrowser.java,v 1.1 2004/04/02 18:43:04 taylor Exp $
   */
  public class PortletApplicationBrowser extends GenericPortlet
  {
      
      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");
          
          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!!!");
  	}
  }
  
  
  

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