You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Chris Howe <cj...@yahoo.com> on 2007/01/21 23:12:13 UTC

simple-method call-*-method behavior

Okay, I think I've figured out the problem and it seems to be mostly this side of the keyboard.

Consider the following:

========>
<call-object-method method-name="createManagerConnection" obj-field-name="factory" ret-field-name="managerConnection"/>
<create-object class-name="org.asteriskjava.manager.action.OriginateAction" field-name="originateAction"/>

<call-object-method method-name="sendAction" obj-field-name="managerConnection" ret-field-name="originateResponse">


    <field field-name="originateAction"/>


    <field field-name="timeout" type="Long.TYPE"/>


</call-object-method>
<========

this fails because field-name="originateAction" gets passed as a string.  So, I then tried this:

========>


<call-object-method method-name="sendAction" obj-field-name="managerConnection" ret-field-name="originateResponse">


    <field field-name="originateAction" type="org.asteriskjava.manager.action.OriginateAction"/>


    <field field-name="timeout" type="Long.TYPE"/>


</call-object-method>
<========

this fails because the method I'm trying to invoke is actually:

========>
managerConnection.sendAction(org.asteriskjava.manager.action.ManagerAction, long)
<========

However, OriginateAction implements a class (EventGeneratingAction) that extends ManagerAction.
The following works (after the CachedClassLoader patch from OFBIZ-400)

========>

<call-object-method method-name="sendAction" obj-field-name="managerConnection" ret-field-name="originateResponse">

    <field field-name="originateAction" type="org.asteriskjava.manager.action.ManagerAction"/>

    <field field-name="timeout" type="Long.TYPE"/>

</call-object-method>
<========

My question is:  Given the nature of minilang, is it possible to NOT default the field type to string so that Java will take care of resolving the methods that aren't extended in the object's class?

Thanks!

Chris


BTW: I've now successfully implemented a service that implements a simple method equivalent of the HelloManager tutorial http://asterisk-java.org/development/tutorial.html to connect to a remote asterisk PBX. I obtained the jars from the following projects:

Project says MIT License:
gjtapi-20060515.jar -https://sourceforge.net/project/showfiles.php?group_id=40963
jtapi-1.3.1.jar - https://sourceforge.net/project/showfiles.php?group_id=40963

Project says Apache License
asterisk-jtapi-0.2.jar - http://sourceforge.net/projects/asterisk-jtapi
asterisk-java-0.3-m1.jar - http://asterisk-java.org/

For collaboration, should I implement a component for specialpurpose or just kick it around the ofbiz-sandbox project or just do a writeup for docs.ofbiz.org?