During addition of some new features, I found something odd:
I have two Locs that both contain a rewrite function:
Loc1: assets/edit/x -> assets/edit
Loc2: assets/x/edit -> assets/edit
What happens is that if I hit the url in Loc2, the calcTemplate of
Loc1 is called, but the snippets from Loc1 is used (I think, since
they're not the same the template doesn't render) ...
This strikes me as odd. Never mind the fact that the two scenarios
above don't make sense, is this expected behavior?
/Jeppe
/Jeppe
--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Yeah, that was what I was thinking. Is there a reason why it's not an
error to add two Locs with the same link.uriList? Iirc, this is not
possible with "normal" sitemap entries....
/Jeppe
/Jeppe
--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Yep, http://www.assembla.com/spaces/liftweb/tickets/423
/Jeppe
I used to do:
val entries =
Menu(Loc("Home", List("index"), "Home")) ::
Menu(Loc("About", List("index"), "About")) ::
Nil
This approach throws a SiteMapException after ticket 423.
Trond
--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Because it is not well defined which Loc is used for e.g. access
control when the link is accessed.
/Jeppe
Cheers, Tim
This change breaks one of my production apps! I have several menu items with the same link.Why should it be an error to have several Locs with the same link.uriList?
What can we do?
On Wed, Mar 24, 2010 at 4:25 AM, Heiko Seeberger <heiko.s...@googlemail.com> wrote:
This change breaks one of my production apps! I have several menu items with the same link.Why should it be an error to have several Locs with the same link.uriList?Can you explain the use case for this?
What can we do?
If I understand the reason for it, I can either roll back the patch or create a mechanism for saying "Yeah... this is okay."
Cant you just use rewriting?
On 24 March 2010 14:03, David Pollak <feeder.of...@gmail.com> wrote:On Wed, Mar 24, 2010 at 4:25 AM, Heiko Seeberger <heiko.s...@googlemail.com> wrote:
This change breaks one of my production apps! I have several menu items with the same link.Why should it be an error to have several Locs with the same link.uriList?Can you explain the use case for this?Very simple: There are several menu items that point to the same Loc/link/template.
My client has got a complex website with a complex menu and some important links are accessible as "favorites".
What can we do?
If I understand the reason for it, I can either roll back the patch or create a mechanism for saying "Yeah... this is okay."I already rolled the commit back locally, but this will only last for today. I would appreciate if you could roll back the commit until we find a solution that satisfies all needs.Heiko
Company: weiglewilczek.com
Blog: heikoseeberger.name
Follow me: twitter.com/hseeberger
OSGi on Scala: scalamodules.org
Lift, the simply functional web framework: liftweb.net
--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
On 24 March 2010 14:36, Timothy Perrett <tim...@getintheloop.eu> wrote:Cant you just use rewriting?Maybe, but that seems to me any ugly fix introducing unnecessary complexity. Please consider also that there seem to be others affected by this change (see this thread) and I am pretty sure that others will be affected.Please let's roll back and then discuss the solution for the following requirements:1. We need to support multiple menu items to the same location
2. We need to access protect the location uniquely (if I understand the issue related to #423 correctly)
Do all of these menu items have the same name?
Do all of the pages render the same or is there some mechanism on the page that determines what the real page is?
When you click on any given link that points to the same place, which menu item should be highlighted (put another way, what are your breadcrumbs)?
Please let's roll back and then discuss the solution for the following requirements:1. We need to support multiple menu items to the same locationI don't see this as a requirement and until I see a use case, I don't agree that this is a requirement.2. We need to access protect the location uniquely (if I understand the issue related to #423 correctly)We need to help people not have incorrectly designed menus. It is incorrect in my opinion and Jeppe's opinion to have two different menu items pointing to the same URL. That's the meaning of the ticket and that's what I implemented.
I think the fundamental issue here is that Loc both defines the menu
structure and what happens on any given URL.
I agree that there are use cases for having the same URL accessible
from different places in an app. But some subset of this this is still
possible by creating an anchor tag pointing to the Loc (ie the Github
logo case). In your
But to me Loc is mostly about defining what happes on any given URL
(ie access control, what template to render, what rewriting to do
etc). Here it simply doesn't make sense to have several Locs with the
same url.
So, I think the current solution is correct, but maybe it is breaking
too much without a clear workaround (it broke my production app as
well, but both cases turned out to be errors in the menu structure!).
So what to do? I see a few options:
1) Optionally define the menu text in Menu. Then you could add the
same Loc to different menus:
val loc = Loc(...)
val entries =
Menu(loc, "Home") ::
Menu(loc, "About" ::
Nil
In fact, since you do your own menu rendering, can't you just subclass
Menu like the above and do the correct rendering?
2) Make a special cased LocAlias:
val loc = Loc(...)
val alias = LocAlias(loc, "About")
val entries =
Menu(loc) ::
Menu(alias) ::
Nil
I don't really know the inner workings of sitemap well enough to see
if there are issues with any of these solutions...and there may be
better ones.
You still end up with the problem of identifying the correct
breadcrumb to a given URL: Is it About or Home?
/Jeppe
/Jeppe
Heiko, this should work for you right?
Cheers, Tim
I think the fundamental issue here is that Loc both defines the menustructure and what happens on any given URL.
I agree that there are use cases for having the same URL accessible
from different places in an app.
But some subset of this this is still
possible by creating an anchor tag pointing to the Loc (ie the Github
logo case). In your
But to me Loc is mostly about defining what happes on any given URL
(ie access control, what template to render, what rewriting to do
etc). Here it simply doesn't make sense to have several Locs with the
same url.
1) Optionally define the menu text in Menu. Then you could add the
same Loc to different menus:
val loc = Loc(...)
val entries =
Menu(loc, "Home") ::
Menu(loc, "About" ::
Nil
In fact, since you do your own menu rendering, can't you just subclass
Menu like the above and do the correct rendering?
2) Make a special cased LocAlias:
val loc = Loc(...)
val alias = LocAlias(loc, "About")
val entries =
Menu(loc) ::
Menu(alias) ::
Nil
--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
[...]
>> But some subset of this this is still
>> possible by creating an anchor tag pointing to the Loc (ie the Github
>> logo case). In your
>
> Sounds good! What exactly are you talking about? What's an anchor tag? Could
> you please give me an example?
Basically just an <a/> tag:
<lift:Menu.item name="home">About</lift:Menu.item>
will render the "home" loc somewhere with the text "About"
>> But to me Loc is mostly about defining what happes on any given URL
>> (ie access control, what template to render, what rewriting to do
>> etc). Here it simply doesn't make sense to have several Locs with the
>> same url.
>
> Well, it depends. Sometimes you will not define any special behavior (no
> LocParams at all). Then Loc is *only* about menu structure.
Well yes, but this is just a special case of the more general scenario.
> Lift *must* support all use cases, right?
I don't know :-)
>> 1) Optionally define the menu text in Menu. Then you could add the
>> same Loc to different menus:
>>
>> val loc = Loc(...)
>> val entries =
>> Menu(loc, "Home") ::
>> Menu(loc, "About" ::
>> Nil
>>
>> In fact, since you do your own menu rendering, can't you just subclass
>> Menu like the above and do the correct rendering?
>
> Sounds great! Separates concerns, should work.
>
>>
>> 2) Make a special cased LocAlias:
>>
>> val loc = Loc(...)
>> val alias = LocAlias(loc, "About")
>> val entries =
>> Menu(loc) ::
>> Menu(alias) ::
>> Nil
>
> What's a LocAlias?
Just a possible future Loc subclass I made up, that makes it explicit
that this Loc as actually just an alias for another Loc and it is the
other Loc that controls the LocParams.
/Jeppe
What happens here:
val entries =
Menu(Loc("Home", List("index"), "Home", User.testSuperUser,
AllowDuplicationURI)) ::
Menu(Loc("About", List("index"), "About",AllowDuplicationURI)) ::
Nil
Do you have to be super user or not to see the index? Granted, it is
up the developer to make sure it makes sense. But maybe as an interim
solution until a more permanent one is found?
My LocAlias class above would make it more explicit that this Loc is
really an alias for another Loc and it is the other Loc that controls
the LocParams.
But none of the methods really solve the fundamental issue of
separating the concerns between URI mapping & menu structure.....
/Jeppe
This starts becoming a very valuable discussion!Until we find a good solution, would it be possible to revert the commit?
On Wed, Mar 24, 2010 at 11:18 AM, Heiko Seeberger <heiko.s...@googlemail.com> wrote:
This starts becoming a very valuable discussion!Until we find a good solution, would it be possible to revert the commit?
There is a solution right now:
Menu(Loc("Foo", List("place"), "Foo")) ::
Menu(Loc("Foo2", List("placex") /* this used to be List("place") */, "Other Foo", Template(() => TemplateFinder.findAnyTemplate(List("place")) openOr NodeSeq.Empty))) ::
Nil
So, you specify a different URL for each page, but use the same template.
So this change has broken our application (this is why I keep production pinned to a milestone release :-) )
On Tue, Mar 30, 2010 at 11:43 AM, Ross Mellgren <dri...@gmail.com> wrote:So this change has broken our application (this is why I keep production pinned to a milestone release :-) )
Open a ticket for me on M4. I'll put a flag in to disable to enforcement.