continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r357031 - in /maven/continuum/trunk/continuum-webapp/src/main: java/org/apache/maven/continuum/web/action/ resources/ resources/META-INF/plexus/ resources/localization/ webapp/ webapp/WEB-INF/ webapp/navigations/
Date Thu, 15 Dec 2005 15:16:31 GMT
Author: evenisse
Date: Thu Dec 15 07:16:19 2005
New Revision: 357031

URL: http://svn.apache.org/viewcvs?rev=357031&view=rev
Log:
o Add more internationalization
o Add a sample static login page

Added:
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/LoginAction.java
  (with props)
    maven/continuum/trunk/continuum-webapp/src/main/webapp/login.jsp   (with props)
Modified:
    maven/continuum/trunk/continuum-webapp/src/main/resources/META-INF/plexus/components.xml
    maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
    maven/continuum/trunk/continuum-webapp/src/main/resources/xwork.xml
    maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/decorators.xml
    maven/continuum/trunk/continuum-webapp/src/main/webapp/navigations/DefaultTop.jsp

Added: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/LoginAction.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/LoginAction.java?rev=357031&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/LoginAction.java
(added)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/LoginAction.java
Thu Dec 15 07:16:19 2005
@@ -0,0 +1,52 @@
+package org.apache.maven.continuum.web.action;
+
+import org.apache.maven.continuum.Continuum;
+
+import com.opensymphony.xwork.ActionSupport;
+
+import java.util.Collection;
+
+public class LoginAction
+    extends ActionSupport
+{
+    private String username;
+
+    private String password;
+
+    public String execute()
+        throws Exception
+    {
+        //TODO
+        if ( username == null || password == null || !"testuser".equals( username ) )
+        {
+            //TODO : i18n
+            addFieldError( "username", "Username/password incorrect");
+
+            System.out.println( "Username=" + username + " - password = " + password);
+
+            return INPUT;
+        }
+        System.out.println( "SUCESS" + "Username=" + username + " - password = " + password);
+        return SUCCESS;
+    }
+
+    public String doDefault()
+    {
+        return INPUT;
+    }
+
+    public String getUsername()
+    {
+        return username;
+    }
+
+    public void setUsername( String username )
+    {
+        this.username = username;
+    }
+
+    public void setPassword( String password )
+    {
+        this.password = password;
+    }
+}

Propchange: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/LoginAction.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/LoginAction.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Modified: maven/continuum/trunk/continuum-webapp/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-webapp/src/main/resources/META-INF/plexus/components.xml?rev=357031&r1=357030&r2=357031&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/resources/META-INF/plexus/components.xml
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/resources/META-INF/plexus/components.xml
Thu Dec 15 07:16:19 2005
@@ -3,15 +3,25 @@
     <!--
      | Actions
      |-->
+
+    <!-- NOTE: ALL ACTIONS MUST USE PER-LOOKUP INSTANCIATION STRATEGY -->
+
     <component>
       <role>com.opensymphony.xwork.Action</role>
       <role-hint>summaryAction</role-hint>
       <implementation>org.apache.maven.continuum.web.action.SummaryAction</implementation>
+      <instantiation-strategy>per-lookup</instantiation-strategy>
       <requirements>
         <requirement>
           <role>org.apache.maven.continuum.Continuum</role>
         </requirement>
       </requirements>
+    </component>
+    <component>
+      <role>com.opensymphony.xwork.Action</role>
+      <role-hint>loginAction</role-hint>
+      <implementation>org.apache.maven.continuum.web.action.LoginAction</implementation>
+      <instantiation-strategy>per-lookup</instantiation-strategy>
     </component>
 
     <!--

Modified: maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties?rev=357031&r1=357030&r2=357031&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
Thu Dec 15 07:16:19 2005
@@ -6,11 +6,25 @@
 message.error = Error
 
 // ----------------------------------------------------------------------
+// Page: Top
+// ----------------------------------------------------------------------
+top.logo.default = [Your company logo here]
+
+// ----------------------------------------------------------------------
 // Page: About
 // ----------------------------------------------------------------------
 about.page.title = Continuum - About
 about.section.title = About Continuum
 about.version = Version : ${project.version}
+
+// ----------------------------------------------------------------------
+// Page: Login
+// ----------------------------------------------------------------------
+login.page.title = Continuum - Authentication
+login.section.title = Authentication
+login.username = Username
+login.password = Password
+login.submit = Connect
 
 // ----------------------------------------------------------------------
 // Page: Summary

Modified: maven/continuum/trunk/continuum-webapp/src/main/resources/xwork.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-webapp/src/main/resources/xwork.xml?rev=357031&r1=357030&r2=357031&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/resources/xwork.xml (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/resources/xwork.xml Thu Dec 15 07:16:19
2005
@@ -11,5 +11,10 @@
                 class="summaryAction">
             <result name="success">summary.jsp</result>
         </action>
+        <action name="login"
+                class="loginAction">
+            <result name="input">login.jsp</result>
+            <result name="success" type="redirect">summary.action</result>
+        </action>
     </package>
 </xwork>

Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/decorators.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/decorators.xml?rev=357031&r1=357030&r2=357031&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/decorators.xml (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/decorators.xml Thu Dec
15 07:16:19 2005
@@ -1,7 +1,7 @@
 <decorators defaultdir="/decorators">
-    <decorator name="none" page="none.jsp">
+    <!-- decorator name="none" page="none.jsp">
         <pattern>/login*</pattern>
-    </decorator>
+    </decorator -->
     <decorator name="default" page="default.jsp">
         <pattern>/*</pattern>
     </decorator>

Added: maven/continuum/trunk/continuum-webapp/src/main/webapp/login.jsp
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-webapp/src/main/webapp/login.jsp?rev=357031&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/login.jsp (added)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/login.jsp Thu Dec 15 07:16:19 2005
@@ -0,0 +1,18 @@
+<%@ taglib uri="webwork" prefix="ww" %>
+<html>
+  <ww:i18n name="localization.Continuum">
+    <head>
+        <title><ww:text name="login.page.title"/></title>
+    </head>
+    <body>
+      <div id="axial" class="h3">
+        <h3><ww:text name="login.section.title"/></h3>
+        <ww:form action="login" method="post">
+            <ww:textfield label="%{getText('login.username')}" name="username"/>
+            <ww:password label="%{getText('login.password')}" name="password"/>
+            <ww:submit value="%{getText('login.submit')}"/>
+        </ww:form>
+      </div>
+    </body>
+  </ww:i18n>
+</html>

Propchange: maven/continuum/trunk/continuum-webapp/src/main/webapp/login.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/continuum/trunk/continuum-webapp/src/main/webapp/login.jsp
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/navigations/DefaultTop.jsp
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-webapp/src/main/webapp/navigations/DefaultTop.jsp?rev=357031&r1=357030&r2=357031&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/navigations/DefaultTop.jsp (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/navigations/DefaultTop.jsp Thu
Dec 15 07:16:19 2005
@@ -1,11 +1,12 @@
 <%@ taglib uri="webwork" prefix="ww" %>
+<ww:i18n name="localization.Continuum">
 <div id="banner">
   <table border="1" cellspacing="0" cellpadding="8" width="100%">
     <tbody>
       <tr>
         <td>
             <a href="http://maven.apache.org/continuum/">
-              <b><font color="red">TODO</font></b>[Your company logo
here]
+              <b><font color="red">TODO</font></b><ww:text name="top.logo.default"/>
             </a>
         </td>
         <td>
@@ -26,6 +27,7 @@
   </div>
 
   <div>
-      <b><font color="red">TODO</font></b>Welcome, <b>Guest</b>
- <a href="$link.setPage('Login.vm')">Login</a>
+      <b><font color="red">TODO</font></b>Welcome, <b>Guest</b>
- <a href="<ww:url value="login!default.action"/>">Login</a>
   </div>
 </div>
+</ww:i18n>
\ No newline at end of file



Mime
View raw message