You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rave.apache.org by ja...@apache.org on 2011/06/30 20:31:08 UTC

svn commit: r1141653 - in /incubator/rave/trunk/rave-portal/src/main/webapp: WEB-INF/applicationContext-security.xml WEB-INF/tags/rave_generic_page.tag WEB-INF/views/home.jsp WEB-INF/views/store.jsp WEB-INF/views/widget.jsp css/default.css login.jsp

Author: jasha
Date: Thu Jun 30 18:31:07 2011
New Revision: 1141653

URL: http://svn.apache.org/viewvc?rev=1141653&view=rev
Log:
RAVE-36 Rave styled login page. Bypassing security for css, scripts and static images

Added:
    incubator/rave/trunk/rave-portal/src/main/webapp/login.jsp
Modified:
    incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/applicationContext-security.xml
    incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/tags/rave_generic_page.tag
    incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/views/home.jsp
    incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/views/store.jsp
    incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/views/widget.jsp
    incubator/rave/trunk/rave-portal/src/main/webapp/css/default.css

Modified: incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/applicationContext-security.xml
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/applicationContext-security.xml?rev=1141653&r1=1141652&r2=1141653&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/applicationContext-security.xml (original)
+++ incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/applicationContext-security.xml Thu Jun 30 18:31:07 2011
@@ -27,29 +27,34 @@
 	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
 			    http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd">
 
-	<security:http auto-config="true" use-expressions="true" disable-url-rewriting="true">
-	  <!-- all urls must be authenticated -->
-          <security:intercept-url pattern="/**"
-			          access="isAuthenticated()" />
-           <security:openid-login user-service-ref="userService">
-	        <security:attribute-exchange>
-               	<!-- Supported by MyOpenID.com -->
-				<security:openid-attribute name="firstName" type="http://schema.openid.net/namePerson/first"/>
-				<security:openid-attribute name="lastName" type="http://schema.openid.net/namePerson/last"/>
-				<security:openid-attribute name="email" type="http://schema.openid.net/contact/email" required="true"/>
-				<!-- security:openid-attribute name="language" type="http://schema.openid.net/language/pref"/>
-				<security:openid-attribute name="birthDate" type="http://schema.openid.net/birthDate"/>
-				<security:openid-attribute name="namePerson" type="http://schema.openid.net/namePerson" required="true"/>
-				<security:openid-attribute name="nickname" type="http://schema.openid.net/namePerson/friendly" required="true"/>
-				<security:openid-attribute name="country" type="http://schema.openid.net/contact/country/home"/> 
-				-->
+    <security:http auto-config="true" use-expressions="true" disable-url-rewriting="true">
+        <security:intercept-url pattern="/login.jsp*" filters="none" />
+        <security:intercept-url pattern="/css/**" access="permitAll"/>
+        <security:intercept-url pattern="/images/**" access="permitAll"/>
+        <security:intercept-url pattern="/script/**" access="permitAll"/>
+        <!-- all urls must be authenticated -->
+        <security:intercept-url pattern="/**"
+                                access="isAuthenticated()"/>
+        <security:openid-login user-service-ref="userService">
+            <security:attribute-exchange>
+                <!-- Supported by MyOpenID.com -->
+                <security:openid-attribute name="firstName" type="http://schema.openid.net/namePerson/first"/>
+                <security:openid-attribute name="lastName" type="http://schema.openid.net/namePerson/last"/>
+                <security:openid-attribute name="email" type="http://schema.openid.net/contact/email" required="true"/>
+                <!-- security:openid-attribute name="language" type="http://schema.openid.net/language/pref"/>
+                    <security:openid-attribute name="birthDate" type="http://schema.openid.net/birthDate"/>
+                    <security:openid-attribute name="namePerson" type="http://schema.openid.net/namePerson" required="true"/>
+                    <security:openid-attribute name="nickname" type="http://schema.openid.net/namePerson/friendly" required="true"/>
+                    <security:openid-attribute name="country" type="http://schema.openid.net/contact/country/home"/>
+                    -->
             </security:attribute-exchange>
-	      </security:openid-login>
-          <security:logout/>
-	</security:http>
+        </security:openid-login>
+        <security:form-login login-page="/login.jsp" />
+        <security:logout/>
+    </security:http>
 
-	<security:authentication-manager>
+    <security:authentication-manager>
 		<security:authentication-provider
 			user-service-ref="userService" />
 	</security:authentication-manager>
-</beans>
\ No newline at end of file
+</beans>

Modified: incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/tags/rave_generic_page.tag
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/tags/rave_generic_page.tag?rev=1141653&r1=1141652&r2=1141653&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/tags/rave_generic_page.tag (original)
+++ incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/tags/rave_generic_page.tag Thu Jun 30 18:31:07 2011
@@ -22,12 +22,14 @@
 <%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
 <%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
+<%@ attribute name="pageTitle" required="false" description="The title of the page, will appear in the title bar" %>
 <%--
 This tag will provide simple template layouts for pages that use it. See for example home.jsp.
 --%>
 <html>
   <head>
-     <title>Rave Home</title>
+     <meta charset="UTF-8"/>
+     <title><c:out value="${pageTitle}"/></title>
      <link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/themes/base/jquery-ui.css"/>
      <link rel="stylesheet" href="<c:url value="/css/default.css" />" />
   </head>

Modified: incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/views/home.jsp
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/views/home.jsp?rev=1141653&r1=1141652&r2=1141653&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/views/home.jsp (original)
+++ incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/views/home.jsp Thu Jun 30 18:31:07 2011
@@ -29,7 +29,7 @@
 
 <c:set var="opensocial_engine_url" value="${openSocialEnv.engineProtocol}://${openSocialEnv.engineRoot}${openSocialEnv.engineGadgetPath}"/>
 
-<rave:rave_generic_page>
+<rave:rave_generic_page pageTitle="Home - Rave">
 <c:set var="defaultPage" value="${pages[0]}"/>
 <div id="header">
     <a href="<spring:url value="/j_spring_security_logout" htmlEscape="true" />">Logout</a>

Modified: incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/views/store.jsp
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/views/store.jsp?rev=1141653&r1=1141652&r2=1141653&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/views/store.jsp (original)
+++ incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/views/store.jsp Thu Jun 30 18:31:07 2011
@@ -22,7 +22,7 @@
 <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
 <%@ taglib tagdir="/WEB-INF/tags" prefix="rave"%>
 
-<rave:rave_generic_page>
+<rave:rave_generic_page pageTitle="Widget Store - Rave">
 <div id="banner">
     <span class="backToPage">
         <a href="<spring:url value="/index.html" />">Back to Rave</a>
@@ -72,4 +72,4 @@
 </script>
 <script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
 <script src="<spring:url value="/script/rave_api.js"/>"></script>
-</rave:rave_generic_page>
\ No newline at end of file
+</rave:rave_generic_page>

Modified: incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/views/widget.jsp
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/views/widget.jsp?rev=1141653&r1=1141652&r2=1141653&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/views/widget.jsp (original)
+++ incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/views/widget.jsp Thu Jun 30 18:31:07 2011
@@ -23,7 +23,7 @@
 <%@ taglib tagdir="/WEB-INF/tags" prefix="rave"%>
 <jsp:useBean id="widget" scope="request" class="org.apache.rave.portal.model.Widget" />
 
-<rave:rave_generic_page>
+<rave:rave_generic_page pageTitle="${widget.title} - Rave">
 <div id="banner">
     <span class="backToPage">
         <a href="<spring:url value="/index.html" />">Back to Rave</a>
@@ -101,4 +101,4 @@
 <script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
 <script src="<spring:url value="/script/rave_api.js"/>"></script>
 
-</rave:rave_generic_page>
\ No newline at end of file
+</rave:rave_generic_page>

Modified: incubator/rave/trunk/rave-portal/src/main/webapp/css/default.css
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal/src/main/webapp/css/default.css?rev=1141653&r1=1141652&r2=1141653&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal/src/main/webapp/css/default.css (original)
+++ incubator/rave/trunk/rave-portal/src/main/webapp/css/default.css Thu Jun 30 18:31:07 2011
@@ -265,4 +265,17 @@ dt {
 button.widget-toolbar-btn {
 	width: 1em;
 }
-	
\ No newline at end of file
+
+fieldset{
+    margin: 0;
+    border:none
+}
+p label {
+    width: 120px;
+    float: left;
+    display: block;
+}
+
+input.long {
+    width:400px;
+}
\ No newline at end of file

Added: incubator/rave/trunk/rave-portal/src/main/webapp/login.jsp
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal/src/main/webapp/login.jsp?rev=1141653&view=auto
==============================================================================
--- incubator/rave/trunk/rave-portal/src/main/webapp/login.jsp (added)
+++ incubator/rave/trunk/rave-portal/src/main/webapp/login.jsp Thu Jun 30 18:31:07 2011
@@ -0,0 +1,61 @@
+<%--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you 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.
+  --%>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<%@ taglib tagdir="/WEB-INF/tags" prefix="rave"%>
+<rave:rave_generic_page pageTitle="Login - Rave">
+<div id="content">
+
+    <h1>Login</h1>
+
+    <h2>Username and Password</h2>
+    <form id="loginForm" name="loginForm" action="j_spring_security_check" method="post">
+        <fieldset>
+            <p>
+                <label for="usernameField">Username: </label>
+                <input id="usernameField" type="text" name="j_username"/>
+            </p>
+
+            <p>
+                <label for="passwordField">Password: </label>
+                <input id="passwordField" type="password" name="j_password"/>
+            </p>
+        </fieldset>
+        <fieldset>
+            <input type="submit" value="Login"/>
+        </fieldset>
+    </form>
+
+    <h2>OpenID Identity</h2>
+    <form id="oidForm" name='oidf' action='j_spring_openid_security_check' method='POST'>
+        <fieldset>
+            <p>
+                <label for="openid_identifier">Identity: </label>
+                <input type='text' id="openid_identifier" name='openid_identifier' class="long"/>
+            </p>
+        </fieldset>
+        <fieldset>
+            <input type="submit" value="Login with OpenID"/>
+        </fieldset>
+
+    </form>
+</div>
+<script>
+document.loginForm.j_username.focus();
+</script>
+</rave:rave_generic_page>