The problem is that in Play 1.2, the Plugin API was designed for the
Java API, and then we started to experiment in a separate module with
scala. So most methods of the Plugin API are not relevant for the
Scala API.
Btw, that's why we started Play 2.0 to clean all this stuff and have 2
API at the same level with a proper Plugin mechanism.
In the meantime you should just provide a trait in your jade module.
It is probably the easiest and cleanest way to handle it.
> --
> You received this message because you are subscribed to the Google Groups "play-framework" group.
> To post to this group, send email to play-fr...@googlegroups.com.
> To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.
>
>
--
Guillaume Bort, http://guillaume.bort.fr
override def compile(): Unit = {}
override def render(args: java.util.Map[String, AnyRef]): String = {
internalRender(args)
}
override def internalRender(args: java.util.Map[String, AnyRef]): String = {
// todo: Convert from a [String, AnyRef] to (Symbol, Any)
// ScalateTemplate(template).render(args)
""
}
Anyone know how to do this conversion?
Thanks,
Matt
scala> val m = new java.util.HashMap[String, AnyRef]m: java.util.HashMap[String,AnyRef] = {}scala> m.put("a", "123")res0: AnyRef = nullscala> m.put("b", "456")res1: AnyRef = nullscala> def convertMap(in: java.util.Map[String, AnyRef]): Map[Symbol, Any] = {
| import scala.collection.JavaConversions._| Map.empty ++ (in map { pair => (Symbol(pair._1) -> pair._2.asInstanceOf[Any]) })| }
convertMap: (in: java.util.Map[String,AnyRef])Map[Symbol,Any]scala> convertMap(m)res2: Map[Symbol,Any] = Map('a -> 123, 'b -> 456)
The render method I'm trying to call takes the following:def render(args: (Symbol, Any)*)
render(convertMap(theMapToConvert).toSeq :_*)