On Jan 9, 2005, at 7:21 PM, Mark Lundquist wrote:
From: Glen Ezkovich [mailto:[EMAIL PROTECTED] On Jan 9, 2005, at 4:17 PM, Mark Lundquist wrote:Do we really want inter-block flowscript function calls?
I was wondering about this as well. Is it even necessary in order to
use the functions in the first place? If one has a dependency on
another blocks flowscript function couldn't one just load the file and
use the function as in
cocoon.load("resource://org/apache/cocoon/forms/flow/javascript/
Form.js"); ? Is there something special about blocks that would prevent
the current cocoon methods of accessing resources from working?
Actually, I think there _is_ something special that way...
I don't think your client block will know what file to load... see http://wiki.apache.org/cocoon/BlockImplementation
That would be a horrible thing. We are just talking about loading a file. If Cocoon can't determine where a file inside a block is located we have a problem. If the client block has a dependency on a particular javascript function in another block it better know what file it has to load. If you would like to create a block that could return or call any randomly desired function then that in and of its self is a block.
From the wiki section 4:
The block manager will be queried by all the cocoon internal services that need to locate block-dependent stuff, that is:
the sitemap interpreter: to find out where the blocks sitemaps are mounted in the main sitemap URL space.
This should make it possible to load any file including a javascript file and its functions.
the block: protocol: to locate the services provided by the blocks
This should make it possible to access any service. In the worse case block://newBlock/resources/javascriptFile.js should get us the file.
the component manager: to locate components provided by the blocks (either avalon components, sitemap components and VirtualComponents)
This should make it possible to locate and thus use any component.
Maybe I'm dense this evening, but it seems that using a javascript function in a file contained in another block should not be that difficult.
Glen Ezkovich HardBop Consulting glen at hard-bop.com http://www.hard-bop.com
A Proverb for Paranoids:
"If they can get you asking the wrong questions, they don't have to worry about answers."
- Thomas Pynchon Gravity's Rainbow