[Lift] Re: is that a lift's bug?

2009-08-14 Thread David Pollak
On Fri, Aug 14, 2009 at 1:10 AM, xiaomingzhen...@gmail.com <
xiaomingzhen...@gmail.com> wrote:

>
> i am a newer to lift, and now i am reading the book the definitive
> guide to lift. In chapter 5.1, book told me this:
> val helpMenu = Menu(Loc("helpHome",("help" :: "" :: Nil) ->
> true,"Help")) make all the files under help folder accessible, but i
> found the loc object in the Menu item should write like this:
> ("help" :: Nil) -> true. Is that book wrong?
>
> and sometimes i wrote Menu(Loc("Home", "/", "Home")) and got a compile
> wrong, and i have to write Menu(Loc("Home", "/" :: Nil, "Home")). i
> have imported Loc._, why "/" string can not convert to a list? is that
> a lift bug?
>
> besides, does all pages accessible in lift project must be import to
> Sitemap?


No.  If you do not declare the sitemap, then all the pages in the app will
be available, however you'll have to manually enforce access control and
manually build menus.  You can also define particular directories as
"anything in this directory gets served."


> if so, when the website is large, the work may be tiring?


It's been my experience that having a large site is a very good reason to
have SiteMap... you can have each module define its pages, access control,
etc. and roll that up into a nice menu.


>
>
> >
>


-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Git some: http://github.com/dpp

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: is that a lift's bug?

2009-08-14 Thread Derek Chen-Becker
That looks like a typo in the book. I'll fix it.

Derek

On Fri, Aug 14, 2009 at 2:10 AM, xiaomingzhen...@gmail.com <
xiaomingzhen...@gmail.com> wrote:

>
> i am a newer to lift, and now i am reading the book the definitive
> guide to lift. In chapter 5.1, book told me this:
> val helpMenu = Menu(Loc("helpHome",("help" :: "" :: Nil) ->
> true,"Help")) make all the files under help folder accessible, but i
> found the loc object in the Menu item should write like this:
> ("help" :: Nil) -> true. Is that book wrong?
>
> and sometimes i wrote Menu(Loc("Home", "/", "Home")) and got a compile
> wrong, and i have to write Menu(Loc("Home", "/" :: Nil, "Home")). i
> have imported Loc._, why "/" string can not convert to a list? is that
> a lift bug?
>
> besides, does all pages accessible in lift project must be import to
> Sitemap? if so, when the website is large, the work may be tiring?
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: is that a lift's bug?

2009-08-14 Thread Jeppe Nejsum Madsen

"marius d."  writes:


[...]

>> besides, does all pages accessible in lift project must be import to
>> Sitemap?
>
> To access a page you should put it in the SiteMap. You can choose to
> not use SiteMap at all but rather work only with DispatchPF and so on,
> but for a web application this is impractical.

You could also add

LiftRules.passNotFoundToChain = true

in order to serve static content from your webapp

/Jeppe

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: is that a lift's bug?

2009-08-14 Thread marius d.



On Aug 14, 11:10 am, "xiaomingzhen...@gmail.com"
 wrote:
> i am a newer to lift, and now i am reading the book the definitive
> guide to lift. In chapter 5.1, book told me this:
> val helpMenu = Menu(Loc("helpHome",("help" :: "" :: Nil) ->
> true,"Help")) make all the files under help folder accessible, but i
> found the loc object in the Menu item should write like this:
> ("help" :: Nil) -> true. Is that book wrong?
>
> and sometimes i wrote Menu(Loc("Home", "/", "Home")) and got a compile
> wrong, and i have to write Menu(Loc("Home", "/" :: Nil, "Home")). i
> have imported Loc._, why "/" string can not convert to a list? is that
> a lift bug?

String and List are unrelated types. You can write if you want in
implicit conversion function but IMHO is not worth it.

Menu(Loc("Home", List("/"), "Home"))
For this construct Lift already has an implicit conversion
strLstToLink from a Seq[String] to a Link which is what Loc apply
expects.

So List[String] is expected because a path is not expressed as a plain
string but rather as a List of path parts.


>
> besides, does all pages accessible in lift project must be import to
> Sitemap?

To access a page you should put it in the SiteMap. You can choose to
not use SiteMap at all but rather work only with DispatchPF and so on,
but for a web application this is impractical.

>if so, when the website is large, the work may be tiring?

You only define the sitemap once. You can break it to modules etc.
that return specific lists of Menus but that's about application
design. If you're doing RIA style application you'll probably won't
need a tremendous amount of pages anyways.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---