SimpleParmValueItem.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. "use strict";
  2. /**
  3. * Licensed Materials - Property of IBM
  4. * IBM Cognos Products: Cognos Analytics
  5. * Copyright IBM Corp. 2015, 2017
  6. * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. */
  8. define(['bi/admin/globalparameters/helpers/SoapHelper'], function (SoapHelper) {
  9. function SimpleParmValueItem() {
  10. //NOSONAR
  11. this._inclusive = true;
  12. this._use = '';
  13. this._display = '';
  14. }
  15. SimpleParmValueItem.prototype.fromJSON = function (json) {
  16. if (json.inclusive) {
  17. this._inclusive = json.inclusive;
  18. }
  19. if (json.use) {
  20. this._use = json.use;
  21. }
  22. if (json.display) {
  23. this._display = json.display;
  24. }
  25. };
  26. SimpleParmValueItem.prototype.toXML = function (nodeName) {
  27. var simpleParmValueItem = '<' + nodeName + ' xsi:type="bus:simpleParmValueItem">' + '<inclusive xsi:type="xsd:boolean">' + this._inclusive + '</inclusive>' + '<display xsi:type="xsd:string">' + SoapHelper.xml_encode(this._display) + '</display>' + '<use xsi:type="xsd:string">' + SoapHelper.xml_encode(this._use) + '</use>' + '</' + nodeName + '>';
  28. return simpleParmValueItem;
  29. };
  30. return SimpleParmValueItem;
  31. });