On Sat, Jan 25, 2003 at 06:26:42AM +0100, Robert Simmons wrote: > > ----- Original Message ----- > From: "Jeff Turner" <[EMAIL PROTECTED]> > To: "Cocoon Users" <[EMAIL PROTECTED]> > Sent: Saturday, January 25, 2003 6:02 AM > Subject: Re: The simplest possible cocoon application? > > > > On Sat, Jan 25, 2003 at 05:21:13AM +0100, Robert Simmons wrote: > > > I currently have the cocoon war installed on my JBoss 3.0.4 server. It > > > works fine. I deployed a second war file that contains an XML and an > > > XSL. The XML has an embedded xsl:stylesheet processing instruction. > > > > Embedded stylesheets are very unusual.. are you sure it's Cocoon applying > > the embedded stylesheet, or the web browser? > > Hmm, how could I tell?
'view source' in your browser. If you see XML, then it's the browser rendering. If you see HTML, Cocoon is rendering. > What would you use if you didnt embedd the stylesheet into the XML? Oh, > I get it, the pipeline tells it what transform to make ? Yes. In the sitemap you'd have a pipeline like: <map:match pattern="foo.html"> <map:generate src="foo.xml"/> <map:transform src="foo2html.xsl"/> <map:serialize type="html"/> </map:match> > Addendum: I undeployed cocoon from jboss and the transform still > worked. Must be the browser doing it. OOK .. =) :) What was the URL you were using? Did it start with 'http:' or 'file:'? > Now I feel like i actually know LESS than before. > > > > > > When I go to the URL inside the war and hit the XML page, the > > > translation is made fine. > > > > > > Ok so here is the question. I am now thinking of doing something a bit > > > more than static XML pages. What would be the bare minimum? Do I have > > > to copy the cocoon war and all the libs in it to another deployment or > > > can I use the jars already deployed in the war? > > > > Each war has one main sitemap. Each sitemap can have lots of different > > pipelines. Where did the 'second war file' you mention come from? Did > > you copy the sitemap and WEB-INF/cocoon.xconf from the Cocoon samples > > war? > > > > What I mean is that, if possible, I dont want to copy the whole MASSIVE > jar library in the cocoon distribution war into every blasted web app > that I create. There's lots of jars but most of them aren't big. I have lots of webapps with ~8mb of jars in their WEB-INF/lib. What you lose in disk space, you gain in webapp portability. But if you really want a common set of jars, you can put them in Tomcat 4.x's lib/common/ directory. > The thing thats stumping the newbie here is how a user > uses it. It almost seems like i have to be practically a dveloper on > cocoon to use it. I honestly dont care how it works, I just ultimately > want to write come generators that smack a EJB and spit out XML that > then gets transformed. Basically what i have right now is a normal java > servlet that builds a dom document, serializes it to xml and trusts the > xsl transform to put out the html and so on. The servlet has a massive > number of methods from all the commands being handeled. I want to nuke > that servlet and instead write cocoon generators to spit out the xml > and then let cocoon do its magic. However after 12 hours of reading, Im > still a tad lost. <wet blanket mode> Cocoon is big and complex (as you've found out). Assuming all you want to do is an XSLT transform on the end of your servlet, and this is a once-off job, I'd suggest just using a JSP taglib or something to query the servlet and transform the result. Some simpler alternatives to Cocoon: http://jakarta.apache.org/taglibs/doc/standard-doc/intro.html http://jakarta.apache.org/taglibs/doc/xtags-doc/intro.html http://mav.sourceforge.net/ http://jakarta.apache.org/commons/sandbox/jelly/ Also, remember you can make a single servlet *appear* to have multiple URIs (one per command) with web.xml <servlet-mapping> sections and request.getPathInfo(). </wet blanket mode> If you want a gentle introduction to Cocoon, you could download Forrest: http://xml.apache.org/forrest/ (essentially 'pre-packaged' Cocoon for project docs). Once installed, you type: mkdir myproj cd myproj forrest seed # Generates a template project, with sitemap forrest webapp # Generates a webapp from your template project forrest run # Runs webapp in a webserver Then view the Cocoon site at http://localhost:8888/, and you can experiment with the sitemap in build/webapp/sitemap.xmap. ... > > Fortunately we have a Wiki where anyone can document things. This > > page looks quite relevant to your question: > > > > I will read it ... but I have to say that this looks liek a very > powerful front end that once you know it, it is great. Prior to that > there is ALLOT of head scratching. And I dont think im any lightweight > at programmign either. It's like a sledgehammer.. big, powerful, not suitable for all problems. --Jeff > > http://wiki.cocoondev.org/Wiki.jsp?page=SimpleTransformations > > > > > > --Jeff > > > > > -- Robert > > > > --------------------------------------------------------------------- > > 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]>