{
"path": "/backend",
"target": {
"type": "destination",
"name": "IOTAS"
},
"description": "IOTAS"
}, {
"path": "/IOTAS-DETAILS-THING-ODATA",
"target": {
"type": "destination",
"name": "IOTAS-DETAILS-THING-ODATA"
},
"description": "IOTAS-DETAILS-THING-ODATA"
}, {
"path": "/resources/sap/ui/iot",
"target": {
"type": "destination",
"name": "IOTAS_CONTROLS"
},
"description": "IoT UI Controls library"
}, {
"path": "sap/ui5/1/resources/sap/ui/iot",
"target": {
"type": "destination",
"name": "IOTAS_CONTROLS"
},
"description": "IoT UI Controls library"
},
jQuery.sap.declare("sap.iot.ain.manageequipments.aeExtension.blocks.block");
jQuery.sap.require("sap.uxap.BlockBase");
sap.uxap.BlockBase.extend("sap.iot.ain.manageequipments.aeExtension.blocks.block",{
metadata:{
views:{
Expanded:{
viewName:"sap.iot.ain.manageequipments.aeExtension.view.AE",
type: "XML"
},
Collapsed:{
viewName:"sap.iot.ain.manageequipments.aeExtension.view.AE",
type: "XML"
}
}
}
});
<core:FragmentDefinition xmlns:core="sap.ui.core" xmlns="sap.uxap" xmlns:b="sap.iot.ain.lib.reusable.blocks"
xmlns:nb="sap.iot.ain.manageequipments.aeExtension.blocks">
<ObjectPageSection title="AE Extension">
<subSections>
<ObjectPageSubSection>
<blocks>
<nb:block></nb:block>
</blocks>
</ObjectPageSubSection>
</subSections>
</ObjectPageSection>
</core:FragmentDefinition>
"extends": {
"component": "sap.iot.ain.manageequipments",
"extensions": {
"sap.ui.viewExtensions": {
"sap.iot.ain.manageequipments.view.EquipmentObjectPage": {
"ObjectPageSections": {
"className": "sap.ui.core.Fragment",
"fragmentName": "sap.iot.ain.manageequipments.aeExtension.fragment.AEFragment",
"type": "XML"
}
}
}
}
},
<mvc:View controllerName="sap.iot.ain.manageequipments.aeExtension.controller.AE" xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:mvc="sap.ui.core.mvc" xmlns:iot="sap.ui.iot.controls" displayBlock="true" xmlns="sap.m" xmlns:uxap="sap.uxap" xmlns:iotele="sap.ui.iot.elements">
<uxap:ObjectPageSection showTitle="false">
<uxap:subSections>
<uxap:ObjectPageSubSection title="Time Series Data" mode="Expanded">
<uxap:blocks>
<VBox height="600px">
<iot:IoTChart id="tchart0" chartHeight ="100%">
</iot:IoTChart>
</VBox>
</uxap:blocks>
</uxap:ObjectPageSubSection>
</uxap:subSections>
</uxap:ObjectPageSection>
</mvc:View>
sap.ui.define([
"sap/iot/ain/lib/reusable/view/SectionBaseController"
], function(Controller) {
"use strict";
return Controller.extend("sap.iot.ain.manageequipments.aeExtension.controller.AE", {
oEquipID: "",
sThingId: "0",
onAfterRendering: function() {
if (!this.bInitialized) {
this.bInitialized = true;
this._oObjectPage = sap.iot.ain.lib.reusable.utilities.Utility.getObjectPage(this.oView);
this._oParentController = sap.iot.ain.lib.reusable.utilities.Utility.getParentControlByType(this._oObjectPage,
"sap.ui.core.mvc.XMLView").getController();
}
var that = this;
var equiID = that._oParentController.mGetObjectId();
if(that.oEquipID !== equiID){
this.oEquipID = equiID;
var sUrl = "/ain/odata.svc/ObjectExternalIDs/?iv_ain_objectid=" + equiID + "&$format=json"; //equipment = oParams.id
sap.iot.ain.lib.reusable.utilities.ServiceHandler.getData({
"url": sUrl,
"isAsync": true,
"showBusyIndicator": false,
"success": function(oData) {
var sAttributeId = "";
if (oData.d.results.length) {
for (var i = 0; i < oData.d.results.length; i++) {
if (oData.d.results[i].systemName) {
if (oData.d.results[i].systemName === 'IoT AE') {
sAttributeId = oData.d.results[i].externalID;
}
}
}
}
if (sAttributeId || sAttributeId.length > 0) {
that.sThingId = sAttributeId;
var oChart = that.byId("tchart0");
oChart.setAssetId(that.sThingId, true);
}
},
"error": function(oErrorData) {
}
});
}
}
});
});
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
10 | |
5 | |
4 | |
4 | |
3 | |
2 | |
2 | |
2 | |
2 | |
1 |