You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by "Rony G. Flatscher" <ro...@wu-wien.ac.at> on 2002/09/11 14:54:56 UTC

BSF (Bean Scripting Framework) and Cocoon's usage of it ?? (Re: Seeking help on BSF calling a non-Java language engine (Rexx) ...

Hi there,

a couple of days ago I posted a question regarding the Bean Scripting 
Framework's (BSF) usage of Cocoon. BSF allows Java programs to invoke 
functions/scripts/programs written in non-Java languages and
originates 
in an IBM alphawork project. In the past months a process has taken 
place to hand it over to Apache.

The problem: using BSF to add functions to XSLT works nicely with the 
JavaScriptEngine of BSF, but does not work yet, if using the
RexxEngine 
(either with the open source Regina Rexx interpreter or IBM's Object 
Rexx, which is free for Linux, BTW).

The reason: "Cocoon" uses the call()-method and supplies the name of
the 
function (as defined in the appropriate XSLT document) and the
arguments 
but not the source code, containing the Rexx code to be executed.

Short of any other documentation, there is no way at the moment to 
determine the location of the source code (in this case embedded in a 
CDATA-section in the XSLT-file).

Hence the plea for help: where is the source code stored, how can one 
retrieve the source-code at run-time?

Any help or any hint is highly appreciated!

Regards,

---rony
 

Rony G. Flatscher wrote:

>Hi there,
>
>have tried to research the mail-archives, the documentation and the
FAQ, but have not come up with a
>solution to a BSF-related problem, so my request for help in this
group of very ;) knowledgable
>people. Here's the problem:
>
>Extending the functionality of XSLT by defining a Rexx function which
should get called with the
>help of BSF during an XSLT-transformation. Obviously the
call()-Method is invoked and not apply(),
>which would supply the source-code in the form of a String.
>
>The BSF RexxEnigne call() method receives the declared function-name
and the argument(s), but not
>the source code. Here's the question: how is it possible at runtime
to get a hold of the source code
>(this is needed to be passed on to the used Rexx interpreter)?
>[Obviously, the RexxEngine is found and its call() Method is used, so
that part would be o.k.]
>
>Please, if you have any insights or hints which may help solve this
problem, then please do!
>
>(Would there be a way to force apply() to be used instead of call(),
which would supply the source?
>Or, could one indicate that the object-argument supplied to call()
which is set to null should
>possess the sourcecode?)
>
>---
>
>Should you need an example (XSLT defining the extension embedding the
Rexx code etc. and a short
>XML-file to be processed, URL to the Rexx-support for BSF), then
please let me know.
>
>Thanks in advance,
>
>---rony
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: BSF - *any* knowledge at all in this group ? (Re: BSF (Bean ScriptingFramework) and Cocoon's usage of it ?? (Re: Seeking help on BSF callinga non-Java language engine (Rexx) ...

Posted by "Rony G. Flatscher" <Ro...@wu-wien.ac.at>.
Vadim:

> >so far I have not received one answer to the BSF-related question. As I really want to get the Rexx
> >and Object Rexx BSF engines to work flawlessly with cocoon, I wonder what I could do from this point
> >on.
> >
>
> In Cocoon, you can use BSF to write actions (via ScriptAction). What it
> has to do with XSLT, I don't know.
>
> >Would the Xalan-group be more knowledgable/willing to help?
> >
>
> If it is XSLT related, then yes, this is question more for Xalan group
> then for Cocoon one.

Yes, it is definitely XSLT-related and if Xalan is used without changes/adaptations then it'll make
sense. Actually, thanks to your answer I will first research the Xalan-group and then proceed from there
on.

Thank you (and Carsten) very much for your help and good intentions!
:)

Regards,

---rony




---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: BSF - *any* knowledge at all in this group ? (Re: BSF (Bean Scripting Framework) and Cocoon's usage of it ?? (Re: Seeking help on BSF calling a non-Java language engine (Rexx) ...

Posted by Vadim Gritsenko <va...@verizon.net>.
Rony G. Flatscher wrote:

>Hi there,
>
>so far I have not received one answer to the BSF-related question. As I really want to get the Rexx
>and Object Rexx BSF engines to work flawlessly with cocoon, I wonder what I could do from this point
>on.
>

In Cocoon, you can use BSF to write actions (via ScriptAction). What it 
has to do with XSLT, I don't know.


>Would the Xalan-group be more knowledgable/willing to help?
>

If it is XSLT related, then yes, this is question more for Xalan group 
then for Cocoon one.

Vadim



>TIA,
>
>---rony
>
>
>"Rony G. Flatscher" schrieb:
>
>  
>
>>Hi there,
>>
>>a couple of days ago I posted a question regarding the Bean Scripting
>>Framework's (BSF) usage of Cocoon. BSF allows Java programs to invoke
>>functions/scripts/programs written in non-Java languages and
>>originates
>>in an IBM alphawork project. In the past months a process has taken
>>place to hand it over to Apache.
>>
>>The problem: using BSF to add functions to XSLT works nicely with the
>>JavaScriptEngine of BSF, but does not work yet, if using the
>>RexxEngine
>>(either with the open source Regina Rexx interpreter or IBM's Object
>>Rexx, which is free for Linux, BTW).
>>
>>The reason: "Cocoon" uses the call()-method and supplies the name of
>>the
>>function (as defined in the appropriate XSLT document) and the
>>arguments
>>but not the source code, containing the Rexx code to be executed.
>>
>>Short of any other documentation, there is no way at the moment to
>>determine the location of the source code (in this case embedded in a
>>CDATA-section in the XSLT-file).
>>
>>Hence the plea for help: where is the source code stored, how can one
>>retrieve the source-code at run-time?
>>
>>Any help or any hint is highly appreciated!
>>
>>Regards,
>>
>>---rony
>>
>>
>>Rony G. Flatscher wrote:
>>
>>    
>>
>>>Hi there,
>>>
>>>have tried to research the mail-archives, the documentation and the
>>>      
>>>
>>FAQ, but have not come up with a
>>    
>>
>>>solution to a BSF-related problem, so my request for help in this
>>>      
>>>
>>group of very ;) knowledgable
>>    
>>
>>>people. Here's the problem:
>>>
>>>Extending the functionality of XSLT by defining a Rexx function which
>>>      
>>>
>>should get called with the
>>    
>>
>>>help of BSF during an XSLT-transformation. Obviously the
>>>      
>>>
>>call()-Method is invoked and not apply(),
>>    
>>
>>>which would supply the source-code in the form of a String.
>>>
>>>The BSF RexxEnigne call() method receives the declared function-name
>>>      
>>>
>>and the argument(s), but not
>>    
>>
>>>the source code. Here's the question: how is it possible at runtime
>>>      
>>>
>>to get a hold of the source code
>>    
>>
>>>(this is needed to be passed on to the used Rexx interpreter)?
>>>[Obviously, the RexxEngine is found and its call() Method is used, so
>>>      
>>>
>>that part would be o.k.]
>>    
>>
>>>Please, if you have any insights or hints which may help solve this
>>>      
>>>
>>problem, then please do!
>>    
>>
>>>(Would there be a way to force apply() to be used instead of call(),
>>>      
>>>
>>which would supply the source?
>>    
>>
>>>Or, could one indicate that the object-argument supplied to call()
>>>      
>>>
>>which is set to null should
>>    
>>
>>>possess the sourcecode?)
>>>
>>>---
>>>
>>>Should you need an example (XSLT defining the extension embedding the
>>>      
>>>
>>Rexx code etc. and a short
>>    
>>
>>>XML-file to be processed, URL to the Rexx-support for BSF), then
>>>      
>>>
>>please let me know.
>>    
>>
>>>Thanks in advance,
>>>
>>>---rony
>>>
>>>      
>>>




---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


RE: BSF - *any* knowledge at all in this group ? (Re: BSF (Bean Scripting Framework) and Cocoon's usage of it ?? (Re: Seeking help on BSF calling a non-Java language engine (Rexx) ...

Posted by Carsten Ziegeler <cz...@s-und-n.de>.
Ah, ok - now I understand what you mean. Sorry, but I can't help you
here.
Perhaps someone who wrote the ScriptAction or ScriptGenerator for
Cocoon does know more about BSF.

Sorry
Carsten


> -----Original Message-----
> From: Rony G. Flatscher [mailto:Rony.Flatscher@wu-wien.ac.at]
> Sent: Friday, September 13, 2002 3:56 PM
> To: cocoon-dev@xml.apache.org
> Subject: Re: BSF - *any* knowledge at all in this group ? (Re: BSF (Bean
> Scripting Framework) and Cocoon's usage of it ?? (Re: Seeking help on
> BSF calling a non-Java language engine (Rexx) ...
>
>
> Hi Carsten:
>
> > I don't have any knowledge of BSF - but I now a little bit about Cocoon.
> > Sorry, I can't follow you: where is this method call of call() and
> > about what source are you talking?
>
> Well, this is a kind of a very special question and has to do
> with the BSF-utiltity. Basically it
> allows for calling non-Java-languages from within Java and allows
> also for those non-Java-programs
> to call back into Java. Various Apache projects are employing BSF
> (was developed by IBM as
> open-source and has been handed over to Apache).
>
> BSF in the context of XSL-transformations allows for defining
> extensions (i.e. functions written
> e.g. in JavaScript, in Perl, ie. extending the class
> BSFEngineImpl). In theory any implemented
> BSF-language can be handled uniformely. In the context of Cocoon
> it is the first time that the
> RexxEngine for BSF does not work. It seems that the way the
> BSF-RexxEngine is called causes a
> problem: the name of the function and the argument(s) are
> supplied, but not the source code of the
> program (in this case the Rexx program).
>
> So I would like to know how I could get a hold of the source code
> at runtime to be able to invoke
> it.
>
> To make it maybe a little bit more interesting, I enclosed the
> following files:
>
>     - page2html-javascript.xsl - contains a JavaScript function
> as an extension to XSLT
>     - hello-page2html.xml - xml-file to be processed (using a
> JavaScript function)
>
> (   - XML nach HTML.htm - the resulting HTML-file  )
>
> This JavaScript version works with Cocoon, due to BSF.
>
> The question to the developers in the know: how is it possible to
> access the source of the program
> (in the file "page2html-javascript.xsl it is defined in a
> CDATA-section)? [The call() method is a
> method defined in BSFEngineImpl(), and it seems to me that it is
> not being used correctly, at least
> not the way I read the original BSF documentation.]
>
> *Any* help, *any* hint highly appreciated !
>
> TIA,
>
> ---rony
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: BSF - *any* knowledge at all in this group ? (Re: BSF (Bean Scripting Framework) and Cocoon's usage of it ?? (Re: Seeking help on BSF calling a non-Java language engine (Rexx) ...

Posted by "Rony G. Flatscher" <Ro...@wu-wien.ac.at>.
Hi Carsten:

> I don't have any knowledge of BSF - but I now a little bit about Cocoon.
> Sorry, I can't follow you: where is this method call of call() and
> about what source are you talking?

Well, this is a kind of a very special question and has to do with the BSF-utiltity. Basically it
allows for calling non-Java-languages from within Java and allows also for those non-Java-programs
to call back into Java. Various Apache projects are employing BSF (was developed by IBM as
open-source and has been handed over to Apache).

BSF in the context of XSL-transformations allows for defining extensions (i.e. functions written
e.g. in JavaScript, in Perl, ie. extending the class BSFEngineImpl). In theory any implemented
BSF-language can be handled uniformely. In the context of Cocoon it is the first time that the
RexxEngine for BSF does not work. It seems that the way the BSF-RexxEngine is called causes a
problem: the name of the function and the argument(s) are supplied, but not the source code of the
program (in this case the Rexx program).

So I would like to know how I could get a hold of the source code at runtime to be able to invoke
it.

To make it maybe a little bit more interesting, I enclosed the following files:

    - page2html-javascript.xsl - contains a JavaScript function as an extension to XSLT
    - hello-page2html.xml - xml-file to be processed (using a JavaScript function)

(   - XML nach HTML.htm - the resulting HTML-file  )

This JavaScript version works with Cocoon, due to BSF.

The question to the developers in the know: how is it possible to access the source of the program
(in the file "page2html-javascript.xsl it is defined in a CDATA-section)? [The call() method is a
method defined in BSFEngineImpl(), and it seems to me that it is not being used correctly, at least
not the way I read the original BSF documentation.]

*Any* help, *any* hint highly appreciated !

TIA,

---rony



RE: BSF - *any* knowledge at all in this group ? (Re: BSF (Bean Scripting Framework) and Cocoon's usage of it ?? (Re: Seeking help on BSF calling a non-Java language engine (Rexx) ...

Posted by Carsten Ziegeler <cz...@s-und-n.de>.
Hi,

I don't have any knowledge of BSF - but I now a little bit about Cocoon.
Sorry, I can't follow you: where is this method call of call() and
about what source are you talking?

Carsten

> -----Original Message-----
> From: Rony G. Flatscher [mailto:Rony.Flatscher@wu-wien.ac.at]
> Sent: Friday, September 13, 2002 12:50 PM
> To: cocoon-dev@xml.apache.org
> Subject: BSF - *any* knowledge at all in this group ? (Re: BSF (Bean
> Scripting Framework) and Cocoon's usage of it ?? (Re: Seeking help on
> BSF calling a non-Java language engine (Rexx) ...
> 
> 
> Hi there,
> 
> so far I have not received one answer to the BSF-related 
> question. As I really want to get the Rexx
> and Object Rexx BSF engines to work flawlessly with cocoon, I 
> wonder what I could do from this point
> on.
> 
> Would the Xalan-group be more knowledgable/willing to help?
> 
> TIA,
> 
> ---rony
> 
> 
> "Rony G. Flatscher" schrieb:
> 
> > Hi there,
> >
> > a couple of days ago I posted a question regarding the Bean Scripting
> > Framework's (BSF) usage of Cocoon. BSF allows Java programs to invoke
> > functions/scripts/programs written in non-Java languages and
> > originates
> > in an IBM alphawork project. In the past months a process has taken
> > place to hand it over to Apache.
> >
> > The problem: using BSF to add functions to XSLT works nicely with the
> > JavaScriptEngine of BSF, but does not work yet, if using the
> > RexxEngine
> > (either with the open source Regina Rexx interpreter or IBM's Object
> > Rexx, which is free for Linux, BTW).
> >
> > The reason: "Cocoon" uses the call()-method and supplies the name of
> > the
> > function (as defined in the appropriate XSLT document) and the
> > arguments
> > but not the source code, containing the Rexx code to be executed.
> >
> > Short of any other documentation, there is no way at the moment to
> > determine the location of the source code (in this case embedded in a
> > CDATA-section in the XSLT-file).
> >
> > Hence the plea for help: where is the source code stored, how can one
> > retrieve the source-code at run-time?
> >
> > Any help or any hint is highly appreciated!
> >
> > Regards,
> >
> > ---rony
> >
> >
> > Rony G. Flatscher wrote:
> >
> > >Hi there,
> > >
> > >have tried to research the mail-archives, the documentation and the
> > FAQ, but have not come up with a
> > >solution to a BSF-related problem, so my request for help in this
> > group of very ;) knowledgable
> > >people. Here's the problem:
> > >
> > >Extending the functionality of XSLT by defining a Rexx function which
> > should get called with the
> > >help of BSF during an XSLT-transformation. Obviously the
> > call()-Method is invoked and not apply(),
> > >which would supply the source-code in the form of a String.
> > >
> > >The BSF RexxEnigne call() method receives the declared function-name
> > and the argument(s), but not
> > >the source code. Here's the question: how is it possible at runtime
> > to get a hold of the source code
> > >(this is needed to be passed on to the used Rexx interpreter)?
> > >[Obviously, the RexxEngine is found and its call() Method is used, so
> > that part would be o.k.]
> > >
> > >Please, if you have any insights or hints which may help solve this
> > problem, then please do!
> > >
> > >(Would there be a way to force apply() to be used instead of call(),
> > which would supply the source?
> > >Or, could one indicate that the object-argument supplied to call()
> > which is set to null should
> > >possess the sourcecode?)
> > >
> > >---
> > >
> > >Should you need an example (XSLT defining the extension embedding the
> > Rexx code etc. and a short
> > >XML-file to be processed, URL to the Rexx-support for BSF), then
> > please let me know.
> > >
> > >Thanks in advance,
> > >
> > >---rony
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> > For additional commands, email: cocoon-dev-help@xml.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


BSF - *any* knowledge at all in this group ? (Re: BSF (Bean Scripting Framework) and Cocoon's usage of it ?? (Re: Seeking help on BSF calling a non-Java language engine (Rexx) ...

Posted by "Rony G. Flatscher" <Ro...@wu-wien.ac.at>.
Hi there,

so far I have not received one answer to the BSF-related question. As I really want to get the Rexx
and Object Rexx BSF engines to work flawlessly with cocoon, I wonder what I could do from this point
on.

Would the Xalan-group be more knowledgable/willing to help?

TIA,

---rony


"Rony G. Flatscher" schrieb:

> Hi there,
>
> a couple of days ago I posted a question regarding the Bean Scripting
> Framework's (BSF) usage of Cocoon. BSF allows Java programs to invoke
> functions/scripts/programs written in non-Java languages and
> originates
> in an IBM alphawork project. In the past months a process has taken
> place to hand it over to Apache.
>
> The problem: using BSF to add functions to XSLT works nicely with the
> JavaScriptEngine of BSF, but does not work yet, if using the
> RexxEngine
> (either with the open source Regina Rexx interpreter or IBM's Object
> Rexx, which is free for Linux, BTW).
>
> The reason: "Cocoon" uses the call()-method and supplies the name of
> the
> function (as defined in the appropriate XSLT document) and the
> arguments
> but not the source code, containing the Rexx code to be executed.
>
> Short of any other documentation, there is no way at the moment to
> determine the location of the source code (in this case embedded in a
> CDATA-section in the XSLT-file).
>
> Hence the plea for help: where is the source code stored, how can one
> retrieve the source-code at run-time?
>
> Any help or any hint is highly appreciated!
>
> Regards,
>
> ---rony
>
>
> Rony G. Flatscher wrote:
>
> >Hi there,
> >
> >have tried to research the mail-archives, the documentation and the
> FAQ, but have not come up with a
> >solution to a BSF-related problem, so my request for help in this
> group of very ;) knowledgable
> >people. Here's the problem:
> >
> >Extending the functionality of XSLT by defining a Rexx function which
> should get called with the
> >help of BSF during an XSLT-transformation. Obviously the
> call()-Method is invoked and not apply(),
> >which would supply the source-code in the form of a String.
> >
> >The BSF RexxEnigne call() method receives the declared function-name
> and the argument(s), but not
> >the source code. Here's the question: how is it possible at runtime
> to get a hold of the source code
> >(this is needed to be passed on to the used Rexx interpreter)?
> >[Obviously, the RexxEngine is found and its call() Method is used, so
> that part would be o.k.]
> >
> >Please, if you have any insights or hints which may help solve this
> problem, then please do!
> >
> >(Would there be a way to force apply() to be used instead of call(),
> which would supply the source?
> >Or, could one indicate that the object-argument supplied to call()
> which is set to null should
> >possess the sourcecode?)
> >
> >---
> >
> >Should you need an example (XSLT defining the extension embedding the
> Rexx code etc. and a short
> >XML-file to be processed, URL to the Rexx-support for BSF), then
> please let me know.
> >
> >Thanks in advance,
> >
> >---rony
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org