Return-Path: Delivered-To: apmail-cocoon-users-archive@www.apache.org Received: (qmail 41011 invoked from network); 27 Sep 2005 21:01:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 27 Sep 2005 21:01:16 -0000 Received: (qmail 66798 invoked by uid 500); 27 Sep 2005 21:01:10 -0000 Delivered-To: apmail-cocoon-users-archive@cocoon.apache.org Received: (qmail 66751 invoked by uid 500); 27 Sep 2005 21:01:10 -0000 Mailing-List: contact users-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: users@cocoon.apache.org List-Id: Delivered-To: mailing list users@cocoon.apache.org Received: (qmail 66736 invoked by uid 99); 27 Sep 2005 21:01:10 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Sep 2005 14:01:10 -0700 X-ASF-Spam-Status: No, hits=0.6 required=10.0 tests=USERPASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [199.234.13.208] (HELO smtp.rjlg.com) (199.234.13.208) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Sep 2005 14:01:16 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: Using the output of a pipeline to call another pipeline? Date: Tue, 27 Sep 2005 17:05:48 -0400 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Using the output of a pipeline to call another pipeline? thread-index: AcXDfIHFaskvPT8mQumK5s9T9w+KfwAAp/XQ From: "Chris Marasti-Georg" To: X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N I think you have 2 options - a reader, or an action. Your action could call the xquery, get the result, and put it in the returned map, making it visible to a subsequent read call (my syntax may not be perfect, it's been a while since I coded an action): Or, implement a special reader that performs both steps... Calling the xquery, and then using the result to retrieve the actual image. I'm not sure of the inner workings of readers, with respect to reading from a source other than the one that is passed in from the sitemap... My guess would be that the action would be a cleaner implementation. One other thought I just had, but have no idea how reasonable it would be, is to use a flowscript function like readImage() { // get request uri in here somehow var realfile =3D cocoon.processPipelineTo("flow/locateimage"+cocoon.getRequestUri()); //parse response var realFilename =3D getFilenameFromResponse(realfile); Cocoon.sendPage("flow/readimage/"+realFileName"); } External pipeline Internal pipeline: Just some ideas, and I take no blame if nothing works... I waited to see if anyone else would pitch in 2 cents, and they didn't, so you get my penny instead ;) Good to see another person using eXist... Chris Marasti-Georg =20 > -----Original Message----- > From: Jonas Lundberg [mailto:my.name.is.hans@gmail.com]=20 > Sent: Tuesday, September 27, 2005 11:54 AM > To: users@cocoon.apache.org > Subject: Re: Using the output of a pipeline to call another pipeline? >=20 > Thanks for the replies, I'll explain in more detail then. >=20 > The images are referenced in an HTML page, which means that=20 > the browser will request them separately after the page is=20 > sent. Do you propose that I somehow embed the image data in the page? >=20 > All paths in the system are virtual. I use XML files to=20 > create virtual hierarchies, that gives depth and structure to=20 > a site. That means that the same contents can be rendered=20 > using several different site layouts, at the same time. >=20 > Therefore, all images are stored in one big collection in the=20 > eXist database. To avoid that any two images get the same=20 > file name, each file is renamed when uploaded, and given a=20 > unique name (a number). The actual name, and the virtual path=20 > where it is to be shown, is stored in the meta data file. >=20 > In the html page generation pipeline, I could put the new=20 > file name directly in the html page, but that would violate=20 > the separation between storage and presentation. The author=20 > of the document should decide what file name to present to=20 > the user, not the system. A strict separation between storage=20 > and presentation is a main point with my system. >=20 > Also, if I execute an xquery to provide the file name, then I=20 > can at the same time check whether the metadata file states=20 > that the file is "live" or "waiting". It should not be=20 > possible to retreive an image before it is published. And=20 > when I am doing that, I can also check whether the particular=20 > user requesting the file should be allowed to see it. If the=20 > user is not allowed to see the image, or if it is not there,=20 > I can simply send a different image. >=20 > So, when the xquery has created an xml file with the image: > > 44500.jpg > > Then I cannot send a HTML file with an because=20 > the browser has requested the actual image file. Also, if I=20 > do that, then I have to check the user premissions, and the=20 > live-status of the image again, when the browser requests the=20 > actual image. >=20 > If I instead simply cinclude the image then I will get =20 > image data That would be an image embedded in XML,=20 > which is not what I want. >=20 > So, what I want to do is very basic: >=20 > First, I want to generate the internal file name using=20 > xQuery, given the virtual path and the virtual file name. At=20 > the same time I check whether the image is live ,and whether=20 > the particular user should be allowed to view it. > Then, I want to call a different (internal) pipeline using=20 > the resulting file name (embedded in the tag)=20 > (for instance > 44400.jpg) as the request, and return the result of that pipeline. >=20 > Any ideas now of how I can achieve that? >=20 > Hans >=20 >=20 >=20 >=20 >=20 >=20 >=20 >=20 > On 9/27/05, Derek Hohls wrote: > > > > Its not clear what you mean by the "second pipeline" - do=20 > you mean the=20 > > **.jpg ? If so, can you not simply call that from the page=20 > where it=20 > > needs to appear? (And the page itself is generated using=20 > the output=20 > > from the first pipeline; cinclude or simply a map:aggregate=20 > will feed=20 > > the XML into your page prior to a final transform.) > > > > If you need more help, you may have to lay out your problem=20 > a little=20 > > more clearly. > > > > >>> my.name.is.hans@gmail.com 2005/09/27 11:40:16 AM >>> > > > > I've got a very basic question that I got stuck with....=20 > maybe someone=20 > > can help me out? > > > > I have a web publishing system that stores all images in=20 > eXist, using=20 > > a number as the file name, e.g. 44500.jpg > > > > Each image has a metadata file, describing at what URL the image=20 > > should be shown (and also some other things, not shown here), e.g. > > > > webdesign/cocoon > > banner.jpg > > > > > > In the html files, the url to the file points at its=20 > virutal location,=20 > > and virtual name, e.g. webdesign/cocoon/banner.jpg Thus, I=20 > could write=20 > > a cocoon sitemap matcher like this: > > > > > > > name=3D"file" value=3D"{1}/{2}/{3}"/> ? How to call = the=20 > > second pipeline with the result of the query? > > > > > > The xquery generates the file name to use in the second=20 > pipeline, like=20 > > this 44500.jpg > > > > The image is then to be fetched from eXist using this pipeline: > > > > > > >=20 > src=3D"http://guest:guest@localhost:8080/cocoon/webdav/db/conten > ts/jpeg/{1}.jpg" > > " > > mime-type=3D"text/jpg "/> > > > > > > But how do I call the second pipeline, using the file name=20 > created by=20 > > the generator in the first pipeline? This is a very basic question,=20 > > but I got stuck with it anyway... Any ideas? > > > > Hans > > > >=20 > --------------------------------------------------------------------- > > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org > > For additional commands, e-mail: users-help@cocoon.apache.org > > > > > > -- > > This message is subject to the CSIR's copyright, terms and=20 > conditions=20 > > and e-mail legal notice. > > Views expressed herein do not necessarily represent the=20 > views of the CSIR. > > > > CSIR E-mail Legal Notice > > > > CSIR Copyright, Terms and Conditions > > > > For electronic copies of the CSIR Copyright, Terms and=20 > Conditions and=20 > > the CSIR Legal Notice send a blank message with "REQUEST=20 > LEGAL" in the=20 > > subject line to CSIR HelpDesk > > > > > > This message has been scanned for viruses and dangerous content by=20 > > MailScanner, and is believed to be clean. MailScanner=20 > thanks Transtec=20 > > Computers for their support. >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org > For additional commands, e-mail: users-help@cocoon.apache.org >=20 >=20 --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org For additional commands, e-mail: users-help@cocoon.apache.org