portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shins...@apache.org
Subject svn commit: r391321 - in /portals/jetspeed-2/trunk: components/portal/src/java/org/apache/jetspeed/login/filter/ jetspeed-api/src/java/org/apache/jetspeed/ layout-portlets/src/java/org/apache/jetspeed/portlets/layout/resources/ src/webapp/decorations/l...
Date Tue, 04 Apr 2006 14:27:20 GMT
Author: shinsuke
Date: Tue Apr  4 07:27:18 2006
New Revision: 391321

URL: http://svn.apache.org/viewcvs?rev=391321&view=rev
Log:
put login form to blueocean decorator for PortalFilter

Added:
    portals/jetspeed-2/trunk/src/webapp/decorations/layout/blueocean/images/button_background.gif
  (with props)
Modified:
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/login/filter/PortalFilter.java
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/login/filter/PortalRequestWrapper.java
    portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/PortalReservedParameters.java
    portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/resources/LayoutResource.properties
    portals/jetspeed-2/trunk/src/webapp/decorations/layout/blueocean/css/styles.css
    portals/jetspeed-2/trunk/src/webapp/decorations/layout/blueocean/header.vm

Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/login/filter/PortalFilter.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/login/filter/PortalFilter.java?rev=391321&r1=391320&r2=391321&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/login/filter/PortalFilter.java
(original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/login/filter/PortalFilter.java
Tue Apr  4 07:27:18 2006
@@ -72,12 +72,12 @@
                 }
                 else
                 {
-                    request.getSession().setAttribute(LoginConstants.ERRORCODE, "2");   
                
+                    request.getSession().setAttribute(LoginConstants.ERRORCODE, LoginConstants.ERROR_INVALID_PASSWORD);
                   
                 }
             }
             else
             {
-                HttpSession session = request.getSession();
+                //HttpSession session = request.getSession();
                 //System.out.println("*** session = " + session);
                 Subject subject = (Subject)request.getSession().getAttribute(PortalReservedParameters.SESSION_KEY_SUBJECT);
                 if (subject != null)
@@ -92,8 +92,10 @@
                     }
                 }                
             }              
-        }
 
+            sRequest.setAttribute(PortalReservedParameters.PORTAL_FILTER_ATTRIBUTE, "true");
+        }
+        
         if (filterChain != null)
         {
             filterChain.doFilter(sRequest, sResponse);

Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/login/filter/PortalRequestWrapper.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/login/filter/PortalRequestWrapper.java?rev=391321&r1=391320&r2=391321&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/login/filter/PortalRequestWrapper.java
(original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/login/filter/PortalRequestWrapper.java
Tue Apr  4 07:27:18 2006
@@ -15,19 +15,29 @@
  */
 package org.apache.jetspeed.login.filter;
 
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
 import java.security.Principal;
+import java.util.Enumeration;
+import java.util.Locale;
+import java.util.Map;
 
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletInputStream;
+import javax.servlet.http.Cookie;
 import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletRequestWrapper;
+import javax.servlet.http.HttpSession;
 
-public class PortalRequestWrapper extends HttpServletRequestWrapper
+public class PortalRequestWrapper implements HttpServletRequest
 {
     private Principal userPrincipal = null;
-
+    private HttpServletRequest request=null;
+    
     public PortalRequestWrapper(HttpServletRequest request,
             Principal userPrincipal)
     {
-        super(request);
+        this.request = request;
         this.userPrincipal = userPrincipal;
     }
 
@@ -55,6 +65,390 @@
         {
             return null;
         }
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.ServletRequest#getAttribute(java.lang.String)
+     */
+    public Object getAttribute(String arg0)
+    {
+        return request.getAttribute(arg0);
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.ServletRequest#getAttributeNames()
+     */
+    public Enumeration getAttributeNames()
+    {
+        return request.getAttributeNames();
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.http.HttpServletRequest#getAuthType()
+     */
+    public String getAuthType()
+    {
+        return request.getAuthType();
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.ServletRequest#getCharacterEncoding()
+     */
+    public String getCharacterEncoding()
+    {
+        return request.getCharacterEncoding();
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.ServletRequest#getContentLength()
+     */
+    public int getContentLength()
+    {
+        return request.getContentLength();
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.ServletRequest#getContentType()
+     */
+    public String getContentType()
+    {
+        return request.getContentType();
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.http.HttpServletRequest#getContextPath()
+     */
+    public String getContextPath()
+    {
+        return request.getContextPath();
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.http.HttpServletRequest#getCookies()
+     */
+    public Cookie[] getCookies()
+    {
+        return request.getCookies();
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.http.HttpServletRequest#getDateHeader(java.lang.String)
+     */
+    public long getDateHeader(String arg0)
+    {
+        return request.getDateHeader(arg0);
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.http.HttpServletRequest#getHeader(java.lang.String)
+     */
+    public String getHeader(String arg0)
+    {
+        return request.getHeader(arg0);
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.http.HttpServletRequest#getHeaderNames()
+     */
+    public Enumeration getHeaderNames()
+    {
+        return request.getHeaderNames();
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.http.HttpServletRequest#getHeaders(java.lang.String)
+     */
+    public Enumeration getHeaders(String arg0)
+    {
+        return request.getHeaders(arg0);
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.ServletRequest#getInputStream()
+     */
+    public ServletInputStream getInputStream() throws IOException
+    {
+        return request.getInputStream();
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.http.HttpServletRequest#getIntHeader(java.lang.String)
+     */
+    public int getIntHeader(String arg0)
+    {
+        return request.getIntHeader(arg0);
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.ServletRequest#getLocale()
+     */
+    public Locale getLocale()
+    {
+        return request.getLocale();
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.ServletRequest#getLocales()
+     */
+    public Enumeration getLocales()
+    {
+        return request.getLocales();
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.http.HttpServletRequest#getMethod()
+     */
+    public String getMethod()
+    {
+        return request.getMethod();
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.ServletRequest#getParameter(java.lang.String)
+     */
+    public String getParameter(String arg0)
+    {
+        return request.getParameter(arg0);
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.ServletRequest#getParameterMap()
+     */
+    public Map getParameterMap()
+    {
+        return request.getParameterMap();
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.ServletRequest#getParameterNames()
+     */
+    public Enumeration getParameterNames()
+    {
+        return request.getParameterNames();
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.ServletRequest#getParameterValues(java.lang.String)
+     */
+    public String[] getParameterValues(String arg0)
+    {
+        return request.getParameterValues(arg0);
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.http.HttpServletRequest#getPathInfo()
+     */
+    public String getPathInfo()
+    {
+        return request.getPathInfo();
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.http.HttpServletRequest#getPathTranslated()
+     */
+    public String getPathTranslated()
+    {
+        return request.getPathTranslated();
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.ServletRequest#getProtocol()
+     */
+    public String getProtocol()
+    {
+        return request.getProtocol();
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.http.HttpServletRequest#getQueryString()
+     */
+    public String getQueryString()
+    {
+        return request.getQueryString();
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.ServletRequest#getReader()
+     */
+    public BufferedReader getReader() throws IOException
+    {
+        return request.getReader();
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.ServletRequest#getRealPath(java.lang.String)
+     */
+    public String getRealPath(String arg0)
+    {
+        return request.getRealPath(arg0);
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.ServletRequest#getRemoteAddr()
+     */
+    public String getRemoteAddr()
+    {
+        return request.getRemoteAddr();
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.ServletRequest#getRemoteHost()
+     */
+    public String getRemoteHost()
+    {
+        return request.getRemoteHost();
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.ServletRequest#getRequestDispatcher(java.lang.String)
+     */
+    public RequestDispatcher getRequestDispatcher(String arg0)
+    {
+        return request.getRequestDispatcher(arg0);
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.http.HttpServletRequest#getRequestedSessionId()
+     */
+    public String getRequestedSessionId()
+    {
+        return request.getRequestedSessionId();
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.http.HttpServletRequest#getRequestURI()
+     */
+    public String getRequestURI()
+    {
+        return request.getRequestURI();
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.http.HttpServletRequest#getRequestURL()
+     */
+    public StringBuffer getRequestURL()
+    {
+        return request.getRequestURL();
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.ServletRequest#getScheme()
+     */
+    public String getScheme()
+    {
+        return request.getScheme();
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.ServletRequest#getServerName()
+     */
+    public String getServerName()
+    {
+        return request.getServerName();
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.ServletRequest#getServerPort()
+     */
+    public int getServerPort()
+    {
+        return request.getServerPort();
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.http.HttpServletRequest#getServletPath()
+     */
+    public String getServletPath()
+    {
+        return request.getServletPath();
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.http.HttpServletRequest#getSession()
+     */
+    public HttpSession getSession()
+    {
+        return request.getSession();
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.http.HttpServletRequest#getSession(boolean)
+     */
+    public HttpSession getSession(boolean arg0)
+    {
+        return request.getSession(arg0);
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.http.HttpServletRequest#isRequestedSessionIdFromCookie()
+     */
+    public boolean isRequestedSessionIdFromCookie()
+    {
+        return request.isRequestedSessionIdFromCookie();
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.http.HttpServletRequest#isRequestedSessionIdFromUrl()
+     */
+    public boolean isRequestedSessionIdFromUrl()
+    {
+        return request.isRequestedSessionIdFromUrl();
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.http.HttpServletRequest#isRequestedSessionIdFromURL()
+     */
+    public boolean isRequestedSessionIdFromURL()
+    {
+        return request.isRequestedSessionIdFromURL();
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.http.HttpServletRequest#isRequestedSessionIdValid()
+     */
+    public boolean isRequestedSessionIdValid()
+    {
+        return request.isRequestedSessionIdValid();
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.ServletRequest#isSecure()
+     */
+    public boolean isSecure()
+    {
+        return request.isSecure();
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.http.HttpServletRequest#isUserInRole(java.lang.String)
+     */
+    public boolean isUserInRole(String arg0)
+    {
+        return request.isUserInRole(arg0);
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.ServletRequest#removeAttribute(java.lang.String)
+     */
+    public void removeAttribute(String arg0)
+    {
+        request.removeAttribute(arg0);
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.ServletRequest#setAttribute(java.lang.String, java.lang.Object)
+     */
+    public void setAttribute(String arg0, Object arg1)
+    {
+        request.setAttribute(arg0, arg1);
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.ServletRequest#setCharacterEncoding(java.lang.String)
+     */
+    public void setCharacterEncoding(String arg0) throws UnsupportedEncodingException
+    {
+        request.setCharacterEncoding(arg0);
     }
 
 }

Modified: portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/PortalReservedParameters.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/PortalReservedParameters.java?rev=391321&r1=391320&r2=391321&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/PortalReservedParameters.java
(original)
+++ portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/PortalReservedParameters.java
Tue Apr  4 07:27:18 2006
@@ -53,5 +53,6 @@
     public static final String RESOVLER_CACHE_ATTR = "org.apache.jetspeed.resovler.cache";
     public static final String PORTLET_WINDOW_ATTRIBUTE = "org.apache.jetspeed.portlet.window";
     public static final String PAGE_THEME_ATTRIBUTE = "org.apache.jetspeed.theme";
+    public static final String PORTAL_FILTER_ATTRIBUTE = "org.apache.jetspeed.login.filter.PortalFilter";
     
 }

Modified: portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/resources/LayoutResource.properties
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/resources/LayoutResource.properties?rev=391321&r1=391320&r2=391321&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/resources/LayoutResource.properties
(original)
+++ portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/resources/LayoutResource.properties
Tue Apr  4 07:27:18 2006
@@ -51,3 +51,8 @@
 portal.page.editing.moveLayoutDown=Move Layout Down
 portal.page.editing.moveLayoutRight=Move Layout Right
 
+portal.loginform.logout=Logout
+portal.loginform.login=Login
+portal.loginform.username=Username:
+portal.loginform.password=Password:
+portal.loginform.error.invalid_password=Invalid password

Modified: portals/jetspeed-2/trunk/src/webapp/decorations/layout/blueocean/css/styles.css
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/src/webapp/decorations/layout/blueocean/css/styles.css?rev=391321&r1=391320&r2=391321&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/decorations/layout/blueocean/css/styles.css (original)
+++ portals/jetspeed-2/trunk/src/webapp/decorations/layout/blueocean/css/styles.css Tue Apr
 4 07:27:18 2006
@@ -75,6 +75,28 @@
 
 
 
+.layout-blueocean .button
+{
+    background-image:url(../images/button_background.gif);
+    padding-left:5px;
+    padding-right:5px;
+    padding-top:2px;
+    padding-bottom:2px;
+    margin:1px;
+    text-align:center;
+    vertical-align:middle;
+}
+
+.layout-blueocean .button a
+{
+    color:#0080b0;
+    text-decoration: none;
+    font-weight:bold;
+    font-family:Verdana,Helvetica,Arial,sans-serif;
+    voice-family:"\"}\"";
+    voice-family:inherit;
+    font-size:9pt;
+}
 
 .layout-blueocean #banner {
     margin:0px;
@@ -97,26 +119,40 @@
 .layout-blueocean #banner .action {
     margin:0px;
     padding:0px;
-    height:30px;
+    height:20px;
     vertical-align:middle;
 }
 
 .layout-blueocean #banner .logo {
-    vertical-align:top;
-    height:70px;
+    height:95px;
+}
+
+.layout-blueocean #banner .logo img {
+    margin-top:25px;
 }
 
 .layout-blueocean #banner .info {
     vertical-align:top;
     text-align:right;
-    height:70px;
+    height:95px;
 
     color:#ffffff;
-    font-weight:bold;
-    font-family:monospace;
+    font-family:Verdana,Helvetica,Arial,sans-serif;
     voice-family:"\"}\"";
     voice-family:inherit;
     font-size:10pt;
+}
+
+.layout-blueocean #banner .info div {
+    margin:0px;
+    padding:2px;
+}
+
+.layout-blueocean #banner .info input {
+    border:1px;
+    border-color:#0000ff;
+
+    font-weight:bold;
 }
 
 .layout-blueocean #poweredby {

Modified: portals/jetspeed-2/trunk/src/webapp/decorations/layout/blueocean/header.vm
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/src/webapp/decorations/layout/blueocean/header.vm?rev=391321&r1=391320&r2=391321&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/decorations/layout/blueocean/header.vm (original)
+++ portals/jetspeed-2/trunk/src/webapp/decorations/layout/blueocean/header.vm Tue Apr  4
07:27:18 2006
@@ -26,6 +26,13 @@
 #* Username *#
 #set($username = $JS2RequestContext.request.remoteUser)
 
+#* Login Error Code *#
+#set($errorcode = $JS2RequestContext.getSessionAttribute("org.apache.jetspeed.login.errorcode"))
+
+#* check Portal Filter *#
+#set($portalFilter = $JS2RequestContext.getRequestAttribute("org.apache.jetspeed.login.filter.PortalFilter"))
+
+
 <html>
   <head>
 	<base href="#BaseHref()">
@@ -51,14 +58,6 @@
       <div id="banner">
         <table>
           <tr>
-            <td>&nbsp;</td>
-            <td>
-              <div class="action">
-                &nbsp;
-              </div>
-            </td>
-          </tr>
-          <tr>
             <td>
               <div class="logo">
               <img src="#GetPageResource('images/logo.gif')" alt="Logo" border="0"/>
@@ -66,8 +65,21 @@
             </td>
             <td>
               <div class="info">
+## For PortalFilter
+#if($portalFilter)
 #if($username)
-                Username: $username<br/>
+                <div>$messages.getString("portal.loginform.username") $username</div>
+                <div class="action"><span class="button"><a href="#BaseHref()login/logout">$messages.getString("portal.loginform.logout")</a></span></div>
+#else
+                <form name="loginform" method="POST">
+                  <div>$messages.getString("portal.loginform.username") <input type="text"
size="10" name="org.apache.jetspeed.login.username" value=""></div>
+                  <div>$messages.getString("portal.loginform.password") <input type="password"
size="10" name="org.apache.jetspeed.login.password"></div>
+                  <div class="action"><span class="button"><a href="#" onclick="javascript:document.loginform.submit()">$messages.getString("portal.loginform.login")</a></span></div>
+  #if($errorcode == 2) ## ERROR_INVALID_PASSWORD
+                  <div>$messages.getString("portal.loginform.error.invalid_password")</div>
+  #end
+                </form>
+#end
 #end
               </div>
             </td>

Added: portals/jetspeed-2/trunk/src/webapp/decorations/layout/blueocean/images/button_background.gif
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/src/webapp/decorations/layout/blueocean/images/button_background.gif?rev=391321&view=auto
==============================================================================
Binary file - no diff available.

Propchange: portals/jetspeed-2/trunk/src/webapp/decorations/layout/blueocean/images/button_background.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream



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


Mime
View raw message