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/components/web-content/src/java/org/apache/jetspeed/portlet IFrameGenericPortlet.java SSOIFramePortlet.java
Date Wed, 01 Dec 2004 01:29:26 GMT
taylor      2004/11/30 17:29:26

  Modified:    components/web-content/src/java/org/apache/jetspeed/portlet
                        IFrameGenericPortlet.java SSOIFramePortlet.java
  Log:
  implemented SSO IFrame Portlet with SSO via request params
  
  Revision  Changes    Path
  1.6       +3 -3      jakarta-jetspeed-2/components/web-content/src/java/org/apache/jetspeed/portlet/IFrameGenericPortlet.java
  
  Index: IFrameGenericPortlet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/components/web-content/src/java/org/apache/jetspeed/portlet/IFrameGenericPortlet.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- IFrameGenericPortlet.java	28 Nov 2004 19:02:23 -0000	1.5
  +++ IFrameGenericPortlet.java	1 Dec 2004 01:29:25 -0000	1.6
  @@ -129,7 +129,7 @@
       protected void doIFrame(RenderRequest request, RenderResponse response) throws IOException
       {
           PortletPreferences prefs = request.getPreferences();
  -        String source = getURLSource(request, prefs);
  +        String source = getURLSource(request, response, prefs);
           // generate HTML IFRAME content
           StringBuffer content = new StringBuffer(4096);
           content.append("<IFRAME");
  @@ -169,7 +169,7 @@
           response.getWriter().print(content.toString());
       }
   
  -    public String getURLSource(RenderRequest request, PortletPreferences prefs)
  +    public String getURLSource(RenderRequest request, RenderResponse response, PortletPreferences
prefs)
       {
           String source = getAttributePreference(prefs, "SRC");
           if (source == null) source = "";
  
  
  
  1.4       +20 -9     jakarta-jetspeed-2/components/web-content/src/java/org/apache/jetspeed/portlet/SSOIFramePortlet.java
  
  Index: SSOIFramePortlet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/components/web-content/src/java/org/apache/jetspeed/portlet/SSOIFramePortlet.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SSOIFramePortlet.java	30 Nov 2004 19:01:10 -0000	1.3
  +++ SSOIFramePortlet.java	1 Dec 2004 01:29:25 -0000	1.4
  @@ -18,6 +18,7 @@
   import java.io.IOException;
   import java.security.AccessControlContext;
   import java.security.AccessController;
  +
   import javax.security.auth.Subject;
   
   import javax.portlet.ActionRequest;
  @@ -48,8 +49,8 @@
       public static final String SSO_TYPE_HTTP = "http";
       public static final String SSO_TYPE_CERTIFICATE = "certificate";
       
  -    public static final String SSO_TYPE_URL_USERNAME = "sso.url.param.username";
  -    public static final String SSO_TYPE_URL_PASSWORD = "sso.url.param.password";
  +    public static final String SSO_TYPE_URL_USERNAME = "sso.url.Principal";
  +    public static final String SSO_TYPE_URL_PASSWORD = "sso.url.Credential";
       
       public static final String SSO_REQUEST_ATTRIBUTE_USERNAME = "sso.ra.username";
       public static final String SSO_REQUEST_ATTRIBUTE_PASSWORD = "sso.ra.password";
  @@ -102,7 +103,7 @@
           
           super.doEdit(request, response);
       }
  -    
  +        
       public void doView(RenderRequest request, RenderResponse response)
       throws PortletException, IOException
       {
  @@ -112,6 +113,7 @@
               // no credentials configured in SSO store
               // switch to SSO Configure View
               request.setAttribute(PARAM_VIEW_PAGE, this.getPortletConfig().getInitParameter(PARAM_EDIT_PAGE));
  +            setupPreferencesEdit(request, response);
               super.doView(request, response);
               return;
           }
  @@ -130,6 +132,7 @@
                   // no credentials configured in SSO store
                   // switch to SSO Configure View
                   request.setAttribute(PARAM_VIEW_PAGE, this.getPortletConfig().getInitParameter(PARAM_EDIT_PAGE));
  +                setupPreferencesEdit(request, response);                
               }
               else
               {
  @@ -150,6 +153,13 @@
           // ssoUserName 
           String ssoPrincipal = request.getParameter(SSO_FORM_PRINCIPAL);
           String ssoCredential = request.getParameter(SSO_FORM_CREDENTIAL);
  +        /*
  +        if (ssoPrincipal == null || ssoCredential == null)
  +        {
  +            
  +            actionResponse.setPortletMode(PortletMode.EDIT); // stay on edit
  +        }
  +        */
           String site = request.getPreferences().getValue("SRC", "");
           try
           {
  @@ -170,14 +180,14 @@
           
       }
       
  -    public String getURLSource(RenderRequest request, PortletPreferences prefs)
  +    public String getURLSource(RenderRequest request, RenderResponse response, PortletPreferences
prefs)
       {
  -        String baseSource = super.getURLSource(request, prefs);
  +        String baseSource = super.getURLSource(request, response, prefs);
           String type = prefs.getValue(SSO_TYPE, SSO_TYPE_URL);
           if (type.equals(SSO_TYPE_URL))
           {
  -            String userNameParam = prefs.getValue("sso.url.param.username", "");
  -            String passwordParam = prefs.getValue("sso.url.param.password", "");
  +            String userNameParam = prefs.getValue(SSO_TYPE_URL_USERNAME, "user");
  +            String passwordParam = prefs.getValue(SSO_TYPE_URL_PASSWORD, "password");
               StringBuffer source = new StringBuffer(baseSource);
               if (baseSource.indexOf("?") == -1)
               {
  @@ -200,7 +210,8 @@
               source.append(passwordParam);
               source.append("=");
               source.append(password);
  -            return source.toString();
  +            
  +            return response.encodeURL(source.toString());
           }
           else
           {
  
  
  

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