In general these frameworks provide functionality that covers one or more of the following:
- Routing: A mechanism for taking HTTP requests and routing them to some code that handles them and returns a response.
package com.proinnovate.webfunction | |
import org.scalatra.ScalatraServlet | |
import akka.actor.{Scheduler, Actor} | |
import javax.servlet.http.{HttpServletResponse, HttpServletRequest} | |
import org.atmosphere.cpr.BroadcastFilter.BroadcastAction | |
import org.atmosphere.cpr._ | |
import org.atmosphere.util.XSSHtmlFilter | |
import collection.JavaConversions._ | |
import java.util.concurrent.{LinkedBlockingQueue, TimeUnit} |
Note that this documentation is a note to self and mostly likely is currently wrong because my code isn't working yet!
Atmosphere provides consistent client side (JavaScript) and server side (Java) libraries for websocket like support across different web browsers and web servers.
This documentation is written from the perspective of a developer trying to integrate the support into a Scala application which already uses jQuery on the client.
import java.lang.Readable | |
import java.nio.CharBuffer | |
import java.util.Scanner | |
val readable = new Readable { def read(x: CharBuffer) = { x.put("12 34".reverse); 5} } | |
def s = new Scanner(readable) | |
assert(s.nextInt() == 43) |
// For the xsbt-web plugin... | |
seq(com.github.siasia.WebPlugin.webSettings :_*) | |
// Add an additional webappResources directory in the target directory... | |
webappResources <<= (webappResources, target in Compile)((wr, t) => wr +++ t / "webapp_managed" ) | |
// For the CoffeeScripted Sbt plugin... | |
seq(coffeescript.CoffeeScript.coffeeSettings: _*) | |
// Use the additional webappResources directory as the targetDirectory for coffee... |
#!/bin/sh | |
exec /Users/sroebuck/local/bin/scalas $0 $@ | |
!# | |
/*** | |
libraryDependencies ++= Seq( | |
"com.github.scala-incubator.io" %% "scala-io-file" % "0.2.0", | |
"joda-time" % "joda-time" % "2.0", | |
"org.joda" % "joda-convert" % "1.1" | |
) | |
*/ |
By September 2012, the Scottish Government is scheduled to deliver an ICT Strategy for the Public Sector in Scotland[^ictstrategy]. This is a huge opportunity for Scotland to reform the public sector's use of ICT into a service that facilitates the move into a citizen centred, efficient public sector tailored to the varying needs of a diverse and distributed population. Unfortunately, it could also turn out to be a missed opportunity.
Here is my 'alternative' ICT Strategy document. It is a work in progress so this blog entry will be changing over time.[^gist] This is what I would like the government ICT strategy document to look like!
To deliver public services in Scotland, the government has adopted some core technologies on which everything can be built. These technologies are well defined, current, standard and adaptable.
import scala.util.Random | |
import scala.language.reflectiveCalls | |
class Customer(customerId: String, code: String, customerName: String, host: String, val isEnabled: Boolean, | |
languageCode: String, val isServicesOnly: Boolean, val isEvaluation: Boolean) { | |
def customerId(): String = customerId | |
def customerName(): String = customerName | |
def host(): String = host | |
def languageCode(): String = languageCode | |
override def toString = s"Customer($customerId, $code, $customerName, $host, $isEnabled, $languageCode, $isServicesOnly, $isEvaluation)" |