Jörn Nettingsmeier wrote:
Richard Frovarp wrote:
So my question for you is this: Is it just cocoon:/ or does it include cocoon:// as well? The code in usecases.js matches cocoon:/ but the subsequent substring will leave the trailing / from cocoon://

iirc, the flow code only deals with a protocol-less string "FOO/BAR/BAZ" that is then fed to the flow sitemap and interpreted as if you had requested "cocoon:/FOO/BAR/BAZ" from the context of that flow sitemap. the leading slash is left intact afaik. does that answer your question? if not, i'd need to dig into the flow code again...



The relevant section from usecases.js:
// we used to allow a cocoon:/ prefix (which sendPageXXX does not handle),
   // but it is now deprecated!
   if (viewUri.startsWith("cocoon:/")) {
viewUri = viewUri.substring(new Packages.java.lang.String("cocoon:/").length()); log("warn", "The use of the cocoon:/ protocol prefix in the <view uri=\"...\"> attribute is deprecated!");
   }
   if (! viewUri.startsWith("/")) {
// a local URI must be handled by usecase.xmap, which assumes a prefix "usecases-view/[menu|nomenu]/ // that determines whether the menu is to be displayed. this mechanism is used by most lenya core usecases.
       viewUri = "usecases-view/"
           + (view.showMenu() ? "menu" : "nomenu")
           + "/" + viewUri;
   }


So the first if matches cocoon:// and cocoon:/. You then do a substring that leaves the second / behind in the case of cocoon://. In the case of cocoon:/ the second if would trip, but in the case of cocoon:// it would not. Is this behavior correct? The code and the comments are confusing to me. I only see <view uri> with cocoon://, but the message is still tripping because they match the first if and are in fact acted upon.

So basically I'm confused as the comments only reference cocoon:/ and not cocoon://, but it is obvious that the code acts on cocoon://. Given what the difference is between / and // it would seem that the code is correct and the comments are not complete.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to