From commits-return-14025-apmail-activemq-commits-archive=activemq.apache.org@activemq.apache.org Wed Jul 07 03:53:56 2010 Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 36861 invoked from network); 7 Jul 2010 03:53:56 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 7 Jul 2010 03:53:56 -0000 Received: (qmail 36486 invoked by uid 500); 7 Jul 2010 03:53:56 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 36423 invoked by uid 500); 7 Jul 2010 03:53:54 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 36416 invoked by uid 99); 7 Jul 2010 03:53:54 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Jul 2010 03:53:54 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Jul 2010 03:53:50 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 46E2B23888D1; Wed, 7 Jul 2010 03:52:56 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r961095 - in /activemq/sandbox/activemq-apollo-actor: ./ activemq-web/ activemq-web/src/ activemq-web/src/main/ activemq-web/src/main/resources/ activemq-web/src/main/scala/ activemq-web/src/main/scala/org/ activemq-web/src/main/scala/org/f... Date: Wed, 07 Jul 2010 03:52:56 -0000 To: commits@activemq.apache.org From: chirino@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100707035256.46E2B23888D1@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: chirino Date: Wed Jul 7 03:52:55 2010 New Revision: 961095 URL: http://svn.apache.org/viewvc?rev=961095&view=rev Log: adding initial web module based on the scalate bookstore example Added: activemq/sandbox/activemq-apollo-actor/activemq-web/ activemq/sandbox/activemq-apollo-actor/activemq-web/pom.xml activemq/sandbox/activemq-apollo-actor/activemq-web/run (with props) activemq/sandbox/activemq-apollo-actor/activemq-web/src/ activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/ activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/resources/ activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/resources/logback.xml activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/scala/ activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/scala/org/ activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/scala/org/fusesource/ activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/scala/org/fusesource/scalate/ activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/scala/org/fusesource/scalate/samples/ activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/scala/org/fusesource/scalate/samples/bookstore/ activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/scala/org/fusesource/scalate/samples/bookstore/ServletContextListener.scala activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/scala/org/fusesource/scalate/samples/bookstore/model/ activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/scala/org/fusesource/scalate/samples/bookstore/model/Book.scala activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/scala/org/fusesource/scalate/samples/bookstore/resources/ activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/scala/org/fusesource/scalate/samples/bookstore/resources/BookResource.scala activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/scala/org/fusesource/scalate/samples/bookstore/resources/Bookstore.scala activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/scala/org/fusesource/scalate/samples/bookstore/resources/DefaultRepresentations.scala activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/webapp/ activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/webapp/WEB-INF/ activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/webapp/WEB-INF/org/ activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/webapp/WEB-INF/org/fusesource/ activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/webapp/WEB-INF/org/fusesource/scalate/ activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/webapp/WEB-INF/org/fusesource/scalate/samples/ activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/webapp/WEB-INF/org/fusesource/scalate/samples/bookstore/ activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/webapp/WEB-INF/org/fusesource/scalate/samples/bookstore/resources/ activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/webapp/WEB-INF/org/fusesource/scalate/samples/bookstore/resources/BookResource.index.ssp activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/webapp/WEB-INF/org/fusesource/scalate/samples/bookstore/resources/Bookstore.index.ssp activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/webapp/WEB-INF/web.xml activemq/sandbox/activemq-apollo-actor/activemq-web/src/test/ activemq/sandbox/activemq-apollo-actor/activemq-web/src/test/scala/ activemq/sandbox/activemq-apollo-actor/activemq-web/src/test/scala/org/ activemq/sandbox/activemq-apollo-actor/activemq-web/src/test/scala/org/fusesource/ activemq/sandbox/activemq-apollo-actor/activemq-web/src/test/scala/org/fusesource/scalate/ activemq/sandbox/activemq-apollo-actor/activemq-web/src/test/scala/org/fusesource/scalate/sample/ activemq/sandbox/activemq-apollo-actor/activemq-web/src/test/scala/org/fusesource/scalate/sample/SampleTest.scala Modified: activemq/sandbox/activemq-apollo-actor/pom.xml Added: activemq/sandbox/activemq-apollo-actor/activemq-web/pom.xml URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-web/pom.xml?rev=961095&view=auto ============================================================================== --- activemq/sandbox/activemq-apollo-actor/activemq-web/pom.xml (added) +++ activemq/sandbox/activemq-apollo-actor/activemq-web/pom.xml Wed Jul 7 03:52:55 2010 @@ -0,0 +1,151 @@ + + + 4.0.0 + + + org.apache.activemq + activemq-project + 6.0-SNAPSHOT + + + org.apache.activemq + activemq-web + war + 6.0-SNAPSHOT + + ActiveMQ :: Web + + + 8080 + Tomcat60 + ${env.SCALATE_EDITOR} + ${basedir}/target/_scalate + + + + + + org.apache.activemq + activemq-broker + 6.0-SNAPSHOT + + + org.apache.activemq + activemq-jaxb + 6.0-SNAPSHOT + + + + org.fusesource.scalate + scalate-war + ${scalate-version} + war + + + + org.fusesource.scalate + scalate-guice + ${scalate-version} + + + + javax.servlet + servlet-api + ${servlet-api-version} + provided + + + + org.codehaus.jackson + jackson-jaxrs + 1.3.2 + + + + + org.fusesource.scalate + scalate-test + ${scalate-version} + test + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + once + + false + false + + **/*Test.* + + + **/QueuesTest.* + **/htmlunit/**.* + + + + + + org.apache.maven.plugins + maven-war-plugin + + + + org.mortbay.jetty + jetty-maven-plugin + ${jetty-plugin-version} + + + / + + + + scalate.editor + ${scalate-editor} + + + scalate.temp.workingdir + true + + + scalate-workdir + ${scalate-workdir} + + + 0 + + + + + + + + + precompile + + + + org.fusesource.scalate + maven-scalate-plugin + ${scalate-version} + + + + precompile + + + + + + + + + + + Added: activemq/sandbox/activemq-apollo-actor/activemq-web/run URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-web/run?rev=961095&view=auto ============================================================================== --- activemq/sandbox/activemq-apollo-actor/activemq-web/run (added) +++ activemq/sandbox/activemq-apollo-actor/activemq-web/run Wed Jul 7 03:52:55 2010 @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +echo +echo Running the web application with JRebel so we can hot-reload code changes +echo +echo In another shell run the following command: +echo " mvn scala:cc" +echo +echo Using JRebel home directory of $JREBEL_HOME +MAVEN_OPTS="-noverify -javaagent:$JREBEL_HOME/jrebel.jar" +mvn -Dscalate.temp.workingdir=true $* jetty:run + Propchange: activemq/sandbox/activemq-apollo-actor/activemq-web/run ------------------------------------------------------------------------------ svn:executable = * Added: activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/resources/logback.xml URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/resources/logback.xml?rev=961095&view=auto ============================================================================== --- activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/resources/logback.xml (added) +++ activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/resources/logback.xml Wed Jul 7 03:52:55 2010 @@ -0,0 +1,29 @@ + + + + + target/application.log + true + + + %-4relative [%thread] %-5level %logger{40} - %msg%n + + + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + + + + \ No newline at end of file Added: activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/scala/org/fusesource/scalate/samples/bookstore/ServletContextListener.scala URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/scala/org/fusesource/scalate/samples/bookstore/ServletContextListener.scala?rev=961095&view=auto ============================================================================== --- activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/scala/org/fusesource/scalate/samples/bookstore/ServletContextListener.scala (added) +++ activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/scala/org/fusesource/scalate/samples/bookstore/ServletContextListener.scala Wed Jul 7 03:52:55 2010 @@ -0,0 +1,27 @@ +package org.fusesource.scalate.samples.bookstore + +import _root_.com.google.inject.Guice +import _root_.com.google.inject.servlet.GuiceServletContextListener +import _root_.org.fusesource.scalate.guice.ScalateModule + +/** + * A servlet context listener which registers + * Guice Servlet + * + * @version $Revision : 1.1 $ + */ + +class ServletContextListener extends GuiceServletContextListener { + + def getInjector = Guice.createInjector(new ScalateModule() { + + // TODO add some custom provider methods here + // which can then be injected into resources or templates + // + // @Provides def createSomething = new MyThing() + + // lets add any package names which contain JAXRS resources + // https://jersey.dev.java.net/issues/show_bug.cgi?id=485 + override def resourcePackageNames = "org.fusesource.scalate.samples.bookstore.resources" :: super.resourcePackageNames + }) +} Added: activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/scala/org/fusesource/scalate/samples/bookstore/model/Book.scala URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/scala/org/fusesource/scalate/samples/bookstore/model/Book.scala?rev=961095&view=auto ============================================================================== --- activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/scala/org/fusesource/scalate/samples/bookstore/model/Book.scala (added) +++ activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/scala/org/fusesource/scalate/samples/bookstore/model/Book.scala Wed Jul 7 03:52:55 2010 @@ -0,0 +1,6 @@ +package org.fusesource.scalate.samples.bookstore.model + +/** + * @version $Revision: 1.1 $ + */ +case class Book(id: String, title: String, author: String) \ No newline at end of file Added: activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/scala/org/fusesource/scalate/samples/bookstore/resources/BookResource.scala URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/scala/org/fusesource/scalate/samples/bookstore/resources/BookResource.scala?rev=961095&view=auto ============================================================================== --- activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/scala/org/fusesource/scalate/samples/bookstore/resources/BookResource.scala (added) +++ activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/scala/org/fusesource/scalate/samples/bookstore/resources/BookResource.scala Wed Jul 7 03:52:55 2010 @@ -0,0 +1,11 @@ +package org.fusesource.scalate.samples.bookstore.resources + +import org.fusesource.scalate.samples.bookstore.model.Book +import org.fusesource.scalate.rest.{Container, ElementResource} + +/** + * @version $Revision : 1.1 $ + */ +class BookResource(val book: Book, val container: Container[String, Book]) + extends ElementResource[String, Book](book, container) with DefaultRepresentations { +} \ No newline at end of file Added: activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/scala/org/fusesource/scalate/samples/bookstore/resources/Bookstore.scala URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/scala/org/fusesource/scalate/samples/bookstore/resources/Bookstore.scala?rev=961095&view=auto ============================================================================== --- activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/scala/org/fusesource/scalate/samples/bookstore/resources/Bookstore.scala (added) +++ activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/scala/org/fusesource/scalate/samples/bookstore/resources/Bookstore.scala Wed Jul 7 03:52:55 2010 @@ -0,0 +1,20 @@ +package org.fusesource.scalate.samples.bookstore.resources + +import org.fusesource.scalate.samples.bookstore.model.Book +import org.fusesource.scalate.rest.{MapContainer, ContainerResource} +import java.lang.String +import javax.ws.rs.{Path} + +/** + * @version $Revision: 1.1 $ + */ +@Path("/") +class Bookstore extends ContainerResource[String,Book,BookResource] with DefaultRepresentations { + val container = new MapContainer[String,Book]() { + def key(book: Book) = book.id + + put(Book("item1", "Title1", "Author1"), Book("item2", "Title2", "Author2")) + } + + def createChild(e: Book) = new BookResource(e, container) +} \ No newline at end of file Added: activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/scala/org/fusesource/scalate/samples/bookstore/resources/DefaultRepresentations.scala URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/scala/org/fusesource/scalate/samples/bookstore/resources/DefaultRepresentations.scala?rev=961095&view=auto ============================================================================== --- activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/scala/org/fusesource/scalate/samples/bookstore/resources/DefaultRepresentations.scala (added) +++ activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/scala/org/fusesource/scalate/samples/bookstore/resources/DefaultRepresentations.scala Wed Jul 7 03:52:55 2010 @@ -0,0 +1,16 @@ +package org.fusesource.scalate.samples.bookstore.resources + +import com.sun.jersey.api.view.ImplicitProduces +import javax.ws.rs.Produces +import javax.ws.rs.core.MediaType + +/** + * Defines the default representations to be used on resources + * + * @version $Revision: 1.1 $ + */ +@ImplicitProduces(Array("text/html;qs=5")) +@Produces(Array("application/xml","text/xml", "application/json")) +trait DefaultRepresentations { + +} \ No newline at end of file Added: activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/webapp/WEB-INF/org/fusesource/scalate/samples/bookstore/resources/BookResource.index.ssp URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/webapp/WEB-INF/org/fusesource/scalate/samples/bookstore/resources/BookResource.index.ssp?rev=961095&view=auto ============================================================================== --- activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/webapp/WEB-INF/org/fusesource/scalate/samples/bookstore/resources/BookResource.index.ssp (added) +++ activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/webapp/WEB-INF/org/fusesource/scalate/samples/bookstore/resources/BookResource.index.ssp Wed Jul 7 03:52:55 2010 @@ -0,0 +1,20 @@ + +<%@ val it: BookResource %> +<% import it.book._ %> + + +

Book ${title}

+ +
    +
  • Title: ${title}
  • +
  • by: ${author}
  • +
  • id: ${id}
  • +
+

+ + + +

+ + + \ No newline at end of file Added: activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/webapp/WEB-INF/org/fusesource/scalate/samples/bookstore/resources/Bookstore.index.ssp URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/webapp/WEB-INF/org/fusesource/scalate/samples/bookstore/resources/Bookstore.index.ssp?rev=961095&view=auto ============================================================================== --- activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/webapp/WEB-INF/org/fusesource/scalate/samples/bookstore/resources/Bookstore.index.ssp (added) +++ activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/webapp/WEB-INF/org/fusesource/scalate/samples/bookstore/resources/Bookstore.index.ssp Wed Jul 7 03:52:55 2010 @@ -0,0 +1,15 @@ + +<%@ val it: Bookstore %> + + +

Bookstore

+ +

Items

+ + + + + \ No newline at end of file Added: activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/webapp/WEB-INF/web.xml URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/webapp/WEB-INF/web.xml?rev=961095&view=auto ============================================================================== --- activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/webapp/WEB-INF/web.xml (added) +++ activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/webapp/WEB-INF/web.xml Wed Jul 7 03:52:55 2010 @@ -0,0 +1,32 @@ + + + + Bookstore + + + Bookstore Sample + + + + org.fusesource.scalate.samples.bookstore.ServletContextListener + + + + guiceFilter + com.google.inject.servlet.GuiceFilter + + + + guiceFilter + /* + + + + 500 + /WEB-INF/errors/scalate/500.scaml + + + Added: activemq/sandbox/activemq-apollo-actor/activemq-web/src/test/scala/org/fusesource/scalate/sample/SampleTest.scala URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-web/src/test/scala/org/fusesource/scalate/sample/SampleTest.scala?rev=961095&view=auto ============================================================================== --- activemq/sandbox/activemq-apollo-actor/activemq-web/src/test/scala/org/fusesource/scalate/sample/SampleTest.scala (added) +++ activemq/sandbox/activemq-apollo-actor/activemq-web/src/test/scala/org/fusesource/scalate/sample/SampleTest.scala Wed Jul 7 03:52:55 2010 @@ -0,0 +1,23 @@ +package org.fusesource.scalate.sample + +import org.junit.runner.RunWith +import org.scalatest.junit.JUnitRunner +import org.scalatest.{FunSuite} + +import org.fusesource.scalate.test._ + +/** + * @version $Revision: 1.1 $ + */ +@RunWith(classOf[JUnitRunner]) +class SampleTest extends FunSuite with WebServerMixin with WebDriverMixin { + + test("home page") { + webDriver.get(rootUrl) + pageContains("Bookstore") + } + + testPageContains("id/item1", "Title1", "Author1", "item1") + testPageContains("id/item2", "Title2", "Author2", "item2") + +} \ No newline at end of file Modified: activemq/sandbox/activemq-apollo-actor/pom.xml URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/pom.xml?rev=961095&r1=961094&r2=961095&view=diff ============================================================================== --- activemq/sandbox/activemq-apollo-actor/pom.xml (original) +++ activemq/sandbox/activemq-apollo-actor/pom.xml Wed Jul 7 03:52:55 2010 @@ -92,7 +92,13 @@ 1.0-SNAPSHOT 1.1-SNAPSHOT 1.0-SNAPSHOT - + + 6.1.22 + 7.0.1.v20091125 + 1.1-SNAPSHOT + 2.5 + 1.3.2 + 2.8.0.Beta1 1.0.1-for-scala-2.8.0.Beta1-RC7-with-test-interfaces-0.3-SNAPSHOT 2.9.1