on 03-15-2016 3:27 AM
Hi All,
I'm extending the My Inbox app, and rather than modify the RFC signature within the Task Gateway for each service to get back-end data; I've decided it is more elegant (and supportable) to create a new service (per backend) that can be used to extract additional data from a single work item (e.g. Purchase Order information) for a specific task/work item.
Whether this is right or wrong is a discussion for another post I'll do later; but my question is how to have both the original service model (/IWPGW/TASKPROCESSING) and my new task set-up in the extension project via WebIDE.
Currently, I have it working if I add the mock utility and load the model manually in the init of the component file:
this._startMockServer(sServiceUrl); | ||
this._initODataModel(sServiceUrl, "MyCustomService"); |
But I'd prefer to use the existing framework that WebIDE supports which involves .project.json set-up, the manifest.json and an unavailable configuration.js file in my extension project.
I did note that the mockpreview tag in .project.json does support being an array (while the WebIDE project settings screen does not) but there is some funky configuration in the configuration.js that I'm unclear how to extend (possibly I just need to work out how to extend configuration.js to solve this).
oServiceParams: { |
serviceList: [
{
name: "TASKPROCESSING",
masterCollection: "TaskCollection",
serviceUrl: cross.fnd.fiori.inbox.Component.getMetadata().getManifestEntry("sap.app").dataSources["TASKPROCESSING"].uri,
isDefault: true,
Anyone able to help do this more generically, rather than my old school solution?
Cheers,
Matt
ps. Complex problem to describe but appreciate if you understand what I'm trying to do and have some ideas.
Hi All,
Just a further update...I realised when I looked closer that selecting the mock data flag in WebIDE runtime configuration, it actually generates mock server start code inside your html file for the service defined in project.json file. Hence, copying the file, and turning off this flag is one way to get both services working in WebIDE; though obviously won't work if you use the extension pane with mock data.
Anyway, a step closer to understanding a better way.
Cheers,
Matt
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Matt,
The Web IDE doesn't support multiple OData services when using the Run with Mock Data feature. I would suggest to copy the content of the generated mock server start code into a new index.html file, and run it without the Run with Mock Data configuration. This way you will have full control on the mock server and can add as many mock server instances as you'd like to support mocking of multiple services.
In addition, if your index.html file contains the mock server start code of one service while the second service configured in the project.json file then extension pane with mock data should work.
Hope that helps,
Regards,
Gal
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.