
Warning: This page contains code snippets and require the reader to have good understanding about the model-view-controller (MVC) architecture in SAPUI5.
Note: I am using Web IDE (http(s)://host:port/sap/hana/ide/editor) to perform the operations, but you can use HANA Studio’s Development Perspective to do this as well.
{ "exposed": true,"authentication":{"method":"Form"},"prevent_xsrf" : true,"cache_control" : "no-cache, no-store" }
Note: The application-access file does not have a filename and has only the file extension .xsaccess
Note: The application-descriptor file has no name and no content and has only the file extension .xsapp
Note: You would not be able to activate the .xsapp file if the parent (or any parent in package hierarchy) of the current package already has an .xsapp file. You can skip step 3 in such a case
Create a file called Component.js under the package /my/opi/workspace/ and paste the following piece of code. Make sure you change the package from my.opi.workspace to your package name (if it is different)
jQuery.sap.declare("my.opi.workspace.Component");
jQuery.sap.require("sap.opi.pv.workspace.Component");
jQuery.sap.require("sap.opi.pv.workspace.ui.navigation.Routes");
jQuery.sap.require("sap.opi.pv.workspace.ui.navigation.RouteMatchedHandler");
jQuery.sap.require("sap.opi.pv.workspace.ui.shell.ShellConstants");
sap.opi.pv.workspace.Component.extend("my.opi.workspace.Component", {
metadata : {
}
});
function _getLoggedOnUserData() {
var UserDataProvider = sap.opi.pv.workspace.ui.dataProvider.UserDataProvider;
var userData = UserDataProvider.getLoggedOnUserData();
return userData;
}
function _initialConfiguration(userData) {
var ConfigurationUtil = sap.opi.pv.workspace.ui.utils.ConfigurationUtil;
if (userData && !ConfigurationUtil.isLocalePassed()) {
if (userData.locale) {
sap.ui.getCore().getConfiguration().setLanguage(userData.locale);
} else if (userData.requestLanguage) {
sap.ui.getCore().getConfiguration().setLanguage(userData.requestLanguage);
}
}
var styleSheetFilename = ConfigurationUtil.isHCBTheme() ? "style_hcb.css" : "style.css";
jQuery.sap.includeStyleSheet("/sap/opi/pv/workspace/resources/styles/" + styleSheetFilename);
}
function _loadRequiredResources() {
jQuery.sap.require("sap.opi.pv.workspace.ui.utils.ConfigurationUtil");
jQuery.sap.require("sap.opi.pv.workspace.ui.dataProvider.UserDataProvider");
jQuery.sap.require("jquery.sap.storage");
jQuery.sap.require("sap.ui.core.Icon");
jQuery.sap.require("sap.ui.core.routing.Router");
jQuery.sap.require("sap.ui.core.routing.HashChanger");
jQuery.sap.require("sap.opi.pv.workspace.filterParams");
}
my.opi.workspace.Component.prototype.initRouter = function() {
var router = this.getRouter();
var RouteMatchedHandler = sap.opi.pv.workspace.ui.navigation.RouteMatchedHandler;
RouteMatchedHandler.initialize(router);
};
my.opi.workspace.Component.prototype.init = function() {
sap.opi.pv.workspace.Component.prototype.init.apply(this, arguments);
};
my.opi.workspace.Component.prototype.onAfterRendering = function() {
$("#loadingContainer").css("display", "none");
};
<script src="metadata/ProductMetadata.js"></script>
<script src="/sap/opi/pv/workspace/metadata/ProductMetadata.js"></script>
"my.opi.workspace" : "/my/opi/workspace/",
var component = sap.ui.getCore().createComponent({
name : "sap.opi.pv.workspace",
id : "opintComponent"
});
var component = sap.ui.getCore().createComponent({
name : "my.opi.workspace",
id : "opintComponent_ext"
});
Disclaimer for OPInt Upgrade
The steps mention above is OPInt version specific. Hence, it is recommended to perform the pre-requisites after each OPInt upgrade.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
18 | |
15 | |
13 | |
9 | |
9 | |
9 | |
8 | |
7 | |
7 | |
6 |