You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by Diwaker Gupta <di...@apache.org> on 2005/10/01 18:45:48 UTC
locationmaps not working?
I'm getting errors using locationmap:
$ cat content/locationmap.xml
<locationmap xmlns="http://apache.org/forrest/locationmap/1.0">
<locator>
<match pattern="code/**">
<location src="http://floatingsun.net/code/{1}" />
</match>
</locator>
</locationmap>
Usage in my pages is like:
<a href="lm:code/DaffyInstaller.jar">Daffy Installer</a>
On running Forrest, I get errors like:
X [0] projects/lm:code/DaffyInstaller.jar
BROKEN: No pipeline matched request: projects/lm:code/DaffyInstaller.jar
Seems like locationmap's are not being used in the pipeline or something
similar. Any ideas?
Diwaker
--
Web/Blog/Gallery: http://floatingsun.net
On Apache: http://people.apache.org/~diwaker
Re: locationmaps not working?
Posted by Diwaker Gupta <di...@apache.org>.
Ok, atleast part of the problem seems to be from the fact that Forrest tries
to verify the existance of the target of a locationmap expansion before using
it. So if I have a match for rewriteDemo/** that maps to
http://floatingsun.net/foobar/{1}.html, and this file doesn't exist then the
locationmap fails.
IMHO, locationmap should generate what I ask it to, irrespective of its
existence. There are multiple reasons:
o at the time I'm generating my static pages, the targets may not exist. But I
might just copy them later on.
o how does Forrest do this check precisely? I'm assuming some kind of message
to the webserver? That might not be a very good idea...
But I'm having problems despite this. More as I find out.
--
Web/Blog/Gallery: http://floatingsun.net
On Apache: http://people.apache.org/~diwaker
Re: locationmaps not working?
Posted by Diwaker Gupta <di...@apache.org>.
On Saturday 01 October 2005 4:17 pm, Ross Gardler wrote:
> Is this a views based site? (if so try turning off views to see if it
> works with skins)
Doesn't seem to be views related. The *exact* same locationmap is working in a
Forrest seed but not for me. Even weirder, it works some times and doesn't
other times. Ok, I know I'm not giving any real information here, but right
now I'm just trying to isolate the problem :)
Will keep this thread updated as I find something new.
Diwaker
--
Web/Blog/Gallery: http://floatingsun.net
On Apache: http://people.apache.org/~diwaker
Re: locationmaps not working?
Posted by Diwaker Gupta <di...@apache.org>.
On Saturday 01 October 2005 4:17 pm, Ross Gardler wrote:
> However, the locationmap does work, see the link reqriting section on
> our forest-seed site [1]
>
> http://forrest.zones.apache.org/ft/build/forrest-seed/samples/locationmap/i
>ndex.html
Yep, sure does.
> Do you have a custom sitemap for your project?
Nope.
> Is this a views based site? (if so try turning off views to see if it
> works with skins)
Yep. Trying without views right now. Will report back shortly.
--
Web/Blog/Gallery: http://floatingsun.net
On Apache: http://people.apache.org/~diwaker
Re: locationmaps not working?
Posted by Diwaker Gupta <di...@apache.org>.
So finally in frustration, I created a fresh site (views enabled), made sure
that locationmap rewriting is working (in samples/locationmap/index.html).
Then I copied over the seed-site's locationmap and the sample index.xml file
over into my content area and did the same thing. Doesn't work!
I'm totally out of ideas now. I've made sure that my sitemap.xmap,
catalog.xcat, CatalogManager.properties, forrest.properties -- all are
basically identical to the seed site. But it just doesn't work.
I think I'm going to take a break now and wait for some fresh inspiration :)
--
Web/Blog/Gallery: http://floatingsun.net
On Apache: http://people.apache.org/~diwaker
Re: locationmaps not working?
Posted by David Crossley <cr...@apache.org>.
Ross Gardler wrote:
> Diwaker Gupta wrote:
> >Ross Gardler wrote:
> >
> >>Cool. Does this mean the issue you raised earlier in this thread about
> >>the LM verifying the existence of a file is not critical?
> >>
> >>I think you had a valid point about this when using the LM to rewrite
> >>links, but I'm not sure if this was all one of the strange effects you
> >>were getting.
> >
> >This issue still exists (try changing burrokeet.org to foobar.com or some
> >random name in samples/locationmap/index.xml and see what happens). I
> >certainly think its critical (and I think an implementation that does
> >_not_ do this check would be simpler). What do other people think about it?
I became aware of that recently. We actually had
a bad URL for that demo, but we didn't know it was
broken. Suddenly there was a change in behaviour.
It didn't used to verify. See where i needed to
change the demo.
svn log main/fresh-site/src/documentation/content/locationmap.xml
------
Restore upgrade from excalibur-sourceresolve-1.1 to excalibur-sourceresolve-2.1
Use a successful result for the rewriteDemo/index locationmap
demo in seed-sample.
See "changed behaviour for locationmap"
http://marc.theaimsgroup.com/?l=forrest-dev&m=11270994920771
------
> There are two distinct uses of the locationmap. One is for URL rewriting
> (like you are doing). In this instance I think you have a good case for
> not doing the check for existence, at least during development. However,
> at publication time I think this is a valid check as it will highlight
> broken links.
>
> The other use of the LM is where we use it to resolve the location of a
> source file, as in the sitemap stuff. I this instance the check has to
> be made, otherwise a meaningless error is given (null pointer).
>
> One solution would be to add an attribute to the locator node that
> allows us to set whether we should check for existence. This could have
> three values: "always", "never" or "publication". The last option would
> allow us (with the addition of a new CLI parameter) to check that the
> file exists when we try and publish the site, but would allow us to
> ignore errors during development.
However we do not want to ignore errors during development,
so the default is good.
-David
> I don't have the time to implement this yet. If this proposal would
> solve your problem then please add it to the issue tracker (along with
> any other alternatives you can think of).
>
> Ross
Re: locationmaps not working?
Posted by Ross Gardler <rg...@apache.org>.
Diwaker Gupta wrote:
> On Sunday 02 October 2005 3:46 am, Ross Gardler wrote:
>
>>Cool. Does this mean the issue you raised earlier in this thread about
>>the LM verifying the existence of a file is not critical?
>>
>>I think you had a valid point about this when using the LM to rewrite
>>links, but I'm not sure if this was all one of the strange effects you
>>were getting.
>
>
> This issue still exists (try changing burrokeet.org to foobar.com or some
> random name in samples/locationmap/index.xml and see what happens). I
> certainly think its critical (and I think an implementation that does _not_
> do this check would be simpler). What do other people think about it?
There are two distinct uses of the locationmap. One is for URL rewriting
(like you are doing). In this instance I think you have a good case for
not doing the check for existence, at least during development. However,
at publication time I think this is a valid check as it will highlight
broken links.
The other use of the LM is where we use it to resolve the location of a
source file, as in the sitemap stuff. I this instance the check has to
be made, otherwise a meaningless error is given (null pointer).
One solution would be to add an attribute to the locator node that
allows us to set whether we should check for existence. This could have
three values: "always", "never" or "publication". The last option would
allow us (with the addition of a new CLI parameter) to check that the
file exists when we try and publish the site, but would allow us to
ignore errors during development.
I don't have the time to implement this yet. If this proposal would
solve your problem then please add it to the issue tracker (along with
any other alternatives you can think of).
Ross
Re: locationmaps not working?
Posted by Diwaker Gupta <di...@apache.org>.
On Sunday 02 October 2005 3:46 am, Ross Gardler wrote:
> Cool. Does this mean the issue you raised earlier in this thread about
> the LM verifying the existence of a file is not critical?
>
> I think you had a valid point about this when using the LM to rewrite
> links, but I'm not sure if this was all one of the strange effects you
> were getting.
This issue still exists (try changing burrokeet.org to foobar.com or some
random name in samples/locationmap/index.xml and see what happens). I
certainly think its critical (and I think an implementation that does _not_
do this check would be simpler). What do other people think about it?
--
Web/Blog/Gallery: http://floatingsun.net
On Apache: http://people.apache.org/~diwaker
Re: locationmaps not working?
Posted by Ross Gardler <rg...@apache.org>.
Diwaker Gupta wrote:
> ok, I'm a dumb-ass (*bangs head against the wall*)
We all have those moments :-(
> Anyways, all's well that ends well and I can now go to sleep peacefully
> knowing that my website has been updated properly :)
Cool. Does this mean the issue you raised earlier in this thread about
the LM verifying the existence of a file is not critical?
I think you had a valid point about this when using the LM to rewrite
links, but I'm not sure if this was all one of the strange effects you
were getting.
> PS: locationmap looks great. The xmap files already look much less
> intimidating!
Cool, that's the goal. I think the real benefit will come in
resources.xmap...
Ross
Re: locationmaps not working?
Posted by Diwaker Gupta <di...@apache.org>.
ok, I'm a dumb-ass (*bangs head against the wall*)
I copied over the locationmap from the seed site and customized it like I
wanted (and I *swear* I'd tried this before), and it just worked. I don't
know what was wrong, and I don't even know how it got fixed. Can things
possibly get worse??!
Anyways, all's well that ends well and I can now go to sleep peacefully
knowing that my website has been updated properly :)
PS: locationmap looks great. The xmap files already look much less
intimidating!
--
Web/Blog/Gallery: http://floatingsun.net
On Apache: http://people.apache.org/~diwaker
Re: locationmaps not working?
Posted by Ross Gardler <rg...@apache.org>.
Diwaker Gupta wrote:
> On Saturday 01 October 2005 11:00 am, Ross Gardler wrote:
>
>><a href="{lm:code/DaffyInstaller.jar}">Daffy Installer</a>
>
>
> Still not working :( Now I get:
>
> X [0]
> projects/{lm:code/DaffyInstaller.jar} BROKEN: No pipeline matched request:
> projects/{lm:code/DaffyInstaller.jar}
>
> Is there a working sample in one of the plugins I can look at?
DOH! Sorry, I didn't read your mail correctly. Your first version was
correct (in syntax).
However, the locationmap does work, see the link reqriting section on
our forest-seed site [1]
http://forrest.zones.apache.org/ft/build/forrest-seed/samples/locationmap/index.html
I've looked again at your original mail and your locationmap looks fine.
Do you have a custom sitemap for your project?
Is this a views based site? (if so try turning off views to see if it
works with skins)
Ross
Re: locationmaps not working?
Posted by Diwaker Gupta <di...@apache.org>.
On Saturday 01 October 2005 11:00 am, Ross Gardler wrote:
> <a href="{lm:code/DaffyInstaller.jar}">Daffy Installer</a>
Still not working :( Now I get:
X [0]
projects/{lm:code/DaffyInstaller.jar} BROKEN: No pipeline matched request:
projects/{lm:code/DaffyInstaller.jar}
Is there a working sample in one of the plugins I can look at?
--
Web/Blog/Gallery: http://floatingsun.net
On Apache: http://people.apache.org/~diwaker
Re: locationmaps not working?
Posted by Ross Gardler <rg...@apache.org>.
Diwaker Gupta wrote:
> I'm getting errors using locationmap:
>
> $ cat content/locationmap.xml
> <locationmap xmlns="http://apache.org/forrest/locationmap/1.0">
> <locator>
> <match pattern="code/**">
> <location src="http://floatingsun.net/code/{1}" />
> </match>
> </locator>
> </locationmap>
>
> Usage in my pages is like:
> <a href="lm:code/DaffyInstaller.jar">Daffy Installer</a>
<a href="{lm:code/DaffyInstaller.jar}">Daffy Installer</a>
(note curly backets)
Ross