on 12-15-2015 1:19 PM
Hi experts,
I need differentiate my development in ui5 between different environments(dev qas prd)
Any idea ?
Thanks,
Regards.
Hi Axel,
Can you elaborate a bit more on what exactly you are looking for? Normally we would have 1 UI5 app and its corresponding OData service (developed on backend/gateway server and registered on gateway) in the development environment - these would be transported to QAS and PRD systems. The UI5 app would internally call the OData service using a relative URL, so no matter from which environment you run the app, it will fetch the data from the corresponding backend system.
Regards,
Saurabh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Saurabh
Thank you for your answer.
The url of service odata I am using is something like this.
DEV:
http://dev-fiori.test.com.pe:8000/sap/opu/odata/sap/Z_FIORI
QAS:
http://qas-fiori.test.com.pe:8000/sap/opu/odata/sap/Z_FIORI
I need to know, how to differentiate the call from my odata service (dev, qas, prd) in my app UI5.
Thanks,
Regards.
Hi Axel,
As stated earlier you should ideally use relative URL for calling the OData service from the UI5 app.
In your case you can use the URL "/sap/opu/odata/sap/Z_FIORI" in your ODataModel. Since your UI5 app will be deployed as a BSP on the front end server and the OData service would also be registered on the front end server, the UI5 app can access the relative URL from the respective environment, be it DEV, QAS or PRD.
Regards,
Saurabh
create a file systems.json
{
"dev-fiori" : "DEV",
"qas-fiori": "QA",
....
}
var enviromentModel = new sap.ui.model.json.JSONModel();
enviromentModel.attachEvent("requestCompleted", function() {
//fire en event that data loaded to resolve a promise or fire event, whaetever you use
var sid = enviromentModel.getProperty( "/" + window.location.hostname.toLowerCase() );
enviromentModel.setProperty("isQA", "QA" === sid );
enviromentModel.setProperty("isDEV", "DEV" === sid );
}, this);
enviromentModel.loadData( "systems.json" );
that.setModel(enviromentModel, "enviromentModel");
so you can use enviromentModel>/isQA is binding
the only problem with this approcah is if the proxy is used.
Thanks, this issue is solved
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.