Return-Path: Delivered-To: apmail-cocoon-users-archive@www.apache.org Received: (qmail 71714 invoked from network); 10 Feb 2004 19:37:29 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 10 Feb 2004 19:37:29 -0000 Received: (qmail 73256 invoked by uid 500); 10 Feb 2004 19:35:26 -0000 Delivered-To: apmail-cocoon-users-archive@cocoon.apache.org Received: (qmail 73231 invoked by uid 500); 10 Feb 2004 19:35:26 -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 Delivered-To: mailing list users@cocoon.apache.org Received: (qmail 73154 invoked from network); 10 Feb 2004 19:35:25 -0000 Received: from unknown (HELO anchor-post-33.mail.demon.net) (194.217.242.91) by daedalus.apache.org with SMTP; 10 Feb 2004 19:35:25 -0000 Received: from media.demon.co.uk ([80.177.14.141] helo=[192.168.0.4]) by anchor-post-33.mail.demon.net with esmtp (Exim 3.35 #1) id 1AqdfN-000HAD-0X for users@cocoon.apache.org; Tue, 10 Feb 2004 19:35:29 +0000 Mime-Version: 1.0 (Apple Message framework v612) In-Reply-To: <40292D1B.1090902@verizon.net> References: <4028FB36.3050709@verizon.net> <467F5DA9-5BF5-11D8-B9F5-0003935AD2EE@media.demon.co.uk> <40292D1B.1090902@verizon.net> Content-Type: multipart/signed; micalg=sha1; boundary=Apple-Mail-12--649719129; protocol="application/pkcs7-signature" Message-Id: <4811DB84-5C00-11D8-B9F5-0003935AD2EE@media.demon.co.uk> From: Jeremy Quinn Subject: Re: JXTemplate: nested forEach problem Date: Tue, 10 Feb 2004 19:35:28 +0000 To: users@cocoon.apache.org X-Mailer: Apple Mail (2.612) X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N --Apple-Mail-12--649719129 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed On 10 Feb 2004, at 19:12, Christopher Oliver wrote: > What does the log look like? Your script seeems to log the exception. OH Boy !!! Was that a dumb mistake, or what ??? !!! That snippet had been copied partly from XSLT, I had left in it !!! No wonder it did not work!!! So you were right, the actual error ends up in the flow.log, but not on the screen. many thanks, and sorry for the waste of time. regards Jeremy > Chris > > Jeremy Quinn wrote: > >> >> My sincere appologies .... I sent the wrong script !!! >> >> >> >> On 10 Feb 2004, at 18:16, Jeremy Quinn wrote: >> >>> >>> On 10 Feb 2004, at 15:39, Christopher Oliver wrote: >>> >>>> What does your flowscript look like? Just a guess, but is it >>>> possible you are catching the exception from >>>> sendPage*("pipeline-containing-your-template") in your script? >>>> That could explain the "generator already set" error (which occurs >>>> when you incorrectly call sendPage*() more than once in the same >>>> flowscript invocation - i.e. after catching the exception your >>>> script "falls through" to the next sendPage*()). >>>> >>>> HTH, >>> >>> >>> Many thanks for your response. >>> Thing is .... the page works fine without the : >>> >>> ... >>> >>> At the moment, I get this error for any problem I have with >>> JXTemplate syntax. >>> >>> But anyway, here is the flowscript : >> >> >> function album () { >> var factory = cocoon.getComponent (PersistanceFactory.ROLE); >> var session = factory.createSession (); >> try { >> var approot = cocoon.parameters["approot"]; >> var album = AlbumPeer.load (session, new java.lang.Long >> (cocoon.parameters["albumid"]), null); >> var page = parseInt (cocoon.parameters["page"]); >> var size = parseInt (cocoon.parameters["size"]); >> if (album != null && !album.isPrivate) { >> var nav = pagerNavigation (album.resources.size(), page, size); >> if (page > -1 && size > 0 && album.resources.size() > 0) { >> var start = page*size; >> var end = (page*size) + size; >> if (end > album.resources.size()) end = album.resources.size >> (); >> album.resources = album.resources.subList (start, end); >> } >> cocoon.request.setAttribute ("sitemapURI", >> cocoon.parameters["sitemapURI"]) >> cocoon.sendPage (cocoon.parameters["screen"], { album: album, >> nav: nav, approot: approot }); >> catch (return) { session.close(); } // the page has finished >> rendering >> } else { >> cocoon.sendPage("screen/error", {message: >> "albums.album.notavailable"}); >> } >> } catch (e) { >> cocoon.log.error (e); >> cocoon.sendPage("screen/error", {message: >> "albums.album.notavailable"}); >> session.close(); >> } finally { >> cocoon.releaseComponent(factory); >> } >> } >> >> >> >> >>> >>> regards Jeremy >>> >>>> Chris >>>> >>>> Jeremy Quinn wrote: >>>> >>>>> I have a set of nested Beans, from with I am trying to extract >>>>> values using JXTemplate. >>>>> >>>>> album - an Album Bean >>>>> title - String >>>>> text - String >>>>> . . . >>>>> resources - ArrayList of Resource Beans >>>>> artefact - String >>>>> text - String >>>>> images - ArrayList of Image Beans >>>>> image - String >>>>> . . . >>>>> >>>>> Here is part of the Template : >>>>> >>>>> >>>>>
>>>>> >>>>> <a href="../artefacts/work(#{artefact}).html" title="view the >>>>> full artefact"> >>>>> <!-- snip --> >>>>> </a> >>>>> >>>>>

IMAGES: #{count(images)}

>>>>> >>>>> >>>>> image: #{image}>>>> src="../images/thumbnail/artefacts/#{image}.jpg"/> >>>>>   >>>>> >>>>>

>>>> i18n:attr="title">#{text}

>>>>>
>>>>>
>>>>> >>>>> This all works fine if I take out the inner 'forEach'. >>>>> When I leave it in I get the far from helpful (currently in >>>>> 2.1.4-dev, generic) Exception: >>>>> >>>>> org.apache.cocoon.ProcessingException: Generator already set. >>>>> Cannot set generator 'jx' at >>>>> file:/Users/jerm/Development/Checkouts/someproject/webapp/ >>>>> album.xmap: 37:62 >>>>> at >>>>> org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.se >>>>> tG ene rator(AbstractProcessingPipeline.java:243) >>>>> at >>>>> org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessin >>>>> gP ipe >>>>> line.setGenerator(AbstractCachingProcessingPipeline.java:158) >>>>> >>>>> etc. >>>>> >>>>> What I do not understand is that this works : >>>>> #{count(images)} >>>>> But this throws exceptions : >>>>> >>>>> >>>>> Any suggestions? >>>>> I have tried all of the variations in the documentation and User's >>>>> List that I could find. >>>>> >>>>> thanks >>>>> >>>>> regards Jeremy >>>> >>>> >>>> >>>> >>>> -------------------------------------------------------------------- >>>> - >>>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org >>>> For additional commands, e-mail: users-help@cocoon.apache.org >>>> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org > For additional commands, e-mail: users-help@cocoon.apache.org > --Apple-Mail-12--649719129 Content-Transfer-Encoding: base64 Content-Type: application/pkcs7-signature; name=smime.p7s Content-Disposition: attachment; filename=smime.p7s MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIGJDCCAt0w ggJGoAMCAQICAwskYzANBgkqhkiG9w0BAQQFADBiMQswCQYDVQQGEwJaQTElMCMGA1UEChMcVGhh d3RlIENvbnN1bHRpbmcgKFB0eSkgTHRkLjEsMCoGA1UEAxMjVGhhd3RlIFBlcnNvbmFsIEZyZWVt YWlsIElzc3VpbmcgQ0EwHhcNMDMxMTEzMjEwMTI0WhcNMDQxMTEyMjEwMTI0WjBKMR8wHQYDVQQD ExZUaGF3dGUgRnJlZW1haWwgTWVtYmVyMScwJQYJKoZIhvcNAQkBFhhqZXJlbXlAbWVkaWEuZGVt b24uY28udWswggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCwu9abCH/mefGpJqCrbgn+ H3FX223ceivXU1FpwEciHb1edLiyhRDmeELKfS8RBh1fWeXPnsMsR+/JW1kFTjuU05vtu3zr4AC8 HH5qx5TexLkqHP9rfwQPwzlkbXa5m30niA4a642Wi9Q7i/sg1i41najIRr/W/no+MkOWgPypsqbG aWpUWIZyETfrJNhlyeYOXWivyv657l2Oc2qSzxOUnWvh9GiwF4Ru7kESViiCLwyDzPaN2yLreMKA 6ZU+0hv77iwtc0Ul8GDNWwYUiFA1RqDMtz90oKoOIEzNn/LCD1PMziPCmpXXipAuVnttv0eSXX6w /jlIQYf+k0MwAEw5AgMBAAGjNTAzMCMGA1UdEQQcMBqBGGplcmVteUBtZWRpYS5kZW1vbi5jby51 azAMBgNVHRMBAf8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