Set request parameter in Orbeon - eclipse

I am very new to Orbeon and XForms.
I have created a form with input field "BaseId"
<xf:input id="control-3-control" bind="control-3-bind">
<xf:label ref="$form-resources/control-3/label"/>
<xf:hint ref="$form-resources/control-3/hint"/>
<xf:help ref="$form-resources/control-3/help"/>
<xf:alert ref="$fr-resources/detail/labels/alert"/>
</xf:input>
and i want when i summit this form, in crud.xpl
method PUT i cant get value of BaseId through
<sql:param type="xs:string" select="/request/baseid"/>
Help me,please
Sorry for my bad English

The value of controls are passed to the persistence layer REST API in an XML document, as the body of the HTTP request. So in crud.xpl (say the one for eXist), this will be a document under /request/body. The exact path depends on your section and control name. For instance, if the section is named address and the field city, the value will be under /request/body/form/address/city.

Related

How can i save the campaign name from responsys on a form

I'm trying to get the name of the campaign where the person opened the form and save it in the supplemental table of the form.
I saw that it has the campaignname() function but I didn't know how to use it.
the form call in the body of the email:
$personalizedform('test_form', 'EMAIL_ADDRESS_',concat(CAMPAIGN_NAME=campaignname()))$
and the hidden field in the form:
<input type="hidden" name="CAMPAIGN_NAME" value="$CAMPAIGN_NAME$">
i managed to figure out how to do this and it was really dumb of me not to notice it but i can just use campaign.name in the form call
Based on what the limited information, I'd think that you'd want to write your form input to a supplemental table using the form rules, and have the input name/id match a column in your supplemental table.
The freemarker/RPL code to pass campaign name to a form would look something like this: ${form('test_form','EMAIL_ADDRESS_','CAMPAIGN_NAME='+campaign.name())}
Sources:
Responsys Form Method
Responsys Namespace Reference

How can I query delll boomi MDH field thats not in match rule?

I am new to MDH and I would like to know how to query MDH field directly thats not in match rules.
I have a model that has 5 fields (Src_id, name, email, updated_date, created_date) and we have a match rule on Src_id which is also ID in MDH.
But, I would like to search on name and get the Src_Id is it possible? if not, do I need to make any changes to my model
Any help is highly appreciated.
There are two avenues for "querying" your master data hub.
MDH Web UI
Boomi MDH API
You say you would like to search "Name" and get "Src_Id". If you using avenue
(1) - you simply go to UI and select "Add Filter"->"Field Data"->select "Name"->select operator "Equals"->{fill in name you'd like to search for} --> The entire Golden Record is returned and you can see it via the UI or by clicking the timestamp to pull up the record in depth
(2) refer to https://help.boomi.com/bundle/hub/page/r-mdm-REST_APIs.html
specifically "Query Golden Record". You would fill in all the necessary API information (URL)+Basic Auth based on Repository+universe id-based on model, etc.
Your request body would look like:
<RecordQueryRequest>
<view>
<fieldId>SRC_ID</fieldId>
</view>
<filter>
<fieldValue>
<fieldId>NAME</fieldId>
<operator>EQUALS</operator>
<value>{INSERT NAME TO SEARCH}</value>
</fieldValue>
</filter>
</RecordQueryRequest>
Response will be in XML corresponding to your model: eg)
<RecordQueryResponse resultCount="1" totalCount="1">
<Record recordId="GUID" createdDate="TIMESTAMP" updatedDate="TIMESTAMP" recordTitle="DERIVED BY MODEL">
<Fields>
<rootelementname>
<src_id>123</src_id>
</rootelementname>
</Fields>
</RecordQueryResponse>

How to configure a dynamic autocomplete in Orbeon Forms?

I need to use a dynamic autocomplete based on ws rest to show suggestions of my field. I used it but it didn't work, it didn't update the list of suggestions. Example:
<fr:autocomplete
id="control-3-control"
appearance="minimal"
labelref="#label"
resource="http://127.0.0.1/api/ws/pays/all"
bind="control-3-bind">
<xf:label ref="$form-resources/control-3/label"/>
<xf:hint ref="$form-resources/control-3/hint"/>
<xf:alert ref="$fr-resources/detail/labels/alert"/>
<xf:itemset ref="./_">
<xf:label ref=".//libelle"/>
<xf:value ref=".//id"/>
</xf:itemset>
</fr:autocomplete>
And this is the screenshot:
Doing the "filtering" based on the value entered by users is the responsibility of the service the autocomplete is calling. However, it can't do this if you don't provide it with the current value of the field. For this, use {$fr-search-value} somewhere in the URL, e.g. something like:
http://127.0.0.1/api/ws/pays/all?search={$fr-search-value}
And of course, then your service needs to take the value of the search request parameter into account. The autocomplete component will automatically call the service again and again, as necessary as users type in the field.
This allows you to search in a large dataset without having to return the whole set of possible values to Orbeon Forms.

Action object Form Object Command Object

Can someone explain in the context of a Web application what do these mean? I am reading up on Spring MVC reference and see these terms thrown around.
These are referring to a bean that is the the target for the data in the form fields. I.e if you have a Person bean with username, address, email etc etc then you might have a registration.jsp with a form that your users enter all these various details, with an attribute path set in the form tag, e.g. path="username" etc. Once they post the form all the information that they have entered will be matched up from the path attributes and mapped to the corresponding appropriate fields in your Person class.
Example jsp:
<form:form ... commandName="person">
<input type="text" ... path="username">
Person class
Private String username;
Spring docs here: http://docs.spring.io/autorepo/docs/spring/3.2.x/spring-framework-reference/html/view.html

Orbeon 4.1 custom REST persistence

I have been struggling for over a week with trying to setup a custom ORBEON REST persistence.
I am using the Struts 2 MVC framework with the following configuration:
<action name="/crud/{appName}/{formName}/form/form.xhtml" class="com.example.CrudController" method="executeForm" />
<action name="/crud/{appName}/{formName}/data/{uuid}/data.xml" class="com.example.CrudController" method="executeData" />
<action name="/search/{appName}/{formName}" class="com.example.SearchController" />
The problem is that only the first action is being called.
From the Form Builder, when I click on a form record (say "foo"), this is called:
GET http://localhost:8080/mycontext/app/crud/myapp/library/form/form.xhtml
Notice that, myapp is the correct application name but library is not the correct form name (which should be "foo").
From Form Runner, when I try the "foo" summary or new pages, this is called:
GET http://localhost:8080/mycontext/app/crud/myapp/foo/form/form.xhtml
This time the form name is correct, however I expected a /search/... call instead. Nevertheless I tried responding with either the xform xml or a query result with no success.
The call to /crud/myapp/library/form/form.xhtml is normal: it isn't done by Form Runner to load your form, but to load your app-specific section templates library, which is stored in the reserved library form name. So most likely your implementation of the persistence API should return a 404, since it doesn't have a form myapp/library.
As to the query to /crud/myapp/foo/form/form.xhtml when you access the new page for a myapp/foo, this is just Form Runner loading the form definition for myapp/foo. The query to the search API is only done by the summary page, to list data for a specific form.