Skip to content

Commit

Permalink
Init timetable.
Browse files Browse the repository at this point in the history
  • Loading branch information
dboissin committed Jul 18, 2011
1 parent f5ecedf commit 0f1d811
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
32 changes: 32 additions & 0 deletions src/main/scala/poc/resources/TimetableResource.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package poc.resources

import com.sun.jersey.api.view.ImplicitProduces
import javax.ws.rs.Path
import javax.ws.rs.PathParam
import javax.ws.rs.GET
import com.sun.jersey.api.view.Viewable
import poc.dto.TimetableDTO

@Path("/timetable")
@ImplicitProduces(Array("text/html;qs=5"))
class TimetableResource {

def blip() = {
new TimetableDTO("year", "week", "name")
}

@GET
/*@Path("/")
def cashierTimetable() = {
*/
@Path("/{year}/{week}/{name}")
def cashierTimetable(
@PathParam("year") year:String,
@PathParam("week") week:String,
@PathParam("name") name:String) = {
println("cashier timetable")
new Viewable("index", blip)
// new TimetableDTO("2011", "34", "Blip")
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
-@ val it: TimetableResource

%html
%body
%h1 Timetable #{it.blip.name}

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
-@ val it: TimetableResource

%html
%body
%h1 Timetable #{it.blip.name}

0 comments on commit 0f1d811

Please sign in to comment.