I want to add some context paramters to my odata service.
The parameters i want to include in the url as param (after the service name) so that the url can be used in excel
How would one be able to receive and parse any addition param supplied in the url before the odata service does it's thing?
(i'm using Olingo)
You can use custom query options. See 5. Custom Query Options here: http://www.odata.org/documentation/odata-version-2-0/uri-conventions/
In Olingo, the GetEntityUriInfo, PostEntityUriInfo etc interfaces define a getCustomQueryOptions method: https://olingo.apache.org/javadoc/odata2/org/apache/olingo/odata2/api/uri/info/GetEntityUriInfo.html#getCustomQueryOptions--
You can refer the scn blog about adding a custom annotation to metadata
Refer the link
https://blogs.sap.com/2016/10/02/adding-custom-annotation-and-labels-to-metadata/
Related
I've created an ADF flow that loops over URL's to fetch OData using the OData connection.
However, not all fields are available in all URL's, there are certain ones that are available in one URL, but not in the other. A $Select is used to select the fields that we need.
Is it possible to have an optional selection (as in, if the path is not available, do not fetch this field and return null instead for instance)? Would help us a great deal.
I've tried adding ? after the field, but that does not work. $select=Field1,Field2,FieldOptional?
Thanks
As I understand you are trying to loop through a bunch of a URL and the query on the ODATA URL will change and so will be the fields . I think you can use a lookup where you pass the unique url and its gives the fields and then concatenate the url with the fields and make a odata call .
Do you have a recommendation for creating a dynamic URL on a form (to open another form in a new window):
I should use buttons and how I can to configure that?
I should use explanatory text and how I can configure that?
This will be become easier when RFE 2427 is implemented. For now, you can use the technique described in this answer.
In the context of that question, the URL comes from a property. For your case, you're not saying what logic determines the dynamic URL, but I imagine that you can implement it in XPath. If it is indeed the case, you can just replace the call to xxf:property('com.example.siteurl') by your own XPath.
I have a Web API project I am working on in Visual Studio 2013, and I'd like for my Controllers to accept a comma separated list of values via the query string, similar to this:
http://localhost:12345/api/Procedures/1?embed=doctors,drugs&fields=fieldA,fieldB,fieldC
The reason for this is that I'd like to be able to control if related resources (additional tables) are queried via custom embedding using the embed parameter, and control what fields are returned from the base object using the fields parameter.
I've done some searching on Google but most of what is being suggested relates to extending IModelBinder (http://www.strathweb.com/2013/04/asp-net-web-api-parameter-binding-part-1-understanding-binding-from-uri/) or setting up a custom ActionFilterAttribute (Convert custom action filter for Web API use?) which seems like overkill for something relatively simple.
FYI I am using an Entity Framework dbContext class to connect to my database.
The comma character does not have any specific meaning in HTTP query strings so it does not get treated as a separator by out-of-the-box model binding mechanisms.
As far as I know the approach you mentioned with custom attributes is the simplest you can get. And it does not look like an overkill considering you will only implement the attribute once and use everywhere.
for our scopes we need to use unique ID generated by us for the answers submitted by users. This is possible by adding "?c=" at the end of the survey link followed by the ID number.
Example Format: http://www.surveymonkey.com/s/XXXXX?c=00001
The terrific problem is that the custom value is not returned anyway via API. It is not added as a property of the Answer object neither its value replaces somehow the respondant_id property.
We see that you are able to expose that data from your internal endpoints that you use for your proprietary web interface but how to get this data from he outside via API?
Thanks
When you call 'get_respondent_list', ensure you pass through 'custom_id' in the list of strings in the 'fields' parameter. This will then be returned in the output with the custom value you entered.
i am using Model View Controller , How can I encrypt my query string URL for my edit and delete views ?
Not complete answer, but you may build/implement your logic using the technique shown at and my notes below that:
http://haacked.com/archive/2010/02/21/manipulating-action-method-parameters.aspx/
Additional logic:
Build encryption and decryption methods, which accept values.
While creating the URL/ActionLink, encrypt values using the method and attach value, and while decoding the value, decrypt and set the values to parameters. (using technique mentioned in above link)
You can also refer the project below to implement using URL Rewriting.
https://github.com/sethyates/urlrewriter