Re: is it possible to cache sql queries?

2006-03-10 Thread Antonio Gallardo

AFAIK, the SQL tranformer is not cacheable.

Best Regards,

Antonio Gallardo.

Brian Maddy wrote:

Does anyone know if it is possible to cache sql queries?  I'm using 
the sql transformer a lot and many of the queries don't need to be 
done more than once every few hours.  But they're being done all the 
time.  Is it possible to cache the results somehow with cocoon's 
caching system?


Thanks,
Brian


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: extra-classpath issue ?

2006-03-10 Thread Antonio Gallardo

Hi gilles,

knowing how the tomcat classloader works might help you a lot [1].
Also, you should use only one application. Merge the cocoon directory 
and integrate the whole web application in the same directory. Please 
check the Bertrand presentation for best practices. [2]


Best Regards,

Antonio Gallardo.

[1] http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html
[2] http://www.cocoongt.org/Slides-and-recordings.html

gilles wrote:


Hi,

I'm using cocoon 2.1.8 deployed under tomcat 5.5.15
My jdk is 1.5.0_06, my OS is Red Hat Enterprise Linux ES release 4

I wrote a cocoon based application whose files are located in a directory
/var/www/webapps/visumtd/ apart from the cocoon webapp directory 
which is located in /var/www/webapps/cocoon/. I mounted this application

through the mount-table mecanism and it works fine.

This web application needs some specific jar files to run and I want these jar
files to be located in the application file hierarchy, not in the cocoon
webapp one.

I used the extra-classpath parameter in web.xml of cocoon webapp to specify
the path to those jars :


 

/var/www/webapps/visumtd/WEB-INF/lib/visuMtd-v0.0.3_j2dk_1.5.0.jar:/var/www/webapps/visumtd/WEB-INF/lib/metadata-0.0.1.jar

   


but this had no effect and the classes of those jars are not known 
(ClassNotFoundException)


I tried to use the ParanoidCocoonServlet instead of the CocoonServlet as 
suggested in the web.xml comments but with no effects. I also tried to set

the value of the "init-classloader" parameter to true. Still with no effects.

Of course, when I put the jar files in the WEB-INF/lib/ directory of cocoon 
webapp, everything works fine...


I've browsed the cocoon-users list archives : it seems that some people meet 
the same problem, but I didn't found any answer.


Does anyone have an idea ?


Thanks,

Gilles





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Exception in tomcat catalina.out

2006-03-10 Thread Antonio Gallardo

Versions?

Best Regards,

Antonio Gallardo.

Anna Bikkina wrote:


Hi,

I am running my application in cocoon and am using cocoon portals . I 
see the following error in tomcat catalina.out constantly. The 
application seems to work fine. Can anyone explain why I am getting 
this error.


Thanks,
Anna.


java.lang.NullPointerException
   at 
org.apache.cocoon.environment.http.HttpRequest.getRequestURI(HttpRequest.java:227) 

   at 
org.apache.cocoon.util.log.CocoonLogFormatter.getURI(CocoonLogFormatter.java:232) 

   at 
org.apache.cocoon.util.log.CocoonLogFormatter.formatPatternRun(CocoonLogFormatter.java:175) 

   at 
org.apache.cocoon.util.log.ExtensiblePatternFormatter.format(ExtensiblePatternFormatter.java:376) 

   at 
org.apache.log.output.AbstractOutputTarget.format(AbstractOutputTarget.java:189) 

   at 
org.apache.log.output.AbstractOutputTarget.doProcessEvent(AbstractOutputTarget.java:148) 

   at 
org.apache.log.output.AbstractTarget.processEvent(AbstractTarget.java:145) 


   at org.apache.log.Logger.fireEvent(Logger.java:708)
   at org.apache.log.Logger.output(Logger.java:683)
   at org.apache.log.Logger.output(Logger.java:666)
   at org.apache.log.Logger.info(Logger.java:206)
   at 
org.apache.avalon.framework.logger.LogKitLogger.info(LogKitLogger.java:117) 

   at 
org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:1167)

   at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
   at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) 

   at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) 

   at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256) 

   at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) 

   at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) 

   at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
   at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) 

   at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) 

   at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) 

   at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
   at 
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415) 

   at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) 

   at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) 

   at 
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171) 

   at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) 

   at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172) 

   at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) 

   at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) 

   at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
   at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174) 

   at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) 

   at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) 

   at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
   at 
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
   at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594) 

   at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392) 

   at 
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565) 

   at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619) 


   at java.lang.Thread.run(Thread.java:534)
Logging Error: Unknown error writing event.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: AW: Memoryleaks in Cocoon 2.1.7?

2006-03-10 Thread Ralph Goers

Were you using Java 5?

Christofer Dutz wrote:


Well it seems that I was able to get rid of the nasty memory leaks.

The problem is, that they weren't real memory leaks after all. I 
noticed that if I pressed the "GC" button in the JConsole tool, that 
all unnecessary Memory was freed. As far as could find out, this is a 
problem with the default garbage collection method used to free 
memory. This uses a fast but inaccurate way to free unused memory 
blocks. I could have started testing out different GC settings, but I 
simply witched to a JRockit VM and all my memory problems were solved. 
After doing some performance evaluations at my university I knew that 
JRockit seems to handle its memory a lot more efficient than the Sun 
VM (both with default GC setting), so I didn't bother testing the 
settings of the Sun VM. Maybe someone on this list has some hints to 
getting the Sun VM to clean up its memory better.


Hope this helps anyone.

Chris



*Von:* Simone Gianni [mailto:[EMAIL PROTECTED]
*Gesendet:* Donnerstag, 2. März 2006 13:14
*An:* users@cocoon.apache.org
*Betreff:* Re: Memoryleaks in Cocoon 2.1.7?

Just for the records, i'm currently experiencing some out of memory 
errors on a cocoon 2.1.8 using common blocks + forms + fop on two 
machines (a developer machine running windows, and a gentoo server), 
while with the same cocoon version and same application it does not 
happen on other machines (ranging from ubuntu and gentoo developers 
machines, and an ubuntu server). So I thought it was a platform 
problem, not directly related with cocoon (so didn't even tried a 
profiled run), but since the thread is open and i have two machines 
showing random out of memory, let me know if i can check something to 
make it clearer.


Simone

Tomasz Nowak wrote:

Użytkownik <[EMAIL PROTECTED]>  wrote:
  

I have read your posts. The problem seems to be a different one.
 
We increased the memory assigned to tomcat and cocoon and successfully

increased the time between OutOfMemory errors. With 2GB of Memory the
application runs stable for about one week. I am now looking for the
leak itself and as I can see in the jconsole there is deffinitively a
leak. If I cant get a tip here, my next step is to setup a profiler
and run jmeter stresstests untill I find the bug. Hopefully it is no
"big-one" in cocoon itself.

 
I would be VERY THANKFULL if you let me know if you find that leak.
 
  


--
Simone Gianni



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Access bound bean itself on CForms - also hibernate reattach object to hibernate session on view.

2006-03-10 Thread Simone Gianni

Hi Andre,
you cannot actually access the bean from the template, since the 
template does not even know that there is a binding and a bean. Anyway, 
you can pass the bean (and the session, and everything else you need) 
from the flow to the (JX) template passing it as a bizdata, for example :


in flow :

form.showForm('myform.def.xml', {"bean": mybaean});

in jx template you can then access the bean with ${bean.method()}.

The flow/view/hibernate problem is commonly not easy to solve, there has 
been a recent thread about this : 
http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=114164895800296&w=2 . 
In the second mail of this thread i posted a possible solution we are 
using in our cocoon+hibernate+spring projects.


Hope this helps,
Simone

Andre Cesta wrote:


How do I access the BEAN itself that is bound on CFORMS with bean binding 
framework?

To be more specific, how to I access/reference the bean from: 1.Inside the 
cform template file and
2 . Inside the cform binding file?

I was trying to do the following from the form template: 



  


Although the form displays, the code seems to fail to execute.

Doing the following:

  

Does display: [object Object]
But the problem is that I cannot seem to be able to call methods on it.

I explain what I want to achieve with this:

I want to be able to reattach an object to a new hibernate session on the view 
(template).

Normally the pattern used with hibernate lazy initialized objects and CForms is 
the: “session
closed on view pattern”.  This means the session is passed/stored on the 
“request header” and will
be closed normally by a servlet filter on the view. Examples of this can be 
found on the cocoon
mailing list, and also on the “Hibernate Fast” book and on the Cocoon wiki for 
hibernate.

The problem with this is that it moves a lot of the code that has to do with 
transactions,
sessions from Java into Cocoon.

The “hibernate in action” book mentions that a good alternative to keeping the 
session open is to
simply leave your Java methods as they are (closing the sessions) and reopen 
the sessions on the
view and reattaching the objects (lock method).

I wonder if anybody would be able to help me achieving this reopening and 
reattachment of the
session.

Has anybody perhaps already tried this?  Are you satisfied with the results?




___ 
To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

 


--
Simone Gianni

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



AW: Memoryleaks in Cocoon 2.1.7?

2006-03-10 Thread Christofer Dutz








Well it seems that I was
able to get rid of the nasty memory leaks.

The problem is, that they
weren’t real memory leaks after all. I noticed that if I pressed the “GC”
button in the JConsole tool, that all unnecessary Memory was freed. As far as could
find out, this is a problem with the default garbage collection method used to
free memory. This uses a fast but inaccurate way to free unused memory blocks.
I could have started testing out different GC settings, but I simply witched to
a JRockit VM and all my memory problems were solved. After doing some performance
evaluations at my university I knew that JRockit seems to handle its memory a
lot more efficient than the Sun VM (both with default GC setting), so I didn’t
bother testing the settings of the Sun VM. Maybe someone on this list has some
hints to getting the Sun VM to clean up its memory better.

 

Hope this helps anyone.

 

Chris

 









Von: Simone Gianni [mailto:[EMAIL PROTECTED]

Gesendet: Donnerstag, 2. März 2006
13:14
An: users@cocoon.apache.org
Betreff: Re: Memoryleaks in Cocoon
2.1.7?



 

Just for the records, i'm currently
experiencing some out of memory errors on a cocoon 2.1.8 using common blocks +
forms + fop on two machines (a developer machine running windows, and a gentoo
server), while with the same cocoon version and same application it does not
happen on other machines (ranging from ubuntu and gentoo developers machines,
and an ubuntu server). So I thought it was a platform problem, not directly
related with cocoon (so didn't even tried a profiled run), but since the thread
is open and i have two machines showing random out of memory, let me know if i
can check something to make it clearer.

Simone

Tomasz Nowak wrote: 

Użytkownik <[EMAIL PROTECTED]> wrote:  

I have read your posts. The problem seems to be a different one. We increased the memory assigned to tomcat and cocoon and successfullyincreased the time between OutOfMemory errors. With 2GB of Memory theapplication runs stable for about one week. I am now looking for theleak itself and as I can see in the jconsole there is deffinitively aleak. If I cant get a tip here, my next step is to setup a profilerand run jmeter stresstests untill I find the bug. Hopefully it is no"big-one" in cocoon itself.    

 I would be VERY THANKFULL if you let me know if you find that leak.   

-- 
Simone Gianni








Access bound bean itself on CForms - also hibernate reattach object to hibernate session on view.

2006-03-10 Thread Andre Cesta
How do I access the BEAN itself that is bound on CFORMS with bean binding 
framework?

To be more specific, how to I access/reference the bean from: 1.Inside the 
cform template file and
2 . Inside the cform binding file?

I was trying to do the following from the form template: 


  

Although the form displays, the code seems to fail to execute.

Doing the following:

   

Does display: [object Object]
But the problem is that I cannot seem to be able to call methods on it.

I explain what I want to achieve with this:

I want to be able to reattach an object to a new hibernate session on the view 
(template).

Normally the pattern used with hibernate lazy initialized objects and CForms is 
the: “session
closed on view pattern”.  This means the session is passed/stored on the 
“request header” and will
be closed normally by a servlet filter on the view. Examples of this can be 
found on the cocoon
mailing list, and also on the “Hibernate Fast” book and on the Cocoon wiki for 
hibernate.

The problem with this is that it moves a lot of the code that has to do with 
transactions,
sessions from Java into Cocoon.

The “hibernate in action” book mentions that a good alternative to keeping the 
session open is to
simply leave your Java methods as they are (closing the sessions) and reopen 
the sessions on the
view and reattaching the objects (lock method).

I wonder if anybody would be able to help me achieving this reopening and 
reattachment of the
session.

Has anybody perhaps already tried this?  Are you satisfied with the results?




___ 
To help you stay safe and secure online, we've developed the all new Yahoo! 
Security Centre. http://uk.security.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: No ajax, but page with long repeater...

2006-03-10 Thread Jason Johnston
> Using cocoon 2.1.8, here is the problem:
>
> Say a form has a repeater with many rows. If there is a repeater-action
> at the bottom that adds a new row, clicking it causes a form submit, and
> the user ends up at the top of the page, where the new row sits at the
> bottom of the page.
>
> Likewise, if the repeater rows themselves have nested repeaters, any
> action that causes a form submission leaves the user at the top of the
> page, in a different "context", if you will, than where they performed
> the "submit action".
>
> Is it possible, without ajax, to have a page submission target the
> widget that was "acted upon"?
>
> Is CForms able to output an  that is
> targeted somehow via an http://my_continuation_url#repeater-row-id?

You don't need an  element to implement anchors, any element
with an id attribute will do, and is in fact the preferred method since
HTML4.  All HTML fields produced by CForms already have an id attribute,
so you should be able to use that.

Perhaps you can add an onclick handler to your button that adds the id of
that button to the end of the form action as a fragment identifier before
submitting:

  onclick="this.form.action += '#' + this.id;"

Unfortunately the styling XSLT already adds an onclick to buttons, so you
may have to override the appropriate template(s) to add your custom
onclick.

Or another approach might be to override the built-in submitForm JS
function, by adding something like the following to your own JS that gets
loaded after the base cforms.js:

  cocoon.forms._orig_submitForm = cocoon.forms.submitForm;
  cocoon.forms.submitForm = function(element, name) {
var form = this.getForm(element);
form.action += '#' + element.id;
this._orig_submitForm(element, name);
  }

(Based on cforms.js in 2.1.8, assumes the JS API doesn't change.)  This
would add the fragment identifier for all form submits, which may be what
you want or maybe not.

Hope that helps
--Jason



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Dynamic CForm with HTML-Tags in Initial-Value

2006-03-10 Thread Moritz Kobel
Hi,

i'm writing a simple content management system with the html-editor
tiny-mce instead of htmlarea. on one page there are multiple
content-fields possible, so i generate the template & definition file
with data from a sql database.
when i fill up the inital-value with html code from the database all the
html-tags are removed.

can somebody give me a hint how to solve this problem? i found no
solution seeking the mailinglist and asking google.

thanks in advance

-moritz

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



No ajax, but page with long repeater...

2006-03-10 Thread David Park

Using cocoon 2.1.8, here is the problem:

Say a form has a repeater with many rows. If there is a repeater-action 
at the bottom that adds a new row, clicking it causes a form submit, and 
the user ends up at the top of the page, where the new row sits at the 
bottom of the page.


Likewise, if the repeater rows themselves have nested repeaters, any 
action that causes a form submission leaves the user at the top of the 
page, in a different "context", if you will, than where they performed 
the "submit action".


Is it possible, without ajax, to have a page submission target the 
widget that was "acted upon"?


Is CForms able to output an  that is 
targeted somehow via an http://my_continuation_url#repeater-row-id?


Many thanks to anyone who has any assistance to offer.

David Park
[EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Setting Default Focus in CForms

2006-03-10 Thread ian . d . stewart
Have you tried

   document.form.elements['name:input'].focus?


Ian

It's better to be hated for who you are
than loved for who you are not

Ian D. Stewart
Appl Dev Analyst-Advisory, DCS Automation
JPMorganChase Global Technology Infrastructure
Phone: (614) 244-2564
Pager: (888) 260-0078



  
  "Stewart, Gary"   
  
  <[EMAIL PROTECTED]To:   
 
  cot.nhs.uk> cc:   
  
  Subject:  Setting Default 
Focus in CForms   
  03/10/2006 11:31 AM   
  
  Please respond to 
  
  users 
  

  




Hi there,

I've been trying to set the first form item to have focus when the form is
loaded. Normally it would just be a case of setting

document.form.name.focus();

but the issue seems to be that CForms uses a name:input format for the id.
Is there a way of setting the focus in CForms? I looked at the Widget API
but couldn't see a function to set the widget as focus (unless I'm missing
something... which is quite possible).

Thanks,

Gary


*
The information contained in this message may be confidential or
legally privileged and is intended for the addressee only, If you
have received this message in error or there are any problems,
please notify the originator immediately. The unauthorised use,
disclosure, copying or alteration of this message is
strictly forbidden.
*


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Setting Default Focus in CForms

2006-03-10 Thread Stewart, Gary
Hi there,

I've been trying to set the first form item to have focus when the form is 
loaded. Normally it would just be a case of setting 

document.form.name.focus();

but the issue seems to be that CForms uses a name:input format for the id. Is 
there a way of setting the focus in CForms? I looked at the Widget API but 
couldn't see a function to set the widget as focus (unless I'm missing 
something... which is quite possible).

Thanks,

Gary


*
The information contained in this message may be confidential or 
legally privileged and is intended for the addressee only, If you 
have received this message in error or there are any problems, 
please notify the originator immediately. The unauthorised use, 
disclosure, copying or alteration of this message is 
strictly forbidden.
*


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Cached objects and http header 'range'!

2006-03-10 Thread Marcel Rouwenhorst








Hi,

 

I see that some readers i.e. the ResourceReader and DatabaseReader
accept http header ‘Range’. These readers also supports caching. 

 

But what happens if a object that is already serviced
by a reader and is cached by the pipeline cache, is requested by a client that
asks for a specific ‘Range’?

Is the cache capable
of streaming this ‘Rang’ or does it stream the complete component?

 

 

Thank you,

Marcel








Re: Calendar generator -> adding Content

2006-03-10 Thread Jason Johnston
Joost Kuif wrote:
> Hi,
> 
> Does anyone have a working example of how to add content (like a simple
> anchor tag) to the Calendargenerator with use of a overridden subclass?
> 
> I haven't seen one in the example block, but maybe I am missing
> something.

Could you use a transform (XSLT?) directly after the calendar generator
to add your specialized content?  Just a thought.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: handling errors in parts

2006-03-10 Thread Bruno Dumon
On Thu, 2006-03-09 at 14:37 -0500, Justin Hannus wrote:
> Bruno Dumon wrote:
> 
> >what do you refer to with 'pipelines' here? The other map:part's?
> >Transformers after the map:aggregate?
> >
> >  
> >
> Yes, the other map:parts.

Then that's impossible. It will stop at the first part that throws an
exception.

>  The src attribute points to points to another 
> pipeline with cocoon://. Please see my first post as it has an 
> example at the bottom. I re-posted the same thread omitting the example 
> for brevity.
> 
> >>cocoon:// request will continue processing as if no error has occurred 
> >>but. you will still see the cocoon error page as if processing 
> >>actually stopped!
> >>
> >>I have a pipeline which aggregates several other pipelines and then 
> >>writes the generated content to disk. If there is an exception in one of 
> >>the aggregate parts I need the sitemap processing to stop and handle the 
> >>exception appropriately. Instead the generated content, which has 
> >>errored and therefore invalid, is still written to disk. If I remove the 
> >>aggregate pipeline and just use a regular generator the handle-errors is 
> >>respected correctly and processing stops before writing the content.
> >>
> >>Am I misusing the  elements? Or is this the expected 
> >>behavoir?
> >>
> >>
> >>
> >
> >I have no experience with map:aggregate, but from a quick look at the
> >code, it doesn't catch any exceptions. What it does always do (also when
> >an exception occurs) is closing the root tag and sending the end
> >document event.
> >
> >  
> >
> That would explain why exceptions are caught and handled after the 
> aggregate parts are executed, as if things went fine, and concatenated 
> instead of being caught and handled by the map:handle-errors defined in 
> the erroring piepline.

As I wrote, the exceptions are not caught, so it is impossible that
map:parts that follow the one which gives an error are executed.

> 
> BTW: can you point out the file and line you found this on. I've been 
> digging but with no luck yet.

It really doesn't matter, as there's nothing to fix there. While I do
think that sending additional SAX-events after an exception occured is
wrong, changing this will not cause a reliable alternative behaviour, as
the resulting behaviour would just be a coincidence of implementation
details of other transformers. Don't forget the SAX-pipeline is
streaming, you can't pull back events which are already forwarded to the
next transformer.

This being said, ContentAggregator.generate() is where it happens.

> 
> >Now I'm just going to guess wildly (since you didn't mention), but if
> >after the map:generate you have an XSLT transformer and you write the
> >content using the source writing transformer, I can image the file
> >indeed still gets written. This is because on the one hand Xalan can
> >cope with the invalid input, and the endDocument event will cause it to
> >do the transform and thus cause the source writing transformer to do its
> >job.
> >  
> >
> Exactly correct. Please see my first post as it has an example at the 
> bottom. I re-posted the same thread omitting the example for brevity.
> 
> >While the close-root-tag-and-send-end-document-event behaviour of the
> >aggregate is debatable, it is the nature of a SAX-pipeline that
> >everything in the pipeline starts executing together. Therefore things
> >which have side-effects and for which error recovery is important should
> >not be done in a streaming pipeline (therefore the source writing
> >transformer is considered an evil one -- don't use it).
> >
> >  
> >
> I've also tried some other experiments with aggregate map:parts calling 
> pipelines and setting request attributes. It seems as if a new Request 
> object is created for each map:aggregate part.

While Cocoon does create a request object wrapper for each internal
request ("cocoon:" request), most things, including setting request
attributes, are delegated to the original request object (at least, I'd
be very suprised if it's different).

>  Therefore setting a 
> request attribute in a pipeline when called from a map:part is not 
> visible to other map:parts or the original pipeline

Careful here: if you set a request attribute in say, a generator of a
pipeline called from a map:part, and read it out in (e.g.) an action in
the original pipeline, then that won't work indeed.

This has to do with how the sitemap works, the following resource might
help you understand this:
http://cocoon.zones.apache.org/daisy/documentation/863/sitemap/853.html

>  that contains the 
> map:aggregate. In my mind there should always be only one Request 
> object. I haven been able to verify this in the source code yet but 
> seems to be that case. Another undesirable side-effect of the map:aggregate.
> 
> >The alternative approach is to use flowscript and its processPipelineTo
> >function, where you can use a try-catch block and remove the file (if
> >needed) when an error occurs.

RE: jx templates and syntax

2006-03-10 Thread Danny Bols
If you write the following, myVar wil be a collection of dom nodes:

test
${myVar.getClass().getName()} -> [Lorg.w3c.dom.Node

To get the text value you should write:

${myVar[0].nodeValue} -> test

--
Danny

> -Original Message-
> From: Kamal Bhatt [mailto:[EMAIL PROTECTED]
> Sent: vrijdag 10 maart 2006 2:33
> To: users@cocoon.apache.org
> Subject: Re: jx templates and syntax
> 
> 
> 
> Simone Gianni wrote:
> 
> > Hi Kamal,
> > dunno why, nut i always have problems like this in jx. Seems like a 
> > variable declared with :
> >
> > Content
> >
> > Takes as value a document fragment, and thus should be converted to 
> > string or something else to be used "normally".
> >
> Really? I found the opposite to be true, at least when I printed 
> the value.
> 
> > I usually declare the variable with :
> >
> > 
> >
> > And this (again, usually) works in the expected way.
> >
> > Hope this helps,
> > Simone
> >
> > Kamal Bhatt wrote:
> >
> >>
> >> Hi.
> >> I was wondering, if this is a bug and if it is,  has been fixed in 
> >> 2.1.8 (I am currently on 2.1.7 and do not have access to 2.1.8):
> >>
> >> If I create a variable with value of a field eg.
> >>
> >>  >> value="${form.getChild('active_repeater').getValue()}"/>
> >>
> >> then I reference it in an if eg.
> >>
> >> 
> >> ...
> >>
> >> I do not enter the code inside of the if but if I change it to this:
> >> 
> >>
> >> it works fine.
> >>
> >> Also, while we are on the topic of jx templates, why are they so 
> >> inconsisten with the way we do things in XSLT and XML based 
> "languages".
> >>
> >> Cheers.
> >>
> 
>  -- 
> Kamal Bhatt
> 
> Tourism Technology Pty Ltd
> 
> 
> T:  +61 (02) 9956 7300
> F:  +61 (02) 9956 7411
> 
> 
> Level 10, 1 Pacific Highway, North Sydney, NSW 2060
> 
>  
> http://www.tt.com.au
> 
> 
> --
> Disclaimer: This email is confidential and may contain privileged 
> information for the sole use of the person or business to which 
> it is addressed. If you are not the intended recipient, please 
> notify the sender by return e-mail or phone as you must not view, 
> disseminate, distribute or copy this email without our consent. 
> We do not accept any liability in connection with any computer 
> virus, data corruption, incompleteness, or unauthorised amendment 
> of this email. It is the sole responsibility of the receiver to 
> scan for viruses before opening.
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Calendar generator -> adding Content

2006-03-10 Thread Joost Kuif
Hi,

Does anyone have a working example of how to add content (like a simple
anchor tag) to the Calendargenerator with use of a overridden subclass?

I haven't seen one in the example block, but maybe I am missing
something.

Thanks,
Joost


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]