SourceResolver from Java (via flow)

View: New views
2 Messages — Rating Filter:   Alert me  

SourceResolver from Java (via flow)

by Lochschmied, Alexander :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

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


Parent Message unknown RE: SourceResolver from Java (via flow)

by Lochschmied, Alexander :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

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.SourceResolver.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@...'
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