I need to get navigation properties data.
Does anybody know how to use navigation properties using SAP Cloud SDK?
I created a VDM by SAP Cloud SDK VDM Generator.
The source OData is V2 and on S/4 HANA, which is generated by CDS View.
What I want to execute is like following.
HTTP Method: GET
Path: <host, domain, port and path>/(parameter='test')/Set?&fileter=filed eq 'hoge'
You can either fetch the data directly by expanding the navigation properties in the OData call OR fetch them at a later point in time.
To follow the first approach leverage the select functionality of your service class. Pass in the navigation property that you want to retrieve e.g. MyEntityClass.TO_MY_NAVIGATION_PROPERTY. Check out the Cloud SDK documentation for the details and an example.
You then obtain the data by invoking its dedicated Getter on the result entity of your query e.g. myEntityObject.getMyNavigationPropertyIfPresent(). Or you omit expanding in your original request and use myEntityObject.getMyNavigationPropertyOrFetch(). This will again query the server specifically for the data of the navigation property.
Internal Incidents
Stackoverflow
Thank you for replying.
Let me explain in detail.
I created an OData from CDS View on S/4HANA 1709.
The CDS View is with parameters.
The OData should be called like this.
/(parameter='value')/Set?$filter=field eq 'value'
When I tried to call without navigation property, it occurs an error.
/(parameter='value')
Besides, I need "filter" parameter for navigated entity,
since it gets too many records without filtering.
So I don't want to use the both expansion and 2-step fetch.
As workaround, I developed a function module which retrieves data from CDS view.
Related
I have a requirement where I need to search a particular term in App insights and then export this 'report' and send it in the email. Consider this as "report a bug" use case.
So if I search key "xxxxxx123", it should retrieve all matching traces/logs and then export it to either excel or CSV.
So my question is, is it possible with the NuGet package or even with REST API?
I tried looking at this, but couldn't find it helpful,
dev.applicationinsights.io/apiexplorer
There is no nuget package. You can do it by using the Get query rest api.
Write any query you need in the Query textbox, then in the right side, you can see the generated request. Then you can use c# or other programming language to query the results, as per this article.(Note: remember use your real Application ID and API Key).
Add a screenshot for your reference:
After fetch the data, you should write your own logic to export it to csv or excel.
I have used Liferay search container for displying data for custom entity and it is working.
I have another portlet where data coming from REST API so is there any way that I can use search container? OR I need to use datatable for that.
My REST API is with pagination and without pagination.
You can use SearchContainer with any data. Its uses with DB is more natural of course but where the data comes from is irrelevant as long as SearchContainer can access it. So you can build your own service that talks to remote API and provides data to the SearchContainer. In case you haven't done that for your other service, see here for example how it can be build server side.
i would like to ask your help in relation with one issue i am facing. So basically i defined a swagger 2.0 spec for an API, and on the operation's responses i used the schema property in order to reference some definitions for objects that reflect the responses structure. I validated the spec on the Swagger Editor, and it is valid, and also if i generate the client code, using Swagger Codegen, the client app works well consuming the API. Now, the problem is. I went to the Developer Portal and on the API's details page, i checked the API definition (Open API option) and i compared the spec with my original spec that i used to import the API on the API Management service. And i noticed that the schema property is missing, so it is not referencing the schema of the response. Any idea?
Thanks
I figured out the issue. Apparently using the schema property on the responses, according to Swagger 2.0 spec, you can use nested $refs, in order to reference definitions inside each other. But apparently, it is not possible for Azure API Management Service, since it is mentioned as a limitation in the following link: API Management - API Import restrictions.
Anyway, i will try to change my API's spec in order to avoid nested $refs and workaround the issue.
Thanks
What is the best way to consume an external api's data?
Do I need to create a new web api project and set up routing?
In the past I use a web service data source and attached a repeater. This won't work because I have an API instead of a web service.
Thanks much
you can try this, this is how i've converted my JSON / XML apis (or anything really) into a Transformable object, just clone this tool and adjust to your needs
https://devnet.kentico.com/marketplace/utilities/universal-api-viewer-(with-hierarchy-support)
A custom Data Source is what you would still want to do, as all a data source does really is return a Data Table, my tool there takes it another step by assigning it hierarchy structure and psuedo page types so the Repeater can treat them like items on the content tree.
After reading you can now connect externally do the database, you can use Kentico's ConnnectionHelper to connect to the external database via the Connection String, then query it.
If you have access to the external database, then you can use Kentico's ConnectionHelper class to pass in the external database connection string and run queries against it if you wish.
GeneralConnection ConnectionObj = ConnectionHelper.GetConnection("GetConnectionStringFromWeb.ConfigHere");
ConnectionObj.Open();
DataSet Results = ConnectionObj.ExecuteQuery(new QueryParameters("select * from SomeTable", null, QueryTypeEnum.SQLQuery));
As far as I got it so far, OData is more meant to consume data, i.e. in a read-only manner. I want to ask whether it's intended to use OData to invoke remote functions, for example a Domain Service's method.
When looking at the OData 4.0 spec, chapter 4.3 "Addressing Entities", there are indeed terminologies like actionCall, entityFunctionCall etc. But this so far is of course also only meant for "serving", I assume.
I'd like to do something like http://example.org/service/BankAccountDomainService/ApproveBankAccount(abcde-123456)... Does that make sense?
If I understand you correctlu, you want to invoke an unbound action, which is called "Action Import" since your action "ApproveBankAccount" does not bounded to any type....
According to the Odata Protocol, the folloding URL should be "POST": the "Account" should be included in Payload.
URL: http://example.org/service/BankAccountDomainService/ApproveBankAccount()
Payload: { abcde-123456 }
Aternatively, you can also design bounded action "Approve" on entity type "BankAccount", the posted URL should be:
http://example.org/service/BankAccountDomainService/BankAccount(abcde-12345)/NameSpace.Approve()
OData is a standardized protocol for creating and consuming data APIs. OData builds on core protocols like HTTP and commonly accepted methodologies like REST. The result is a uniform way to expose full-featured data APIs.
Except providing functions and actions bound to entities, OData also provides service level functions and actions.
Please reference this URL for the sample:
https://aspnet.codeplex.com/SourceControl/latest#Samples/WebApi/ODataActionsSample/
But it is based on OData v3, and there will soon be samples for OData v4.