RE: how do I redirect in an Action?
This is how it works in my project. Christian Haul says the same I guess: Another misconception in this thread seems to be that the tags after the action will always be processed. That is only true if it was determined that they are part of the actual pipeline. -Oorspronkelijk bericht- Van: Lai, Harry [mailto:[EMAIL PROTECTED]] Verzonden: donderdag 23 mei 2002 17:49 Aan: '[EMAIL PROTECTED]' Onderwerp: RE: how do I redirect in an Action? Hi Edgar, I may be misunderstanding how actions work, but at least for how we've used them in our project, anything after an action always executes, regardless of whether the action returns a null Map or not. If an action returns a null Map, it skips the steps inside the act tag, but it will continue executing the steps after the act tag. If this isn't always the case, please let me know. I'll be the first to admit that my understanding of Cocoon is far from perfect! =) Harry -Original Message- From: Graaf, Edgar de (fin) [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 23, 2002 10:25 AM To: '[EMAIL PROTECTED]' Subject: RE: how do I redirect in an Action? Harry, I have to look in to you example later. But the last redirect is to a page that ask you to try again... when the action doesn't fail(the password is right) that redirect is not executed (that between the map:act is). -Oorspronkelijk bericht- Van: Lai, Harry [mailto:[EMAIL PROTECTED]] Verzonden: donderdag 23 mei 2002 17:19 Aan: '[EMAIL PROTECTED]' Onderwerp: RE: how do I redirect in an Action? Hi Christopher and Edgar, Couple things. I could be wrong, but I believe in Edgar's example, the redirect would always execute (since it sits outside the action). Also, depending on how many protected url matchers you have, you can also delegate all work to a resource where you could put all your authentication and redirect logic (so you don't have to have it in each matcher). So you could do something like this: map:match pattern=some protected url map:call resource=authenticatedAccess map:parameter name=someIDForThisPipe value=foo/ ... any other params you might need to process this pipe ... /map:call /map:match map:match pattern=some other protected url map:call resource=authenticatedAccess map:parameter name=someIDForThisPipe value=bar/ ... any other params you might need to process this pipe ... /map:call /map:match And the resource might look like: map:resource name=authenticatedAccess map:act type=my-authenticator map:select type=parameter map:parameter name=parameter-selector-test value={authStatus}/ map:when test=success ... stuff to process pipeline based on params /map:when map:otherwise map:redirect-to uri=loginpage.html/ /map:otherwise /map:select /map:act /map:resource Anyway, hope that helps! Harry -Original Message- X-Sybari-Space: From: Graaf, Edgar de (fin) [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 23, 2002 10:01 AM To: '[EMAIL PROTECTED]' Subject: RE: how do I redirect in an Action? Christopher, map:act... can't contain matchers, how else would cocoon know that the action should be run? try: map:match pattern=some protected url map:act type=my-authenticator ... /map:act map:redirect-to uri=loginpage.html/ /map:match map:match pattern=some other protected url map:act type=my-authenticator ... /map:act map:redirect-to uri=loginpage.html/ /map:match regards Edgar -Oorspronkelijk bericht- Van: Christopher Painter-Wakefield [mailto:[EMAIL PROTECTED]] Verzonden: donderdag 23 mei 2002 15:52 Aan: [EMAIL PROTECTED] Onderwerp: Re: how do I redirect in an Action? I'm trying to implement a homegrown authentication scheme. One of our types of users will be authenticated by coming into the system with appropriate credentials as request parameters in the URL (we will e-mail them their unique URL). This is to avoid generating a large number of user ids and requiring all these users to remember credentials for a system they will likely use once or twice a year. None of the existing server-level authentication schemes would seem to support this. Once the user has logged in by providing the correct credentials, I planned to store their identity and the fact that they have been authenticated in their session. So, each time a request is made to a protected page, I need to first check the
AW: Question: what is {session-id} ? in a sitemap.xmap ?
Hi John, unfortunately, it is not enough to set 'fred' as a session attribute, who would have to set it as a sitemap parameter just as Artur said. You can do this inside an action (actions return a java.util.Map and you can use the keys stored in it as sitemap parameters. I don't know if it is there in 2.0.1 but in 2.0.2 you can look in the docs under User Guide / Concepts / Actions and there at 'Communication between Sitemap and Action'. As Artur also pointed out you can call a resource with some parameters which you can then use as sitemap parameters inside the map:resource tag. Judith -Ursprüngliche Nachricht- Von: John Austin [SMTP:[EMAIL PROTECTED]] Gesendet am: Freitag, 24. Mai 2002 00:37 An: [EMAIL PROTECTED] Betreff: Re: Question: what is {session-id} ? in a sitemap.xmap ? On Thursday 23 May 2002 18:23, you wrote: Thanks. It is pretty clear that {name} is a variable. My question should have been: How do I discover the valid values for {name} ? The example I was looking at used {session-id} which is intuitively linked to the session-id I would get from session:get-attribute name=session-id/. Is my inference correct? Does it therefore follow that I can use any attribute from the session context ? If I set a session attribute named 'fred' with the value 'flintstone' does {fred} evaluate to 'flintstone' in a sitemap ? Is the definition of {name} documented anywhere ? Is there any way of enumerating defined names ? From what I know, basically {name} is a representation of a sitemap parameter which are used by sitemap components. For example, if your pipeline wants to call another (resource) pipeline you with a target parameter you would do it this way map:call resource=simple-page map:parameter name=target value=some/path/to/something/ /map:call now in your simple-page pipline you can access that target paramter with {target} so you can have: map:resource name=simple-page map:generate type=file src={target}.xml/ map:transform src=stylesheets/page/simple-page2html.xsl map:parameter name=view-source value={target}.xml/ /map:transform map:serialize/ /map:resource Also, if you implement actions the return of the act() method is a map that will be added to the session paramters. In your action of you do sitemapParam.put(session-id, getSessionID()); then in your pipeline you can do map:match pattern=something map:act type=my-action map:generate src=something/{session-id}/ ... /map:act /map:match - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Vadim : Very Important: Deploy Servlets in the Cocoon Context
Vadim, If I use the html generator on this, I still get: Cocoon 2 - Internal server error type fatal message Exception in HTMLGenerator.generate() description org.apache.cocoon.ProcessingException: Exception in HTMLGenerator.generate(): java.lang.NullPointerException sender org.apache.cocoon.servlet.CocoonServlet source Cocoon servlet stack-trace org.apache.cocoon.ProcessingException: Exception in HTMLGenerator.generate(): java.lang.NullPointerException at org.apache.cocoon.generation.HTMLGenerator.generate(HTMLGenerator.java:249) at org.apache.cocoon.components.pipeline.CachingEventPipeline.process(CachingEv entPipeline.java:251) at org.apache.cocoon.components.pipeline.CachingStreamPipeline.process(CachingS treamPipeline.java:399) at org.apache.cocoon.www.mount.mebcatalog.sitemap_xmap.matchN1002D(/Library/Jon as/Tomcat33/work/DEFAULT/cocoon/cocoon-files/org/apache/cocoon/www/mount/meb catalog/sitemap_xmap.java:506) at org.apache.cocoon.www.mount.mebcatalog.sitemap_xmap.process(/Library/Jonas/T omcat33/work/DEFAULT/cocoon/cocoon-files/org/apache/cocoon/www/mount/mebcata log/sitemap_xmap.java:381) at org.apache.cocoon.www.mount.mebcatalog.sitemap_xmap.process(/Library/Jonas/T omcat33/work/DEFAULT/cocoon/cocoon-files/org/apache/cocoon/www/mount/mebcata log/sitemap_xmap.java:321) at org.apache.cocoon.sitemap.Handler.process(Handler.java:222) at org.apache.cocoon.sitemap.Manager.invoke(Manager.java:179) at org.apache.cocoon.www.sitemap_xmap.matchN105AF(/Library/Jonas/Tomcat33/work/ DEFAULT/cocoon/cocoon-files/org/apache/cocoon/www/sitemap_xmap.java:6670) at org.apache.cocoon.www.sitemap_xmap.process(/Library/Jonas/Tomcat33/work/DEFA ULT/cocoon/cocoon-files/org/apache/cocoon/www/sitemap_xmap.java:3341) at org.apache.cocoon.www.sitemap_xmap.process(/Library/Jonas/Tomcat33/work/DEFA ULT/cocoon/cocoon-files/org/apache/cocoon/www/sitemap_xmap.java:3085) at org.apache.cocoon.sitemap.Handler.process(Handler.java:222) at org.apache.cocoon.sitemap.Manager.invoke(Manager.java:179) at org.apache.cocoon.sitemap.SitemapManager.process(SitemapManager.java:154) at org.apache.cocoon.Cocoon.process(Cocoon.java:575) at org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:998) at javax.servlet.http.HttpServlet.service(HttpServlet.java) at org.apache.tomcat.facade.ServletHandler.doService(ServletHandler.java:574) at org.apache.tomcat.core.Handler.invoke(Handler.java:322) at org.apache.tomcat.core.Handler.service(Handler.java:235) at org.apache.tomcat.facade.ServletHandler.service(ServletHandler.java:485) at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:91 7) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:833) at org.apache.tomcat.modules.server.Http10Interceptor.processConnection(Http10I nterceptor.java:176) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:494) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav a:516) at java.lang.Thread.run(Thread.java:496) java.lang.NullPointerException at org.apache.xml.utils.TreeWalker.startNode(TreeWalker.java:373) at org.apache.xml.utils.TreeWalker.traverse(TreeWalker.java:183) at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerId entityImpl.java:325) at org.apache.cocoon.xml.dom.DOMStreamer.stream(DOMStreamer.java:143) at org.apache.cocoon.generation.HTMLGenerator.generate(HTMLGenerator.java:236) at org.apache.cocoon.components.pipeline.CachingEventPipeline.process(CachingEv entPipeline.java:251) at org.apache.cocoon.components.pipeline.CachingStreamPipeline.process(CachingS treamPipeline.java:399) at org.apache.cocoon.www.mount.mebcatalog.sitemap_xmap.matchN1002D(/Library/Jon as/Tomcat33/work/DEFAULT/cocoon/cocoon-files/org/apache/cocoon/www/mount/meb catalog/sitemap_xmap.java:506) at org.apache.cocoon.www.mount.mebcatalog.sitemap_xmap.process(/Library/Jonas/T omcat33/work/DEFAULT/cocoon/cocoon-files/org/apache/cocoon/www/mount/mebcata log/sitemap_xmap.java:381) at org.apache.cocoon.www.mount.mebcatalog.sitemap_xmap.process(/Library/Jonas/T omcat33/work/DEFAULT/cocoon/cocoon-files/org/apache/cocoon/www/mount/mebcata log/sitemap_xmap.java:321) at org.apache.cocoon.sitemap.Handler.process(Handler.java:222) at org.apache.cocoon.sitemap.Manager.invoke(Manager.java:179) at org.apache.cocoon.www.sitemap_xmap.matchN105AF(/Library/Jonas/Tomcat33/work/ DEFAULT/cocoon/cocoon-files/org/apache/cocoon/www/sitemap_xmap.java:6670) at org.apache.cocoon.www.sitemap_xmap.process(/Library/Jonas/Tomcat33/work/DEFA ULT/cocoon/cocoon-files/org/apache/cocoon/www/sitemap_xmap.java:3341) at org.apache.cocoon.www.sitemap_xmap.process(/Library/Jonas/Tomcat33/work/DEFA
RE: how do I redirect in an Action?
I tried the following: map:act type=session-validator map:parameter name=descriptor value=context://bugtrack//descriptors/params.xml/ map:parameter name=validate value=username,password/ map:match bla bla == protected area == /map:act !-- WHEN LOGIN DOESN'T FAIL THIS IS NEVER EXECUTED-- map:match pattern=* map:redirect-to uri=login/ /map:match Login is of course outside the protected area. It sets the session variable when the password is right. It is not high security, I know... This worked. So you where both right that a matcher can be inside map:act. Thanks! Regards -Oorspronkelijk bericht- Van: Christian Haul [mailto:[EMAIL PROTECTED]] Verzonden: donderdag 23 mei 2002 18:08 Aan: [EMAIL PROTECTED] Onderwerp: Re: how do I redirect in an Action? On 23.May.2002 -- 05:00 PM, Graaf, Edgar de (fin) wrote: Christopher, map:act... can't contain matchers, how else would cocoon know that the action should be run? Edgar, AFAIK this is not true. map:act can contain all other tags that are allowed within a pipeline. Depending on the amount of pipeline fragments protected by the action it would be worthwhile to use a subsitemap, though. Another misconception in this thread seems to be that the tags after the action will always be processed. That is only true if it was determined that they are part of the actual pipeline. The whole process is made in two steps: 1) determine what the pipeline actually contains by evaluating actions, matchers, selectors, call and redirect tags. A pipeline is terminated when a serializer is found. For the sake of brevity I consider a reader here to be a (generator + serializer). 2) Use the components (readers, generators, transformers, serializers) determined in step 1. Note that in this step no actions, matchers, or selectors are used. IOW if a serializer is nested inside a map:act tag, it effectively terminates the pipeline and tags beneath the map:act will not be considered. It works just like it was mentioned with redirects or calls. HTH Chris. -- C h r i s t i a n H a u l [EMAIL PROTECTED] fingerprint: 99B0 1D9D 7919 644A 4837 7D73 FEF9 6856 335A 9E08 - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Question: what is {session-id} ? in a sitemap.xmap ?
On 23.May.2002 -- 06:37 PM, John Austin wrote: On Thursday 23 May 2002 18:23, you wrote: Thanks. It is pretty clear that {name} is a variable. My question should have been: How do I discover the valid values for {name} ? The example I was looking at used {session-id} which is intuitively linked to the session-id I would get from session:get-attribute name=session-id/. Is my inference correct? Does it therefore follow that I can use any attribute from the session context ? If I set a session attribute named 'fred' with the value 'flintstone' does {fred} evaluate to 'flintstone' in a sitemap ? Is the definition of {name} documented anywhere ? Is there any way of enumerating defined names ? Since these vars depend on the components that set them, they are documented in the (java)docs for these components (e.g. matchers, actions). If you have a close look at your log files (sitemap.log), you will discover all present vars with their names and values after every step that as potential effect on them. E.g. Current Sitemap Parameters: PARAM: '1' VALUE: 'apps' PARAM: '0' VALUE: 'sample-apps' You have two vars named 1 and 2 available at this stage of the pipeline. Chris. -- C h r i s t i a n H a u l [EMAIL PROTECTED] fingerprint: 99B0 1D9D 7919 644A 4837 7D73 FEF9 6856 335A 9E08 - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: XML in actions
Hello Chitharanjan, Could you, please, tell why you don't advise here to store data in session? What problems do you see? Thank you. Roman Chitharanjan Das wrote: These are the following options 1. Store the XML in the request object (request.setAttribute(xml, xmlStr); 2. return the XML in the hashmap. This xml can be accesses as sitemap parameters in XSP. 3. Also can be stored in Session (not advised) Regds, Chiths -Original Message- From: Mike Ash [mailto:[EMAIL PROTECTED]] Sent:Thursday, May 23, 200212:02 PM To: '[EMAIL PROTECTED]' Subject: XML in actions I need something (action/generator) that talks to a backend system to get xml. The problem is I can't use a generator because I also want to use the xsp generator in the same pipeline. So how can I get an action to return xml that is available to xsp as xml. Here is a sitemap example of what I was looking for map:pipeline map:match type=request-parameter pattern=login-test map:act type=ValidateUser map:act type=GetXml map:generate type=serverpages src=xsp/home.xsp/ /map:act /map:act map:transform src=xsl/simple.xsl/ map:serialize/ /map:match /map:pipeline - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Action Problem.
On 23.May.2002 -- 07:32 PM, Kenny Chow wrote: To Christian Haul, Your suggestion was good and I wanted to do that but my understanding of both the form and dbAddAction have been somewhat poor... So I am putting all actions I wanna do together so that I can get used to the Cocoon API. Have a look at the CVS version (HEAD or cocoon_2_0_3_branch). I have put in some (hopefully good) documentation in it about both flavours of database actions. Although the modular actions are 2.0.x-scratchpad stuff, I would recommend them over the original ones. It would surprise me if they aren't able to do the job. As for form validation, it is rather simple but limited. Best documentation source is the javadoc for it. There is a new validation package around XForms in 2.0.x-scratchpad and HEAD. I understand that some extensive docs have just arrived in HEAD. Anyway, if you ask some questions about any of these on this list, I'm sure you will get answers. Chris. -- C h r i s t i a n H a u l [EMAIL PROTECTED] fingerprint: 99B0 1D9D 7919 644A 4837 7D73 FEF9 6856 335A 9E08 - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat error, BeginnerQuestion
I am using Tomcat4.0.3. I have removed xerces and placed xalanXXX, xercesXXX and xml-apis.jar and change entries in web.xml and restarted the tomcat. I got following exception. I am using Cocoon2.0.2. Error starts here= type fatal message SAX2 driver class org.apache.xerces.parsers.SAXParser does not implement XMLReader description java.lang.ClassCastException: org.apache.xerces.parsers.StandardParserConfiguration sender org.apache.cocoon.servlet.CocoonServlet source Cocoon servlet stack-trace java.lang.ClassCastException: org.apache.xerces.parsers.StandardParserConfiguration at org.xml.sax.helpers.XMLReaderFactory.createXMLReader(Unknown Source) at org.xml.sax.helpers.XMLReaderFactory.createXMLReader(Unknown Source) at org.apache.cocoon.components.language.markup.AbstractMarkupLanguage.gene rateCode(AbstractMarkupLanguage.java:377) at org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.gen erateResource(ProgramGeneratorImpl.java:365) at org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.cre ateResource(ProgramGeneratorImpl.java:328) at org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.loa d(ProgramGeneratorImpl.java:291) at org.apache.cocoon.sitemap.Handler.run(Handler.java:270) at java.lang.Thread.run(Thread.java:484) request-uri /cocoon/ path-info ==error ends== - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: how do I redirect in an Action?
On 23.May.2002 -- 05:00 PM, Graaf, Edgar de (fin) wrote: Christopher, map:act... can't contain matchers, how else would cocoon know that the action should be run? Edgar, AFAIK this is not true. map:act can contain all other tags that are allowed within a pipeline. EDGAR - Okay prob. Then euh.. sorry Cristopher for misleading you. I have to adapt my program I guess. But I thought I copied the example provided by Cocoon. But still my example works (read on) Depending on the amount of pipeline fragments protected by the action it would be worthwhile to use a subsitemap, though. Another misconception in this thread seems to be that the tags after the action will always be processed. That is only true if it was determined that they are part of the actual pipeline. EDGAR - Agreed, because that is the whole concept my sollution is based upon. It works, that is for sure. Only maybe it is not the best sollution - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How can I use a different XSLT Processor?
Hi, Can someone tell me how I would use a different XSLT Processor? For example Saxon Regards Edgar - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: esql v1.22 multiple returned update counts and ResultSets
On 23.May.2002 -- 09:50 AM, neil wrote: I'll try your changes out sometime soon, but for now I'm still using my patch but with your switch statements added. I've added a default case to the switch: This allows you to reuse the same esql:update-results if you want to. Likewise for esql:results and esql:no-results. Its not difficult to work with and I think its an option worth having even though its not strictly necessary. OK, since noone objected, I have done so for HEAD. Just for the record, I've changed your suggestion in order to avoid scoping problems. switch (_esql_query.getResultCount()) { xsl:for-each select=esql:results case xsl:value-of select=position()/: xsl:if test=position()=last()xsl:text default: /xsl:text/xsl:ifxsl:apply-templates select=./ break; /xsl:for-each } Chris. -- C h r i s t i a n H a u l [EMAIL PROTECTED] fingerprint: 99B0 1D9D 7919 644A 4837 7D73 FEF9 6856 335A 9E08 - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How can I use a different XSLT Processor?
Although I was never totally successful with this, AFAIK this is what you need to do for Saxon in Cocoon 2.0.2: 1. Replace xalan-2.3.1 with saxon.jar. 2. Use v1.9 of xsp.xsl (http://cvs.apache.org/viewcvs.cgi/xml-cocoon2/src/java/org/apache/cocoo n/components/language/markup/xsp/java/xsp.xsl) 3. Start the servlet-engine with the additional switch -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFac toryImpl Be sure to clear out your cache directory before restarting. Steve -Original Message- From: Graaf, Edgar de (fin) [mailto:[EMAIL PROTECTED]] Sent: Friday, May 24, 2002 7:37 AM To: Cocoon-Users (E-mail) Subject: How can I use a different XSLT Processor? Hi, Can someone tell me how I would use a different XSLT Processor? For example Saxon Regards Edgar - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How to use pools
Hi List, How can I use pool settings for components? What is the background behind this? What settings for pool-grow, pool-max, pool-min make sense in different enviroments? CHeers, Michael - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: XSP Expression within XSL:for-each loop
Finally I found a solution, and it has nothing to do with Cocoon. The XSL fragment in my question is part of an XSL template, and is preceded by two statements loading two different xml files as a documents and querying for a value in them. Later, another template uses position() to mark the positions of gvs-list elements returned by the java method call and created the HTML for select list. I could make it work by using position() div number('2') instead of position() to do this indexing. If I load another document prior to uti-include-expr, I will have to change it to position() div number('3') to make it work, and so on. But I don't understand -why- this works. Can some one enlighten me? Sreedhar -Original Message- From: Sreedhar Chintalapaty [mailto:[EMAIL PROTECTED]] Sent: Monday, May 20, 2002 9:55 AM To: Cocoon Users Subject: XSP Expression within XSL:for-each loop Hi Gurus, I have a piece of code with the following for-each loop: xsl:for-each select=document('actions.xml')/actions/action xsl:variable name=target-class xsl:value-of select=@class/ /xsl:variable util:include-expr util:expr xsp:expr xsl:value-of select=$target-class/.getAll() /xsp:expr /util:expr /util:include-expr /xsl:for-each The intention is to determine the class name at run time and get all persistent objects of that class from the database. The reality is that the util:include-expr/util:include-expr part is using only the very first $target-class value, even though the $target-class value is different for different action elements. Of course, if I just print out the value of the variable target-class right before entering the util:include-expr/util:include-expr, it prints out all the different values, as it should. When I look into the generated class, here's what I find (assuming target class is Singer, and excluding fully qualified class names): 1. { 2. Parser newParser = null; 3. try { 4. newParser = (Parser) this.manager.lookup(Parser.ROLE); 5. InputSource __is = new InputSource(new StringReader(String.valueOf(Singer.getAll(; 6. XSPUtil.include(__is, this.contentHandler, newParser); 7. } catch (Exception e) { 8. getLogger().error(Could not include page, e); 9. } finally { 10. if (newParser != null) { 11. this.manager.release((Component) newParser); 12. } 13. } 14. } This code block is repeated for each value of $target-class, with the method call Singer.getAll replaced with the correct value of $target-class - i.e., if $target-class = {Singer, Actor, Producer), the block above is repeated thrice, with Singer.getAll(), Actor.getAll(), and Producer.getAll() as the method calls in line 5. That part is as it should be; but when I see the output, I actually see only the results of Singer.getAll() appearing thrice! Is the finally clause releasing the newParser in line 11 responsible for this? How can I get this to work right? Am I missing something in the way I am including the expression? Thanks, and Best Regards, Sreedhar - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Fw: XML Schema Components Infoset Model in Java by IBM is available on Partnerworld for Developers
FYI, Very interesting reading for those of you who asked about XML Schema API before. I know a few people wanted to create XML instances from Schema. Validation might be also improved with this. - Original Message - From: Bob Schloss [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, May 24, 2002 4:33 AM Subject: XML Schema Components Infoset Model in Java by IBM is available on Partnerworld for Developers There has been a lot of discussion (on various mailing lists) about the benefits of a standard API which would allow software that creates, examines or modify XML Schemas, written in Java, to do so in a way that represents the semantic XML schema components described in the W3C XML Schema specifications. In February, we shared with the W3C Schema and DOM working groups some thoughts about what such an API should try to do. You can see those 'requirements' described here: http://www.research.ibm.com/XML/schema/WD- XML-Schema-Infoset-API-Req.htm . I have been lucky to work with Ed Merks, part of the IBM Websphere Studio Application Developer (WSAD) development group, to define such an API and to produce a reference implementation. Although we have not yet completed every last function we have in mind to implement, nor have we done any performance tuning, this API has been used successfully in building several real XML and Web Services developer-time tools. We have tried to make a reasonable and straightforward Javadoc, and have been grateful to have Shane Curcuru, who has worked on the Apache Xalan team, give us some guidance on how to do this. We are aiming for an API which is very complete: not simply read-only, and able to handle any XML Schema, no matter how complex. We tried to use the terminology from the W3C's XML Schema specifications in naming our classes/interfaces, methods, and constants. We have now made this work, including source code, UML, example usage code and documentation, available publically for the wider community to examine and use. Donating a future version of this to some open source effort is possible, although I can't make a commitment on behalf of IBM at this time. Reaction and comments from the Apache community would strongly influence whether we do this. We encourage you to download our work. You can do so through IBM's Partnerworld for Developers web pages. https://www.developer.ibm.com/member/register/how2join.html - shows how you can get yourself an ID and password if you've never joined Partnerworld for Developers https://www.developer.ibm.com/websphere/member/workbench_beta_download.html - where you can find the XSD Feature, the name for the Schema Infoset Model (aka com.ibm.etools.xsd) Although I am posting this notice here, I recommend that all discussion about this, at least until the end of June, take place in a single venue. I recommend that questions and comments be posted to [EMAIL PROTECTED] . (The archive is: http://lists.w3.org/Archives/Public/xmlschema-dev/ . Instructions are here: http://www.w3.org/Mail/Request and here: http: //www.w3.org/Mail/Lists.html ). Note: I have posted this notice also to xerces-j-dev, xerces-j-user, and might post it to a few other xml and web services development lists. Bob Schloss XML/XSL Transformational Technologies IBM T.J. Watson Research Center - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Saxon and Cocoon
Hi, earlier I asked how I would use Saxon in Cocoon. It is very simple, delete Xalan and place Saxon in. Saxon 7 is really fast! I see the difference. My problem was that I didn't notice anything different, so I guessed I did something wrong. However I had a jar called j2ee.jar in my lib, it contained Xalan. If you also want to do this, the search the core.log for templatesHandler. If Saxon is there you did everything right - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
refactored samples all '404'
Hi, I'ved deployed the cocoon.war (2.0.2), but all the links on the 'refactored samples' page (http://localhost/cocoon/samples/welcome) bring up a '404 not found.' The main page says it's a 'work in progress', but the '404' for every link is suprising. (i.e. I would have expected the 'easy' examples to work.) Am I missing something? thanks, bill milbratz - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat error, BeginnerQuestion
Just curious. What did you change in the web.xml? And why did you remove xerces? What version of Xerces did you use? -Oorspronkelijk bericht- Van: Rajeev Singh [mailto:[EMAIL PROTECTED]] Verzonden: vrijdag 24 mei 2002 12:20 Aan: [EMAIL PROTECTED] Onderwerp: Tomcat error, BeginnerQuestion I am using Tomcat4.0.3. I have removed xerces and placed xalanXXX, xercesXXX and xml-apis.jar and change entries in web.xml and restarted the tomcat. I got following exception. I am using Cocoon2.0.2. Error starts here= type fatal message SAX2 driver class org.apache.xerces.parsers.SAXParser does not implement XMLReader description java.lang.ClassCastException: org.apache.xerces.parsers.StandardParserConfiguration sender org.apache.cocoon.servlet.CocoonServlet source Cocoon servlet stack-trace java.lang.ClassCastException: org.apache.xerces.parsers.StandardParserConfiguration at org.xml.sax.helpers.XMLReaderFactory.createXMLReader(Unknown Source) at org.xml.sax.helpers.XMLReaderFactory.createXMLReader(Unknown Source) at org.apache.cocoon.components.language.markup.AbstractMarkupLanguage.gene rateCode(AbstractMarkupLanguage.java:377) at org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.gen erateResource(ProgramGeneratorImpl.java:365) at org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.cre ateResource(ProgramGeneratorImpl.java:328) at org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.loa d(ProgramGeneratorImpl.java:291) at org.apache.cocoon.sitemap.Handler.run(Handler.java:270) at java.lang.Thread.run(Thread.java:484) request-uri /cocoon/ path-info ==error ends== - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat error, BeginnerQuestion
I had the same problem and it worked ok when I use xerces1.4 instead of version 2.Not sure if that apply to your case. Just curious. What did you change in the web.xml? And why did you remove xerces? What version of Xerces did you use? -Oorspronkelijk bericht- Van: Rajeev Singh [mailto:[EMAIL PROTECTED]] Verzonden: vrijdag 24 mei 2002 12:20 Aan: [EMAIL PROTECTED] Onderwerp: Tomcat error, BeginnerQuestion I am using Tomcat4.0.3. I have removed xerces and placed xalanXXX, xercesXXX and xml-apis.jar and change entries in web.xml and restarted the tomcat. I got following exception. I am using Cocoon2.0.2. Error starts here= type fatal message SAX2 driver class org.apache.xerces.parsers.SAXParser does not implement XMLReader description java.lang.ClassCastException: org.apache.xerces.parsers.StandardParserConfiguration sender org.apache.cocoon.servlet.CocoonServlet source Cocoon servlet stack-trace java.lang.ClassCastException: org.apache.xerces.parsers.StandardParserConfiguration at org.xml.sax.helpers.XMLReaderFactory.createXMLReader(Unknown Source) at org.xml.sax.helpers.XMLReaderFactory.createXMLReader(Unknown Source) at org.apache.cocoon.components.language.markup.AbstractMarkupLanguage.gene rateCode(AbstractMarkupLanguage.java:377) at org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.gen erateResource(ProgramGeneratorImpl.java:365) at org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.cre ateResource(ProgramGeneratorImpl.java:328) at org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.loa d(ProgramGeneratorImpl.java:291) at org.apache.cocoon.sitemap.Handler.run(Handler.java:270) at java.lang.Thread.run(Thread.java:484) request-uri /cocoon/ path-info ==error ends== - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Saxon and Cocoon
Edgar: Be aware that Saxon 7 is a partial implementation of XSLT/XPATH 2.0 and that Michael Kay indicates that for production 6.5.2 is the version to use. Carlos On 5/24/02 5:07 AM, Graaf, Edgar de (fin) [EMAIL PROTECTED] wrote: Hi, earlier I asked how I would use Saxon in Cocoon. It is very simple, delete Xalan and place Saxon in. Saxon 7 is really fast! I see the difference. My problem was that I didn't notice anything different, so I guessed I did something wrong. However I had a jar called j2ee.jar in my lib, it contained Xalan. If you also want to do this, the search the core.log for templatesHandler. If Saxon is there you did everything right - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Carlos E. Araya ---+ WebCT Administrator/Trainer P | California Virtual Campus - | C/O De Anza College G | 21250 Stevens Creek Blvd ---+ Cupertino, CA 95014 email [EMAIL PROTECTED] web http://www.cvc1.org/ (work) http://silverwolf-net.net (personal) phone 408 257 0420 (work) PGP Fingerprint:E629 5DFD 7EAE 4995 E9D7 3D2F 5A9F 0CE7 DFE7 1756 If there is artificial intelligence, doesn't that imply there is also artificial stupidity! - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
XSP Namespace Problem
Cocoon 2.0.1 SUN Solaris 7 BEA Weblogic 6.1 SP2 I've a Problem with a XSP Page, which includes data from a different Namespace: This is the XSP-Page: ?xml version=1.0 encoding=ISO-8859-1? xsp:page language=java xmlns:xsp=http://apache.org/xsp; xmlns:util=http://apache.org/xsp/util/2.0; xmlns:ino=http://namespaces.softwareag.com/tamino/response2; page xsp:logic String xmlDoc = (String)request.getAttribute(Result); /xsp:logic util:include-exprutil:exprxsp:exprxmlDoc/xsp:expr/util:expr/util: include-expr /page /xsp:page In the xmlDoc, there is something like myRecord ino:id=1... The message in the Cocoon Sitemap.log says, that the namespace 'ino' could not be found in the XSP. ExecuteThread: '11' for queue: 'default'/BiblioResult_xsp: Could not include page org.xml.sax.SAXParseException: The namespace prefix ino was not declared. at org.apache.cocoon.components.parser.JaxpParser.error(JaxpParser.java:274) I thought with the namespace declaration in the xsp:page ... tag, it should be solved, but it's not! The Data from the XSP-Page are later transformed with a stylesheet, there the namespace is also defined... Any idea??? - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Livesites - Self-Roster.com - Cocoon 2
Hi Folks, We provide the online way to plan and deliver rotas for shift workers. We let you and your staff decide who works when. Simply. http://www.self-roster.com/ Powered by Cocoon 2. Regards, Pete Hargreaves. - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: refactored samples all '404'
Hi Bill, I can be mistaken, but it might be possible you have to build the scratchpad also in order to view those refactored examples. hth, tomK Bill Milbratz wrote: Hi, I'ved deployed the cocoon.war (2.0.2), but all the links on the 'refactored samples' page (http://localhost/cocoon/samples/welcome) bring up a '404 not found.' The main page says it's a 'work in progress', but the '404' for every link is suprising. (i.e. I would have expected the 'easy' examples to work.) Am I missing something? thanks, bill milbratz - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: XSP Namespace Problem
On 24.May.2002 -- 07:45 PM, Peter, Reto wrote: I've a Problem with a XSP Page, which includes data from a different Namespace: util:include-exprutil:exprxsp:exprxmlDoc/xsp:expr/util:expr/util: include-expr In the xmlDoc, there is something like myRecord ino:id=1... The message in the Cocoon Sitemap.log says, that the namespace 'ino' could not be found in the XSP. The data is passed through a different parser that does not inherit the namespace declaration from your xsp. Your document must include a namespace declaration. But you can try to slip such declaration in right after the util:include-expr tag. No guarantees, though. Chris. -- C h r i s t i a n H a u l [EMAIL PROTECTED] fingerprint: 99B0 1D9D 7919 644A 4837 7D73 FEF9 6856 335A 9E08 - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: AW: Question: what is {session-id} ? in a sitemap.xmap ?
Thanks. Some of this is starting to become clearer. Unfortunately, it seems that the only way to learn Cocoon is to read the source code. That isn't going to cut it for much longer. It would be nice if there were a list of all of the similar variable types and their purposes and how to set them and use them. Perl becomes understandable (well ... a bit) when the different types of name are explained. unfortunately, it is not enough to set 'fred' as a session attribute, who would have to set it as a sitemap parameter just as Artur said. You can do this inside an action (actions return a java.util.Map and you can use the keys stored in it as sitemap parameters. I don't know if it is there in 2.0.1 but in 2.0.2 you can look in the docs under User Guide / Concepts / Actions and there at 'Communication between Sitemap and Action'. As Artur also pointed out you can call a resource with some parameters which you can then use as sitemap parameters inside the map:resource tag. - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Xinclude Problem
Hi! (I apologize, if this mail is sent twice. I sent it yesterday already, but so far it didn't seem to arrive in the mailing list.) In the Browser I get the following error statement: root cause java.lang.OutOfMemoryError Cocoon runs properly, if I remove all the xi:include (in the xml- and xslt- and xsp-files) Are the xi:include really the problem? Thanks Margrit - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]