<mvc:View controllerName="sap.cf.parentComponent.MyParentApp.controller.ParentView" xmlns:mvc="sap.ui.core.mvc" displayBlock="true"
xmlns="sap.m" xmlns:core="sap.ui.core">
<Shell id="shell">
<App id="app">
<pages>
<Page id="page" title="{i18n>title}">
<content>
<core:ComponentContainer width="100%" id="myChildContainer"/>
</content>
</Page>
</pages>
</App>
</Shell>
</mvc:View>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>MyParentApp</title>
<script id="sap-ui-bootstrap"
src="https://sapui5.hana.ondemand.com/resources/sap-ui-core.js"
data-sap-ui-theme="sap_belize"
data-sap-ui-resourceroots='{"sap.cf.parentComponent.MyParentApp": "./",
"sap.cf.childComponent.MyChildApp": "../MyChildApp/MyChildApp/"
}'
data-sap-ui-compatVersion="edge"
data-sap-ui-oninit="module:sap/ui/core/ComponentSupport"
data-sap-ui-async="true"
data-sap-ui-frameOptions="trusted">
</script>
</head>
<body class="sapUiBody">
<div data-sap-ui-component data-name="sap.cf.parentComponent.MyParentApp" data-id="container" data-settings='{"id" : "MyParentApp"}'></div>
</body>
</html>
sap.ui.define([
"sap/ui/core/mvc/Controller"
], function (Controller) {
"use strict";
return Controller.extend("sap.cf.parentComponent.MyParentApp.controller.ParentView", {
onInit: function () {
// get the child container
var oChildContainer = this.byId("myChildContainer");
this.getOwnerComponent().runAsOwner(function () {
sap.ui.component({
name: "sap.cf.childComponent.MyChildApp", //Our child component
id: "MyChildComponent",
manifestFirst: true,
async: true
}).then(function (component) {
// set the component when it is successfully loaded
oChildContainer.setComponent(component);
}.bind(this));
}.bind(this));
}
});
});
"sap.ui5": {
...
"dependencies": {
...
"components": {
"sap.cf.childComponent.MyChildApp": {
"lazy": true
}
} //End components
}//End dependencies
}// End sap.ui5"
{
"welcomeFile": "/MyParentApp/index.html",
"authenticationMethod": "none",
"logout": {
"logoutEndpoint": "/do/logout"
},
"routes": [
{
"source": "^/MyParentApp/(.*)$",
"target": "$1",
"localDir": "webapp"
}, {
"source": "^/MyChildApp/(.*)",
"target": "$1",
"destination": "dest_FirstParentMTA"
}
]
}
ID: FirstMTA
_schema-version: '2.1'
version: 0.0.1
modules:
- name: MyChildApp
type: html5
path: MyChildApp
provides:
- name: provideChildUI
properties:
service_url: '${default-url}'
parameters:
disk-quota: 256M
memory: 256M
build-parameters:
builder: grunt
- name: MyParentApp2
type: html5
path: MyParentApp2
parameters:
disk-quota: 200M
memory: 200M
build-parameters:
builder: grunt
requires:
- name: provideChildUI
group: destinations
properties:
name: myChildDestination
url: '~{service_url}'
forwardAuthToken: false
{
"welcomeFile": "/MyParentApp2/index.html",
"authenticationMethod": "none",
"logout": {
"logoutEndpoint": "/do/logout"
},
"routes": [
{
"source": "^/MyParentApp2/(.*)$",
"target": "$1",
"localDir": "webapp"
}, {
"source": "^/MyChildApp/(.*)",
"target": "$1",
"destination": "myChildDestination"
}
]
}
ID: FirstParentMTA
_schema-version: '2.1'
version: 0.0.1
modules:
- name: MyParentApp
type: html5
path: MyParentApp
parameters:
disk-quota: 200M
memory: 200M
build-parameters:
builder: grunt
requires:
- name: provideChildUI
group: destinations
properties:
name: myChildDestination
url: '~{service_url}'
forwardAuthToken: false
resources:
- name: provideChildUI
type: mta-provided
parameters:
mta-id: FirstMTA
mta-provides-dependency: provideChildUI
mta-version: ">=0.0.1"
# requires:
# - name: uaa_FirstParentMTA
# - name: dest_FirstParentMTA
#resources:
# - name: uaa_FirstParentMTA
# parameters:
# path: ./xs-security.json
# service-plan: application
# service: xsuaa
# type: org.cloudfoundry.managed-service
# - name: dest_FirstParentMTA
# parameters:
# service-plan: lite
# service: destination
# type: org.cloudfoundry.managed-service
{
"welcomeFile": "/MyParentApp/index.html",
"authenticationMethod": "none",
"logout": {
"logoutEndpoint": "/do/logout"
},
"routes": [
{
"source": "^/MyParentApp/(.*)$",
"target": "$1",
"localDir": "webapp"
}, {
"source": "^/MyChildApp/(.*)",
"target": "$1",
"destination": "myChildDestination"
}
]
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
21 | |
16 | |
13 | |
12 | |
11 | |
10 | |
7 | |
7 | |
7 | |
7 |