Hi Javier,

Thanks for your reply.

Yes, your suggestion probably would work, but seems more cumbersome. Response returned from another block must be XML, right? That is, the requested javascript has to be inserted into XML with at least one containing element before it is send to the requesting block. Subsequently, the requesting block would need to create a text/javascript response that is send to the client. The latter can be accomplish with a TextSerializer. More importantly, every cocoon-based web application must have a block specifically for this particular purpose, which would mean more overhead for maintaining the software. Finally, the block serving the javascript would need to access javascript as well, which have to be stored in a directory, as indicated in my original email. I would like to avoid all of this, and simply read javascript from a jar (maintained centrally as a maven project).

Could the developers possibly confirm that there is in fact no resource protocol in cocoon 3. And if so, would there be any chance for having this feature available in next release of cocoon 3. At least to me, this would be extremely useful.

Thanks,
André



On 14/09/11 13:06, Javier Puerto wrote:
Hi Andre,

2011/9/14 Andre Juffer <ajuf...@cc.oulu.fi <mailto:ajuf...@cc.oulu.fi>>

    Hi,

    with cocoon 2.2 one can read javascript resources residing in
    separate jars like:

    <map:match pattern="dojoroot/**">
    <map:read src="resource://dojoroot/{1}" />
    </map:match>

    (the above is for loading javascript from the dojotoolkit. I made
    a separate maven project for Dojo, and make a cocoon-based project
    depending on it. I have different maven projects for different
    versions of Dojo.)


    It seems that cocoon 3 is currently not supporting the resource
    protocol? A solution would be to physically have all the Dojo
    javascript located in a subdirectory dojoroot (for example), and
    in the sitemap have something like

    <map:match pattern="dojoroot/**">
    <map:read src="dojoroot/{1}" mime-type="text/javascript"/>
    </map:match>

    (as in the example web application)

    However, this is inconvenient, as one would need to copy dojo to a
    subdirectory for each project that requires dojo. The maven way is
    much more easier and certainly more elegant, as all projects
    requiring dojo are updated automatically.

    My question is now: If there is no resource protocol, how can one
    achieve the above?


I can't found in 3.0 documentation , but you can try blockcontext:/ protocol that's available on 2.2.

http://cocoon.apache.org/2.2/1291_1_1.html

Salu2


    Thanks,

-- Andre H. Juffer | Phone: +358-8-553 1161
    <tel:%2B358-8-553%201161>
    Biocenter Oulu and           | Fax: +358-8-553-1141
    <tel:%2B358-8-553-1141>
    Department of Biochemistry   | Email: andre.juf...@oulu.fi
    <mailto:andre.juf...@oulu.fi>
    University of Oulu, Finland  | WWW:
    www.biochem.oulu.fi/Biocomputing/
    <http://www.biochem.oulu.fi/Biocomputing/>
    StruBioCat                   | WWW: www.strubiocat.oulu.fi
    <http://www.strubiocat.oulu.fi>
    NordProt                     | WWW: www.nordprot.org
    <http://www.nordprot.org>
    Triacle Biocomputing         | WWW: www.triacle-bc.com
    <http://www.triacle-bc.com>

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
    <mailto:users-unsubscr...@cocoon.apache.org>
    For additional commands, e-mail: users-h...@cocoon.apache.org
    <mailto:users-h...@cocoon.apache.org>




--
Andre H. Juffer              | Phone: +358-8-553 1161
Biocenter Oulu and           | Fax: +358-8-553-1141
Department of Biochemistry   | Email: andre.juf...@oulu.fi
University of Oulu, Finland  | WWW: www.biochem.oulu.fi/Biocomputing/
StrucBioCat                  | WWW: www.strucbiocat.oulu.fi
Triacle Biocomputing         | WWW: www.triacle-bc.com

Reply via email to