You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by Tim Williams <wi...@gmail.com> on 2005/06/04 15:55:44 UTC

locationmap - not finishing the pipeline

The second link in the locationmap wouldn't work because for some
reason it's trying to use the "file src" defined in forrest-core.xconf
and append it to the project-content-dir.  This is strange because it
apparently finds locationmap.xml with no problem for simple link
re-writing (the first sample).  I don't really know where to start but
for now I made the kludge even worse by hardcoding the absolute path
to locationmap.xml.  This gives me something to play with for now
anyway.

Anyway, so I can successfully take the /locationmap/demo.xml and
return a real demo.xml from 127.0.0.1:8080/slide/files/demo.xml (my
slide repo).  Everythings pretty much hard coded for now mind you. 
Now the problems:  1) it strips the contents from demo.xml and is
essentially just a shell xml file.  2) it doesn't apply any skinning
to it -- it just returns the xml.  any pointers on where to start with
these?


--tim

Re: locationmap - not finishing the pipeline

Posted by Ross Gardler <rg...@apache.org>.
Ross Gardler wrote:
> Tim Williams wrote:
> 
>> On 6/4/05, Ross Gardler <rg...@apache.org> wrote:
>>
>>> Tim Williams wrote:
>>>
> 
> ...
> 
>>>> Now the problems:  1) it strips the contents from demo.xml and is
>>>> essentially just a shell xml file.
>>>
>>>
>>> Well that isn't very helpful, I suppose we better fix that ;-)
>>>
>>> I have no idea how this can be happening. Are you able to confirm that
>>> the file is being read from slide correctly?
>>
>>
>>
>> Well, it appears that the hello2document.xsl in the local sitemap.xmap
>> is the culprit.  Probably should have figured something so simple.
> 
> 
> Blast, sorry that should not have been in the sitemap for that matcher. 
> Sorry, this probably took you a while to figure out.
> 
>>>> 2) it doesn't apply any skinning
>>>> to it -- it just returns the xml.
>>>
>>>
>>> Is your request to Forrest for demo.html or demo.xml?
>>
>>
>>
>> I've got maps set up for both since I don't really understand *how*
>> this is really working yet, I'm doing some serious trial and error and
>> covering all bases.  So for each, here's what i get:
>>
>> demo.html - what i've learned (thanks) is now the equivalent of
>> body-demo.html, seems it stops processing there and never applies the
>> skin.  I'm getting no errors and the core log is of no help.
>>
> 
> I wouldn't expect that to work since you have added a matcher that will 
> prevent the existing matchers in Forrest from processing the request for 
> *.html. More below...
> 
>> demo.xml - the unprocessed, straight xml from SVN's freshsite.
> 
> 
> OK this is good. If you remove the matcher you created for *.html then 
> the Forrest matcher for such patterns should be used instead, this one 
> does all the skinning. In other words, it should "just work"

Correction. It doesn't work that way. I won't go into why because it is 
late and I don't want to have to think about it right now. I'll come 
back to this when I can.

However, I have committed a fix for the problem of having to hard code 
the path to the locationmap.


> If you haven't done so already I recommend you read 
> http://forrest.apache.org/docs/sitemap-ref.html this may help you 
> understand how this happens. Of course, it may not since it is a 
> technical doc that assumes a level of knowledge. It would be useful to 
> know how effective you feel this doc is.

It will still be worth reading this for background if you haven't done so.

Ross

Re: locationmap - not finishing the pipeline

Posted by Ross Gardler <rg...@apache.org>.
Tim Williams wrote:
> On 6/4/05, Ross Gardler <rg...@apache.org> wrote:
> 
>>Tim Williams wrote:
>>

...

>>>Now the problems:  1) it strips the contents from demo.xml and is
>>>essentially just a shell xml file.
>>
>>Well that isn't very helpful, I suppose we better fix that ;-)
>>
>>I have no idea how this can be happening. Are you able to confirm that
>>the file is being read from slide correctly?
> 
> 
> Well, it appears that the hello2document.xsl in the local sitemap.xmap
> is the culprit.  Probably should have figured something so simple.

Blast, sorry that should not have been in the sitemap for that matcher. 
Sorry, this probably took you a while to figure out.

>>>2) it doesn't apply any skinning
>>>to it -- it just returns the xml.
>>
>>Is your request to Forrest for demo.html or demo.xml?
> 
> 
> I've got maps set up for both since I don't really understand *how*
> this is really working yet, I'm doing some serious trial and error and
> covering all bases.  
> So for each, here's what i get:
> 
> demo.html - what i've learned (thanks) is now the equivalent of
> body-demo.html, seems it stops processing there and never applies the
> skin.  I'm getting no errors and the core log is of no help.
> 

I wouldn't expect that to work since you have added a matcher that will 
prevent the existing matchers in Forrest from processing the request for 
*.html. More below...

> demo.xml - the unprocessed, straight xml from SVN's freshsite.

OK this is good. If you remove the matcher you created for *.html then 
the Forrest matcher for such patterns should be used instead, this one 
does all the skinning. In other words, it should "just work"

If you haven't done so already I recommend you read 
http://forrest.apache.org/docs/sitemap-ref.html this may help you 
understand how this happens. Of course, it may not since it is a 
technical doc that assumes a level of knowledge. It would be useful to 
know how effective you feel this doc is.

Ross

Re: locationmap - not finishing the pipeline

Posted by Tim Williams <wi...@gmail.com>.
On 6/4/05, Ross Gardler <rg...@apache.org> wrote:
> Tim Williams wrote:
> > The second link in the locationmap wouldn't work because for some
> > reason it's trying to use the "file src" defined in forrest-core.xconf
> > and append it to the project-content-dir.  This is strange because it
> > apparently finds locationmap.xml with no problem for simple link
> > re-writing (the first sample).  I don't really know where to start but
> > for now I made the kludge even worse by hardcoding the absolute path
> > to locationmap.xml.  This gives me something to play with for now
> > anyway.
> 
> Yes, I noticed that problem (which is why there is a warning on that
> section of the page saying it doesn't work yet). I'm glad you found a
> temporary solution. The longer term solution (I think) is to pass the
> path to the locationmap to the input-module from the sitemap rather than
> within xconf. I'll look into this next week.

Good, I got lost trying to use references to sitemap.xmap as an
example last night -- ended up having to revert everything.

> > Anyway, so I can successfully take the /locationmap/demo.xml and
> > return a real demo.xml from 127.0.0.1:8080/slide/files/demo.xml (my
> > slide repo).  Everythings pretty much hard coded for now mind you.
> 
> Fantastic. That was to be my next test (with Daisy rather than Slide,
> but same principle), glad to hear it works, at least to an extent
> 
> > Now the problems:  1) it strips the contents from demo.xml and is
> > essentially just a shell xml file.
> 
> Well that isn't very helpful, I suppose we better fix that ;-)
> 
> I have no idea how this can be happening. Are you able to confirm that
> the file is being read from slide correctly?

Well, it appears that the hello2document.xsl in the local sitemap.xmap
is the culprit.  Probably should have figured something so simple.  I
commented the transform line out and it's at least giving me my
document back.  And yes, now I'm able to confirm that it is coming
from Slide (and after the other change the fresh-site in SVN).  See
below for my next problem...


> > 2) it doesn't apply any skinning
> > to it -- it just returns the xml.
> 
> Is your request to Forrest for demo.html or demo.xml?

I've got maps set up for both since I don't really understand *how*
this is really working yet, I'm doing some serious trial and error and
covering all bases.  So for each, here's what i get:

demo.html - what i've learned (thanks) is now the equivalent of
body-demo.html, seems it stops processing there and never applies the
skin.  I'm getting no errors and the core log is of no help.

demo.xml - the unprocessed, straight xml from SVN's freshsite.

> Could you modify your code to retrieve that page rather than a slide one
> and put a patch against http://issues.apache.org/jira/browse/FOR-200

I'm not sure what you mean, I've taken what you had and (minus that
one config thing) it just worked.  Obviously, I've manipulated the
location a bit but nothing else really.  I haven't really *done*
anything yet:)

--tim

Re: locationmap - not finishing the pipeline

Posted by Ross Gardler <rg...@apache.org>.
Tim Williams wrote:
> The second link in the locationmap wouldn't work because for some
> reason it's trying to use the "file src" defined in forrest-core.xconf
> and append it to the project-content-dir.  This is strange because it
> apparently finds locationmap.xml with no problem for simple link
> re-writing (the first sample).  I don't really know where to start but
> for now I made the kludge even worse by hardcoding the absolute path
> to locationmap.xml.  This gives me something to play with for now
> anyway.

Yes, I noticed that problem (which is why there is a warning on that 
section of the page saying it doesn't work yet). I'm glad you found a 
temporary solution. The longer term solution (I think) is to pass the 
path to the locationmap to the input-module from the sitemap rather than 
within xconf. I'll look into this next week.

> Anyway, so I can successfully take the /locationmap/demo.xml and
> return a real demo.xml from 127.0.0.1:8080/slide/files/demo.xml (my
> slide repo).  Everythings pretty much hard coded for now mind you. 

Fantastic. That was to be my next test (with Daisy rather than Slide, 
but same principle), glad to hear it works, at least to an extent

> Now the problems:  1) it strips the contents from demo.xml and is
> essentially just a shell xml file.  

Well that isn't very helpful, I suppose we better fix that ;-)

I have no idea how this can be happening. Are you able to confirm that 
the file is being read from slide correctly?

> 2) it doesn't apply any skinning
> to it -- it just returns the xml.  

Is your request to Forrest for demo.html or demo.xml?

>any pointers on where to start with these?

Lets start with a simple case. Lets ignore slide for now and retrieve 
something via http. A good candidate would be something from our own 
SVN, for example

http://svn.apache.org/viewcvs.cgi/*checkout*/forrest/trunk/main/fresh-site/src/documentation/content/xdocs/index.xml

(the home page of fresh-site)

Could you modify your code to retrieve that page rather than a slide one 
and put a patch against http://issues.apache.org/jira/browse/FOR-200

We can then work against the same code that way. Don't worry that we are 
using hacks like hard-coded paths. As long as you put a nice clear FIXME 
note against the changes we can tidy up later. The branch we are working 
in will not be merged with trunk until we iron all these things out. For 
now we should free to experiment.

Ross