You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by ma...@apache.org on 2012/03/24 11:55:37 UTC
svn commit: r1304757 - in /james/hupa/trunk: ./ client/
client/src/main/java/org/apache/hupa/
client/src/main/java/org/apache/hupa/client/ client/src/main/resources/
server/src/main/webapp/WEB-INF/conf/
Author: manolo
Date: Sat Mar 24 10:55:36 2012
New Revision: 1304757
URL: http://svn.apache.org/viewvc?rev=1304757&view=rev
Log:
Added Jetty so as hupa war file can be run as an standalone application
Added:
james/hupa/trunk/client/src/main/java/org/apache/hupa/Launcher.java
Modified:
james/hupa/trunk/README.txt
james/hupa/trunk/client/pom.xml
james/hupa/trunk/client/src/main/java/org/apache/hupa/client/Hupa.java
james/hupa/trunk/client/src/main/resources/log4j.properties
james/hupa/trunk/pom.xml
james/hupa/trunk/server/src/main/webapp/WEB-INF/conf/config.properties
Modified: james/hupa/trunk/README.txt
URL: http://svn.apache.org/viewvc/james/hupa/trunk/README.txt?rev=1304757&r1=1304756&r2=1304757&view=diff
==============================================================================
--- james/hupa/trunk/README.txt (original)
+++ james/hupa/trunk/README.txt Sat Mar 24 10:55:36 2012
@@ -1,11 +1,9 @@
###### Bulding ######
Hupa use maven2 as build tool. To build hupa download maven2 (http://maven.apache.org), unpack maven2 and install it.
After that change to hupa directory and execute the following cmd:
-
-* mvn clean package
+$ mvn clean package
###### Configuring server side ################
-
Hupa uses a properties file to know the IMAP and SMTP servers configuration.
There is an example configuration file in 'server/src/main/webapp/WEB-INF/conf/config.properties'
@@ -15,10 +13,18 @@ There is an example configuration file i
- Or anywhere if you start your application server with the parameter:
-Dhupa.config.file=full_path_to_your_properties_file
-###### Hupa and GMail #################
+##### Running Hupa ##################
+Hupa comes packaged with a servlet-container, so once you have compiled the app just run:
+$ java -jar target/hupa-${version}.war
+Then point your browser to the url:
+http://localhost:8282
+
+If you prefer to use any other servlet container you can deploy the provided .war file in it.
+
+###### Hupa and GMail #################
By default hupa is configurated as a gmail imap/smtp client, use any gmail valid account to login.
-Note that previously to use a gmail account via imap you should enable it.
+NOTE: that previously to use a gmail account via imap you should enable imap in your gmail account.
###### Using hupa in demo mode #################
In demo mode it is not necessary any imap or smtp server.
Modified: james/hupa/trunk/client/pom.xml
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/pom.xml?rev=1304757&r1=1304756&r2=1304757&view=diff
==============================================================================
--- james/hupa/trunk/client/pom.xml (original)
+++ james/hupa/trunk/client/pom.xml Sat Mar 24 10:55:36 2012
@@ -113,6 +113,14 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-server</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-webapp</artifactId>
+ </dependency>
</dependencies>
<build>
<outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</outputDirectory>
@@ -173,7 +181,12 @@
<directory>../server/src/main/webapp/</directory>
</resource>
</webResources>
- <warName>${artifactId}</warName>
+ <warName>${artifactId}-${version}</warName>
+ <archive>
+ <manifest>
+ <mainClass>org.apache.hupa.Launcher</mainClass>
+ </manifest>
+ </archive>
</configuration>
</plugin>
<plugin>
@@ -226,8 +239,8 @@
</executions>
</plugin>
<plugin>
+ <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
- <version>2.5</version>
<executions>
<execution>
<id>copy-resources</id>
@@ -240,13 +253,48 @@
<resources>
<resource>
<directory>src/main/webapp</directory>
- <filtering>true</filtering>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ <execution>
+ <id>copy-launcher</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${project.build.directory}/${project.build.finalName}</outputDirectory>
+ <resources>
+ <resource>
+ <directory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</directory>
+ <include>org/apache/hupa/Launcher.class</include>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>jetty-classpath</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>unpack-dependencies</goal>
+ </goals>
+ <configuration>
+ <includeGroupIds>org.eclipse.jetty,javax.servlet</includeGroupIds>
+ <excludeArtifactIds>jsp-api,jstl</excludeArtifactIds>
+ <outputDirectory>
+ ${project.build.directory}/${project.artifactId}-${project.version}
+ </outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
</project>
Added: james/hupa/trunk/client/src/main/java/org/apache/hupa/Launcher.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/Launcher.java?rev=1304757&view=auto
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/Launcher.java (added)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/Launcher.java Sat Mar 24 10:55:36 2012
@@ -0,0 +1,44 @@
+/****************************************************************
+ * 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. *
+ ****************************************************************/
+package org.apache.hupa;
+
+import java.net.URL;
+import java.security.ProtectionDomain;
+
+import org.eclipse.jetty.server.Server;
+import org.eclipse.jetty.webapp.WebAppContext;
+
+/**
+ * When hupa is packaged with jetty this class is called to
+ * start jetty server.
+ */
+public final class Launcher {
+ public static void main(String[] args) throws Exception {
+ int port = Integer.parseInt(System.getProperty("port", "8282"));
+ Server server = new Server(port);
+ ProtectionDomain domain = Launcher.class.getProtectionDomain();
+ URL location = domain.getCodeSource().getLocation();
+ WebAppContext webapp = new WebAppContext();
+ webapp.setContextPath("/");
+ webapp.setWar(location.toExternalForm());
+ server.setHandler(webapp);
+ server.start();
+ server.join();
+ }
+}
\ No newline at end of file
Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/Hupa.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/Hupa.java?rev=1304757&r1=1304756&r2=1304757&view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/Hupa.java (original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/Hupa.java Sat Mar 24 10:55:36 2012
@@ -23,52 +23,21 @@ import net.customware.gwt.presenter.clie
import org.apache.hupa.client.gin.HupaGinjector;
import org.apache.hupa.client.mvp.AppPresenter;
-import org.apache.hupa.client.rf.HupaRequestFactory;
-import org.apache.hupa.client.rf.SubjectProxy;
-import org.apache.hupa.client.rf.SubjectRequest;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.ui.RootPanel;
-import com.google.web.bindery.requestfactory.shared.Receiver;
public class Hupa implements EntryPoint{
private final HupaGinjector injector = GWT.create(HupaGinjector.class);
public void onModuleLoad() {
-
-// HupaRequestFactory rf = injector.getRequestFactory();
-//
-// SubjectRequest req = rf.subjectRequest();
-// SubjectProxy t = req.create(SubjectProxy.class);
-// t.setTitle("New-Subject");
-// req.echo(t, "from_manolo", "to_james").fire(new Receiver<String>() {
-// public void onSuccess(String response) {
-// System.out.println(response);
-// }
-// });
-//
-// req = rf.subjectRequest();
-// t = req.create(SubjectProxy.class);
-// t.setTitle("New-Subject");
-// req.persist().using(t);
-// req.countSubjects().to(new Receiver<Long>() {
-// public void onSuccess(Long response) {
-// System.out.println(response);
-// }
-// }).fire();
-//
-//
-// if(true) return;
-
-
// remove the loading message from the browser
com.google.gwt.user.client.Element loading = DOM.getElementById("loading");
DOM.removeChild(RootPanel.getBodyElement(), loading);
-
AppPresenter aPres = injector.getAppPresenter();
aPres.bind();
Modified: james/hupa/trunk/client/src/main/resources/log4j.properties
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/resources/log4j.properties?rev=1304757&r1=1304756&r2=1304757&view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/resources/log4j.properties (original)
+++ james/hupa/trunk/client/src/main/resources/log4j.properties Sat Mar 24 10:55:36 2012
@@ -16,7 +16,7 @@
#############################################################################
# Set root logger level to DEBUG and its only appender to A1.
-log4j.rootLogger=DEBUG, A1
+log4j.rootLogger=INFO, A1
# A1 is set to be a ConsoleAppender.
log4j.appender.A1=org.apache.log4j.ConsoleAppender
Modified: james/hupa/trunk/pom.xml
URL: http://svn.apache.org/viewvc/james/hupa/trunk/pom.xml?rev=1304757&r1=1304756&r2=1304757&view=diff
==============================================================================
--- james/hupa/trunk/pom.xml (original)
+++ james/hupa/trunk/pom.xml Sat Mar 24 10:55:36 2012
@@ -61,6 +61,7 @@
<properties>
<gwtVersion>2.4.0</gwtVersion>
<gwtMavenVersion>2.4.0</gwtMavenVersion>
+ <jettyVersion>7.3.0.v20110203</jettyVersion>
</properties>
<dependencyManagement>
<dependencies>
@@ -257,6 +258,18 @@
<artifactId>slf4j-log4j12</artifactId>
<version>1.6.1</version>
</dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-server</artifactId>
+ <version>${jettyVersion}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-webapp</artifactId>
+ <version>${jettyVersion}</version>
+ <scope>provided</scope>
+ </dependency>
</dependencies>
</dependencyManagement>
@@ -301,23 +314,6 @@
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>${gwtMavenVersion}</version>
- <dependencies>
- <dependency>
- <groupId>com.google.gwt</groupId>
- <artifactId>gwt-servlet</artifactId>
- <version>${gwtVersion}</version>
- </dependency>
- <dependency>
- <groupId>com.google.gwt</groupId>
- <artifactId>gwt-user</artifactId>
- <version>${gwtVersion}</version>
- </dependency>
- <dependency>
- <groupId>com.google.gwt</groupId>
- <artifactId>gwt-dev</artifactId>
- <version>${gwtVersion}</version>
- </dependency>
- </dependencies>
</plugin>
<plugin>
<groupId>org.bsc.maven</groupId>
Modified: james/hupa/trunk/server/src/main/webapp/WEB-INF/conf/config.properties
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/webapp/WEB-INF/conf/config.properties?rev=1304757&r1=1304756&r2=1304757&view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/webapp/WEB-INF/conf/config.properties (original)
+++ james/hupa/trunk/server/src/main/webapp/WEB-INF/conf/config.properties Sat Mar 24 10:55:36 2012
@@ -52,6 +52,6 @@ SMTPAuth=true
SMTPS=true
## Remove these lines to use Gmail IMAP AND SMTP
-IMAPServerAddress=demo-mode
-SMTPServerAddress=demo-mode
+# IMAPServerAddress=demo-mode
+# SMTPServerAddress=demo-mode
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org