You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mina.apache.org by ng...@apache.org on 2011/01/14 09:40:41 UTC

svn commit: r1058892 - in /mina/vysper/trunk/server/admin-console: ./ src/main/java/org/apache/vysper/console/ src/main/resources/META-INF/velocity/ src/main/resources/resources/ src/main/resources/velocity/ src/main/webapp/WEB-INF/

Author: ngn
Date: Fri Jan 14 08:40:40 2011
New Revision: 1058892

URL: http://svn.apache.org/viewvc?rev=1058892&view=rev
Log:
Improved design of admin console GUI
Handle timeout from XMPP server

Added:
    mina/vysper/trunk/server/admin-console/src/main/resources/resources/
    mina/vysper/trunk/server/admin-console/src/main/resources/resources/body-bg.png   (with props)
    mina/vysper/trunk/server/admin-console/src/main/resources/resources/common.css
    mina/vysper/trunk/server/admin-console/src/main/resources/resources/content-bg.png   (with props)
    mina/vysper/trunk/server/admin-console/src/main/resources/resources/error.png   (with props)
    mina/vysper/trunk/server/admin-console/src/main/resources/resources/favicon.ico   (with props)
    mina/vysper/trunk/server/admin-console/src/main/resources/resources/footer.png   (with props)
    mina/vysper/trunk/server/admin-console/src/main/resources/resources/header.png   (with props)
    mina/vysper/trunk/server/admin-console/src/main/resources/resources/info.png   (with props)
    mina/vysper/trunk/server/admin-console/src/main/resources/resources/vysper.css
    mina/vysper/trunk/server/admin-console/src/main/resources/resources/vysper_logo.png   (with props)
    mina/vysper/trunk/server/admin-console/src/main/resources/resources/warn.png   (with props)
    mina/vysper/trunk/server/admin-console/src/main/resources/velocity/
      - copied from r1057909, mina/vysper/trunk/server/admin-console/src/main/resources/META-INF/velocity/
Removed:
    mina/vysper/trunk/server/admin-console/src/main/resources/META-INF/velocity/
    mina/vysper/trunk/server/admin-console/src/main/resources/velocity/login.vm
    mina/vysper/trunk/server/admin-console/src/main/resources/velocity/nav.vm
Modified:
    mina/vysper/trunk/server/admin-console/pom.xml
    mina/vysper/trunk/server/admin-console/src/main/java/org/apache/vysper/console/AdminConsoleController.java
    mina/vysper/trunk/server/admin-console/src/main/java/org/apache/vysper/console/HtmlFormBuilder.java
    mina/vysper/trunk/server/admin-console/src/main/resources/velocity/index.vm
    mina/vysper/trunk/server/admin-console/src/main/resources/velocity/layout.vm
    mina/vysper/trunk/server/admin-console/src/main/webapp/WEB-INF/console-servlet.xml

Modified: mina/vysper/trunk/server/admin-console/pom.xml
URL: http://svn.apache.org/viewvc/mina/vysper/trunk/server/admin-console/pom.xml?rev=1058892&r1=1058891&r2=1058892&view=diff
==============================================================================
--- mina/vysper/trunk/server/admin-console/pom.xml (original)
+++ mina/vysper/trunk/server/admin-console/pom.xml Fri Jan 14 08:40:40 2011
@@ -100,5 +100,16 @@
 				</configuration>
 			</plugin>
 		</plugins>
+		<resources>
+			<resource>
+				<directory>src/main/resources</directory>
+				<includes>
+					<include>**/*.png</include>
+					<include>**/*.css</include>
+					<include>**/*.ico</include>
+					<include>**/*.vm</include>
+				</includes>
+			</resource>
+		</resources>
 	</build>
 </project>

Modified: mina/vysper/trunk/server/admin-console/src/main/java/org/apache/vysper/console/AdminConsoleController.java
URL: http://svn.apache.org/viewvc/mina/vysper/trunk/server/admin-console/src/main/java/org/apache/vysper/console/AdminConsoleController.java?rev=1058892&r1=1058891&r2=1058892&view=diff
==============================================================================
--- mina/vysper/trunk/server/admin-console/src/main/java/org/apache/vysper/console/AdminConsoleController.java (original)
+++ mina/vysper/trunk/server/admin-console/src/main/java/org/apache/vysper/console/AdminConsoleController.java Fri Jan 14 08:40:40 2011
@@ -20,7 +20,9 @@
 package org.apache.vysper.console;
 
 import java.util.Arrays;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpSession;
@@ -54,11 +56,12 @@ public class AdminConsoleController {
 
     public static final String SESSION_FIELD = "vysper-admingui-sessionid";
     
-    public static final List<String> COMMANDS = Arrays.asList(
-            "get-online-users-num",
-            "add-user",
-            "change-user-password"
-            );
+    public static final Map<String, String> COMMANDS = new HashMap<String, String>();
+    static {
+        COMMANDS.put("get-online-users-num", "Get online users");
+        COMMANDS.put("add-user", "Add user");
+        COMMANDS.put("change-user-password", "Change user password");
+    }
     
     private ConnectionConfiguration connectionConfiguration;
     
@@ -76,6 +79,8 @@ public class AdminConsoleController {
         if(client == null) {
             // login
             return login();
+        } else if(!client.isConnected()) {
+            return login("Disconnected from XMPP server, please log in again");
         } else {
             ModelAndView mav = new ModelAndView("index");
             mav.addObject(MODEL_AUTHENTICATED, getUserName(client));
@@ -95,8 +100,10 @@ public class AdminConsoleController {
         if(client == null) {
             // login
             return login();
+        } else if(!client.isConnected()) {
+            return login("Disconnected from XMPP server, please log in again");
         } else {
-            if(!COMMANDS.contains(command)) {
+            if(!COMMANDS.keySet().contains(command)) {
                 throw new ResourceNotFoundException();
             }
             
@@ -117,9 +124,9 @@ public class AdminConsoleController {
         if(client == null) {
             // login
             return login();
+        } else if(!client.isConnected()) {
+            return login("Disconnected from XMPP server, please log in again");
         } else {
-            System.out.println(request.getParameterMap());
-            
             @SuppressWarnings("unchecked")
             AdHocCommandData requestCommand = adHocCommandDataBuilder.build(request.getParameterMap());
             requestCommand.setType(Type.SET);
@@ -136,30 +143,33 @@ public class AdminConsoleController {
         try {
             Packet response = client.sendSync(requestCommand);
             
-            AdHocCommandData responseData = (AdHocCommandData) response;
-            DataForm form = responseData.getForm();
-            
             StringBuffer htmlForm = new StringBuffer();
-            
-            for(AdHocCommandNote note : responseData.getNotes()) {
-                htmlForm.append("<p class='note " + note.getType() + "'>" + note.getValue() + "</p>");
-            }
-            
-            htmlForm.append("<form action='' method='post'>");
-            htmlForm.append("<input type='hidden' name='" + SESSION_FIELD + "' value='" + responseData.getSessionID() + "' />");
-
-            htmlForm.append(htmlFormBuilder.build(form));
-            if(Status.executing.equals(responseData.getStatus())) {
-                htmlForm.append("<input type='submit' value='" + command + "' />");
-            } else if(Status.completed.equals(responseData.getStatus())) {
-                if(form == null || form.getFields() == null || !form.getFields().hasNext()) {
-                    // no field, print success
-                    htmlForm.append("<p>Command successful</p>");
+            if(response != null) {
+                AdHocCommandData responseData = (AdHocCommandData) response;
+                DataForm form = responseData.getForm();
+                
+                for(AdHocCommandNote note : responseData.getNotes()) {
+                    htmlForm.append("<p class='note " + note.getType() + "'>" + note.getValue() + "</p>");
+                }
+                
+                htmlForm.append("<form action='' method='post'>");
+                htmlForm.append("<input type='hidden' name='" + SESSION_FIELD + "' value='" + responseData.getSessionID() + "' />");
+    
+                htmlForm.append(htmlFormBuilder.build(form));
+                if(Status.executing.equals(responseData.getStatus())) {
+                    htmlForm.append("<input type='submit' value='" + COMMANDS.get(command) + "' />");
+                } else if(Status.completed.equals(responseData.getStatus())) {
+                    if(form == null || form.getFields() == null || !form.getFields().hasNext()) {
+                        // no field, print success
+                        htmlForm.append("<p>Command successful</p>");
+                    }
                 }
+                htmlForm.append("</form>");
+            } else {
+                htmlForm.append("<p class='note error'>Timeout waiting for response from XMPP server</p>");
+                
             }
-            htmlForm.append("</form>");
-            System.out.println(htmlForm);
-            
+                
             ModelAndView mav = new ModelAndView("command");
             mav.addObject(MODEL_AUTHENTICATED, getUserName(client));
             mav.addObject("form", htmlForm.toString());
@@ -170,7 +180,13 @@ public class AdminConsoleController {
     }
 
     private ModelAndView login() {
-        return new ModelAndView("login");
+        return login("Please log in");
+    }
+
+    private ModelAndView login(String msg) {
+        ModelAndView mav = new ModelAndView("index");
+        mav.addObject("message", msg);
+        return mav;
     }
 
     protected ExtendedXMPPConnection createXMPPConnection() {
@@ -186,7 +202,7 @@ public class AdminConsoleController {
             session.setAttribute(SESSION_ATTRIBUTE, client);
             return new ModelAndView("redirect:");
         } catch (XMPPException e) {
-            ModelAndView mav = new ModelAndView("login");
+            ModelAndView mav = new ModelAndView("index");
             mav.addObject("error", "Failed to login to server: " + e.getMessage());
             return mav;
         }

Modified: mina/vysper/trunk/server/admin-console/src/main/java/org/apache/vysper/console/HtmlFormBuilder.java
URL: http://svn.apache.org/viewvc/mina/vysper/trunk/server/admin-console/src/main/java/org/apache/vysper/console/HtmlFormBuilder.java?rev=1058892&r1=1058891&r2=1058892&view=diff
==============================================================================
--- mina/vysper/trunk/server/admin-console/src/main/java/org/apache/vysper/console/HtmlFormBuilder.java (original)
+++ mina/vysper/trunk/server/admin-console/src/main/java/org/apache/vysper/console/HtmlFormBuilder.java Fri Jan 14 08:40:40 2011
@@ -39,7 +39,6 @@ public class HtmlFormBuilder {
         while(fields.hasNext()) {
             FormField field = fields.next();
             String type = field.getType();
-            System.out.println(type);
             sb.append("<p>");
             if("hidden".equals(type)) {
                 sb.append(hiddenFieldToHtml(field));
@@ -76,11 +75,14 @@ public class HtmlFormBuilder {
     }
 
     private String fixedFieldToHtml(FormField field) {
-        return labelToHtml(field) + " <span>" + field.getValues().next() + "</span>"; 
+        StringBuffer sb = new StringBuffer();
+        if(field.getLabel() != null) sb.append(field.getLabel());
+        sb.append(" <span>" + field.getValues().next() + "</span>");
+        return sb.toString();
     }
 
     private String jidSingleFieldToHtml(FormField field) {
-        return labelToHtml(field) + "<input name='" + field.getVariable() + "' value='" + getSingleValue(field) + "' />";
+        return labelToHtml(field) + "<input name='" + field.getVariable() + "' value='" + getSingleValue(field) + "' type='email' placeholder='example@vysper.org' />";
     }
     
     private String textSingleFieldToHtml(FormField field) {

Added: mina/vysper/trunk/server/admin-console/src/main/resources/resources/body-bg.png
URL: http://svn.apache.org/viewvc/mina/vysper/trunk/server/admin-console/src/main/resources/resources/body-bg.png?rev=1058892&view=auto
==============================================================================
Binary file - no diff available.

Propchange: mina/vysper/trunk/server/admin-console/src/main/resources/resources/body-bg.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: mina/vysper/trunk/server/admin-console/src/main/resources/resources/common.css
URL: http://svn.apache.org/viewvc/mina/vysper/trunk/server/admin-console/src/main/resources/resources/common.css?rev=1058892&view=auto
==============================================================================
--- mina/vysper/trunk/server/admin-console/src/main/resources/resources/common.css (added)
+++ mina/vysper/trunk/server/admin-console/src/main/resources/resources/common.css Fri Jan 14 08:40:40 2011
@@ -0,0 +1,460 @@
+/*
+ *  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.
+*/
+
+html 
+{
+	overflow-y: scroll;
+}
+
+body 
+{
+	padding: 0;
+	margin: 0;
+	font-family: 'Lucida Sans', 'Helvetica', 'Sans-serif', 'sans';
+	font-size: 77%;
+	color: #777777;
+	background-color: white;
+	background-image: url('body-bg.png');
+	background-repeat: repeat-x;
+	background-position: bottom;
+	background-attachment: fixed;
+	height: 99%;
+}
+
+h1, h2, h3, h4, h5, h6 
+{
+	font-weight: bold;
+	margin: 0.67em 0px 0.67em 0px;
+}
+
+h1 
+{
+	font-size: 197%;
+
+/* 26px equivalent */
+}
+
+h2 
+{
+	font-size: 153.9%;
+
+/* 20px equivalent */
+}
+
+h3 
+{
+	font-size: 131%;
+
+/* 17px equivalent */
+}
+
+h4 
+{
+	font-size: 93%;
+
+/* 12px equivalent */
+}
+
+h5 
+{
+	font-size: 85%;
+
+/* 11px equivalent */
+}
+
+h6 
+{
+	font-size: 77%;
+
+/* 10px equivalent */
+}
+
+#container 
+{
+	position: absolute;
+	width: 1005px;
+	margin-left: -502px;
+	left: 50%;
+}
+
+#header 
+{
+	width: 1005px;
+	height: 165px;
+	background-repeat: no-repeat;
+}
+
+#navBar 
+{
+	color: white;
+	text-align: right;
+	margin: 0px;
+	color: #ffffff;
+	font-size: 12px;
+	padding: 20px 20px 2px;
+}
+
+#navBar a, #navBar a:link, #navBar a:visited 
+{
+	color: #ffffff;
+	text-decoration: none;
+}
+
+#navBar a:hover 
+{
+	color: #ffffff;
+	border-bottom: solid #ffffff 1px;
+}
+
+#navBar a strong 
+{
+	font-size: 14px;
+	font-weight: bold;
+	color: #ffffff;
+	border-bottom: solid #ffffff 1px;
+}
+
+#content 
+{
+	background: url('content-bg.png') repeat-y;
+}
+
+#endContent 
+{
+	clear: both;
+}
+
+#leftColumn 
+{
+	float: left;
+	width: 193px;
+	padding-top: 10px;
+	margin-left: 10px;
+	line-height: 1.8em;
+}
+
+#rightColumn 
+{
+	float: left;
+	margin-left: 15px;
+	width: 762px;
+	text-align: left;
+	line-height: 1.5em;
+}
+
+#editZone 
+{
+
+
+/* Netscape 4, IE 4.x-5.0/Win and other lesser browsers will use this */
+  position: absolute;
+	right: 0;
+	top: 0;
+	height: 60px;
+	width: 60px;
+	z-index: 1000;
+}
+
+body > div#editZone 
+{
+	
+
+/* used by Opera 5+, Netscape6+/Mozilla, Konqueror, Safari, OmniWeb 4.5+, iCab, ICEbrowser */
+  position: fixed;
+}
+
+a 
+{
+	color: #777777;
+	text-decoration: underline;
+}
+
+a:hover 
+{
+	color: #000000;
+}
+
+a.none 
+{
+	background: transparent;
+	padding-right: 0px;
+}
+
+#navigation 
+{
+	padding-left: 12px;
+	font-weight: bold;
+}
+
+#navigation ul 
+{
+	margin: 0px;
+	padding: 0px;
+	margin-bottom: 10px;
+}
+
+#navigation li 
+{
+	list-style-type: none;
+	margin-left: 15px;
+	padding-left: 0px;
+}
+
+#navigation li ul 
+{
+	margin-left: 1.5em;
+}
+
+#navigation a 
+{
+	text-decoration: none;
+	color: #777777;
+}
+
+#navigation a:hover 
+{
+	color: #000000;
+	font-weight: bolder;
+}
+
+#navigation div 
+{
+	line-height: 1.5em;
+	margin-bottom: 2em;
+}
+
+#navigation h5 
+{
+	font-size: 1em;
+	margin-bottom: 0px;
+	padding-bottom: 0px;
+}
+
+#navigation strong 
+{
+	color: #000000;
+}
+
+.blogSurtitle 
+{
+	padding-bottom: 10px;
+}
+
+.blogSurtitle img 
+{
+	display: none;
+}
+
+.endsection, .pagesubheading 
+{
+	display: none;
+}
+
+.blogpost .wiki-content 
+{
+	padding-left: 25px;
+}
+
+.blogDate 
+{
+	text-decoration: none;
+	font-weight: bolder;
+	padding: 1px;
+	padding-left: 20px;
+}
+
+a.blogHeading 
+{
+	text-decoration: none;
+	font-weight: bolder;
+	padding-left: 20px;
+	margin: 10px;
+}
+
+#footer
+{
+        font-size: 11px;
+        padding-left: 215px;
+        padding-right: 20px;
+        padding-bottom: 15px;
+        text-align: center;
+        background-image: url('footer.png');
+        background-repeat: no-repeat;
+        background-position: bottom;
+}
+
+.nobr sup img 
+{
+	display: none;
+}
+
+.preformattedContent pre 
+{
+	padding: 5px 10px;
+	border: 1px dashed #1a6c0b;
+	background-color: #f0f0f0;
+}
+
+blockquote 
+{
+	margin: 10px;
+	padding: 0px 10px;
+	border-left: 1px solid #1a6c0b;
+}
+
+table.confluenceTable 
+{
+	margin: 5px;
+	border-collapse: collapse;
+}
+
+/* Added as a temporary fix for CONF-4223. The table elements appear to be inheriting the border: none attribute from the sectionMacro class */
+
+table.confluenceTable td.confluenceTd 
+{
+	border-width: 1px;
+	border-style: solid;
+	border-color: #ccc;
+	padding: 3px 4px 3px 4px;
+}
+
+/* Added as a temporary fix for CONF-4223. The table elements appear to be inheriting the border: none attribute from the sectionMacro class */
+
+table.confluenceTable th.confluenceTh 
+{
+	border-width: 1px;
+	border-style: solid;
+	border-color: #ccc;
+	padding: 3px 4px 3px 4px;
+	background-color: #f0f0f0;
+	text-align: center;
+}
+
+td.confluenceTd 
+{
+	border-width: 1px;
+	border-style: solid;
+	border-color: #ccc;
+	padding: 3px 4px 3px 4px;
+}
+
+th.confluenceTh 
+{
+	border-width: 1px;
+	border-style: solid;
+	border-color: #ccc;
+	padding: 3px 4px 3px 4px;
+	background-color: #f0f0f0;
+	text-align: center;
+}
+
+.noteMacro 
+{
+	border: 1px solid #f0c000;
+	background-color: #ffffce;
+	margin-top: 5px;
+	margin-bottom: 5px
+}
+
+.warningMacro 
+{
+	border: 1px solid #c00;
+	background-color: #fcc;
+	text-align: left;
+	margin-top: 5px;
+	margin-bottom: 5px
+}
+
+.infoMacro 
+{
+	border: 1px solid #3c78b5;
+	background-color: #D8E4F1;
+	text-align: left;
+	margin-top: 5px;
+	margin-bottom: 5px
+}
+
+.tipMacro 
+{
+	border: 1px solid #090;
+	background-color: #dfd;
+	text-align: left;
+	margin-top: 5px;
+	margin-bottom: 5px
+}
+
+.code 
+{
+	border: 1px dashed #1a6c0b;
+	font-size: 11px;
+	font-family: Courier;
+	margin: 10px;
+	line-height: 13px;
+}
+
+.codeHeader 
+{
+	background-color: #f0f0f0;
+	border-bottom: 1px dashed #1a6c0b;
+	padding: 3px;
+	text-align: center;
+}
+
+.codeContent 
+{
+	text-align: left;
+	background-color: #f0f0f0;
+	padding: 3px;
+}
+
+.code-keyword 
+{
+	color: #000091;
+	background-color: inherit;
+}
+
+.code-object 
+{
+	color: #910091;
+	background-color: inherit;
+}
+
+.code-quote 
+{
+	color: #009100;
+	background-color: inherit;
+}
+
+.code-comment 
+{
+	color: #808080;
+	background-color: inherit;
+}
+
+.code-xml .code-keyword 
+{
+	color: inherit;
+	font-weight: bold;
+}
+
+.code-tag 
+{
+	color: #000091;
+	background-color: inherit;
+}

Added: mina/vysper/trunk/server/admin-console/src/main/resources/resources/content-bg.png
URL: http://svn.apache.org/viewvc/mina/vysper/trunk/server/admin-console/src/main/resources/resources/content-bg.png?rev=1058892&view=auto
==============================================================================
Binary file - no diff available.

Propchange: mina/vysper/trunk/server/admin-console/src/main/resources/resources/content-bg.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: mina/vysper/trunk/server/admin-console/src/main/resources/resources/error.png
URL: http://svn.apache.org/viewvc/mina/vysper/trunk/server/admin-console/src/main/resources/resources/error.png?rev=1058892&view=auto
==============================================================================
Binary file - no diff available.

Propchange: mina/vysper/trunk/server/admin-console/src/main/resources/resources/error.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: mina/vysper/trunk/server/admin-console/src/main/resources/resources/favicon.ico
URL: http://svn.apache.org/viewvc/mina/vysper/trunk/server/admin-console/src/main/resources/resources/favicon.ico?rev=1058892&view=auto
==============================================================================
Binary file - no diff available.

Propchange: mina/vysper/trunk/server/admin-console/src/main/resources/resources/favicon.ico
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: mina/vysper/trunk/server/admin-console/src/main/resources/resources/footer.png
URL: http://svn.apache.org/viewvc/mina/vysper/trunk/server/admin-console/src/main/resources/resources/footer.png?rev=1058892&view=auto
==============================================================================
Binary file - no diff available.

Propchange: mina/vysper/trunk/server/admin-console/src/main/resources/resources/footer.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: mina/vysper/trunk/server/admin-console/src/main/resources/resources/header.png
URL: http://svn.apache.org/viewvc/mina/vysper/trunk/server/admin-console/src/main/resources/resources/header.png?rev=1058892&view=auto
==============================================================================
Binary file - no diff available.

Propchange: mina/vysper/trunk/server/admin-console/src/main/resources/resources/header.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: mina/vysper/trunk/server/admin-console/src/main/resources/resources/info.png
URL: http://svn.apache.org/viewvc/mina/vysper/trunk/server/admin-console/src/main/resources/resources/info.png?rev=1058892&view=auto
==============================================================================
Binary file - no diff available.

Propchange: mina/vysper/trunk/server/admin-console/src/main/resources/resources/info.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: mina/vysper/trunk/server/admin-console/src/main/resources/resources/vysper.css
URL: http://svn.apache.org/viewvc/mina/vysper/trunk/server/admin-console/src/main/resources/resources/vysper.css?rev=1058892&view=auto
==============================================================================
--- mina/vysper/trunk/server/admin-console/src/main/resources/resources/vysper.css (added)
+++ mina/vysper/trunk/server/admin-console/src/main/resources/resources/vysper.css Fri Jan 14 08:40:40 2011
@@ -0,0 +1,75 @@
+/*
+ *  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.
+*/
+
+
+h1, h2, h3, h4, h5, h6 
+{
+	color: #330066;
+}
+
+#header 
+{
+	background-image: url('header.png');
+}
+
+label {    
+	display: block;   
+}
+
+#rightColumn {
+	color: #222;
+}
+
+#navigation li {
+	text-indent:-10px;
+}
+
+#login {
+	margin-left: 20px;
+}
+
+.note {
+	padding: 5px;
+	padding-left: 25px;
+	background-repeat:no-repeat;
+	background-position: 5px 5px;
+}
+
+.note.error {
+	background-color: #FCC;
+	background-image:url('error.png');
+	border: 1px solid #FAA;
+	border-radius: 3px;
+}
+
+.note.warn {
+	background-color: #FFFFCE;
+	background-image:url('warn.png');
+	border: 1px solid #FFFF00;
+	border-radius: 3px;
+}
+
+.note.info {
+	background-color: #D8E4F1;
+	background-image:url('info.png');
+	border: 1px solid #6666FF;
+	border-radius: 3px;
+}
+
+

Added: mina/vysper/trunk/server/admin-console/src/main/resources/resources/vysper_logo.png
URL: http://svn.apache.org/viewvc/mina/vysper/trunk/server/admin-console/src/main/resources/resources/vysper_logo.png?rev=1058892&view=auto
==============================================================================
Binary file - no diff available.

Propchange: mina/vysper/trunk/server/admin-console/src/main/resources/resources/vysper_logo.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: mina/vysper/trunk/server/admin-console/src/main/resources/resources/warn.png
URL: http://svn.apache.org/viewvc/mina/vysper/trunk/server/admin-console/src/main/resources/resources/warn.png?rev=1058892&view=auto
==============================================================================
Binary file - no diff available.

Propchange: mina/vysper/trunk/server/admin-console/src/main/resources/resources/warn.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: mina/vysper/trunk/server/admin-console/src/main/resources/velocity/index.vm
URL: http://svn.apache.org/viewvc/mina/vysper/trunk/server/admin-console/src/main/resources/velocity/index.vm?rev=1058892&r1=1057909&r2=1058892&view=diff
==============================================================================
--- mina/vysper/trunk/server/admin-console/src/main/resources/velocity/index.vm (original)
+++ mina/vysper/trunk/server/admin-console/src/main/resources/velocity/index.vm Fri Jan 14 08:40:40 2011
@@ -16,5 +16,8 @@
  *  specific language governing permissions and limitations
  *  under the License.
 *#
-<h1>Welcome to the Vysper Admin console</h1>
+<h1>Welcome to the Vysper admin console</h1>
+
+<p>In the Admin console you can manage your Vysper server, for example add users.</p>
+
 

Modified: mina/vysper/trunk/server/admin-console/src/main/resources/velocity/layout.vm
URL: http://svn.apache.org/viewvc/mina/vysper/trunk/server/admin-console/src/main/resources/velocity/layout.vm?rev=1058892&r1=1057909&r2=1058892&view=diff
==============================================================================
--- mina/vysper/trunk/server/admin-console/src/main/resources/velocity/layout.vm (original)
+++ mina/vysper/trunk/server/admin-console/src/main/resources/velocity/layout.vm Fri Jan 14 08:40:40 2011
@@ -1,4 +1,4 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 #*
  *  Licensed to the Apache Software Foundation (ASF) under one
  *  or more contributor license agreements.  See the NOTICE file
@@ -17,48 +17,64 @@
  *  specific language governing permissions and limitations
  *  under the License.
 *#
-<html>
-	<head>
-		<title>Apache Vysper Admin console</title>
-		<link rel="stylesheet" type="text/css" href="#springUrl("/resources/css/reset.css")" />
-        <link rel="stylesheet" type="text/css" href="#springUrl("/resources/css/typography.css")" /> 
-        <link rel="stylesheet" type="text/css" href="#springUrl("/resources/css/console.css")" /> 
-	</head>
-	<body>
-		<div id="main">
-			<div id="top">
-				 <div id="top-left">
-				 </div>
-				 <div id="top-right">
+ 
+<html> 
+    <head> 
+        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> 
+        <title>Apache Vysper admin console</title> 
+        <link href="#springUrl("/resources/common.css")" rel="stylesheet" type="text/css">
+        <link href="#springUrl("/resources/vysper.css")" rel="stylesheet" type="text/css"> 
+        <link rel="shortcut icon" href="#springUrl("/resources/favicon.ico")" />
+    </head> 
+    <body> 
+        <div id="container"> 
+            <div id="header"> 
+                <div id="navBar"> 
 				 	#if($authenticated)
 			 		<span>Logged in as $authenticated.</span>
 					<span>
-						<a href="logout">
+						<a href="#springUrl("/logout")">
 							Log out
 						</a>
 					</span>
 					#end
-				 </div>
-			</div>
-			<div class="clear"></div>
-			<div id="content">
-				<div id="center">
-					<div class="errorMessages">
-						#if ($error)
+                </div>
+            </div>
+            <div id="content"> 
+                <div id="leftColumn">
+                	#if($authenticated) 
+                    <div id="navigation">
+                     
+                        <h3>Users</h3> 
+                        <ul> 
+	                        <li><a href="#springUrl("/get-online-users-num")">Get number of online users</a></li>
+							<li><a href="#springUrl("/add-user")">Add user</a></li>
+							<li><a href="#springUrl("/change-user-password")">Change user password</a></li>
+                        </ul> 
+                    </div>
+                    #else
+						<div id="login"> 
+							<h3>Please log in</p>
+							<form action="login" method="post">
+								<p><input name="username" value="admin@vysper.org" /></p>
+								<p><input name="password" type="password" value="password" /></p>
+								<p><input type="submit" value="Log in" /></p>
+							</form>
+						</div>
+                    #end
+                </div>
+                <div id="rightColumn">
+					#if ($error)
+   					<p class="note error">
 							$error
-						#end
-					</div>
-					<div id="centerContent">
-						$screen_content
-					</div>
-				</div>
-				#if($authenticated)
-				<div id="left">
-					#parse("nav.vm")
-				</div>
-				#end
-			</div>
-			<div class="clear">&nbsp;</div>
-		</div>
-	</body>
+					</p>
+					#end
+					
+					$screen_content
+                
+                </div>
+                <div id="endContent"></div> 
+            </div>
+            <div id="footer"></div>
+    </body> 
 </html>
\ No newline at end of file

Modified: mina/vysper/trunk/server/admin-console/src/main/webapp/WEB-INF/console-servlet.xml
URL: http://svn.apache.org/viewvc/mina/vysper/trunk/server/admin-console/src/main/webapp/WEB-INF/console-servlet.xml?rev=1058892&r1=1058891&r2=1058892&view=diff
==============================================================================
--- mina/vysper/trunk/server/admin-console/src/main/webapp/WEB-INF/console-servlet.xml (original)
+++ mina/vysper/trunk/server/admin-console/src/main/webapp/WEB-INF/console-servlet.xml Fri Jan 14 08:40:40 2011
@@ -27,7 +27,7 @@
         http://www.springframework.org/schema/mvc 
         http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">
 
-    <mvc:resources location="classpath:/META-INF/" mapping="/resources/**" /> 
+    <mvc:resources location="classpath:/resources/" mapping="/resources/**" /> 
 
 	<mvc:annotation-driven/>
 
@@ -49,7 +49,7 @@
 
 	<bean id="velocityConfig"
 		class="org.springframework.web.servlet.view.velocity.VelocityConfigurer">
-		<property name="resourceLoaderPath" value="classpath:/META-INF/velocity/" />
+		<property name="resourceLoaderPath" value="classpath:/velocity/" />
 		<property name="velocityProperties">
 			<props>
 				<prop key="input.encoding">utf-8</prop>