12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- "use strict";
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: Cognos Analytics
- * Copyright IBM Corp. 2015, 2017
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define(['underscore', 'bi/admin/common/utils/parameters/SimpleParmValueItem'], function (_, SimpleParmValueItem) {
- function HierarchicalParmValueItem() {
- //NOSONAR
- this._inclusive = true;
- this._value = new SimpleParmValueItem();
- this._subNodes = [];
- }
- HierarchicalParmValueItem.prototype.fromJSON = function (json) {
- if (json.inclusive) {
- this._inclusive = json.inclusive;
- }
- if (json.value) {
- this._value.fromJSON(json.value);
- }
- if (json.subNodes) {
- _.each(json.subNodes, function (subNodeJSON) {
- var subNode = new HierarchicalParmValueItem();
- subNode.fromJSON(subNodeJSON);
- this._subNodes.push(subNode);
- }.bind(this));
- }
- };
- HierarchicalParmValueItem.prototype.toXML = function (nodeName) {
- var subNodesXML = '<subNodes xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:hierarchicalParmValueItem[]">';
- _.each(this._subNodes, function (subNode) {
- subNodesXML += subNode.toXML('item');
- });
- subNodesXML += '</subNodes>';
- var hierarchicalParmValueItem = '<' + nodeName + ' xsi:type="bus:hierarchicalParmValueItem">' + '<inclusive xsi:type="xsd:boolean">' + this._inclusive + '</inclusive>' + this._value.toXML('value') + subNodesXML + '</' + nodeName + '>';
- return hierarchicalParmValueItem;
- };
- return HierarchicalParmValueItem;
- });
|