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 23:48:12 UTC

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

Author: ngn
Date: Fri Jan 14 22:48:12 2011
New Revision: 1059194

URL: http://svn.apache.org/viewvc?rev=1059194&view=rev
Log:
Building both a jar and war version of the admin console

Added:
    mina/vysper/trunk/server/admin-console/src/main/resources/webapp/
    mina/vysper/trunk/server/admin-console/src/main/resources/webapp/WEB-INF/
      - copied from r1057909, mina/vysper/trunk/server/admin-console/src/main/webapp/WEB-INF/
    mina/vysper/trunk/server/admin-console/src/main/resources/webapp/WEB-INF/console-servlet.xml
    mina/vysper/trunk/server/admin-console/src/main/resources/webapp/WEB-INF/web.xml
    mina/vysper/trunk/server/admin-console/src/test/resources/bogus_mina_tls.cert
      - copied unchanged from r1057909, mina/vysper/trunk/server/admin-console/src/main/resources/bogus_mina_tls.cert
Removed:
    mina/vysper/trunk/server/admin-console/src/main/resources/META-INF/
    mina/vysper/trunk/server/admin-console/src/main/resources/bogus_mina_tls.cert
    mina/vysper/trunk/server/admin-console/src/main/webapp/
Modified:
    mina/vysper/trunk/server/admin-console/pom.xml
    mina/vysper/trunk/server/admin-console/src/main/java/org/apache/vysper/console/AdminConsole.java
    mina/vysper/trunk/server/admin-console/src/main/resources/velocity/layout.vm
    mina/vysper/trunk/server/admin-console/src/test/java/org/apache/vysper/console/ServerMain.java

Modified: mina/vysper/trunk/server/admin-console/pom.xml
URL: http://svn.apache.org/viewvc/mina/vysper/trunk/server/admin-console/pom.xml?rev=1059194&r1=1059193&r2=1059194&view=diff
==============================================================================
--- mina/vysper/trunk/server/admin-console/pom.xml (original)
+++ mina/vysper/trunk/server/admin-console/pom.xml Fri Jan 14 22:48:12 2011
@@ -22,7 +22,6 @@
 	<artifactId>vysper-admin-console</artifactId>
 	<name>Apache Vysper Admin Console</name>
 	<version>0.7-SNAPSHOT</version>
-	<packaging>war</packaging>
 
 	<dependencies>
 		<dependency>
@@ -110,19 +109,24 @@
 		</dependency>
 
 		<dependency>
+			<groupId>org.eclipse.jetty</groupId>
+			<artifactId>jetty-webapp</artifactId>
+		</dependency>
+
+		<dependency>
 			<groupId>org.slf4j</groupId>
 			<artifactId>slf4j-log4j12</artifactId>
 		</dependency>
 
 		<dependency>
-			<groupId>log4j</groupId>
-			<artifactId>log4j</artifactId>
+			<groupId>org.slf4j</groupId>
+			<artifactId>jcl-over-slf4j</artifactId>
 		</dependency>
 
+
 		<dependency>
-			<groupId>org.eclipse.jetty</groupId>
-			<artifactId>jetty-webapp</artifactId>
-			<scope>provided</scope>
+			<groupId>log4j</groupId>
+			<artifactId>log4j</artifactId>
 		</dependency>
 
 		<!-- Test dependencies -->
@@ -137,18 +141,50 @@
 			<artifactId>mockito-all</artifactId>
 			<scope>test</scope>
 		</dependency>
+
 	</dependencies>
 
 	<build>
-		<finalName>vysper-admin-console</finalName>
 		<plugins>
 			<plugin>
-				<groupId>org.mortbay.jetty</groupId>
-				<artifactId>maven-jetty-plugin</artifactId>
-				<configuration>
-					<scanIntervalSeconds>10</scanIntervalSeconds>
-					<contextPath>/</contextPath>
-				</configuration>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-war-plugin</artifactId>
+				<version>2.1.1</version>
+				<executions>
+					<execution>
+						<goals>
+							<goal>war</goal>
+						</goals>
+						<configuration>
+							<packagingExcludes>WEB-INF/lib/jetty-*.jar</packagingExcludes>
+							
+							<warSourceDirectory>src/main/resources/webapp</warSourceDirectory>
+						</configuration>
+						<phase>package</phase>
+					</execution>
+				</executions>
+			</plugin>
+			<plugin>
+				<groupId>org.codehaus.mojo</groupId>
+				<artifactId>build-helper-maven-plugin</artifactId>
+				<version>1.5</version>
+				<executions>
+					<execution>
+						<id>attach-artifacts</id>
+						<phase>package</phase>
+						<goals>
+							<goal>attach-artifact</goal>
+						</goals>
+						<configuration>
+							<artifacts>
+								<artifact>
+									<file>${project.build.directory}/${project.build.finalName}.war</file>
+									<type>war</type>
+								</artifact>
+							</artifacts>
+						</configuration>
+					</execution>
+				</executions>
 			</plugin>
 		</plugins>
 		<resources>
@@ -159,6 +195,9 @@
 					<include>**/*.css</include>
 					<include>**/*.ico</include>
 					<include>**/*.vm</include>
+					<include>**/*.xml</include>
+					<include>**/*.cert</include>
+					<include>**/*.properties</include>
 				</includes>
 			</resource>
 		</resources>

Modified: mina/vysper/trunk/server/admin-console/src/main/java/org/apache/vysper/console/AdminConsole.java
URL: http://svn.apache.org/viewvc/mina/vysper/trunk/server/admin-console/src/main/java/org/apache/vysper/console/AdminConsole.java?rev=1059194&r1=1059193&r2=1059194&view=diff
==============================================================================
--- mina/vysper/trunk/server/admin-console/src/main/java/org/apache/vysper/console/AdminConsole.java (original)
+++ mina/vysper/trunk/server/admin-console/src/main/java/org/apache/vysper/console/AdminConsole.java Fri Jan 14 22:48:12 2011
@@ -33,8 +33,8 @@ public class AdminConsole {
         server = new Server(port);
         
         WebAppContext context = new WebAppContext();
-        context.setDescriptor("src/main/webapp/WEB-INF/web.xml");
-        context.setResourceBase("src/main/webapp");
+        context.setDescriptor("src/main/resources/webapp/WEB-INF/web.xml");
+        context.setResourceBase("src/main/resources/webapp");
         context.setContextPath("/");
  
         server.setHandler(context);

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=1059194&r1=1059193&r2=1059194&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 22:48:12 2011
@@ -58,8 +58,8 @@
 						<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 name="username" placeholder="admin@vysper.org" /></p>
+								<p><input name="password" type="password" /></p>
 								<p><input type="submit" value="Log in" /></p>
 							</form>
 						</div>

Added: mina/vysper/trunk/server/admin-console/src/main/resources/webapp/WEB-INF/console-servlet.xml
URL: http://svn.apache.org/viewvc/mina/vysper/trunk/server/admin-console/src/main/resources/webapp/WEB-INF/console-servlet.xml?rev=1059194&view=auto
==============================================================================
--- mina/vysper/trunk/server/admin-console/src/main/resources/webapp/WEB-INF/console-servlet.xml (added)
+++ mina/vysper/trunk/server/admin-console/src/main/resources/webapp/WEB-INF/console-servlet.xml Fri Jan 14 22:48:12 2011
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+  <!--
+    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.
+  -->
+<beans xmlns="http://www.springframework.org/schema/beans" 
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+    xmlns:context="http://www.springframework.org/schema/context"
+    xmlns:mvc="http://www.springframework.org/schema/mvc"
+    xsi:schemaLocation="
+        http://www.springframework.org/schema/beans 
+        http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+        http://www.springframework.org/schema/context 
+        http://www.springframework.org/schema/context/spring-context-3.0.xsd
+        http://www.springframework.org/schema/mvc 
+        http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">
+
+    <mvc:resources location="classpath:/resources/" mapping="/resources/**" /> 
+
+	<mvc:annotation-driven/>
+
+	<context:component-scan base-package="org.apache.vysper.console"/>
+	
+	<bean id="serverDomain" class="java.lang.String">
+		<constructor-arg value="vysper.org" />
+	</bean>
+	
+	<bean class="org.jivesoftware.smack.ConnectionConfiguration">
+		<constructor-arg ref="serverDomain" />
+		<constructor-arg value="5222" />
+		<constructor-arg value="localhost" />
+<!--		<property name="keystorePath" value="bogus_mina_tls.cert" />-->
+<!--		<property name="truststorePath" value="bogus_mina_tls.cert" />-->
+<!--		<property name="truststorePassword" value="boguspw" />-->
+	</bean>
+	
+
+	<bean id="velocityConfig"
+		class="org.springframework.web.servlet.view.velocity.VelocityConfigurer">
+		<property name="resourceLoaderPath" value="classpath:/velocity/" />
+		<property name="velocityProperties">
+			<props>
+				<prop key="input.encoding">utf-8</prop>
+				<prop key="output.encoding">utf-8 </prop>
+			</props>
+		</property>
+	</bean>
+
+	<bean id="viewResolver"
+		class="org.springframework.web.servlet.view.velocity.VelocityLayoutViewResolver">
+		<property name="layoutUrl" value="layout.vm" />
+		<property name="screenContentKey" value="screen_content"/>
+		<property name="layoutKey" value="layout"/>
+		<property name="prefix" value="" />
+		<property name="suffix" value=".vm" />
+		<property name="contentType" value="text/html; charset=UTF-8" />
+	</bean>
+    
+    
+</beans>
\ No newline at end of file

Added: mina/vysper/trunk/server/admin-console/src/main/resources/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/mina/vysper/trunk/server/admin-console/src/main/resources/webapp/WEB-INF/web.xml?rev=1059194&view=auto
==============================================================================
--- mina/vysper/trunk/server/admin-console/src/main/resources/webapp/WEB-INF/web.xml (added)
+++ mina/vysper/trunk/server/admin-console/src/main/resources/webapp/WEB-INF/web.xml Fri Jan 14 22:48:12 2011
@@ -0,0 +1,35 @@
+<?xml version='1.0' encoding='UTF-8'?>
+  <!--
+    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.
+  -->
+  <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+  version="2.4">
+
+  <description>Apache Vysper admin console</description>
+
+	<servlet>
+		<servlet-name>console</servlet-name>
+		<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
+		<load-on-startup>1</load-on-startup>
+	</servlet>
+
+	<servlet-mapping>
+		<servlet-name>console</servlet-name>
+		<url-pattern>/*</url-pattern>
+	</servlet-mapping>
+</web-app>
\ No newline at end of file

Modified: mina/vysper/trunk/server/admin-console/src/test/java/org/apache/vysper/console/ServerMain.java
URL: http://svn.apache.org/viewvc/mina/vysper/trunk/server/admin-console/src/test/java/org/apache/vysper/console/ServerMain.java?rev=1059194&r1=1059193&r2=1059194&view=diff
==============================================================================
--- mina/vysper/trunk/server/admin-console/src/test/java/org/apache/vysper/console/ServerMain.java (original)
+++ mina/vysper/trunk/server/admin-console/src/test/java/org/apache/vysper/console/ServerMain.java Fri Jan 14 22:48:12 2011
@@ -72,7 +72,7 @@ public class ServerMain {
         //server.addEndpoint(new StanzaSessionFactory());
         server.setStorageProviderRegistry(providerRegistry);
 
-        server.setTLSCertificateInfo(new File("src/main/resources/bogus_mina_tls.cert"), "boguspw");
+        server.setTLSCertificateInfo(new File("src/test/resources/bogus_mina_tls.cert"), "boguspw");
 
         server.start();
         System.out.println("Vysper server is running...");