Skip to content

Commit

Permalink
Untested ScaladinPortlet
Browse files Browse the repository at this point in the history
  • Loading branch information
Henri Kerola committed Feb 27, 2013
1 parent 3d83c25 commit 10952b9
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
25 changes: 25 additions & 0 deletions addon/src/main/scala/vaadin/scala/ScaladinPortlet.scala
@@ -0,0 +1,25 @@
package vaadin.scala

import com.vaadin.server.{SessionInitEvent, SessionInitListener, VaadinPortlet}
import internal.ScaladinUIProvider
import javax.portlet.PortletConfig

/**
* @see com.vaadin.server.VaadinPortlet
* @author Henri Kerola / Vaadin
*/
class ScaladinPortlet extends VaadinPortlet {

override def init(config: PortletConfig) {
super.init(config)
registerUIProvider()
}

private def registerUIProvider() {
getService.addSessionInitListener(new SessionInitListener {
def sessionInit(e: SessionInitEvent) {
e.getSession.addUIProvider(new ScaladinUIProvider)
}
})
}
}
5 changes: 3 additions & 2 deletions project/Build.scala
Expand Up @@ -40,7 +40,8 @@ object Dependencies {
val vaadin = "com.vaadin" % "vaadin-server" % vaadinVersion
val vaadinClientCompiled = "com.vaadin" % "vaadin-client-compiled" % vaadinVersion
val vaadinThemes = "com.vaadin" % "vaadin-themes" % vaadinVersion
val servletApi = "javax.servlet" % "javax.servlet-api" % "3.0.1"
val servletApi = "javax.servlet" % "servlet-api" % "2.4"
val portletApi = "javax.portlet" % "portlet-api" % "2.0"
val jetty = "org.eclipse.jetty" % "jetty-webapp" % jettyVersion % "container"
val scalaTest = "org.scalatest" % "scalatest_2.10.0-RC5" % scalaTestVersion % "test"
val junitInterface = "com.novocode" % "junit-interface" % "0.7" % "test->default"
Expand All @@ -53,7 +54,7 @@ object ScaladinBuild extends Build {

lazy val addonSettings = buildSettings ++ jacoco.settings ++ scalariformSettings ++ Seq(
name := buildName,
libraryDependencies := Seq(scala, scalaActors, vaadin, servletApi, scalaTest, junitInterface, mockito),
libraryDependencies := Seq(scala, scalaActors, vaadin, servletApi, portletApi, scalaTest, junitInterface, mockito),
packageConfiguration in Compile in packageBin ~= {
(config: Package.Configuration) => new Package.Configuration(config.sources, config.jar, manifestAttributes)
},
Expand Down

0 comments on commit 10952b9

Please sign in to comment.