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

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>

Related

SAPUI5: How to create a control hierarchy?

I hope you can help me with this. After reading all the documentation several times, googling for days, etc I don't find the way to do what i'm going to explain in a clean way, and in think I'm missing something because it's a really basic scenario.
I'm working with oData models, in this case 2 named models, "Model1", "Model2". Now what I want is to show a "parent" ComboBox based on an oData path, and a table that changes its items depending on the selection, in other words.
Model1 { //JSON representation of the data.
Accounts:[
"account 1": {invoices: ["invoice1", "invoice2", "invoice3"]},
"account 2": {invoices:["invoice4", "invoice5"]}
]
}
Combo Box:
<... items={Model1>/Accounts} /> -- This works and shows Account 1, and Account2.
Table
<Table... items="{Model1>Invoices}">
..
<items>
....
</items>
</Table>
What I want is the table to change it's context to the account selected on the ComboBox. The point is that this works, but the first time it loads the view, as there is no account selected, it calls the wrong odata path MYSERVICE/Invoices, instead of doing nothing, as the Account is not set yet, and the path for the invoices, once selected the account, shoud be MYSERVICE/Account('Account1')/Invoices for example.
I know I can achieve this with code, but I'm sure there must be a clean way to do this.
Seriously, this is driving me crazy.
Thanks for your help.
Are you sure that
items="{Model1>Invoices}"
triggers odata call? Because this is a relative path (without leading slash), normally it should not do the call.
What you can do:
Handle ComboBox selectionChange event;
In this event handler, create a path that you will bound the table to. In your case the path could look like this: "/Account(Account1)" - "/{EntitySetName}({KEY})". You can make use of createKey method of ODataModel2;
Set the table's context using the path:
oTable.bindObject({
path: sPath,
model: "Model1",
parameters: {
$expand: "Invoices"
}
});
Once the context is set, the relative binding will start working automatically and table will get the "Invoices"
I assume that the Account and Invoices are linked via navigation property and one-to-many cardinality, that's why the $expand parameter will load the corresponding invoices.

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.

grails access form attributes in controller

In grails i have a form with g:field tags like:
<g:field name="test" from="0..20"/>
I am trying to find a way how I can access the "from" attribute in my controller.
I can get the "value" attribute by using:
print params.test
I have tried:
print params.test.from
I'm sure there must be a way to do this but I can not seem to find it.
What I am wanting to achieve by this is perform validation so that the value does not go outside the the from range.
I know that this can be added in the domain, but in my situation I need to allow the user to overwrite the range constraints.
Any ideas?
By the time that code hits the browser, it is just HTML. from doesn't exist anymore. If that is being rendered into some sort of client side validation, that's not going to get submitted back to the server in a form submit.
If you explain what you are really needing to do in your question, I can provide a better answer.
You can pass the "from" values as hidden fields.
<g:hiddenField name="min" value="0" />
<g:hiddenField name="max" value="20" />
Something like that.

Set request parameter in Orbeon

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.

what should my URLs look like for this simple REST web service?

I'm new to REST but I've built a simple web service and I'm having trouble finding a simple explaination of what URL format would be correct.
The service allows to create an invoice and push it through a series of simple approval phases.
(1) Read all invoices in an XML format:
GET: http://localhost/webapp/ws/invoices
(2) Read one invoice in an XML format (ex. invoice id = 555):
GET: http://localhost/webapp/ws/invoices/555
(3) Submit a new invoice:
POST: http://localhost/webapp/ws/invoices
With the invoice attributes ("userid", "totalprice", etc) are included like the POST parameters of a simple HTML form.
(4) Approve an invoice:
POST: http://localhost/webapp/ws/invoices/action
With the action attributes (ex. "userid=123", invoiceid=567, "action=APPROVE" or "REJECT", etc) are included like the POST parameters of a simple HTML form.
It works fine, but is that even close to what a RESTful web service is supposed to look like?
Any advice is greatly appreciated, thanks.
Rob
The URLs don't make an API RESTful or not. It is more important to clearly represent your resources and their state transitions (through links and forms) and avoiding out-of-band information that couples clients to your implementation. A RESTful Hypermedia API in Three Easy Steps covers this concept nicely.
1) Create a root resource that provides a well know starting point for all clients and allows them to discover the services available (this can be the same URL used by Browers. Use the Accept header to determine if HTML or your APIs media-type should be returned).
GET: http://localhost/webapp
<webapp href="/webapp">
<invoices href="/webapp/invoices"/>
... any other services ...
</webapp>
2) Create a collection resource for you invoices
GET: http://localhost/webapp/invoices
<invoices href="/webapp/invoices">
<invoice href="/webapp/invoices/555"/>
<invoice href="/webapp/invoices/554"/>
<invoice href="/webapp/invoices/553"/>
<invoice href="/webapp/invoices/552"/>
...
<search href="/webapp/invoices/" method="get">
<query type="xpath" cardinality="required"/>
</search>
<next href="/webapp/invoices?page=2" method="get"/>
<create-draft href="/webapp/invoices" method="post">
<total-price type="decimal" cardinality="optional"/>
... user should be picked up automatically based on the authorised user posting the form ...
... add other optional and required parameters here. ...
</create-draft>
</invoices>
This is a paginated collection, with the next element telling the client how to get the next page. If there weren't enough invoices (e.g., 5 invoices and each page can contain 10) then the next element would not be show. Similarly if the requester is no authorised to create invoices then the create-draft form would not be included.
Getting the next page would look something like:
GET: http://localhost/webapp/invoices?page=2
<invoices href="/webapp/invoices">
<invoice href="/webapp/invoices/545"/>
<invoice href="/webapp/invoices/544"/>
<invoice href="/webapp/invoices/543"/>
<invoice href="/webapp/invoices/542"/>
...
<search href="/webapp/invoices/" method="get">
<query type="xpath" cardinality="required"/>
</search>
<next href="/webapp/invoices?page=3" method="get"/>
<prev href="/webapp/invoices" method="get"/>
<create-draft href="/webapp/invoices" method="post">
<total-price type="xs:decimal" cardinality="optional"/>
... user should be picked up automatically based on the authorised user posting the form ...
... add other optional and required parameters here. ...
</create-draft>
</invoices>
3) Create an item resource for your invoices
GET: http://localhost/webapp/invoices/555
<invoice href="/webapp/invoice/555">
... details go here ...
<reject href="/webapp/invoices/555" method="delete">
<reason type="xs:string" cardinality="required"/>
</reject>
<approve href="/webapp/invoices/555" method="put">
... add approval parameters here ...
</approve>
</invoices>
Similarly, if the user is not authorised to reject or approve invoices then those elements should not be displayed. Same goes if the invoice has already been approved (in which case maybe there is a cancel form).
IMHO for the approval process I would do:
(4) Approve an invoice:
PUT: http://localhost/webapp/ws/invoices/555
As you are going to modify an existing resource, identified by the ID (555), so you only need to pass the attributes that will change.