You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@forrest.apache.org by Cameron McCormack <ca...@mcc.id.au> on 2006/05/09 06:22:27 UTC
site: URIs with fragment identifiers
Hi.
I'm just starting to use Forrest (0.7), and I'd like to make links using
site: URIs. I find though that if I use a fragment identifier on the
URI, this gets stuffed in to the XPath expression that is used to look
up the actual page to get. For example I get errors like:
Error accessing attribute 'architecture#coreComponents' from input module
'site'. Module does not support
</s...@href>attribute.
How can I use such links?
Thanks,
Cameron
--
Cameron McCormack ICQ: 26955922
cam (at) mcc.id.au MSN: cam (at) mcc.id.au
http://mcc.id.au/ JBR: heycam (at) jabber.org
Re: site: URIs with fragment identifiers
Posted by Thorsten Scherler <th...@wyona.com>.
El mié, 10-05-2006 a las 08:30 +0100, Ross Gardler escribió:
> Gav... wrote:
> > <quote who="David Crossley">
> >
> >>Ross Gardler wrote:
> >>
> >>>Cameron McCormack wrote:
> >>>
> >>>>Hi David.
> >>>>
> >>>>David Crossley:
> >>>>
> >>>>
> >>>>>Not sure if this demo is in the Forrest-0.7 fresh site
> >>>>>'forrest seed', but it is Forrest-0.8-dev and you can see
> >>>>>it here:
> >>>>>http://forrest.zones.apache.org/ft/build/forrest-seed/samples/linking.html#site-fragment
> >>>>
> >>>>Hmm, so you can only link to them by putting them in the site.xml file?
> >>>>One for each ID in my documents? Maybe when the URIs are being
> >>>>rewritten, the fragment ID should be stripped off and appended to the
> >>>>end of the generated URI.
> >>>
> >>>That would be good, but don't hold your breath. Patches welcome (and
> >>>help available on the dev list).
> >>
> >>See a very old related issue:
> >>http://issues.apache.org/jira/browse/FOR-95
> >>
> >>-David
> >>
> >
> >
> > Just wondering about adding an extra match into the locationmap.
> >
> > Something like :-
> >
> > <match pattern="**#*">
> > <location src="{1}.xml#{2}" />
> > </match>
> >
> > I'm not sure of the correct syntax at this stage, just wanted to throw the
> > idea in.
> >
>
> All works fine if we use a normal URL, but if we use the "site:"
> protocol as is requried here the fragement identifier gets lost.
> Therefore, the above would make no difference I'm afraid.
Further I am pretty sure that will result in an error since AFAIR the lm
is not aware of fragement identifier and would look for a file (!!!)
called e.g. gav.xml#testing and obviously would not find such a file. On
the other hand what would the lm would response? Since the "real" answer
is an xpath expression to a certain subset of a document. The location
map is only worrying about *locations* of files not within files.
salu2
--
Thorsten Scherler
COO Spain
Wyona Inc. - Open Source Content Management - Apache Lenya
http://www.wyona.com http://lenya.apache.org
thorsten.scherler@wyona.com thorsten@apache.org
Re: site: URIs with fragment identifiers
Posted by Ross Gardler <rg...@apache.org>.
Gav... wrote:
> <quote who="David Crossley">
>
>>Ross Gardler wrote:
>>
>>>Cameron McCormack wrote:
>>>
>>>>Hi David.
>>>>
>>>>David Crossley:
>>>>
>>>>
>>>>>Not sure if this demo is in the Forrest-0.7 fresh site
>>>>>'forrest seed', but it is Forrest-0.8-dev and you can see
>>>>>it here:
>>>>>http://forrest.zones.apache.org/ft/build/forrest-seed/samples/linking.html#site-fragment
>>>>
>>>>Hmm, so you can only link to them by putting them in the site.xml file?
>>>>One for each ID in my documents? Maybe when the URIs are being
>>>>rewritten, the fragment ID should be stripped off and appended to the
>>>>end of the generated URI.
>>>
>>>That would be good, but don't hold your breath. Patches welcome (and
>>>help available on the dev list).
>>
>>See a very old related issue:
>>http://issues.apache.org/jira/browse/FOR-95
>>
>>-David
>>
>
>
> Just wondering about adding an extra match into the locationmap.
>
> Something like :-
>
> <match pattern="**#*">
> <location src="{1}.xml#{2}" />
> </match>
>
> I'm not sure of the correct syntax at this stage, just wanted to throw the
> idea in.
>
All works fine if we use a normal URL, but if we use the "site:"
protocol as is requried here the fragement identifier gets lost.
Therefore, the above would make no difference I'm afraid.
Ross
Re: site: URIs with fragment identifiers
Posted by "Gav..." <br...@brightontown.com.au>.
<quote who="David Crossley">
> Ross Gardler wrote:
>> Cameron McCormack wrote:
>> >Hi David.
>> >
>> >David Crossley:
>> >
>> >>Not sure if this demo is in the Forrest-0.7 fresh site
>> >>'forrest seed', but it is Forrest-0.8-dev and you can see
>> >>it here:
>> >>http://forrest.zones.apache.org/ft/build/forrest-seed/samples/linking.html#site-fragment
>> >
>> >Hmm, so you can only link to them by putting them in the site.xml file?
>> >One for each ID in my documents? Maybe when the URIs are being
>> >rewritten, the fragment ID should be stripped off and appended to the
>> >end of the generated URI.
>>
>> That would be good, but don't hold your breath. Patches welcome (and
>> help available on the dev list).
>
> See a very old related issue:
> http://issues.apache.org/jira/browse/FOR-95
>
> -David
>
Just wondering about adding an extra match into the locationmap.
Something like :-
<match pattern="**#*">
<location src="{1}.xml#{2}" />
</match>
I'm not sure of the correct syntax at this stage, just wanted to throw the
idea in.
--
Gav...
Re: site: URIs with fragment identifiers
Posted by David Crossley <cr...@apache.org>.
Ross Gardler wrote:
> Cameron McCormack wrote:
> >Hi David.
> >
> >David Crossley:
> >
> >>Not sure if this demo is in the Forrest-0.7 fresh site
> >>'forrest seed', but it is Forrest-0.8-dev and you can see
> >>it here:
> >>http://forrest.zones.apache.org/ft/build/forrest-seed/samples/linking.html#site-fragment
> >
> >Hmm, so you can only link to them by putting them in the site.xml file?
> >One for each ID in my documents? Maybe when the URIs are being
> >rewritten, the fragment ID should be stripped off and appended to the
> >end of the generated URI.
>
> That would be good, but don't hold your breath. Patches welcome (and
> help available on the dev list).
See a very old related issue:
http://issues.apache.org/jira/browse/FOR-95
-David
Re: site: URIs with fragment identifiers
Posted by David Crossley <cr...@apache.org>.
Cameron McCormack wrote:
> David Crossley:
> > Please attach it to a new Issue at Cocoon's issue tracker
> > http://issues.apache.org/jira/browse/COCOON
>
> Ok, though perhaps a different solution would be better...
>
> > Me either. Here are some tips, but i am not even sure
> > if they are up-to-date.
> > http://cocoon.zones.apache.org/daisy/documentation/g1/798.html
>
> That seems to work, thanks.
Fantastic. It will be comforting for the cocoon-dev
people to know that Cocoon-2.2 trunk is usable.
> So after thinking about it, I'm not sure if changing the
> LinkRewriterTransformer is the right solution. Perhaps you want to
> have some schemes that don't include the fragment (e.g., site:) and
> others that do (e.g., an rdf: scheme that identifies RDF literals,
> where fragment identifiers are important). You'd need two linkrewriter
> instances for that.
>
> So I think it's more that the SimpleMappingMetaModule is insufficient to
> describe the mapping of 'A#B' to 'concat(/site//A/@href, "#B")' for the
> key to the XMLFileModule.
>
> What do you think the right solution to this should be? A
> MoreComplexMappingMetaModule that can construct such keys? How general
> should this be? And where should it go, in Cocoon or Forrest?
It is beyond me, and nobody else has answered you.
Anyway, i think that it is a topic for dev@cocoon.
-David
Re: site: URIs with fragment identifiers
Posted by Cameron McCormack <ca...@mcc.id.au>.
David Crossley:
> Please attach it to a new Issue at Cocoon's issue tracker
> http://issues.apache.org/jira/browse/COCOON
Ok, though perhaps a different solution would be better...
> Me either. Here are some tips, but i am not even sure
> if they are up-to-date.
> http://cocoon.zones.apache.org/daisy/documentation/g1/798.html
That seems to work, thanks.
So after thinking about it, I'm not sure if changing the
LinkRewriterTransformer is the right solution. Perhaps you want to
have some schemes that don't include the fragment (e.g., site:) and
others that do (e.g., an rdf: scheme that identifies RDF literals,
where fragment identifiers are important). You'd need two linkrewriter
instances for that.
So I think it's more that the SimpleMappingMetaModule is insufficient to
describe the mapping of 'A#B' to 'concat(/site//A/@href, "#B")' for the
key to the XMLFileModule.
What do you think the right solution to this should be? A
MoreComplexMappingMetaModule that can construct such keys? How general
should this be? And where should it go, in Cocoon or Forrest?
Thanks,
Cameron
--
Cameron McCormack ICQ: 26955922
cam (at) mcc.id.au MSN: cam (at) mcc.id.au
http://mcc.id.au/ JBR: heycam (at) jabber.org
Re: site: URIs with fragment identifiers
Posted by David Crossley <cr...@apache.org>.
Cameron McCormack wrote:
> Hi Ross.
>
> Ross Gardler:
> > That would be good, but don't hold your breath. Patches welcome (and
> > help available on the dev list).
>
> The attached patch to Cocoon should do something like I requested.
Please attach it to a new Issue at Cocoon's issue tracker
http://issues.apache.org/jira/browse/COCOON
> It's
> completely untested, and I didn't even compile it (it wasn't immediately
> obvious to me how to use Cocoon's build system, since I know nothing of
> Maven).
Me either. Here are some tips, but i am not even sure
if they are up-to-date.
http://cocoon.zones.apache.org/daisy/documentation/g1/798.html
> It adds a parameter that can be given to the LinkRewriterTransformer to
> tell it to let a fragment identifier pass through, or not.
>
> I made the default "false", so that fragids are not given to the
> rewriter, since I imagine that would be the more common case.
>
> Also, I'm not sure why there are two copies of the link rewriter stuff
> in Cocoon's repository (one under src/blocks/linkrewriter, and another
> under blocks/cocoon-linkrewriter); they seem to be identical except for
> the $Id$ string.
Due to the gradual reconfiguration of all blocks.
My guess is that the latter is what you need to patch.
-David
Re: site: URIs with fragment identifiers
Posted by Cameron McCormack <ca...@mcc.id.au>.
Hi Ross.
Ross Gardler:
> That would be good, but don't hold your breath. Patches welcome (and
> help available on the dev list).
The attached patch to Cocoon should do something like I requested. It's
completely untested, and I didn't even compile it (it wasn't immediately
obvious to me how to use Cocoon's build system, since I know nothing of
Maven).
It adds a parameter that can be given to the LinkRewriterTransformer to
tell it to let a fragment identifier pass through, or not.
I made the default "false", so that fragids are not given to the
rewriter, since I imagine that would be the more common case.
Also, I'm not sure why there are two copies of the link rewriter stuff
in Cocoon's repository (one under src/blocks/linkrewriter, and another
under blocks/cocoon-linkrewriter); they seem to be identical except for
the $Id$ string.
Thanks,
Cameron
--
Cameron McCormack ICQ: 26955922
cam (at) mcc.id.au MSN: cam (at) mcc.id.au
http://mcc.id.au/ JBR: heycam (at) jabber.org
Re: site: URIs with fragment identifiers
Posted by Ross Gardler <rg...@apache.org>.
Cameron McCormack wrote:
> Hi David.
>
> David Crossley:
>
>>Not sure if this demo is in the Forrest-0.7 fresh site
>>'forrest seed', but it is Forrest-0.8-dev and you can see
>>it here:
>>http://forrest.zones.apache.org/ft/build/forrest-seed/samples/linking.html#site-fragment
>
>
> Hmm, so you can only link to them by putting them in the site.xml file?
> One for each ID in my documents? Maybe when the URIs are being
> rewritten, the fragment ID should be stripped off and appended to the
> end of the generated URI.
That would be good, but don't hold your breath. Patches welcome (and
help available on the dev list).
Ross
Re: site: URIs with fragment identifiers
Posted by Cameron McCormack <ca...@mcc.id.au>.
Hi David.
David Crossley:
> Not sure if this demo is in the Forrest-0.7 fresh site
> 'forrest seed', but it is Forrest-0.8-dev and you can see
> it here:
> http://forrest.zones.apache.org/ft/build/forrest-seed/samples/linking.html#site-fragment
Hmm, so you can only link to them by putting them in the site.xml file?
One for each ID in my documents? Maybe when the URIs are being
rewritten, the fragment ID should be stripped off and appended to the
end of the generated URI.
--
Cameron McCormack ICQ: 26955922
cam (at) mcc.id.au MSN: cam (at) mcc.id.au
http://mcc.id.au/ JBR: heycam (at) jabber.org
Re: site: URIs with fragment identifiers
Posted by David Crossley <cr...@apache.org>.
Cameron McCormack wrote:
>
> I'm just starting to use Forrest (0.7), and I'd like to make links using
> site: URIs. I find though that if I use a fragment identifier on the
> URI, this gets stuffed in to the XPath expression that is used to look
> up the actual page to get. For example I get errors like:
>
> Error accessing attribute 'architecture#coreComponents' from input module
> 'site'. Module does not support
> </s...@href>attribute.
>
> How can I use such links?
Not sure if this demo is in the Forrest-0.7 fresh site
'forrest seed', but it is Forrest-0.8-dev and you can see
it here:
http://forrest.zones.apache.org/ft/build/forrest-seed/samples/linking.html#site-fragment
-David