RE: How to access sourceResolver in action configure() method
Charles, thank you for a tip, but this way I only get the root of the webapplication. (This produces the same result as something I was using: org.apache.cocoon.environment.SourceResolver env = org.apache.cocoon.components.CocoonComponentManager.getCurrentEnvironment(); path = env.resolve(myConfigFileName).getSystemId(); File file = new File(path); ) But I have my action in mounted sitemap and sourceResolver for mounted sitemap works in the context of the sitemap directory. If my mounted sitemap is located in 'subsitemap' directory and I use action within this sitemap, correct resolving of 'myconfig.xml' would be d:/jboss/server/default/deploy/webapp.war/subsitemap/myconfig.xml but via Context or Environment I only get my file resolved as d:/jboss/server/default/deploy/webapp.war/myconfig.xml - what is wrong. Do not you know any way how to get same environment object as that which is passed by SitemapManager to the act() method of any action located in mounted sitemap? Maybe I could get it from ComponentManager by some role? Thank you, Michal -Original Message- From: Charles Yates [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 27, 2003 7:32 PM To: [EMAIL PROTECTED] Subject: Re: How to access sourceResolver in action configure() method Can you put the configuration stuff into cocoon.xconf? Then it would be available in configure(). If not you could implement Contextualizable and get the HttpContext like this: public void contextualize(Context aContext) throws ContextException { myContext = (HttpContext) aContext.get(Constants.CONTEXT_ENVIRONMENT_CONTEXT); } then you could get the file like this: myConfigFile = new File(myContext.getRealPath(myConfigFileName)); Charles (this works in 2.1, should in 2.0.4, though maybe minor differences) DURDINA Michal wrote: Hello! I am using own ConfigurableComposerAction and I have problem with loading configuration from external file (from filesystem). In act() method, I would use SourceResolver parameter passed to this method, but in configure() method I do not know where should I get the source resolver from. I am using Cocoon 2.0.4 with compiled sitemap, thus I cannot use this: public void compose(ComponentManager manager) throws ComponentException { this.manager = manager; this.resolver = (SourceResolver)manager.lookup(SourceResolver.ROLE); } Thank you for your help, Michal - 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] __ Informacia od NOD32 1.415 (20030521) __ Tato sprava bola preverena systemom NOD32 pre Exchange. http://www.eset.sk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How to access sourceResolver in action configure() method
Hello! I am using own ConfigurableComposerAction and I have problem with loading configuration from external file (from filesystem). In act() method, I would use SourceResolver parameter passed to this method, but in configure() method I do not know where should I get the source resolver from. I am using Cocoon 2.0.4 with compiled sitemap, thus I cannot use this: public void compose(ComponentManager manager) throws ComponentException { this.manager = manager; this.resolver = (SourceResolver)manager.lookup(SourceResolver.ROLE); } Thank you for your help, Michal - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Source aggregation by XInclude
Hello, now I'm using CachingCIncludeTransformer, but sometimes I encounter caching problems and hence unwanted recompilation to Java classes in some cases. In my test case I have 2 serverpages with 2 variations and following resulst under Cocoon 2.0.3 and Cocoon 2.0.4 (changed hash keys): http://durdina/ebanking/main/main.xml - cached under 2.0.3, always recompiled under 2.0.4 http://durdina/ebanking/banks2/banks.xml - cached under 2.0.3, always recompiled under 2.0.4 and same pages copied to opposite directories http://durdina/ebanking/main/banks.xml - cached under 2.0.3, always recompiled under 2.0.4 http://durdina/ebanking/banks2/main.xml - always recompiled under 2.0.3, cached under 2.0.4 According to logs, xml_source (from */*.source pipeline) objects are always cached, but serverpagers generator which uses cocoon:/ protocol loads compiled Java classes from cache only and only if they satisfy some specific name condition (URL). For examle it helped me to rename banks2/main.xml file to banks2/bmain.xml to initiate caching of the same compiled source (org.apache.cocoon.www.cocoon_._.banks2.main_source) instead of throwing it away and recompiling the page on every request basically to get the same class :). Is this known caching issue, or do you have any other solution for me? Thanks for help, Michal map:pipelines map:pipeline !-- Source aggregation -- map:match pattern=*/*.source map:generate type=file src={1}/{2}.xml/ map:transform type=xslt-saxon src=xinclude/x2cinclude.xsl/ map:transform type=cinclude/ map:serialize type=xml/ /map:match !-- Serverpages -- map:match pattern=**.xml map:act type=xsp-action src=actions/check-session-action.xsp map:match pattern=main/*.xml map:generate type=serverpages src=cocoon:/main/{1}.source/ map:transform type=xslt-saxon src=main/{1}.xsl/ map:serialize type=html/ /map:match !-- Informacie -- map:match pattern=banks2/*.xml map:generate type=serverpages src=cocoon:/banks2/{1}.source/ map:transform type=xslt-saxon src=banks2/{1}.xsl/ map:serialize type=html/ /map:match /map:act map:redirect-to uri=fu.htmll/ /map:match /map:pipeline /map:pipelines -Original Message- From: Timothy Larson [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 18, 2002 2:48 PM To: [EMAIL PROTECTED] Subject: RE: Source aggregation by XInclude You coulde try the caching version of the cinclude transformer in place of the non-caching xinclude transformer. See http://xml.apache.org/cocoon/userdocs/transformers/cinclude-tr ansformer.html The only problem I see is that the cinclude transformer does not seem to have the xpath features that the xinclude transformer has. Tim [EMAIL PROTECTED] 12/18/02 07:16AM Thank you, but now my xsp pages get recompiled to Java every time. Probably it is the issue of xinclude. Can anyone help me how to tell cocoon not to recompile some_page.xsp every time I acces the page? Does it exist any explicit mechanism how to cache the output of the pipeline? I am using this xsp preprocesing pipeline: map:match pattern=some_page.xsp map:generate src=some_file.xml/ map:transform type=xinclude/ map:serialize type=xml/ /map:match map:match pattern=some_page.html map:generate src=cocoon:/some_page.xsp type=serverpages/ map:transform src=some_other_stylesheet.xsl/ map:serialize type=xml/ /map:match Cocoon 2.0.3. Thanks for help. Michal - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Informacia od NOD32 1.337 (20021217) __ Tato sprava bola preverena systemom NOD32 pre Exchange. http://www.eset.sk - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Source aggregation by XInclude
Thank you, but now my xsp pages get recompiled to Java every time. Probably it is the issue of xinclude. Can anyone help me how to tell cocoon not to recompile some_page.xsp every time I acces the page? Does it exist any explicit mechanism how to cache the output of the pipeline? I am using this xsp preprocesing pipeline: map:match pattern=some_page.xsp map:generate src=some_file.xml/ map:transform type=xinclude/ map:serialize type=xml/ /map:match map:match pattern=some_page.html map:generate src=cocoon:/some_page.xsp type=serverpages/ map:transform src=some_other_stylesheet.xsl/ map:serialize type=xml/ /map:match Cocoon 2.0.3. Thanks for help. Michal -Original Message- From: Timothy Larson [mailto:[EMAIL PROTECTED]] Sent: Monday, December 16, 2002 5:18 PM To: [EMAIL PROTECTED] Subject: Re: Source aggregation by XInclude You can use the cocoon:/ protocol to do this: map:match pattern=some_page.xsp map:generate src=some_file.xml/ map:transform src=some_stylesheet.xsl/ map:serialize type=xml/ /map:match map:match pattern=some_page.html map:generate src=cocoon:/some_page.xsp type=serverpages/ map:transform src=some_other_stylesheet.xsl/ map:serialize type=xml/ /map:match You may run into problems with the java code generated from the XSP not always updating immediately when you make changes to the XSP page. It seems like the timestamp only has one minute resolution. YMMV. Tim [EMAIL PROTECTED] 12/16/02 10:57AM Hello, In Cocoon 1.8 we used xinclude for aggregation of our xsp sources. Now in C2, xsp is generator and xinclude is transformer, therefore xinclude cannot precede xsp to prepare sources for it. Is there any working technique how to compose sources for xsp generator from more than one file? Michal -- MisoD -- Michal Durdina - [EMAIL PROTECTED] ASSET Soft a.s., Kosicka 56, Bratislava, 821 08 Slovakia, Europe - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.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/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Informacia od NOD32 1.335 (20021211) __ Tato sprava bola preverena systemom NOD32 pre Exchange. http://www.eset.sk - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: HowTo Cocoon pages
Mohamed, Your problem is too general. Anyway, try to copy generated war file (after Build) to Tomcat webapps directory and run Tomcat without JBuilder. Don't forget to include required libraries to WEB-INF\lib directory for generated war file (all jars from cocoon/lib). Your problem looks like some required libraries are not on Java classpath (or in WEB-INF/lib) OR some of required Cocoon configuration files are missing (cocoon.xconf). Try to check it and next time try to submit what kind of exception occured. With regards, Mike -Original Message- From: Mohamed El-Refaey [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 07, 2002 5:23 PM To: [EMAIL PROTECTED] Subject: Re: HowTo Cocoon pages Hi I just try to configure and run the example of cocoon2 and tomcat 4 u made on JBuilder 5 and followed all the configuration instruction u put in the project and it rais an internal server error. I wish u tell me how to solve this problem. Thanx Mohamed - Original Message - From: DURDINA Michal [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, February 06, 2002 4:42 PM Subject: HowTo Cocoon pages Hello Cocoon users, I have just completed few tutorial pages along with examples about developing applications in Cocoon2. The location is http://durdo.miesto.sk/Cocoon2HowTo/index.html. At the time these pages consist of only 3 articles: * Subsitemap - creating the empty project before you move on * Data connection - connecting to DBMS, generating XML document with data from database * JBuilder for Cocoon developing - overview of JBuilder in scope of Cocoon2 developing, settings, hints, web application example These articles evolved with time, the last one is most comprehensive and contains working example of simple Cocoon2 web application. Tech info: All docs are written using Apache Documentation DTD and can be easily integrated to greater documentation. If anybody has similar pages we can merge or has better repository (domain) for these pages, please contact me. With regards, -- MisoD -- Michal Durdina - [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] __ Informacia od NOD32 1.209 (20020130) __ Tato sprava bola preverena systemom NOD32 pre Exchange. http://www.nod32.com - 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: HowTo Cocoon pages
XSLT is quite complex but not hard to learn if you are programmer (maybe LISP or Prolog programmer :). I have a book XSLT Programmer's Reference from Michael Kay (Saxon author) with 900pages of great text. But you can find many tutorials on web i.e. (I used all of them and are good) http://www.xml101.com/xsl/default.asp http://www.zvon.org/xxl/XSLTutorial/Output/contents.html http://www.w3schools.com/xsl/default.asp XSLT (or XSL if you want) is fundamental language to know when working with XML in Cocoon (it is not only about stylesheets). With regards, -- MisoD -- Michal Durdina - [EMAIL PROTECTED] -Original Message- From: Adrian 'Dagurashibanipal' von Bidder [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 06, 2002 9:46 PM To: [EMAIL PROTECTED] Subject: Re: HowTo Cocoon pages On Tue, 2001-02-06 at 16:00, Andreas Hartmann wrote: http://www.cocooncenter.de/cocooncenter/tutorials/navigation/tutorial.html Wow! Phew! Last week I finally started to do something about a new look for my website (better: any look at all - fortytwo.ch is not what you'd call nice right now :-) I looked at fastcgi (discarded because I'm programming enough C on my day job already) and axKit (don't really like perl, though) and have now decided to start with cocoon2. Looking at the example tells me that you can do everything with it - but what was missing was a cute little example for somebody who doen't know more about xslt than that it's about XML. So a big thank you there! -- vbi - 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] __ Informacia od NOD32 1.209 (20020130) __ Tato sprava bola preverena systemom NOD32 pre Exchange. http://www.nod32.com - 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]
HowTo Cocoon pages
Hello Cocoon users, I have just completed few tutorial pages along with examples about developing applications in Cocoon2. The location is http://durdo.miesto.sk/Cocoon2HowTo/index.html. At the time these pages consist of only 3 articles: * Subsitemap - creating the empty project before you move on * Data connection - connecting to DBMS, generating XML document with data from database * JBuilder for Cocoon developing - overview of JBuilder in scope of Cocoon2 developing, settings, hints, web application example These articles evolved with time, the last one is most comprehensive and contains working example of simple Cocoon2 web application. Tech info: All docs are written using Apache Documentation DTD and can be easily integrated to greater documentation. If anybody has similar pages we can merge or has better repository (domain) for these pages, please contact me. With regards, -- MisoD -- Michal Durdina - [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 without stylesheet
Try this... map:match pattern=valid.xml map:generate type=serverpages src=valid.xsp/ map:serialize type=xml/ /map:match -Original Message- From: Dwayne Kemp [mailto:[EMAIL PROTECTED]] Sent: Monday, December 17, 2001 9:56 PM To: [EMAIL PROTECTED] Subject: xsp without stylesheet I have an xsp page that i am using for verification and page redirect. Could any one tell me how to set this up in the sitemap.xmap file. I have this map:match pattern=valid.xml map:generate type=serverpages src=valid.xsp/ /map:match and the browser throws file contained no data. //| Dwayne A. Kemp | | [EMAIL PROTECTED] if the gospel be hid it is hid | //| 732 932 3938// to those that are lost | | Programmer /// | ___| - 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] __ Informacia od NOD32 1.130 (20011207) __ Tato sprava bola preverena systemom NOD32 pre Exchange. http://www.nod32.com - 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]