cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lochschmied, Alexander" <Alexander.Lochschm...@Vishay.com>
Subject RE: SourceResolver from Java (via flow)
Date Wed, 28 Oct 2009 10:48:49 GMT
Pass the cocoon object to the Java class:

      public JavaClass(Object form, FOM_Cocoon cocoon) {

            this.cocoon = cocoon;

            ...

 

Then SourceResolver can be accessed:

            Object o =
cocoon.jsFunction_getComponent(org.apache.cocoon.environment.SourceResol
ver.ROLE);

            SourceResolver sr = (SourceResolver)
((org.mozilla.javascript.NativeJavaObject) o).unwrap();

 

Not sure if that the right way to do it but it works.

Alexander

 

From: Lochschmied, Alexander 
Sent: Dienstag, 27. Oktober 2009 10:57
To: 'users@cocoon.apache.org'
Subject: SourceResolver from Java (via flow)

 

Hello,

 

(How) can I access the SourceResolver from a custom Java object that is
invoked through flowscript?

(How) can I access the Cocoon object from a custom Java object that is
invoked through flowscript?

 

Thanks!

Alexander


Mime
View raw message