equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright 2011 Tomas Zeman <tzeman@volny.cz> |
2 * Copyright 2011-2012 Tomas Zeman <tzeman@volny.cz> |
3 * |
3 * |
4 * Licensed under the Apache License, Version 2.0 (the "License"); |
4 * Licensed under the Apache License, Version 2.0 (the "License"); |
5 * you may not use this file except in compliance with the License. |
5 * you may not use this file except in compliance with the License. |
6 * You may obtain a copy of the License at |
6 * You may obtain a copy of the License at |
7 * |
7 * |
15 */ |
15 */ |
16 package net.tz.lift.boot |
16 package net.tz.lift.boot |
17 |
17 |
18 import net.liftweb.common._ |
18 import net.liftweb.common._ |
19 import net.liftweb.http._ |
19 import net.liftweb.http._ |
20 import net.liftweb.mapper._ |
|
21 import net.liftweb.sitemap._ |
20 import net.liftweb.sitemap._ |
22 import net.liftweb.sitemap.Loc._ |
21 import net.liftweb.sitemap.Loc._ |
23 import net.liftweb.util._ |
22 import net.liftweb.util._ |
24 import net.liftweb.widgets.menu.MenuWidget |
23 import net.liftweb.widgets.menu.MenuWidget |
25 import net.tz.lift.snippet.ActionLinks |
24 import net.tz.lift.snippet.ActionLinks |
29 * Prototype boot class to be either extended or copied. |
28 * Prototype boot class to be either extended or copied. |
30 */ |
29 */ |
31 class ProtoBoot extends Logger { |
30 class ProtoBoot extends Logger { |
32 |
31 |
33 def boot: Unit = { |
32 def boot: Unit = { |
34 /* DB stuff */ |
|
35 /* |
|
36 S.addAround(DB.buildLoanWrapper()) |
|
37 */ |
|
38 |
|
39 if (Props.mode == Props.RunModes.Development) |
|
40 DB.addLogFunc { (dbLog, l) => dbLog.statementEntries.foreach { e => |
|
41 debug("Query: " + e.statement) |
|
42 }} |
|
43 |
33 |
44 /* Date format */ |
34 /* Date format */ |
45 LiftRules.dateTimeConverter.default.set { () => YmdDateTimeConverter } |
35 LiftRules.dateTimeConverter.default.set { () => YmdDateTimeConverter } |
46 |
36 |
47 /* Handle end slash and drop it (except for home page) */ |
37 /* Handle end slash and drop it (except for home page) */ |
62 } |
52 } |
63 |
53 |
64 /* Sitemap */ |
54 /* Sitemap */ |
65 SiteMap.enforceUniqueLinks = false |
55 SiteMap.enforceUniqueLinks = false |
66 |
56 |
67 /* |
|
68 LiftRules.setSiteMap(SiteMap( |
|
69 Menu.i("Home") / "index" >> Hidden |
|
70 )) |
|
71 */ |
|
72 |
|
73 /* Menu widget */ |
57 /* Menu widget */ |
74 MenuWidget.init() |
58 MenuWidget.init() |
75 |
59 |
76 /* Http conf */ |
60 /* Http conf */ |
77 LiftRules.logServiceRequestTiming = false |
61 LiftRules.logServiceRequestTiming = false |