Re: xsp:include in logicsheets
Hi, the xsp:structure/ tag must be a child of the root xsp:page/, and not included inside an xsl:template/, as you have indicated below. Hope this helps, Adrian - Original Message - From: Ratty [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, November 26, 2001 2:07 PM Subject: xsp:include in logicsheets In my logicsheet i must use java.uitl.Calendar in import. How i can include it in basic xsp, from which my logicsheet called? do i must write something like this in logicsheet: xsl:template match =ratty:xxx xsp:page xsp:structure xsp:includejava.util.Calendar/xsp:include /xsp:structure page .../page /xsp:page /xsl:template ? when i tried it i give me error - something like ; expected! in generated code i see import java.util.Calendar inside my xsp generated class - as i unterstood its wrong Please help me!! - 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: Look-and-feel approach with views
On 26.Nov.2001 -- 06:20 PM, Alexander Smirnoff wrote: OK. Then how could I implement dynamically look-and-feel based on user credentials (customer-id, user_id) ? I see only one possible way: inserting action for each XSL transformation in each pipeline... That approach makes sitemap look even more ugly... It depends a bit on how complex the differences for each user are. You might get away with map:transform src=resource:/styles/look+feel/{user_credentials}/ in every subpipeline. Or, if there are many subpipelines, you could create a resource that does the styling (and serializing) and map:redirect-to resource=look+feel/ or, for more complex stylings even map:redirect-to resource=look+feel/{user_credentials}/ in every pipeline where it's applicable. In addition, you could use selectors to chose between different look+feels based on some user parameter. 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]
Re: Look-and-feel approach with views
I suggest that there is an easier approach to solve your lookfeel issue. Assuming that the LF is supported by means of some transformation, then why not use the following sitemap construct: map:pipeline map:match pattern=xslt/look_feel.xsl map:action get-user-l_f map:read src=xslt/skins/{look-n-feel}.xsl /map:action map:read src=xslt/default_l_f.xsl/ /map:match map:match pattern=* map:generate src={1}/ map:transform src=cocoon:/xslt/look_feel.xsl/ map:serialize/ /map:match /map:pipeline That way, look and feel is handled in a single location and there is no need to extend the sitemap language. Hope this helps, Adrian (I haven't tested the above, but I want to illustrate the idea) - Original Message - From: Alexander Smirnoff [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, November 26, 2001 11:20 PM Subject: Re: Look-and-feel approach with views OK. Then how could I implement dynamically look-and-feel based on user credentials (customer-id, user_id) ? I see only one possible way: inserting action for each XSL transformation in each pipeline... That approach makes sitemap look even more ugly... Comments are follows, Alex. - Original Message - From: giacomo [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, November 26, 2001 5:50 PM Subject: Re: Look-and-feel approach with views On Mon, 26 Nov 2001, Alexander Smirnoff wrote: OK. I've got it. Well, is it possible to trigger the view from inside sitemap? What about Passing parameters? I think the idea of breaking pipeline and continuing it from another resource-like pipeline (view) from labeled predefined point is very powerful. Imagine having the same long chain of transformations through group or even all of pipelines in the sitemap! From my point of view it makes sitemap more unreadable. From the other side, if you have some resource-like view which could be processed from any pipeline and being returned to the point of entry will make readability of sitemap more easy... Something like that: !-- declaration -- map:chain name=look-feel !-- action get-user-skin :-) defines path to the source of the skin -- map:act type=get-user-skin map:transform src={srcpath}/{src}/ /map:act map:transform src=default/{src}/ /map:chain !-- from pipline -- map:match pattern=... map:generate src=welcome.xml/ map:call-chain name=look-feel map:parameter name=src value=welcome.xsl/ /map:call-chain map:serialize/ /map:match This is just a random thought. Sorry for being naive if this is the case...Probably there are some workaround which I don't know, - I'll be glad to comprehend. I can't see what your approach is good for. Views aren't made for skinning. They are for producing view in the sense of schema, meta data, links etc. but not for green or red. If you like to use it that way, yes, your sitemap might look ugly then. So what would be more elegant approach ? Use actions in each transformation point in sitemap? Your proposed enhancement is only giving another programmers view into the sitemap which isn't what we initially wanted and is what we like to get fixed in the future. The only proposition I made is to manipulate sitemap in orthogonal fashion like views do. Why not? I do understand... What are the tradeoffs? Giacomo Thanks, Alex. - Original Message - From: giacomo [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, November 26, 2001 2:46 PM Subject: Re: Look-and-feel approach with views On Mon, 26 Nov 2001, Alexander Smirnoff wrote: I'm using 2.0rc1, but even if I put label=xsltran into generator... declaration this doesnt work either... I feel that I misundersatnd the concept. It seems, for example, in webapp sitemap.xconf (in HEAD branch) the view declaration like: map:view name=links from-position=last map:serialize type=links/ /map:view never executes... Otherwise it supposed to be executed for every pipline after last component in pipline... So I'm really confused... If you don't request that view it will never be executed :) use a http://localhost:8080/cocoon/welcome?cocoon-view=links and you'll get all the links in the welcome page as response. Giacomo Thanks, Alex. On Fri, 23 Nov 2001, Alexander Smirnoff wrote: Hi everyone, I'm trying to use Views for setting look and feel based on specific user logged on the web site. So far I cannot even make very basic view working: map:views map:view from-label=xsltran name=xsltran map:transform src=stylesheets/xsl/welcome.xsl/
cocoon path outside cocoon's dir
i have install apache cocoon2 and tomcat4 my web site warks when i puut all files into /cocoon/docs/samples/myDir/ but i want to have my website files into /home/myDir/ i have try this: map:generate src=docs/samples/myDir/{1}.xml/ and work fine but when i try to modify this line to this one map:generate src=/home/myDir/{1].xml/ i recieve errors i think that i can not point to files outside cocoon's path is this true how can i have my site files into a directory in /home/? thanks kounis stavros - 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: cocoon path outside cocoon's dir
i think that i can not point to files outside cocoon's path I bet you can... just look at the FAQ entry called How could I have my Cocoon app in an URI other than you-server/cocoon/my-app?. Best regards, - Luca Morandini GIS Consultant [EMAIL PROTECTED] http://utenti.tripod.it/lmorandini/index.html - -Original Message- From: Cocoon User [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 27, 2001 10:28 AM To: [EMAIL PROTECTED] Subject: cocoon path outside cocoon's dir i have install apache cocoon2 and tomcat4 my web site warks when i puut all files into /cocoon/docs/samples/myDir/ but i want to have my website files into /home/myDir/ i have try this: map:generate src=docs/samples/myDir/{1}.xml/ and work fine but when i try to modify this line to this one map:generate src=/home/myDir/{1].xml/ i recieve errors i think that i can not point to files outside cocoon's path is this true how can i have my site files into a directory in /home/? thanks kounis stavros - 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: cocoon path outside cocoon's dir
Cocoon User wrote: i have install apache cocoon2 and tomcat4 my web site warks when i puut all files into /cocoon/docs/samples/myDir/ but i want to have my website files into /home/myDir/ i have try this: map:generate src=docs/samples/myDir/{1}.xml/ and work fine but when i try to modify this line to this one map:generate src=/home/myDir/{1].xml/ i recieve errors i think that i can not point to files outside cocoon's path is this true how can i have my site files into a directory in /home/? thanks kounis stavros I have a construction where docs/samples/myDir is a symlink (I'm running Linux) to /home/myDir. In the sitemap I have something like: map:generate src=docs/samples/myDir/{1}.xml/ That works for me. If this is not desirable or possible, i.e. because you're running another os, the problem you mentioned could be caused by file read permissions being too strict. In my installation Tomcat is run as user www-data and subsequently Cocoon is also running with that userid. Thus when Cocoon needs to read some file, the file has to be readable for user www-data (in my case) or for everyone. Hope this helpes Martijn Bouterse - 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]
Encoding
Hi, i am testing the employee example, which is contained with C2 distribution and accessible under http://localhost:8080/cocoon/forms/employee. When trying to add an employee with special chararters like aumlaut they aren't stored correctly in the database. Does anyone know how to avoid this ?? Max - 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]
Get a xml file from a query
Hi, I've a question: Now I've made a xml query in a database msql (with sql params), the queries are in a xml file, but I would to get another xml file with the results of the queries. That's possible? How can I do this ? Thanks FerranDo You Yahoo!? Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
[c2] How to stop on generation errors ?
Hi, Probably a newbie question. I'm using cocoon2 to generate documentation for my project. I run the generation as part of my Ant build. At the moment, if there is an error in any xml file, the build does not stop. Errors are reported in a log file and in the generated page. I'd like to know how to tell cocoon to exit upon error so that the Ant build see the error and exit itself. Thanks a lot -Vincent - 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: no html output after html rendering
Hi Nick thanks for your help! Unfortunately, when I say: extension-element-prefixes=xalan instead of: extension-element-prefixes=redirect I get Parser errors,with redirect it seems to work, but no index.html Any more ideas? It seems that nobody uses Cocoon with junitreport (frames) or Norman Walshs stylesheets for Docbook or Slides (others then the plain ones). Would be great! erik stunkat -Original Message- From: Nick Entin [mailto:[EMAIL PROTECTED]] Sent: Friday, November 23, 2001 11:57 AM To: [EMAIL PROTECTED] Subject: RE: no html output after html rendering Hi Eric, I might be wrong, but in my understanding transform is just convert incoming SAX events to outgoing SAX events. If your transformer writes something on disk - it has no impact on serializer afterwards. You might have generated plain-text or picture and only serializer knows what to do with the data. But how serializer could know where you outputed the results of xslt? Nowhere... I would do it another way: - you leave output declaration for the stylesheet default (put results to usual output stream), - you modify your stylesheet to generate _additional_ file (multiple output files feature). For xalan it could be: xsl:stylesheet version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform; xmlns:xalan=org.apache.xalan.lib.Redirect extension-element-prefixes=xalan xsl:template match=/ xalan:write select=docs/samples/ess/index.html ... Whatever you put to the index.html... /xalan:write !-- And here you make redirection to just generated page! - html meta http-equiv=refresh content=3; url=docs/samples/junit/index.html/ /html /xsl:template ... So this way, you actually generate two htmls - one for pipeline and serializer, another with your data... ATTENTION: in XSLT paths to files could be different than URLs!!! Thus write will use relative path from the current directory, which seems to be bin directory of tomcat (if you use tomcat), when URLs - are related to the current context. In my situation I should do xalan:write select=../webapps/cocoon/docs/samples/ess/index.html and meta http-equiv=refresh content=3; url=docs/samples/junit/index.html/ If current context is root of cocoon (host:port/cocoon). Best wishes, Nick -Original Message- From: Erik Stunkat [mailto:[EMAIL PROTECTED]] Sent: Friday, November 23, 2001 11:30 AM To: [EMAIL PROTECTED] Subject: RE: no html output after html rendering Hi Nick thanks for your answer, I tried xsl:output method=html encoding=ISO-8859-1 indent=no meta http-equiv=refresh content=3 url=docs/samples/ess/index.html/ but Cocoon shows nothing, no error, just a blank page sitemap: map:match pattern=esschunk2.html map:generate src=docs/samples/ess/ess31.xml/ map:transform src=stylesheets/docbook/html/chunk.xsl/ map:serialize type=html/ /map:match or I tried this one: map:match pattern=docs/samples/ess/index.html map:generate src=docs/samples/ess/ess31.xml/ map:transform type=xslt src=stylesheets/docbook/html/chunk.xsl/ map:serialize type=html/ /map:match the chunk.xsl give me multiple html files, starts with index.html and cocoon seems to convert everything fine but doesn´t find index.html (start page). Instead is always a blank page thanks for any answers/ideas erik -Original Message- From: Nick Entin [mailto:[EMAIL PROTECTED]] Sent: Friday, November 09, 2001 6:00 PM To: [EMAIL PROTECTED] Subject: RE: no html output after html rendering Hi Eric, I was in battle with the same problem last days. I presume junit-frames.xsl creates index.html, but produces no output to the default destination, is that correct? You may find answer on your question in sitemap.java, generated for your sitemap.xmap. Also I'd recommend you to take a look how the java is generating: cocoon_home\src\org\apache\cocoon\components\language\markup \sitemap\j ava\sitemap.xsl You could find many interesting things there. Serialize - is the last action in match: ... !-- generate the code to invoke a serializer -- xsl:template match=map:serialize xsl:call-template name=setup-component xsl:with-param name=default-component select=/map:sitemap/map:components/map:serializers/@default/ xsl:with-param name=methodpipeline.setSerializer/xsl:with-param xsl:with-param name=prefixserializer/xsl:with-param xsl:with-param name=mime-type select=@mime-type/ /xsl:call-template !-- if there is a status-code attribute tell it to the environment -- xsl:if test=@status-code environment.setStatus(xsl:value-of select=@status-code/); /xsl:if xsl:if test=not(ancestor::map:pipeline[@internal-only='yes' or @internal-only='true']) if (!internalRequest) { return pipeline.process(environment); } /xsl:if !-- the if(true) prevents
Cocoon cookie class and javax cookie class compile issue
My project compiles just fine in J++, but when I try things in Jakarta Ant, I get the following: [javac] file javax\servlet\http\Cookie.class not found [javac] response.addCookie(new org.apache.cocoon.environment.http.HttpCookie(CMSUSER, session.getId())); [javac] Looking up in the javadoc, I see that Cocooon's cookie class does not seem to refer to the javax.servlet.http.Cookie class at all. Could anybody shed any light on why this will compile in J++ and not in Ant? What exactly am I missing from my classpath? Thanks all... Liam Morley - 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]
xsl:output
I realise xsl:output was disabled for various reasons in C1. Does it work in C2? Thanks Sharat Koya
Re: including xml dynamically from a string
Someone else had this same problem recently. Use util:include-expr. It will parse the text that you pass in to it, and generate SAX calls from it (as opposed to writing the text straight to the output - after escaping all the control chars - like it's doing now). 1) Include the namespace xmlns:util=http://apache.org/xsp/util/2.0; in your XSP or the util:include-expr won't get called properly. 2) the call you need to make this work: util:include-exprutil:exprxsp:exprxml/xsp:expr/util:expr/util:include-expr xsp:exprxml/xsp:expr takes the value of String xml, which is then passed in to util:include-expr. DR At 09:47 AM 11/27/01 +0530, you wrote: Hi, Can any one help me in doing this. I get a piece of XML data as a request attribute forwarded from a servlet. In my xsp page i have to attach that. here is the code snippet page body headingdynamic/heading xsp:logic String xml = (String)request.getAttribute(xml); ( This will return a XML format string like folders folderInbox/folder folderBulk Mail/folder /folders ) // what should i do here ?? /xsp:logic /body /page so that the xml which goes to the xslt processes from xsp processor should look like this. page body center headingdynamic/heading folders folderInbox/folder folderBulk Mail/folder /folders /body /page It happens some time that the string i get from request attribute can even have a different structure also . I need a generic sort of implementation to do this. I tried the code below which will add some tree to the xml but i need to populate that reading from the string. ?xml version=1.0? ?cocoon-process type=xsp? ?cocoon-process type=xslt? ?xml-stylesheet href=xsl/dynamic-to-html.xsl type=text/xsl ? xsp:page language=java xmlns:xsp=http://www.apache.org/1999/XSP/Corehttp://www.apache.org/1999/XSP/Core; xmlns:request=http://www.apache.org/1999/XSP/Requesthttp://www.apache.org/1999/XSP/Request; xmlns:util=http://www.apache.org/1999/XSP/Utilhttp://www.apache.org/1999/XSP/Util; create-session=true page body center headingdynamic/heading xsp:logic String xml = (String)request.getAttribute(xml); ( This willreturn a XML format string like folders folderInbox/folder folderBulk Mail/folder /folders ) xspParentNode = xspCurrentNode; xspNodeStack.push(xspParentNode); xspCurrentNode =document.createElement(folders); xspParentNode.appendChild(xspCurrentNode); xspParentNode = xspCurrentNode; xspNodeStack.push(xspParentNode); xspCurrentNode = document.createElement(folder); xspParentNode.appendChild(xspCurrentNode); xspCurrentNode.appendChild(document.createTextNode(Inbox)); xspCurrentNode = document.createElement(folder); xspParentNode.appendChild(xspCurrentNode); xspCurrentNode.appendChild(document.createTextNode(Outbox)); /xsp:logic /center /body /page /xsp:page can any one please help me Thanks in advance regards, Arun.N - 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: [c2] How to stop on generation errors ?
I'd suggest using Xalan directly for this instead of Cocoon then. Ant has a style action, which is used to call an XSLT transformer (usually Xalan). The style action works properly with Ant and does what you want (i.e., terminating the build if an error occurs). I use this in my project to generate static XML at compile time. I only use Cocoon to generate dynamic pages in response to user requests. You can look in the Ant docs for details about the style action, but to get you started, my build.xml uses it like this: style style=${style}.xsl in=${in}.xml out=${out} Email if you need more info. HTH. DR At 01:43 PM 11/27/01 +, you wrote: Hi, Probably a newbie question. I'm using cocoon2 to generate documentation for my project. I run the generation as part of my Ant build. At the moment, if there is an error in any xml file, the build does not stop. Errors are reported in a log file and in the generated page. I'd like to know how to tell cocoon to exit upon error so that the Ant build see the error and exit itself. Thanks a lot -Vincent - 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: Cocoon or Tomcat with Servlets/Taglibs?
Interesting question... basically I agree with you... Cocoon is *just* a framework, so its task is to give you one (or more) way to do things. It oblige you and force to use a strong structure (sitemap, Generators, transformers)... Everything you do with cocoon can be done by servlets... but remember that even servlets are a evolution of old cgi-bins written in perl/C... There are a lots of reasons that can make you prefer XML to HTML, Java to C... Cocoon to self-made-stuff! I think the most important are always the same: speed of development, separation of logic from content, a STANDARD way. an many more reasons. Anyway, I hope Cocoon become soon a more widely supported standard. I belive that soon there will be a lot of new configuration tools and a better documentation. - Tomás. - Original Message - From: Heath Stewart [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 27, 2001 6:05 PM Subject: Cocoon or Tomcat with Servlets/Taglibs? I'm trying to decide whether or not to use Cocoon or just Tomcat (via mod_webapp with Apache/SSL) with Servlets, JSP, and Taglibs. What does this list think? I've done stuff with Cocoon, but frankly, it's more complicated to map servlets and tag libs which I would use extensively in my site, not to mention it's easy to build an entire site based on Tomcat with Forte for Java, since it's all built in. I can also create taglibs and have an xml tag or something that I would then use Xerces and Xalan to transform the source XML and XSL files, maybe even the FOP library for some kind of print servlet. Isn't that basically what Cocoon is doing with the sitemap, just mapping requests for files (like **.html to **.xml) to a Java class(es) using Xerces and Xalan to transform the source? Heath Stewart Network Administrator / Web Developer College of Veterinary Medicine Iowa State University http://www.vetmed.iastate.edu - 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: Cocoon or Tomcat with Servlets/Taglibs?
I guess another way to look at it is: what is cocoon well suited for, and what is it less well suited for? From that perspective, you might want to use cocoon if: * you need to serve the same content, but on different devices. Cocoon is good at dynamically generating the presentation you need. * your content is already very heavily xml * you believe very strongly in the cocoon philosophy of separation of content, logic, and presentation (or want to move away from JSP because of its lack of that separation) You might not want to use cocoon if: * Your pages are developed by page designers using a templating system * You prefer a non-XML solution like JSP or Struts etc. HTH. DR At 06:26 PM 11/27/01 +0100, you wrote: Interesting question... basically I agree with you... Cocoon is *just* a framework, so its task is to give you one (or more) way to do things. It oblige you and force to use a strong structure (sitemap, Generators, transformers)... Everything you do with cocoon can be done by servlets... but remember that even servlets are a evolution of old cgi-bins written in perl/C... There are a lots of reasons that can make you prefer XML to HTML, Java to C... Cocoon to self-made-stuff! I think the most important are always the same: speed of development, separation of logic from content, a STANDARD way. an many more reasons. Anyway, I hope Cocoon become soon a more widely supported standard. I belive that soon there will be a lot of new configuration tools and a better documentation. - Tomás. - Original Message - From: Heath Stewart [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 27, 2001 6:05 PM Subject: Cocoon or Tomcat with Servlets/Taglibs? I'm trying to decide whether or not to use Cocoon or just Tomcat (via mod_webapp with Apache/SSL) with Servlets, JSP, and Taglibs. What does this list think? I've done stuff with Cocoon, but frankly, it's more complicated to map servlets and tag libs which I would use extensively in my site, not to mention it's easy to build an entire site based on Tomcat with Forte for Java, since it's all built in. I can also create taglibs and have an xml tag or something that I would then use Xerces and Xalan to transform the source XML and XSL files, maybe even the FOP library for some kind of print servlet. Isn't that basically what Cocoon is doing with the sitemap, just mapping requests for files (like **.html to **.xml) to a Java class(es) using Xerces and Xalan to transform the source? Heath Stewart Network Administrator / Web Developer College of Veterinary Medicine Iowa State University http://www.vetmed.iastate.edu - 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: Look-and-feel approach with views
Thanks Cris for suggestion. On 26.Nov.2001 -- 06:20 PM, Alexander Smirnoff wrote: OK. Then how could I implement dynamically look-and-feel based on user credentials (customer-id, user_id) ? I see only one possible way: inserting action for each XSL transformation in each pipeline... That approach makes sitemap look even more ugly... It depends a bit on how complex the differences for each user are. You might get away with map:transform src=resource:/styles/look+feel/{user_credentials}/ With this kind of redirection is throwing an exception while connecting Piplines (Cocoon 2.1 cvs HEAD branch): Original exception : java.lang.RuntimeException: Problem in getTransformer:Error in creating Transform Handler at org.apache.cocoon.transformation.TraxTransformer.setConsumer(TraxTransformer .java:279) at org.apache.cocoon.components.pipeline.AbstractEventPipeline.connectPipeline( AbstractEventPipeline.java:216) at org.apache.cocoon.components.pipeline.AbstractEventPipeline.process(Abstract EventPipeline.java:106) at org.apache.cocoon.components.pipeline.AbstractStreamPipeline.process(Abstrac tStreamPipeline.java:140) at org.apache.cocoon.www.file_.C_.java.tomcat.webapps.gwvas.WEB_INF.conf.sitema p_xmap.wildcardMatchN400065(sitemap_xmap.java:782) This type of exception gave me a wrongful impression that you cannot break the pipeline and connect with another one from the transformation point. I don't know, the lack of clear rules in documentation cause me huge headake while debugging such stuff. But apparently redirect-to IS working ! So I guess this will be the right answer. Thanks, Cris. in every subpipeline. Or, if there are many subpipelines, you could create a resource that does the styling (and serializing) and map:redirect-to resource=look+feel/ or, for more complex stylings even map:redirect-to resource=look+feel/{user_credentials}/ in every pipeline where it's applicable. In addition, you could use selectors to chose between different look+feels based on some user parameter. 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: Cocoon or Tomcat with Servlets/Taglibs?
Some comments ... At 11:35 AM 11/27/01 -0600, you wrote: I'm just trying to figure out if I should take the time and create a huge sitemap with all the functionality I want I can understand that. You want to make sure there's enough of a benefit before you put in the work. I've also looked into how to use servlets with Cocoon and it isn't pretty Doesn't have to be, right? You can just have your sitemap redirect to a servlet, or have a form generated by a servlet submit to cocoon. Should be able to move between servlets and cocoon quickly and easily, no? Other thoughts on this: * If you're talking about calling servlet code from Cocoon, then you might want to consider pulling the code out of the servlet into some common class that can be called both from Cocoon (from an XSP page, for example) as well as from the servlet. * You might want to consider looking into Cocoon Action classes. They're probably much easier to integrate with a Cocoon app than a servlet. not to mention everytime I need to add some basic functionality, I need to restart cocoon, then httpd after tomcat restarts. Actually, you don't need to. * XSP pages and your sitemap get automatically re-compiled when changed, without restarting Cocoon/Tomcat. Similarly, changes to XML and XSL files are picked up automatically without a re-start. * Although code (e.g., Action classes) are not picked up automatically, you don't have to shut down Tomcat to reload them. Assuming that you have set up manager access, you can use the manager servlet to reload Cocoon without a shutdown (e.g., http://localhost/manager/reload?path=/cocoon) I could implement my navbars using taglibs instead of XInclude, which would be easier anyway Again, your call. You'll have to decide if the benefit vs. cost of Cocoon is sufficient for you to go with it. HTH. DR - 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: Look-and-feel approach with views
That exactly what I mean on functional level, but unfortunately, this kind connection in Cocoon causes an exception: Original exception : java.lang.RuntimeException: Problem in getTransformer:Error in creating Transform Handler at org.apache.cocoon.transformation.TraxTransformer.setConsumer(TraxTransformer .java:279) at org.apache.cocoon.components.pipeline.AbstractEventPipeline.connectPipeline( AbstractEventPipeline.java:216) at org.apache.cocoon.components.pipeline.AbstractEventPipeline.process(Abstract EventPipeline.java:106) at org.apache.cocoon.components.pipeline.AbstractStreamPipeline.process(Abstrac tStreamPipeline.java:140) at org.apache.cocoon.www.file_.C_.java.tomcat.webapps.gwvas.WEB_INF.conf.sitema p_xmap.wildcardMatchN400063(sitemap_xmap.java:752) at org.apache.cocoon.www.file_.C_.java.tomcat.webapps.gwvas.WEB_INF.conf.sitema p_xmap.process(sitemap_xmap.java:568) at org.apache.cocoon.www.file_.C_.java.tomcat.webapps.gwvas.WEB_INF.conf.sitema p_xmap.process(sitemap_xmap.java:521) I suggest that there is an easier approach to solve your lookfeel issue. Assuming that the LF is supported by means of some transformation, then why not use the following sitemap construct: map:pipeline map:match pattern=xslt/look_feel.xsl map:action get-user-l_f map:read src=xslt/skins/{look-n-feel}.xsl /map:action map:read src=xslt/default_l_f.xsl/ /map:match map:match pattern=* map:generate src={1}/ map:transform src=cocoon:/xslt/look_feel.xsl/ map:serialize/ /map:match /map:pipeline That way, look and feel is handled in a single location and there is no need to extend the sitemap language. Hope this helps, Adrian (I haven't tested the above, but I want to illustrate the idea) - Original Message - From: Alexander Smirnoff [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, November 26, 2001 11:20 PM Subject: Re: Look-and-feel approach with views OK. Then how could I implement dynamically look-and-feel based on user credentials (customer-id, user_id) ? I see only one possible way: inserting action for each XSL transformation in each pipeline... That approach makes sitemap look even more ugly... Comments are follows, Alex. - Original Message - From: giacomo [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, November 26, 2001 5:50 PM Subject: Re: Look-and-feel approach with views On Mon, 26 Nov 2001, Alexander Smirnoff wrote: OK. I've got it. Well, is it possible to trigger the view from inside sitemap? What about Passing parameters? I think the idea of breaking pipeline and continuing it from another resource-like pipeline (view) from labeled predefined point is very powerful. Imagine having the same long chain of transformations through group or even all of pipelines in the sitemap! From my point of view it makes sitemap more unreadable. From the other side, if you have some resource-like view which could be processed from any pipeline and being returned to the point of entry will make readability of sitemap more easy... Something like that: !-- declaration -- map:chain name=look-feel !-- action get-user-skin :-) defines path to the source of the skin -- map:act type=get-user-skin map:transform src={srcpath}/{src}/ /map:act map:transform src=default/{src}/ /map:chain !-- from pipline -- map:match pattern=... map:generate src=welcome.xml/ map:call-chain name=look-feel map:parameter name=src value=welcome.xsl/ /map:call-chain map:serialize/ /map:match This is just a random thought. Sorry for being naive if this is the case...Probably there are some workaround which I don't know, - I'll be glad to comprehend. I can't see what your approach is good for. Views aren't made for skinning. They are for producing view in the sense of schema, meta data, links etc. but not for green or red. If you like to use it that way, yes, your sitemap might look ugly then. So what would be more elegant approach ? Use actions in each transformation point in sitemap? Your proposed enhancement is only giving another programmers view into the sitemap which isn't what we initially wanted and is what we like to get fixed in the future. The only proposition I made is to manipulate sitemap in orthogonal fashion like views do. Why not? I do understand... What are the tradeoffs? Giacomo Thanks, Alex. - Original Message - From: giacomo [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, November 26, 2001 2:46 PM Subject: Re: Look-and-feel approach with views On Mon, 26 Nov 2001, Alexander Smirnoff wrote: I'm using 2.0rc1, but even if I put
Re: Cocoon or Tomcat with Servlets/Taglibs?
At 11:38 AM 11/27/01 -0600, you wrote: ...not to mention Cocoon loads a lot of libraries I'll never use but that Cocoon depends on, like Batik, which Java 1.4 can do without. You might want to do what I've done: I've set up a separate dir for my app - separate from my /cocoon directory - and that's where I run my app out of. This dir is a copy of the /cocoon dir, but I've tailored it to remove unnecessary libs like Batik (since I know my app isn't using SVG) and that trims the list of loaded libs a bit. DR - 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]
LF: passing parameters to resource
Is there any way to pass parameters to resource from redirect-to point. for example: map:resources map:resource name=transf map:transform src=stylesheets/xsl/{file}.xsl/ map:serialize/ /map:resource /map:resources map:pipelines map:pipeline map:match pattern=home map:parameter name=file value=welcome/ !-- This doesn't work -- map:generate src=content/xml/welcome.xml / map:redirect-to resource=transf/ /map:match /map:pipeline /map:pipelines Any ideas? Alex - 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: LF: passing parameters to resource
I think this works: map:match pattern=home map:generate src=content/xml/welcome.xml / map:redirect-to resource=transf map:parameter name=file value=welcome/ /map:redirect-to /map:match Haven't tried it though. Email back if I'm wrong. DR At 01:22 PM 11/27/01 -0500, you wrote: Is there any way to pass parameters to resource from redirect-to point. for example: map:resources map:resource name=transf map:transform src=stylesheets/xsl/{file}.xsl/ map:serialize/ /map:resource /map:resources map:pipelines map:pipeline map:match pattern=home map:parameter name=file value=welcome/ !-- This doesn't work -- map:generate src=content/xml/welcome.xml / map:redirect-to resource=transf/ /map:match /map:pipeline /map:pipelines Any ideas? Alex - 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: LF: passing parameters to resource
Nope it doesn't. - Original Message - From: David Rosenstrauch [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 27, 2001 2:10 PM Subject: Re: LF: passing parameters to resource I think this works: map:match pattern=home map:generate src=content/xml/welcome.xml / map:redirect-to resource=transf map:parameter name=file value=welcome/ /map:redirect-to /map:match Haven't tried it though. Email back if I'm wrong. DR At 01:22 PM 11/27/01 -0500, you wrote: Is there any way to pass parameters to resource from redirect-to point. for example: map:resources map:resource name=transf map:transform src=stylesheets/xsl/{file}.xsl/ map:serialize/ /map:resource /map:resources map:pipelines map:pipeline map:match pattern=home map:parameter name=file value=welcome/ !-- This doesn't work -- map:generate src=content/xml/welcome.xml / map:redirect-to resource=transf/ /map:match /map:pipeline /map:pipelines Any ideas? Alex - 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: LF: passing parameters to resource
Thanks Cris, Again you saved me, man. Thanks. This works now: map:resources map:resource name=transf map:transform src=stylesheets/xsl/{target}.xsl/ map:serialize/ /map:resource /map:resources ... map:match pattern=home map:generate src=content/xml/welcome.xml/ map:redirect-to resource=transf target=welcome/ /map:match ... Approach with map:parameter name=target value=welcome/ generates code in wrong place, which cause compilation error of sitemap. So I guess it could be treated as a BUG. Regards, Alex. On 27.Nov.2001 -- 01:22 PM, Alexander Smirnoff wrote: Is there any way to pass parameters to resource from redirect-to point. for example: map:resources map:resource name=transf map:transform src=stylesheets/xsl/{file}.xsl/ map:serialize/ /map:resource /map:resources map:pipelines map:pipeline map:match pattern=home map:parameter name=file value=welcome/ !-- This doesn't work -- map:generate src=content/xml/welcome.xml / map:redirect-to resource=transf/ /map:match /map:pipeline /map:pipelines Alexander, all sitemap parameters are still available after the redirection. In addition you can give it an additional attribute @target which will show up as additional sitemap parameter {target}. Obviously, redirect-to resource introduces a new layer of parameters, thus {1} before will be {../1} afterwards. 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: C2 Installation on JRun 3.x...
Well, I also managed to get it working but I can confirm your problem. It has something to do with the order of the JARs in the classpath. Conflicts between JRun JARs and Cocoon JARs, and off course JRun wins... :-) You can change the order of how the classpath is composed in the global.properties file in the JRun/lib directory. e.g. if you put the user.classpath in front, things work fine with all the Cocoon JARs in the WEB-INF/lib. Off course it does... but who wants to work like this if you have more than one server running? Jan -Original Message- From: SANSONE, AARON M [Non-Pharmacia/1000] [mailto:[EMAIL PROTECTED]] Sent: woensdag 21 november 2001 17:09 To: Cocoon-Users (E-mail) Subject: C2 Installation on JRun 3.x... Has anyone successfully installed C2 on a JRun Servlet engine? I have had some success but am trying to package an application as a WAR file and deploy. My problem is that Cocoon2 won't run unless the JAR files are located in the JRun server lib directory. According to the Servlet 2.2 spec, the JAR files for cocoon2 should be placed in the WEB-INF/lib directory and picked up by the Servlet engine. However when I do this I get the following error message: /cocoon2/: null java.lang.NoSuchMethodError at org.apache.avalon.framework.configuration.DefaultConfigurationBuilder.init (DefaultConfigurationBuilder.java:38) at org.apache.cocoon.servlet.CocoonServlet.initLogger(CocoonServlet.java:398) at org.apache.cocoon.servlet.CocoonServlet.init(CocoonServlet.java:128) at allaire.jrun.servlet.JRunServletLoader.loadServletInstance(../servlet/JRunSe rvletLoader.java:203) at allaire.jrun.servlet.JRunServletLoader.loadServletInstance(../servlet/JRunSe rvletLoader.java:161) at allaire.jrun.servlet.JRunServletLoader.loadServlet(../servlet/JRunServletLoa der.java:149) at allaire.jrun.servlet.JRunSE.getServletReference(../servlet/JRunSE.java:1705) at allaire.jrun.servlet.JRunSE.runServlet(../servlet/JRunSE.java:1231) at allaire.jrun.servlet.JRunRequestDispatcher.forward(../servlet/JRunRequestDis patcher.java:89) at allaire.jrun.servlet.JRunSE.service(../servlet/JRunSE.java:1552) at allaire.jrun.servlet.JRunSE.service(../servlet/JRunSE.java:1542) at allaire.jrun.servlet.JvmContext.dispatch(../servlet/JvmContext.java:364) at allaire.jrun.http.WebEndpoint.run(../http/WebEndpoint.java:115) at allaire.jrun.ThreadPool.run(../ThreadPool.java:272) at allaire.jrun.WorkerThread.run(../WorkerThread.java:75) Anyone have any ideas? - 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]
ndash problem with NS4++
Hi, i found that NS4++ can't support ndash; and lsquo; but the website generated by cocoon2b1 will transform the #8211; to ndash; and #8216; to lsquo; so is any configuration can remain the #8216 and #8216 ? Here are the snip code for xml and sitemap: xml file: ?xml version=1.0 encoding=ISO-8859-1? Documentpage-titleTable/page-titlepage-nameTable/page-namebig-title titleAbout symbols/title para/sub-title titleAbout symbols/title para/ paraThis is only a test for :/para para#8211; /para para#8216;/para para@/para para#/para para$/para para%/para para^/para paraamp;/para para*/para para?/para para~/para para`/para para+/para para=/para/sub-title /big-title/Document sitemap: map:serializers default=html map:serializer name=links src=org.apache.cocoon.serialization.LinkSerializer/ map:serializer name=xmlmime-type=text/xml src=org.apache.cocoon.serialization.XMLSerializer/ map:serializer name=html mime-type=text/html src=org.apache.cocoon.serialization.HTMLSerializer indent0/indent encodingISO-8859-1/encoding /map:serializer map:serializer name=fo2pdf mime-type=application/pdf src=org.apache.cocoon.serialization.FOPSerializer/ map:serializer name=vrml mime-type=model/vrml src=org.apache.cocoon.serialization.TextSerializer/ map:serializer name=wapmime-type=text/vnd.wap.wml src=org.apache.cocoon.serialization.XMLSerializer doctype-public-//WAPFORUM//DTD WML 1.1//EN/doctype-public doctype-systemhttp://www.wapforum.org/DTD/wml_1.1.xml/doctype-system /map:serializer Name: Ling Kok Choon E-mail: Ling Kok Choon [EMAIL PROTECTED] Date: 11/28/01 Time: 10:26:49 This message was sent by Z-Mail Pro - from NetManage NetManage - delivers Standards Based IntraNet Solutions - 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: Encoding
Hi, thnaks it works at least more than ever, but still some issues are open. First why does it work when changing the encoding of the serializer. I mean the serializer influence the response and the request parameter comes from the request (the beginning of the pipeline)?? Second if i set the serializer encoding to UTF-8 does than even japanese characters get stored correctly ?? Max -Original Message- From: Nuno José Pires dos Santos [mailto:[EMAIL PROTECTED]] Sent: Dienstag, 27. November 2001 16:36 To: [EMAIL PROTECTED] Subject: RE: Encoding Try this map:serializer name=html mime-type=text/html src=org.apache.cocoon.serialization.HTMLSerializer encodingISO-8859-1/encoding /map:serializer -Mensagem original- De: Max Larsson [mailto:[EMAIL PROTECTED]] Enviada: terça-feira, 27 de Novembro de 2001 11:28 Para: 'Cocoon Users' Assunto: Encoding Hi, i am testing the employee example, which is contained with C2 distribution and accessible under http://localhost:8080/cocoon/forms/employee. When trying to add an employee with special chararters like aumlaut they aren't stored correctly in the database. Does anyone know how to avoid this ?? Max - 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]