Liferay action triggered by orbeon button

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Liferay action triggered by orbeon button

r.pecori
Hi,

I am running Orbeon Forms 4.0.0.rc1.201302120214 PE with development licence.

I am showing orbeon forms in the form runner portlet and I need something like this:
when I press the Orbeon SAVE button, data are saved into the Mysql DB (and this is already done) and
moreover a custom action is triggered.

The particular action would be to trigger liferay workflow (and this I have already done from a custom portlet and a custom button), but how can I trigger an action by simply pressing an orbeon button?

Thank you
Reply | Threaded
Open this post in threaded view
|

Re: Liferay action triggered by orbeon button

Erik Bruchez
Administrator
How do you usually trigger Liferay workflow? Is that with Java code? Do you have an example of such code?

One idea would be to add a custom button which calls Java code via XPath.

-Erik
Reply | Threaded
Open this post in threaded view
|

Re: Liferay action triggered by orbeon button

r.pecori
This post was updated on .
I have a method within a liferay portlet that triggers the workflow by Java code.
I have exposed it as a JSON Liferay Web service that I can call from a certain URL and that receive as input a String (namely the xml)
Now I need to call this web service from orbeon.
I tried two ways:

- the workflow-send-button along with the following properties in properties-local.xml:

<property as="xs:anyURI" name="oxf.fr.detail.send.success.uri.*.*"
          value="<MY_WORKING_WEB_SERVICE_URI>"/>

<property as="xs:string" name="oxf.fr.detail.send.success.method.*.*" value="post"/>

- the following xform code catching the save event and calling a submission:
  <xf:submission id="submit_model_auctionItems"
                           ref="instance('fr-form-instance')"
                           action="<MY_WORKING_WEB_SERVICE_URI>"
                           method="post"/>
           
            <xf:action ev:event="xforms-submit-done" ev:observer="fr-create-update-submission">
           
                    <xf:send submission="submit_model_auctionItems"/>
                                 </xf:action> 


But neither works, I receive the Java error: java.lang.IllegalArgumentException: text/javascript is not a supported mime type.

I thought the xml was sent, not javascript. What's going wrong in your opinion?
Reply | Threaded
Open this post in threaded view
|

Re: Liferay action triggered by orbeon button

Erik Bruchez
Administrator
Probably what's happening is that the service is called, but Orbeon Forms fails after that because the service returns some JavaScript. Do you think this is possible? Can you share the stack trace which produces the java.lang.IllegalArgumentException?

Also, what happens if your service returns instead plain text or HTML?

-Erik