You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by Florent André <fl...@4sengines.eu> on 2008/10/02 01:20:27 UTC
Re: [Forum module] work with collection and Cinclude
Thank you for this answer Thorsten
I will be more precise in the future.
You ask me to give the xml file before .xsl.
"
> Put a <map:serialize type="xml"/> here to see what goes in
> collection2html.xsl.
"
But I have a "problem" with <map:serialize> : If I put a <map:serialize>
before collection2html.xsl, the serialized xml will be transform with other
<map:match> (the stream is redirected by other map:generator).
So, in order to display the stream before transformation by
collection2html.xsl, I see this options :
1 - reorder the sitemap in order to have the collection2html in the last
position -- I think it's a very bad solution
2 - use <map:view> -- I try that in the module's subsitemap : the result in
web-browser is : no content
3 - use a serializer that write a file on the file system -- What is the
serializer defining in Lenya ? I search him in editor's sitemap, but I
don't find it from now...
And, for the :
>
> Yeah, see above basic violation of the whole concept of the pipeline.
I guarantee you that I don't redo that !
have a good day
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org
Re: [Debugging] see the stream anywhere in a sitemap
Posted by Florent André <fl...@4sengines.com>.
Thanks for your feedback
On Sun, 7 Dec 2008 17:13:16 -0500, solprovider@apache.org wrote:
> Notes about the Wiki article http://wiki.apache.org/lenya/DebuggingTips
>
> Section 1: I use the personal "I" when posting to the MLs.
> Documentation should not.
.. normally, it's ok
> Section 2:
...
> The line explaining the date format translated the "hh:" into a link.
I don't know how do that with this wiki syntax...
> The first code box lost the end of the first line: name="filedatetime">
" > " Was lost on an island during the copy-paste :)
Have a good day
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org
Re: [Debugging] see the stream anywhere in a sitemap
Posted by so...@apache.org.
Notes about the Wiki article http://wiki.apache.org/lenya/DebuggingTips
Section 1: I use the personal "I" when posting to the MLs.
Documentation should not. Use the implicit "you" when possible, and
the explicit "you" when necessary:
- When first creating an XMAP, serialize after each generator..
(implicit "you".)
- You may discover namespaces ... (explicit "you".)
Section 2:
As in Section 1, be impersonal -- use "you", not "we".
- Use the datetime ... (implicit "you".)
The line explaining the date format translated the "hh:" into a link.
The first code box lost the end of the first line: name="filedatetime">
Someone familiar with Wiki syntax (specifically escaping controls)
should fix this.
solprovider
On 12/7/08, Florent André <fl...@4sengines.com> wrote:
> Hi all,
> A mail revival
>
> On Mon, 3 Nov 2008 08:02:19 -0500, solprovider@apache.org wrote:
> > On 11/2/08, Florent André <fl...@4sengines.com> wrote:
> >> Hello Solprovider,
> >> First : I would like to create a wiki page on this debugging discussion
> > so
> >> : Can you allow me to copy paste your answer in the
> >> http://wiki.apache.org/lenya/DebuggingTips page for introduce the
> > article ?
> >
> > I am not certain that posts to mailing list become public domain, but...
> > 1. Before I became a Committer, I posted that any of the Lenya-related
> > documentation from solprovider.com could be copied to the official
> > website. (A few articles were copied -- sometimes causing problems as
> > patches were added on my website and not the official one.)
> > 2. As a Lenya Committer, all my personal contributions are for the
> > project's good.
> You give your heart and your soul to Lenya ! :)
>
> >
> > This material is similar to information already on my website.
> If you give me some pointers I can put them in the wiki
>
> > Any
> > new text will eventually be posted there. You have my blessing to add
> > my text to the wiki.
> >
>
> I just do that.
> Explanation and expression are correct ? (I am still not "english ready" :) )
>
> @Andreas : your explanation about the "Log SAX events as XML" is still OK ?
> (I don't try that for now)
>
> Have a good (not Sun)Day
Re: [Debugging] see the stream anywhere in a sitemap
Posted by Florent André <fl...@4sengines.com>.
Hi all,
A mail revival
On Mon, 3 Nov 2008 08:02:19 -0500, solprovider@apache.org wrote:
> On 11/2/08, Florent André <fl...@4sengines.com> wrote:
>> Hello Solprovider,
>> First : I would like to create a wiki page on this debugging discussion
> so
>> : Can you allow me to copy paste your answer in the
>> http://wiki.apache.org/lenya/DebuggingTips page for introduce the
> article ?
>
> I am not certain that posts to mailing list become public domain, but...
> 1. Before I became a Committer, I posted that any of the Lenya-related
> documentation from solprovider.com could be copied to the official
> website. (A few articles were copied -- sometimes causing problems as
> patches were added on my website and not the official one.)
> 2. As a Lenya Committer, all my personal contributions are for the
> project's good.
You give your heart and your soul to Lenya ! :)
>
> This material is similar to information already on my website.
If you give me some pointers I can put them in the wiki
> Any
> new text will eventually be posted there. You have my blessing to add
> my text to the wiki.
>
I just do that.
Explanation and expression are correct ? (I am still not "english ready" :)
)
@Andreas : your explanation about the "Log SAX events as XML" is still OK ?
(I don't try that for now)
Have a good (not Sun)Day
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org
Re: [Debugging] see the stream anywhere in a sitemap
Posted by so...@apache.org.
On 11/2/08, Florent André <fl...@4sengines.com> wrote:
> Hello Solprovider,
> First : I would like to create a wiki page on this debugging discussion so
> : Can you allow me to copy paste your answer in the
> http://wiki.apache.org/lenya/DebuggingTips page for introduce the article ?
I am not certain that posts to mailing list become public domain, but...
1. Before I became a Committer, I posted that any of the Lenya-related
documentation from solprovider.com could be copied to the official
website. (A few articles were copied -- sometimes causing problems as
patches were added on my website and not the official one.)
2. As a Lenya Committer, all my personal contributions are for the
project's good.
This material is similar to information already on my website. Any
new text will eventually be posted there. You have my blessing to add
my text to the wiki.
> On Sun, 12 Oct 2008 13:27:19 -0400, solprovider@apache.org wrote:
> > With Lenya/Cocoon XMAP, debugging a complex process with multiple
> > pipelines in multiple XMAPs can be a challenge.
> >
> > When first creating an XMAP, I serialize after each generator,
> > aggregator, and transformer and save the XML from the browser to a
> > file.
>
> Second : My problem is that I don't see how to see the result XML in the
> browser (due to the construction of the site). Do you use a tips like that :
>
> On top of the publication-sitemap.xmap:
> <map:match pattern="**">
> <map:generate src="../../content/util/empty.xml"/>
> <map:mount uri-prefix="" src="{fallback:TheMapToTest.xmap}"
> check-reload="true" reload-method="synchron"/>
> <map:serialize type="html"/>
> </map:match>
Most of my work is on Lenya 1.3 with a different Module system.
publication-sitemap.xmap is no longer used. I rarely test within the
main Modules, preferring a "test" Module for testing snippets of XMAP
code -- sometimes using the empty Generator, sometimes using other
Generators and Aggregators.
> ==> I don't test that for now, I have this idea after read this mail :
> http://markmail.org/message/ljpvtd73fh6npmj2
>
> third :thank you for this good explanation
You are welcome.
> > Knowing the results of each process greatly helps with writing
> > the next stage. I often discover namespaces in element names that
> > need to be either dropped in the current process or handled by the
> > next process. The saved output provides reference for later
> > development.
> >
> > After an XMAP is completed, debugging is more difficult. The final
> > results are often combined from several XMAPs. Logging intermediate
> > results to a file is a very good solution.
> >
> > One difficult-to-notice mistake between processes can waste much time.
> > I often create a "test" XMAP to isolate portions of the problematic
> > XMAP -- copying pieces XMAPs, tweaking URLs, and controlling the input
> > by generating from XML files rather than depending on the full
> > process. Some tests work perfectly indicating the problem was earlier
> > in the pipeline -- difficult to determine without isolating each
> > process.
solprovider
Re: [Debugging] see the stream anywhere in a sitemap
Posted by Florent André <fl...@4sengines.com>.
Hello Solprovider,
First : I would like to create a wiki page on this debugging discussion so
: Can you allow me to copy paste your answer in the
http://wiki.apache.org/lenya/DebuggingTips page for introduce the article ?
On Sun, 12 Oct 2008 13:27:19 -0400, solprovider@apache.org wrote:
> With Lenya/Cocoon XMAP, debugging a complex process with multiple
> pipelines in multiple XMAPs can be a challenge.
>
> When first creating an XMAP, I serialize after each generator,
> aggregator, and transformer and save the XML from the browser to a
> file.
Second : My problem is that I don't see how to see the result XML in the
bowser (due to the construction of the site). Do you use a tips like that :
On top of the publication-sitemap.xml:
<map:match pattern="**">
<map:generate src="../../content/util/empty.xml"/>
<map:mount uri-prefix="" src="{fallback:TheMapToTest.xmap}"
check-reload="true" reload-method="synchron"/>
<map:serialize type="html"/>
</map:match>
==> I don't test that for now, I have this idea after read this mail :
http://markmail.org/message/ljpvtd73fh6npmj2
third :thank you for this good explanation
> Knowing the results of each process greatly helps with writing
> the next stage. I often discover namespaces in element names that
> need to be either dropped in the current process or handled by the
> next process. The saved output provides reference for later
> development.
>
> After an XMAP is completed, debugging is more difficult. The final
> results are often combined from several XMAPs. Logging intermediate
> results to a file is a very good solution.
>
> One difficult-to-notice mistake between processes can waste much time.
> I often create a "test" XMAP to isolate portions of the problematic
> XMAP -- copying pieces XMAPs, tweaking URLs, and controlling the input
> by generating from XML files rather than depending on the full
> process. Some tests work perfectly indicating the problem was earlier
> in the pipeline -- difficult to determine without isolating each
> process.
>
> HTH,
> solprovider
>
> On 10/12/08, Florent André <fl...@4sengines.eu> wrote:
>> On Thu, 09 Oct 2008 00:58:44 +0200, Thorsten Scherler
> <th...@apache.org>
>> wrote:
>> >1 - the stream is "cut" when the map:serialize is throw
>> > Yes that is the whole idea of debugging.
>> >
>> > Imaging a video of someone climbing a mountain and someone else
>> > recording it with a cam. If the climber falls and later analyze why,
> the
>> > most repeated part of this video probably is the one just before the
>> > fall. This is because the climber wants to learn why (s)he fall to
> not
>> > and fix this mistake in the future.
>>
>> Yes, I'm agree with you, very good metaphor.
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org
Re: [Debugging] see the stream anywhere in a sitemap
Posted by so...@apache.org.
With Lenya/Cocoon XMAP, debugging a complex process with multiple
pipelines in multiple XMAPs can be a challenge.
When first creating an XMAP, I serialize after each generator,
aggregator, and transformer and save the XML from the browser to a
file. Knowing the results of each process greatly helps with writing
the next stage. I often discover namespaces in element names that
need to be either dropped in the current process or handled by the
next process. The saved output provides reference for later
development.
After an XMAP is completed, debugging is more difficult. The final
results are often combined from several XMAPs. Logging intermediate
results to a file is a very good solution.
One difficult-to-notice mistake between processes can waste much time.
I often create a "test" XMAP to isolate portions of the problematic
XMAP -- copying pieces XMAPs, tweaking URLs, and controlling the input
by generating from XML files rather than depending on the full
process. Some tests work perfectly indicating the problem was earlier
in the pipeline -- difficult to determine without isolating each
process.
HTH,
solprovider
On 10/12/08, Florent André <fl...@4sengines.eu> wrote:
> On Thu, 09 Oct 2008 00:58:44 +0200, Thorsten Scherler <th...@apache.org>
> wrote:
> >1 - the stream is "cut" when the map:serialize is throw
> > Yes that is the whole idea of debugging.
> >
> > Imaging a video of someone climbing a mountain and someone else
> > recording it with a cam. If the climber falls and later analyze why, the
> > most repeated part of this video probably is the one just before the
> > fall. This is because the climber wants to learn why (s)he fall to not
> > and fix this mistake in the future.
>
> Yes, I'm agree with you, very good metaphor.
Re: [Debugging] see the stream anywhere in a sitemap
Posted by Florent André <fl...@4sengines.eu>.
On Thu, 09 Oct 2008 00:58:44 +0200, Thorsten Scherler <th...@apache.org>
wrote:
> On Wed, 2008-10-08 at 01:50 +0200, Florent André wrote:
>> This mail is an answer to this mail : Re: [Forum module] work with
>> collection and Cinclude
>
> Next time just change the subject like:
> [Debugging] see the stream anywhere in a sitemap (was [Forum module]
> work with collection and Cinclude)
OK.
> ...
>1 - the stream is "cut" when the map:serialize is throw
>
> Yes that is the whole idea of debugging.
>
> Imaging a video of someone climbing a mountain and someone else
> recording it with a cam. If the climber falls and later analyze why, the
> most repeated part of this video probably is the one just before the
> fall. This is because the climber wants to learn why (s)he fall to not
> and fix this mistake in the future.
Yes, I'm agree with you, very good metaphor.
>
> The quickest way to get a point in time of pipeline processing is
> terminating the match with a serialize. I do not care about what happens
> next since I need to determine the problem why the next is not working
> like I want.
When you have a grave bug (that throw an error page), I agree with this.
But when you have a little bug (the result is not exactly what you want), I
thing that is important to see the input and the output for study the
problem.
>
>> 2 - when the sitemap has many "redirection" (=<map:generate
>> src="cocoon:/feedContent/news/{1}/{2}/{3}/{4}/{5}"/>) it's difficult to
>> write a well formed request in the browser
>
> Make it static then. You are debugging. Do not debug the most abstract
> match. Create your own match="test" one and request what you need. I am
> talking all the time of debugging - I asked for the incoming xml of the
> problematic xsl.
For now, I don't see how I can request exactly the incoming xml that I
want. For example, If I had a "page2" in my publication that fire my bug, I
don't know how I can make a static match that request the page2 and process
it.
Maybe, you want to say that I have to debug my xmap out off Lenya ? (just
with Cocoon)
>
>> 3 - when I do that in a module's sitemap (eg news module), I have the
> error
>> page that display on the site
>
> What is the error? What is the url you request?
Ok, excuse me, I will be more precise in the future... but for this I
"lost" my modifications...
>
>
>> So, after some research in the lenya code, I found this solution :
>> Before the transformation put this code :
>>
>> <map:transform
>> src="fallback://lenya/xslt/authoring/edit/addSourceTags.xsl">
>> <map:parameter name="source"
>> value="context://lenya/pubs/debugDOC.xsl"/>
>> </map:transform>
>> <map:transform type="write-source">
>> <map:parameter name="serializer" value="xml"/>
>> </map:transform>
>> <map:transform
>> src="fallback://lenya/xslt/authoring/edit/removeSourceTags.xsl"/>
>>
>> and :
>> - the stream is writing in the pubs/debugDOC.xsl
>> - the sitemap processing is not disturbed
>>
>> What do you think about this solution ?
>
> It does what I asked just with the write-source transformer. That is
> fine please post that to the other thread.
>
I search on markmail, but I don't find the thread that you talk about...
Regards
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org
Re: [Debugging] see the stream anywhere in a sitemap
Posted by Thorsten Scherler <th...@apache.org>.
On Wed, 2008-10-08 at 01:50 +0200, Florent André wrote:
> This mail is an answer to this mail : Re: [Forum module] work with
> collection and Cinclude
Next time just change the subject like:
[Debugging] see the stream anywhere in a sitemap (was [Forum module]
work with collection and Cinclude)
> I modify the title in order to <map:match pattern="better"> to the
> discussion :
>
> In order to seralize the stream before a transformation you suggest me to :
>
> > You have
> > <map:match pattern="*.xml/*/*/*/*">
> >
> > So just request in your browser. The outcome should be xml and you can
> > see what goes into the transformation.
>
> but, in my opinion this tip has two "problems"
> 1 - the stream is "cut" when the map:serialize is throw
Yes that is the whole idea of debugging.
Imaging a video of someone climbing a mountain and someone else
recording it with a cam. If the climber falls and later analyze why, the
most repeated part of this video probably is the one just before the
fall. This is because the climber wants to learn why (s)he fall to not
and fix this mistake in the future.
The quickest way to get a point in time of pipeline processing is
terminating the match with a serialize. I do not care about what happens
next since I need to determine the problem why the next is not working
like I want.
> 2 - when the sitemap has many "redirection" (=<map:generate
> src="cocoon:/feedContent/news/{1}/{2}/{3}/{4}/{5}"/>) it's difficult to
> write a well formed request in the browser
Make it static then. You are debugging. Do not debug the most abstract
match. Create your own match="test" one and request what you need. I am
talking all the time of debugging - I asked for the incoming xml of the
problematic xsl.
> 3 - when I do that in a module's sitemap (eg news module), I have the error
> page that display on the site
What is the error? What is the url you request?
> So, after some research in the lenya code, I found this solution :
> Before the transformation put this code :
>
> <map:transform
> src="fallback://lenya/xslt/authoring/edit/addSourceTags.xsl">
> <map:parameter name="source"
> value="context://lenya/pubs/debugDOC.xsl"/>
> </map:transform>
> <map:transform type="write-source">
> <map:parameter name="serializer" value="xml"/>
> </map:transform>
> <map:transform
> src="fallback://lenya/xslt/authoring/edit/removeSourceTags.xsl"/>
>
> and :
> - the stream is writing in the pubs/debugDOC.xsl
> - the sitemap processing is not disturbed
>
> What do you think about this solution ?
It does what I asked just with the write-source transformer. That is
fine please post that to the other thread.
>
> However, the debugDOC.xsl is a "one line" xml... that is not very friendly.
> I try to add a <xsl:output indent="yes"/> in the addSourceTags.xsl, but
> it's don't work... If you have any ideas : they are welcome !!
> ( I use the linux program xmlindent for create an indented debugDOC, but
> this is not very simple)
Again you are debugging. I am using eclipse and xml buddy. In case I
have an one line xml I copy it to a tmp doc in eclipse and format it
there.
salu2
>
> Have a good day
>
> On Sat, 04 Oct 2008 22:58:49 +0200, Thorsten Scherler <th...@apache.org>
> wrote:
> > On Thu, 2008-10-02 at 01:20 +0200, Florent André wrote:
> >> Thank you for this answer Thorsten
> >>
> >> I will be more precise in the future.
> >>
> >> You ask me to give the xml file before .xsl.
> >>
> >> "
> >> > Put a <map:serialize type="xml"/> here to see what goes in
> >> > collection2html.xsl.
> >> "
> >> But I have a "problem" with <map:serialize> : If I put a <map:serialize>
> >> before collection2html.xsl, the serialized xml will be transform with
> > other
> >> <map:match> (the stream is redirected by other map:generator).
> >
> > I am talking about debugging. Meaning my suggestion is that you debug
> > just the one match not the whole pipeline. General rule of thumb for
> > debugging is keep it small to pin down the problem.
> >
> > You have
> > <map:match pattern="*.xml/*/*/*/*">
> >
> > So just request in your browser. The outcome should be xml and you can
> > see what goes into the transformation.
> >
> >
> >> So, in order to display the stream before transformation by
> >> collection2html.xsl, I see this options :
> >> 1 - reorder the sitemap in order to have the collection2html in the last
> >> position -- I think it's a very bad solution
> >> 2 - use <map:view> -- I try that in the module's subsitemap : the result
> > in
> >> web-browser is : no content
> >> 3 - use a serializer that write a file on the file system -- What is the
> >> serializer defining in Lenya ? I search him in editor's sitemap, but I
> >> don't find it from now...
> >>
> >
> > All of the above sounds way too much fuzz. Just add the serializer,
> > request the match pattern and see what is the result.
> >
> > salu2
> >
> >>
> >> And, for the :
> >> >
> >> > Yeah, see above basic violation of the whole concept of the pipeline.
> >> I guarantee you that I don't redo that !
> >>
> >> have a good day
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
> >> For additional commands, e-mail: dev-help@lenya.apache.org
> >>
> > --
> > Thorsten Scherler thorsten.at.apache.org
> > Open Source Java consulting, training and solutions
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
> > For additional commands, e-mail: dev-help@lenya.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
> For additional commands, e-mail: dev-help@lenya.apache.org
>
--
Thorsten Scherler thorsten.at.apache.org
Open Source Java consulting, training and solutions
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org
Re: [Debugging] see the stream anywhere in a sitemap
Posted by Florent André <fl...@4sengines.com>.
On Sun, 12 Oct 2008 12:24:00 -0400, solprovider@apache.org wrote:
> On 10/12/08, Florent André <fl...@4sengines.eu> wrote:
>> On Wed, 8 Oct 2008 02:05:40 -0400, solprovider@apache.org wrote:
>> > P.S. This question belongs on the User ML. Questions about using or
>> > developing applications with Lenya belong on the User ML. The Dev ML
>> > is for suggestions and work concerning changes to the Lenya platform.
>> > "dev" is traditional for the programmers ML -- confusing for
> platforms
>> > because people use platforms to develop applications. The
> programmers
>> > ML should use a different name e.g. platform or base.
>>
>> I think that is more efficient to end this thread in this ML, but ok, I
>> will post on the user list in the future, excuse me.
>
> I apologize if this postscript disturbed you.
There is no problem, I well understand that.
> As you saw on the
> thread about MLs (prompted by this postscript), this issue is very
> common. I prefer a permanent solution rather than educating every
> newbie. The current pattern annoys both the devs (off-topic
> interruptions on the platform ML) and the newbies (thinking they made
> a mistake when the system encourages it.) Fixing the problem requires
> overcoming considerable resistance to change.
I really think that a clear caution on the lenya.apache.org ML page
(section subscribe/unsubscribe) could reduce errors and explain the
difference between dev and user ML.
See you soon
>
> solprovider
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org
Re: [Debugging] see the stream anywhere in a sitemap
Posted by so...@apache.org.
On 10/12/08, Florent André <fl...@4sengines.eu> wrote:
> On Wed, 8 Oct 2008 02:05:40 -0400, solprovider@apache.org wrote:
> > P.S. This question belongs on the User ML. Questions about using or
> > developing applications with Lenya belong on the User ML. The Dev ML
> > is for suggestions and work concerning changes to the Lenya platform.
> > "dev" is traditional for the programmers ML -- confusing for platforms
> > because people use platforms to develop applications. The programmers
> > ML should use a different name e.g. platform or base.
>
> I think that is more efficient to end this thread in this ML, but ok, I
> will post on the user list in the future, excuse me.
I apologize if this postscript disturbed you. As you saw on the
thread about MLs (prompted by this postscript), this issue is very
common. I prefer a permanent solution rather than educating every
newbie. The current pattern annoys both the devs (off-topic
interruptions on the platform ML) and the newbies (thinking they made
a mistake when the system encourages it.) Fixing the problem requires
overcoming considerable resistance to change.
solprovider
Re: [Debugging] see the stream anywhere in a sitemap
Posted by Florent André <fl...@4sengines.com>.
Thank you, It's work like a charm !
And now, debug lines are clean and human readable.
Have a good day
On Sun, 12 Oct 2008 12:04:13 -0400, solprovider@apache.org wrote:
> A "resource" is a subroutine to prevent repeating code. Add the
> resource to the "resources" section. The "map:resources" element is a
> child of "map:sitemap". The typical order is zero or one each of
> "map:components", "map:views", "map:resources", then one or more
> "map:pipelines".
>
> <map:resources>
> <map:resource name="log-to-file">
> <map:transform
> src="fallback://lenya/xslt/authoring/edit/addSourceTags.xsl">
> <map:parameter name="source"
>
value="context://lenya/pubs/debug/{fileprefix}-{filedatetime:currentDate}.xml"/>
> </map:transform>
> <map:transform type="write-source">
> <map:parameter name="serializer" value="xml"/>
> </map:transform>
> <map:transform
> src="fallback://lenya/xslt/authoring/edit/removeSourceTags.xsl"/>
> </map:resource>
> </map:resources>
>
> In the pipeline, you use:
> <!-- DEV DEBUG 1 BEGIN -->
> <map:call resource="log-to-file"><map:parameter name="fileprefix"
> value="AfterTransform1"/></map:call>
> <!-- DEV DEBUG 1 END -->
>
> XML does not care if the elements are on one line or multiple lines.
> I condensed the "function call" to one line, but you can indent the
> three elements on as many lines as you want.
>
> solprovider
>
> On 10/12/08, Florent André <fl...@4sengines.eu> wrote:
>> In the XMAP that I want to debug, I have to write (copy-past in
> reality)
>> this at each debug point :
>> <!-- /////debugging 2////// -->
>>
>> <map:transform
>> src="fallback://lenya/xslt/authoring/edit/addSourceTags.xsl">
>> <map:parameter name="source"
>>
>>
>
value="context://lenya/pubs/debug/AfterIncludeSubNews-{filedatetime:currentDate}.xml"/>
>>
>> </map:transform>
>> <map:transform type="write-source">
>> <map:parameter name="serializer" value="xml"/>
>> </map:transform>
>> <map:transform
>> src="fallback://lenya/xslt/authoring/edit/removeSourceTags.xsl"/>
>>
>> <!-- debugging -->
>>
>> This 9 lines are not very "sexy", and if many debug point are define,
> the
>> reading of the xmap is less easy...
>>
>> So,
>> It's possible to define a "super transformer" that groups this 3
>> transformers ? (All tranformers that I see are define with a java
> class,
>> but not with sub-tranformation...)
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org
Re: [Debugging] see the stream anywhere in a sitemap
Posted by so...@apache.org.
A "resource" is a subroutine to prevent repeating code. Add the
resource to the "resources" section. The "map:resources" element is a
child of "map:sitemap". The typical order is zero or one each of
"map:components", "map:views", "map:resources", then one or more
"map:pipelines".
<map:resources>
<map:resource name="log-to-file">
<map:transform
src="fallback://lenya/xslt/authoring/edit/addSourceTags.xsl">
<map:parameter name="source"
value="context://lenya/pubs/debug/{fileprefix}-{filedatetime:currentDate}.xml"/>
</map:transform>
<map:transform type="write-source">
<map:parameter name="serializer" value="xml"/>
</map:transform>
<map:transform
src="fallback://lenya/xslt/authoring/edit/removeSourceTags.xsl"/>
</map:resource>
</map:resources>
In the pipeline, you use:
<!-- DEV DEBUG 1 BEGIN -->
<map:call resource="log-to-file"><map:parameter name="fileprefix"
value="AfterTransform1"/></map:call>
<!-- DEV DEBUG 1 END -->
XML does not care if the elements are on one line or multiple lines.
I condensed the "function call" to one line, but you can indent the
three elements on as many lines as you want.
solprovider
On 10/12/08, Florent André <fl...@4sengines.eu> wrote:
> In the XMAP that I want to debug, I have to write (copy-past in reality)
> this at each debug point :
> <!-- /////debugging 2////// -->
>
> <map:transform
> src="fallback://lenya/xslt/authoring/edit/addSourceTags.xsl">
> <map:parameter name="source"
>
> value="context://lenya/pubs/debug/AfterIncludeSubNews-{filedatetime:currentDate}.xml"/>
>
> </map:transform>
> <map:transform type="write-source">
> <map:parameter name="serializer" value="xml"/>
> </map:transform>
> <map:transform
> src="fallback://lenya/xslt/authoring/edit/removeSourceTags.xsl"/>
>
> <!-- debugging -->
>
> This 9 lines are not very "sexy", and if many debug point are define, the
> reading of the xmap is less easy...
>
> So,
> It's possible to define a "super transformer" that groups this 3
> transformers ? (All tranformers that I see are define with a java class,
> but not with sub-tranformation...)
Re: [Debugging] see the stream anywhere in a sitemap
Posted by Florent André <fl...@4sengines.eu>.
Thank you for this excellent suggestion
On Wed, 8 Oct 2008 02:05:40 -0400, solprovider@apache.org wrote:
...
> Inside the <input-modules> element, add:
> <component-instance
> class="org.apache.cocoon.components.modules.input.DateInputModule"
> logger="core.modules.input" name="filedatetime">
> <format>yyyymmddHHmmss</format>
> </component-instance>
For the format, I write : <format>yyyy-MM-d-HH-mm-ss</format> in order to
have a well formed date (mm--> MM ; dd --> d)
This suggestion help me a lot, another thanks.
I have 2 another questions :
1 ----------------------------------
In the XMAP that I want to debug, I have to write (copy-past in reality)
this at each debug point :
<!-- /////debugging 2////// -->
<map:transform
src="fallback://lenya/xslt/authoring/edit/addSourceTags.xsl">
<map:parameter name="source"
value="context://lenya/pubs/debug/AfterIncludeSubNews-{filedatetime:currentDate}.xml"/>
</map:transform>
<map:transform type="write-source">
<map:parameter name="serializer" value="xml"/>
</map:transform>
<map:transform
src="fallback://lenya/xslt/authoring/edit/removeSourceTags.xsl"/>
<!-- debugging -->
This 9 lines are not very "sexy", and if many debug point are define, the
reading of the xmap is less easy...
So,
It's possible to define a "super transformer" that groups this 3
transformers ? (All tranformers that I see are define with a java class,
but not with sub-tranformation...)
2 ----------------------------------
I find this document : lenya/modules/profiling/xslt/profile2xhtml.xsl
He said put <map:pipeline type="profile-noncaching"> and :
"
Once you've done this, and you have sent a couple of requests to
the pipeline in question, this page will display useful information
about processing and setup time of the individual pipeline
components.
What's even more interesting, you will be able to view the XML
output of all intermediate stages! "
==> I do that, but I see nothing in my page...
> P.S. This question belongs on the User ML. Questions about using or
> developing applications with Lenya belong on the User ML. The Dev ML
> is for suggestions and work concerning changes to the Lenya platform.
> "dev" is traditional for the programmers ML -- confusing for platforms
> because people use platforms to develop applications. The programmers
> ML should use a different name e.g. platform or base.
>
I think that is more efficient to end this thread in this ML, but ok, I
will post on the user list in the future, excuse me.
Regards
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org
Re: [Debugging] see the stream anywhere in a sitemap
Posted by so...@apache.org.
On 10/7/08, Florent André <fl...@4sengines.eu> wrote:
> Before the transformation put this code :
> <map:transform
> src="fallback://lenya/xslt/authoring/edit/addSourceTags.xsl">
> <map:parameter name="source"
> value="context://lenya/pubs/debugDOC.xsl"/>
> </map:transform>
> <map:transform type="write-source">
> <map:parameter name="serializer" value="xml"/>
> </map:transform>
> <map:transform
> src="fallback://lenya/xslt/authoring/edit/removeSourceTags.xsl"/>
>
> and :
> - the stream is writing in the pubs/debugDOC.xsl
> - the sitemap processing is not disturbed
>
> What do you think about this solution ?
1. The file extension should be XML, not XSL
2. Use the datetime to create a new file for each run to prevent
overwrites with multiple threads and provide a history. A
disadvantage is many files are created and must be deleted manually.
Lenya's default date format is "yyyy-M-dd HH:mm:ss Z". Most operating
systems do not allow colons in filenames. Configure a new date format
to avoid colons in the string.
FILE: build\lenya\webapp\WEB-INF\cocoon.xconf
Inside the <input-modules> element, add:
<component-instance
class="org.apache.cocoon.components.modules.input.DateInputModule"
logger="core.modules.input" name="filedatetime">
<format>yyyymmddHHmmss</format>
</component-instance>
In your XMAP, change:
<map:parameter name="source" value="context://lenya/pubs/debugDOC.xsl"/>
TO:
<map:parameter name="source"
value="context://lenya/pubs/{filedatetime:currentDate}.xml"/>
HTH,
solprovider
P.S. This question belongs on the User ML. Questions about using or
developing applications with Lenya belong on the User ML. The Dev ML
is for suggestions and work concerning changes to the Lenya platform.
"dev" is traditional for the programmers ML -- confusing for platforms
because people use platforms to develop applications. The programmers
ML should use a different name e.g. platform or base.
[Debugging] see the stream anywhere in a sitemap
Posted by Florent André <fl...@4sengines.eu>.
This mail is an answer to this mail : Re: [Forum module] work with
collection and Cinclude
I modify the title in order to <map:match pattern="better"> to the
discussion :
In order to seralize the stream before a transformation you suggest me to :
> You have
> <map:match pattern="*.xml/*/*/*/*">
>
> So just request in your browser. The outcome should be xml and you can
> see what goes into the transformation.
but, in my opinion this tip has two "problems"
1 - the stream is "cut" when the map:serialize is throw
2 - when the sitemap has many "redirection" (=<map:generate
src="cocoon:/feedContent/news/{1}/{2}/{3}/{4}/{5}"/>) it's difficult to
write a well formed request in the browser
3 - when I do that in a module's sitemap (eg news module), I have the error
page that display on the site
So, after some research in the lenya code, I found this solution :
Before the transformation put this code :
<map:transform
src="fallback://lenya/xslt/authoring/edit/addSourceTags.xsl">
<map:parameter name="source"
value="context://lenya/pubs/debugDOC.xsl"/>
</map:transform>
<map:transform type="write-source">
<map:parameter name="serializer" value="xml"/>
</map:transform>
<map:transform
src="fallback://lenya/xslt/authoring/edit/removeSourceTags.xsl"/>
and :
- the stream is writing in the pubs/debugDOC.xsl
- the sitemap processing is not disturbed
What do you think about this solution ?
However, the debugDOC.xsl is a "one line" xml... that is not very friendly.
I try to add a <xsl:output indent="yes"/> in the addSourceTags.xsl, but
it's don't work... If you have any ideas : they are welcome !!
( I use the linux program xmlindent for create an indented debugDOC, but
this is not very simple)
Have a good day
On Sat, 04 Oct 2008 22:58:49 +0200, Thorsten Scherler <th...@apache.org>
wrote:
> On Thu, 2008-10-02 at 01:20 +0200, Florent André wrote:
>> Thank you for this answer Thorsten
>>
>> I will be more precise in the future.
>>
>> You ask me to give the xml file before .xsl.
>>
>> "
>> > Put a <map:serialize type="xml"/> here to see what goes in
>> > collection2html.xsl.
>> "
>> But I have a "problem" with <map:serialize> : If I put a <map:serialize>
>> before collection2html.xsl, the serialized xml will be transform with
> other
>> <map:match> (the stream is redirected by other map:generator).
>
> I am talking about debugging. Meaning my suggestion is that you debug
> just the one match not the whole pipeline. General rule of thumb for
> debugging is keep it small to pin down the problem.
>
> You have
> <map:match pattern="*.xml/*/*/*/*">
>
> So just request in your browser. The outcome should be xml and you can
> see what goes into the transformation.
>
>
>> So, in order to display the stream before transformation by
>> collection2html.xsl, I see this options :
>> 1 - reorder the sitemap in order to have the collection2html in the last
>> position -- I think it's a very bad solution
>> 2 - use <map:view> -- I try that in the module's subsitemap : the result
> in
>> web-browser is : no content
>> 3 - use a serializer that write a file on the file system -- What is the
>> serializer defining in Lenya ? I search him in editor's sitemap, but I
>> don't find it from now...
>>
>
> All of the above sounds way too much fuzz. Just add the serializer,
> request the match pattern and see what is the result.
>
> salu2
>
>>
>> And, for the :
>> >
>> > Yeah, see above basic violation of the whole concept of the pipeline.
>> I guarantee you that I don't redo that !
>>
>> have a good day
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
>> For additional commands, e-mail: dev-help@lenya.apache.org
>>
> --
> Thorsten Scherler thorsten.at.apache.org
> Open Source Java consulting, training and solutions
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
> For additional commands, e-mail: dev-help@lenya.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org
Re: [Forum module] work with collection and Cinclude
Posted by Thorsten Scherler <th...@apache.org>.
On Thu, 2008-10-02 at 01:20 +0200, Florent André wrote:
> Thank you for this answer Thorsten
>
> I will be more precise in the future.
>
> You ask me to give the xml file before .xsl.
>
> "
> > Put a <map:serialize type="xml"/> here to see what goes in
> > collection2html.xsl.
> "
> But I have a "problem" with <map:serialize> : If I put a <map:serialize>
> before collection2html.xsl, the serialized xml will be transform with other
> <map:match> (the stream is redirected by other map:generator).
I am talking about debugging. Meaning my suggestion is that you debug
just the one match not the whole pipeline. General rule of thumb for
debugging is keep it small to pin down the problem.
You have
<map:match pattern="*.xml/*/*/*/*">
So just request in your browser. The outcome should be xml and you can
see what goes into the transformation.
> So, in order to display the stream before transformation by
> collection2html.xsl, I see this options :
> 1 - reorder the sitemap in order to have the collection2html in the last
> position -- I think it's a very bad solution
> 2 - use <map:view> -- I try that in the module's subsitemap : the result in
> web-browser is : no content
> 3 - use a serializer that write a file on the file system -- What is the
> serializer defining in Lenya ? I search him in editor's sitemap, but I
> don't find it from now...
>
All of the above sounds way too much fuzz. Just add the serializer,
request the match pattern and see what is the result.
salu2
>
> And, for the :
> >
> > Yeah, see above basic violation of the whole concept of the pipeline.
> I guarantee you that I don't redo that !
>
> have a good day
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
> For additional commands, e-mail: dev-help@lenya.apache.org
>
--
Thorsten Scherler thorsten.at.apache.org
Open Source Java consulting, training and solutions
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org