| author | Tomas Zeman <tzeman@volny.cz> |
| Wed, 30 May 2012 22:51:02 +0200 | |
| changeset 100 | 1fcbeae1f9da |
| parent 99 | 49eb72a46208 |
| permissions | -rw-r--r-- |
| 11 | 1 |
/* |
|
22
94ed9cfdb123
Squeryl connection manager instead of mapper-based
Tomas Zeman <tzeman@volny.cz>
parents:
16
diff
changeset
|
2 |
* Copyright 2011-2012 Tomas Zeman <tzeman@volny.cz> |
| 11 | 3 |
* |
4 |
* Licensed under the Apache License, Version 2.0 (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 |
|
7 |
* |
|
8 |
* http://www.apache.org/licenses/LICENSE-2.0 |
|
9 |
* |
|
10 |
* Unless required by applicable law or agreed to in writing, software |
|
11 |
* distributed under the License is distributed on an "AS IS" BASIS, |
|
12 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
13 |
* See the License for the specific language governing permissions and |
|
14 |
* limitations under the License. |
|
15 |
*/ |
|
16 |
package bootstrap.liftweb |
|
17 |
||
18 |
import fis.base.model._ |
|
| 49 | 19 |
import fis.base.ui._ |
| 70 | 20 |
import fis.aaa.model._ |
21 |
import fis.aaa.ui._ |
|
| 69 | 22 |
import fis.crm.ui._ |
| 100 | 23 |
import fis.fs.lib._ |
24 |
import fis.fs.model._ |
|
| 76 | 25 |
import fis.geo.ui._ |
| 79 | 26 |
import fis.pm.ui._ |
| 99 | 27 |
import fis.sr.ui._ |
|
22
94ed9cfdb123
Squeryl connection manager instead of mapper-based
Tomas Zeman <tzeman@volny.cz>
parents:
16
diff
changeset
|
28 |
import fis.db.SquerylTxMgr |
| 100 | 29 |
import java.io.File |
| 77 | 30 |
import net.datatables.DataTables |
| 11 | 31 |
import net.liftweb.common._ |
32 |
import net.liftweb.http._ |
|
| 15 | 33 |
import net.liftweb.sitemap._ |
| 11 | 34 |
import net.liftweb.squerylrecord.SquerylRecord |
35 |
import net.liftweb.util._ |
|
36 |
import net.liftweb.util.Helpers._ |
|
37 |
import net.tz.lift.boot.ProtoBoot |
|
38 |
||
39 |
class Boot extends ProtoBoot {
|
|
40 |
override def boot = {
|
|
41 |
||
42 |
/* DB stuff */ |
|
|
22
94ed9cfdb123
Squeryl connection manager instead of mapper-based
Tomas Zeman <tzeman@volny.cz>
parents:
16
diff
changeset
|
43 |
SquerylTxMgr.init() |
| 11 | 44 |
|
45 |
super.boot |
|
46 |
||
| 15 | 47 |
import Loc._ |
48 |
||
| 70 | 49 |
AuthnSnippet.init() |
| 49 | 50 |
SecNav.init() |
| 77 | 51 |
DataTables.init() |
| 49 | 52 |
|
| 70 | 53 |
/* Authn wiring */ |
54 |
UserVendors.cur.default.set(Vendor(() => AuthnSnippet.cur)) |
|
55 |
AuthnSnippet. |
|
56 |
registerAuthenticator(FetchUserAuthenticator). |
|
57 |
registerAuthenticator(PasswordAuthenticator) |
|
58 |
||
| 87 | 59 |
val menus = List(Menu("/", "FIS Main page") / "index" >>
|
60 |
EarlyResponse(() => Full(RedirectResponse(ProjectSnippet.url.list))) >> |
|
61 |
Hidden, |
|
| 88 | 62 |
ProjectSnippet.menu, |
63 |
TaskSnippet.menu, |
|
| 67 | 64 |
UserSnippet.menu, |
| 70 | 65 |
AuthnSnippet.menu, |
| 88 | 66 |
CompanySnippet.menu, |
67 |
ContactSnippet.menu, |
|
| 68 | 68 |
CountrySnippet.menu, |
| 79 | 69 |
CitySnippet.menu, |
| 99 | 70 |
LocationSnippet.menu, |
71 |
ServiceSnippet.menu |
|
| 79 | 72 |
) |
| 15 | 73 |
|
74 |
LiftRules.setSiteMap(SiteMap(menus:_*)) |
|
| 41 | 75 |
|
76 |
LiftRules.htmlProperties.default.set { r: Req =>
|
|
77 |
Html5Properties(r.userAgent) } |
|
|
51
523c5c5b84e5
[mq]: twitter-bootstrap-forms-error+help.patch
Tomas Zeman <tzeman@volny.cz>
parents:
49
diff
changeset
|
78 |
|
|
523c5c5b84e5
[mq]: twitter-bootstrap-forms-error+help.patch
Tomas Zeman <tzeman@volny.cz>
parents:
49
diff
changeset
|
79 |
ScreenRules.init() |
| 75 | 80 |
|
81 |
/* Language */ |
|
82 |
LangSwitcher.init() |
|
83 |
LiftRules.localeCalculator = { _ => CurLanguage.get }
|
|
| 100 | 84 |
|
85 |
/* Attachment */ |
|
86 |
for {
|
|
87 |
dn <- Props get "dir.attachment" |
|
88 |
} {
|
|
89 |
val r = new FileSystemAttachmentStore(new File(dn)) |
|
90 |
Attachment.repo.default.set(Vendor(Full(r))) |
|
91 |
LiftRules.maxMimeSize = 80 * 1024 * 1024 |
|
92 |
LiftRules.maxMimeFileSize = 70 * 1024 * 1024 |
|
93 |
} |
|
94 |
||
| 11 | 95 |
} |
96 |
} |
|
97 |
||
98 |
// vim: set ts=2 sw=2 et: |