This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.scalatest.FunSuite | |
import xml.NodeSeq | |
import org.fusesource.scalate.scuery.{Transform, Transformer} | |
class SimpleSqueryTest extends FunSuite{ | |
test("hello"){ | |
println(transformer(seq)) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
renderWith(ViewPath(GET, MappedPath("/myresource/")), modelObject1, modelObject1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.bowlerframework.view.squery.component.ValidationFeedbackPanel | |
ValidationFeedbackPanel.showErrorMessages |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
get("/widgets/new/squery")((request, response) => { | |
renderWith(new SqueryWidgetPage(new NewWidgetForm),Widget(0, null, null, null)) | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.bowlerframework.view.squery.{Component,MarkupContainer} | |
class SqueryWidgetPage(component: MarkupContainer) extends Component{ | |
$(".tabs-container").contents = component.render | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<span> | |
<h3>Create new Widget</h3> | |
<div id="errorPanel"></div> | |
<form method="POST" action="/widgets">Id<br/><input name="widget.id" value=""/><br/> | |
Name<br/><input name="widget.name" value=""/><br/> | |
Year Made<br/><input name="widget.yearMade" value=""/><br/> | |
Description<br/><input name="widget.description" value=""/><br/><input type="submit" value="Create!"/> | |
</form> | |
</span> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.bowlerframework.view.squery.component.ValidationFeedbackPanel._ | |
import org.bowlerframework.view.squery.Component | |
import org.bowlerframework.RequestScope | |
class NewWidgetForm extends Component{ | |
val request = RequestScope.request | |
$("#errorPanel").contents = showErrorMessages | |
request.getSession.getValidatedModel match{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.recursivity.commons.bean.scalap | |
import scala.tools.scalap.scalax.rules.scalasig._ | |
import tools.scalap._ | |
import scalax.rules.scalasig.ClassFileParser.{ConstValueIndex, Annotation} | |
import reflect.generic.ByteCodecs | |
import java.io.{StringWriter, ByteArrayOutputStream, PrintStream} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MyController extends Controller with ParameterMapper with Renderable{ | |
post("/widgets/")((request, response) => { | |
mapRequest[Widget](request)(widget => { | |
render(WidgetService.save(widget)) | |
}) | |
}) | |
} | |
object WidgetService extends Validations{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class POSOController extends Controller with FunctionNameConventionRoutes{ | |
// * back-ticks on the function name allow us to give function any random name, | |
// ..such as a RESTful URL with named parameters, wildcards etc! | |
// * Two choices: | |
// -if the Controller does NOT extend Renderable, return-types will be | |
// automatically rendered by a parent Renderable | |
// - if Controller does extend Renderable, API user has full controll over render-calls | |
def `GET /myresource/:id`(id: Long): MyResource = { | |
// impl code goes here |