form-builder embedding parameters, buttons and processes

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

form-builder embedding parameters, buttons and processes

falba48
Hello,

Is it possible to parameterize the form-builder embedded in the Java API, to give the name of the app and form, in the API headers?

<%    
    HashMap<StringStringmapa = new HashMap<StringString>();       
    
    mapa.put("app""Proves");
    mapa.put("form""test");
    
        API.embedFormJava(
            request,            // HttpServletRequest: incoming HttpServletRequest
            out,                // Writer: where the embedded form is written
            "orbeon",    // String: Form Runner app name
            "builder",          // String: Form Runner form name
            "new",              // String: Form Runner action name
            null,               // String: Form Runner document id (optional)
            null,               // String: query string (optional)
            mapa                // Map<String, String>: custom HTTP headers (optional)
        );
%>


Another question would be the consequences of changing the orbeon / builder buttons and processes in properties-local.xml.

I have managed to show only the save button and have it send a document-id to the servlet, and redirect to another page from the servlet.

Not seeing it in the documentation my question is about the consequences of doing this?

Is there any "then publish" metod?

Greetings and thanks.

<!-- Proves de parametritzar el form-builder -->
    <property as="xs:string" name="oxf.fr.detail.buttons.orbeon.builder">
        save-final
    </property>

<property as="xs:string" name="oxf.fr.detail.process.save-final.orbeon.builder">
    require-valid
    <!--        then email-->
    then save
    then send(
        uri        = "http://localhost:8080/formularis/ServletRepBuilder",
        method     = "POST",
        content    = "xml",
        replace    = "all"
    )
/>

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/f94ce33b-7b95-43f9-b0d7-ce4f46a110bf%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: form-builder embedding parameters, buttons and processes

Alessandro  Vernet
Administrator
Are you saying that you'd like to embed Form Builder, and would like to
provide the app/form name so users don't have to type it in the dialog that
shows up when you load Form Builder? If so, try passing them as request
parameters, in the query string, which is the 7th parameter to
`API.embedFormJava()`, just before the headers.

Doing this without the embedding API, which is maybe clearer, looks like
this, and you'll notice that if you load this URL you'll get right into Form
Builder without having to enter the app/form name:

https://demo.orbeon.com/demo/fr/orbeon/builder/new?fr-app=my-app&fr-form=my-form

For more on this, see:
https://doc.orbeon.com/form-builder/advanced/extensibility/integration#bypassing-the-new-form-dialog

You'll let me know if this works for you,

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1590431086366-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: form-builder embedding parameters, buttons and processes

falba48
In reply to this post by falba48
Yes, this works.

Is it possible to modify the buttons and processes of the from-builder? For a button to save, publish and send the information of that form to a Servlet to use it?

I've only got these parameters with empty XML, I don't know if this integration is possible.

Parameters received in the servlet

{app=[orbeon], form=[builder], form-version=[1], document=[27835e22478afebaf22f11399fe03f94a8d546a8], valid=[true], language=[en], process=[a49008ecc675e9f5be622166eaaab5fa051a5390], data-format-version=[4.0.0]}

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/2a35a0f6-d73a-4f1d-a4be-6d1583c3ad26%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: form-builder embedding parameters, buttons and processes

Alessandro  Vernet
Administrator
Mmh… it is not completely impossible, but it is tricky to run something after
the form has been published. What is your use case? What do you need to do
with the form after it is published?

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1590551367309-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: form-builder embedding parameters, buttons and processes

Alessandro  Vernet
Administrator
Have you found a way to do what you wanted on publish? Or, if not, do you
have any feedback about my question on your use case?

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1591159121790-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: form-builder embedding parameters, buttons and processes

falba48
Yes, I have found an alternative way to do it.

- I redirect to servlet with save button.
- With the $document-id that I receive, I publish the form with the API.
- Parsing the response XML to get the app-name and form-name.

But now I have new doubts.
I have created a cancel button in the form-builder, can orbeon redirect to the page where the user comes from? Or do I do it from a servlet?

The other question is: can I (when embedding the form-builder) specify the language of the form, as I would do with the app i form in the query?

Greetings and thanks.

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/75447ab4-2f10-445c-9d18-1a23d061cae8%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: form-builder embedding parameters, buttons and processes

Alessandro  Vernet
Administrator
Excellent, that's a good way to do it; I hadn't thought about it :).

> I have created a cancel button in the form-builder, can orbeon redirect to
> the
> page where the user comes from? Or do I do it from a servlet?

When the button is pressed, you could run some JavaScript that issues a
browser back. But that wouldn't work if the user opened the page in a new
tab. It seems to me that it would be better if can find a more predictable
way to find where to take the user in cases they press "Cancel", and
navigate to that place more explicitly. Maybe the caller of the embedding
API can pass that information to the form in an HTTP header or request
parameter, you can store it in a Hidden Field, and navigate to the value of
that field?

> The other question is: can I (when embedding the form-builder) specify the
> language
> of the form, as I would do with the app i form in the query?

Try passing the `fr-language` request parameter in the query string
parameter. Also see:
https://doc.orbeon.com/form-runner/features/localization#determination-of-the-forms-language

‑Alex



-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1591221636446-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: form-builder embedding parameters, buttons and processes

falba48
In reply to this post by falba48
Thanks for the answers.

The JS method would serve us. But I have not found the way to execute a JS on a button of the form-builder, how would it be done?

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/52c6fbce-d12a-4e50-8923-a79d7fca7471o%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: form-builder embedding parameters, buttons and processes

Alessandro  Vernet
Administrator
Hi,

You can run JavaScript through the `navigate()` action (see link below).
You'll let me know if this works for you.

https://doc.orbeon.com/form-runner/advanced/buttons-and-processes/actions-form-runner#navigate

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1591642071178-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: form-builder embedding parameters, buttons and processes

falba48
In reply to this post by falba48
Yes, this works, thanks.

Another question. When passing the language parameter, can one not directly supported be passed? 

For example Catalan. I have tried without result with ca, cat, etc. What parameter would it be? if possible. 

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/56993cf5-9f3f-4dca-8cef-e24d56f6c5dao%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: form-builder embedding parameters, buttons and processes

Alessandro  Vernet
Administrator
Hi,

Orbeon Forms uses 2 letter codes (ISO 639-1), so for Catalan use "ca". And
we currently don't have Form Runner localized in Catalan, but would love to.
I've put a link below to a page with more information about this, and if
you're ok with it, you can also contribute your localization so it can ship
out-of-the-box in future versions of the product.

https://doc.orbeon.com/contributors/localizing-orbeon-forms

And you can pass the language explicitly with the `fr-language=ca` request
parameter in the query string
parameter.

https://doc.orbeon.com/form-runner/features/localization#determination-of-the-forms-language

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1591724575590-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: form-builder embedding parameters, buttons and processes

falba48
In reply to this post by falba48
Can the red part of the image be in Catalan with the query parameter?
I could not do it

form-runner-not-ca.jpg


--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/bd275bf6-86fa-4b9b-8904-f0ca87df0b4co%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: form-builder embedding parameters, buttons and processes

Alessandro  Vernet
Administrator
This is because you created an English form. Instead, you need to create a
form in Catalan. With Orbeon Forms PE, you can have a single form in
multiple languages. With Orbeon Forms CE, only one language per form is
supported. For more on this, see:

https://doc.orbeon.com/form-builder/localization

Now, you can’t just use Catalan in Form Builder, because it isn’t one of the
supported languages. First, you’ll want to localize Form Runner in Catalan.
You’ll find more information about that in the 1st page linked below. Then
you can add “ca” to the available languages, and set it as the default
language.

https://doc.orbeon.com/contributors/localizing-orbeon-forms
https://doc.orbeon.com/configuration/properties/form-runner#available-languages
https://doc.orbeon.com/configuration/properties/form-runner#default-language

Does this sound like a plan?

-Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1591922639270-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: form-builder embedding parameters, buttons and processes

falba48
In reply to this post by falba48
I will continue to review the information.

Thank you for answering my questions.

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/66ca4edb-383e-45fd-80de-471ad648f11bo%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: form-builder embedding parameters, buttons and processes

Alessandro  Vernet
Administrator
Sounds good, and of course just let us know if you encounter any difficulty
localizing Form Runner in Catalan.

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1592613830635-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet