You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by "Mike M." <le...@mordent.com> on 2005/02/28 18:05:50 UTC
Debugging the pipeline
Hi,
How can I dump out the XML data (whether to the screen or to a file) prior to
calling my doctype's transformer?
I've figured out how to dump it after my transformer but not before (I can see
the XML in my browser by just changing "html" to "xml" in the serializer in the
publication-sitemap.xmap pipeline, but I can't seem to do this before the
transform happens)...
Thanks!
-Mike
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org
Re: Debugging the pipeline
Posted by "Gregor J. Rothfuss" <gr...@apache.org>.
mike, you mentioned some debugging aids you came up with. can you add
them to the wiki?
--
Gregor J. Rothfuss
COO, Wyona Content Management Solutions http://wyona.com
Apache Lenya http://lenya.apache.org
gregor.rothfuss@wyona.com gregor@apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org
Re: Debugging the pipeline
Posted by "Mike M." <le...@mordent.com>.
Torsten Schlabach <tschlabach <at> apache.org> writes:
>
> - Regarding a hook to the pipeline, consider using Cocoon
> SourceWritingTransformer. It is something like a tee for SAX pipelines,
> in case you are on the Linux/Unix side of things. It will write anything
> that passes it into a writeable source which in the easiest case can be
> a file.
>
Hi,
I saw the SourceWritingTransformer in the cocoon docs, but couldn't figure out
how to use it. It looked like you needed to add not only the sourcewrite into
your pipeline, but also add special xml tags in the actual content to make it
work, but I got totally lost trying to determine what and where to put these
extra elements. There weren't any examples I could find.
Thanks!
-Mike
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org
Re: Debugging the pipeline
Posted by Torsten Schlabach <ts...@apache.org>.
You could also have a look here:
http://wiki.apache.org/lenya/PublicationSitemapEntryPoints
If I get you right, you got two problems:
- Finding the place in the pipeline to hook up to in order to find what
you want to find.
- How and where to actually write the content.
The problem with sending it right to your browser is that you probably
need to hook somewhere in between and as you can see from
http://wiki.apache.org/lenya/GetPageWalkthrough Lenya uses a system of
nested pipelines where
pipeline A calls
pipeline B calls
pipeline C
Read: The serialized result of C is processed by B which result is
processed by A and then sent back.
The http://wiki.apache.org/lenya/GetPageWalkthrough provides sort of a
top down view how to get from a URL to the file(s) beeing used as input
for rendering while you probably need more of a buttom up view like: I
have this file here which I have written. What transformations get
applied to it until it reached the browser window.
Whatever you do to the serializer of pipeline C you will not see its
output but its output after if ran trough the transformations of pipline
B and pipleline A (which does not yield the result you expect).
Unfortunately (which leads to maybe deepen my research a bit) you cannot
just call pipeline C directly in your browser, check it it does what it
is expected to, then call pipeline B directly in your browser, etc. It
would be nice if you could, but I think you cannot.
Now back to your very immediate issues (if you haven't solved them yet,
but also for the benefit of the archive readers):
- Regarding a hook to the pipeline, consider using Cocoon
SourceWritingTransformer. It is something like a tee for SAX pipelines,
in case you are on the Linux/Unix side of things. It will write anything
that passes it into a writeable source which in the easiest case can be
a file.
- The lowest hook in the food chain is in doctypes.xmap. Don't overlook
it, it's damn small. doctypes.xmap (in the default publication) has two
matchers blocks. The upper on is only used if you want to view a past
revision of a document, so this can be safely ignored in most cases. (At
least when debugging!)
- In the other one, the line
<map:generate src="content/{2}/{4}.xml"/>
reads you pure file from the filesystem.
Next comes the yourdoctype2xhtml transformation:
<map:transform src="xslt/{3}2xhtml.xsl">
<map:parameter name="rendertype" value="{1}"/>
<map:parameter name="nodeid"
value="{page-envelope:document-node-id}"/>
<map:parameter name="language"
value="{page-envelope:document-language}"/>
</map:transform>
<map:serialize type="xml"/>
If you put a source writing transformer here, you should see your
doctype rendered as a clean and valid XHTML page, but yet without
navigation.
All that actually happens later in publication-sitemap.xmap will be to
wrap the XHTML with the navigational framework and the page is ready for
display.
Hope this helps.
Regards,
Torsten
Andreas Hartmann schrieb:
> Mike M. wrote:
>
>>>> I think a View might help you out. Check out the documentation here:
>>>>
>>>> http://cocoon.apache.org/2.1/userdocs/concepts/views.html
>>>
>>>
>>> ...and here:
>>> http://wiki.apache.org/cocoon/DebuggingWithViews
>>>
>>
>>
>> Thanks for the pointers. The same problem exists though with views as
>> it does
>> with inserting a serializer. The issue is "where"?
>>
>> I thought that putting an xml serializer after the generator in
>> publication-sitemap would do the trick, but when I try it, I just get
>> the same
>> page I got without it. What I'm having a hard time with is
>> determining lenya's
>> pipeline process and where to stick the debugging in. Even with
>> views, you have
>> to know where in the pipeline to call the view.
>
>
> Maybe this helps:
>
> http://wiki.apache.org/lenya/GetPageWalkthrough
>
> -- Andreas
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
> For additional commands, e-mail: user-help@lenya.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org
Re: Debugging the pipeline
Posted by Andreas Hartmann <an...@apache.org>.
Mike M. wrote:
>>>I think a View might help you out. Check out the documentation here:
>>>
>>>http://cocoon.apache.org/2.1/userdocs/concepts/views.html
>>
>>...and here:
>> http://wiki.apache.org/cocoon/DebuggingWithViews
>>
>
>
> Thanks for the pointers. The same problem exists though with views as it does
> with inserting a serializer. The issue is "where"?
>
> I thought that putting an xml serializer after the generator in
> publication-sitemap would do the trick, but when I try it, I just get the same
> page I got without it. What I'm having a hard time with is determining lenya's
> pipeline process and where to stick the debugging in. Even with views, you have
> to know where in the pipeline to call the view.
Maybe this helps:
http://wiki.apache.org/lenya/GetPageWalkthrough
-- Andreas
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org
Re: Debugging the pipeline
Posted by Mark Lundquist <ml...@comcast.net>.
On Feb 28, 2005, at 10:48 AM, Mike M. wrote:
> Thanks for the pointers. The same problem exists though with views as
> it does
> with inserting a serializer. The issue is "where"?
>
> I thought that putting an xml serializer after the generator in
> publication-sitemap would do the trick, but when I try it, I just get
> the same
> page I got without it. What I'm having a hard time with is
> determining lenya's
> pipeline process and where to stick the debugging in. Even with
> views, you have
> to know where in the pipeline to call the view.
>
I know just what you mean. You might try having a look at the
sitemep.log...?
—ml—
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org
Re: Debugging the pipeline
Posted by "Mike M." <le...@mordent.com>.
> >
> > I think a View might help you out. Check out the documentation here:
> >
> > http://cocoon.apache.org/2.1/userdocs/concepts/views.html
>
> ...and here:
> http://wiki.apache.org/cocoon/DebuggingWithViews
>
Thanks for the pointers. The same problem exists though with views as it does
with inserting a serializer. The issue is "where"?
I thought that putting an xml serializer after the generator in
publication-sitemap would do the trick, but when I try it, I just get the same
page I got without it. What I'm having a hard time with is determining lenya's
pipeline process and where to stick the debugging in. Even with views, you have
to know where in the pipeline to call the view.
Thanks,
-Mike
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org
Re: Debugging the pipeline
Posted by Mark Lundquist <ml...@comcast.net>.
On Feb 28, 2005, at 10:01 AM, Jonathan Linczak wrote:
> Hey Mike,
>
> I think a View might help you out. Check out the documentation here:
>
> http://cocoon.apache.org/2.1/userdocs/concepts/views.html
...and here:
http://wiki.apache.org/cocoon/DebuggingWithViews
cheers,
—ml—
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org
Re: Debugging the pipeline
Posted by Jonathan Linczak <li...@hiram.edu>.
On Feb 28, 2005, at 12:45 PM, Mike M. wrote:
>>
>> Inserting <map:serialize type="xml"/> should do the trick.
>>
>
> Hi,
>
> As I thought I mentioned in my original post, I already know how to
> change the
> serializer. However, I just don't know where in the pipeline it needs
> to be
> changed to output the xml "before" the xsl transformation of the page
> (the one
> that does the page2xhtml transform). I can get it to work "after" the
> transformation without any problems but I need to see the xml before
> that.
>
> Thanks,
> -mm
Hey Mike,
I think a View might help you out. Check out the documentation here:
http://cocoon.apache.org/2.1/userdocs/concepts/views.html
Hope this helps!
Jon
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org
Re: Debugging the pipeline
Posted by Comiotto Thomas <th...@unicom.unizh.ch>.
As I told you, _insert_ a serializer before the transformer.
Am 28.02.2005 um 18:45 schrieb Mike M.:
>>
>> Inserting <map:serialize type="xml"/> should do the trick.
>>
>
> Hi,
>
> As I thought I mentioned in my original post, I already know how to
> change the
> serializer. However, I just don't know where in the pipeline it needs
> to be
> changed to output the xml "before" the xsl transformation of the page
> (the one
> that does the page2xhtml transform). I can get it to work "after" the
> transformation without any problems but I need to see the xml before
> that.
>
> Thanks,
> -mm
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
> For additional commands, e-mail: user-help@lenya.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org
Re: Debugging the pipeline
Posted by "Mike M." <le...@mordent.com>.
>
> Inserting <map:serialize type="xml"/> should do the trick.
>
Hi,
As I thought I mentioned in my original post, I already know how to change the
serializer. However, I just don't know where in the pipeline it needs to be
changed to output the xml "before" the xsl transformation of the page (the one
that does the page2xhtml transform). I can get it to work "after" the
transformation without any problems but I need to see the xml before that.
Thanks,
-mm
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org
Re: Debugging the pipeline
Posted by Comiotto Thomas <th...@unicom.unizh.ch>.
Hi Mike
Inserting <map:serialize type="xml"/> should do the trick.
--
Thomas
Am 28.02.2005 um 18:05 schrieb Mike M.:
> Hi,
>
> How can I dump out the XML data (whether to the screen or to a file)
> prior to
> calling my doctype's transformer?
>
> I've figured out how to dump it after my transformer but not before (I
> can see
> the XML in my browser by just changing "html" to "xml" in the
> serializer in the
> publication-sitemap.xmap pipeline, but I can't seem to do this before
> the
> transform happens)...
>
> Thanks!
> -Mike
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
> For additional commands, e-mail: user-help@lenya.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org