How to use objectType method in Playwright Internal

Best JavaScript code snippet using playwright-internal

cronapi.js

Source:cronapi.js Github

copy

Full Screen

1(function() {2 'use strict';3 this.$evt = function(str) {4 var self = this;5 if (!self.$eval) {6 self = angular.element(event.target).scope();7 }8 self.$eval(str);9 }.bind(this);10 this.cronapi = {};11 this.cronapi.toDate = function(value) {12 return new Date(value);13 }14 var getDatasource = function(ds) {15 if (typeof ds == 'string') {16 return window[ds];17 } else {18 return ds;19 }20 }21 this.cronapi.doEval = function(arg) {22 return arg;23 }24 this.cronapi.evalInContext = function(js) {25 var result = eval('this.cronapi.doEval('+js+')');26 if (result && result.commands) {27 for (var i=0;i<result.commands.length;i++) {28 var func = eval(result.commands[i].function);29 func.apply(this, result.commands[i].params);30 }31 }32 if (result && result.value) {33 return result.value;34 }35 }36 this.cronapi.client = function(pack) {37 return {38 attr: function() {39 return this;40 },41 run: function() {42 var bk = eval('blockly.'+pack);43 return bk.apply(this, arguments);44 }.bind(this)45 }46 };47 var serverMap = {};48 this.cronapi.server = function(pack) {49 var attr = false;50 return {51 attr: function() {52 attr = true;53 return this;54 },55 run: function() {56 var key = pack;57 for (var i = 0;i <arguments.length;i++) {58 key += String(arguments[i]);59 }60 if (attr) {61 if (serverMap.hasOwnProperty(key)) {62 if (serverMap[key] != "$$loading") {63 return serverMap[key];64 } else {65 return "";66 }67 }68 serverMap[key] = "$$loading";69 }70 var parts = pack.split(".");71 var func = parts[parts.length-1];72 parts.pop();73 var namespace = parts.join(".");74 var blocklyName = namespace + ":" + func;75 var success = function(data) {76 this.safeApply(function() {77 if (attr) {78 serverMap[key] = data;79 }80 });81 }.bind(this);82 var error = function(error) {83 this.safeApply(function() {84 if (attr) {85 serverMap[key] = error;86 }87 });88 }.bind(this);89 var args = [blocklyName, error, success];90 for (var i = 0;i <arguments.length;i++) {91 args.push(arguments[i]);92 }93 this.cronapi.util.makeCallServerBlocklyAsync.apply(this, args);94 }.bind(this)95 }96 };97 /**98 * @category CategoryType.CONVERSION99 * @categoryTags Conversão|Convert100 */101 this.cronapi.conversion = {};102 /**103 * @type function104 * @name {{textToTextBinary}}105 * @nameTags asciiToBinary106 * @description {{functionToConvertTextInTextBinary}}107 * @param {ObjectType.STRING} astring {{contentInAscii}}108 * @returns {ObjectType.STRING}109 */110 this.cronapi.conversion.asciiToBinary = function(astring) {111 var binary = "";112 if (astring.length > 0) {113 for (var i = 0; i < astring.length; i++) {114 var value = astring.charCodeAt(i);115 for (var j = 7; j >= 0; j--) {116 binary += ((value >> j) & 1);117 }118 }119 }120 return binary;121 };122 /**123 * @type function124 * @name {{toLogic}}125 * @nameTags toBoolean126 * @description {{functionConvertToLogic}}127 * @param {ObjectType.STRING} value {{content}}128 * @returns {ObjectType.BOOLEAN}129 */130 this.cronapi.conversion.toBoolean = function(value) {131 return this.cronapi.internal.parseBoolean(value);132 };133 /**134 * @type function135 * @name {{convertToBytes}}136 * @nameTags toBytes137 * @description {{functionToConvertTextBinaryToText}}138 * @param {ObjectType.OBJECT} obj {{contentInTextBinary}}139 * @returns {ObjectType.STRING}140 */141 this.cronapi.conversion.toBytes = function(obj) {142 return obj ? obj.toString() : "";143 };144 /**145 * @type function146 * @name {{convertToAscii}}147 * @nameTags chrToAscii|convertToAscii148 * @description {{functionToConvertToAscii}}149 * @param {ObjectType.STRING} value {{content}}150 * @returns {ObjectType.STRING}151 */152 this.cronapi.conversion.chrToAscii = function(value) {153 if (!value) {154 return null;155 } else {156 return (value.charCodeAt(0));157 }158 };159 /**160 * @type function161 * @name {{convertStringToJs}}162 * @nameTags stringToJs163 * @description {{functionToConvertStringToJs}}164 * @param {ObjectType.STRING} value {{content}}165 * @returns {ObjectType.STRING}166 */167 this.cronapi.conversion.stringToJs = function(value) {168 return this.cronapi.internal.stringToJs(value);169 };170 /**171 * @type function172 * @name {{convertStringToDate}}173 * @nameTags stringToDate174 * @description {{functionToConvertStringToDate}}175 * @param {ObjectType.STRING} value {{content}}176 * @returns {ObjectType.DATETIME}177 */178 this.cronapi.conversion.stringToDate = function(value) {179 var pattern = /^\s*(\d+)[\/\.-](\d+)[\/\.-](\d+)(\s(\d+):(\d+):(\d+))?\s*$/;180 if (value) {181 if (value instanceof Date)182 return value;183 else if (pattern.test(value)) {184 var splited = pattern.exec(value);185 var userLang = (navigator.language || navigator.userLanguage)186 .split("-")[0];187 if (userLang == "pt" || userLang == "en") {188 var functionToCall = eval("cronapi.internal." + userLang + "Date");189 return functionToCall(splited);190 } else191 return new Date(value);192 } else193 return new Date(value);194 }195 return null;196 };197 /**198 * @type function199 * @name {{convertIntToHex}}200 * @nameTags intToHex201 * @description {{functionToConvertIntToHex}}202 * @param {ObjectType.STRING} value {{content}}203 * @returns {ObjectType.STRING}204 */205 this.cronapi.conversion.intToHex = function(value) {206 return Number(value).toString(16).toUpperCase();207 };208 /**209 * @type function210 * @name {{convertToLong}}211 * @nameTags toLong212 * @description {{functionToConvertToLong}}213 * @param {ObjectType.OBJECT} value {{content}}214 * @returns {ObjectType.LONG}215 */216 this.cronapi.conversion.toLong = function(value) {217 return parseInt(value);218 };219 /**220 * @type function221 * @name {{convertToString}}222 * @nameTags toString223 * @description {{functionToConvertToString}}224 * @param {ObjectType.OBJECT} value {{content}}225 * @returns {ObjectType.STRING}226 */227 this.cronapi.conversion.toString = function(value) {228 if (value){229 var result = new String(value);230 return result.toString();231 }232 return "";233 };234 /**235 * @category CategoryType.UTIL236 * @categoryTags Util237 */238 this.cronapi.util = {};239 /**240 * @type internal241 * @name {{callServerBlocklyAsync}}242 * @nameTags callServerBlocklyAsync243 * @description {{functionToCallServerBlocklyAsync}}244 * @param {ObjectType.STRING} classNameWithMethod {{classNameWithMethod}}245 * @param {ObjectType.OBJECT} callbackSuccess {{callbackSuccess}}246 * @param {ObjectType.OBJECT} callbackError {{callbackError}}247 * @param {ObjectType.OBJECT} params {{params}}248 * @arbitraryParams true249 */250 this.cronapi.util.callServerBlocklyAsync = function(classNameWithMethod, fields, callbackSuccess, callbackError) {251 var serverUrl = 'api/cronapi/call/body/#classNameWithMethod#/'.replace('#classNameWithMethod#', classNameWithMethod);252 var http = this.cronapi.$scope.http;253 var params = [];254 $(arguments).each(function() {255 params.push(this);256 });257 var token = "";258 if (window.uToken)259 token = window.uToken;260 var dataCall = {261 "fields": fields,262 "inputs": params.slice(4)263 };264 var finalUrl = this.cronapi.internal.getAddressWithHostApp(serverUrl);265 var resultData = $.ajax({266 type: 'POST',267 url: finalUrl,268 dataType: 'html',269 data : JSON.stringify(dataCall),270 headers : {271 'Content-Type' : 'application/json',272 'X-AUTH-TOKEN' : token,273 'toJS' : true274 },275 success : callbackSuccess,276 error : callbackError277 });278 };279 /**280 * @type internal281 */282 this.cronapi.util.getScreenFields = function() {283 var fields = {};284 for (var key in this.cronapi.$scope) {285 if (this.cronapi.$scope[key] && this.cronapi.$scope[key].constructor && this.cronapi.$scope[key].constructor.name=="DataSet") {286 fields[key] = {};287 fields[key].active = this.cronapi.$scope[key].active;288 }289 }290 for (var key in this.cronapi.$scope.vars) {291 if (this.cronapi.$scope.vars[key]) {292 if (!fields.vars) {293 fields.vars = {};294 }295 fields.vars[key] = this.cronapi.$scope.vars[key];296 }297 }298 for (var key in this.cronapi.$scope.params) {299 if (this.cronapi.$scope.params[key]) {300 if (!fields.params) {301 fields.params = {};302 }303 fields.params[key] = this.cronapi.$scope.params[key];304 }305 }306 return fields;307 }308 /**309 * @type internal310 * @name {{makeCallServerBlocklyAsync}}311 * @nameTags makeCallServerBlocklyAsync312 * @description {{functionToMakeCallServerBlocklyAsync}}313 * @param {ObjectType.STRING} blocklyWithFunction {{blocklyWithFunction}}314 * @param {ObjectType.STRING} callbackBlocklySuccess {{callbackBlocklySuccess}}315 * @param {ObjectType.STRING} callbackBlocklyError {{callbackBlocklyError}}316 * @param {ObjectType.OBJECT} params {{params}}317 * @arbitraryParams if (window.event.target && window.event.target) {318 window.cronapi.$scope = angular.element(window.event.target).scope();319 }true320 */321 this.cronapi.util.makeCallServerBlocklyAsync = function(blocklyWithFunction, callbackSuccess, callbackError) {322 var fields = this.cronapi.util.getScreenFields();323 var paramsApply = [];324 paramsApply.push(blocklyWithFunction);325 paramsApply.push(fields);326 paramsApply.push(function(data) {327 var result = this.cronapi.evalInContext(data);328 if (typeof callbackSuccess == "string") {329 eval(callbackSuccess)(result);330 } else if (callbackSuccess) {331 callbackSuccess(result);332 }333 }.bind(this));334 paramsApply.push(function(data, status, errorThrown) {335 var message = this.cronapi.internal.getErrorMessage(data.responseText, errorThrown);336 if (typeof callbackError == "string") {337 eval(callbackError)(message);338 }339 else if (callbackError) {340 callbackError(message);341 }342 else {343 this.cronapi.$scope.Notification.error(message);344 }345 }.bind(this));346 $(arguments).each(function(idx) {347 if (idx >= 3)348 paramsApply.push(this);349 });350 this.cronapi.util.callServerBlocklyAsync.apply(this, paramsApply);351 };352 /**353 * @type function354 * @name {{callServerBlockly}}355 * @nameTags callServerBlockly356 * @description {{functionToCallServerBlockly}}357 * @param {ObjectType.STRING} classNameWithMethod {{classNameWithMethod}}358 * @param {ObjectType.OBJECT} params {{params}}359 * @arbitraryParams true360 * @wizard procedures_callblockly_callnoreturn361 */362 this.cronapi.util.callServerBlocklyNoReturn = function() {363 this.cronapi.util.callServerBlockly.apply(this, arguments);364 }365 /**366 * @type function367 * @name {{throwExceptionName}}368 * @nameTags throwException369 * @description {{throwExceptionDescription}}370 * @param {ObjectType.OBJECT} value {{throwExceptionParam0}}371 */372 this.cronapi.util.throwException = function(value) {373 throw value;374 };375 /**376 * @type function377 * @name {{createExceptionName}}378 * @nameTags createException379 * @description {{createExceptionDescription}}380 * @param {ObjectType.STRING} value {{createExceptionParam0}}381 * @returns {ObjectType.STRING}382 */383 this.cronapi.util.createException = function(value) {384 return value;385 };386 /**387 * @type function388 * @name {{callServerBlockly}}389 * @nameTags callServerBlockly390 * @description {{functionToCallServerBlockly}}391 * @param {ObjectType.STRING} classNameWithMethod {{classNameWithMethod}}392 * @param {ObjectType.OBJECT} params {{params}}393 * @arbitraryParams true394 * @wizard procedures_callblockly_callreturn395 * @returns {ObjectType.OBJECT}396 */397 this.cronapi.util.callServerBlockly = function(classNameWithMethod) {398 var serverUrl = 'api/cronapi/call/body/#classNameWithMethod#/'.replace('#classNameWithMethod#', classNameWithMethod);399 var params = [];400 var fields = this.cronapi.util.getScreenFields();401 var dataCall = {402 "fields": fields,403 "inputs": params404 };405 for (var i = 1; i<arguments.length; i++)406 params.push(arguments[i]);407 var token = "";408 if (window.uToken)409 token = window.uToken;410 var finalUrl = this.cronapi.internal.getAddressWithHostApp(serverUrl);411 var resultData = $.ajax({412 type: 'POST',413 url: finalUrl,414 dataType: 'html',415 data : JSON.stringify(dataCall),416 async: false,417 headers : {418 'Content-Type' : 'application/json',419 'X-AUTH-TOKEN' : token,420 'toJS' : true421 }422 });423 var result;424 if (resultData.status == 200) {425 if (resultData.responseJSON)426 result = resultData.responseJSON;427 else428 result = this.cronapi.evalInContext(resultData.responseText);429 }430 else {431 var message = this.cronapi.internal.getErrorMessage(resultData.responseText, resultData.statusText);432 this.cronapi.$scope.Notification.error(message);433 throw message;434 }435 return result;436 };437 /**438 * @type function439 * @name {{callServerBlocklyAsync}}440 * @nameTags callServerBlocklyAsync441 * @description {{callServerBlocklyAsync}}442 * @param {ObjectType.OBJECT} params {{params}}443 * @wizard procedures_callblockly_callreturn_async444 * @returns {ObjectType.OBJECT}445 */446 this.cronapi.util.callServerBlocklyAsynchronous = function(classNameWithMethod , callback , params) {447 if(classNameWithMethod != '' && typeof callback == 'function'){448 var params = [];449 params.push(classNameWithMethod);450 params.push(callback);451 params.push(callback);452 var idx = 2;453 for(idx; idx < arguments.length ; idx ++){454 params.push(arguments[idx]);455 };456 this.cronapi.util.makeCallServerBlocklyAsync.apply(this,params);457 }458 };459 /**460 * @type function461 * @name {{executeJavascriptNoReturnName}}462 * @nameTags executeJavascriptNoReturn463 * @description {{executeJavascriptNoReturnDescription}}464 * @param {ObjectType.STRING} value {{executeJavascriptNoReturnParam0}}465 * @multilayer true466 */467 this.cronapi.util.executeJavascriptNoReturn = function(value) {468 eval( value );469 };470 /**471 * @type function472 * @name {{downloadFileName}}473 * @nameTags downloadFile474 * @description {{downloadFileDescription}}475 * @param {ObjectType.STRING} url {{downloadFileParam0}}476 * @multilayer true477 */478 this.cronapi.util.downloadFile = function(url) {479 var finalUrl = this.cronapi.internal.getAddressWithHostApp(url);480 this.cronapi.screen.openUrl(finalUrl, '_blank' ,0,0 );481 };482 /**483 * @type function484 * @name {{executeJavascriptNoReturnName}}485 * @nameTags executeJavascriptNoReturn486 * @description {{executeJavascriptNoReturnDescription}}487 * @param {ObjectType.STRING} value {{executeJavascriptNoReturnParam0}}488 * @returns {ObjectType.STRING}489 */490 this.cronapi.util.executeJavascriptNoReturn = function(value) {491 eval( value );492 };493 /**494 * @type function495 * @name {{executeJavascriptNoReturnName}}496 * @nameTags executeJavascriptReturn497 * @description {{executeJavascriptReturnDescription}}498 * @param {ObjectType.STRING} value {{executeJavascriptNoReturnParam0}}499 * @returns {ObjectType.STRING}500 */501 this.cronapi.util.executeJavascriptReturn = function(value) {502 return eval( value );503 };504 /**505 * @type function506 * @name {{openReport}}507 * @nameTags openReport|abrirrelatorio508 * @description {{openReportDescription}}509 * @param {ObjectType.STRING} value {{report}}510 * @multilayer true511 * @returns {ObjectType.VOID}512 * @wizard procedures_openreport_callnoreturn513 */514 this.cronapi.util.openReport = function(/** @type {ObjectType.STRING} @blockType util_report_list */ name) {515 this.cronapi.$scope.getReport(name);516 };517 /**518 * @type function519 * @name {{getURLFromOthersName}}520 * @description {{getURLFromOthersDescription}}521 * @nameTags URL|API|Content|Download|Address|Endereco|Conteudo522 * @param {ObjectType.STRING} method {{HTTPMethod}}523 * @param {ObjectType.STRING} contentType {{contentType}}524 * @param {ObjectType.STRING} url {{URLAddress}}525 * @param {ObjectType.STRING} params {{paramsHTTP}}526 * @param {ObjectType.STRING} headers {{headers}}527 * @param {ObjectType.STRING} success {{success}}528 * @param {ObjectType.STRING} error {{error}}529 */530 this.cronapi.util.getURLFromOthers = function(/** @type {ObjectType.STRING} @description {{HTTPMethod}} @blockType util_dropdown @keys GET|POST|PUT|DELETE|PATCH|HEAD|OPTIONS|TRACE @values GET|POST|PUT|DELETE|PATCH|HEAD|OPTIONS|TRACE */ method , /** @type {ObjectType.STRING} @description {{HTTPMethod}} @blockType util_dropdown @keys application/x-www-form-urlencoded|application/json @values application/x-www-form-urlencoded|application/json */ contentType , /** @type {ObjectType.STRING} @description {{URLAddress}} */ url, /** @type {ObjectType.OBJECT} @description {{paramsHTTP}} */ params, /** @type {ObjectType.OBJECT} @description {{headers}} */ headers, /** @type {ObjectType.STATEMENTSENDER} @description {{success}} */ success, /** @type {ObjectType.STATEMENTSENDER} @description {{error}} */ error ) {531 var header = Object.create(headers);532 header["Content-Type"] = contentType;533 // Angular has a .run that inject X-AUTH-TOKEN, so we use JQuery534 $.ajax({535 method : method,536 url : url,537 data: params,538 headers: header539 }).success(success.bind(this)).error(error.bind(this));540 };541 /**542 * @type function543 * @name {{getUserToken}}544 * @nameTags token | auth | autenticaçào | armazenamento545 * @description {{getUserTokenDesc}}546 * @returns {ObjectType.STRING}547 */548 this.cronapi.util.getUserToken = function() {549 return JSON.parse(window.localStorage.getItem('_u')).token;550 };551 /**552 * @type function553 * @name {{setSessionStorage}}554 * @nameTags storage | session | sessão | armazenamento555 * @description {{setSessionStorageDesc}}556 * @param {ObjectType.STRING} key {{key}}557 * @param {ObjectType.STRING} value {{value}}558 */559 this.cronapi.util.setSessionStorage = function(key, value) {560 window.sessionStorage.setItem(key, value);561 };562 /**563 * @type function564 * @name {{getSessionStorage}}565 * @nameTags storage | session | sessão | armazenamento566 * @description {{getSessionStorageDesc}}567 * @param {ObjectType.STRING} key {{key}}568 * @returns {ObjectType.OBJECT}569 */570 this.cronapi.util.getSessionStorage = function(key) {571 return window.sessionStorage.getItem(key);572 };573 /**574 * @type function575 * @name {{setLocalStorage}}576 * @nameTags storage | session | sessão | armazenamento577 * @description {{setLocalStorageDesc}}578 * @param {ObjectType.STRING} key {{key}}579 * @param {ObjectType.STRING} value {{value}}580 */581 this.cronapi.util.setLocalStorage = function(key, value) {582 window.localStorage.setItem(key, value);583 };584 /**585 * @type function586 * @name {{getLocalStorage}}587 * @nameTags storage | session | sessão | armazenamento588 * @description {{getLocalStorageDesc}}589 * @param {ObjectType.STRING} key {{key}}590 * @returns {ObjectType.STRING}591 */592 this.cronapi.util.getLocalStorage = function(key) {593 return window.localStorage.getItem(key);594 };595 /**596 * @type function597 * @name {{executeAsynchronousName}}598 * @nameTags Executar|Assíncrono|Execute| Asynchronous599 * @description {{executeAsynchronousDescription}}600 * @param {ObjectType.STATEMENT} statement {{statement}}601 *602 */603 this.cronapi.util.executeAsynchronous = function( /** @type {ObjectType.STATEMENT} @description {{statement}} */ statement) {604 setTimeout(statement , 0 );605 };606 /**607 * @type function608 * @name {{scheduleExecutionName}}609 * @nameTags Executar|Agenda|Agendar|Agendamento|Execução|Execute|Execution|Schedule|Scheduled610 * @description {{scheduleExecutionDescription}}611 * @param {ObjectType.STATEMENT} statement {{statement}}612 * @param {ObjectType.LONG} initial_time {{scheduleExecutionParam1}}613 * @param {ObjectType.LONG} interval_time {{scheduleExecutionParam2}}614 * @param {ObjectType.STRING} measurement_unit {{scheduleExecutionParam3}}615 */616 this.cronapi.util.scheduleExecution = function( /** @type {ObjectType.STATEMENT} @description {{statement}} */ statements , /** @type {ObjectType.LONG} */ initial_time , /** @type {ObjectType.LONG} */ interval_time , /** @type {ObjectType.STRING} @description {{scheduleExecutionParam3}} @blockType util_dropdown @keys seconds|milliseconds|minutes|hours @values {{seconds}}|{{millisecondss}}|{{minutes}}|{{hours}} */ measurement_unit ) {617 var factor = 1;618 if (measurement_unit == 'seconds') {619 factor = 1000;620 } else if(measurement_unit =='minutes') {621 factor = 60000;622 } else if(measurement_unit =='hours') {623 factor = 3600000;624 }625 initial_time = initial_time * factor;626 interval_time = interval_time * factor;627 var intervalId = -1;628 var timeoutId = setTimeout(function() {629 statements();630 intervalId = setInterval(statements , interval_time) ;631 }.bind(this), initial_time);632 this.$on('$destroy', function() {633 try { clearTimeout(timeoutId); } catch(e) {}634 try { clearInterval(intervalId); } catch(e) {}635 });636 };637 /**638 * @type internal639 */640 this.cronapi.util.openReport = function(name, params, config) {641 this.cronapi.$scope.getReport(name, params, config);642 };643 /**644 * @category CategoryType.SCREEN645 * @categoryTags Screen|Tela646 */647 this.cronapi.screen = {};648 /**649 * @type function650 * @name {{fieldNameFromScreen}}651 * @nameTags fieldNameFromScreen652 * @description {{functionToGetFieldNameFromScreen}}653 * @param {ObjectType.STRING} field {{field}}654 * @returns {ObjectType.OBJECT}655 * @wizard field_from_screen656 * @multilayer true657 */658 this.cronapi.screen.fieldFromScreen = function(field) {659 return field;660 };661 /**662 * @type function663 * @name {{changeValueOfField}}664 * @nameTags changeValueOfField|changeFieldValue665 * @description {{functionToChangeValueOfField}}666 * @param {ObjectType.STRING} field {{field}}667 * @param {ObjectType.STRING} value {{value}}668 * @multilayer true669 */670 this.cronapi.screen.changeValueOfField = function(/** @type {ObjectType.STRING} @blockType field_from_screen*/ field, /** @type {ObjectType.STRING} */value) {671 try {672 this.__tempValue = value;673 var func = new Function('this.' + field + ' = this.__tempValue;');674 this.safeApply(func.bind(this));675 }676 catch (e) {677 // NO COMMAND678 }679 };680 /**681 * @type function682 * @name {{getValueOfField}}683 * @nameTags getValueOfField|getFieldValue684 * @description {{functionToGetValueOfField}}685 * @param {ObjectType.STRING} field {{field}}686 * @returns {ObjectType.OBJECT}687 * @displayInline true688 */689 this.cronapi.screen.getValueOfField = function(/** @type {ObjectType.STRING} @blockType field_from_screen*/ field) {690 try {691 if (field && field.length > 0) {692 if (field.indexOf('.active.') > -1)693 return eval(field);694 else695 return eval('this.'+field);696 }697 return '';698 }699 catch (e) {700 alert(e);701 }702 };703 /**704 * @type function705 * @name {{createScopeVariableName}}706 * @nameTags createScopeVariable707 * @description {{createScopeVariableDescription}}708 * @param {ObjectType.STRING} name {{createScopeVariableParam0}}709 * @param {ObjectType.STRING} value {{createScopeVariableParam1}}710 */711 this.cronapi.screen.createScopeVariable = function(name,value) {712 this.cronapi.$scope.vars[name] = value;713 };714 /**715 * @type function716 * @name {{getScopeVariableName}}717 * @nameTags getScopeVariable718 * @description {{getScopeVariableDescription}}719 * @param {ObjectType.STRING} name {{getScopeVariableParam0}}720 * @returns {ObjectType.STRING}721 */722 this.cronapi.screen.getScopeVariable = function(name) {723 return this.cronapi.$scope.vars[name];724 };725 /**726 * @type function727 * @name {{screenNotifyName}}728 * @description {{screenNotifyDescription}}729 * @nameTags show | exibir | exibe | notification | notificação730 * @param {ObjectType.STRING} type {{screenNotifyParam0}}731 * @param {ObjectType.STRING} message {{screenNotifyParam1}}732 * @wizard notify_type733 * @multilayer true734 */735 this.cronapi.screen.notify = function(/** @type {ObjectType.STRING} */ type, /** @type {ObjectType.STRING} */ message) {736 if (message == null || message == undefined) {737 message = '';738 }739 this.cronapi.$scope.Notification({'message':message.toString() },type);740 };741 /**742 * @type function743 * @name {{datasourceFromScreenName}}744 * @nameTags datasourceFromScreen745 * @description {{datasourceFromScreenDescription}}746 * @param {ObjectType.STRING} datasource {{datasourceFromScreenParam0}}747 * @returns {ObjectType.STRING}748 * @wizard datasource_from_screen749 * @multilayer true750 */751 this.cronapi.screen.datasourceFromScreen = function(datasource) {752 return datasource;753 };754 /**755 * @type function756 * @name {{startInsertingModeName}}757 * @nameTags startInsertingMode758 * @description {{startInsertingModeDescription}}759 * @param {ObjectType.STRING} datasource {{startInsertingModeParam0}}760 * @multilayer true761 */762 this.cronapi.screen.startInsertingMode = function(/** @type {ObjectType.OBJECT} @blockType datasource_from_screen*/ datasource) {763 getDatasource(datasource).$apply( function() { getDatasource(datasource).startInserting();});764 };765 /**766 * @type function767 * @name {{startEditingModeName}}768 * @nameTags startEditingMode769 * @description {{startEditingModeDescription}}770 * @param {ObjectType.STRING} datasource {{startEditingModeParam0}}771 * @multilayer true772 */773 this.cronapi.screen.startEditingMode = function(/** @type {ObjectType.OBJECT} @blockType datasource_from_screen*/ datasource) {774 getDatasource(datasource).$apply( new function(){getDatasource(datasource).startEditing();} );775 };776 /**777 * @type function778 * @name {{previusRecordName}}779 * @nameTags previusRecord780 * @description {{previusRecordDescription}}781 * @param {ObjectType.STRING} datasource {{previusRecordParam0}}782 * @multilayer true783 */784 this.cronapi.screen.previusRecord = function(/** @type {ObjectType.OBJECT} @blockType datasource_from_screen*/ datasource) {785 getDatasource(datasource).$apply( new function(){getDatasource(datasource).previous();} );786 };787 /**788 * @type function789 * @name {{nextRecordName}}790 * @nameTags nextRecord791 * @description {{nextRecordDescription}}792 * @param {ObjectType.STRING} datasource {{nextRecordParam0}}793 * @multilayer true794 */795 this.cronapi.screen.nextRecord = function(/** @type {ObjectType.OBJECT} @blockType datasource_from_screen*/ datasource) {796 getDatasource(datasource).$apply( new function(){getDatasource(datasource).next();} );797 };798 /**799 * @type function800 * @name {{firstRecordName}}801 * @nameTags firstRecord802 * @description {{firstRecordDescription}}803 * @param {ObjectType.STRING} datasource {{firstRecordParam0}}804 * @multilayer true805 */806 this.cronapi.screen.firstRecord = function(/** @type {ObjectType.OBJECT} @blockType datasource_from_screen*/ datasource) {807 getDatasource(datasource).$apply( new function(){808 var ds = getDatasource(datasource);809 ds.cursor = -1;810 ds.next();811 } );812 };813 /**814 * @type function815 * @name {{lastRecordName}}816 * @nameTags lastRecord817 * @description {{lastRecordDescription}}818 * @param {ObjectType.STRING} datasource {{lastRecordParam0}}819 * @multilayer true820 */821 this.cronapi.screen.lastRecord = function(/** @type {ObjectType.OBJECT} @blockType datasource_from_screen*/ datasource) {822 getDatasource(datasource).$apply( new function(){823 var ds = getDatasource(datasource);824 ds.cursor = ds.data.length-2;825 ds.next();826 } );827 };828 /**829 * @type function830 * @name {{removeRecordName}}831 * @nameTags removeRecord832 * @description {{removeRecordDescription}}833 * @param {ObjectType.STRING} datasource {{removeRecordParam0}}834 * @multilayer true835 */836 this.cronapi.screen.removeRecord = function(/** @type {ObjectType.OBJECT} @blockType datasource_from_screen*/ datasource) {837 getDatasource(datasource).$apply( new function(){getDatasource(datasource).removeSilent();} );838 };839 /**840 * @type function841 * @name {{refreshActiveRecordName}}842 * @nameTags hasNextRecord843 * @description {{refreshActiveRecordDescription}}844 * @param {ObjectType.STRING} datasource {{refreshActiveRecordParam0}}845 * @multilayer true846 */847 this.cronapi.screen.refreshActiveRecord = function(/** @type {ObjectType.OBJECT} @blockType datasource_from_screen*/ datasource) {848 getDatasource(datasource).refreshActive();849 };850 /**851 * @type function852 * @name {{hasNextRecordName}}853 * @nameTags hasNextRecord854 * @description {{hasNextRecordDescription}}855 * @param {ObjectType.STRING} datasource {{hasNextRecordParam0}}856 * @returns {ObjectType.BOOLEAN}857 */858 this.cronapi.screen.hasNextRecord = function(/** @type {ObjectType.OBJECT} @blockType datasource_from_screen*/ datasource) {859 return getDatasource(datasource).hasNext();860 };861 /**862 * @type function863 * @name {{quantityRecordsName}}864 * @nameTags quantityRecords865 * @description {{quantityRecordsDescription}}866 * @param {ObjectType.STRING} datasource {{quantityRecordsParam0}}867 * @returns {ObjectType.LONG}868 */869 this.cronapi.screen.quantityRecords = function(/** @type {ObjectType.OBJECT} @blockType datasource_from_screen*/ datasource) {870 return getDatasource(datasource).data.length;871 };872 /**873 * @type function874 * @name {{datasourcePostName}}875 * @nameTags post|datasource876 * @description {{datasourcePostDescription}}877 * @param {ObjectType.STRING} datasource {{datasource}}878 * @multilayer true879 */880 this.cronapi.screen.post = function(/** @type {ObjectType.OBJECT} @blockType datasource_from_screen*/ datasource) {881 return getDatasource(datasource).postSilent();882 };883 /**884 * @type function885 * @name {{datasourceFilterName}}886 * @nameTags filter|datasource887 * @description {{datasourceFilterDescription}}888 * @param {ObjectType.STRING} datasource {{datasourceFilterParam0}}889 * @param {ObjectType.STRING} datasource {{datasourceFilterParam1}}890 * @multilayer true891 */892 this.cronapi.screen.filter = function(/** @type {ObjectType.OBJECT} @blockType datasource_from_screen*/ datasource,/** @type {ObjectType.STRING}*/ path) {893 getDatasource(datasource).filter("/"+path);894 };895 /**896 * @type function897 * @name {{changeView}}898 * @nameTags changeView|Mudar tela|Change form|Change screen|Mudar formulário899 * @description {{functionToChangeView}}900 * @param {ObjectType.STRING} view {{view}}901 * @param {ObjectType.LIST} params {{params}}902 * @wizard procedures_open_form_callnoreturn903 * @multilayer true904 */905 this.cronapi.screen.changeView = function(view, params) {906 try {907 var queryString = '';908 var paramsStopEncode = {};909 paramsStopEncode['%24'] = '$';910 function decodeCharParam(value) {911 if (value) {912 for (var param in paramsStopEncode) {913 var regex = eval('/' + param + '/g' );914 value = value.replace(regex, paramsStopEncode[param]);915 }916 }917 return value;918 }919 if (typeof params != 'undefined') {920 for (var i in Object.keys(params)) {921 var k = Object.keys(params[i])[0];922 var v = String(Object.values(params[i])[0]);923 if (queryString) {924 queryString += "&";925 }926 queryString += decodeCharParam(encodeURIComponent(k)) + "=" + encodeURIComponent(v);927 }928 }929 var oldHash = window.location.hash;930 window.location.hash = view + (queryString?"?"+queryString:"");931 var oldHashToCheck = oldHash + (oldHash.indexOf("?") > -1 ? "": "?");932 var viewToCheck = view + (view.indexOf("?") > -1 ? "": "?");933 if(oldHashToCheck.indexOf(viewToCheck) >= 0){934 window.location.reload();935 }936 }937 catch (e) {938 alert(e);939 }940 };941 /**942 * @type function943 * @name {{openUrl}}944 * @nameTags openUrl|Abrir url945 * @description {{functionToOpenUrl}}946 * @param {ObjectType.STRING} url {{url}}947 * @param {ObjectType.BOOLEAN} newTab {{newTab}}948 * @param {ObjectType.LONG} width {{width}}949 * @param {ObjectType.LONG} height {{height}}950 * @multilayer true951 */952 this.cronapi.screen.openUrl = function(url, newTab, width, height) {953 try {954 var target = '_self';955 var params = '';956 if (newTab && newTab.toString().toLowerCase() == 'true')957 target = '_blank';958 if (width)959 params += 'width=' + width + ',';960 if (height)961 params += 'height=' + height+ ',';962 window.open(url, target, params);963 }964 catch (e) {965 alert(e);966 }967 };968 /**969 * @type function970 * @name {{getParam}}971 * @nameTags getParam|Obter paramêtro972 * @description {{functionToGetParam}}973 * @returns {ObjectType.STRING}974 * @param {ObjectType.STRING} paramName {{paramName}}975 */976 this.cronapi.screen.getParam = function(paramName) {977 try {978 var vars = [], hash;979 var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');980 for(var i = 0; i < hashes.length; i++)981 {982 hash = hashes[i].split('=');983 vars.push(hash[0]);984 vars[hash[0]] = hash[1];985 }986 if (vars[paramName] !== undefined)987 return decodeURIComponent(vars[paramName]);988 }989 catch (e) {990 //991 }992 return null;993 };994 /**995 * @type function996 * @name {{confirmDialogName}}997 * @nameTags confirmDialog|Confirmar998 * @description {{confirmDialogDescription}}999 * @returns {ObjectType.BOOLEAN}1000 * @param {ObjectType.STRING} msg {{confirmDialogParam0}}1001 */1002 this.cronapi.screen.confimDialog = function(msg) {1003 var value = confirm(msg);1004 return value;1005 };1006 /**1007 * @type function1008 * @name {{createDefaultModalName}}1009 * @nameTags createModal|Criar Modal| Modal1010 * @description {{createDefaultModalDescription}}1011 * @param {ObjectType.STRING} title {{createDefaultModalParam1}}1012 * @param {ObjectType.STRING} msg {{createDefaultModalParam2}}1013 * @param {ObjectType.STRING} buttonCancelName {{createDefaultModalParam3}}1014 * @param {ObjectType.STRING} buttonSaveName {{createDefaultModalParam4}}1015 *1016 */1017 this.cronapi.screen.createDefaultModal = function(title, msg, buttonCancelName, buttonSaveName, /** @type {ObjectType.STATEMENT} @description {{createDefaultModalParam5}} */ onSuccess, /** @type {ObjectType.STATEMENT} @description {{createDefaultModalParam6}}*/ onError,/** @type {ObjectType.STATEMENT} @description {{createDefaultModalParam7}}*/ onClose ) {1018 $('#modalTemplateTitle').text(title);1019 $('#modalTemplateBody').text(msg);1020 $('#modalTemplateCancel').text(buttonCancelName);1021 $('#modalTemplateSave').text(buttonSaveName);1022 $( "#modalTemplateClose").unbind( "click" );1023 $('#modalTemplateClose').click(onClose);1024 $( "#modalTemplateCancel").unbind( "click" );1025 $('#modalTemplateCancel').click(onError);1026 $( "#modalTemplateSave").unbind( "click" );1027 $('#modalTemplateSave').click(onSuccess);1028 this.cronapi.screen.showModal('modalTemplate');1029 };1030 /**1031 * @type function1032 * @name {{showModal}}1033 * @nameTags Show| Modal| Exibir| Mostrar1034 * @platform W1035 * @description {{showModalDesc}}1036 * @param {ObjectType.STRING} component {{ComponentParam}}1037 * @multilayer true1038 */1039 this.cronapi.screen.showModal = function(/** @type {ObjectType.OBJECT} @blockType ids_from_screen*/ id) {1040 try{1041 $('#'+id).modal({backdrop: 'static', keyboard: false});1042 }catch(e){1043 $('#'+id).show();1044 }1045 };1046 /**1047 * @type function1048 * @name {{setActiveTab}}1049 * @nameTags Show| Tab| Exibir| Mostrar | Ativar | Aba1050 * @platform W1051 * @description {{setActiveTablDesc}}1052 * @param {ObjectType.STRING} component {{ComponentParam}}1053 * @multilayer true1054 */1055 this.cronapi.screen.setActiveTab = function(/** @type {ObjectType.OBJECT} @blockType ids_from_screen*/ id) {1056 this.cronapi.$scope.safeApply( function(){1057 if( $('#'+id).attr('data-target') === undefined){1058 $( '[data-target="#'+ id + '"]' ).tab('show');1059 }1060 else{1061 $('#'+id).tab('show');1062 }1063 });1064 };1065 /**1066 * @type function1067 * @name {{hideModal}}1068 * @nameTags Hide| Modal| Esconder | Fechar1069 * @description {{hideModalDesc}}1070 * @param {ObjectType.STRING} component {{ComponentParam}}1071 * @multilayer true1072 */1073 this.cronapi.screen.hideModal = function(/** @type {ObjectType.OBJECT} @blockType ids_from_screen*/ id) {1074 try{1075 $('#'+id).modal('hide');1076 }catch(e){1077 $('#'+id).hide();1078 }1079 };1080 /**1081 * @type function1082 * @name {{showMobileModal}}1083 * @nameTags Show| Modal| Exibir| Mostrar1084 * @description {{showMobileModalDesc}}1085 * @platform M1086 * @param {ObjectType.STRING} component {{ComponentParam}}1087 * @multilayer true1088 */1089 this.cronapi.screen.showIonicModal = function(/** @type {ObjectType.OBJECT} @blockType ids_from_screen*/ id) {1090 if($('#'+id).data('cronapp-modal') ) $('#'+id).data('cronapp-modal').remove();1091 this.cronapi.$scope.$ionicModal.fromTemplateUrl(id, {1092 scope: this.cronapi.$scope,1093 animation: 'slide-in-up'1094 }).then(function(modal){1095 $('#'+id).data('cronapp-modal', modal);1096 modal.show();1097 })1098 };1099 /**1100 * @type function1101 * @name {{hideMobileModal}}1102 * @nameTags Hide| Modal| Esconder | Fechar1103 * @description {{hideMobileModalDesc}}1104 * @platform M1105 * @param {ObjectType.STRING} component {{ComponentParam}}1106 * @multilayer true1107 */1108 this.cronapi.screen.hideIonicModal = function(/** @type {ObjectType.OBJECT} @blockType ids_from_screen*/ id) {1109 if($('#'+id).data('cronapp-modal')) {1110 var modal = $('#'+id).data('cronapp-modal');1111 modal.remove();1112 $('#'+id).data('cronapp-modal', null);1113 }1114 };1115 /**1116 * @type function1117 * @name {{isShownIonicModal}}1118 * @nameTags isShown| Modal| Exibido1119 * @description {{isShownIonicModallDesc}}1120 * @platform M1121 * @param {ObjectType.STRING} component {{ComponentParam}}1122 * @returns {ObjectType.BOOLEAN}1123 */1124 this.cronapi.screen.isShownIonicModal = function(/** @type {ObjectType.OBJECT} @blockType ids_from_screen*/ id) {1125 if($('#'+id).data('cronapp-modal')) {1126 var modal = $('#'+id).data('cronapp-modal');1127 return modal.isShown();1128 }1129 return false;1130 };1131 /**1132 * @type function1133 * @name {{showLoading}}1134 * @nameTags Show| Loading| Exibir | Carregamento1135 * @description {{showLoadingDesc}}1136 * @platform M1137 */1138 this.cronapi.screen.showLoading = function() {1139 this.cronapi.$scope.$ionicLoading.show({1140 content : 'Loading',1141 animation : 'fade-in',1142 showBackdrop : true,1143 maxWidth : 200,1144 showDelay : 01145 });1146 };1147 /**1148 * @type function1149 * @name {{hideLoading}}1150 * @nameTags Hide| Loading| Esconder | Carregamento1151 * @description {{hideLoadingDesc}}1152 * @platform M1153 */1154 this.cronapi.screen.hide = function() {1155 this.cronapi.$scope.$ionicLoading.hide();1156 };1157 /**1158 * @type function1159 * @name {{getHostapp}}1160 * @nameTags Hostapp1161 * @description {{getHostappDesc}}1162 * @platform M1163 * @returns {ObjectType.String}1164 */1165 this.cronapi.screen.getHostapp = function() {1166 return window.hostApp;1167 };1168 /**1169 * @type function1170 * @name {{searchIds}}1171 * @nameTags searchIds1172 * @description {{searchIdsDescription}}1173 * @wizard ids_from_screen1174 * @multilayer true1175 */1176 this.cronapi.screen.searchIds = function() {1177 };1178 /**1179 * @type function1180 * @name {{showComponent}}1181 * @nameTags showComponent1182 * @description {{showComponentDesc}}1183 * @param {ObjectType.STRING} component {{ComponentParam}}1184 * @multilayer true1185 */1186 this.cronapi.screen.showComponent = function(/** @type {ObjectType.OBJECT} @blockType ids_from_screen*/ id) {1187 $("#"+id).get(0).style.setProperty("display", "block", "important");1188 };1189 /**1190 * @type function1191 * @name {{hideComponent}}1192 * @nameTags hideComponent1193 * @description {{hideComponentDesc}}1194 * @param {ObjectType.STRING} component {{ComponentParam}}1195 * @multilayer true1196 */1197 this.cronapi.screen.hideComponent = function(/** @type {ObjectType.OBJECT} @blockType ids_from_screen*/ id) {1198 $("#"+id).get(0).style.setProperty("display", "none", "important");1199 };1200 /**1201 * @type function1202 * @name {{disableComponent}}1203 * @nameTags disableComponent1204 * @description {{disableComponentDesc}}1205 * @param {ObjectType.STRING} component {{ComponentParam}}1206 * @multilayer true1207 */1208 this.cronapi.screen.disableComponent = function(/** @type {ObjectType.OBJECT} @blockType ids_from_screen*/ id) {1209 if($('#'+id).data("kendoComboBox")){1210 $('#'+id).data("kendoComboBox").enable(false);1211 }else{1212 $.each( $('#'+id).find('*').addBack(), function(index, value){ $(value).prop('disabled',true); });1213 }1214 };1215 /**1216 * @type function1217 * @name {{enableComponent}}1218 * @nameTags enableComponent1219 * @description {{enableComponentDesc}}1220 * @param {ObjectType.STRING} component {{ComponentParam}}1221 * @multilayer true1222 */1223 this.cronapi.screen.enableComponent = function(/** @type {ObjectType.OBJECT} @blockType ids_from_screen*/ id) {1224 $.each( $('#'+id).find('*').addBack(), function(index, value){ $(value).prop('disabled',false); });1225 };1226 /**1227 * @type function1228 * @name {{focusComponent}}1229 * @nameTags focus1230 * @description {{focusComponentDesc}}*1231 * @multilayer true1232 */1233 this.cronapi.screen.focusComponent = function(/** @type {ObjectType.OBJECT} @blockType ids_from_screen*/ id) {1234 this.cronapi.$scope.safeApply( function() {1235 if( tinyMCE && tinyMCE.get(id) !== undefined) {1236 tinyMCE.get(id).focus();1237 }else{1238 $('#'+id).find('*').addBack().focus();1239 }1240 });1241 };1242 /**1243 * @type function1244 * @name {{changeAttrValueName}}1245 * @nameTags changeAttrValue1246 * @description {{changeAttrValueDesc}}1247 * @param {ObjectType.STRING} id {{idsFromScreen}}1248 * @param {ObjectType.STRING} attrName {{attrName}}1249 * @param {ObjectType.STRING} attrValue {{attrValue}}1250 * @multilayer true1251 */1252 this.cronapi.screen.changeAttrValue = function(/** @type {ObjectType.OBJECT} @blockType ids_from_screen*/ id , /** @type {ObjectType.STRING} */ attrName, /** @type {ObjectType.STRING} */ attrValue ) {1253 $('#'+id).attr(attrName , attrValue);1254 };1255 /**1256 * @type function1257 * @name {{changeContent}}1258 * @nameTags change|content|conteudo|moficiar1259 * @description {{changeContentDesc}}1260 * @param {ObjectType.STRING} id {{idsFromScreen}}1261 * @param {ObjectType.STRING} content {{content}}1262 * @param {ObjectType.BOOLEAN} compile {{compile}}1263 * @multilayer true1264 */1265 this.cronapi.screen.changeContent = function(/** @type {ObjectType.OBJECT} @blockType ids_from_screen*/ id , /** @type {ObjectType.STRING} */ content, /** @type {ObjectType.BOOLEAN} @blockType util_dropdown @keys false|true @values {{false}}|{{true}}*/ compile) {1266 $('#'+id).html(content);1267 if(compile === true || compile === 'true'){1268 var $injector = angular.injector(['ng']);1269 var that = this;1270 $injector.invoke(['$compile', function($compile) {1271 $compile(document.querySelector('#'+id))(that.cronapi.$scope);1272 }]);1273 }1274 };1275 1276 /**1277 * @type function1278 * @name {{logoutName}}1279 * @nameTags logout1280 * @description {{logoutDescription}}1281 * @multilayer true1282 */1283 this.cronapi.screen.logout = function() {1284 if(this.cronapi.$scope.logout != undefined)1285 this.cronapi.$scope.logout();1286 };1287 /**1288 * @type function1289 * @name {{refreshDatasource}}1290 * @nameTags refresh|datasource|atualizar|fonte1291 * @description {{refreshDatasourceDescription}}1292 * @param {ObjectType.STRING} datasource {{datasource}}1293 * @multilayer true1294 */1295 this.cronapi.screen.refreshDatasource = function(/** @type {ObjectType.OBJECT} @blockType datasource_from_screen*/ datasource , /** @type {ObjectType.BOOLEAN} @description {{keepFilters}} @blockType util_dropdown @keys true|false @values {{true}}|{{false}} */ keepFilters ) {1296 if(keepFilters == true || keepFilters == 'true' ){1297 this[datasource].search(this[datasource].terms , this[datasource].caseInsensitive);1298 }else1299 this[datasource].search("", this[datasource].caseInsensitive);1300 };1301 /**1302 * @type function1303 * @name {{loadMoreName}}1304 * @nameTags load|datasource|next|page1305 * @description {{loadMoreNameDescription}}1306 * @param {ObjectType.STRING} datasource {{datasource}}1307 */1308 this.cronapi.screen.loadMore = function(/** @type {ObjectType.OBJECT} @blockType datasource_from_screen*/ datasource) {1309 getDatasource(datasource).$apply( function() { getDatasource(datasource).nextPage();});1310 };1311 /**1312 * @type function1313 * @name {{hasNextPageName}}1314 * @nameTags load|datasource|next|page1315 * @description {hasNextPageDescription}}1316 * @param {ObjectType.STRING} datasource {{datasource}}1317 * @returns {ObjectType.BOOLEAN}1318 */1319 this.cronapi.screen.hasNextPage = function(/** @type {ObjectType.OBJECT} @blockType datasource_from_screen*/ datasource) {1320 return getDatasource(datasource).hasNextPage();1321 };1322 /**1323 * @category CategoryType.DATETIME1324 * @categoryTags Date|Datetime|Data|Hora1325 */1326 this.cronapi.dateTime = {};1327 this.cronapi.dateTime.utcTimestamp = true1328 this.cronapi.dateTime.formats = function() {1329 var formats = [];1330 if (this.cronapi.$translate.use() == 'pt_br')1331 formats = ['DD/MM/YYYY HH:mm:ss', 'DD/MM/YYYY', 'DD-MM-YYYY HH:mm:ss', 'DD-MM-YYYY'];1332 else1333 formats = ['MM/DD/YYYY HH:mm:ss', 'MM/DD/YYYY', 'MM-DD-YYYY HH:mm:ss', 'MM-DD-YYYY'];1334 formats.push('YYYY-MM-DDTHH:mm:ss');1335 formats.push('HH:mm:ss')1336 formats.push('MMMM');1337 return formats;1338 };1339 this.cronapi.dateTime.getMomentObj = function(value) {1340 var currentMoment = moment;1341 if (this.cronapi.dateTime.utcTimestamp)1342 currentMoment = moment.utc;1343 if (value instanceof moment) {1344 return value;1345 }1346 else if (value instanceof Date) {1347 return currentMoment(value);1348 }1349 else {1350 var formats = this.cronapi.dateTime.formats();1351 var momentObj = null;1352 for (var ix in formats) {1353 momentObj = currentMoment(value, formats[ix]);1354 if (momentObj.isValid())1355 break;1356 }1357 return momentObj;1358 }1359 };1360 /**1361 * @type function1362 * @name {{getSecondFromDate}}1363 * @nameTags getSecond1364 * @description {{functionToGetSecondFromDate}}1365 * @param {ObjectType.DATETIME} value {{ObjectType.DATETIME}}1366 * @returns {ObjectType.LONG}1367 */1368 this.cronapi.dateTime.getSecond = function(value) {1369 var date = this.cronapi.dateTime.getMomentObj(value);1370 if (date)1371 return date.get('second');1372 return 0;1373 };1374 /**1375 * @type function1376 * @name {{getMinuteFromDate}}1377 * @nameTags getMinute1378 * @description {{functionToGetMinuteFromDate}}1379 * @param {ObjectType.DATETIME} value {{ObjectType.DATETIME}}1380 * @returns {ObjectType.LONG}1381 */1382 this.cronapi.dateTime.getMinute = function(value) {1383 var date = this.cronapi.dateTime.getMomentObj(value);1384 if (date)1385 return date.get('minute');1386 return 0;1387 };1388 /**1389 * @type function1390 * @name {{getHourFromDate}}1391 * @nameTags getHour1392 * @description {{functionToGetHourFromDate}}1393 * @param {ObjectType.DATETIME} value {{ObjectType.DATETIME}}1394 * @returns {ObjectType.LONG}1395 */1396 this.cronapi.dateTime.getHour = function(value) {1397 var date = this.cronapi.dateTime.getMomentObj(value);1398 if (date)1399 return date.get('hour');1400 return 0;1401 };1402 /**1403 * @type function1404 * @name {{getYearFromDate}}1405 * @nameTags getYear1406 * @description {{functionToGetYearFromDate}}1407 * @param {ObjectType.DATETIME} value {{ObjectType.DATETIME}}1408 * @returns {ObjectType.LONG}1409 */1410 this.cronapi.dateTime.getYear = function(value) {1411 var date = this.cronapi.dateTime.getMomentObj(value);1412 if (date)1413 return date.get('year');1414 return 0;1415 };1416 /**1417 * @type function1418 * @name {{getMonthFromDate}}1419 * @nameTags getMonth1420 * @description {{functionToGetMonthFromDate}}1421 * @param {ObjectType.DATETIME} value {{ObjectType.DATETIME}}1422 * @returns {ObjectType.LONG}1423 */1424 this.cronapi.dateTime.getMonth = function(value) {1425 var date = this.cronapi.dateTime.getMomentObj(value);1426 if (date)1427 return date.get('month') + 1;1428 return 0;1429 };1430 /**1431 * @type function1432 * @name {{getDayFromDate}}1433 * @nameTags getDay1434 * @description {{functionToGetDayFromDate}}1435 * @param {ObjectType.DATETIME} value {{ObjectType.DATETIME}}1436 * @returns {ObjectType.LONG}1437 */1438 this.cronapi.dateTime.getDay = function(value) {1439 var date = this.cronapi.dateTime.getMomentObj(value);1440 if (date)1441 return date.get('date');1442 return 0;1443 };1444 /**1445 * @type function1446 * @name {{getSecondsBetweenDates}}1447 * @nameTags getSecondsBetweenDates|getSecondsDiffDate|diffDatesSeconds1448 * @description {{functionToGetSecondsBetweenDates}}1449 * @param {ObjectType.DATETIME} date {{largerDateToBeSubtracted}}1450 * @param {ObjectType.DATETIME} date2 {{smallerDateToBeSubtracted}}1451 * @returns {ObjectType.LONG}1452 */1453 this.cronapi.dateTime.getSecondsBetweenDates = function(date, date2) {1454 var dateVar = this.cronapi.dateTime.getMomentObj(date);1455 var date2Var = this.cronapi.dateTime.getMomentObj(date2);1456 return dateVar.diff(date2Var, 'seconds');1457 };1458 /**1459 * @type function1460 * @name {{getMinutesBetweenDates}}1461 * @nameTags getMinutesBetweenDates|getMinutesDiffDate|diffDatesMinutes1462 * @description {{functionToGetMinutesBetweenDates}}1463 * @param {ObjectType.DATETIME} date {{largerDateToBeSubtracted}}1464 * @param {ObjectType.DATETIME} date2 {{smallerDateToBeSubtracted}}1465 * @returns {ObjectType.LONG}1466 */1467 this.cronapi.dateTime.getMinutesBetweenDates = function(date, date2) {1468 var dateVar = this.cronapi.dateTime.getMomentObj(date);1469 var date2Var = this.cronapi.dateTime.getMomentObj(date2);1470 return dateVar.diff(date2Var, 'minutes');1471 };1472 /**1473 * @type function1474 * @name {{getHoursBetweenDates}}1475 * @nameTags getHoursBetweenDates|getHoursDiffDate|diffDatesHours1476 * @description {{functionToGetHoursBetweenDates}}1477 * @param {ObjectType.DATETIME} date {{largerDateToBeSubtracted}}1478 * @param {ObjectType.DATETIME} date2 {{smallerDateToBeSubtracted}}1479 * @returns {ObjectType.LONG}1480 */1481 this.cronapi.dateTime.getHoursBetweenDates = function(date, date2) {1482 var dateVar = this.cronapi.dateTime.getMomentObj(date);1483 var date2Var = this.cronapi.dateTime.getMomentObj(date2);1484 return dateVar.diff(date2Var, 'hours');1485 };1486 /**1487 * @type function1488 * @name {{getDaysBetweenDates}}1489 * @nameTags getDaysBetweenDates|getDaysDiffDate|diffDatesDays1490 * @description {{functionToGetDaysBetweenDates}}1491 * @param {ObjectType.DATETIME} date {{largerDateToBeSubtracted}}1492 * @param {ObjectType.DATETIME} date2 {{smallerDateToBeSubtracted}}1493 * @returns {ObjectType.LONG}1494 */1495 this.cronapi.dateTime.getDaysBetweenDates = function(date, date2) {1496 var dateVar = this.cronapi.dateTime.getMomentObj(date);1497 var date2Var = this.cronapi.dateTime.getMomentObj(date2);1498 return dateVar.diff(date2Var, 'days');1499 };1500 /**1501 * @type function1502 * @name {{getMonthsBetweenDates}}1503 * @nameTags getMonthsBetweenDates|getMonthsDiffDate|diffDatesMonths1504 * @description {{functionToGetMonthsBetweenDates}}1505 * @param {ObjectType.DATETIME} date {{largerDateToBeSubtracted}}1506 * @param {ObjectType.DATETIME} date2 {{smallerDateToBeSubtracted}}1507 * @returns {ObjectType.LONG}1508 */1509 this.cronapi.dateTime.getMonthsBetweenDates = function(date, date2) {1510 var dateVar = this.cronapi.dateTime.getMomentObj(date);1511 var date2Var = this.cronapi.dateTime.getMomentObj(date2);1512 return dateVar.diff(date2Var, 'months');1513 };1514 /**1515 * @type function1516 * @name {{getYearsBetweenDates}}1517 * @nameTags getYearsBetweenDates|getYearsDiffDate|diffDatesYears1518 * @description {{functionToGetYearsBetweenDates}}1519 * @param {ObjectType.DATETIME} date {{largerDateToBeSubtracted}}1520 * @param {ObjectType.DATETIME} date2 {{smallerDateToBeSubtracted}}1521 * @returns {ObjectType.LONG}1522 */1523 this.cronapi.dateTime.getYearsBetweenDates = function(date, date2) {1524 var dateVar = this.cronapi.dateTime.getMomentObj(date);1525 var date2Var = this.cronapi.dateTime.getMomentObj(date2);1526 return dateVar.diff(date2Var, 'years');1527 };1528 /**1529 * @type function1530 * @name {{incSecond}}1531 * @nameTags incSecond|increaseSecond1532 * @description {{functionToIncSecond}}1533 * @param {ObjectType.DATETIME} date {{ObjectType.DATETIME}}1534 * @param {ObjectType.LONG} second {{secondsToIncrement}}1535 * @returns {ObjectType.DATETIME}1536 */1537 this.cronapi.dateTime.incSecond = function(date, second) {1538 var dateVar = this.cronapi.dateTime.getMomentObj(date);1539 return dateVar.add('seconds', second).toDate();1540 };1541 /**1542 * @type function1543 * @name {{incMinute}}1544 * @nameTags incMinute|increaseMinute1545 * @description {{functionToIncMinute}}1546 * @param {ObjectType.DATETIME} date {{ObjectType.DATETIME}}1547 * @param {ObjectType.LONG} minute {{minutesToIncrement}}1548 * @returns {ObjectType.DATETIME}1549 */1550 this.cronapi.dateTime.incMinute = function(date, minute) {1551 var dateVar = this.cronapi.dateTime.getMomentObj(date);1552 return dateVar.add('minutes', minute).toDate();1553 };1554 /**1555 * @type function1556 * @name {{incHour}}1557 * @nameTags incHour|increaseHour1558 * @description {{functionToIncHour}}1559 * @param {ObjectType.DATETIME} date {{ObjectType.DATETIME}}1560 * @param {ObjectType.LONG} hour {{hoursToIncrement}}1561 * @returns {ObjectType.DATETIME}1562 */1563 this.cronapi.dateTime.incHour = function(date, hour) {1564 var dateVar = this.cronapi.dateTime.getMomentObj(date);1565 return dateVar.add('hours', hour).toDate();1566 };1567 /**1568 * @type function1569 * @name {{incDay}}1570 * @nameTags incDay|increaseDay1571 * @description {{functionToIncDay}}1572 * @param {ObjectType.DATETIME} date {{ObjectType.DATETIME}}1573 * @param {ObjectType.LONG} day {{daysToIncrement}}1574 * @returns {ObjectType.DATETIME}1575 */1576 this.cronapi.dateTime.incDay = function(date, day) {1577 var dateVar = this.cronapi.dateTime.getMomentObj(date);1578 return dateVar.add('days', day).toDate();1579 };1580 /**1581 * @type function1582 * @name {{incMonth}}1583 * @nameTags incMonth|increaseMonth1584 * @description {{functionToIncMonth}}1585 * @param {ObjectType.DATETIME} date {{ObjectType.DATETIME}}1586 * @param {ObjectType.LONG} month {{monthsToIncrement}}1587 * @returns {ObjectType.DATETIME}1588 */1589 this.cronapi.dateTime.incMonth = function(date, month) {1590 var dateVar = this.cronapi.dateTime.getMomentObj(date);1591 return dateVar.add('months', month).toDate();1592 };1593 /**1594 * @type function1595 * @name {{incYear}}1596 * @nameTags incYear|increaseYear1597 * @description {{functionToIncYear}}1598 * @param {ObjectType.DATETIME} date {{ObjectType.DATETIME}}1599 * @param {ObjectType.LONG} year {{yearsToIncrement}}1600 * @returns {ObjectType.DATETIME}1601 */1602 this.cronapi.dateTime.incYear = function(date, year) {1603 var dateVar = this.cronapi.dateTime.getMomentObj(date);1604 return dateVar.add('years', year).toDate();1605 };1606 /**1607 * @type function1608 * @name {{getNow}}1609 * @nameTags getNow|now|getDate1610 * @description {{functionToGetNow}}1611 * @returns {ObjectType.DATETIME}1612 */1613 this.cronapi.dateTime.getNow = function() {1614 return moment().toDate();1615 };1616 /**1617 * @type function1618 * @name {{formatDateTime}}1619 * @nameTags formatDateTime1620 * @description {{functionToFormatDateTime}}1621 * @param {ObjectType.DATETIME} date {{ObjectType.DATETIME}}1622 * @param {ObjectType.STRING} format {{format}}1623 * @returns {ObjectType.STRING}1624 */1625 this.cronapi.dateTime.formatDateTime = function(date, format) {1626 return moment(date).format(format);1627 };1628 /**1629 * @type function1630 * @name {{newDate}}1631 * @nameTags newDate|createDate1632 * @description {{functionToNewDate}}1633 * @param {ObjectType.LONG} year {{year}}1634 * @param {ObjectType.LONG} month {{month}}1635 * @param {ObjectType.LONG} month {{day}}1636 * @param {ObjectType.LONG} hour {{hour}}1637 * @param {ObjectType.LONG} minute {{minute}}1638 * @param {ObjectType.LONG} second {{second}}1639 * @returns {ObjectType.DATETIME}1640 */1641 this.cronapi.dateTime.newDate = function(year, month, day, hour, minute, second) {1642 var date = new Date();1643 date.setYear(year);1644 date.setMonth(month - 1);1645 date.setDate(day);1646 date.setHours(hour);1647 date.setMinutes(minute);1648 date.setSeconds(second);1649 return this.cronapi.dateTime.getMomentObj(date.toLocaleString()).toDate();1650 };1651 /**1652 * @category CategoryType.TEXT1653 * @categoryTags TEXT|text1654 */1655 this.cronapi.text = {};1656 /**1657 * @type function1658 * @wizard text_prompt_ext1659 */1660 this.cronapi.text.prompt = function(/** @type {ObjectType.STRING} @defaultValue abc*/ value) {1661 return null;1662 }1663 /**1664 * @category CategoryType.XML1665 * @categoryTags XML|xml1666 */1667 this.cronapi.xml = {};1668 /**1669 * @type function1670 * @name {{newXMLEmptyName}}1671 * @nameTags newXMLEmptyValue1672 * @description {{newXMLEmptyDescription}}1673 * @returns {ObjectType.OBJECT}1674 */1675 this.cronapi.xml.newXMLEmpty = function() {1676 return $.parseXML('<?xml version="1.0" encoding="UTF-8"?><root></root>');1677 };1678 /**1679 * @type function1680 * @name {{newXMLEmptyWithRootName}}1681 * @nameTags newXMLEmptyWithRoot1682 * @description {{newXMLEmptyWithRootDescription}}1683 * @param {ObjectType.OBJECT} rootElement {{rootElement}}1684 * @returns {ObjectType.OBJECT}1685 */1686 this.cronapi.xml.newXMLEmptyWithRoot = function(rootElement) {1687 var t__temp = $.parseXML('<?xml version="1.0" encoding="UTF-8"?><root></root>');1688 t__temp.removeChild(t__temp.firstElementChild);1689 t__temp.appendChild(rootElement);1690 return t__temp;1691 };1692 /**1693 * @type function1694 * @name {{newXMLElementName}}1695 * @nameTags newXMLElement1696 * @description {{newXMLElementDescription}}1697 * @param {ObjectType.STRING} elementName {{elementName}}1698 * @param {ObjectType.STRING} value {{content}}1699 * @returns {ObjectType.OBJECT}1700 */1701 this.cronapi.xml.newXMLElement = function(elementName, value) {1702 var t__tempElement = document.createElement(elementName);1703 t__tempElement.textContent = value;1704 return t__tempElement;1705 };1706 /**1707 * @type function1708 * @name {{addXMLElementName}}1709 * @nameTags addXMLElement1710 * @description {{addXMLElementDescription}}1711 * @param {ObjectType.OBJECT} parent {{parentElement}}1712 * @param {ObjectType.OBJECT} value {{elementToAdd}}1713 * @returns {ObjectType.BOOLEAN}1714 */1715 this.cronapi.xml.addXMLElement = function(parent, element) {1716 try{1717 var temp = element.cloneNode(true);1718 parent.appendChild(temp);1719 return true;1720 }catch(e){1721 return false;1722 }1723 };1724 /**1725 * @type function1726 * @name {{XMLHasRootElementName}}1727 * @nameTags XMLHasRootElement1728 * @description {{XMLHasRootElementDescription}}1729 * @param {ObjectType.OBJECT} element {{element}}1730 * @returns {ObjectType.BOOLEAN}1731 */1732 this.cronapi.xml.XMLHasRootElement = function(element) {1733 if(element && element.getRootNode()) return true;1734 return false;1735 }1736 /**1737 * @type function1738 * @name {{XMLGetRootElementName}}1739 * @nameTags XMLGetRootElement1740 * @description {{XMLGetRootElementDescription}}1741 * @param {ObjectType.OBJECT} element {{element}}1742 * @returns {ObjectType.OBJECT}1743 */1744 this.cronapi.xml.XMLGetRootElement = function(element) {1745 if(element instanceof XMLDocument){1746 return element.firstElementChild;1747 }1748 return element.getRootNode();1749 }1750 /**1751 * @type function1752 * @name {{XMLDocumentToTextName}}1753 * @nameTags XMLDocumentToText1754 * @description {{XMLDocumentToTextDescription}}1755 * @param {ObjectType.OBJECT} xml {{element}}1756 * @returns {ObjectType.STRING}1757 */1758 this.cronapi.xml.XMLDocumentToText = function(xml) {1759 if(xml instanceof XMLDocument){1760 return $($($(xml.firstElementChild).context.outerHTML).removeAttr('xmlns'))[0].outerHTML ;1761 }1762 if($(xml).size() > 1 ){1763 var __v = '';1764 $.each($(xml).toArray() , function(key , value){ __v += $($(value)[0].outerHTML).removeAttr('xmlns')[0].outerHTML } );1765 return __v;1766 }1767 return $($($(xml).context.outerHTML).removeAttr('xmlns'))[0].outerHTML ;1768 }1769 /**1770 * @type function1771 * @name {{getChildrenName}}1772 * @nameTags getChildren1773 * @description {{getChildrenDescription}}1774 * @param {ObjectType.OBJECT} element {{element}}1775 * @param {ObjectType.STRING} search {{getChildrenParam1}}1776 * @returns {ObjectType.LIST}1777 */1778 this.cronapi.xml.getChildren = function(element, search) {1779 if(element instanceof XMLDocument){1780 return element.firstElementChild.toArray;1781 }1782 if(search){1783 if(search.localName){1784 return $(element).find(search.localName).toArray();1785 }else {1786 return $(element).find(search).toArray();1787 }1788 }1789 return $(element).children().toArray();1790 };1791 /**1792 * @type function1793 * @name {{setAttributeName}}1794 * @nameTags setAttribute1795 * @description {{setAttributeDescription}}1796 * @param {ObjectType.OBJECT} element {{element}}1797 * @param {ObjectType.STRING} attributeName {{attributeName}}1798 * @param {ObjectType.STRING} attributeValue {{attributeValue}}1799 * @returns {ObjectType.BOOLEAN}1800 */1801 this.cronapi.xml.setAttribute = function(element, attributeName, attributeValue) {1802 if(!attributeName){1803 return false;1804 }1805 if(element instanceof XMLDocument){1806 element.firstChild.setAttribute(attributeName, attributeValue);1807 return true;1808 }1809 if(element){1810 element.setAttribute(attributeName, attributeValue);1811 return true;1812 }1813 return false;1814 };1815 /**1816 * @type function1817 * @name {{getAttributeValueName}}1818 * @nameTags getAttributeValue1819 * @description {{getAttributeValueDescription}}1820 * @param {ObjectType.OBJECT} element {{element}}1821 * @param {ObjectType.STRING} attributeName {{attributeName}}1822 * @returns {ObjectType.STRING}1823 */1824 this.cronapi.xml.getAttributeValue = function(element, attributeName) {1825 if(!attributeName){1826 return '';1827 }1828 if(element instanceof XMLDocument){1829 return element.firstChild.getAttribute(attributeName) ? element.firstChild.getAttribute(attributeName) : '' ;1830 }1831 if(element && attributeName ){1832 return element.getAttribute(attributeName) ;1833 }1834 return '';1835 }1836 /**1837 * @type function1838 * @name {{getParentNodeName}}1839 * @nameTags getParentNode1840 * @description {{getParentNodeDescription}}1841 * @param {ObjectType.OBJECT} element {{element}}1842 * @returns {ObjectType.OBJECT}1843 */1844 this.cronapi.xml.getParentNode = function(element){1845 if(element instanceof XMLDocument){1846 return element.firstChild;1847 }1848 return element.parentNode;1849 }1850 /**1851 * @type function1852 * @name {{setElementValueName}}1853 * @nameTags setElementValue1854 * @description {{setElementValueDescription}}1855 * @param {ObjectType.OBJECT} element {{element}}1856 * @param {ObjectType.STRING} content {{content}}1857 */1858 this.cronapi.xml.setElementContent = function(element, content) {1859 if(element instanceof XMLDocument){1860 element.firstChild.textContent = content;1861 }1862 element.textContent = content;1863 }1864 /**1865 * @type function1866 * @name {{getElementContentName}}1867 * @nameTags getElementContent1868 * @description {{getElementContentDescription}}1869 * @param {ObjectType.OBJECT} element {{element}}1870 * @returns {ObjectType.STRING}1871 */1872 this.cronapi.xml.getElementContent = function(element) {1873 if(element instanceof XMLDocument){1874 return element.firstChild.innerText;1875 }1876 return element.innerText;1877 }1878 /**1879 * @type function1880 * @name {{removeElementName}}1881 * @nameTags removeElement1882 * @description {{removeElementDescription}}1883 * @param {ObjectType.OBJECT} parent {{parentElement}}1884 * @param {ObjectType.STRING} element {{element}}1885 */1886 this.cronapi.xml.removeElement = function(parent, element) {1887 if(parent instanceof XMLDocument)1888 {1889 if(element)1890 {1891 if( element instanceof HTMLUnknownElement ){1892 element.remove();1893 }else1894 {1895 $.each( $(parent.firstElementChild.children), function( key , value )1896 {1897 if(value.localName == element)1898 value.remove();1899 });1900 }1901 }else1902 {1903 $.each( $(parent.firstElementChild.children), function( key , currentObject ){ currentObject.remove() });1904 }1905 }else1906 {1907 if(element)1908 {1909 if( element instanceof HTMLUnknownElement ){1910 element.remove();1911 }else1912 {1913 $.each( $(parent.children), function( key , value )1914 {1915 if(value.localName == element)1916 value.remove();1917 });1918 }1919 }else1920 {1921 $.each( $(parent.children), function( key , currentObject ){ currentObject.remove() });1922 }1923 }1924 }1925 /**1926 * @type function1927 * @name {{getElementNameName}}1928 * @nameTags getElementName1929 * @description {{getElementNameDescription}}1930 * @param {ObjectType.OBJECT} element {{element}}1931 * @returns {ObjectType.STRING}1932 */1933 this.cronapi.xml.getElementName = function(element){1934 if(element instanceof XMLDocument){1935 return element.firstChild.localName;1936 }1937 return element.localName;1938 }1939 /**1940 * @type function1941 * @name {{renameElementName}}1942 * @nameTags renameElement1943 * @description {{renameElementDescription}}1944 * @param {ObjectType.OBJECT} element {{element}}1945 * @param {ObjectType.STRING} name {{name}}1946 */1947 this.cronapi.xml.renameElement = function(element, name){1948 var newElement = element.outerHTML.replace(element.localName, name )1949 newElement = newElement.replace('/'+ element.localName ,'/'+name);1950 newElement = $(newElement).removeAttr('xmlns');1951 element.replaceWith(newElement[0]);1952 }1953 /**1954 * @category CategoryType.LOGIC1955 * @categoryTags LOGIC|logic1956 */1957 this.cronapi.logic = {};1958 /**1959 * @type function1960 * @name {{LogicIsNullName}}1961 * @nameTags isNull1962 * @description {{LogicIsNullDescription}}1963 * @returns {ObjectType.BOOLEAN}1964 * @displayInline true1965 */1966 this.cronapi.logic.isNull = function(/** @type {ObjectType.OBJECT} @description */ value) {1967 return (value === null || typeof value == 'undefined' || value == undefined);1968 }1969 /**1970 * @type function1971 * @name {{LogicIsEmptyName}}1972 * @nameTags isEmpty1973 * @description {{LogicIsEmptyDescription}}1974 * @returns {ObjectType.BOOLEAN}1975 * @displayInline true1976 */1977 this.cronapi.logic.isEmpty = function(/** @type {ObjectType.OBJECT} @description */ value) {1978 return (value === '');1979 }1980 /**1981 * @type function1982 * @name {{LogicIsNullOrEmptyName}}1983 * @nameTags isNullOrEmpty1984 * @description {{LogicIsNullOrEmptyDescription}}1985 * @returns {ObjectType.BOOLEAN}1986 * @displayInline true1987 */1988 this.cronapi.logic.isNullOrEmpty = function(/** @type {ObjectType.OBJECT} @description */ value) {1989 return (this.cronapi.logic.isNull(value) || this.cronapi.logic.isEmpty(value));1990 }1991 /**1992 * @type function1993 * @name {{}}1994 * @nameTags typeOf1995 * @description {{typeOfDescription}}1996 * @returns {ObjectType.OBJECT}1997 * @displayInline true1998 */1999 this.cronapi.logic.typeOf = function(/** @type {ObjectType.OBJECT} @description {{value}} */ value, /** @type {ObjectType.OBJECT} @description {{typeOf}} @blockType util_dropdown @keys string|number|undefined|object|function|array @values {{string}}|{{number}}|{{undefined}}|{{object}}|{{function}}|{{array}} */ type) {2000 if(type==='array') return Array.isArray(value);2001 if(type==='object' && Array.isArray(value)) return false;2002 return (typeof(value) === type);2003 }2004 this.cronapi.i18n = {};2005 this.cronapi.i18n.translate = function(value , params) {2006 if (value) {2007 var text = this.cronapi.$translate.instant(value);2008 for (var i = 0; i < params.length; i++){2009 var param = params[i];2010 if (param != null && typeof param != "undefined") {2011 var regexp = new RegExp("\\{" + (i) + "\\}", "g");2012 text = text.replace(regexp, param);2013 }2014 }2015 return text;2016 }2017 return;2018 };2019 this.cronapi.internal = {};2020 this.cronapi.internal.setFile = function(field, file) {2021 this.cronapi.internal.fileToBase64(file, function(base64) { this.cronapi.screen.changeValueOfField(field, base64); }.bind(this));2022 };2023 this.cronapi.internal.fileToBase64 = function(file, cb) {2024 var fileReader = new FileReader();2025 fileReader.readAsDataURL(file);2026 fileReader.onload = function(e) {2027 var base64Data = e.target.result.substr(e.target.result.indexOf('base64,') + 'base64,'.length);2028 cb(base64Data);2029 };2030 };2031 this.cronapi.internal.startCamera = function(field) {2032 //verify if user is on Browser or not2033 if(window.cordova && window.cordova.platformId && window.cordova.platformId !== 'browser') {2034 // If in mobile devices use native camera cordova plugin2035 var that = this;2036 navigator.camera.getPicture(function (result) {2037 that.cronapi.screen.changeValueOfField(field, result);2038 }, function (error) {2039 console.error(error);2040 that.cronapi.$scope.Notification.error(message);2041 }, {2042 quality: 60, //Mobile images are very big to be stored into database, so reducing their quality (same as whatsapp images) improve performance and reduce db size2043 destinationType: Camera.DestinationType.DATA_URL,2044 encodingType: Camera.EncodingType.PNG,2045 correctOrientation: true2046 });2047 }else{2048 var cameraContainer = '<div class="camera-container" style="margin-left:-$marginleft$;margin-top:-$margintop$">\2049 <div class="btn btn-success button button-balanced" id="cronapiVideoCaptureOk" style="position: absolute; z-index: 999999999;">\2050 <span class="glyphicon glyphicon-ok icon ion-checkmark-round"></span>\2051 </div>\2052 <div class="btn btn-danger button button-assertive button-cancel-capture" id="cronapiVideoCaptureCancel" style="position: absolute; margin-left: 42px; z-index: 999999999;">\2053 <span class="glyphicon glyphicon-remove icon ion-android-close"></span>\2054 </div>\2055 <video id="cronapiVideoCapture" style="height: $height$; width: $width$;" autoplay=""></video>\2056 </div>';2057 function getMaxResolution(width, height) {2058 var maxWidth = window.innerWidth;2059 var maxHeight = window.innerHeight;2060 var ratio = 0;2061 ratio = maxWidth / width;2062 height = height * ratio;2063 width = width * ratio;2064 if(width > maxWidth){2065 ratio = maxWidth / width;2066 height = height * ratio;2067 width = width * ratio;2068 }2069 if(height > maxHeight){2070 ratio = maxHeight / height;2071 width = width * ratio;2072 height = height * ratio;2073 }2074 return { width: width, height: height };2075 }2076 var streaming = null;2077 var mediaConfig = { video: true };2078 var errBack = function(e) {2079 console.log('An error has occurred!', e)2080 };2081 if(navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {2082 navigator.mediaDevices.getUserMedia(mediaConfig).then(function(stream) {2083 streaming = stream;2084 var res = getMaxResolution(stream.getTracks()[0].getSettings().width, stream.getTracks()[0].getSettings().height);2085 var halfWidth = res.width;2086 var halfHeight = res.height;2087 try {2088 halfWidth = parseInt(halfWidth/2);2089 halfHeight = parseInt(halfHeight/2);2090 }2091 catch (e) { }2092 cameraContainer =2093 cameraContainer2094 .split('$height$').join(res.height+'px')2095 .split('$width$').join(res.width+'px')2096 .split('$marginleft$').join(halfWidth+'px')2097 .split('$margintop$').join(halfHeight+'px')2098 ;2099 var cronapiVideoCapture = $(cameraContainer);2100 cronapiVideoCapture.prependTo("body");2101 var videoDOM = document.getElementById('cronapiVideoCapture');2102 cronapiVideoCapture.find('#cronapiVideoCaptureCancel').on('click',function() {2103 if (streaming!= null && streaming.getTracks().length > 0)2104 streaming.getTracks()[0].stop();2105 $(cronapiVideoCapture).remove();2106 }.bind(this));2107 cronapiVideoCapture.find('#cronapiVideoCaptureOk').on('click',function() {2108 this.cronapi.internal.captureFromCamera(field, res.width, res.height);2109 if (streaming!= null && streaming.getTracks().length > 0)2110 streaming.getTracks()[0].stop();2111 $(cronapiVideoCapture).remove();2112 }.bind(this));2113 videoDOM.srcObject = stream;2114 videoDOM.onloadedmetadata = function(e) {2115 videoDOM.play();2116 };2117 }.bind(this));2118 }2119 }2120 };2121 this.cronapi.internal.downloadFileEntityMobile = function(datasource, field, indexData) {2122 var tempJsonFileUploaded = null;2123 var valueContent;2124 var itemActive;2125 if (indexData) {2126 valueContent = datasource.data[indexData][field];2127 itemActive = datasource.data[indexData];2128 }2129 else {2130 try {2131 valueContent = datasource.active[field];2132 itemActive = datasource.active;2133 }2134 catch (e) {2135 valueContent = datasource[field];2136 itemActive = datasource;2137 }2138 }2139 //Verificando se é JSON Uploaded file2140 try {2141 var tempJsonFileUploaded = JSON.parse(valueContent);2142 }2143 catch(e) { }2144 if (tempJsonFileUploaded) {2145 var finalUrl = this.cronapi.internal.getAddressWithHostApp('/api/cronapi/filePreview/');2146 window.open(finalUrl + tempJsonFileUploaded.path, '_system');2147 }2148 else if (valueContent.indexOf('dropboxusercontent') > -1) {2149 window.open(valueContent, '_system');2150 }2151 else {2152 var url = '/api/cronapi/downloadFile';2153 var splited = datasource.entity.split('/');2154 var entity = splited[splited.length-1];2155 if (entity.indexOf(":") > -1) {2156 //Siginifica que é relacionamento, pega a entidade do relacionamento2157 var entityRelation = '';2158 var splitedDomainBase = splited[3].split('.');2159 for (var i=0; i<splitedDomainBase.length-1;i++)2160 entityRelation += splitedDomainBase[i]+'.';2161 var entityRelationSplited = entity.split(':');2162 entity = entityRelation + entityRelationSplited[entityRelationSplited.length-1];2163 }2164 url += '/' + entity;2165 url += '/' + field;2166 var object = itemActive;2167 var ids = datasource.getKeyValues(object);2168 var currentIdxId = 0;2169 for (var attr in ids) {2170 if (currentIdxId == 0)2171 url = url + '/' + object[attr];2172 else2173 url = url + ':' + object[attr];2174 currentIdxId++;2175 }2176 var finalUrl = this.cronapi.internal.getAddressWithHostApp(url);2177 window.open(finalUrl, '_system');2178 }2179 };2180 this.cronapi.internal.captureFromCamera = function(field, width, height) {2181 var canvas = document.createElement("canvas"); // create img tag2182 canvas.width = width;2183 canvas.height = height;2184 var context = canvas.getContext('2d');2185 var videoDOM = document.getElementById('cronapiVideoCapture');2186 context.drawImage(videoDOM, 0, 0, width, height);2187 var base64 = canvas.toDataURL().substr(22);2188 this.cronapi.screen.changeValueOfField(field, base64);2189 };2190 this.cronapi.internal.castBinaryStringToByteArray = function(binary_string) {2191 var len = binary_string.length;2192 var bytes = new Uint8Array( len );2193 for (var i = 0; i < len; i++) {2194 bytes[i] = binary_string.charCodeAt(i);2195 }2196 return bytes;2197 };2198 this.cronapi.internal.castBase64ToByteArray = function(base64) {2199 var binary_string = window.atob(base64);2200 return this.cronapi.internal.castBinaryStringToByteArray(binary_string);2201 };2202 this.cronapi.internal.castByteArrayToString = function(bytes) {2203 return String.fromCharCode.apply(null, new Uint16Array(bytes));2204 };2205 this.cronapi.internal.generatePreviewDescriptionByte = function(data) {2206 var json;2207 try {2208 //Verificando se é JSON Uploaded file2209 json = JSON.parse(data);2210 }2211 catch (e) {2212 try {2213 //Tenta pegar do header2214 json = JSON.parse(window.atob(data));2215 }2216 catch (e) {2217 //Verifica se é drpobox2218 if (data && data.indexOf('dropboxusercontent') > -1) {2219 json = {};2220 var urlSplited = data.split('/');2221 var fullName = urlSplited[urlSplited.length - 1].replace('?dl=0','');2222 var fullNameSplited = fullName.split('.')2223 var extension = '.' + fullNameSplited[fullNameSplited.length - 1];2224 json.fileExtension = extension;2225 json.name = fullName.replace(extension, '');2226 json.contentType = 'file/'+extension.replace('.','');2227 }2228 else if (data && data.match(/__odataFile_/g)) {2229 var file = eval(data);2230 var fullNameSplited = file.name.split('.');2231 var extension = '.' + fullNameSplited[fullNameSplited.length - 1];2232 json = {};2233 json.fileExtension = extension;2234 json.name = file.name;2235 json.contentType = file.type || 'unknown';2236 }2237 else if (data && this.cronapi.internal.isBase64(data)) {2238 var fileName = 'download';2239 var fileExtesion = this.cronapi.internal.getExtensionBase64(data);2240 var contentType = this.cronapi.internal.getContentTypeFromExtension(fileExtesion);2241 fileName += fileExtesion;2242 json = {};2243 json.fileExtension = fileExtesion;2244 json.name = fileName;2245 json.contentType = contentType;2246 }2247 }2248 }2249 if (json) {2250 if (json.name.length > 25)2251 json.name = json.name.substr(0,22)+'...';2252 var result = "<b>Nome:</b> <br/>" + json.name +"<br/>";2253 result += "<b>Content-Type:</b> <br/>" + json.contentType +"<br/>";2254 result += "<b>Extensão:</b> <br/>" + json.fileExtension +"<br/>";2255 return result;2256 }2257 };2258 this.cronapi.internal.getContentTypeFromExtension = function(extension) {2259 if (extension) {2260 switch (extension.toLowerCase()) {2261 case '.png':2262 return 'image/png';2263 case '.jpg':2264 return 'image/jpeg';2265 case '.mp4':2266 return 'video/mp4';2267 case '.pdf':2268 return 'application/pdf';2269 case '.ico':2270 return 'image/vnd.microsoft.icon';2271 case '.rar':2272 return 'application/x-rar-compressed';2273 case '.rtf':2274 return 'application/rtf';2275 case '.txt':2276 return 'text/plain';2277 case '.zip':2278 return 'application/zip';2279 case '.srt':2280 return 'text/srt';2281 default:2282 return 'unknown';2283 }2284 }2285 };2286 this.cronapi.internal.getExtensionBase64 = function(base64) {2287 if (base64) {2288 var data = base64.substr(0, 5);2289 switch (data.toLocaleUpperCase())2290 {2291 case "IVBOR":2292 return ".png";2293 case "/9J/4":2294 return ".jpg";2295 case "AAAAF":2296 return ".mp4";2297 case "JVBER":2298 return ".pdf";2299 case "AAABA":2300 return ".ico";2301 case "UMFYI":2302 return ".rar";2303 case "E1XYD":2304 return ".rtf";2305 case "U1PKC":2306 return ".txt";2307 case "UESDB":2308 return ".zip";2309 case "MQOWM":2310 case "77U/M":2311 return ".srt";2312 default:2313 return "";2314 }2315 }2316 return "";2317 };2318 this.cronapi.internal.isBase64 = function(str) {2319 try {2320 return btoa(atob(str)) == str;2321 } catch (err) {2322 return false;2323 }2324 };2325 this.cronapi.internal.downloadFileEntity = function(datasource, field, indexData) {2326 function downloadUrl(url, fileName) {2327 var link = document.createElement('a');2328 link.setAttribute('href', url);2329 link.setAttribute("download", fileName);2330 var event = document.createEvent('MouseEvents');2331 event.initMouseEvent('click', true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 0, null);2332 link.dispatchEvent(event);2333 }2334 var tempJsonFileUploaded = null;2335 var valueContent;2336 var itemActive;2337 if (indexData) {2338 valueContent = datasource.data[indexData][field];2339 itemActive = datasource.data[indexData];2340 }2341 else {2342 try {2343 valueContent = datasource.active[field];2344 itemActive = datasource.active;2345 }2346 catch (e) {2347 valueContent = datasource[field];2348 itemActive = datasource;2349 }2350 }2351 //Verificando se é JSON Uploaded file2352 try {2353 var tempJsonFileUploaded = JSON.parse(valueContent);2354 }2355 catch(e) { }2356 if (tempJsonFileUploaded) {2357 window.open('/api/cronapi/filePreview/'+tempJsonFileUploaded.path);2358 }2359 else if (valueContent.indexOf('dropboxusercontent') > -1) {2360 window.open(valueContent);2361 }2362 else {2363 if (datasource.isOData()) {2364 var urlCreator = window.URL || window.webkitURL || window.mozURL || window.msURL;2365 var bytesOrFileInput;2366 var fileName = 'download';2367 if (valueContent.match(/__odataFile_/g)) {2368 bytesOrFileInput = eval(valueContent);2369 fileName = bytesOrFileInput.name2370 }2371 else {2372 fileName += this.cronapi.internal.getExtensionBase64(valueContent);2373 valueContent = window.atob(valueContent);2374 bytesOrFileInput = this.cronapi.internal.castBinaryStringToByteArray(valueContent);2375 }2376 var url = urlCreator.createObjectURL(new Blob([bytesOrFileInput],{type: 'application/octet-stream'}));2377 downloadUrl(url, fileName);2378 }2379 else {2380 var url = '/api/cronapi/downloadFile';2381 var splited = datasource.entity.split('/');2382 var entity = splited[splited.length-1];2383 if (entity.indexOf(":") > -1) {2384 //Siginifica que é relacionamento, pega a entidade do relacionamento2385 var entityRelation = '';2386 var splitedDomainBase = splited[3].split('.');2387 for (var i=0; i<splitedDomainBase.length-1;i++)2388 entityRelation += splitedDomainBase[i]+'.';2389 var entityRelationSplited = entity.split(':');2390 entity = entityRelation + entityRelationSplited[entityRelationSplited.length-1];2391 }2392 url += '/' + entity;2393 url += '/' + field;2394 var _u = JSON.parse(localStorage.getItem('_u'));2395 var object = itemActive;2396 var finalUrl = this.cronapi.internal.getAddressWithHostApp(url);2397 this.$promise = this.cronapi.$scope.$http({2398 method: 'POST',2399 url: finalUrl,2400 data: (object) ? JSON.stringify(object) : null,2401 responseType: 'blob',2402 headers: {2403 'Content-Type': 'application/json',2404 'X-AUTH-TOKEN': _u.token,2405 }2406 }).success(function(data, status, headers, config) {2407 headers = headers();2408 var filename = headers['x-filename'] || 'download.bin';2409 var urlCreator = window.URL || window.webkitURL || window.mozURL || window.msURL;2410 try2411 {2412 var url = urlCreator.createObjectURL(data);2413 downloadUrl(url, filename);2414 } catch(ex) {2415 console.log('Error downloading file');2416 console.log(ex);2417 }2418 }.bind(this)).error(function(data, status, headers, config) {2419 console.log('Error downloading file');2420 }.bind(this));2421 }2422 }2423 };2424 this.cronapi.internal.uploadFileAjax = function(field, file, progressId) {2425 var uploadUrl = '/api/cronapi/uploadFile';2426 var formData = new FormData();2427 formData.append("file", file);2428 var _u = JSON.parse(localStorage.getItem('_u'));2429 var finalUrl = this.cronapi.internal.getAddressWithHostApp(uploadUrl);2430 this.$promise = this.cronapi.$scope.$http({2431 method: 'POST',2432 url: finalUrl,2433 data: formData,2434 headers: {2435 'Content-Type': undefined,2436 'X-AUTH-TOKEN': _u.token2437 },2438 onProgress: function(event) {2439 if (event.lengthComputable) {2440 var complete = (event.loaded / event.total * 100 | 0);2441 var $progressId = $('#'+progressId);2442 if ($progressId.length > 0) {2443 if ($progressId.data('type') == 'bootstrapProgress') {2444 if (complete < 100) {2445 $progressId.show();2446 $progressId.find('.progress-bar').css('width', complete+'%');2447 }2448 else {2449 $progressId.hide();2450 $progressId.find('.progress-bar').css('width', '0%');2451 }2452 }2453 else {2454 var progress = document.getElementById(progressId);2455 progress.value = progress.innerHTML = complete;2456 }2457 }2458 }2459 }2460 }).success(function(data, status, headers, config) {2461 this.cronapi.screen.changeValueOfField(field, data.jsonString);2462 }.bind(this)).error(function(data, status, headers, config) {2463 alert('Error uploading file');2464 }.bind(this));2465 };2466 this.cronapi.internal.uploadFile = function(field, file, progressId) {2467 if (!file)2468 return;2469 var regexForDatasource = /(.*?).active./g;2470 var groupDatasource = regexForDatasource.exec(field);2471 //Verificar se é campo de um datasource2472 if (groupDatasource) {2473 var datasource = eval(groupDatasource[1]);2474 if (datasource.isOData()) {2475 var regexForField = /.active.([a-zA-Z0-9]*)/g;2476 var groupField = regexForField.exec(field);2477 var fieldName = groupField[1];2478 var schemaField = datasource.getFieldSchema(fieldName);2479 if (schemaField && schemaField.type == 'Binary') {2480 datasource.active['__odataFile_' + fieldName] = file;2481 datasource.active[fieldName] = datasource.name + '.active.__odataFile_' + fieldName;2482 }2483 else {2484 this.cronapi.internal.uploadFileAjax(field, file, progressId);2485 }2486 }2487 else {2488 this.cronapi.internal.uploadFileAjax(field, file, progressId);2489 }2490 }2491 else {2492 this.cronapi.internal.uploadFileAjax(field, file, progressId);2493 }2494 };2495 /**2496 * @category CategoryType.OBJECT2497 * @categoryTags OBJECT|object2498 */2499 this.cronapi.object = {};2500 /**2501 * @type function2502 * @name {{getProperty}}2503 * @nameTags getProperty2504 * @param {ObjectType.OBJECT} object {{object}}2505 * @param {ObjectType.STRING} property {{property}}2506 * @description {{getPropertyDescription}}2507 * @returns {ObjectType.OBJECT}2508 */2509 this.cronapi.object.getProperty = function(object, property) {2510 var splited = property.split('.');2511 if(splited.length > 1 ){2512 var recursiva = function(object, params , idx) {2513 if (!idx) idx = 0;2514 if(object[params[idx]] === undefined)2515 object[params[idx]] = {};2516 idx++;2517 if (idx < params.length)2518 return recursiva(object[params[idx -1]], params , idx);2519 else return object[params[idx-1]];2520 };2521 return recursiva(object , splited , 0);2522 }else{2523 return object[property];2524 }2525 };2526 /**2527 * @type function2528 * @name {{setProperty}}2529 * @nameTags setProperty2530 * @param {ObjectType.OBJECT} object {{object}}2531 * @param {ObjectType.STRING} property {{property}}2532 * @param {ObjectType.OBJECT} value {{value}}2533 * @description {{setPropertyDescription}}2534 * @returns {ObjectType.VOID}2535 */2536 this.cronapi.object.setProperty = function(object, property, value) {2537 var splited = property.split('.');2538 if(splited.length > 1 ){2539 var recursiva = function(object, params,value , idx) {2540 if (!idx) idx = 0;2541 if(object[params[idx]] === undefined)2542 object[params[idx]] = {};2543 idx++;2544 if (idx < params.length)2545 recursiva(object[params[idx -1]], params, value , idx);2546 else object[params[idx-1]] = value;2547 };2548 recursiva(object , splited , value, 0);2549 }else{2550 object[property] = value;2551 }2552 };2553 /**2554 * @type function2555 * @name {{createObject}}2556 * @description {{createObjectDescription}}2557 * @nameTags object2558 * @param {ObjectType.STRING} string {{string}}2559 * @returns {ObjectType.OBJECT}2560 */2561 this.cronapi.object.createObjectFromString = function(string) {2562 return JSON.parse(string);2563 };2564 /**2565 * @type function2566 * @name {{serializeObject}}2567 * @description {{serializeObjectDescription}}2568 * @nameTags object2569 * @param {ObjectType.STRING} string {{string}}2570 * @returns {ObjectType.OBJECT}2571 */2572 this.cronapi.object.serializeObject = function(obj) {2573 return JSON.stringify(obj);2574 };2575 /**2576 * @type function2577 * @name {{deleteProperty}}2578 * @description {{deletePropertyDescription}}2579 * @nameTags object2580 * @param {ObjectType.OBJECT} object {{object}}2581 * @param {ObjectType.STRING} key {{key}}2582 */2583 this.cronapi.object.deleteProperty = function(obj, key) {2584 delete obj[key];2585 };2586 /**2587 * @type function2588 * @name {{createNewObject}}2589 * @nameTags createNewObject2590 * @description {{functionToCreateNewObject}}2591 * @arbitraryParams true2592 * @wizard procedures_createnewobject_callreturn2593 * @returns {ObjectType.OBJECT}2594 */2595 this.cronapi.object.newObject = function() {2596 var result = {};2597 if (arguments && arguments.length > 0) {2598 for (var i = 0; i < arguments.length; i++) {2599 var param = arguments[i];2600 if (param.name)2601 result[param.name] = param.value;2602 }2603 }2604 return result;2605 };2606 /**2607 * @type function2608 * @name {{getObjectField}}2609 * @nameTags getObjectField2610 * @description {{functionToGetObjectField}}2611 * @param {ObjectType.OBJECT} obj {{obj}}2612 * @param {ObjectType.STRING} field {{field}}2613 * @wizard procedures_get_field2614 */2615 this.cronapi.object.getObjectField = function(/** @type {ObjectType.OBJECT} @blockType variables_get */ obj, /** @type {ObjectType.STRING} @blockType procedures_get_field_object */ field) {2616 var result = undefined;2617 if (obj && field)2618 result = obj[field];2619 return result;2620 };2621 /**2622 * @category CategoryType.JSON2623 * @categoryTags JSON|json2624 */2625 this.cronapi.json = {};2626 /**2627 * @type function2628 * @name {{createObjectJson}}2629 * @description {{createObjectJsonDescription}}2630 * @nameTags object2631 * @param {ObjectType.STRING} string {{string}}2632 * @returns {ObjectType.OBJECT}2633 */2634 this.cronapi.json.createObjectFromString = function(string) {2635 return this.cronapi.object.createObjectFromString(string);2636 };2637 /**2638 * @type function2639 * @name {{setProperty}}2640 * @nameTags setProperty2641 * @param {ObjectType.OBJECT} object {{json}}2642 * @param {ObjectType.STRING} property {{property}}2643 * @param {ObjectType.OBJECT} value {{value}}2644 * @description {{setPropertyDescription}}2645 * @returns {ObjectType.VOID}2646 */2647 this.cronapi.json.setProperty = function(object, property, value) {2648 this.cronapi.object.setProperty(object, property, value)2649 };2650 /**2651 * @type function2652 * @name {{deleteProperty}}2653 * @description {{deletePropertyDescription}}2654 * @nameTags object2655 * @param {ObjectType.OBJECT} object {{json}}2656 * @param {ObjectType.STRING} key {{key}}2657 */2658 this.cronapi.json.deleteProperty = function(obj, key) {2659 this.cronapi.object.deleteProperty(obj, key);2660 };2661 /**2662 * @type function2663 * @name {{getProperty}}2664 * @nameTags getProperty2665 * @param {ObjectType.OBJECT} object {{json}}2666 * @param {ObjectType.STRING} property {{property}}2667 * @description {{getPropertyDescription}}2668 * @returns {ObjectType.OBJECT}2669 */2670 this.cronapi.json.getProperty = function(object, property) {2671 return this.cronapi.object.getProperty(object, property);2672 };2673 /**2674 * @category CategoryType.DEVICE2675 * @categoryTags CORDOVA|cordova|Dispositivos|device|Device2676 */2677 this.cronapi.cordova = {};2678 /**2679 * @type function2680 * @name {{vibrate}}2681 * @platform M2682 * @nameTags vibrate2683 * @param {ObjectType.OBJECT} vibrateValue {{vibrateValue}}2684 * @description {{vibrateDescription}}2685 * @returns {ObjectType.VOID}2686 */2687 this.cronapi.cordova.vibrate = function(vibrateValue){2688 navigator.vibrate(vibrateValue);2689 };2690 this.cronapi.cordova.device = {};2691 /**2692 * @type function2693 * @platform M2694 * @name {{getFirebaseToken}}2695 * @nameTags firebase|token|push|notification2696 * @param {ObjectType.STATEMENTSENDER} success {{success}}2697 * @param {ObjectType.STATEMENTSENDER} error {{error}}2698 * @description {{getFirebaseTokenDescription}}2699 * @returns {ObjectType.VOID}2700 */2701 this.cronapi.cordova.device.getFirebaseToken = function(success,error){2702 window.FirebasePlugin.getToken(success,error);2703 };2704 /**2705 * @type function2706 * @platform M2707 * @name {{getFirebaseNotificationData}}2708 * @nameTags firebase|token|push|notification2709 * @param {ObjectType.STATEMENTSENDER} success {{success}}2710 * @param {ObjectType.STATEMENTSENDER} error {{error}}2711 * @description {{getFirebaseNotificationDataDesc}}2712 * @returns {ObjectType.VOID}2713 */2714 this.cronapi.cordova.device.getFirebaseNotificationData = function(success,error){2715 function onDeviceReady() { window.FirebasePlugin.onNotificationOpen(function(notification) {2716 success(notification);2717 }, function(err) {2718 error(err);2719 });2720 };2721 document.addEventListener("deviceready", onDeviceReady, false);2722 };2723 /**2724 * @type function2725 * @platform M2726 * @name {{getDeviceInfo}}2727 * @nameTags device|dispositivo|info2728 * @param {ObjectType.STRING} type {{type}}2729 * @description {{getDeviceInfoDescription}}2730 * @returns {ObjectType.STRING}2731 */2732 this.cronapi.cordova.device.getDeviceInfo = function( /** @type {ObjectType.STRING} @description {{type}} @blockType util_dropdown @keys uuid|model|platform|version|manufacturer|isVirtual|serial @values uuid|model|platform|version|manufacturer|isVirtual|serial */ type){2733 return window.device[type];2734 };2735 this.cronapi.cordova.geolocation = {};2736 /**2737 * @type function2738 * @platform M2739 * @name {{getCurrentPosition}}2740 * @nameTags geolocation|getCurrentPosition2741 * @param {ObjectType.STATEMENTSENDER} success {{success}}2742 * @param {ObjectType.STATEMENTSENDER} error {{error}}2743 * @description {{getCurrentPositionDescription}}2744 * @returns {ObjectType.VOID}2745 */2746 this.cronapi.cordova.geolocation.getCurrentPosition = function(success, error){2747 navigator.geolocation.getCurrentPosition(success, error);2748 };2749 /**2750 * @type function2751 * @platform M2752 * @name {{watchPosition}}2753 * @nameTags geolocation|watchPosition2754 * @param {ObjectType.STATEMENTSENDER} success {{success}}2755 * @param {ObjectType.STATEMENTSENDER} error {{error}}2756 * @param {ObjectType.LONG} maximumAge {{maximumAge}}2757 * @param {ObjectType.LONG} timeout {{timeout}}2758 * @param {ObjectType.BOOLEAN} enableHighAccuracy {{enableHighAccuracy}}2759 * @description {{watchPositionDescription}}2760 * @returns {ObjectType.LONG}2761 */2762 this.cronapi.cordova.geolocation.watchPosition = function(success, error, maximumAge, timeout, enableHighAccuracy){2763 return navigator.geolocation.watchPosition(callbackSuccess, callbackError, { maximumAge: maximumAge, timeout: timeout, enableHighAccuracy: enableHighAccuracy });2764 };2765 /**2766 * @type function2767 * @platform M2768 * @name {{clearWatchPosition}}2769 * @nameTags geolocation|clearWatch2770 * @param {ObjectType.LONG} watchID {{watchID}}2771 * @description {{clearWatchPositionDescription}}2772 * @returns {ObjectType.VOID}2773 */2774 this.cronapi.cordova.geolocation.clearWatchPosition = function(watchID){2775 navigator.geolocation.clearWatch(watchID);2776 };2777 this.cronapi.cordova.camera = {};2778 /**2779 * @type function2780 * @platform M2781 * @name {{getPicture}}2782 * @nameTags geolocation|getPicture2783 * @description {{getPictureDescription}}2784 * @returns {ObjectType.VOID}2785 */2786 this.cronapi.cordova.camera.getPicture = function(/** @type {ObjectType.STATEMENTSENDER} @description {{success}} */ success, /** @type {ObjectType.STATEMENTSENDER} @description {{error}} */ error, /** @type {ObjectType.LONG} @description {{destinationType}} @blockType util_dropdown @keys 0|1|2 @values DATA_URL|FILE_URI|NATIVE_URI */ destinationType, /** @type {ObjectType.LONG} @description {{pictureSourceType}} @blockType util_dropdown @keys 0|1|2 @values PHOTOLIBRARY|CAMERA|SAVEDPHOTOALBUM */ pictureSourceType, /** @type {ObjectType.LONG} @description {{mediaType}} @blockType util_dropdown @keys 0|1|2 @values PICTURE|VIDEO|ALLMEDIA */ mediaType, /** @type {ObjectType.BOOLEAN} @description {{allowEdit}} @blockType util_dropdown @keys false|true @values {{false}}|{{true}} */ allowEdit) {2787 if(mediaType === undefined || mediaType === null) mediaType = 0 ;2788 allowEdit = (allowEdit === true || allowEdit === 'true');2789 navigator.camera.getPicture(success, error, { destinationType: destinationType , sourceType : pictureSourceType , mediaType: mediaType , allowEdit: allowEdit});2790 };2791 /**2792 * @type function2793 * @platform M2794 * @name {{qrCodeScanner}}2795 * @nameTags QRCODE|QR|BAR|Scanner|BARCODE2796 * @param {ObjectType.STRING} format {{formatQRCode}}2797 * @param {ObjectType.STRING} message {{messageQRCode}}2798 * @description {{qrCodeScannerDescription}}2799 * @returns {ObjectType.VOID}2800 */2801 this.cronapi.cordova.camera.qrCodeScanner = function(/** @type {ObjectType.STRING} @description {{formatQRCode}} @blockType util_dropdown @keys QR_CODE|DATA_MATRIX|UPC_A|UPC_E|EAN_8|EAN_13|CODE_39|CODE_128 @values QR_CODE|DATA_MATRIX|UPC_A|UPC_E|EAN_8|EAN_13|CODE_39|CODE_128 */ format,/** @type {ObjectType.STRING} @description {{messageQRCode}} */ message, /** @type {ObjectType.STATEMENTSENDER} @description {{success}} */ success, /** @type {ObjectType.STATEMENTSENDER} @description {{error}} */ error ) {2802 cordova.plugins.barcodeScanner.scan(2803 function (result) {2804 success(result.text);2805 },2806 function (errorMsg) {2807 error(errorMsg);2808 },2809 {2810 preferFrontCamera : false,2811 showFlipCameraButton : true,2812 showTorchButton : true,2813 torchOn: true,2814 saveHistory: true,2815 prompt : message,2816 resultDisplayDuration: 500,2817 formats : format,2818 orientation : "portrait",2819 disableAnimations : true,2820 disableSuccessBeep: false2821 }2822 );2823 };2824 this.cronapi.cordova.file = {};2825 /**2826 * @type function2827 * @platform M2828 * @name {{getDirectory}}2829 * @nameTags file|arquivo|directory|diretorio2830 * @description {{getDirectoryDescription}}2831 * @returns {ObjectType.STRING}2832 */2833 this.cronapi.cordova.file.getDirectory = function(/** @type {ObjectType.LONG} @description {{type}} @blockType util_dropdown @keys 0|1 @values {{INTERNAL}}|{{EXTERNAL}} */ type) {2834 var path;2835 if (type == '0') {2836 path = cordova.file.dataDirectory ;2837 } else {2838 path = cordova.file.externalApplicationStorageDirectory;2839 if (!path) {2840 path = cordova.file.externalDataDirectory;2841 }2842 if (!path) {2843 path = cordova.file.syncedDataDirectory;2844 }2845 }2846 return path;2847 };2848 /**2849 * @type function2850 * @platform M2851 * @name {{removeFile}}2852 * @nameTags file|arquivo|removeFile|remover2853 * @param {ObjectType.STRING} fileName {{fileName}}2854 * @param {ObjectType.STATEMENTSENDER} success {{success}}2855 * @param {ObjectType.STATEMENTSENDER} error {{error}}2856 * @description {{removeFileDescription}}2857 * @returns {ObjectType.VOID}2858 */2859 this.cronapi.cordova.file.removeFile = function(fileName, success, error) {2860 window.resolveLocalFileSystemURL(fileName, function (fileEntry) {2861 fileEntry.remove(function (entry) {2862 if (success)2863 success(entry);2864 }.bind(this),error);2865 }.bind(this),error);2866 };2867 /**2868 * @type function2869 * @platform M2870 * @name {{readFile}}2871 * @nameTags file|arquivo|readFile|lerarquivo2872 * @description {{readFileDescription}}2873 * @returns {ObjectType.VOID}2874 */2875 this.cronapi.cordova.file.readFile = function( /** @type {ObjectType.STRING} @description {{fileName}} */ fileName, /** @type {ObjectType.STATEMENTSENDER} @description {{success}} */ success, /** @type {ObjectType.STATEMENTSENDER} @description {{error}} */ error, /** @type {ObjectType.STRING} @description {{returnType}} @blockType util_dropdown @keys ARRAYBUFFER|TEXT|BINARYSTRING|DATAURL @values {{ARRAYBUFFER}}|{{TEXT}}|{{BINARYSTRING}}|{{DATAURL}} */ returnType) {2876 window.resolveLocalFileSystemURL(fileName, function (fileEntry) {2877 fileEntry.file(function (file) {2878 var reader = new FileReader();2879 reader.onloadend = function (e) {2880 success(this.result);2881 };2882 switch (returnType) {2883 case 'ARRAYBUFFER': {2884 reader.readAsArrayBuffer(file);2885 break;2886 }2887 case 'TEXT': {2888 reader.readAsText(file);2889 break;2890 }2891 case 'BINARYSTRING': {2892 reader.readAsBinaryString(file);2893 break;2894 }2895 case 'DATAURL': {2896 reader.readAsDataURL(file);2897 break;2898 }2899 default: {2900 reader.readAsText(file);2901 }2902 };2903 }.bind(this),error);2904 }.bind(this),error);2905 };2906 /**2907 * @type function2908 * @platform M2909 * @name {{createFile}}2910 * @nameTags file|arquivo|createFile|criararquivo2911 * @param {ObjectType.STRING} dirEntry {{dirEntry}}2912 * @param {ObjectType.STRING} fileName {{fileName}}2913 * @param {ObjectType.STRING} content {{content}}2914 * @param {ObjectType.STATEMENTSENDER} success {{success}}2915 * @param {ObjectType.STATEMENTSENDER} error {{error}}2916 * @description {{createFileDescription}}2917 * @returns {ObjectType.VOID}2918 */2919 this.cronapi.cordova.file.createFile = function(dirEntry, fileName, content, success, error) {2920 var path = (dirEntry || getDirectory(0));2921 window.resolveLocalFileSystemURL(dirEntry, function(directoryEntry) {2922 console.log(dirEntry);2923 directoryEntry.getFile(fileName, {create: true }, function (fileEntry) {2924 fileEntry.createWriter(function(fileWriter) {2925 fileWriter.onwriteend = function (e) {2926 console.log('Write of file "' + fileName + '"" completed.');2927 };2928 fileWriter.onerror = function (e) {2929 console.log('Write failed: ' + e.toString());2930 };2931 var data = new Blob([content], { type: 'text/plain' });2932 fileWriter.write(data);2933 if (success) {2934 setTimeout(function() {2935 success();2936 }.bind(this),500);2937 }2938 }.bind(this), error);2939 }.bind(this), error);2940 }.bind(this), error);2941 };2942 /**2943 * @type function2944 * @platform M2945 * @name {{createDirectory}}2946 * @nameTags file|arquivo|criardiretorio2947 * @param {ObjectType.STRING} dirParent {{dirParent}}2948 * @param {ObjectType.STRING} dirChildrenName {{dirChildrenName}}2949 * @param {ObjectType.STATEMENTSENDER} success {{success}}2950 * @param {ObjectType.STATEMENTSENDER} error {{error}}2951 * @description {{createDirectoryDescription}}2952 * @returns {ObjectType.VOID}2953 */2954 this.cronapi.cordova.file.createDirectory = function(dirParent, dirChildrenName, success, error) {2955 window.resolveLocalFileSystemURL(dirParent, function(directoryEntry) {2956 parentEntry.getDirectory(dirChildrenName, { create: true }, function (childrenEntry) {2957 if (success)2958 success(childrenEntry);2959 }.bind(this),error);2960 }.bind(this), error);2961 };2962 this.cronapi.cordova.storage = {};2963 /**2964 * @type function2965 * @platform M2966 * @name {{setStorageItem}}2967 * @nameTags storage2968 * @param {ObjectType.STRING} key {{key}}2969 * @param {ObjectType.OBJECT} value {{value}}2970 * @description {{setStorageItemDescription}}2971 * @returns {ObjectType.VOID}2972 */2973 this.cronapi.cordova.storage.setStorageItem = function(key, value) {2974 var storage = window.localStorage;2975 if (storage) {2976 storage.setItem(key, value);2977 } else {2978 console.error('Local Storage not Found!');2979 }2980 };2981 /**2982 * @type function2983 * @platform M2984 * @name {{getStorageItem}}2985 * @nameTags storage|getItem2986 * @param {ObjectType.STRING} key {{key}}2987 * @description {{getStorageItemDescription}}2988 * @returns {ObjectType.OBJECT}2989 */2990 this.cronapi.cordova.storage.getStorageItem = function(key) {2991 var storage = window.localStorage;2992 if (storage) {2993 return storage.getItem(key);2994 } else {2995 console.error('Local Storage not Found!');2996 }2997 };2998 /**2999 * @type function3000 * @platform M3001 * @name {{removeStorageItem}}3002 * @nameTags storage|remove3003 * @param {ObjectType.STRING} key {{key}}3004 * @description {{removeStorageItemDescription}}3005 * @returns {ObjectType.VOID}3006 */3007 this.cronapi.cordova.storage.removeStorageItem = function(key) {3008 var storage = window.localStorage;3009 if (storage) {3010 storage.removeItem(key);3011 } else {3012 console.error('Local Storage not Found!');3013 }3014 };3015 this.cronapi.cordova.connection = {};3016 /**3017 * @type function3018 * @platform M3019 * @name {{getConnection}}3020 * @nameTags connection3021 * @description {{getConnectionDescription}}3022 * @returns {ObjectType.BOOLEAN}3023 */3024 this.cronapi.cordova.connection.getConnection = function() {3025 return navigator.connection.type;3026 };3027 /**3028 * @type function3029 * @platform M3030 * @name {{verifyConnection}}3031 * @nameTags connection3032 * @description {{verifyConnectionDescription}}3033 * @returns {ObjectType.BOOLEAN}3034 */3035 this.cronapi.cordova.connection.verifyConnection = function(/** @type {ObjectType.STRING} @description {{type}} @blockType util_dropdown @keys Connection.UNKNOWN|Connection.ETHERNET|Connection.WIFI|Connection.CELL_2G|Connection.CELL_3G|Connection.CELL_4G|Connection.CELL|Connection.NONE @values {{UnknownConnection}}|{{EthernetConnection}}|{{WiFiConnection}}|{{Cell2GConnection}}|{{Cell3GConnection}}|{{Cell4GConnection}}|{{CellGenericConnection}}|{{NoNetworkConnection}} */ type) {3036 return (navigator.connection.type == type);3037 };3038 this.cronapi.cordova.database = {};3039 this.cronapi.cordova.database.nameDefault = "cronappDB";3040 /**3041 * @type function3042 * @platform M3043 * @name {{openDatabase}}3044 * @nameTags openDatabase3045 * @param {ObjectType.STRING} name {{name}}3046 * @description {{openDatabaseDescription}}3047 * @returns {ObjectType.VOID}3048 */3049 this.cronapi.cordova.database.openDatabase = function(dbName) {3050 if (!dbName) {3051 return window.openDatabase(this.cronapi.cordova.database.nameDefault, "1.0",this.cronapi.cordova.database.nameDefault,1000000);3052 }else{3053 return window.openDatabase(dbName, "1.0", dbName, 1000000);3054 }3055 };3056 /**3057 * @type function3058 * @platform M3059 * @name {{executeSql}}3060 * @nameTags executesql3061 * @param {ObjectType.STRING} dbName {{dbName}}3062 * @param {ObjectType.STRING} text {{text}}3063 * @param {ObjectType.OBJECT} array {{arrayParams}}3064 * @param {ObjectType.STATEMENTSENDER} success {{success}}3065 * @param {ObjectType.STATEMENTSENDER} error {{error}}3066 * @description {{executeSqlDescription}}3067 * @returns {ObjectType.VOID}3068 */3069 this.cronapi.cordova.database.executeSql = function(dbName,text, array, success , error){3070 // exist DB3071 var db = this.cronapi.cordova.database.openDatabase(dbName); // create DB3072 // open transaction3073 db.transaction(function(connect){3074 // execute SQL3075 connect.executeSql(text,array, function(a,b){success.call(this,Object.values(b.rows))}.bind(this));3076 }.bind(this), function(e){3077 // error3078 console.log(e);3079 error(e);3080 }.bind(this));3081 };3082 //Private variables and functions3083 this.cronapi.internal.ptDate = function(varray) {3084 var date;3085 var day = varray[1];3086 var month = varray[2];3087 var year = varray[3];3088 var hour = varray[5];3089 var minute = varray[6];3090 var second = varray[7];3091 if (hour)3092 date = new Date(year, month - 1, day, hour, minute, second);3093 else3094 date = new Date(year, month - 1, day, 0, 0, 0);3095 return date;3096 };3097 this.cronapi.internal.enDate = function(varray) {3098 var date;3099 var month = varray[1];3100 var day = varray[2];3101 var year = varray[3];3102 var hour = varray[5];3103 var minute = varray[6];3104 var second = varray[7];3105 if (hour)3106 date = new Date(year, month - 1, day, hour, minute, second);3107 else3108 date = new Date(year, month - 1, day, 0, 0, 0);3109 return date;3110 };3111 this.cronapi.internal.parseBoolean = function(value) {3112 if (!value)3113 return false;3114 if (typeof value == "boolean")3115 return value;3116 value = value.toString().toLowerCase().trim();3117 return value == "1" || value == "true";3118 };3119 this.cronapi.internal.removeAccents = function(value) {3120 var withAccents = 'áàãâäéèêëíìîïóòõôöúùûüçÁÀÃÂÄÉÈÊËÍÌÎÏÓÒÕÖÔÚÙÛÜÇ';3121 var withoutAccents = 'aaaaaeeeeiiiiooooouuuucAAAAAEEEEIIIIOOOOOUUUUC';3122 var newValue = '';3123 for (i = 0; i < value.length; i++) {3124 if (withAccents.search(value.substr(i, 1)) >= 0) {3125 newValue += withoutAccents.substr(withAccents.search(value3126 .substr(i, 1)), 1);3127 } else {3128 newValue += value.substr(i, 1);3129 }3130 }3131 return newValue;3132 };3133 this.cronapi.internal.arrayRemove = function(array, value) {3134 var i = this.cronapi.internal.arrayIndexOf(array, value);3135 if (i != -1) {3136 array.splice(i, 1);3137 }3138 };3139 this.cronapi.internal.arrayIndexOf = function(array, value) {3140 var index = -1;3141 $(array).each(function(idx) {3142 if (value == this) {3143 index = idx;3144 }3145 });3146 return index;3147 };3148 this.cronapi.internal.replaceAll = function(str, value, newValue) {3149 return str.toString().split(value).join(newValue);3150 };3151 this.cronapi.internal.getWindowHeight = function() {3152 $(window).height();3153 };3154 this.cronapi.internal.getWindowWidth = function() {3155 $(window).width();3156 };3157 /**3158 * @type internal3159 */3160 this.cronapi.internal.getAddressWithHostApp = function(address) {3161 var urlWithoutEndSlash = window.hostApp || "";3162 urlWithoutEndSlash = urlWithoutEndSlash.endsWith('/') ? urlWithoutEndSlash.substr(0, urlWithoutEndSlash.length - 1): urlWithoutEndSlash;3163 if (address) {3164 var addressWithoutStartSlash = address.startsWith('/') ? address.substr(1) : address;3165 urlWithoutEndSlash === "" ? urlWithoutEndSlash = addressWithoutStartSlash : urlWithoutEndSlash = urlWithoutEndSlash + '/' + addressWithoutStartSlash;3166 }3167 return urlWithoutEndSlash;3168 };3169 /**3170 *3171 * URL encode / decode3172 * http://www.webtoolkit.info/3173 *3174 **/3175 this.cronapi.internal.Url = {3176 // public method for url encoding3177 encode : function (string) {3178 if (string)3179 return escape(this.cronapi.internal.Url._utf8_encode(string));3180 return '';3181 },3182 // public method for url decoding3183 decode : function (string) {3184 if (string)3185 return this.cronapi.internal.Url._utf8_decode(unescape(string));3186 return '';3187 },3188 // private method for UTF-8 encoding3189 _utf8_encode : function (string) {3190 string = string.replace(/\r\n/g,"\n");3191 var utftext = "";3192 for (var n = 0; n < string.length; n++) {3193 var c = string.charCodeAt(n);3194 if (c < 128) {3195 utftext += String.fromCharCode(c);3196 }3197 else if((c > 127) && (c < 2048)) {3198 utftext += String.fromCharCode((c >> 6) | 192);3199 utftext += String.fromCharCode((c & 63) | 128);3200 }3201 else {3202 utftext += String.fromCharCode((c >> 12) | 224);3203 utftext += String.fromCharCode(((c >> 6) & 63) | 128);3204 utftext += String.fromCharCode((c & 63) | 128);3205 }3206 }3207 return utftext;3208 },3209 // private method for UTF-8 decoding3210 _utf8_decode : function (utftext) {3211 var string = "";3212 var i = 0;3213 var c = c1 = c2 = 0;3214 while ( i < utftext.length ) {3215 c = utftext.charCodeAt(i);3216 if (c < 128) {3217 string += String.fromCharCode(c);3218 i++;3219 }3220 else if((c > 191) && (c < 224)) {3221 c2 = utftext.charCodeAt(i+1);3222 string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));3223 i += 2;3224 }3225 else {3226 c2 = utftext.charCodeAt(i+1);3227 c3 = utftext.charCodeAt(i+2);3228 string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));3229 i += 3;3230 }3231 }3232 return string;3233 }3234 };3235 this.cronapi.internal.stringToJs = function(str) {3236 return (str + '').replace(/[\\"']/g, '\\$&').replace(/\u0000/g, '\\0');3237 };3238 this.cronapi.internal.getErrorMessage = function(data, message) {3239 try {3240 var json = JSON.parse(data);3241 if (json && json.error) {3242 return json.error;3243 }3244 } catch(e) {3245 //Abafa3246 }3247 return message;3248 };3249 /**3250 * @type internal3251 */3252 this.cronapi.util.upload = function(id, description, filter, maxSize, multiple) {3253 this.UploadService.upload({'description': description, 'id' : id, 'filter' : filter, 'maxSize': maxSize, 'multiple': multiple, 'scope': this});3254 };3255 /**3256 * @category CategoryType.CHART3257 * @categoryTags Gráfico|Chart3258 */3259 this.cronapi.chart = {};3260 /**3261 * @type function3262 * @name {{createChartName}}3263 * @nameTags chart|series|serie3264 * @description {{createChartDescription}}3265 * @arbitraryParams true3266 */3267 this.cronapi.chart.createChart = function(/** @type {ObjectType.OBJECT} @description {{createChartId}} @blockType ids_from_screen*/ chartId, /** @type {ObjectType.STRING} @description {{createChartType}} @blockType util_dropdown @keys line|bar|doughnut|pie|polarArea @values line|bar|doughnut|pie|polarArea */ type, /** @type {ObjectType.LIST} @description {{createChartLegends}} */ chartLegends, /** @type {ObjectType.LIST} @description {{createChartOptions}} */ options, /** @type {ObjectType.LIST} @description {{createChartSeries}} */ series) {3268 var CSS_COLOR_NAMES = ["#FF5C00","#0E53A7","#48DD00","#FFD500","#7309AA","#CD0074","#00AF64","#BF8230","#F16D95","#A65000","#A65000","#AF66D5"];3269 var colorIndex = 0;3270 function nextColor(){3271 if(colorIndex < CSS_COLOR_NAMES.length )3272 colorIndex++;3273 else colorIndex = 0;3274 return colorIndex;3275 }3276 function getColumn(position, datasets){3277 var column = [];3278 $.each(datasets , function(index,value){3279 if(value.data[position] != undefined) column.push(value.data[position]);3280 });3281 return column;3282 }3283 function displayLegend(){3284 if(json.data.datasets[0].label ==""){3285 if(json.options.legend == undefined){3286 json.options.legend ={};3287 json.options.legend.display = false;3288 }else3289 json.options.legend.display = false;3290 }3291 }3292 function getDataset(args){3293 var ds = [];3294 for(var size = 4 ; size < args.length ; size++){3295 if(args[size].label){3296 if(args[size].options){3297 if(args[size].data) ds.push(cronapi.chart.createDataset(args[size].label,args[size].data,args[size].options) );3298 else ds.push(cronapi.chart.createDataset(args[size].label,args[size],null) );3299 ds.push(cronapi.chart.createDataset(args[size].label,args[size].data,args[size].options) );3300 }else{3301 ds.push(cronapi.chart.createDataset(args[size].label,args[size].data,null) );3302 }3303 }else3304 {3305 if(args[size].options){3306 if(args[size].data) ds.push(cronapi.chart.createDataset(null,args[size].data, args[size].options) );3307 else ds.push(cronapi.chart.createDataset(null,args[size], args[size].options) );3308 ds.push(cronapi.chart.createDataset(null,args[size].data, args[size].options) );3309 }else{3310 if(args[size].data) ds.push(cronapi.chart.createDataset(null,args[size].data, null) );3311 else ds.push(cronapi.chart.createDataset(null,args[size], null) );3312 }3313 }3314 }3315 return ds;3316 }3317 function beginAtZero(){3318 if(json.options == undefined){ json.options = {};3319 json.options.scales={};3320 json.options.scales.yAxes = [{ticks: {beginAtZero:true}}];3321 }else if(json.options.scales == undefined) { json.options.scales= {}; json.options.scales.yAxes = [{ticks: {beginAtZero:true}}] };3322 }3323 var ctx = document.getElementById(chartId);3324 if (ctx._chart) {3325 ctx._chart.destroy();3326 }3327 ctx.getContext('2d');3328 var json = {};3329 json.type = type;3330 json.data = [];3331 json.options= {};3332 if(Array.isArray(chartLegends)){3333 json.data.labels = chartLegends;3334 }else3335 json.data.labels = JSON.parse(chartLegends);3336 json.data.datasets = [];3337 if(Array.isArray(options)) json.options = options;3338 else if(options != "" && options != null) {3339 try {3340 json.options = JSON.parse(options);3341 }catch(e){3342 json.options={};3343 console.log(e);3344 }3345 }else {3346 json.options= {};3347 }3348 switch(type){3349 case 'line':{3350 json.data.datasets = getDataset(arguments);3351 //Applying configs in Datasets3352 $.each(json.data.datasets, function(index,value){3353 value.fill = false;3354 value.backgroundColor = CSS_COLOR_NAMES[nextColor()];3355 value.borderColor = value.backgroundColor;3356 beginAtZero();3357 displayLegend();3358 });3359 break;3360 }3361 case 'bar':{3362 json.data.datasets = getDataset(arguments);3363 //Applying configs in Datasets3364 $.each(json.data.datasets, function(index,value){3365 value.backgroundColor = CSS_COLOR_NAMES[nextColor()];3366 value.borderColor = value.backgroundColor;3367 });3368 beginAtZero();3369 displayLegend();3370 break;3371 }3372 case 'doughnut':{3373 var ds = getDataset(arguments);3374 $.each(ds, function(index, value){3375 var dtset = {};3376 dtset = ds[index];3377 dtset.backgroundColor = [];3378 dtset.borderColor = [];3379 $.each(dtset.data, function(indexx,valuee){3380 dtset.backgroundColor.push( CSS_COLOR_NAMES[nextColor()] );3381 });3382 dtset.borderColor = dtset.backgroundColor;3383 json.data.datasets.push(dtset);3384 colorIndex = 0;3385 });3386 break;3387 }3388 case 'pie':{3389 var ds = getDataset(arguments);3390 $.each(ds, function(index, value){3391 var dtset = {};3392 dtset = ds[index];3393 dtset.backgroundColor = [];3394 dtset.borderColor = [];3395 $.each(dtset.data, function(indexx,valuee){3396 dtset.backgroundColor.push( CSS_COLOR_NAMES[nextColor()] );3397 });3398 dtset.borderColor = dtset.backgroundColor;3399 json.data.datasets.push(dtset);3400 colorIndex = 0;3401 });3402 break;3403 }3404 case 'polarArea':{3405 var ds = getDataset(arguments);3406 $.each(ds, function(index, value){3407 var dtset = {};3408 dtset = ds[index];3409 dtset.backgroundColor = [];3410 dtset.borderColor = [];3411 $.each(dtset.data, function(indexx,valuee){3412 dtset.backgroundColor.push( CSS_COLOR_NAMES[nextColor()] );3413 });3414 dtset.borderColor = dtset.backgroundColor;3415 json.data.datasets.push(dtset);3416 colorIndex = 0;3417 });3418 break;3419 }3420 default :{3421 }3422 }3423 var chart = new Chart(ctx, json);3424 ctx._chart = chart;3425 }3426 /**3427 * @type function3428 * @name {{createSerieName}}3429 * @nameTags chart|graficos|series|serie|dados3430 * @description {{createSerieDescription}}3431 * @returns {ObjectType.LIST}3432 */3433 this.cronapi.chart.createDataset = function(/** @type {ObjectType.STRING} @description {{createSerieParamName}} */ name, /** @type {ObjectType.LIST} @description {{createSerieParamData}} */ data , /** @type {ObjectType.LIST} @description {{createSerieParamOptions}} */ options ) {3434 var dataset = {};3435 if(name) dataset.label = name; else dataset.label ="";3436 if(Array.isArray(data)) dataset.data = data; else { if(data){ dataset.data = JSON.parse(data);}else dataset.data = [];}3437 if(Array.isArray(options)){ dataset.options = options;} else dataset.options = JSON.parse(options);3438 return dataset;3439 }3440 /**3441 * @category CategoryType.SOCIAL3442 * @categoryTags login|social|network|facebook|github|google|linkedin3443 */3444 this.cronapi.social = {};3445 this.cronapi.social.gup = function(name,url){3446 if (!url) url = location.href;3447 name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");3448 var regexS = "[\\?&]"+name+"=([^&#]*)";3449 var regex = new RegExp( regexS );3450 var results = regex.exec( url );3451 return results == null ? null : results[1];3452 }3453 this.cronapi.social.login = function(login,password,options){3454 var item;3455 this.cronapi.screen.showLoading();3456 if (!this.cronapi.logic.isNullOrEmpty(this.cronapi.screen.getHostapp())) {3457 this.cronapi.util.getURLFromOthers('POST', 'application/x-www-form-urlencoded', String(this.cronapi.screen.getHostapp()) + String('auth'), this.cronapi.object.createObjectFromString(['{ \"username\": \"',login,'\" , \"password\": \"',password,'\" } '].join('')), this.cronapi.object.createObjectFromString(['{ \"X-AUTH-TOKEN\": \"',options,'\" } '].join('')), function(sender_item) {3458 item = sender_item;3459 this.cronapi.screen.hide();3460 this.cronapi.util.setLocalStorage('_u', this.cronapi.object.serializeObject(item));3461 this.cronapi.screen.changeView("#/app/logged/home",[ ]);3462 }.bind(this), function(sender_item) {3463 item = sender_item;3464 if (this.cronapi.object.getProperty(item, 'status') == '403' || this.cronapi.object.getProperty(item, 'status') == '401') {3465 this.cronapi.screen.notify('error',this.cronapi.i18n.translate("LoginViewInvalidpassword",[ ]));3466 } else {3467 this.cronapi.screen.notify('error',this.cronapi.object.getProperty(item, 'responseJSON.message'));3468 }3469 this.cronapi.screen.hide();3470 }.bind(this));3471 } else {3472 this.cronapi.screen.hide();3473 this.cronapi.screen.notify('error','HostApp is Required');3474 }3475 }3476 /**3477 * @type function3478 * @name Login With Facebook3479 * @nameTags login|social|network|facebook|github|google|linkedin3480 * @description {{createSerieDescription}}3481 * @param {ObjectType.STRING} socialNetwork {{socialNetwork}}3482 * @returns {ObjectType.VOID}3483 */3484 this.cronapi.social.sociaLogin = function(/** @type {ObjectType.STRING} @description socialNetwork @blockType util_dropdown @keys facebook|github|google|linkedin @values facebook|github|google|linkedin */ socialNetwork) {3485 var that = this;3486 var u = window.hostApp+"signin/"+socialNetwork+"/";3487 if(cordova.InAppBrowser){3488 var cref = cordova.InAppBrowser.open(u, '_blank', 'location=no');3489 cref.addEventListener('loadstart', function(event) {3490 if (event.url.indexOf("_ctk") > -1) {3491 cref.close();3492 that.cronapi.social.login.bind(that)('#OAUTH#', '#OAUTH#', that.cronapi.social.gup('_ctk',event.url));3493 }3494 });3495 }else{3496 //TODO LOGIN ON WEB3497 }3498 }3499 /**3500 * @type function3501 * @name {{getSelectedRowsGrid}}3502 * @nameTags getSelectedRowsGrid|Obter linhas selecionadas da grade3503 * @description {{functionToGetSelectedRowsGrid}}3504 * @param {ObjectType.STRING} field {{field}}3505 * @returns {ObjectType.OBJECT}3506 */3507 this.cronapi.screen.getSelectedRowsGrid = function(/** @type {ObjectType.STRING} @blockType field_from_screen*/ field) {3508 var result = [];3509 var grid = $('[ng-model="'+ field +'"]').children().data('kendoGrid');3510 if (grid) {3511 var selected = grid.select();3512 selected.each(function() {3513 var dataItem = grid.dataItem(this);3514 result.push(dataItem);3515 });3516 }3517 return result;3518 };...

Full Screen

Full Screen

json-importer.js

Source:json-importer.js Github

copy

Full Screen

1const Test = {};2Test.utils = {};3Test.utils.data = {};4Test.utils.data.activity = {5 "_id": "58ee02de28110d317f1ad09b",6 "objectType": "Activity",7 "surveyForm": {8 "extents": "StudioObject",9 "objectType": "SurveyForm",10 "_id": undefined,11 "sender": "otus@gmail.com",12 "sendingDate": "2017-04-12T02:58:34.240Z",13 "surveyFormType": "FORM_INTERVIEW",14 "surveyTemplate": {15 "extents": "StudioObject",16 "objectType": "Survey",17 "oid": "dXNlclVVSUQ6W3VuZGVmaW5lZF1zdXJ2ZXlVVUlEOls5MWE0ZTdmMC1mODI5LTExZTYtOWE4ZS1mMWE3MWZhZmVhZTddcmVwb3NpdG9yeVVVSUQ6WyBOb3QgZG9uZSB5ZXQgXQ==",18 "identity": {19 "extents": "StudioObject",20 "objectType": "SurveyIdentity",21 "name": "PRESSÃO ARTERIAL",22 "acronym": "PASC",23 "recommendedTo": "",24 "description": "",25 "keywords": []26 },27 "dataSources": [],28 "metainfo": {29 "extents": "StudioObject",30 "objectType": "SurveyMetaInfo",31 "creationDatetime": "2017-02-21T11:33:30.223Z",32 "otusStudioVersion": ""33 },34 "itemContainer": [35 {36 "options": [37 {38 "extents": "StudioObject",39 "objectType": "AnswerOption",40 "dataType": "Integer",41 "label": {42 "ptBR": {43 "extends": "StudioObject",44 "objectType": "Label",45 "oid": "",46 "plainText": "Simn",47 "formattedText": "<div>Sim</div>"48 },49 "enUS": {50 "extends": "StudioObject",51 "objectType": "Label",52 "oid": "",53 "plainText": "",54 "formattedText": ""55 },56 "esES": {57 "extends": "StudioObject",58 "objectType": "Label",59 "oid": "",60 "plainText": "",61 "formattedText": ""62 }63 },64 "value": 1,65 "extractionValue": "1"66 },67 {68 "extents": "StudioObject",69 "objectType": "AnswerOption",70 "dataType": "Integer",71 "label": {72 "ptBR": {73 "extends": "StudioObject",74 "objectType": "Label",75 "oid": "",76 "plainText": "Não",77 "formattedText": "Não"78 },79 "enUS": {80 "extends": "StudioObject",81 "objectType": "Label",82 "oid": "",83 "plainText": "",84 "formattedText": ""85 },86 "esES": {87 "extends": "StudioObject",88 "objectType": "Label",89 "oid": "",90 "plainText": "",91 "formattedText": ""92 }93 },94 "value": 2,95 "extractionValue": "0"96 }97 ],98 "label": {99 "ptBR": {100 "extends": "StudioObject",101 "objectType": "Label",102 "oid": "",103 "plainText": "01. Braço Esquerdo:",104 "formattedText": "<div>01. Braço Esquerdo:</div>"105 },106 "enUS": {107 "extends": "StudioObject",108 "objectType": "Label",109 "oid": "",110 "plainText": "",111 "formattedText": ""112 },113 "esES": {114 "extends": "StudioObject",115 "objectType": "Label",116 "oid": "",117 "plainText": "",118 "formattedText": ""119 }120 },121 "metadata": {122 "extents": "StudioObject",123 "objectType": "MetadataGroup",124 "options": [125 {126 "extends": "StudioObject",127 "objectType": "MetadataAnswer",128 "dataType": "Integer",129 "value": 1,130 "extractionValue": ".Q",131 "label": {132 "ptBR": {133 "extends": "StudioObject",134 "objectType": "Label",135 "oid": "",136 "plainText": "Não quer respondern",137 "formattedText": "<div>Não quer responder</div>"138 },139 "enUS": {140 "extends": "StudioObject",141 "objectType": "Label",142 "oid": "",143 "plainText": "",144 "formattedText": ""145 },146 "esES": {147 "extends": "StudioObject",148 "objectType": "Label",149 "oid": "",150 "plainText": "",151 "formattedText": ""152 }153 }154 },155 {156 "extends": "StudioObject",157 "objectType": "MetadataAnswer",158 "dataType": "Integer",159 "value": 2,160 "extractionValue": ".S",161 "label": {162 "ptBR": {163 "extends": "StudioObject",164 "objectType": "Label",165 "oid": "",166 "plainText": "Não sabe",167 "formattedText": "Não sabe"168 },169 "enUS": {170 "extends": "StudioObject",171 "objectType": "Label",172 "oid": "",173 "plainText": "",174 "formattedText": ""175 },176 "esES": {177 "extends": "StudioObject",178 "objectType": "Label",179 "oid": "",180 "plainText": "",181 "formattedText": ""182 }183 }184 },185 {186 "extends": "StudioObject",187 "objectType": "MetadataAnswer",188 "dataType": "Integer",189 "value": 3,190 "extractionValue": ".A",191 "label": {192 "ptBR": {193 "extends": "StudioObject",194 "objectType": "Label",195 "oid": "",196 "plainText": "Não se aplica",197 "formattedText": "Não se aplica"198 },199 "enUS": {200 "extends": "StudioObject",201 "objectType": "Label",202 "oid": "",203 "plainText": "",204 "formattedText": ""205 },206 "esES": {207 "extends": "StudioObject",208 "objectType": "Label",209 "oid": "",210 "plainText": "",211 "formattedText": ""212 }213 }214 },215 {216 "extends": "StudioObject",217 "objectType": "MetadataAnswer",218 "dataType": "Integer",219 "value": 4,220 "extractionValue": ".F",221 "label": {222 "ptBR": {223 "extends": "StudioObject",224 "objectType": "Label",225 "oid": "",226 "plainText": "Não há dados",227 "formattedText": "Não há dados"228 },229 "enUS": {230 "extends": "StudioObject",231 "objectType": "Label",232 "oid": "",233 "plainText": "",234 "formattedText": ""235 },236 "esES": {237 "extends": "StudioObject",238 "objectType": "Label",239 "oid": "",240 "plainText": "",241 "formattedText": ""242 }243 }244 }245 ]246 },247 "fillingRules": {248 "extends": "StudioObject",249 "objectType": "FillingRules",250 "options": {251 "mandatory": {252 "data": {253 "reference": true,254 "canBeIgnored": false255 },256 "extends": "StudioObject",257 "objectType": "Rule",258 "validatorType": "mandatory"259 }260 }261 },262 "extents": "SurveyItem",263 "objectType": "SingleSelectionQuestion",264 "templateID": "PASC1",265 "customID": "PASC3brs",266 "dataType": "Integer"267 },268 {269 "unit": {270 "ptBR": {271 "extends": "StudioObject",272 "objectType": "Unit",273 "oid": "",274 "plainText": "cm",275 "formattedText": "cm"276 },277 "enUS": {278 "extends": "StudioObject",279 "objectType": "Unit",280 "oid": "",281 "plainText": "",282 "formattedText": ""283 },284 "esES": {285 "extends": "StudioObject",286 "objectType": "Unit",287 "oid": "",288 "plainText": "",289 "formattedText": ""290 }291 },292 "label": {293 "ptBR": {294 "extends": "StudioObject",295 "objectType": "Label",296 "oid": "",297 "plainText": "02. Circunferência do Braço Esquerdo:",298 "formattedText": "<div>02. Circunferência do Braço Esquerdo:</div>"299 },300 "enUS": {301 "extends": "StudioObject",302 "objectType": "Label",303 "oid": "",304 "plainText": "",305 "formattedText": ""306 },307 "esES": {308 "extends": "StudioObject",309 "objectType": "Label",310 "oid": "",311 "plainText": "",312 "formattedText": ""313 }314 },315 "metadata": {316 "extents": "StudioObject",317 "objectType": "MetadataGroup",318 "options": [319 {320 "extends": "StudioObject",321 "objectType": "MetadataAnswer",322 "dataType": "Integer",323 "value": 1,324 "extractionValue": ".Q",325 "label": {326 "ptBR": {327 "extends": "StudioObject",328 "objectType": "Label",329 "oid": "",330 "plainText": "Não quer responder",331 "formattedText": "Não quer responder"332 },333 "enUS": {334 "extends": "StudioObject",335 "objectType": "Label",336 "oid": "",337 "plainText": "",338 "formattedText": ""339 },340 "esES": {341 "extends": "StudioObject",342 "objectType": "Label",343 "oid": "",344 "plainText": "",345 "formattedText": ""346 }347 }348 },349 {350 "extends": "StudioObject",351 "objectType": "MetadataAnswer",352 "dataType": "Integer",353 "value": 2,354 "extractionValue": ".S",355 "label": {356 "ptBR": {357 "extends": "StudioObject",358 "objectType": "Label",359 "oid": "",360 "plainText": "Não sabe",361 "formattedText": "Não sabe"362 },363 "enUS": {364 "extends": "StudioObject",365 "objectType": "Label",366 "oid": "",367 "plainText": "",368 "formattedText": ""369 },370 "esES": {371 "extends": "StudioObject",372 "objectType": "Label",373 "oid": "",374 "plainText": "",375 "formattedText": ""376 }377 }378 },379 {380 "extends": "StudioObject",381 "objectType": "MetadataAnswer",382 "dataType": "Integer",383 "value": 3,384 "extractionValue": ".A",385 "label": {386 "ptBR": {387 "extends": "StudioObject",388 "objectType": "Label",389 "oid": "",390 "plainText": "Não se aplica",391 "formattedText": "Não se aplica"392 },393 "enUS": {394 "extends": "StudioObject",395 "objectType": "Label",396 "oid": "",397 "plainText": "",398 "formattedText": ""399 },400 "esES": {401 "extends": "StudioObject",402 "objectType": "Label",403 "oid": "",404 "plainText": "",405 "formattedText": ""406 }407 }408 },409 {410 "extends": "StudioObject",411 "objectType": "MetadataAnswer",412 "dataType": "Integer",413 "value": 4,414 "extractionValue": ".F",415 "label": {416 "ptBR": {417 "extends": "StudioObject",418 "objectType": "Label",419 "oid": "",420 "plainText": "Não há dados",421 "formattedText": "Não há dados"422 },423 "enUS": {424 "extends": "StudioObject",425 "objectType": "Label",426 "oid": "",427 "plainText": "",428 "formattedText": ""429 },430 "esES": {431 "extends": "StudioObject",432 "objectType": "Label",433 "oid": "",434 "plainText": "",435 "formattedText": ""436 }437 }438 }439 ]440 },441 "fillingRules": {442 "extends": "StudioObject",443 "objectType": "FillingRules",444 "options": {445 "scale": {446 "data": {447 "reference": 1,448 "canBeIgnored": true449 },450 "extends": "StudioObject",451 "objectType": "Rule",452 "validatorType": "scale"453 },454 "upperLimit": {455 "data": {456 "reference": 60,457 "canBeIgnored": true458 },459 "extends": "StudioObject",460 "objectType": "Rule",461 "validatorType": "upperLimit"462 },463 "lowerLimit": {464 "data": {465 "reference": 12,466 "canBeIgnored": true467 },468 "extends": "StudioObject",469 "objectType": "Rule",470 "validatorType": "lowerLimit"471 },472 "mandatory": {473 "data": {474 "reference": true,475 "canBeIgnored": false476 },477 "extends": "StudioObject",478 "objectType": "Rule",479 "validatorType": "mandatory"480 },481 "accept": {482 "data": {483 "reference": true,484 "canBeIgnored": false485 },486 "extends": "StudioObject",487 "objectType": "Rule",488 "validatorType": "accept"489 }490 }491 },492 "extents": "SurveyItem",493 "objectType": "DecimalQuestion",494 "templateID": "PASC2",495 "customID": "PASC1",496 "dataType": "Decimal"497 },498 {499 "options": [500 {501 "extents": "StudioObject",502 "objectType": "AnswerOption",503 "dataType": "Integer",504 "label": {505 "ptBR": {506 "extends": "StudioObject",507 "objectType": "Label",508 "oid": "",509 "plainText": "Omron",510 "formattedText": "Omron"511 },512 "enUS": {513 "extends": "StudioObject",514 "objectType": "Label",515 "oid": "",516 "plainText": "",517 "formattedText": ""518 },519 "esES": {520 "extends": "StudioObject",521 "objectType": "Label",522 "oid": "",523 "plainText": "",524 "formattedText": ""525 }526 },527 "value": 1,528 "extractionValue": "1"529 },530 {531 "extents": "StudioObject",532 "objectType": "AnswerOption",533 "dataType": "Integer",534 "label": {535 "ptBR": {536 "extends": "StudioObject",537 "objectType": "Label",538 "oid": "",539 "plainText": "Tycos",540 "formattedText": "Tycos"541 },542 "enUS": {543 "extends": "StudioObject",544 "objectType": "Label",545 "oid": "",546 "plainText": "",547 "formattedText": ""548 },549 "esES": {550 "extends": "StudioObject",551 "objectType": "Label",552 "oid": "",553 "plainText": "",554 "formattedText": ""555 }556 },557 "value": 2,558 "extractionValue": "2"559 }560 ],561 "label": {562 "ptBR": {563 "extends": "StudioObject",564 "objectType": "Label",565 "oid": "",566 "plainText": "&nbsp;03. Aparelho:",567 "formattedText": "<div>&nbsp;03. Aparelho:</div>"568 },569 "enUS": {570 "extends": "StudioObject",571 "objectType": "Label",572 "oid": "",573 "plainText": "",574 "formattedText": ""575 },576 "esES": {577 "extends": "StudioObject",578 "objectType": "Label",579 "oid": "",580 "plainText": "",581 "formattedText": ""582 }583 },584 "metadata": {585 "extents": "StudioObject",586 "objectType": "MetadataGroup",587 "options": [588 {589 "extends": "StudioObject",590 "objectType": "MetadataAnswer",591 "dataType": "Integer",592 "value": 1,593 "extractionValue": ".Q",594 "label": {595 "ptBR": {596 "extends": "StudioObject",597 "objectType": "Label",598 "oid": "",599 "plainText": "Não quer responder",600 "formattedText": "Não quer responder"601 },602 "enUS": {603 "extends": "StudioObject",604 "objectType": "Label",605 "oid": "",606 "plainText": "",607 "formattedText": ""608 },609 "esES": {610 "extends": "StudioObject",611 "objectType": "Label",612 "oid": "",613 "plainText": "",614 "formattedText": ""615 }616 }617 },618 {619 "extends": "StudioObject",620 "objectType": "MetadataAnswer",621 "dataType": "Integer",622 "value": 2,623 "extractionValue": ".S",624 "label": {625 "ptBR": {626 "extends": "StudioObject",627 "objectType": "Label",628 "oid": "",629 "plainText": "Não sabe",630 "formattedText": "Não sabe"631 },632 "enUS": {633 "extends": "StudioObject",634 "objectType": "Label",635 "oid": "",636 "plainText": "",637 "formattedText": ""638 },639 "esES": {640 "extends": "StudioObject",641 "objectType": "Label",642 "oid": "",643 "plainText": "",644 "formattedText": ""645 }646 }647 },648 {649 "extends": "StudioObject",650 "objectType": "MetadataAnswer",651 "dataType": "Integer",652 "value": 3,653 "extractionValue": ".A",654 "label": {655 "ptBR": {656 "extends": "StudioObject",657 "objectType": "Label",658 "oid": "",659 "plainText": "Não se aplica",660 "formattedText": "Não se aplica"661 },662 "enUS": {663 "extends": "StudioObject",664 "objectType": "Label",665 "oid": "",666 "plainText": "",667 "formattedText": ""668 },669 "esES": {670 "extends": "StudioObject",671 "objectType": "Label",672 "oid": "",673 "plainText": "",674 "formattedText": ""675 }676 }677 },678 {679 "extends": "StudioObject",680 "objectType": "MetadataAnswer",681 "dataType": "Integer",682 "value": 4,683 "extractionValue": ".F",684 "label": {685 "ptBR": {686 "extends": "StudioObject",687 "objectType": "Label",688 "oid": "",689 "plainText": "Não há dados",690 "formattedText": "Não há dados"691 },692 "enUS": {693 "extends": "StudioObject",694 "objectType": "Label",695 "oid": "",696 "plainText": "",697 "formattedText": ""698 },699 "esES": {700 "extends": "StudioObject",701 "objectType": "Label",702 "oid": "",703 "plainText": "",704 "formattedText": ""705 }706 }707 }708 ]709 },710 "fillingRules": {711 "extends": "StudioObject",712 "objectType": "FillingRules",713 "options": {714 "mandatory": {715 "data": {716 "reference": true,717 "canBeIgnored": false718 },719 "extends": "StudioObject",720 "objectType": "Rule",721 "validatorType": "mandatory"722 }723 }724 },725 "extents": "SurveyItem",726 "objectType": "SingleSelectionQuestion",727 "templateID": "PASC3",728 "customID": "PASC3mets",729 "dataType": "Integer"730 },731 {732 "options": [733 {734 "extents": "StudioObject",735 "objectType": "AnswerOption",736 "dataType": "Integer",737 "label": {738 "ptBR": {739 "extends": "StudioObject",740 "objectType": "Label",741 "oid": "",742 "plainText": "Adulto pequeno",743 "formattedText": "Adulto pequeno"744 },745 "enUS": {746 "extends": "StudioObject",747 "objectType": "Label",748 "oid": "",749 "plainText": "",750 "formattedText": ""751 },752 "esES": {753 "extends": "StudioObject",754 "objectType": "Label",755 "oid": "",756 "plainText": "",757 "formattedText": ""758 }759 },760 "value": 1,761 "extractionValue": "1"762 },763 {764 "extents": "StudioObject",765 "objectType": "AnswerOption",766 "dataType": "Integer",767 "label": {768 "ptBR": {769 "extends": "StudioObject",770 "objectType": "Label",771 "oid": "",772 "plainText": "Adulto",773 "formattedText": "Adulto"774 },775 "enUS": {776 "extends": "StudioObject",777 "objectType": "Label",778 "oid": "",779 "plainText": "",780 "formattedText": ""781 },782 "esES": {783 "extends": "StudioObject",784 "objectType": "Label",785 "oid": "",786 "plainText": "",787 "formattedText": ""788 }789 },790 "value": 2,791 "extractionValue": "2"792 },793 {794 "extents": "StudioObject",795 "objectType": "AnswerOption",796 "dataType": "Integer",797 "label": {798 "ptBR": {799 "extends": "StudioObject",800 "objectType": "Label",801 "oid": "",802 "plainText": "Adulto grande",803 "formattedText": "Adulto grande"804 },805 "enUS": {806 "extends": "StudioObject",807 "objectType": "Label",808 "oid": "",809 "plainText": "",810 "formattedText": ""811 },812 "esES": {813 "extends": "StudioObject",814 "objectType": "Label",815 "oid": "",816 "plainText": "",817 "formattedText": ""818 }819 },820 "value": 3,821 "extractionValue": "3"822 },823 {824 "extents": "StudioObject",825 "objectType": "AnswerOption",826 "dataType": "Integer",827 "label": {828 "ptBR": {829 "extends": "StudioObject",830 "objectType": "Label",831 "oid": "",832 "plainText": "Coxa",833 "formattedText": "Coxa"834 },835 "enUS": {836 "extends": "StudioObject",837 "objectType": "Label",838 "oid": "",839 "plainText": "",840 "formattedText": ""841 },842 "esES": {843 "extends": "StudioObject",844 "objectType": "Label",845 "oid": "",846 "plainText": "",847 "formattedText": ""848 }849 },850 "value": 4,851 "extractionValue": "4"852 }853 ],854 "label": {855 "ptBR": {856 "extends": "StudioObject",857 "objectType": "Label",858 "oid": "",859 "plainText": "04. Tamanho do Manguito:",860 "formattedText": "<div>04. Tamanho do Manguito:</div>"861 },862 "enUS": {863 "extends": "StudioObject",864 "objectType": "Label",865 "oid": "",866 "plainText": "",867 "formattedText": ""868 },869 "esES": {870 "extends": "StudioObject",871 "objectType": "Label",872 "oid": "",873 "plainText": "",874 "formattedText": ""875 }876 },877 "metadata": {878 "extents": "StudioObject",879 "objectType": "MetadataGroup",880 "options": [881 {882 "extends": "StudioObject",883 "objectType": "MetadataAnswer",884 "dataType": "Integer",885 "value": 1,886 "extractionValue": ".Q",887 "label": {888 "ptBR": {889 "extends": "StudioObject",890 "objectType": "Label",891 "oid": "",892 "plainText": "Não quer responder",893 "formattedText": "Não quer responder"894 },895 "enUS": {896 "extends": "StudioObject",897 "objectType": "Label",898 "oid": "",899 "plainText": "",900 "formattedText": ""901 },902 "esES": {903 "extends": "StudioObject",904 "objectType": "Label",905 "oid": "",906 "plainText": "",907 "formattedText": ""908 }909 }910 },911 {912 "extends": "StudioObject",913 "objectType": "MetadataAnswer",914 "dataType": "Integer",915 "value": 2,916 "extractionValue": ".S",917 "label": {918 "ptBR": {919 "extends": "StudioObject",920 "objectType": "Label",921 "oid": "",922 "plainText": "Não sabe",923 "formattedText": "Não sabe"924 },925 "enUS": {926 "extends": "StudioObject",927 "objectType": "Label",928 "oid": "",929 "plainText": "",930 "formattedText": ""931 },932 "esES": {933 "extends": "StudioObject",934 "objectType": "Label",935 "oid": "",936 "plainText": "",937 "formattedText": ""938 }939 }940 },941 {942 "extends": "StudioObject",943 "objectType": "MetadataAnswer",944 "dataType": "Integer",945 "value": 3,946 "extractionValue": ".A",947 "label": {948 "ptBR": {949 "extends": "StudioObject",950 "objectType": "Label",951 "oid": "",952 "plainText": "Não se aplica",953 "formattedText": "Não se aplica"954 },955 "enUS": {956 "extends": "StudioObject",957 "objectType": "Label",958 "oid": "",959 "plainText": "",960 "formattedText": ""961 },962 "esES": {963 "extends": "StudioObject",964 "objectType": "Label",965 "oid": "",966 "plainText": "",967 "formattedText": ""968 }969 }970 },971 {972 "extends": "StudioObject",973 "objectType": "MetadataAnswer",974 "dataType": "Integer",975 "value": 4,976 "extractionValue": ".F",977 "label": {978 "ptBR": {979 "extends": "StudioObject",980 "objectType": "Label",981 "oid": "",982 "plainText": "Não há dados",983 "formattedText": "Não há dados"984 },985 "enUS": {986 "extends": "StudioObject",987 "objectType": "Label",988 "oid": "",989 "plainText": "",990 "formattedText": ""991 },992 "esES": {993 "extends": "StudioObject",994 "objectType": "Label",995 "oid": "",996 "plainText": "",997 "formattedText": ""998 }999 }1000 }1001 ]1002 },1003 "fillingRules": {1004 "extends": "StudioObject",1005 "objectType": "FillingRules",1006 "options": {1007 "mandatory": {1008 "data": {1009 "reference": true,1010 "canBeIgnored": false1011 },1012 "extends": "StudioObject",1013 "objectType": "Rule",1014 "validatorType": "mandatory"1015 }1016 }1017 },1018 "extents": "SurveyItem",1019 "objectType": "SingleSelectionQuestion",1020 "templateID": "PASC4",1021 "customID": "PASC1m",1022 "dataType": "Integer"1023 },1024 {1025 "unit": {1026 "ptBR": {1027 "extends": "StudioObject",1028 "objectType": "Unit",1029 "oid": "",1030 "plainText": "mmHg",1031 "formattedText": "mmHg"1032 },1033 "enUS": {1034 "extends": "StudioObject",1035 "objectType": "Unit",1036 "oid": "",1037 "plainText": "",1038 "formattedText": ""1039 },1040 "esES": {1041 "extends": "StudioObject",1042 "objectType": "Unit",1043 "oid": "",1044 "plainText": "",1045 "formattedText": ""1046 }1047 },1048 "label": {1049 "ptBR": {1050 "extends": "StudioObject",1051 "objectType": "Label",1052 "oid": "",1053 "plainText": "Medidas da Pressão Arterial 1. SISTÓLICA",1054 "formattedText": "<b>Medidas da Pressão Arterial</b><div><b>1. SISTÓLICA</b></div>"1055 },1056 "enUS": {1057 "extends": "StudioObject",1058 "objectType": "Label",1059 "oid": "",1060 "plainText": "",1061 "formattedText": ""1062 },1063 "esES": {1064 "extends": "StudioObject",1065 "objectType": "Label",1066 "oid": "",1067 "plainText": "",1068 "formattedText": ""1069 }1070 },1071 "metadata": {1072 "extents": "StudioObject",1073 "objectType": "MetadataGroup",1074 "options": []1075 },1076 "fillingRules": {1077 "extends": "StudioObject",1078 "objectType": "FillingRules",1079 "options": {1080 "upperLimit": {1081 "data": {1082 "reference": 220,1083 "canBeIgnored": true1084 },1085 "extends": "StudioObject",1086 "objectType": "Rule",1087 "validatorType": "upperLimit"1088 },1089 "lowerLimit": {1090 "data": {1091 "reference": 70,1092 "canBeIgnored": true1093 },1094 "extends": "StudioObject",1095 "objectType": "Rule",1096 "validatorType": "lowerLimit"1097 },1098 "mandatory": {1099 "data": {1100 "reference": true,1101 "canBeIgnored": false1102 },1103 "extends": "StudioObject",1104 "objectType": "Rule",1105 "validatorType": "mandatory"1106 },1107 "accept": {1108 "data": {1109 "reference": true,1110 "canBeIgnored": false1111 },1112 "extends": "StudioObject",1113 "objectType": "Rule",1114 "validatorType": "accept"1115 }1116 }1117 },1118 "extents": "SurveyItem",1119 "objectType": "IntegerQuestion",1120 "templateID": "PASC6",1121 "customID": "PASC3a",1122 "dataType": "Integer"1123 },1124 {1125 "unit": {1126 "ptBR": {1127 "extends": "StudioObject",1128 "objectType": "Unit",1129 "oid": "",1130 "plainText": "mmHg",1131 "formattedText": "mmHg"1132 },1133 "enUS": {1134 "extends": "StudioObject",1135 "objectType": "Unit",1136 "oid": "",1137 "plainText": "",1138 "formattedText": ""1139 },1140 "esES": {1141 "extends": "StudioObject",1142 "objectType": "Unit",1143 "oid": "",1144 "plainText": "",1145 "formattedText": ""1146 }1147 },1148 "label": {1149 "ptBR": {1150 "extends": "StudioObject",1151 "objectType": "Label",1152 "oid": "",1153 "plainText": "Medidas da Pressão Arterial 1. DIASTÓLICA",1154 "formattedText": "<div><b style='letter-spacing: 0.14px;'>Medidas da Pressão Arterial</b><b><br></b></div><b>1. DIASTÓLICA</b>"1155 },1156 "enUS": {1157 "extends": "StudioObject",1158 "objectType": "Label",1159 "oid": "",1160 "plainText": "",1161 "formattedText": ""1162 },1163 "esES": {1164 "extends": "StudioObject",1165 "objectType": "Label",1166 "oid": "",1167 "plainText": "",1168 "formattedText": ""1169 }1170 },1171 "metadata": {1172 "extents": "StudioObject",1173 "objectType": "MetadataGroup",1174 "options": []1175 },1176 "fillingRules": {1177 "extends": "StudioObject",1178 "objectType": "FillingRules",1179 "options": {1180 "upperLimit": {1181 "data": {1182 "reference": 140,1183 "canBeIgnored": true1184 },1185 "extends": "StudioObject",1186 "objectType": "Rule",1187 "validatorType": "upperLimit"1188 },1189 "lowerLimit": {1190 "data": {1191 "reference": 50,1192 "canBeIgnored": true1193 },1194 "extends": "StudioObject",1195 "objectType": "Rule",1196 "validatorType": "lowerLimit"1197 },1198 "mandatory": {1199 "data": {1200 "reference": true,1201 "canBeIgnored": false1202 },1203 "extends": "StudioObject",1204 "objectType": "Rule",1205 "validatorType": "mandatory"1206 },1207 "accept": {1208 "data": {1209 "reference": true,1210 "canBeIgnored": false1211 },1212 "extends": "StudioObject",1213 "objectType": "Rule",1214 "validatorType": "accept"1215 }1216 }1217 },1218 "extents": "SurveyItem",1219 "objectType": "IntegerQuestion",1220 "templateID": "PASC7",1221 "customID": "PASC4a",1222 "dataType": "Integer"1223 },1224 {1225 "unit": {1226 "ptBR": {1227 "extends": "StudioObject",1228 "objectType": "Unit",1229 "oid": "",1230 "plainText": "bpm",1231 "formattedText": "bpm"1232 },1233 "enUS": {1234 "extends": "StudioObject",1235 "objectType": "Unit",1236 "oid": "",1237 "plainText": "",1238 "formattedText": ""1239 },1240 "esES": {1241 "extends": "StudioObject",1242 "objectType": "Unit",1243 "oid": "",1244 "plainText": "",1245 "formattedText": ""1246 }1247 },1248 "label": {1249 "ptBR": {1250 "extends": "StudioObject",1251 "objectType": "Label",1252 "oid": "",1253 "plainText": "1. Frequência Cardíaca",1254 "formattedText": "<b>1. Frequência Cardíaca</b>"1255 },1256 "enUS": {1257 "extends": "StudioObject",1258 "objectType": "Label",1259 "oid": "",1260 "plainText": "",1261 "formattedText": ""1262 },1263 "esES": {1264 "extends": "StudioObject",1265 "objectType": "Label",1266 "oid": "",1267 "plainText": "",1268 "formattedText": ""1269 }1270 },1271 "metadata": {1272 "extents": "StudioObject",1273 "objectType": "MetadataGroup",1274 "options": []1275 },1276 "fillingRules": {1277 "extends": "StudioObject",1278 "objectType": "FillingRules",1279 "options": {1280 "upperLimit": {1281 "data": {1282 "reference": 120,1283 "canBeIgnored": true1284 },1285 "extends": "StudioObject",1286 "objectType": "Rule",1287 "validatorType": "upperLimit"1288 },1289 "lowerLimit": {1290 "data": {1291 "reference": 40,1292 "canBeIgnored": true1293 },1294 "extends": "StudioObject",1295 "objectType": "Rule",1296 "validatorType": "lowerLimit"1297 },1298 "mandatory": {1299 "data": {1300 "reference": true,1301 "canBeIgnored": false1302 },1303 "extends": "StudioObject",1304 "objectType": "Rule",1305 "validatorType": "mandatory"1306 },1307 "accept": {1308 "data": {1309 "reference": true,1310 "canBeIgnored": false1311 },1312 "extends": "StudioObject",1313 "objectType": "Rule",1314 "validatorType": "accept"1315 }1316 }1317 },1318 "extents": "SurveyItem",1319 "objectType": "IntegerQuestion",1320 "templateID": "PASC8",1321 "customID": "PASC5a",1322 "dataType": "Integer"1323 },1324 {1325 "unit": {1326 "ptBR": {1327 "extends": "StudioObject",1328 "objectType": "Unit",1329 "oid": "",1330 "plainText": "mmHg",1331 "formattedText": "mmHg"1332 },1333 "enUS": {1334 "extends": "StudioObject",1335 "objectType": "Unit",1336 "oid": "",1337 "plainText": "",1338 "formattedText": ""1339 },1340 "esES": {1341 "extends": "StudioObject",1342 "objectType": "Unit",1343 "oid": "",1344 "plainText": "",1345 "formattedText": ""1346 }1347 },1348 "label": {1349 "ptBR": {1350 "extends": "StudioObject",1351 "objectType": "Label",1352 "oid": "",1353 "plainText": "Medidas da Pressão Arterial 2. SISTÓLICA",1354 "formattedText": "<b>Medidas da Pressão Arterial</b><div><b>2. SISTÓLICA</b></div>"1355 },1356 "enUS": {1357 "extends": "StudioObject",1358 "objectType": "Label",1359 "oid": "",1360 "plainText": "",1361 "formattedText": ""1362 },1363 "esES": {1364 "extends": "StudioObject",1365 "objectType": "Label",1366 "oid": "",1367 "plainText": "",1368 "formattedText": ""1369 }1370 },1371 "metadata": {1372 "extents": "StudioObject",1373 "objectType": "MetadataGroup",1374 "options": []1375 },1376 "fillingRules": {1377 "extends": "StudioObject",1378 "objectType": "FillingRules",1379 "options": {1380 "upperLimit": {1381 "data": {1382 "reference": 220,1383 "canBeIgnored": true1384 },1385 "extends": "StudioObject",1386 "objectType": "Rule",1387 "validatorType": "upperLimit"1388 },1389 "lowerLimit": {1390 "data": {1391 "reference": 70,1392 "canBeIgnored": true1393 },1394 "extends": "StudioObject",1395 "objectType": "Rule",1396 "validatorType": "lowerLimit"1397 },1398 "mandatory": {1399 "data": {1400 "reference": true,1401 "canBeIgnored": false1402 },1403 "extends": "StudioObject",1404 "objectType": "Rule",1405 "validatorType": "mandatory"1406 },1407 "accept": {1408 "data": {1409 "reference": true,1410 "canBeIgnored": false1411 },1412 "extends": "StudioObject",1413 "objectType": "Rule",1414 "validatorType": "accept"1415 }1416 }1417 },1418 "extents": "SurveyItem",1419 "objectType": "IntegerQuestion",1420 "templateID": "PASC9",1421 "customID": "PASC3b",1422 "dataType": "Integer"1423 },1424 {1425 "unit": {1426 "ptBR": {1427 "extends": "StudioObject",1428 "objectType": "Unit",1429 "oid": "",1430 "plainText": "mmHg",1431 "formattedText": "mmHg"1432 },1433 "enUS": {1434 "extends": "StudioObject",1435 "objectType": "Unit",1436 "oid": "",1437 "plainText": "",1438 "formattedText": ""1439 },1440 "esES": {1441 "extends": "StudioObject",1442 "objectType": "Unit",1443 "oid": "",1444 "plainText": "",1445 "formattedText": ""1446 }1447 },1448 "label": {1449 "ptBR": {1450 "extends": "StudioObject",1451 "objectType": "Label",1452 "oid": "",1453 "plainText": "Medidas da Pressão Arterial 2. DIASTÓLICA",1454 "formattedText": "<div><b style='letter-spacing: 0.14px;'>Medidas da Pressão Arterial</b><b><br></b></div><b>2. DIASTÓLICA</b>"1455 },1456 "enUS": {1457 "extends": "StudioObject",1458 "objectType": "Label",1459 "oid": "",1460 "plainText": "",1461 "formattedText": ""1462 },1463 "esES": {1464 "extends": "StudioObject",1465 "objectType": "Label",1466 "oid": "",1467 "plainText": "",1468 "formattedText": ""1469 }1470 },1471 "metadata": {1472 "extents": "StudioObject",1473 "objectType": "MetadataGroup",1474 "options": []1475 },1476 "fillingRules": {1477 "extends": "StudioObject",1478 "objectType": "FillingRules",1479 "options": {1480 "upperLimit": {1481 "data": {1482 "reference": 140,1483 "canBeIgnored": true1484 },1485 "extends": "StudioObject",1486 "objectType": "Rule",1487 "validatorType": "upperLimit"1488 },1489 "lowerLimit": {1490 "data": {1491 "reference": 50,1492 "canBeIgnored": true1493 },1494 "extends": "StudioObject",1495 "objectType": "Rule",1496 "validatorType": "lowerLimit"1497 },1498 "mandatory": {1499 "data": {1500 "reference": true,1501 "canBeIgnored": false1502 },1503 "extends": "StudioObject",1504 "objectType": "Rule",1505 "validatorType": "mandatory"1506 },1507 "accept": {1508 "data": {1509 "reference": true,1510 "canBeIgnored": false1511 },1512 "extends": "StudioObject",1513 "objectType": "Rule",1514 "validatorType": "accept"1515 }1516 }1517 },1518 "extents": "SurveyItem",1519 "objectType": "IntegerQuestion",1520 "templateID": "PASC10",1521 "customID": "PASC4b",1522 "dataType": "Integer"1523 },1524 {1525 "unit": {1526 "ptBR": {1527 "extends": "StudioObject",1528 "objectType": "Unit",1529 "oid": "",1530 "plainText": "bpm",1531 "formattedText": "bpm"1532 },1533 "enUS": {1534 "extends": "StudioObject",1535 "objectType": "Unit",1536 "oid": "",1537 "plainText": "",1538 "formattedText": ""1539 },1540 "esES": {1541 "extends": "StudioObject",1542 "objectType": "Unit",1543 "oid": "",1544 "plainText": "",1545 "formattedText": ""1546 }1547 },1548 "label": {1549 "ptBR": {1550 "extends": "StudioObject",1551 "objectType": "Label",1552 "oid": "",1553 "plainText": "2. Frequência Cardíaca",1554 "formattedText": "<b>2. Frequência Cardíaca</b>"1555 },1556 "enUS": {1557 "extends": "StudioObject",1558 "objectType": "Label",1559 "oid": "",1560 "plainText": "",1561 "formattedText": ""1562 },1563 "esES": {1564 "extends": "StudioObject",1565 "objectType": "Label",1566 "oid": "",1567 "plainText": "",1568 "formattedText": ""1569 }1570 },1571 "metadata": {1572 "extents": "StudioObject",1573 "objectType": "MetadataGroup",1574 "options": []1575 },1576 "fillingRules": {1577 "extends": "StudioObject",1578 "objectType": "FillingRules",1579 "options": {1580 "upperLimit": {1581 "data": {1582 "reference": 120,1583 "canBeIgnored": true1584 },1585 "extends": "StudioObject",1586 "objectType": "Rule",1587 "validatorType": "upperLimit"1588 },1589 "lowerLimit": {1590 "data": {1591 "reference": 40,1592 "canBeIgnored": true1593 },1594 "extends": "StudioObject",1595 "objectType": "Rule",1596 "validatorType": "lowerLimit"1597 },1598 "mandatory": {1599 "data": {1600 "reference": true,1601 "canBeIgnored": false1602 },1603 "extends": "StudioObject",1604 "objectType": "Rule",1605 "validatorType": "mandatory"1606 },1607 "accept": {1608 "data": {1609 "reference": true,1610 "canBeIgnored": false1611 },1612 "extends": "StudioObject",1613 "objectType": "Rule",1614 "validatorType": "accept"1615 }1616 }1617 },1618 "extents": "SurveyItem",1619 "objectType": "IntegerQuestion",1620 "templateID": "PASC11",1621 "customID": "PASC5b",1622 "dataType": "Integer"1623 },1624 {1625 "unit": {1626 "ptBR": {1627 "extends": "StudioObject",1628 "objectType": "Unit",1629 "oid": "",1630 "plainText": "mmHg",1631 "formattedText": "mmHg"1632 },1633 "enUS": {1634 "extends": "StudioObject",1635 "objectType": "Unit",1636 "oid": "",1637 "plainText": "",1638 "formattedText": ""1639 },1640 "esES": {1641 "extends": "StudioObject",1642 "objectType": "Unit",1643 "oid": "",1644 "plainText": "",1645 "formattedText": ""1646 }1647 },1648 "label": {1649 "ptBR": {1650 "extends": "StudioObject",1651 "objectType": "Label",1652 "oid": "",1653 "plainText": "Medidas da Pressão Arterial 3. SISTÓLICA",1654 "formattedText": "<b>Medidas da Pressão Arterial</b><div><b>3. SISTÓLICA</b></div>"1655 },1656 "enUS": {1657 "extends": "StudioObject",1658 "objectType": "Label",1659 "oid": "",1660 "plainText": "",1661 "formattedText": ""1662 },1663 "esES": {1664 "extends": "StudioObject",1665 "objectType": "Label",1666 "oid": "",1667 "plainText": "",1668 "formattedText": ""1669 }1670 },1671 "metadata": {1672 "extents": "StudioObject",1673 "objectType": "MetadataGroup",1674 "options": []1675 },1676 "fillingRules": {1677 "extends": "StudioObject",1678 "objectType": "FillingRules",1679 "options": {1680 "upperLimit": {1681 "data": {1682 "reference": 220,1683 "canBeIgnored": true1684 },1685 "extends": "StudioObject",1686 "objectType": "Rule",1687 "validatorType": "upperLimit"1688 },1689 "lowerLimit": {1690 "data": {1691 "reference": 70,1692 "canBeIgnored": true1693 },1694 "extends": "StudioObject",1695 "objectType": "Rule",1696 "validatorType": "lowerLimit"1697 },1698 "mandatory": {1699 "data": {1700 "reference": true,1701 "canBeIgnored": false1702 },1703 "extends": "StudioObject",1704 "objectType": "Rule",1705 "validatorType": "mandatory"1706 },1707 "accept": {1708 "data": {1709 "reference": true,1710 "canBeIgnored": false1711 },1712 "extends": "StudioObject",1713 "objectType": "Rule",1714 "validatorType": "accept"1715 }1716 }1717 },1718 "extents": "SurveyItem",1719 "objectType": "IntegerQuestion",1720 "templateID": "PASC12",1721 "customID": "PASC3c",1722 "dataType": "Integer"1723 },1724 {1725 "unit": {1726 "ptBR": {1727 "extends": "StudioObject",1728 "objectType": "Unit",1729 "oid": "",1730 "plainText": "mmHg",1731 "formattedText": "mmHg"1732 },1733 "enUS": {1734 "extends": "StudioObject",1735 "objectType": "Unit",1736 "oid": "",1737 "plainText": "",1738 "formattedText": ""1739 },1740 "esES": {1741 "extends": "StudioObject",1742 "objectType": "Unit",1743 "oid": "",1744 "plainText": "",1745 "formattedText": ""1746 }1747 },1748 "label": {1749 "ptBR": {1750 "extends": "StudioObject",1751 "objectType": "Label",1752 "oid": "",1753 "plainText": "Medidas da Pressão Arterial 3. DIASTÓLICA",1754 "formattedText": "<div><b style='letter-spacing: 0.14px;'>Medidas da Pressão Arterial</b><b><br></b></div><b>3. DIASTÓLICA</b>"1755 },1756 "enUS": {1757 "extends": "StudioObject",1758 "objectType": "Label",1759 "oid": "",1760 "plainText": "",1761 "formattedText": ""1762 },1763 "esES": {1764 "extends": "StudioObject",1765 "objectType": "Label",1766 "oid": "",1767 "plainText": "",1768 "formattedText": ""1769 }1770 },1771 "metadata": {1772 "extents": "StudioObject",1773 "objectType": "MetadataGroup",1774 "options": []1775 },1776 "fillingRules": {1777 "extends": "StudioObject",1778 "objectType": "FillingRules",1779 "options": {1780 "upperLimit": {1781 "data": {1782 "reference": 140,1783 "canBeIgnored": true1784 },1785 "extends": "StudioObject",1786 "objectType": "Rule",1787 "validatorType": "upperLimit"1788 },1789 "lowerLimit": {1790 "data": {1791 "reference": 50,1792 "canBeIgnored": true1793 },1794 "extends": "StudioObject",1795 "objectType": "Rule",1796 "validatorType": "lowerLimit"1797 },1798 "mandatory": {1799 "data": {1800 "reference": true,1801 "canBeIgnored": false1802 },1803 "extends": "StudioObject",1804 "objectType": "Rule",1805 "validatorType": "mandatory"1806 },1807 "accept": {1808 "data": {1809 "reference": true,1810 "canBeIgnored": false1811 },1812 "extends": "StudioObject",1813 "objectType": "Rule",1814 "validatorType": "accept"1815 }1816 }1817 },1818 "extents": "SurveyItem",1819 "objectType": "IntegerQuestion",1820 "templateID": "PASC13",1821 "customID": "PASC4c",1822 "dataType": "Integer"1823 },1824 {1825 "unit": {1826 "ptBR": {1827 "extends": "StudioObject",1828 "objectType": "Unit",1829 "oid": "",1830 "plainText": "bpm",1831 "formattedText": "bpm"1832 },1833 "enUS": {1834 "extends": "StudioObject",1835 "objectType": "Unit",1836 "oid": "",1837 "plainText": "",1838 "formattedText": ""1839 },1840 "esES": {1841 "extends": "StudioObject",1842 "objectType": "Unit",1843 "oid": "",1844 "plainText": "",1845 "formattedText": ""1846 }1847 },1848 "label": {1849 "ptBR": {1850 "extends": "StudioObject",1851 "objectType": "Label",1852 "oid": "",1853 "plainText": "3. Frequência Cardíaca",1854 "formattedText": "<b>3. Frequência Cardíaca</b>"1855 },1856 "enUS": {1857 "extends": "StudioObject",1858 "objectType": "Label",1859 "oid": "",1860 "plainText": "",1861 "formattedText": ""1862 },1863 "esES": {1864 "extends": "StudioObject",1865 "objectType": "Label",1866 "oid": "",1867 "plainText": "",1868 "formattedText": ""1869 }1870 },1871 "metadata": {1872 "extents": "StudioObject",1873 "objectType": "MetadataGroup",1874 "options": []1875 },1876 "fillingRules": {1877 "extends": "StudioObject",1878 "objectType": "FillingRules",1879 "options": {1880 "upperLimit": {1881 "data": {1882 "reference": 120,1883 "canBeIgnored": true1884 },1885 "extends": "StudioObject",1886 "objectType": "Rule",1887 "validatorType": "upperLimit"1888 },1889 "lowerLimit": {1890 "data": {1891 "reference": 40,1892 "canBeIgnored": true1893 },1894 "extends": "StudioObject",1895 "objectType": "Rule",1896 "validatorType": "lowerLimit"1897 },1898 "mandatory": {1899 "data": {1900 "reference": true,1901 "canBeIgnored": false1902 },1903 "extends": "StudioObject",1904 "objectType": "Rule",1905 "validatorType": "mandatory"1906 },1907 "accept": {1908 "data": {1909 "reference": true,1910 "canBeIgnored": false1911 },1912 "extends": "StudioObject",1913 "objectType": "Rule",1914 "validatorType": "accept"1915 }1916 }1917 },1918 "extents": "SurveyItem",1919 "objectType": "IntegerQuestion",1920 "templateID": "PASC14",1921 "customID": "PASC5c",1922 "dataType": "Integer"1923 },1924 {1925 "options": [1926 {1927 "extents": "StudioObject",1928 "objectType": "AnswerOption",1929 "dataType": "Integer",1930 "label": {1931 "ptBR": {1932 "extends": "StudioObject",1933 "objectType": "Label",1934 "oid": "",1935 "plainText": "Sim",1936 "formattedText": "Sim"1937 },1938 "enUS": {1939 "extends": "StudioObject",1940 "objectType": "Label",1941 "oid": "",1942 "plainText": "",1943 "formattedText": ""1944 },1945 "esES": {1946 "extends": "StudioObject",1947 "objectType": "Label",1948 "oid": "",1949 "plainText": "",1950 "formattedText": ""1951 }1952 },1953 "value": 1,1954 "extractionValue": "1"1955 },1956 {1957 "extents": "StudioObject",1958 "objectType": "AnswerOption",1959 "dataType": "Integer",1960 "label": {1961 "ptBR": {1962 "extends": "StudioObject",1963 "objectType": "Label",1964 "oid": "",1965 "plainText": "Não",1966 "formattedText": "Não"1967 },1968 "enUS": {1969 "extends": "StudioObject",1970 "objectType": "Label",1971 "oid": "",1972 "plainText": "",1973 "formattedText": ""1974 },1975 "esES": {1976 "extends": "StudioObject",1977 "objectType": "Label",1978 "oid": "",1979 "plainText": "",1980 "formattedText": ""1981 }1982 },1983 "value": 2,1984 "extractionValue": "0"1985 }1986 ],1987 "label": {1988 "ptBR": {1989 "extends": "StudioObject",1990 "objectType": "Label",1991 "oid": "",1992 "plainText": "Alteração do Protocolo:",1993 "formattedText": "Alteração do Protocolo:"1994 },1995 "enUS": {1996 "extends": "StudioObject",1997 "objectType": "Label",1998 "oid": "",1999 "plainText": "",2000 "formattedText": ""2001 },2002 "esES": {2003 "extends": "StudioObject",2004 "objectType": "Label",2005 "oid": "",2006 "plainText": "",2007 "formattedText": ""2008 }2009 },2010 "metadata": {2011 "extents": "StudioObject",2012 "objectType": "MetadataGroup",2013 "options": [2014 {2015 "extends": "StudioObject",2016 "objectType": "MetadataAnswer",2017 "dataType": "Integer",2018 "value": 1,2019 "extractionValue": ".Q",2020 "label": {2021 "ptBR": {2022 "extends": "StudioObject",2023 "objectType": "Label",2024 "oid": "",2025 "plainText": "Não quer responder",2026 "formattedText": "Não quer responder"2027 },2028 "enUS": {2029 "extends": "StudioObject",2030 "objectType": "Label",2031 "oid": "",2032 "plainText": "",2033 "formattedText": ""2034 },2035 "esES": {2036 "extends": "StudioObject",2037 "objectType": "Label",2038 "oid": "",2039 "plainText": "",2040 "formattedText": ""2041 }2042 }2043 },2044 {2045 "extends": "StudioObject",2046 "objectType": "MetadataAnswer",2047 "dataType": "Integer",2048 "value": 2,2049 "extractionValue": ".S",2050 "label": {2051 "ptBR": {2052 "extends": "StudioObject",2053 "objectType": "Label",2054 "oid": "",2055 "plainText": "Não sabe",2056 "formattedText": "Não sabe"2057 },2058 "enUS": {2059 "extends": "StudioObject",2060 "objectType": "Label",2061 "oid": "",2062 "plainText": "",2063 "formattedText": ""2064 },2065 "esES": {2066 "extends": "StudioObject",2067 "objectType": "Label",2068 "oid": "",2069 "plainText": "",2070 "formattedText": ""2071 }2072 }2073 },2074 {2075 "extends": "StudioObject",2076 "objectType": "MetadataAnswer",2077 "dataType": "Integer",2078 "value": 3,2079 "extractionValue": ".A",2080 "label": {2081 "ptBR": {2082 "extends": "StudioObject",2083 "objectType": "Label",2084 "oid": "",2085 "plainText": "Não se aplica",2086 "formattedText": "Não se aplica"2087 },2088 "enUS": {2089 "extends": "StudioObject",2090 "objectType": "Label",2091 "oid": "",2092 "plainText": "",2093 "formattedText": ""2094 },2095 "esES": {2096 "extends": "StudioObject",2097 "objectType": "Label",2098 "oid": "",2099 "plainText": "",2100 "formattedText": ""2101 }2102 }2103 },2104 {2105 "extends": "StudioObject",2106 "objectType": "MetadataAnswer",2107 "dataType": "Integer",2108 "value": 4,2109 "extractionValue": ".F",2110 "label": {2111 "ptBR": {2112 "extends": "StudioObject",2113 "objectType": "Label",2114 "oid": "",2115 "plainText": "Não há dados",2116 "formattedText": "Não há dados"2117 },2118 "enUS": {2119 "extends": "StudioObject",2120 "objectType": "Label",2121 "oid": "",2122 "plainText": "",2123 "formattedText": ""2124 },2125 "esES": {2126 "extends": "StudioObject",2127 "objectType": "Label",2128 "oid": "",2129 "plainText": "",2130 "formattedText": ""2131 }2132 }2133 }2134 ]2135 },2136 "fillingRules": {2137 "extends": "StudioObject",2138 "objectType": "FillingRules",2139 "options": {2140 "mandatory": {2141 "data": {2142 "reference": true,2143 "canBeIgnored": false2144 },2145 "extends": "StudioObject",2146 "objectType": "Rule",2147 "validatorType": "mandatory"2148 }2149 }2150 },2151 "extents": "SurveyItem",2152 "objectType": "SingleSelectionQuestion",2153 "templateID": "PASC15",2154 "customID": "PASCalt",2155 "dataType": "Integer"2156 },2157 {2158 "options": [2159 {2160 "extents": "StudioObject",2161 "objectType": "CheckboxAnswerOption",2162 "optionID": "PASC16a",2163 "customOptionID": "PASCalt1",2164 "dataType": "Boolean",2165 "label": {2166 "ptBR": {2167 "extends": "StudioObject",2168 "objectType": "Label",2169 "oid": "",2170 "plainText": "Medida realizada fora do jejum (após dextrosol e/ou lanche)",2171 "formattedText": "Medida realizada fora do jejum (após dextrosol e/ou lanche)"2172 },2173 "enUS": {2174 "extends": "StudioObject",2175 "objectType": "Label",2176 "oid": "",2177 "plainText": "",2178 "formattedText": ""2179 },2180 "esES": {2181 "extends": "StudioObject",2182 "objectType": "Label",2183 "oid": "",2184 "plainText": "",2185 "formattedText": ""2186 }2187 }2188 },2189 {2190 "extents": "StudioObject",2191 "objectType": "CheckboxAnswerOption",2192 "optionID": "PASC16b",2193 "customOptionID": "PASCalt2",2194 "dataType": "Boolean",2195 "label": {2196 "ptBR": {2197 "extends": "StudioObject",2198 "objectType": "Label",2199 "oid": "",2200 "plainText": "Braço muito curto, exigindo troca de manguito (exemplo: Coxa por Adulto grande)n",2201 "formattedText": "<div>Braço muito curto, exigindo troca de manguito (exemplo: Coxa por Adulto&nbsp;<span style='letter-spacing: 0.01em;'>grande)</span></div>"2202 },2203 "enUS": {2204 "extends": "StudioObject",2205 "objectType": "Label",2206 "oid": "",2207 "plainText": "",2208 "formattedText": ""2209 },2210 "esES": {2211 "extends": "StudioObject",2212 "objectType": "Label",2213 "oid": "",2214 "plainText": "",2215 "formattedText": ""2216 }2217 }2218 },2219 {2220 "extents": "StudioObject",2221 "objectType": "CheckboxAnswerOption",2222 "optionID": "PASC16c",2223 "customOptionID": "PASCalt3",2224 "dataType": "Boolean",2225 "label": {2226 "ptBR": {2227 "extends": "StudioObject",2228 "objectType": "Label",2229 "oid": "",2230 "plainText": "Não foi possível fazer todas as medidas com intervalo de dois minutos",2231 "formattedText": "Não foi possível fazer todas as medidas com intervalo de dois minutos"2232 },2233 "enUS": {2234 "extends": "StudioObject",2235 "objectType": "Label",2236 "oid": "",2237 "plainText": "",2238 "formattedText": ""2239 },2240 "esES": {2241 "extends": "StudioObject",2242 "objectType": "Label",2243 "oid": "",2244 "plainText": "",2245 "formattedText": ""2246 }2247 }2248 },2249 {2250 "extents": "StudioObject",2251 "objectType": "CheckboxAnswerOption",2252 "optionID": "PASC16d",2253 "customOptionID": "PASCalt4",2254 "dataType": "Boolean",2255 "label": {2256 "ptBR": {2257 "extends": "StudioObject",2258 "objectType": "Label",2259 "oid": "",2260 "plainText": "Exigiu mais de três leituras por erros utilizando o OMRON",2261 "formattedText": "Exigiu mais de três leituras por erros utilizando o OMRON"2262 },2263 "enUS": {2264 "extends": "StudioObject",2265 "objectType": "Label",2266 "oid": "",2267 "plainText": "",2268 "formattedText": ""2269 },2270 "esES": {2271 "extends": "StudioObject",2272 "objectType": "Label",2273 "oid": "",2274 "plainText": "",2275 "formattedText": ""2276 }2277 }2278 },2279 {2280 "extents": "StudioObject",2281 "objectType": "CheckboxAnswerOption",2282 "optionID": "PASC16e",2283 "customOptionID": "PASCalt5",2284 "dataType": "Boolean",2285 "label": {2286 "ptBR": {2287 "extends": "StudioObject",2288 "objectType": "Label",2289 "oid": "",2290 "plainText": "Participante se movimentou durante a aferição",2291 "formattedText": "Participante se movimentou durante a aferição"2292 },2293 "enUS": {2294 "extends": "StudioObject",2295 "objectType": "Label",2296 "oid": "",2297 "plainText": "",2298 "formattedText": ""2299 },2300 "esES": {2301 "extends": "StudioObject",2302 "objectType": "Label",2303 "oid": "",2304 "plainText": "",2305 "formattedText": ""2306 }2307 }2308 },2309 {2310 "extents": "StudioObject",2311 "objectType": "CheckboxAnswerOption",2312 "optionID": "PASC16f",2313 "customOptionID": "PASCalt6",2314 "dataType": "Boolean",2315 "label": {2316 "ptBR": {2317 "extends": "StudioObject",2318 "objectType": "Label",2319 "oid": "",2320 "plainText": "Modificação da técnica por problemas anatômicos",2321 "formattedText": "Modificação da técnica por problemas anatômicos"2322 },2323 "enUS": {2324 "extends": "StudioObject",2325 "objectType": "Label",2326 "oid": "",2327 "plainText": "",2328 "formattedText": ""2329 },2330 "esES": {2331 "extends": "StudioObject",2332 "objectType": "Label",2333 "oid": "",2334 "plainText": "",2335 "formattedText": ""2336 }2337 }2338 },2339 {2340 "extents": "StudioObject",2341 "objectType": "CheckboxAnswerOption",2342 "optionID": "PASC16g",2343 "customOptionID": "PASCalt7",2344 "dataType": "Boolean",2345 "label": {2346 "ptBR": {2347 "extends": "StudioObject",2348 "objectType": "Label",2349 "oid": "",2350 "plainText": "Outra",2351 "formattedText": "Outra"2352 },2353 "enUS": {2354 "extends": "StudioObject",2355 "objectType": "Label",2356 "oid": "",2357 "plainText": "",2358 "formattedText": ""2359 },2360 "esES": {2361 "extends": "StudioObject",2362 "objectType": "Label",2363 "oid": "",2364 "plainText": "",2365 "formattedText": ""2366 }2367 }2368 }2369 ],2370 "label": {2371 "ptBR": {2372 "extends": "StudioObject",2373 "objectType": "Label",2374 "oid": "",2375 "plainText": "Alteração do Protocolo - Qual: ",2376 "formattedText": "<div><span style='letter-spacing: 0.01em;'>Alteração do Protocolo - Qual:</span><br></div>"2377 },2378 "enUS": {2379 "extends": "StudioObject",2380 "objectType": "Label",2381 "oid": "",2382 "plainText": "",2383 "formattedText": ""2384 },2385 "esES": {2386 "extends": "StudioObject",2387 "objectType": "Label",2388 "oid": "",2389 "plainText": "",2390 "formattedText": ""2391 }2392 },2393 "metadata": {2394 "extents": "StudioObject",2395 "objectType": "MetadataGroup",2396 "options": []2397 },2398 "fillingRules": {2399 "extends": "StudioObject",2400 "objectType": "FillingRules",2401 "options": {2402 "mandatory": {2403 "data": {2404 "reference": true,2405 "canBeIgnored": false2406 },2407 "extends": "StudioObject",2408 "objectType": "Rule",2409 "validatorType": "mandatory"2410 }2411 }2412 },2413 "extents": "SurveyItem",2414 "objectType": "CheckboxQuestion",2415 "templateID": "PASC16",2416 "customID": "PASCaltq1",2417 "dataType": "Array"2418 },2419 {2420 "label": {2421 "ptBR": {2422 "extends": "StudioObject",2423 "objectType": "Label",2424 "oid": "",2425 "plainText": "Outra (especifique):",2426 "formattedText": "<div>Outra (especifique):</div>"2427 },2428 "enUS": {2429 "extends": "StudioObject",2430 "objectType": "Label",2431 "oid": "",2432 "plainText": "",2433 "formattedText": ""2434 },2435 "esES": {2436 "extends": "StudioObject",2437 "objectType": "Label",2438 "oid": "",2439 "plainText": "",2440 "formattedText": ""2441 }2442 },2443 "metadata": {2444 "extents": "StudioObject",2445 "objectType": "MetadataGroup",2446 "options": [2447 {2448 "extends": "StudioObject",2449 "objectType": "MetadataAnswer",2450 "dataType": "Integer",2451 "value": 1,2452 "extractionValue": ".Q",2453 "label": {2454 "ptBR": {2455 "extends": "StudioObject",2456 "objectType": "Label",2457 "oid": "",2458 "plainText": "Não quer responder",2459 "formattedText": "Não quer responder"2460 },2461 "enUS": {2462 "extends": "StudioObject",2463 "objectType": "Label",2464 "oid": "",2465 "plainText": "",2466 "formattedText": ""2467 },2468 "esES": {2469 "extends": "StudioObject",2470 "objectType": "Label",2471 "oid": "",2472 "plainText": "",2473 "formattedText": ""2474 }2475 }2476 },2477 {2478 "extends": "StudioObject",2479 "objectType": "MetadataAnswer",2480 "dataType": "Integer",2481 "value": 2,2482 "extractionValue": ".S",2483 "label": {2484 "ptBR": {2485 "extends": "StudioObject",2486 "objectType": "Label",2487 "oid": "",2488 "plainText": "Não sabe",2489 "formattedText": "Não sabe"2490 },2491 "enUS": {2492 "extends": "StudioObject",2493 "objectType": "Label",2494 "oid": "",2495 "plainText": "",2496 "formattedText": ""2497 },2498 "esES": {2499 "extends": "StudioObject",2500 "objectType": "Label",2501 "oid": "",2502 "plainText": "",2503 "formattedText": ""2504 }2505 }2506 },2507 {2508 "extends": "StudioObject",2509 "objectType": "MetadataAnswer",2510 "dataType": "Integer",2511 "value": 3,2512 "extractionValue": ".A",2513 "label": {2514 "ptBR": {2515 "extends": "StudioObject",2516 "objectType": "Label",2517 "oid": "",2518 "plainText": "Não se aplica",2519 "formattedText": "Não se aplica"2520 },2521 "enUS": {2522 "extends": "StudioObject",2523 "objectType": "Label",2524 "oid": "",2525 "plainText": "",2526 "formattedText": ""2527 },2528 "esES": {2529 "extends": "StudioObject",2530 "objectType": "Label",2531 "oid": "",2532 "plainText": "",2533 "formattedText": ""2534 }2535 }2536 },2537 {2538 "extends": "StudioObject",2539 "objectType": "MetadataAnswer",2540 "dataType": "Integer",2541 "value": 4,2542 "extractionValue": ".F",2543 "label": {2544 "ptBR": {2545 "extends": "StudioObject",2546 "objectType": "Label",2547 "oid": "",2548 "plainText": "Não há dados",2549 "formattedText": "Não há dados"2550 },2551 "enUS": {2552 "extends": "StudioObject",2553 "objectType": "Label",2554 "oid": "",2555 "plainText": "",2556 "formattedText": ""2557 },2558 "esES": {2559 "extends": "StudioObject",2560 "objectType": "Label",2561 "oid": "",2562 "plainText": "",2563 "formattedText": ""2564 }2565 }2566 }2567 ]2568 },2569 "fillingRules": {2570 "extends": "StudioObject",2571 "objectType": "FillingRules",2572 "options": {2573 "minLength": {2574 "data": {2575 "reference": 1,2576 "canBeIgnored": true2577 },2578 "extends": "StudioObject",2579 "objectType": "Rule",2580 "validatorType": "minLength"2581 },2582 "mandatory": {2583 "data": {2584 "reference": true,2585 "canBeIgnored": false2586 },2587 "extends": "StudioObject",2588 "objectType": "Rule",2589 "validatorType": "mandatory"2590 },2591 "maxLength": {2592 "data": {2593 "reference": 300,2594 "canBeIgnored": true2595 },2596 "extends": "StudioObject",2597 "objectType": "Rule",2598 "validatorType": "maxLength"2599 }2600 }2601 },2602 "extents": "SurveyItem",2603 "objectType": "TextQuestion",2604 "templateID": "PASC17",2605 "customID": "PASCaltqou",2606 "dataType": "String"2607 },2608 {2609 "value": {2610 "ptBR": {2611 "extends": "StudioObject",2612 "objectType": "Label",2613 "oid": "",2614 "plainText": "Obrigado(a).n",2615 "formattedText": "<i>Obrigado(a).</i><br>"2616 },2617 "enUS": {2618 "extends": "StudioObject",2619 "objectType": "Label",2620 "oid": "",2621 "plainText": "",2622 "formattedText": ""2623 },2624 "esES": {2625 "extends": "StudioObject",2626 "objectType": "Label",2627 "oid": "",2628 "plainText": "",2629 "formattedText": ""2630 }2631 },2632 "extents": "SurveyItem",2633 "objectType": "TextItem",2634 "templateID": "PASC18",2635 "customID": "PASCZ",2636 "dataType": "String"2637 }2638 ],2639 "navigationList": [2640 {2641 "extents": "SurveyTemplateObject",2642 "objectType": "Navigation",2643 "origin": "BEGIN NODE",2644 "index": 0,2645 "inNavigations": [],2646 "isDefault": false,2647 "routes": [2648 {2649 "extents": "SurveyTemplateObject",2650 "objectType": "Route",2651 "origin": "BEGIN NODE",2652 "destination": "PASC1",2653 "name": "BEGIN NODE_PASC1",2654 "isDefault": true,2655 "conditions": []2656 }2657 ]2658 },2659 {2660 "extents": "SurveyTemplateObject",2661 "objectType": "Navigation",2662 "origin": "END NODE",2663 "index": 1,2664 "inNavigations": [2665 null,2666 {2667 "origin": "PASC18"2668 }2669 ],2670 "isDefault": false,2671 "routes": []2672 },2673 {2674 "extents": "SurveyTemplateObject",2675 "objectType": "Navigation",2676 "origin": "PASC1",2677 "index": 2,2678 "inNavigations": [2679 {2680 "origin": "BEGIN NODE"2681 }2682 ],2683 "isDefault": false,2684 "routes": [2685 {2686 "extents": "SurveyTemplateObject",2687 "objectType": "Route",2688 "origin": "PASC1",2689 "destination": "PASC2",2690 "name": "PASC1_PASC2",2691 "isDefault": true,2692 "conditions": []2693 }2694 ]2695 },2696 {2697 "extents": "SurveyTemplateObject",2698 "objectType": "Navigation",2699 "origin": "PASC2",2700 "index": 3,2701 "inNavigations": [2702 {2703 "origin": "PASC1"2704 }2705 ],2706 "isDefault": false,2707 "routes": [2708 {2709 "extents": "SurveyTemplateObject",2710 "objectType": "Route",2711 "origin": "PASC2",2712 "destination": "PASC3",2713 "name": "PASC2_PASC3",2714 "isDefault": true,2715 "conditions": []2716 }2717 ]2718 },2719 {2720 "extents": "SurveyTemplateObject",2721 "objectType": "Navigation",2722 "origin": "PASC3",2723 "index": 4,2724 "inNavigations": [2725 {2726 "origin": "PASC2"2727 }2728 ],2729 "isDefault": false,2730 "routes": [2731 {2732 "extents": "SurveyTemplateObject",2733 "objectType": "Route",2734 "origin": "PASC3",2735 "destination": "PASC4",2736 "name": "PASC3_PASC4",2737 "isDefault": true,2738 "conditions": []2739 }2740 ]2741 },2742 {2743 "extents": "SurveyTemplateObject",2744 "objectType": "Navigation",2745 "origin": "PASC4",2746 "index": 5,2747 "inNavigations": [2748 {2749 "origin": "PASC3"2750 }2751 ],2752 "isDefault": false,2753 "routes": [2754 {2755 "extents": "SurveyTemplateObject",2756 "objectType": "Route",2757 "origin": "PASC4",2758 "destination": "PASC6",2759 "name": "PASC4_PASC6",2760 "isDefault": true,2761 "conditions": []2762 }2763 ]2764 },2765 {2766 "extents": "SurveyTemplateObject",2767 "objectType": "Navigation",2768 "origin": "PASC6",2769 "index": 7,2770 "inNavigations": [2771 null,2772 {2773 "origin": "PASC4"2774 }2775 ],2776 "isDefault": false,2777 "routes": [2778 {2779 "extents": "SurveyTemplateObject",2780 "objectType": "Route",2781 "origin": "PASC6",2782 "destination": "PASC7",2783 "name": "PASC6_PASC7",2784 "isDefault": true,2785 "conditions": []2786 }2787 ]2788 },2789 {2790 "extents": "SurveyTemplateObject",2791 "objectType": "Navigation",2792 "origin": "PASC7",2793 "index": 8,2794 "inNavigations": [2795 {2796 "origin": "PASC6"2797 }2798 ],2799 "isDefault": false,2800 "routes": [2801 {2802 "extents": "SurveyTemplateObject",2803 "objectType": "Route",2804 "origin": "PASC7",2805 "destination": "PASC8",2806 "name": "PASC7_PASC8",2807 "isDefault": true,2808 "conditions": []2809 }2810 ]2811 },2812 {2813 "extents": "SurveyTemplateObject",2814 "objectType": "Navigation",2815 "origin": "PASC8",2816 "index": 9,2817 "inNavigations": [2818 {2819 "origin": "PASC7"2820 }2821 ],2822 "isDefault": false,2823 "routes": [2824 {2825 "extents": "SurveyTemplateObject",2826 "objectType": "Route",2827 "origin": "PASC8",2828 "destination": "PASC9",2829 "name": "PASC8_PASC9",2830 "isDefault": true,2831 "conditions": []2832 }2833 ]2834 },2835 {2836 "extents": "SurveyTemplateObject",2837 "objectType": "Navigation",2838 "origin": "PASC9",2839 "index": 10,2840 "inNavigations": [2841 {2842 "origin": "PASC8"2843 }2844 ],2845 "isDefault": false,2846 "routes": [2847 {2848 "extents": "SurveyTemplateObject",2849 "objectType": "Route",2850 "origin": "PASC9",2851 "destination": "PASC10",2852 "name": "PASC9_PASC10",2853 "isDefault": true,2854 "conditions": []2855 }2856 ]2857 },2858 {2859 "extents": "SurveyTemplateObject",2860 "objectType": "Navigation",2861 "origin": "PASC10",2862 "index": 11,2863 "inNavigations": [2864 {2865 "origin": "PASC9"2866 }2867 ],2868 "isDefault": false,2869 "routes": [2870 {2871 "extents": "SurveyTemplateObject",2872 "objectType": "Route",2873 "origin": "PASC10",2874 "destination": "PASC11",2875 "name": "PASC10_PASC11",2876 "isDefault": true,2877 "conditions": []2878 }2879 ]2880 },2881 {2882 "extents": "SurveyTemplateObject",2883 "objectType": "Navigation",2884 "origin": "PASC11",2885 "index": 12,2886 "inNavigations": [2887 {2888 "origin": "PASC10"2889 }2890 ],2891 "isDefault": false,2892 "routes": [2893 {2894 "extents": "SurveyTemplateObject",2895 "objectType": "Route",2896 "origin": "PASC11",2897 "destination": "PASC12",2898 "name": "PASC11_PASC12",2899 "isDefault": true,2900 "conditions": []2901 }2902 ]2903 },2904 {2905 "extents": "SurveyTemplateObject",2906 "objectType": "Navigation",2907 "origin": "PASC12",2908 "index": 13,2909 "inNavigations": [2910 {2911 "origin": "PASC11"2912 }2913 ],2914 "isDefault": false,2915 "routes": [2916 {2917 "extents": "SurveyTemplateObject",2918 "objectType": "Route",2919 "origin": "PASC12",2920 "destination": "PASC13",2921 "name": "PASC12_PASC13",2922 "isDefault": true,2923 "conditions": []2924 }2925 ]2926 },2927 {2928 "extents": "SurveyTemplateObject",2929 "objectType": "Navigation",2930 "origin": "PASC13",2931 "index": 14,2932 "inNavigations": [2933 {2934 "origin": "PASC12"2935 }2936 ],2937 "isDefault": false,2938 "routes": [2939 {2940 "extents": "SurveyTemplateObject",2941 "objectType": "Route",2942 "origin": "PASC13",2943 "destination": "PASC14",2944 "name": "PASC13_PASC14",2945 "isDefault": true,2946 "conditions": []2947 }2948 ]2949 },2950 {2951 "extents": "SurveyTemplateObject",2952 "objectType": "Navigation",2953 "origin": "PASC14",2954 "index": 15,2955 "inNavigations": [2956 {2957 "origin": "PASC13"2958 }2959 ],2960 "isDefault": false,2961 "routes": [2962 {2963 "extents": "SurveyTemplateObject",2964 "objectType": "Route",2965 "origin": "PASC14",2966 "destination": "PASC15",2967 "name": "PASC14_PASC15",2968 "isDefault": true,2969 "conditions": []2970 }2971 ]2972 },2973 {2974 "extents": "SurveyTemplateObject",2975 "objectType": "Navigation",2976 "origin": "PASC15",2977 "index": 16,2978 "inNavigations": [2979 {2980 "origin": "PASC14"2981 }2982 ],2983 "isDefault": false,2984 "routes": [2985 {2986 "extents": "SurveyTemplateObject",2987 "objectType": "Route",2988 "origin": "PASC15",2989 "destination": "PASC18",2990 "name": "PASC15_PASC18",2991 "isDefault": true,2992 "conditions": []2993 },2994 {2995 "extents": "SurveyTemplateObject",2996 "objectType": "Route",2997 "origin": "PASC15",2998 "destination": "PASC16",2999 "name": "PASC15_PASC16",3000 "isDefault": false,3001 "conditions": [3002 {3003 "extents": "StudioObject",3004 "objectType": "RouteCondition",3005 "name": "ROUTE_CONDITION_0",3006 "rules": [3007 {3008 "extents": "SurveyTemplateObject",3009 "objectType": "Rule",3010 "when": "PASC15",3011 "operator": "equal",3012 "answer": "1",3013 "isMetadata": false3014 }3015 ]3016 }3017 ]3018 }3019 ]3020 },3021 {3022 "extents": "SurveyTemplateObject",3023 "objectType": "Navigation",3024 "origin": "PASC16",3025 "index": 17,3026 "inNavigations": [3027 {3028 "origin": "PASC15"3029 }3030 ],3031 "isDefault": false,3032 "routes": [3033 {3034 "extents": "SurveyTemplateObject",3035 "objectType": "Route",3036 "origin": "PASC16",3037 "destination": "PASC18",3038 "name": "PASC16_PASC18",3039 "isDefault": true,3040 "conditions": []3041 },3042 {3043 "extents": "SurveyTemplateObject",3044 "objectType": "Route",3045 "origin": "PASC16",3046 "destination": "PASC17",3047 "name": "PASC16_PASC17",3048 "isDefault": false,3049 "conditions": [3050 {3051 "extents": "StudioObject",3052 "objectType": "RouteCondition",3053 "name": "ROUTE_CONDITION_0",3054 "rules": [3055 {3056 "extents": "SurveyTemplateObject",3057 "objectType": "Rule",3058 "when": "PASC16",3059 "operator": "equal",3060 "answer": "PASCalt7",3061 "isMetadata": false3062 }3063 ]3064 }3065 ]3066 }3067 ]3068 },3069 {3070 "extents": "SurveyTemplateObject",3071 "objectType": "Navigation",3072 "origin": "PASC17",3073 "index": 18,3074 "inNavigations": [3075 {3076 "origin": "PASC16"3077 }3078 ],3079 "isDefault": false,3080 "routes": [3081 {3082 "extents": "SurveyTemplateObject",3083 "objectType": "Route",3084 "origin": "PASC17",3085 "destination": "PASC18",3086 "name": "PASC17_PASC18",3087 "isDefault": true,3088 "conditions": []3089 }3090 ]3091 },3092 {3093 "extents": "SurveyTemplateObject",3094 "objectType": "Navigation",3095 "origin": "PASC18",3096 "index": 19,3097 "inNavigations": [3098 {3099 "origin": "PASC17"3100 },3101 {3102 "origin": "PASC15"3103 },3104 {3105 "origin": "PASC16"3106 }3107 ],3108 "isDefault": false,3109 "routes": [3110 {3111 "extents": "SurveyTemplateObject",3112 "objectType": "Route",3113 "origin": "PASC18",3114 "destination": "END NODE",3115 "name": "PASC18_END NODE",3116 "isDefault": true,3117 "conditions": []3118 }3119 ]3120 }3121 ]3122 },3123 "isDiscarded": false,3124 "version": 1,3125 },3126 "mode": "ONLINE",3127 "participantData": {3128 "recruitmentNumber": 1234567,3129 "name": "FULANO DA SILVA",3130 "sex": "M",3131 "birthdate": {3132 "objectType": "ImmutableDate",3133 "value": "1963-05-24 00:00:00.000"3134 },3135 "fieldCenter": {3136 "name": "Rio Grande do Sul",3137 "code": 5,3138 "acronym": "RS",3139 "country": null,3140 "state": null,3141 "address": null,3142 "complement": null,3143 "zip": null,3144 "phone": null3145 }3146 },3147 "interviews": [3148 {3149 "objectType": "Interview",3150 "date": "2017-04-12T11:16:59.154Z",3151 "interviewer": {3152 "objectType": "Interviewer",3153 "name": "Thiane",3154 "email": "thianeristowcardinal@gmail.com"3155 }3156 }3157 ],3158 "fillContainer": {3159 "fillingList": [3160 {3161 "objectType": "QuestionFill",3162 "questionID": "PASC1",3163 "answer": {3164 "value": "1",3165 "objectType": "AnswerFill",3166 "type": "SingleSelectionQuestion"3167 },3168 "forceAnswer": false,3169 "metadata": {3170 "objectType": "MetadataFill",3171 "value": null3172 },3173 "comment": ""3174 },3175 {3176 "objectType": "QuestionFill",3177 "questionID": "PASC2",3178 "answer": {3179 "value": 37.2,3180 "objectType": "AnswerFill",3181 "type": "DecimalQuestion"3182 },3183 "forceAnswer": false,3184 "metadata": {3185 "objectType": "MetadataFill",3186 "value": null3187 },3188 "comment": ""3189 },3190 {3191 "objectType": "QuestionFill",3192 "questionID": "PASC3",3193 "answer": {3194 "value": "1",3195 "objectType": "AnswerFill",3196 "type": "SingleSelectionQuestion"3197 },3198 "forceAnswer": false,3199 "metadata": {3200 "objectType": "MetadataFill",3201 "value": null3202 },3203 "comment": ""3204 },3205 {3206 "objectType": "QuestionFill",3207 "questionID": "PASC4",3208 "answer": {3209 "value": "3",3210 "objectType": "AnswerFill",3211 "type": "SingleSelectionQuestion"3212 },3213 "forceAnswer": false,3214 "metadata": {3215 "objectType": "MetadataFill",3216 "value": null3217 },3218 "comment": ""3219 },3220 {3221 "objectType": "QuestionFill",3222 "questionID": "PASC6",3223 "answer": {3224 "value": 135,3225 "objectType": "AnswerFill",3226 "type": "IntegerQuestion"3227 },3228 "forceAnswer": false,3229 "metadata": {3230 "objectType": "MetadataFill",3231 "value": null3232 },3233 "comment": ""3234 },3235 {3236 "objectType": "QuestionFill",3237 "questionID": "PASC7",3238 "answer": {3239 "value": 87,3240 "objectType": "AnswerFill",3241 "type": "IntegerQuestion"3242 },3243 "forceAnswer": false,3244 "metadata": {3245 "objectType": "MetadataFill",3246 "value": null3247 },3248 "comment": ""3249 },3250 {3251 "objectType": "QuestionFill",3252 "questionID": "PASC8",3253 "answer": {3254 "value": 51,3255 "objectType": "AnswerFill",3256 "type": "IntegerQuestion"3257 },3258 "forceAnswer": false,3259 "metadata": {3260 "objectType": "MetadataFill",3261 "value": null3262 },3263 "comment": ""3264 },3265 {3266 "objectType": "QuestionFill",3267 "questionID": "PASC9",3268 "answer": {3269 "value": 135,3270 "objectType": "AnswerFill",3271 "type": "IntegerQuestion"3272 },3273 "forceAnswer": false,3274 "metadata": {3275 "objectType": "MetadataFill",3276 "value": null3277 },3278 "comment": ""3279 },3280 {3281 "objectType": "QuestionFill",3282 "questionID": "PASC10",3283 "answer": {3284 "value": 85,3285 "objectType": "AnswerFill",3286 "type": "IntegerQuestion"3287 },3288 "forceAnswer": false,3289 "metadata": {3290 "objectType": "MetadataFill",3291 "value": null3292 },3293 "comment": ""3294 },3295 {3296 "objectType": "QuestionFill",3297 "questionID": "PASC11",3298 "answer": {3299 "value": 53,3300 "objectType": "AnswerFill",3301 "type": "IntegerQuestion"3302 },3303 "forceAnswer": false,3304 "metadata": {3305 "objectType": "MetadataFill",3306 "value": null3307 },3308 "comment": ""3309 },3310 {3311 "objectType": "QuestionFill",3312 "questionID": "PASC12",3313 "answer": {3314 "value": 138,3315 "objectType": "AnswerFill",3316 "type": "IntegerQuestion"3317 },3318 "forceAnswer": false,3319 "metadata": {3320 "objectType": "MetadataFill",3321 "value": null3322 },3323 "comment": ""3324 },3325 {3326 "objectType": "QuestionFill",3327 "questionID": "PASC13",3328 "answer": {3329 "value": 90,3330 "objectType": "AnswerFill",3331 "type": "IntegerQuestion"3332 },3333 "forceAnswer": false,3334 "metadata": {3335 "objectType": "MetadataFill",3336 "value": null3337 },3338 "comment": ""3339 },3340 {3341 "objectType": "QuestionFill",3342 "questionID": "PASC14",3343 "answer": {3344 "value": 56,3345 "objectType": "AnswerFill",3346 "type": "IntegerQuestion"3347 },3348 "forceAnswer": false,3349 "metadata": {3350 "objectType": "MetadataFill",3351 "value": null3352 },3353 "comment": ""3354 },3355 {3356 "objectType": "QuestionFill",3357 "questionID": "PASC15",3358 "answer": {3359 "value": "2",3360 "objectType": "AnswerFill",3361 "type": "SingleSelectionQuestion"3362 },3363 "forceAnswer": false,3364 "metadata": {3365 "objectType": "MetadataFill",3366 "value": null3367 },3368 "comment": ""3369 }3370 ]3371 },3372 "statusHistory": [3373 {3374 "objectType": "ActivityStatus",3375 "name": "CREATED",3376 "date": "2017-04-12T10:35:11.971Z",3377 "user": {3378 "name": "Wilson",3379 "surname": "Cañon Montañez",3380 "phone": "51989197171",3381 "email": "wilcamo32@yahoo.com"3382 }3383 },3384 {3385 "objectType": "ActivityStatus",3386 "name": "OPENED",3387 "date": "2017-04-12T11:16:08.584Z",3388 "user": {3389 "name": "Thiane",3390 "surname": "Ristow Cardinal",3391 "phone": "51999021994",3392 "email": "thianeristowcardinal@gmail.com"3393 }3394 },3395 {3396 "objectType": "ActivityStatus",3397 "name": "INITIALIZED_ONLINE",3398 "date": "2017-04-12T11:16:59.154Z",3399 "user": {3400 "name": "Thiane",3401 "surname": "Ristow Cardinal",3402 "phone": "51999021994",3403 "email": "thianeristowcardinal@gmail.com"3404 }3405 },3406 {3407 "objectType": "ActivityStatus",3408 "name": "FINALIZED",3409 "date": "2017-04-12T11:28:05.250Z",3410 "user": {3411 "name": "Thiane",3412 "surname": "Ristow Cardinal",3413 "phone": "51999021994",3414 "email": "thianeristowcardinal@gmail.com"3415 }3416 }3417 ],3418 "isDiscarded": false,3419 "navigationTracker": {3420 "objectType": "NavigationTracker",3421 "items": [3422 {3423 "objectType": "NavigationTrackingItem",3424 "id": "PASC1",3425 "state": "ANSWERED",3426 "previous": null,3427 "inputs": [],3428 "outputs": [3429 "PASC2"3430 ]3431 },3432 {3433 "objectType": "NavigationTrackingItem",3434 "id": "PASC2",3435 "state": "ANSWERED",3436 "previous": "PASC1",3437 "inputs": [3438 "PASC1"3439 ],3440 "outputs": [3441 "PASC3"3442 ]3443 },3444 {3445 "objectType": "NavigationTrackingItem",3446 "id": "PASC3",3447 "state": "ANSWERED",3448 "previous": "PASC2",3449 "inputs": [3450 "PASC2"3451 ],3452 "outputs": [3453 "PASC4"3454 ]3455 },3456 {3457 "objectType": "NavigationTrackingItem",3458 "id": "PASC4",3459 "state": "ANSWERED",3460 "previous": "PASC3",3461 "inputs": [3462 "PASC3"3463 ],3464 "outputs": [3465 "PASC6"3466 ]3467 },3468 {3469 "objectType": "NavigationTrackingItem",3470 "id": "PASC6",3471 "state": "ANSWERED",3472 "previous": "PASC4",3473 "inputs": [3474 "NULL NAVIGATION",3475 "PASC4"3476 ],3477 "outputs": [3478 "PASC7"3479 ]3480 },3481 {3482 "objectType": "NavigationTrackingItem",3483 "id": "PASC7",3484 "state": "ANSWERED",3485 "previous": "PASC6",3486 "inputs": [3487 "PASC6"3488 ],3489 "outputs": [3490 "PASC8"3491 ]3492 },3493 {3494 "objectType": "NavigationTrackingItem",3495 "id": "PASC8",3496 "state": "ANSWERED",3497 "previous": "PASC7",3498 "inputs": [3499 "PASC7"3500 ],3501 "outputs": [3502 "PASC9"3503 ]3504 },3505 {3506 "objectType": "NavigationTrackingItem",3507 "id": "PASC9",3508 "state": "ANSWERED",3509 "previous": "PASC8",3510 "inputs": [3511 "PASC8"3512 ],3513 "outputs": [3514 "PASC10"3515 ]3516 },3517 {3518 "objectType": "NavigationTrackingItem",3519 "id": "PASC10",3520 "state": "ANSWERED",3521 "previous": "PASC9",3522 "inputs": [3523 "PASC9"3524 ],3525 "outputs": [3526 "PASC11"3527 ]3528 },3529 {3530 "objectType": "NavigationTrackingItem",3531 "id": "PASC11",3532 "state": "ANSWERED",3533 "previous": "PASC10",3534 "inputs": [3535 "PASC10"3536 ],3537 "outputs": [3538 "PASC12"3539 ]3540 },3541 {3542 "objectType": "NavigationTrackingItem",3543 "id": "PASC12",3544 "state": "ANSWERED",3545 "previous": "PASC11",3546 "inputs": [3547 "PASC11"3548 ],3549 "outputs": [3550 "PASC13"3551 ]3552 },3553 {3554 "objectType": "NavigationTrackingItem",3555 "id": "PASC13",3556 "state": "ANSWERED",3557 "previous": "PASC12",3558 "inputs": [3559 "PASC12"3560 ],3561 "outputs": [3562 "PASC14"3563 ]3564 },3565 {3566 "objectType": "NavigationTrackingItem",3567 "id": "PASC14",3568 "state": "ANSWERED",3569 "previous": "PASC13",3570 "inputs": [3571 "PASC13"3572 ],3573 "outputs": [3574 "PASC15"3575 ]3576 },3577 {3578 "objectType": "NavigationTrackingItem",3579 "id": "PASC15",3580 "state": "ANSWERED",3581 "previous": "PASC14",3582 "inputs": [3583 "PASC14"3584 ],3585 "outputs": [3586 "PASC18",3587 "PASC16"3588 ]3589 },3590 {3591 "objectType": "NavigationTrackingItem",3592 "id": "PASC16",3593 "state": "SKIPPED",3594 "previous": null,3595 "inputs": [3596 "PASC15"3597 ],3598 "outputs": [3599 "PASC18",3600 "PASC17"3601 ]3602 },3603 {3604 "objectType": "NavigationTrackingItem",3605 "id": "PASC17",3606 "state": "SKIPPED",3607 "previous": null,3608 "inputs": [3609 "PASC16"3610 ],3611 "outputs": [3612 "PASC18"3613 ]3614 },3615 {3616 "objectType": "NavigationTrackingItem",3617 "id": "PASC18",3618 "state": "VISITED",3619 "previous": "PASC15",3620 "inputs": [3621 "PASC17",3622 "PASC15",3623 "PASC16"3624 ],3625 "outputs": []3626 }3627 ],3628 "lastVisitedIndex": 163629 },3630 "category": {3631 "_id": "5a1dff9428110d0a385114f5",3632 "name": "C0",3633 "objectType": "ActivityCategory",3634 "label": "Normal",3635 "disabled": false,3636 "isDefault": true3637 }3638};3639Test.utils.data.metadata = {3640 "extents": "StudioObject",3641 "objectType": "MetadataGroup",3642 "options": [3643 {3644 "extends": "StudioObject",3645 "objectType": "MetadataAnswer",3646 "dataType": "Integer",3647 "value": 1,3648 "extractionValue": ".Q",3649 "label": {3650 "ptBR": {3651 "extends": "StudioObject",3652 "objectType": "Label",3653 "oid": "",3654 "plainText": "Não quer responder",3655 "formattedText": "Não quer responder"3656 },3657 "enUS": {3658 "extends": "StudioObject",3659 "objectType": "Label",3660 "oid": "",3661 "plainText": "",3662 "formattedText": ""3663 },3664 "esES": {3665 "extends": "StudioObject",3666 "objectType": "Label",3667 "oid": "",3668 "plainText": "",3669 "formattedText": ""3670 }3671 }3672 },3673 {3674 "extends": "StudioObject",3675 "objectType": "MetadataAnswer",3676 "dataType": "Integer",3677 "value": 2,3678 "extractionValue": ".S",3679 "label": {3680 "ptBR": {3681 "extends": "StudioObject",3682 "objectType": "Label",3683 "oid": "",3684 "plainText": "Não sabe",3685 "formattedText": "Não sabe"3686 },3687 "enUS": {3688 "extends": "StudioObject",3689 "objectType": "Label",3690 "oid": "",3691 "plainText": "",3692 "formattedText": ""3693 },3694 "esES": {3695 "extends": "StudioObject",3696 "objectType": "Label",3697 "oid": "",3698 "plainText": "",3699 "formattedText": ""3700 }3701 }3702 },3703 {3704 "extends": "StudioObject",3705 "objectType": "MetadataAnswer",3706 "dataType": "Integer",3707 "value": 3,3708 "extractionValue": ".A",3709 "label": {3710 "ptBR": {3711 "extends": "StudioObject",3712 "objectType": "Label",3713 "oid": "",3714 "plainText": "Não se aplica",3715 "formattedText": "Não se aplica"3716 },3717 "enUS": {3718 "extends": "StudioObject",3719 "objectType": "Label",3720 "oid": "",3721 "plainText": "",3722 "formattedText": ""3723 },3724 "esES": {3725 "extends": "StudioObject",3726 "objectType": "Label",3727 "oid": "",3728 "plainText": "",3729 "formattedText": ""3730 }3731 }3732 },3733 {3734 "extends": "StudioObject",3735 "objectType": "MetadataAnswer",3736 "dataType": "Integer",3737 "value": 4,3738 "extractionValue": ".F",3739 "label": {3740 "ptBR": {3741 "extends": "StudioObject",3742 "objectType": "Label",3743 "oid": "",3744 "plainText": "Não há dados",3745 "formattedText": "Não há dados"3746 },3747 "enUS": {3748 "extends": "StudioObject",3749 "objectType": "Label",3750 "oid": "",3751 "plainText": "",3752 "formattedText": ""3753 },3754 "esES": {3755 "extends": "StudioObject",3756 "objectType": "Label",3757 "oid": "",3758 "plainText": "",3759 "formattedText": ""3760 }3761 }3762 }3763 ]3764};3765Test.utils.data.surveyItem = {3766 "extents": "SurveyItem",3767 "objectType": "SingleSelectionQuestion",3768 "templateID": "DORC1",3769 "customID": "DORC1",3770 "dataType": "Integer",3771 "label": {3772 "ptBR": {3773 "extends": "StudioObject",3774 "objectType": "Label",3775 "oid": "",3776 "plainText": "01. O(A) Sr(a) informou que tem sentido dor nos últimos 30 dias. Essa dor tem&nbsp; durado por pelo menos três meses ?",3777 "formattedText": "<div>01. O(A) Sr(a) informou que tem sentido dor nos últimos 30 dias. Essa dor tem&nbsp;<span style='letter-spacing: 0.01em;'>durado por pelo menos<u> três meses</u>?</span></div>"3778 },3779 "enUS": {3780 "extends": "StudioObject",3781 "objectType": "Label",3782 "oid": "",3783 "plainText": "",3784 "formattedText": ""3785 },3786 "esES": {3787 "extends": "StudioObject",3788 "objectType": "Label",3789 "oid": "",3790 "plainText": "",3791 "formattedText": ""3792 }3793 },3794 "options": [3795 {3796 "extents": "StudioObject",3797 "objectType": "AnswerOption",3798 "value": 1,3799 "extractionValue": "0",3800 "dataType": "Integer",3801 "label": {3802 "ptBR": {3803 "extends": "StudioObject",3804 "objectType": "Label",3805 "oid": "",3806 "plainText": "Não",3807 "formattedText": "Não"3808 },3809 "enUS": {3810 "extends": "StudioObject",3811 "objectType": "Label",3812 "oid": "",3813 "plainText": "",3814 "formattedText": ""3815 },3816 "esES": {3817 "extends": "StudioObject",3818 "objectType": "Label",3819 "oid": "",3820 "plainText": "",3821 "formattedText": ""3822 }3823 }3824 },3825 {3826 "extents": "StudioObject",3827 "objectType": "AnswerOption",3828 "value": 2,3829 "extractionValue": "1",3830 "dataType": "Integer",3831 "label": {3832 "ptBR": {3833 "extends": "StudioObject",3834 "objectType": "Label",3835 "oid": "",3836 "plainText": "Sim",3837 "formattedText": "Sim"3838 },3839 "enUS": {3840 "extends": "StudioObject",3841 "objectType": "Label",3842 "oid": "",3843 "plainText": "",3844 "formattedText": ""3845 },3846 "esES": {3847 "extends": "StudioObject",3848 "objectType": "Label",3849 "oid": "",3850 "plainText": "",3851 "formattedText": ""3852 }3853 }3854 }3855 ],3856 "metadata": Test.utils.data.metadata,3857 "fillingRules": {3858 "extends": "StudioObject",3859 "objectType": "FillingRules",3860 "options": {3861 "mandatory": {3862 "extends": "StudioObject",3863 "objectType": "Rule",3864 "validatorType": "mandatory",3865 "data": {3866 "canBeIgnored": false,3867 "reference": true3868 }3869 }3870 }3871 }3872};3873Test.utils.data.PLAYER_SERVICE_CONSTANTS = {3874 REASONS_TO_LIVE_PLAYER: {3875 IS_NOT_ME: {},3876 GET_OUT_WITHOUT_SAVE: {},3877 SAVE: {},3878 FINALIZE: {},3879 ALREADY_FINALIZED: {},3880 ERROR: {}3881 }3882};3883Test.utils.data.getCurrentSurvey = {3884 getName: function () { return 'x'; }...

Full Screen

Full Screen

current-survey-service-spec.js

Source:current-survey-service-spec.js Github

copy

Full Screen

1describe('Current Question Service', function () {2 var UNIT_NAME = 'otusjs.player.data.activity.CurrentSurveyService';3 var Mock = {};4 var Injections = {};5 var service;6 var CAD1 = 'CAD1';7 var CAD2 = 'CAD2';8 var CAD90 = 'CAD90';9 beforeEach(function () {10 angular.mock.module('otusjs.player.data', function ($provide) {11 $provide.value('otusjs.model.activity.ActivityFacadeService', Mock.ActivityFacadeService);12 });13 inject(function (_$injector_) {14 /* Test data */15 mockSurvey();16 service = _$injector_.get(UNIT_NAME);17 });18 });19 describe('getAnswerByItemID method', function () {20 it('should retrieve the filling of item from survey activity', function () {21 spyOn(Mock.ActivityFacadeService, 'getFillingByQuestionID');22 service.getAnswerByItemID(CAD1);23 expect(Mock.ActivityFacadeService.getFillingByQuestionID).toHaveBeenCalledWith(CAD1);24 });25 });26 xdescribe('getItems method', function () {27 beforeEach(function () {28 service.setup(Mock.ActivityFacadeService.surveyActivity);29 });30 it('should return the items of current survey', function () {31 expect(service.getItems()).toEqual(Mock.surveyTemplate.itemContainer);32 });33 });34 xdescribe('getItemByCustomID method', function () {35 beforeEach(function () {36 service.setup(Mock.ActivityFacadeService.surveyActivity);37 });38 describe('when exists an item', function () {39 it('should return the item', function () {40 var item = service.getItemByCustomID(CAD2);41 expect(item.customID).toEqual(CAD2);42 });43 });44 describe('when not exists an item', function () {45 it('should return null', function () {46 var item = service.getItemByCustomID(CAD90);47 expect(item).toBe(null);48 });49 });50 });51 xdescribe('getItemByTemplateID method', function () {52 beforeEach(function () {53 service.setup(Mock.ActivityFacadeService.surveyActivity);54 });55 describe('when exists an item', function () {56 it('should return the item', function () {57 var item = service.getItemByTemplateID(CAD2);58 expect(item.customID).toEqual(CAD2);59 });60 });61 describe('when not exists an item', function () {62 it('should return null', function () {63 var item = service.getItemByTemplateID(CAD90);64 expect(item).toBe(null);65 });66 it('should return null', function () {67 var item = service.getItemByTemplateID();68 expect(item).toBe(null);69 });70 });71 });72 xdescribe('getNavigations method', function () {73 beforeEach(function () {74 service.setup(Mock.ActivityFacadeService.surveyActivity);75 });76 it('should return the list of navigations of current survey', function () {77 var value = service.getNavigations();78 expect(value).toEqual(Mock.surveyTemplate.navigationList);79 });80 });81 xdescribe('getNavigationByOrigin method', function () {82 beforeEach(function () {83 service.setup(Mock.ActivityFacadeService.surveyActivity);84 });85 describe('when exists a navigation', function () {86 it('should return the navigation of origin', function () {87 var navigation = service.getNavigationByOrigin(CAD1);88 expect(navigation.origin).toEqual(CAD1);89 });90 });91 xdescribe('when not exists a navigation', function () {92 it('should return null', function () {93 var navigation = service.getNavigationByOrigin(CAD90);94 expect(navigation).toEqual(null);95 });96 });97 });98 xdescribe('initialize method', function () {99 it('should open the survey activity', function () {100 spyOn(Mock.ActivityFacadeService, 'openActivitySurvey');101 service.initialize();102 expect(Mock.ActivityFacadeService.openActivitySurvey).toHaveBeenCalledWith();103 });104 });105 xdescribe('setup method', function () {106 it('should initialize the survey activity', function () {107 spyOn(Mock.ActivityFacadeService, 'initializeActivitySurvey');108 service.setup();109 expect(Mock.ActivityFacadeService.initializeActivitySurvey).toHaveBeenCalledWith();110 });111 });112 describe('getWholeTemplateStaticVariableList method', function () {113 it('should getWholeTemplateStaticVariableList the survey activity', function () {114 spyOn(Mock.ActivityFacadeService, 'getWholeTemplateVariableList');115 service.getWholeTemplateStaticVariableList();116 expect(Mock.ActivityFacadeService.getWholeTemplateVariableList).toHaveBeenCalledTimes(1);117 });118 });119 describe('getGroupItemsByMemberID method', function () {120 it('should getGroupItemsByMemberID the survey activity', function () {121 // spyOn(Mock.ActivityFacadeService.surveyActivity, 'getGroupByItemID').and.callFake(a);122 spyOn(Mock.ActivityFacadeService.surveyActivity, 'getGroupItemsByItemID');123 service.getGroupItemsByMemberID();124 expect(Mock.ActivityFacadeService.surveyActivity.getGroupItemsByItemID).toHaveBeenCalledTimes(1);125 });126 });127 function mockSurvey() {128 mockSurveyData();129 Mock.surveyTemplate.SurveyItemManager = {};130 Mock.surveyTemplate.SurveyItemManager.getItemList = jasmine.createSpy('getItemList').and.returnValue(Mock.surveyTemplate.itemContainer);131 Mock.surveyTemplate.SurveyItemManager.getItemByTemplateID = jasmine.createSpy('getItemByTemplateID').and.returnValue(Mock.surveyTemplate.itemContainer[1]);132 Mock.CAD1Navigation = Mock.surveyTemplate.navigationList[0];133 Mock.CAD1Navigation.listRoutes = jasmine.createSpy('listRoutes').and.returnValue(Mock.CAD1Navigation.routes);134 Mock.surveyTemplate.NavigationManager = {};135 Mock.surveyTemplate.NavigationManager.getNavigationList = jasmine.createSpy('getNavigationList').and.returnValue(Mock.surveyTemplate.navigationList);136 Mock.surveyTemplate.NavigationManager.selectNavigationByOrigin = jasmine.createSpy('selectNavigationByOrigin').and.returnValue(Mock.CAD1Navigation);137 }138 function mockSurveyData() {139 Mock.surveyTemplate = {140 "extents": "StudioObject",141 "objectType": "Survey",142 "oid": "dXNlclVVSUQ6W3VuZGVmaW5lZF1zdXJ2ZXlVVUlEOls2YWM5MjJiMC01ZTJiLTExZTYtOGE0ZS01ZGQyNzhhODUzNTddcmVwb3NpdG9yeVVVSUQ6WyBOb3QgZG9uZSB5ZXQgXQ==",143 "identity": {144 "extents": "StudioObject",145 "objectType": "SurveyIdentity",146 "name": "Cadastramento",147 "acronym": "CAD",148 "recommendedTo": "",149 "description": "",150 "keywords": []151 },152 "metainfo": {153 "extents": "StudioObject",154 "objectType": "SurveyMetaInfo",155 "creationDatetime": 1470745124954,156 "otusStudioVersion": ""157 },158 "itemContainer": [{159 "extents": "SurveyItem",160 "objectType": "TextQuestion",161 "templateID": "CAD1",162 "customID": "CAD1",163 "dataType": "String",164 "label": {165 "ptBR": {166 "extends": "StudioObject",167 "objectType": "Label",168 "oid": "",169 "plainText": "1. Qual é o seu nome?",170 "formattedText": "1. Qual é o seu nome?"171 },172 "enUS": {173 "extends": "StudioObject",174 "objectType": "Label",175 "oid": "",176 "plainText": "",177 "formattedText": ""178 },179 "esES": {180 "extends": "StudioObject",181 "objectType": "Label",182 "oid": "",183 "plainText": "",184 "formattedText": ""185 }186 },187 "metadata": {188 "extents": "StudioObject",189 "objectType": "MetadataGroup",190 "options": [{191 "extends": "StudioObject",192 "objectType": "MetadataAnswer",193 "dataType": "Integer",194 "value": 1,195 "label": {196 "ptBR": {197 "extends": "StudioObject",198 "objectType": "Label",199 "oid": "",200 "plainText": "Não quer responder",201 "formattedText": "Não quer responder"202 },203 "enUS": {204 "extends": "StudioObject",205 "objectType": "Label",206 "oid": "",207 "plainText": "",208 "formattedText": ""209 },210 "esES": {211 "extends": "StudioObject",212 "objectType": "Label",213 "oid": "",214 "plainText": "",215 "formattedText": ""216 }217 }218 }]219 },220 "fillingRules": {221 "extends": "StudioObject",222 "objectType": "FillingRules",223 "options": {224 "mandatory": {225 "extends": "StudioObject",226 "objectType": "Rule",227 "validatorType": "mandatory",228 "data": {229 "reference": true230 }231 },232 "minLength": {233 "extends": "StudioObject",234 "objectType": "Rule",235 "validatorType": "minLength",236 "data": {237 "size": null,238 "reference": 5239 }240 }241 }242 }243 }, {244 "extents": "SurveyItem",245 "objectType": "CalendarQuestion",246 "templateID": "CAD2",247 "customID": "CAD2",248 "dataType": "LocalDate",249 "label": {250 "ptBR": {251 "extends": "StudioObject",252 "objectType": "Label",253 "oid": "",254 "plainText": "2. Qual é a data de seu nascimento?",255 "formattedText": "2. Qual é a data de seu nascimento?"256 },257 "enUS": {258 "extends": "StudioObject",259 "objectType": "Label",260 "oid": "",261 "plainText": "",262 "formattedText": ""263 },264 "esES": {265 "extends": "StudioObject",266 "objectType": "Label",267 "oid": "",268 "plainText": "",269 "formattedText": ""270 }271 },272 "metadata": {273 "extents": "StudioObject",274 "objectType": "MetadataGroup",275 "options": [{276 "extends": "StudioObject",277 "objectType": "MetadataAnswer",278 "dataType": "Integer",279 "value": 1,280 "label": {281 "ptBR": {282 "extends": "StudioObject",283 "objectType": "Label",284 "oid": "",285 "plainText": "Não quer responder",286 "formattedText": "Não quer responder"287 },288 "enUS": {289 "extends": "StudioObject",290 "objectType": "Label",291 "oid": "",292 "plainText": "",293 "formattedText": ""294 },295 "esES": {296 "extends": "StudioObject",297 "objectType": "Label",298 "oid": "",299 "plainText": "",300 "formattedText": ""301 }302 }303 }, {304 "extends": "StudioObject",305 "objectType": "MetadataAnswer",306 "dataType": "Integer",307 "value": 2,308 "label": {309 "ptBR": {310 "extends": "StudioObject",311 "objectType": "Label",312 "oid": "",313 "plainText": "Não sabe responder",314 "formattedText": "Não sabe responder"315 },316 "enUS": {317 "extends": "StudioObject",318 "objectType": "Label",319 "oid": "",320 "plainText": "",321 "formattedText": ""322 },323 "esES": {324 "extends": "StudioObject",325 "objectType": "Label",326 "oid": "",327 "plainText": "",328 "formattedText": ""329 }330 }331 }]332 },333 "fillingRules": {334 "extends": "StudioObject",335 "objectType": "FillingRules",336 "options": {337 "mandatory": {338 "extends": "StudioObject",339 "objectType": "Rule",340 "validatorType": "mandatory",341 "data": {342 "reference": true343 }344 }345 }346 }347 }, {348 "extents": "SurveyItem",349 "objectType": "SingleSelectionQuestion",350 "templateID": "CAD3",351 "customID": "CAD3",352 "dataType": "Integer",353 "label": {354 "ptBR": {355 "extends": "StudioObject",356 "objectType": "Label",357 "oid": "",358 "plainText": "3. Seu gênero é:",359 "formattedText": "3. Seu gênero é:"360 },361 "enUS": {362 "extends": "StudioObject",363 "objectType": "Label",364 "oid": "",365 "plainText": "",366 "formattedText": ""367 },368 "esES": {369 "extends": "StudioObject",370 "objectType": "Label",371 "oid": "",372 "plainText": "",373 "formattedText": ""374 }375 },376 "options": [{377 "extents": "StudioObject",378 "objectType": "AnswerOption",379 "value": 1,380 "dataType": "Integer",381 "label": {382 "ptBR": {383 "extends": "StudioObject",384 "objectType": "Label",385 "oid": "",386 "plainText": "Feminino",387 "formattedText": "Feminino"388 },389 "enUS": {390 "extends": "StudioObject",391 "objectType": "Label",392 "oid": "",393 "plainText": "",394 "formattedText": ""395 },396 "esES": {397 "extends": "StudioObject",398 "objectType": "Label",399 "oid": "",400 "plainText": "",401 "formattedText": ""402 }403 }404 }, {405 "extents": "StudioObject",406 "objectType": "AnswerOption",407 "value": 2,408 "dataType": "Integer",409 "label": {410 "ptBR": {411 "extends": "StudioObject",412 "objectType": "Label",413 "oid": "",414 "plainText": "Masculino",415 "formattedText": "Masculino"416 },417 "enUS": {418 "extends": "StudioObject",419 "objectType": "Label",420 "oid": "",421 "plainText": "",422 "formattedText": ""423 },424 "esES": {425 "extends": "StudioObject",426 "objectType": "Label",427 "oid": "",428 "plainText": "",429 "formattedText": ""430 }431 }432 }, {433 "extents": "StudioObject",434 "objectType": "AnswerOption",435 "value": 3,436 "dataType": "Integer",437 "label": {438 "ptBR": {439 "extends": "StudioObject",440 "objectType": "Label",441 "oid": "",442 "plainText": "Outro",443 "formattedText": "Outro"444 },445 "enUS": {446 "extends": "StudioObject",447 "objectType": "Label",448 "oid": "",449 "plainText": "",450 "formattedText": ""451 },452 "esES": {453 "extends": "StudioObject",454 "objectType": "Label",455 "oid": "",456 "plainText": "",457 "formattedText": ""458 }459 }460 }],461 "metadata": {462 "extents": "StudioObject",463 "objectType": "MetadataGroup",464 "options": [{465 "extends": "StudioObject",466 "objectType": "MetadataAnswer",467 "dataType": "Integer",468 "value": 1,469 "label": {470 "ptBR": {471 "extends": "StudioObject",472 "objectType": "Label",473 "oid": "",474 "plainText": "Não se aplica",475 "formattedText": "Não se aplica"476 },477 "enUS": {478 "extends": "StudioObject",479 "objectType": "Label",480 "oid": "",481 "plainText": "",482 "formattedText": ""483 },484 "esES": {485 "extends": "StudioObject",486 "objectType": "Label",487 "oid": "",488 "plainText": "",489 "formattedText": ""490 }491 }492 }, {493 "extends": "StudioObject",494 "objectType": "MetadataAnswer",495 "dataType": "Integer",496 "value": 2,497 "label": {498 "ptBR": {499 "extends": "StudioObject",500 "objectType": "Label",501 "oid": "",502 "plainText": "Não quer responder",503 "formattedText": "Não quer responder"504 },505 "enUS": {506 "extends": "StudioObject",507 "objectType": "Label",508 "oid": "",509 "plainText": "",510 "formattedText": ""511 },512 "esES": {513 "extends": "StudioObject",514 "objectType": "Label",515 "oid": "",516 "plainText": "",517 "formattedText": ""518 }519 }520 }, {521 "extends": "StudioObject",522 "objectType": "MetadataAnswer",523 "dataType": "Integer",524 "value": 3,525 "label": {526 "ptBR": {527 "extends": "StudioObject",528 "objectType": "Label",529 "oid": "",530 "plainText": "Não sabe responder",531 "formattedText": "Não sabe responder"532 },533 "enUS": {534 "extends": "StudioObject",535 "objectType": "Label",536 "oid": "",537 "plainText": "",538 "formattedText": ""539 },540 "esES": {541 "extends": "StudioObject",542 "objectType": "Label",543 "oid": "",544 "plainText": "",545 "formattedText": ""546 }547 }548 }]549 },550 "fillingRules": {551 "extends": "StudioObject",552 "objectType": "FillingRules",553 "options": {554 "mandatory": {555 "extends": "StudioObject",556 "objectType": "Rule",557 "validatorType": "mandatory",558 "data": {559 "reference": true560 }561 }562 }563 }564 }, {565 "extents": "SurveyItem",566 "objectType": "TextQuestion",567 "templateID": "CAD4",568 "customID": "CAD4",569 "dataType": "String",570 "label": {571 "ptBR": {572 "extends": "StudioObject",573 "objectType": "Label",574 "oid": "",575 "plainText": "4. Qual outro?",576 "formattedText": "4. Qual outro?"577 },578 "enUS": {579 "extends": "StudioObject",580 "objectType": "Label",581 "oid": "",582 "plainText": "",583 "formattedText": ""584 },585 "esES": {586 "extends": "StudioObject",587 "objectType": "Label",588 "oid": "",589 "plainText": "",590 "formattedText": ""591 }592 },593 "metadata": {594 "extents": "StudioObject",595 "objectType": "MetadataGroup",596 "options": [{597 "extends": "StudioObject",598 "objectType": "MetadataAnswer",599 "dataType": "Integer",600 "value": 1,601 "label": {602 "ptBR": {603 "extends": "StudioObject",604 "objectType": "Label",605 "oid": "",606 "plainText": "Não se aplica",607 "formattedText": "Não se aplica"608 },609 "enUS": {610 "extends": "StudioObject",611 "objectType": "Label",612 "oid": "",613 "plainText": "",614 "formattedText": ""615 },616 "esES": {617 "extends": "StudioObject",618 "objectType": "Label",619 "oid": "",620 "plainText": "",621 "formattedText": ""622 }623 }624 }, {625 "extends": "StudioObject",626 "objectType": "MetadataAnswer",627 "dataType": "Integer",628 "value": 2,629 "label": {630 "ptBR": {631 "extends": "StudioObject",632 "objectType": "Label",633 "oid": "",634 "plainText": "Não quer responder",635 "formattedText": "Não quer responder"636 },637 "enUS": {638 "extends": "StudioObject",639 "objectType": "Label",640 "oid": "",641 "plainText": "",642 "formattedText": ""643 },644 "esES": {645 "extends": "StudioObject",646 "objectType": "Label",647 "oid": "",648 "plainText": "",649 "formattedText": ""650 }651 }652 }, {653 "extends": "StudioObject",654 "objectType": "MetadataAnswer",655 "dataType": "Integer",656 "value": 3,657 "label": {658 "ptBR": {659 "extends": "StudioObject",660 "objectType": "Label",661 "oid": "",662 "plainText": "Não sabe responder",663 "formattedText": "Não sabe responder"664 },665 "enUS": {666 "extends": "StudioObject",667 "objectType": "Label",668 "oid": "",669 "plainText": "",670 "formattedText": ""671 },672 "esES": {673 "extends": "StudioObject",674 "objectType": "Label",675 "oid": "",676 "plainText": "",677 "formattedText": ""678 }679 }680 }]681 },682 "fillingRules": {683 "extends": "StudioObject",684 "objectType": "FillingRules",685 "options": {686 "mandatory": {687 "extends": "StudioObject",688 "objectType": "Rule",689 "validatorType": "mandatory",690 "data": {691 "reference": true692 }693 }694 }695 }696 }, {697 "extents": "SurveyItem",698 "objectType": "SingleSelectionQuestion",699 "templateID": "CAD5",700 "customID": "CAD5",701 "dataType": "Integer",702 "label": {703 "ptBR": {704 "extends": "StudioObject",705 "objectType": "Label",706 "oid": "",707 "plainText": "5.  Qual é a sua nacionalidade?",708 "formattedText": "5. &nbsp;Qual é a sua nacionalidade?"709 },710 "enUS": {711 "extends": "StudioObject",712 "objectType": "Label",713 "oid": "",714 "plainText": "",715 "formattedText": ""716 },717 "esES": {718 "extends": "StudioObject",719 "objectType": "Label",720 "oid": "",721 "plainText": "",722 "formattedText": ""723 }724 },725 "options": [{726 "extents": "StudioObject",727 "objectType": "AnswerOption",728 "value": 1,729 "dataType": "Integer",730 "label": {731 "ptBR": {732 "extends": "StudioObject",733 "objectType": "Label",734 "oid": "",735 "plainText": "Brasileira",736 "formattedText": "Brasileira"737 },738 "enUS": {739 "extends": "StudioObject",740 "objectType": "Label",741 "oid": "",742 "plainText": "",743 "formattedText": ""744 },745 "esES": {746 "extends": "StudioObject",747 "objectType": "Label",748 "oid": "",749 "plainText": "",750 "formattedText": ""751 }752 }753 }, {754 "extents": "StudioObject",755 "objectType": "AnswerOption",756 "value": 2,757 "dataType": "Integer",758 "label": {759 "ptBR": {760 "extends": "StudioObject",761 "objectType": "Label",762 "oid": "",763 "plainText": "Outra",764 "formattedText": "Outra"765 },766 "enUS": {767 "extends": "StudioObject",768 "objectType": "Label",769 "oid": "",770 "plainText": "",771 "formattedText": ""772 },773 "esES": {774 "extends": "StudioObject",775 "objectType": "Label",776 "oid": "",777 "plainText": "",778 "formattedText": ""779 }780 }781 }],782 "metadata": {783 "extents": "StudioObject",784 "objectType": "MetadataGroup",785 "options": [{786 "extends": "StudioObject",787 "objectType": "MetadataAnswer",788 "dataType": "Integer",789 "value": 1,790 "label": {791 "ptBR": {792 "extends": "StudioObject",793 "objectType": "Label",794 "oid": "",795 "plainText": "Não se aplica",796 "formattedText": "Não se aplica"797 },798 "enUS": {799 "extends": "StudioObject",800 "objectType": "Label",801 "oid": "",802 "plainText": "",803 "formattedText": ""804 },805 "esES": {806 "extends": "StudioObject",807 "objectType": "Label",808 "oid": "",809 "plainText": "",810 "formattedText": ""811 }812 }813 }, {814 "extends": "StudioObject",815 "objectType": "MetadataAnswer",816 "dataType": "Integer",817 "value": 2,818 "label": {819 "ptBR": {820 "extends": "StudioObject",821 "objectType": "Label",822 "oid": "",823 "plainText": "Não quer responder",824 "formattedText": "Não quer responder"825 },826 "enUS": {827 "extends": "StudioObject",828 "objectType": "Label",829 "oid": "",830 "plainText": "",831 "formattedText": ""832 },833 "esES": {834 "extends": "StudioObject",835 "objectType": "Label",836 "oid": "",837 "plainText": "",838 "formattedText": ""839 }840 }841 }, {842 "extends": "StudioObject",843 "objectType": "MetadataAnswer",844 "dataType": "Integer",845 "value": 3,846 "label": {847 "ptBR": {848 "extends": "StudioObject",849 "objectType": "Label",850 "oid": "",851 "plainText": "Não sabe responder",852 "formattedText": "Não sabe responder"853 },854 "enUS": {855 "extends": "StudioObject",856 "objectType": "Label",857 "oid": "",858 "plainText": "",859 "formattedText": ""860 },861 "esES": {862 "extends": "StudioObject",863 "objectType": "Label",864 "oid": "",865 "plainText": "",866 "formattedText": ""867 }868 }869 }]870 },871 "fillingRules": {872 "extends": "StudioObject",873 "objectType": "FillingRules",874 "options": {875 "mandatory": {876 "extends": "StudioObject",877 "objectType": "Rule",878 "validatorType": "mandatory",879 "data": {880 "reference": true881 }882 }883 }884 }885 }, {886 "extents": "SurveyItem",887 "objectType": "TextQuestion",888 "templateID": "CAD6",889 "customID": "CAD6",890 "dataType": "String",891 "label": {892 "ptBR": {893 "extends": "StudioObject",894 "objectType": "Label",895 "oid": "",896 "plainText": "6. Qual outra?",897 "formattedText": "6. Qual outra?"898 },899 "enUS": {900 "extends": "StudioObject",901 "objectType": "Label",902 "oid": "",903 "plainText": "",904 "formattedText": ""905 },906 "esES": {907 "extends": "StudioObject",908 "objectType": "Label",909 "oid": "",910 "plainText": "",911 "formattedText": ""912 }913 },914 "metadata": {915 "extents": "StudioObject",916 "objectType": "MetadataGroup",917 "options": [{918 "extends": "StudioObject",919 "objectType": "MetadataAnswer",920 "dataType": "Integer",921 "value": 1,922 "label": {923 "ptBR": {924 "extends": "StudioObject",925 "objectType": "Label",926 "oid": "",927 "plainText": "Não se aplica",928 "formattedText": "Não se aplica"929 },930 "enUS": {931 "extends": "StudioObject",932 "objectType": "Label",933 "oid": "",934 "plainText": "",935 "formattedText": ""936 },937 "esES": {938 "extends": "StudioObject",939 "objectType": "Label",940 "oid": "",941 "plainText": "",942 "formattedText": ""943 }944 }945 }, {946 "extends": "StudioObject",947 "objectType": "MetadataAnswer",948 "dataType": "Integer",949 "value": 2,950 "label": {951 "ptBR": {952 "extends": "StudioObject",953 "objectType": "Label",954 "oid": "",955 "plainText": "Não quer responder",956 "formattedText": "Não quer responder"957 },958 "enUS": {959 "extends": "StudioObject",960 "objectType": "Label",961 "oid": "",962 "plainText": "",963 "formattedText": ""964 },965 "esES": {966 "extends": "StudioObject",967 "objectType": "Label",968 "oid": "",969 "plainText": "",970 "formattedText": ""971 }972 }973 }, {974 "extends": "StudioObject",975 "objectType": "MetadataAnswer",976 "dataType": "Integer",977 "value": 3,978 "label": {979 "ptBR": {980 "extends": "StudioObject",981 "objectType": "Label",982 "oid": "",983 "plainText": "Não sabe responder",984 "formattedText": "Não sabe responder"985 },986 "enUS": {987 "extends": "StudioObject",988 "objectType": "Label",989 "oid": "",990 "plainText": "",991 "formattedText": ""992 },993 "esES": {994 "extends": "StudioObject",995 "objectType": "Label",996 "oid": "",997 "plainText": "",998 "formattedText": ""999 }1000 }1001 }]1002 },1003 "fillingRules": {1004 "extends": "StudioObject",1005 "objectType": "FillingRules",1006 "options": {1007 "mandatory": {1008 "extends": "StudioObject",1009 "objectType": "Rule",1010 "validatorType": "mandatory",1011 "data": {1012 "reference": true1013 }1014 }1015 }1016 }1017 }, {1018 "extents": "SurveyItem",1019 "objectType": "SingleSelectionQuestion",1020 "templateID": "CAD7",1021 "customID": "CAD7",1022 "dataType": "Integer",1023 "label": {1024 "ptBR": {1025 "extends": "StudioObject",1026 "objectType": "Label",1027 "oid": "",1028 "plainText": "7. Você deseja fazer parte do estudo?",1029 "formattedText": "7. Você deseja fazer parte do estudo?"1030 },1031 "enUS": {1032 "extends": "StudioObject",1033 "objectType": "Label",1034 "oid": "",1035 "plainText": "",1036 "formattedText": ""1037 },1038 "esES": {1039 "extends": "StudioObject",1040 "objectType": "Label",1041 "oid": "",1042 "plainText": "",1043 "formattedText": ""1044 }1045 },1046 "options": [{1047 "extents": "StudioObject",1048 "objectType": "AnswerOption",1049 "value": 1,1050 "dataType": "Integer",1051 "label": {1052 "ptBR": {1053 "extends": "StudioObject",1054 "objectType": "Label",1055 "oid": "",1056 "plainText": "Não",1057 "formattedText": "Não"1058 },1059 "enUS": {1060 "extends": "StudioObject",1061 "objectType": "Label",1062 "oid": "",1063 "plainText": "",1064 "formattedText": ""1065 },1066 "esES": {1067 "extends": "StudioObject",1068 "objectType": "Label",1069 "oid": "",1070 "plainText": "",1071 "formattedText": ""1072 }1073 }1074 }, {1075 "extents": "StudioObject",1076 "objectType": "AnswerOption",1077 "value": 2,1078 "dataType": "Integer",1079 "label": {1080 "ptBR": {1081 "extends": "StudioObject",1082 "objectType": "Label",1083 "oid": "",1084 "plainText": "Sim",1085 "formattedText": "Sim"1086 },1087 "enUS": {1088 "extends": "StudioObject",1089 "objectType": "Label",1090 "oid": "",1091 "plainText": "",1092 "formattedText": ""1093 },1094 "esES": {1095 "extends": "StudioObject",1096 "objectType": "Label",1097 "oid": "",1098 "plainText": "",1099 "formattedText": ""1100 }1101 }1102 }],1103 "metadata": {1104 "extents": "StudioObject",1105 "objectType": "MetadataGroup",1106 "options": [{1107 "extends": "StudioObject",1108 "objectType": "MetadataAnswer",1109 "dataType": "Integer",1110 "value": 1,1111 "label": {1112 "ptBR": {1113 "extends": "StudioObject",1114 "objectType": "Label",1115 "oid": "",1116 "plainText": "Não se aplica",1117 "formattedText": "Não se aplica"1118 },1119 "enUS": {1120 "extends": "StudioObject",1121 "objectType": "Label",1122 "oid": "",1123 "plainText": "",1124 "formattedText": ""1125 },1126 "esES": {1127 "extends": "StudioObject",1128 "objectType": "Label",1129 "oid": "",1130 "plainText": "",1131 "formattedText": ""1132 }1133 }1134 }, {1135 "extends": "StudioObject",1136 "objectType": "MetadataAnswer",1137 "dataType": "Integer",1138 "value": 2,1139 "label": {1140 "ptBR": {1141 "extends": "StudioObject",1142 "objectType": "Label",1143 "oid": "",1144 "plainText": "Não sabe responder",1145 "formattedText": "Não sabe responder"1146 },1147 "enUS": {1148 "extends": "StudioObject",1149 "objectType": "Label",1150 "oid": "",1151 "plainText": "",1152 "formattedText": ""1153 },1154 "esES": {1155 "extends": "StudioObject",1156 "objectType": "Label",1157 "oid": "",1158 "plainText": "",1159 "formattedText": ""1160 }1161 }1162 }]1163 },1164 "fillingRules": {1165 "extends": "StudioObject",1166 "objectType": "FillingRules",1167 "options": {1168 "mandatory": {1169 "extends": "StudioObject",1170 "objectType": "Rule",1171 "validatorType": "mandatory",1172 "data": {1173 "reference": true1174 }1175 }1176 }1177 }1178 }, {1179 "extents": "SurveyItem",1180 "objectType": "CheckboxQuestion",1181 "templateID": "CAD8",1182 "customID": "CAD8",1183 "dataType": "Array",1184 "label": {1185 "ptBR": {1186 "extends": "StudioObject",1187 "objectType": "Label",1188 "oid": "",1189 "plainText": "8. Por favor, assinale as razões para participar, como voluntário, do estudo:",1190 "formattedText": "8. Por favor, assinale as razões para participar, como voluntário, do estudo:"1191 },1192 "enUS": {1193 "extends": "StudioObject",1194 "objectType": "Label",1195 "oid": "",1196 "plainText": "",1197 "formattedText": ""1198 },1199 "esES": {1200 "extends": "StudioObject",1201 "objectType": "Label",1202 "oid": "",1203 "plainText": "",1204 "formattedText": ""1205 }1206 },1207 "options": [{1208 "extents": "StudioObject",1209 "objectType": "CheckboxAnswerOption",1210 "dataType": "Boolean",1211 "label": {1212 "ptBR": {1213 "extends": "StudioObject",1214 "objectType": "Label",1215 "oid": "",1216 "plainText": "Irá auxiliar em minha formação",1217 "formattedText": "Irá auxiliar em minha formação"1218 },1219 "enUS": {1220 "extends": "StudioObject",1221 "objectType": "Label",1222 "oid": "",1223 "plainText": "",1224 "formattedText": ""1225 },1226 "esES": {1227 "extends": "StudioObject",1228 "objectType": "Label",1229 "oid": "",1230 "plainText": "",1231 "formattedText": ""1232 }1233 }1234 }, {1235 "extents": "StudioObject",1236 "objectType": "CheckboxAnswerOption",1237 "dataType": "Boolean",1238 "label": {1239 "ptBR": {1240 "extends": "StudioObject",1241 "objectType": "Label",1242 "oid": "",1243 "plainText": "Experiência em campo",1244 "formattedText": "Experiência em campo"1245 },1246 "enUS": {1247 "extends": "StudioObject",1248 "objectType": "Label",1249 "oid": "",1250 "plainText": "",1251 "formattedText": ""1252 },1253 "esES": {1254 "extends": "StudioObject",1255 "objectType": "Label",1256 "oid": "",1257 "plainText": "",1258 "formattedText": ""1259 }1260 }1261 }, {1262 "extents": "StudioObject",1263 "objectType": "CheckboxAnswerOption",1264 "dataType": "Boolean",1265 "label": {1266 "ptBR": {1267 "extends": "StudioObject",1268 "objectType": "Label",1269 "oid": "",1270 "plainText": "Curiosidade",1271 "formattedText": "Curiosidade"1272 },1273 "enUS": {1274 "extends": "StudioObject",1275 "objectType": "Label",1276 "oid": "",1277 "plainText": "",1278 "formattedText": ""1279 },1280 "esES": {1281 "extends": "StudioObject",1282 "objectType": "Label",1283 "oid": "",1284 "plainText": "",1285 "formattedText": ""1286 }1287 }1288 }, {1289 "extents": "StudioObject",1290 "objectType": "CheckboxAnswerOption",1291 "dataType": "Boolean",1292 "label": {1293 "ptBR": {1294 "extends": "StudioObject",1295 "objectType": "Label",1296 "oid": "",1297 "plainText": "Apenas preciso cumprir carga horária complementar em meu curso",1298 "formattedText": "Apenas preciso cumprir carga horária complementar em meu curso"1299 },1300 "enUS": {1301 "extends": "StudioObject",1302 "objectType": "Label",1303 "oid": "",1304 "plainText": "",1305 "formattedText": ""1306 },1307 "esES": {1308 "extends": "StudioObject",1309 "objectType": "Label",1310 "oid": "",1311 "plainText": "",1312 "formattedText": ""1313 }1314 }1315 }, {1316 "extents": "StudioObject",1317 "objectType": "CheckboxAnswerOption",1318 "dataType": "Boolean",1319 "label": {1320 "ptBR": {1321 "extends": "StudioObject",1322 "objectType": "Label",1323 "oid": "",1324 "plainText": "Interesse em seguir pesquisando o tema",1325 "formattedText": "Interesse em seguir pesquisando o tema"1326 },1327 "enUS": {1328 "extends": "StudioObject",1329 "objectType": "Label",1330 "oid": "",1331 "plainText": "",1332 "formattedText": ""1333 },1334 "esES": {1335 "extends": "StudioObject",1336 "objectType": "Label",1337 "oid": "",1338 "plainText": "",1339 "formattedText": ""1340 }1341 }1342 }, {1343 "extents": "StudioObject",1344 "objectType": "CheckboxAnswerOption",1345 "dataType": "Boolean",1346 "label": {1347 "ptBR": {1348 "extends": "StudioObject",1349 "objectType": "Label",1350 "oid": "",1351 "plainText": "Outro",1352 "formattedText": "Outro"1353 },1354 "enUS": {1355 "extends": "StudioObject",1356 "objectType": "Label",1357 "oid": "",1358 "plainText": "",1359 "formattedText": ""1360 },1361 "esES": {1362 "extends": "StudioObject",1363 "objectType": "Label",1364 "oid": "",1365 "plainText": "",1366 "formattedText": ""1367 }1368 }1369 }],1370 "metadata": {1371 "extents": "StudioObject",1372 "objectType": "MetadataGroup",1373 "options": [{1374 "extends": "StudioObject",1375 "objectType": "MetadataAnswer",1376 "dataType": "Integer",1377 "value": 1,1378 "label": {1379 "ptBR": {1380 "extends": "StudioObject",1381 "objectType": "Label",1382 "oid": "",1383 "plainText": "Não sabe responder",1384 "formattedText": "Não sabe responder"1385 },1386 "enUS": {1387 "extends": "StudioObject",1388 "objectType": "Label",1389 "oid": "",1390 "plainText": "",1391 "formattedText": ""1392 },1393 "esES": {1394 "extends": "StudioObject",1395 "objectType": "Label",1396 "oid": "",1397 "plainText": "",1398 "formattedText": ""1399 }1400 }1401 }, {1402 "extends": "StudioObject",1403 "objectType": "MetadataAnswer",1404 "dataType": "Integer",1405 "value": 2,1406 "label": {1407 "ptBR": {1408 "extends": "StudioObject",1409 "objectType": "Label",1410 "oid": "",1411 "plainText": "Não quer responder",1412 "formattedText": "Não quer responder"1413 },1414 "enUS": {1415 "extends": "StudioObject",1416 "objectType": "Label",1417 "oid": "",1418 "plainText": "",1419 "formattedText": ""1420 },1421 "esES": {1422 "extends": "StudioObject",1423 "objectType": "Label",1424 "oid": "",1425 "plainText": "",1426 "formattedText": ""1427 }1428 }1429 }]1430 },1431 "fillingRules": {1432 "extends": "StudioObject",1433 "objectType": "FillingRules",1434 "options": {1435 "mandatory": {1436 "extends": "StudioObject",1437 "objectType": "Rule",1438 "validatorType": "mandatory",1439 "data": {1440 "reference": true1441 }1442 }1443 }1444 }1445 }, {1446 "extents": "SurveyItem",1447 "objectType": "TextQuestion",1448 "templateID": "CAD9",1449 "customID": "CAD9",1450 "dataType": "String",1451 "label": {1452 "ptBR": {1453 "extends": "StudioObject",1454 "objectType": "Label",1455 "oid": "",1456 "plainText": "9. Qual a outra razão?",1457 "formattedText": "9. Qual a outra razão?"1458 },1459 "enUS": {1460 "extends": "StudioObject",1461 "objectType": "Label",1462 "oid": "",1463 "plainText": "",1464 "formattedText": ""1465 },1466 "esES": {1467 "extends": "StudioObject",1468 "objectType": "Label",1469 "oid": "",1470 "plainText": "",1471 "formattedText": ""1472 }1473 },1474 "metadata": {1475 "extents": "StudioObject",1476 "objectType": "MetadataGroup",1477 "options": []1478 },1479 "fillingRules": {1480 "extends": "StudioObject",1481 "objectType": "FillingRules",1482 "options": {1483 "mandatory": {1484 "extends": "StudioObject",1485 "objectType": "Rule",1486 "validatorType": "mandatory",1487 "data": {1488 "reference": true1489 }1490 }1491 }1492 }1493 }, {1494 "extents": "SurveyItem",1495 "objectType": "SingleSelectionQuestion",1496 "templateID": "CAD10",1497 "customID": "CAD10",1498 "dataType": "Integer",1499 "label": {1500 "ptBR": {1501 "extends": "StudioObject",1502 "objectType": "Label",1503 "oid": "",1504 "plainText": "10. Classifique de 1 a 5 sua satisfação com esse formulário:nn1 - Nada satisfeito (a)n3 - Satisfeito (a)n5 - Muito satisfeito (a)n",1505 "formattedText": "<span style='letter-spacing: 0.14px;'>10. Classifique de 1 a 5 sua satisfação com esse formulário:</span><div style='letter-spacing: 0.14px;'><br>1 - Nada satisfeito (a)<div>3 - Satisfeito (a)</div><div>5 - Muito satisfeito (a)</div></div>"1506 },1507 "enUS": {1508 "extends": "StudioObject",1509 "objectType": "Label",1510 "oid": "",1511 "plainText": "",1512 "formattedText": ""1513 },1514 "esES": {1515 "extends": "StudioObject",1516 "objectType": "Label",1517 "oid": "",1518 "plainText": "",1519 "formattedText": ""1520 }1521 },1522 "options": [{1523 "extents": "StudioObject",1524 "objectType": "AnswerOption",1525 "value": 1,1526 "dataType": "Integer",1527 "label": {1528 "ptBR": {1529 "extends": "StudioObject",1530 "objectType": "Label",1531 "oid": "",1532 "plainText": "1",1533 "formattedText": "1"1534 },1535 "enUS": {1536 "extends": "StudioObject",1537 "objectType": "Label",1538 "oid": "",1539 "plainText": "",1540 "formattedText": ""1541 },1542 "esES": {1543 "extends": "StudioObject",1544 "objectType": "Label",1545 "oid": "",1546 "plainText": "",1547 "formattedText": ""1548 }1549 }1550 }, {1551 "extents": "StudioObject",1552 "objectType": "AnswerOption",1553 "value": 2,1554 "dataType": "Integer",1555 "label": {1556 "ptBR": {1557 "extends": "StudioObject",1558 "objectType": "Label",1559 "oid": "",1560 "plainText": "2",1561 "formattedText": "2"1562 },1563 "enUS": {1564 "extends": "StudioObject",1565 "objectType": "Label",1566 "oid": "",1567 "plainText": "",1568 "formattedText": ""1569 },1570 "esES": {1571 "extends": "StudioObject",1572 "objectType": "Label",1573 "oid": "",1574 "plainText": "",1575 "formattedText": ""1576 }1577 }1578 }, {1579 "extents": "StudioObject",1580 "objectType": "AnswerOption",1581 "value": 3,1582 "dataType": "Integer",1583 "label": {1584 "ptBR": {1585 "extends": "StudioObject",1586 "objectType": "Label",1587 "oid": "",1588 "plainText": "3",1589 "formattedText": "3"1590 },1591 "enUS": {1592 "extends": "StudioObject",1593 "objectType": "Label",1594 "oid": "",1595 "plainText": "",1596 "formattedText": ""1597 },1598 "esES": {1599 "extends": "StudioObject",1600 "objectType": "Label",1601 "oid": "",1602 "plainText": "",1603 "formattedText": ""1604 }1605 }1606 }, {1607 "extents": "StudioObject",1608 "objectType": "AnswerOption",1609 "value": 4,1610 "dataType": "Integer",1611 "label": {1612 "ptBR": {1613 "extends": "StudioObject",1614 "objectType": "Label",1615 "oid": "",1616 "plainText": "4",1617 "formattedText": "4"1618 },1619 "enUS": {1620 "extends": "StudioObject",1621 "objectType": "Label",1622 "oid": "",1623 "plainText": "",1624 "formattedText": ""1625 },1626 "esES": {1627 "extends": "StudioObject",1628 "objectType": "Label",1629 "oid": "",1630 "plainText": "",1631 "formattedText": ""1632 }1633 }1634 }, {1635 "extents": "StudioObject",1636 "objectType": "AnswerOption",1637 "value": 5,1638 "dataType": "Integer",1639 "label": {1640 "ptBR": {1641 "extends": "StudioObject",1642 "objectType": "Label",1643 "oid": "",1644 "plainText": "5",1645 "formattedText": "5"1646 },1647 "enUS": {1648 "extends": "StudioObject",1649 "objectType": "Label",1650 "oid": "",1651 "plainText": "",1652 "formattedText": ""1653 },1654 "esES": {1655 "extends": "StudioObject",1656 "objectType": "Label",1657 "oid": "",1658 "plainText": "",1659 "formattedText": ""1660 }1661 }1662 }],1663 "metadata": {1664 "extents": "StudioObject",1665 "objectType": "MetadataGroup",1666 "options": []1667 },1668 "fillingRules": {1669 "extends": "StudioObject",1670 "objectType": "FillingRules",1671 "options": {1672 "mandatory": {1673 "extends": "StudioObject",1674 "objectType": "Rule",1675 "validatorType": "mandatory",1676 "data": {1677 "reference": true1678 }1679 }1680 }1681 }1682 }, {1683 "extents": "SurveyItem",1684 "objectType": "ImageItem",1685 "templateID": "CAD11",1686 "customID": "CAD11",1687 "dataType": "String",1688 "url": "https://i.ytimg.com/vi/_1CF2IWZGZo/maxresdefault.jpg",1689 "footer": {1690 "ptBR": {1691 "extends": "StudioObject",1692 "objectType": "Label",1693 "oid": "",1694 "plainText": "Poxa...",1695 "formattedText": "Poxa..."1696 },1697 "enUS": {1698 "extends": "StudioObject",1699 "objectType": "Label",1700 "oid": "",1701 "plainText": "",1702 "formattedText": ""1703 },1704 "esES": {1705 "extends": "StudioObject",1706 "objectType": "Label",1707 "oid": "",1708 "plainText": "",1709 "formattedText": ""1710 }1711 }1712 }, {1713 "extents": "SurveyItem",1714 "objectType": "ImageItem",1715 "templateID": "CAD12",1716 "customID": "CAD12",1717 "dataType": "String",1718 "url": "http://bolaof1.com.br/imagens/memes/neutral-poker-face-no-text.jpg",1719 "footer": {1720 "ptBR": {1721 "extends": "StudioObject",1722 "objectType": "Label",1723 "oid": "",1724 "plainText": ":S",1725 "formattedText": ":S"1726 },1727 "enUS": {1728 "extends": "StudioObject",1729 "objectType": "Label",1730 "oid": "",1731 "plainText": "",1732 "formattedText": ""1733 },1734 "esES": {1735 "extends": "StudioObject",1736 "objectType": "Label",1737 "oid": "",1738 "plainText": "",1739 "formattedText": ""1740 }1741 }1742 }, {1743 "extents": "SurveyItem",1744 "objectType": "ImageItem",1745 "templateID": "CAD13",1746 "customID": "CAD13",1747 "dataType": "String",1748 "url": "http://kingofwallpapers.com/happy/happy-001.jpg",1749 "footer": {1750 "ptBR": {1751 "extends": "StudioObject",1752 "objectType": "Label",1753 "oid": "",1754 "plainText": "Uhuu!",1755 "formattedText": "Uhuu!"1756 },1757 "enUS": {1758 "extends": "StudioObject",1759 "objectType": "Label",1760 "oid": "",1761 "plainText": "",1762 "formattedText": ""1763 },1764 "esES": {1765 "extends": "StudioObject",1766 "objectType": "Label",1767 "oid": "",1768 "plainText": "",1769 "formattedText": ""1770 }1771 }1772 }, {1773 "extents": "SurveyItem",1774 "objectType": "TextItem",1775 "templateID": "CAD14",1776 "customID": "CAD14",1777 "dataType": "String",1778 "value": {1779 "ptBR": {1780 "extends": "StudioObject",1781 "objectType": "Label",1782 "oid": "",1783 "plainText": "Vlw flw",1784 "formattedText": "Vlw flw"1785 },1786 "enUS": {1787 "extends": "StudioObject",1788 "objectType": "Label",1789 "oid": "",1790 "plainText": "",1791 "formattedText": ""1792 },1793 "esES": {1794 "extends": "StudioObject",1795 "objectType": "Label",1796 "oid": "",1797 "plainText": "",1798 "formattedText": ""1799 }1800 }1801 }, {1802 "extents": "SurveyItem",1803 "objectType": "IntegerQuestion",1804 "templateID": "CAD15",1805 "customID": "CAD15",1806 "dataType": "Integer",1807 "label": {1808 "ptBR": {1809 "extends": "StudioObject",1810 "objectType": "Label",1811 "oid": "",1812 "plainText": "",1813 "formattedText": ""1814 },1815 "enUS": {1816 "extends": "StudioObject",1817 "objectType": "Label",1818 "oid": "",1819 "plainText": "",1820 "formattedText": ""1821 },1822 "esES": {1823 "extends": "StudioObject",1824 "objectType": "Label",1825 "oid": "",1826 "plainText": "",1827 "formattedText": ""1828 }1829 },1830 "metadata": {1831 "extents": "StudioObject",1832 "objectType": "MetadataGroup",1833 "options": []1834 },1835 "unit": {1836 "ptBR": {1837 "extends": "StudioObject",1838 "objectType": "Unit",1839 "oid": "",1840 "plainText": "",1841 "formattedText": ""1842 },1843 "enUS": {1844 "extends": "StudioObject",1845 "objectType": "Unit",1846 "oid": "",1847 "plainText": "",1848 "formattedText": ""1849 },1850 "esES": {1851 "extends": "StudioObject",1852 "objectType": "Unit",1853 "oid": "",1854 "plainText": "",1855 "formattedText": ""1856 }1857 },1858 "fillingRules": {1859 "extends": "StudioObject",1860 "objectType": "FillingRules",1861 "options": {1862 "mandatory": {1863 "extends": "StudioObject",1864 "objectType": "Rule",1865 "validatorType": "mandatory",1866 "data": {1867 "reference": false1868 }1869 },1870 "lowerLimit": {1871 "extends": "StudioObject",1872 "objectType": "Rule",1873 "validatorType": "lowerLimit",1874 "data": {1875 "reference": null1876 }1877 }1878 }1879 }1880 }],1881 "navigationList": [{1882 "extents": "StudioObject",1883 "objectType": "Navigation",1884 "origin": "CAD1",1885 "index": 0,1886 "inNavigations": [],1887 "isDefault": true,1888 "routes": [{1889 "extents": "StudioObject",1890 "objectType": "Route",1891 "name": "CAD1_CAD2",1892 "origin": "CAD1",1893 "destination": "CAD2",1894 "isDefault": true,1895 "conditions": []1896 }]1897 }, {1898 "extents": "StudioObject",1899 "objectType": "Navigation",1900 "origin": "CAD2",1901 "index": 1,1902 "inNavigations": [{1903 "origin": "CAD1",1904 "isDefaultPath": true,1905 "isDefaultRoute": true1906 }],1907 "isDefault": true,1908 "routes": [{1909 "extents": "StudioObject",1910 "objectType": "Route",1911 "name": "CAD2_CAD3",1912 "origin": "CAD2",1913 "destination": "CAD3",1914 "isDefault": true,1915 "conditions": []1916 }]1917 }, {1918 "extents": "StudioObject",1919 "objectType": "Navigation",1920 "origin": "CAD3",1921 "index": 2,1922 "inNavigations": [{1923 "origin": "CAD2",1924 "isDefaultPath": true,1925 "isDefaultRoute": true1926 }],1927 "isDefault": true,1928 "routes": [{1929 "extents": "StudioObject",1930 "objectType": "Route",1931 "name": "CAD3_CAD4",1932 "origin": "CAD3",1933 "destination": "CAD4",1934 "isDefault": true,1935 "conditions": []1936 }]1937 }, {1938 "extents": "StudioObject",1939 "objectType": "Navigation",1940 "origin": "CAD4",1941 "index": 3,1942 "inNavigations": [{1943 "origin": "CAD3",1944 "isDefaultPath": true,1945 "isDefaultRoute": true1946 }],1947 "isDefault": true,1948 "routes": [{1949 "extents": "StudioObject",1950 "objectType": "Route",1951 "name": "CAD4_CAD5",1952 "origin": "CAD4",1953 "destination": "CAD5",1954 "isDefault": true,1955 "conditions": []1956 }]1957 }, {1958 "extents": "StudioObject",1959 "objectType": "Navigation",1960 "origin": "CAD5",1961 "index": 4,1962 "inNavigations": [{1963 "origin": "CAD4",1964 "isDefaultPath": true,1965 "isDefaultRoute": true1966 }],1967 "isDefault": true,1968 "routes": [{1969 "extents": "StudioObject",1970 "objectType": "Route",1971 "name": "CAD5_CAD6",1972 "origin": "CAD5",1973 "destination": "CAD6",1974 "isDefault": true,1975 "conditions": []1976 }]1977 }, {1978 "extents": "StudioObject",1979 "objectType": "Navigation",1980 "origin": "CAD6",1981 "index": 5,1982 "inNavigations": [{1983 "origin": "CAD5",1984 "isDefaultPath": true,1985 "isDefaultRoute": true1986 }],1987 "isDefault": true,1988 "routes": [{1989 "extents": "StudioObject",1990 "objectType": "Route",1991 "name": "CAD6_CAD7",1992 "origin": "CAD6",1993 "destination": "CAD7",1994 "isDefault": true,1995 "conditions": []1996 }]1997 }, {1998 "extents": "StudioObject",1999 "objectType": "Navigation",2000 "origin": "CAD7",2001 "index": 6,2002 "inNavigations": [{2003 "origin": "CAD6",2004 "isDefaultPath": true,2005 "isDefaultRoute": true2006 }],2007 "isDefault": true,2008 "routes": [{2009 "extents": "StudioObject",2010 "objectType": "Route",2011 "name": "CAD7_CAD8",2012 "origin": "CAD7",2013 "destination": "CAD8",2014 "isDefault": true,2015 "conditions": []2016 }]2017 }, {2018 "extents": "StudioObject",2019 "objectType": "Navigation",2020 "origin": "CAD8",2021 "index": 7,2022 "inNavigations": [{2023 "origin": "CAD7",2024 "isDefaultPath": true,2025 "isDefaultRoute": true2026 }],2027 "isDefault": true,2028 "routes": [{2029 "extents": "StudioObject",2030 "objectType": "Route",2031 "name": "CAD8_CAD9",2032 "origin": "CAD8",2033 "destination": "CAD9",2034 "isDefault": true,2035 "conditions": []2036 }]2037 }, {2038 "extents": "StudioObject",2039 "objectType": "Navigation",2040 "origin": "CAD9",2041 "index": 8,2042 "inNavigations": [{2043 "origin": "CAD8",2044 "isDefaultPath": true,2045 "isDefaultRoute": true2046 }],2047 "isDefault": true,2048 "routes": [{2049 "extents": "StudioObject",2050 "objectType": "Route",2051 "name": "CAD9_CAD10",2052 "origin": "CAD9",2053 "destination": "CAD10",2054 "isDefault": true,2055 "conditions": []2056 }]2057 }, {2058 "extents": "StudioObject",2059 "objectType": "Navigation",2060 "origin": "CAD10",2061 "index": 9,2062 "inNavigations": [{2063 "origin": "CAD9",2064 "isDefaultPath": true,2065 "isDefaultRoute": true2066 }],2067 "isDefault": true,2068 "routes": [{2069 "extents": "StudioObject",2070 "objectType": "Route",2071 "name": "CAD10_CAD11",2072 "origin": "CAD10",2073 "destination": "CAD11",2074 "isDefault": true,2075 "conditions": []2076 }]2077 }, {2078 "extents": "StudioObject",2079 "objectType": "Navigation",2080 "origin": "CAD11",2081 "index": 10,2082 "inNavigations": [{2083 "origin": "CAD10",2084 "isDefaultPath": true,2085 "isDefaultRoute": true2086 }],2087 "isDefault": true,2088 "routes": [{2089 "extents": "StudioObject",2090 "objectType": "Route",2091 "name": "CAD11_CAD12",2092 "origin": "CAD11",2093 "destination": "CAD12",2094 "isDefault": true,2095 "conditions": []2096 }]2097 }, {2098 "extents": "StudioObject",2099 "objectType": "Navigation",2100 "origin": "CAD12",2101 "index": 11,2102 "inNavigations": [{2103 "origin": "CAD11",2104 "isDefaultPath": true,2105 "isDefaultRoute": true2106 }],2107 "isDefault": true,2108 "routes": [{2109 "extents": "StudioObject",2110 "objectType": "Route",2111 "name": "CAD12_CAD13",2112 "origin": "CAD12",2113 "destination": "CAD13",2114 "isDefault": true,2115 "conditions": []2116 }]2117 }, {2118 "extents": "StudioObject",2119 "objectType": "Navigation",2120 "origin": "CAD13",2121 "index": 12,2122 "inNavigations": [{2123 "origin": "CAD12",2124 "isDefaultPath": true,2125 "isDefaultRoute": true2126 }],2127 "isDefault": true,2128 "routes": [{2129 "extents": "StudioObject",2130 "objectType": "Route",2131 "name": "CAD13_CAD14",2132 "origin": "CAD13",2133 "destination": "CAD14",2134 "isDefault": true,2135 "conditions": []2136 }]2137 }, {2138 "extents": "StudioObject",2139 "objectType": "Navigation",2140 "origin": "CAD14",2141 "index": 13,2142 "inNavigations": [{2143 "origin": "CAD13",2144 "isDefaultPath": true,2145 "isDefaultRoute": true2146 }],2147 "isDefault": true,2148 "routes": [{2149 "extents": "StudioObject",2150 "objectType": "Route",2151 "name": "CAD14_CAD15",2152 "origin": "CAD14",2153 "destination": "CAD15",2154 "isDefault": true,2155 "conditions": []2156 }]2157 }]2158 };2159 }2160 Mock.ActivityFacadeService = {2161 getFillingByQuestionID: function () {2162 return {};2163 },2164 getWholeTemplateVariableList: function () {2165 return Promise.resolve();2166 },2167 getGroupByItemID: function () {2168 return Promise.resolve();2169 },2170 surveyActivity: {2171 getGroupByItemID: function () {2172 },2173 getGroupItemsByItemID: function () {2174 }2175 }2176 };...

Full Screen

Full Screen

activity-facade-service-spec.js

Source:activity-facade-service-spec.js Github

copy

Full Screen

1describe('ActivityFacadeService', function () {2 var UNIT_NAME = 'otusjs.player.data.activity.ActivityFacadeService';3 var Mock = {};4 var Injections = {};5 var service = {};6 var CAD1 = 'CAD1';7 var CAD2 = 'CAD2';8 var CAD100 = 'CAD100';9 var ANSWER = 'ANSWER';10 var METADATA = 'METADATA';11 var COMMENT = 'COMMENT';12 beforeEach(function () {13 module('otusjs.player.data');14 inject(function (_$injector_) {15 /* Test data */16 mockSurvey();17 mockAnswerData();18 mockValidationErrorData();19 mockVariableData();20 /* Injectable mocks */21 mockCurrentSurveyService(_$injector_);22 mockCurrentItemService(_$injector_);23 service = _$injector_.get(UNIT_NAME, Injections);24 });25 });26 describe('applyAnswer method', function () {27 it('should delegates the filling applies to current question', function () {28 spyOn(Mock.CurrentItemService, 'applyFilling');29 service.applyAnswer(Mock.answerData);30 expect(Mock.CurrentItemService.applyFilling).toHaveBeenCalledWith();31 });32 });33 describe('attachItemValidationError method', function () {34 it('should delegates the validation error attachment', function () {35 spyOn(Mock.CurrentItemService, 'attachValidationError');36 service.attachItemValidationError(Mock.validationErrorData);37 expect(Mock.CurrentItemService.attachValidationError).toHaveBeenCalledWith(Mock.validationErrorData);38 });39 });40 describe('fetchItemAnswerByCustomID method', function () {41 it('should retrieve the answer of item from survey activity', function () {42 spyOn(Mock.CurrentSurveyService, 'getAnswerByItemID');43 service.fetchItemAnswerByCustomID(CAD1);44 expect(Mock.CurrentSurveyService.getAnswerByItemID).toHaveBeenCalledWith(CAD1);45 });46 });47 describe('fetchItemByID method', function () {48 it('should return the item', function () {49 spyOn(Mock.CurrentSurveyService, 'getItemByTemplateID');50 service.fetchItemByID(CAD1);51 expect(Mock.CurrentSurveyService.getItemByTemplateID).toHaveBeenCalledWith(CAD1);52 });53 });54 describe('initialize method', function () {55 beforeEach(function () {56 spyOn(Mock.CurrentSurveyService, 'initialize');57 spyOn(Mock.CurrentSurveyService, 'getItems').and.returnValue(Mock.surveyTemplate.itemContainer);58 spyOn(Mock.CurrentSurveyService, 'getNavigations').and.returnValue(Mock.surveyTemplate.navigationList);59 });60 it('should initialize the survey', function () {61 service.initialize();62 expect(Mock.CurrentSurveyService.initialize).toHaveBeenCalledWith();63 });64 });65 describe('setupAnswer method', function () {66 it('should delegates the filling of current question', function () {67 spyOn(Mock.CurrentItemService, 'fill');68 service.setupAnswer(Mock.answerData);69 expect(Mock.CurrentItemService.fill).toHaveBeenCalledWith(Mock.answerData);70 });71 });72 describe('getWholeTemplateStaticVariableList method', function () {73 it('should keep a reference to variable into activity module', function () {74 spyOn(Mock.CurrentSurveyService, 'getWholeTemplateStaticVariableList');75 service.getWholeTemplateStaticVariableList();76 expect(Mock.CurrentSurveyService.getWholeTemplateStaticVariableList).toHaveBeenCalledWith();77 });78 });79 it('Methods should fetchItemGroupByID execute', function () {80 spyOn(Mock.CurrentSurveyService, 'getGroupItemsByMemberID');81 service.fetchItemGroupByID(CAD2);82 expect(Mock.CurrentSurveyService.getGroupItemsByMemberID).toHaveBeenCalledWith(CAD2);83 });84 function mockCurrentSurveyService($injector) {85 Mock.CurrentSurveyService = $injector.get('otusjs.player.data.activity.CurrentSurveyService');86 Injections.CurrentSurveyService = Mock.CurrentSurveyService;87 }88 function mockCurrentItemService($injector) {89 Mock.CurrentItemService = $injector.get('otusjs.player.data.activity.CurrentItemService');90 Injections.CurrentItemService = Mock.CurrentItemService;91 }92 function mockAnswerData() {93 Mock.answerData = {};94 Mock.answerData.answer = ANSWER;95 Mock.answerData.metadata = METADATA;96 Mock.answerData.comment = COMMENT;97 }98 function mockValidationErrorData() {99 Mock.validationErrorData = {};100 }101 function mockSurvey() {102 mockSurveyData();103 Mock.surveyTemplate.SurveyItemManager = {};104 Mock.surveyTemplate.SurveyItemManager.getItemList = jasmine.createSpy('getItemList').and.returnValue(Mock.surveyTemplate.itemContainer);105 Mock.surveyTemplate.SurveyItemManager.getItemByTemplateID = jasmine.createSpy('getItemByTemplateID').and.returnValue(Mock.surveyTemplate.itemContainer[1]);106 Mock.CAD1Navigation = Mock.surveyTemplate.navigationList[0];107 Mock.CAD1Navigation.listRoutes = jasmine.createSpy('listRoutes').and.returnValue(Mock.CAD1Navigation.routes);108 Mock.surveyTemplate.NavigationManager = {};109 Mock.surveyTemplate.NavigationManager.getNavigationList = jasmine.createSpy('getNavigationList').and.returnValue(Mock.surveyTemplate.navigationList);110 Mock.surveyTemplate.NavigationManager.selectNavigationByOrigin = jasmine.createSpy('selectNavigationByOrigin').and.returnValue(Mock.CAD1Navigation);111 }112 function mockVariableData() {113 Mock.Variable = [114 {115 "label": "CÓDIGO DO ACTÍGRAFO:",116 "translatedValue": "Sim"117 }118 ];119 }120 function mockSurveyData() {121 Mock.surveyTemplate = {122 "extents": "StudioObject",123 "objectType": "Survey",124 "oid": "dXNlclVVSUQ6W3VuZGVmaW5lZF1zdXJ2ZXlVVUlEOls2YWM5MjJiMC01ZTJiLTExZTYtOGE0ZS01ZGQyNzhhODUzNTddcmVwb3NpdG9yeVVVSUQ6WyBOb3QgZG9uZSB5ZXQgXQ==",125 "identity": {126 "extents": "StudioObject",127 "objectType": "SurveyIdentity",128 "name": "Cadastramento",129 "acronym": "CAD",130 "recommendedTo": "",131 "description": "",132 "keywords": []133 },134 "metainfo": {135 "extents": "StudioObject",136 "objectType": "SurveyMetaInfo",137 "creationDatetime": 1470745124954,138 "otusStudioVersion": ""139 },140 "itemContainer": [{141 "extents": "SurveyItem",142 "objectType": "TextQuestion",143 "templateID": "CAD1",144 "customID": "CAD1",145 "dataType": "String",146 "label": {147 "ptBR": {148 "extends": "StudioObject",149 "objectType": "Label",150 "oid": "",151 "plainText": "1. Qual é o seu nome?",152 "formattedText": "1. Qual é o seu nome?"153 },154 "enUS": {155 "extends": "StudioObject",156 "objectType": "Label",157 "oid": "",158 "plainText": "",159 "formattedText": ""160 },161 "esES": {162 "extends": "StudioObject",163 "objectType": "Label",164 "oid": "",165 "plainText": "",166 "formattedText": ""167 }168 },169 "metadata": {170 "extents": "StudioObject",171 "objectType": "MetadataGroup",172 "options": [{173 "extends": "StudioObject",174 "objectType": "MetadataAnswer",175 "dataType": "Integer",176 "value": 1,177 "label": {178 "ptBR": {179 "extends": "StudioObject",180 "objectType": "Label",181 "oid": "",182 "plainText": "Não quer responder",183 "formattedText": "Não quer responder"184 },185 "enUS": {186 "extends": "StudioObject",187 "objectType": "Label",188 "oid": "",189 "plainText": "",190 "formattedText": ""191 },192 "esES": {193 "extends": "StudioObject",194 "objectType": "Label",195 "oid": "",196 "plainText": "",197 "formattedText": ""198 }199 }200 }]201 },202 "fillingRules": {203 "extends": "StudioObject",204 "objectType": "FillingRules",205 "options": {206 "mandatory": {207 "extends": "StudioObject",208 "objectType": "Rule",209 "validatorType": "mandatory",210 "data": {211 "reference": true212 }213 },214 "minLength": {215 "extends": "StudioObject",216 "objectType": "Rule",217 "validatorType": "minLength",218 "data": {219 "size": null,220 "reference": 5221 }222 }223 }224 }225 }, {226 "extents": "SurveyItem",227 "objectType": "CalendarQuestion",228 "templateID": "CAD2",229 "customID": "CAD2",230 "dataType": "LocalDate",231 "label": {232 "ptBR": {233 "extends": "StudioObject",234 "objectType": "Label",235 "oid": "",236 "plainText": "2. Qual é a data de seu nascimento?",237 "formattedText": "2. Qual é a data de seu nascimento?"238 },239 "enUS": {240 "extends": "StudioObject",241 "objectType": "Label",242 "oid": "",243 "plainText": "",244 "formattedText": ""245 },246 "esES": {247 "extends": "StudioObject",248 "objectType": "Label",249 "oid": "",250 "plainText": "",251 "formattedText": ""252 }253 },254 "metadata": {255 "extents": "StudioObject",256 "objectType": "MetadataGroup",257 "options": [{258 "extends": "StudioObject",259 "objectType": "MetadataAnswer",260 "dataType": "Integer",261 "value": 1,262 "label": {263 "ptBR": {264 "extends": "StudioObject",265 "objectType": "Label",266 "oid": "",267 "plainText": "Não quer responder",268 "formattedText": "Não quer responder"269 },270 "enUS": {271 "extends": "StudioObject",272 "objectType": "Label",273 "oid": "",274 "plainText": "",275 "formattedText": ""276 },277 "esES": {278 "extends": "StudioObject",279 "objectType": "Label",280 "oid": "",281 "plainText": "",282 "formattedText": ""283 }284 }285 }, {286 "extends": "StudioObject",287 "objectType": "MetadataAnswer",288 "dataType": "Integer",289 "value": 2,290 "label": {291 "ptBR": {292 "extends": "StudioObject",293 "objectType": "Label",294 "oid": "",295 "plainText": "Não sabe responder",296 "formattedText": "Não sabe responder"297 },298 "enUS": {299 "extends": "StudioObject",300 "objectType": "Label",301 "oid": "",302 "plainText": "",303 "formattedText": ""304 },305 "esES": {306 "extends": "StudioObject",307 "objectType": "Label",308 "oid": "",309 "plainText": "",310 "formattedText": ""311 }312 }313 }]314 },315 "fillingRules": {316 "extends": "StudioObject",317 "objectType": "FillingRules",318 "options": {319 "mandatory": {320 "extends": "StudioObject",321 "objectType": "Rule",322 "validatorType": "mandatory",323 "data": {324 "reference": true325 }326 }327 }328 }329 }, {330 "extents": "SurveyItem",331 "objectType": "SingleSelectionQuestion",332 "templateID": "CAD3",333 "customID": "CAD3",334 "dataType": "Integer",335 "label": {336 "ptBR": {337 "extends": "StudioObject",338 "objectType": "Label",339 "oid": "",340 "plainText": "3. Seu gênero é:",341 "formattedText": "3. Seu gênero é:"342 },343 "enUS": {344 "extends": "StudioObject",345 "objectType": "Label",346 "oid": "",347 "plainText": "",348 "formattedText": ""349 },350 "esES": {351 "extends": "StudioObject",352 "objectType": "Label",353 "oid": "",354 "plainText": "",355 "formattedText": ""356 }357 },358 "options": [{359 "extents": "StudioObject",360 "objectType": "AnswerOption",361 "value": 1,362 "dataType": "Integer",363 "label": {364 "ptBR": {365 "extends": "StudioObject",366 "objectType": "Label",367 "oid": "",368 "plainText": "Feminino",369 "formattedText": "Feminino"370 },371 "enUS": {372 "extends": "StudioObject",373 "objectType": "Label",374 "oid": "",375 "plainText": "",376 "formattedText": ""377 },378 "esES": {379 "extends": "StudioObject",380 "objectType": "Label",381 "oid": "",382 "plainText": "",383 "formattedText": ""384 }385 }386 }, {387 "extents": "StudioObject",388 "objectType": "AnswerOption",389 "value": 2,390 "dataType": "Integer",391 "label": {392 "ptBR": {393 "extends": "StudioObject",394 "objectType": "Label",395 "oid": "",396 "plainText": "Masculino",397 "formattedText": "Masculino"398 },399 "enUS": {400 "extends": "StudioObject",401 "objectType": "Label",402 "oid": "",403 "plainText": "",404 "formattedText": ""405 },406 "esES": {407 "extends": "StudioObject",408 "objectType": "Label",409 "oid": "",410 "plainText": "",411 "formattedText": ""412 }413 }414 }, {415 "extents": "StudioObject",416 "objectType": "AnswerOption",417 "value": 3,418 "dataType": "Integer",419 "label": {420 "ptBR": {421 "extends": "StudioObject",422 "objectType": "Label",423 "oid": "",424 "plainText": "Outro",425 "formattedText": "Outro"426 },427 "enUS": {428 "extends": "StudioObject",429 "objectType": "Label",430 "oid": "",431 "plainText": "",432 "formattedText": ""433 },434 "esES": {435 "extends": "StudioObject",436 "objectType": "Label",437 "oid": "",438 "plainText": "",439 "formattedText": ""440 }441 }442 }],443 "metadata": {444 "extents": "StudioObject",445 "objectType": "MetadataGroup",446 "options": [{447 "extends": "StudioObject",448 "objectType": "MetadataAnswer",449 "dataType": "Integer",450 "value": 1,451 "label": {452 "ptBR": {453 "extends": "StudioObject",454 "objectType": "Label",455 "oid": "",456 "plainText": "Não se aplica",457 "formattedText": "Não se aplica"458 },459 "enUS": {460 "extends": "StudioObject",461 "objectType": "Label",462 "oid": "",463 "plainText": "",464 "formattedText": ""465 },466 "esES": {467 "extends": "StudioObject",468 "objectType": "Label",469 "oid": "",470 "plainText": "",471 "formattedText": ""472 }473 }474 }, {475 "extends": "StudioObject",476 "objectType": "MetadataAnswer",477 "dataType": "Integer",478 "value": 2,479 "label": {480 "ptBR": {481 "extends": "StudioObject",482 "objectType": "Label",483 "oid": "",484 "plainText": "Não quer responder",485 "formattedText": "Não quer responder"486 },487 "enUS": {488 "extends": "StudioObject",489 "objectType": "Label",490 "oid": "",491 "plainText": "",492 "formattedText": ""493 },494 "esES": {495 "extends": "StudioObject",496 "objectType": "Label",497 "oid": "",498 "plainText": "",499 "formattedText": ""500 }501 }502 }, {503 "extends": "StudioObject",504 "objectType": "MetadataAnswer",505 "dataType": "Integer",506 "value": 3,507 "label": {508 "ptBR": {509 "extends": "StudioObject",510 "objectType": "Label",511 "oid": "",512 "plainText": "Não sabe responder",513 "formattedText": "Não sabe responder"514 },515 "enUS": {516 "extends": "StudioObject",517 "objectType": "Label",518 "oid": "",519 "plainText": "",520 "formattedText": ""521 },522 "esES": {523 "extends": "StudioObject",524 "objectType": "Label",525 "oid": "",526 "plainText": "",527 "formattedText": ""528 }529 }530 }]531 },532 "fillingRules": {533 "extends": "StudioObject",534 "objectType": "FillingRules",535 "options": {536 "mandatory": {537 "extends": "StudioObject",538 "objectType": "Rule",539 "validatorType": "mandatory",540 "data": {541 "reference": true542 }543 }544 }545 }546 }, {547 "extents": "SurveyItem",548 "objectType": "TextQuestion",549 "templateID": "CAD4",550 "customID": "CAD4",551 "dataType": "String",552 "label": {553 "ptBR": {554 "extends": "StudioObject",555 "objectType": "Label",556 "oid": "",557 "plainText": "4. Qual outro?",558 "formattedText": "4. Qual outro?"559 },560 "enUS": {561 "extends": "StudioObject",562 "objectType": "Label",563 "oid": "",564 "plainText": "",565 "formattedText": ""566 },567 "esES": {568 "extends": "StudioObject",569 "objectType": "Label",570 "oid": "",571 "plainText": "",572 "formattedText": ""573 }574 },575 "metadata": {576 "extents": "StudioObject",577 "objectType": "MetadataGroup",578 "options": [{579 "extends": "StudioObject",580 "objectType": "MetadataAnswer",581 "dataType": "Integer",582 "value": 1,583 "label": {584 "ptBR": {585 "extends": "StudioObject",586 "objectType": "Label",587 "oid": "",588 "plainText": "Não se aplica",589 "formattedText": "Não se aplica"590 },591 "enUS": {592 "extends": "StudioObject",593 "objectType": "Label",594 "oid": "",595 "plainText": "",596 "formattedText": ""597 },598 "esES": {599 "extends": "StudioObject",600 "objectType": "Label",601 "oid": "",602 "plainText": "",603 "formattedText": ""604 }605 }606 }, {607 "extends": "StudioObject",608 "objectType": "MetadataAnswer",609 "dataType": "Integer",610 "value": 2,611 "label": {612 "ptBR": {613 "extends": "StudioObject",614 "objectType": "Label",615 "oid": "",616 "plainText": "Não quer responder",617 "formattedText": "Não quer responder"618 },619 "enUS": {620 "extends": "StudioObject",621 "objectType": "Label",622 "oid": "",623 "plainText": "",624 "formattedText": ""625 },626 "esES": {627 "extends": "StudioObject",628 "objectType": "Label",629 "oid": "",630 "plainText": "",631 "formattedText": ""632 }633 }634 }, {635 "extends": "StudioObject",636 "objectType": "MetadataAnswer",637 "dataType": "Integer",638 "value": 3,639 "label": {640 "ptBR": {641 "extends": "StudioObject",642 "objectType": "Label",643 "oid": "",644 "plainText": "Não sabe responder",645 "formattedText": "Não sabe responder"646 },647 "enUS": {648 "extends": "StudioObject",649 "objectType": "Label",650 "oid": "",651 "plainText": "",652 "formattedText": ""653 },654 "esES": {655 "extends": "StudioObject",656 "objectType": "Label",657 "oid": "",658 "plainText": "",659 "formattedText": ""660 }661 }662 }]663 },664 "fillingRules": {665 "extends": "StudioObject",666 "objectType": "FillingRules",667 "options": {668 "mandatory": {669 "extends": "StudioObject",670 "objectType": "Rule",671 "validatorType": "mandatory",672 "data": {673 "reference": true674 }675 }676 }677 }678 }, {679 "extents": "SurveyItem",680 "objectType": "SingleSelectionQuestion",681 "templateID": "CAD5",682 "customID": "CAD5",683 "dataType": "Integer",684 "label": {685 "ptBR": {686 "extends": "StudioObject",687 "objectType": "Label",688 "oid": "",689 "plainText": "5.  Qual é a sua nacionalidade?",690 "formattedText": "5. &nbsp;Qual é a sua nacionalidade?"691 },692 "enUS": {693 "extends": "StudioObject",694 "objectType": "Label",695 "oid": "",696 "plainText": "",697 "formattedText": ""698 },699 "esES": {700 "extends": "StudioObject",701 "objectType": "Label",702 "oid": "",703 "plainText": "",704 "formattedText": ""705 }706 },707 "options": [{708 "extents": "StudioObject",709 "objectType": "AnswerOption",710 "value": 1,711 "dataType": "Integer",712 "label": {713 "ptBR": {714 "extends": "StudioObject",715 "objectType": "Label",716 "oid": "",717 "plainText": "Brasileira",718 "formattedText": "Brasileira"719 },720 "enUS": {721 "extends": "StudioObject",722 "objectType": "Label",723 "oid": "",724 "plainText": "",725 "formattedText": ""726 },727 "esES": {728 "extends": "StudioObject",729 "objectType": "Label",730 "oid": "",731 "plainText": "",732 "formattedText": ""733 }734 }735 }, {736 "extents": "StudioObject",737 "objectType": "AnswerOption",738 "value": 2,739 "dataType": "Integer",740 "label": {741 "ptBR": {742 "extends": "StudioObject",743 "objectType": "Label",744 "oid": "",745 "plainText": "Outra",746 "formattedText": "Outra"747 },748 "enUS": {749 "extends": "StudioObject",750 "objectType": "Label",751 "oid": "",752 "plainText": "",753 "formattedText": ""754 },755 "esES": {756 "extends": "StudioObject",757 "objectType": "Label",758 "oid": "",759 "plainText": "",760 "formattedText": ""761 }762 }763 }],764 "metadata": {765 "extents": "StudioObject",766 "objectType": "MetadataGroup",767 "options": [{768 "extends": "StudioObject",769 "objectType": "MetadataAnswer",770 "dataType": "Integer",771 "value": 1,772 "label": {773 "ptBR": {774 "extends": "StudioObject",775 "objectType": "Label",776 "oid": "",777 "plainText": "Não se aplica",778 "formattedText": "Não se aplica"779 },780 "enUS": {781 "extends": "StudioObject",782 "objectType": "Label",783 "oid": "",784 "plainText": "",785 "formattedText": ""786 },787 "esES": {788 "extends": "StudioObject",789 "objectType": "Label",790 "oid": "",791 "plainText": "",792 "formattedText": ""793 }794 }795 }, {796 "extends": "StudioObject",797 "objectType": "MetadataAnswer",798 "dataType": "Integer",799 "value": 2,800 "label": {801 "ptBR": {802 "extends": "StudioObject",803 "objectType": "Label",804 "oid": "",805 "plainText": "Não quer responder",806 "formattedText": "Não quer responder"807 },808 "enUS": {809 "extends": "StudioObject",810 "objectType": "Label",811 "oid": "",812 "plainText": "",813 "formattedText": ""814 },815 "esES": {816 "extends": "StudioObject",817 "objectType": "Label",818 "oid": "",819 "plainText": "",820 "formattedText": ""821 }822 }823 }, {824 "extends": "StudioObject",825 "objectType": "MetadataAnswer",826 "dataType": "Integer",827 "value": 3,828 "label": {829 "ptBR": {830 "extends": "StudioObject",831 "objectType": "Label",832 "oid": "",833 "plainText": "Não sabe responder",834 "formattedText": "Não sabe responder"835 },836 "enUS": {837 "extends": "StudioObject",838 "objectType": "Label",839 "oid": "",840 "plainText": "",841 "formattedText": ""842 },843 "esES": {844 "extends": "StudioObject",845 "objectType": "Label",846 "oid": "",847 "plainText": "",848 "formattedText": ""849 }850 }851 }]852 },853 "fillingRules": {854 "extends": "StudioObject",855 "objectType": "FillingRules",856 "options": {857 "mandatory": {858 "extends": "StudioObject",859 "objectType": "Rule",860 "validatorType": "mandatory",861 "data": {862 "reference": true863 }864 }865 }866 }867 }, {868 "extents": "SurveyItem",869 "objectType": "TextQuestion",870 "templateID": "CAD6",871 "customID": "CAD6",872 "dataType": "String",873 "label": {874 "ptBR": {875 "extends": "StudioObject",876 "objectType": "Label",877 "oid": "",878 "plainText": "6. Qual outra?",879 "formattedText": "6. Qual outra?"880 },881 "enUS": {882 "extends": "StudioObject",883 "objectType": "Label",884 "oid": "",885 "plainText": "",886 "formattedText": ""887 },888 "esES": {889 "extends": "StudioObject",890 "objectType": "Label",891 "oid": "",892 "plainText": "",893 "formattedText": ""894 }895 },896 "metadata": {897 "extents": "StudioObject",898 "objectType": "MetadataGroup",899 "options": [{900 "extends": "StudioObject",901 "objectType": "MetadataAnswer",902 "dataType": "Integer",903 "value": 1,904 "label": {905 "ptBR": {906 "extends": "StudioObject",907 "objectType": "Label",908 "oid": "",909 "plainText": "Não se aplica",910 "formattedText": "Não se aplica"911 },912 "enUS": {913 "extends": "StudioObject",914 "objectType": "Label",915 "oid": "",916 "plainText": "",917 "formattedText": ""918 },919 "esES": {920 "extends": "StudioObject",921 "objectType": "Label",922 "oid": "",923 "plainText": "",924 "formattedText": ""925 }926 }927 }, {928 "extends": "StudioObject",929 "objectType": "MetadataAnswer",930 "dataType": "Integer",931 "value": 2,932 "label": {933 "ptBR": {934 "extends": "StudioObject",935 "objectType": "Label",936 "oid": "",937 "plainText": "Não quer responder",938 "formattedText": "Não quer responder"939 },940 "enUS": {941 "extends": "StudioObject",942 "objectType": "Label",943 "oid": "",944 "plainText": "",945 "formattedText": ""946 },947 "esES": {948 "extends": "StudioObject",949 "objectType": "Label",950 "oid": "",951 "plainText": "",952 "formattedText": ""953 }954 }955 }, {956 "extends": "StudioObject",957 "objectType": "MetadataAnswer",958 "dataType": "Integer",959 "value": 3,960 "label": {961 "ptBR": {962 "extends": "StudioObject",963 "objectType": "Label",964 "oid": "",965 "plainText": "Não sabe responder",966 "formattedText": "Não sabe responder"967 },968 "enUS": {969 "extends": "StudioObject",970 "objectType": "Label",971 "oid": "",972 "plainText": "",973 "formattedText": ""974 },975 "esES": {976 "extends": "StudioObject",977 "objectType": "Label",978 "oid": "",979 "plainText": "",980 "formattedText": ""981 }982 }983 }]984 },985 "fillingRules": {986 "extends": "StudioObject",987 "objectType": "FillingRules",988 "options": {989 "mandatory": {990 "extends": "StudioObject",991 "objectType": "Rule",992 "validatorType": "mandatory",993 "data": {994 "reference": true995 }996 }997 }998 }999 }, {1000 "extents": "SurveyItem",1001 "objectType": "SingleSelectionQuestion",1002 "templateID": "CAD7",1003 "customID": "CAD7",1004 "dataType": "Integer",1005 "label": {1006 "ptBR": {1007 "extends": "StudioObject",1008 "objectType": "Label",1009 "oid": "",1010 "plainText": "7. Você deseja fazer parte do estudo?",1011 "formattedText": "7. Você deseja fazer parte do estudo?"1012 },1013 "enUS": {1014 "extends": "StudioObject",1015 "objectType": "Label",1016 "oid": "",1017 "plainText": "",1018 "formattedText": ""1019 },1020 "esES": {1021 "extends": "StudioObject",1022 "objectType": "Label",1023 "oid": "",1024 "plainText": "",1025 "formattedText": ""1026 }1027 },1028 "options": [{1029 "extents": "StudioObject",1030 "objectType": "AnswerOption",1031 "value": 1,1032 "dataType": "Integer",1033 "label": {1034 "ptBR": {1035 "extends": "StudioObject",1036 "objectType": "Label",1037 "oid": "",1038 "plainText": "Não",1039 "formattedText": "Não"1040 },1041 "enUS": {1042 "extends": "StudioObject",1043 "objectType": "Label",1044 "oid": "",1045 "plainText": "",1046 "formattedText": ""1047 },1048 "esES": {1049 "extends": "StudioObject",1050 "objectType": "Label",1051 "oid": "",1052 "plainText": "",1053 "formattedText": ""1054 }1055 }1056 }, {1057 "extents": "StudioObject",1058 "objectType": "AnswerOption",1059 "value": 2,1060 "dataType": "Integer",1061 "label": {1062 "ptBR": {1063 "extends": "StudioObject",1064 "objectType": "Label",1065 "oid": "",1066 "plainText": "Sim",1067 "formattedText": "Sim"1068 },1069 "enUS": {1070 "extends": "StudioObject",1071 "objectType": "Label",1072 "oid": "",1073 "plainText": "",1074 "formattedText": ""1075 },1076 "esES": {1077 "extends": "StudioObject",1078 "objectType": "Label",1079 "oid": "",1080 "plainText": "",1081 "formattedText": ""1082 }1083 }1084 }],1085 "metadata": {1086 "extents": "StudioObject",1087 "objectType": "MetadataGroup",1088 "options": [{1089 "extends": "StudioObject",1090 "objectType": "MetadataAnswer",1091 "dataType": "Integer",1092 "value": 1,1093 "label": {1094 "ptBR": {1095 "extends": "StudioObject",1096 "objectType": "Label",1097 "oid": "",1098 "plainText": "Não se aplica",1099 "formattedText": "Não se aplica"1100 },1101 "enUS": {1102 "extends": "StudioObject",1103 "objectType": "Label",1104 "oid": "",1105 "plainText": "",1106 "formattedText": ""1107 },1108 "esES": {1109 "extends": "StudioObject",1110 "objectType": "Label",1111 "oid": "",1112 "plainText": "",1113 "formattedText": ""1114 }1115 }1116 }, {1117 "extends": "StudioObject",1118 "objectType": "MetadataAnswer",1119 "dataType": "Integer",1120 "value": 2,1121 "label": {1122 "ptBR": {1123 "extends": "StudioObject",1124 "objectType": "Label",1125 "oid": "",1126 "plainText": "Não sabe responder",1127 "formattedText": "Não sabe responder"1128 },1129 "enUS": {1130 "extends": "StudioObject",1131 "objectType": "Label",1132 "oid": "",1133 "plainText": "",1134 "formattedText": ""1135 },1136 "esES": {1137 "extends": "StudioObject",1138 "objectType": "Label",1139 "oid": "",1140 "plainText": "",1141 "formattedText": ""1142 }1143 }1144 }]1145 },1146 "fillingRules": {1147 "extends": "StudioObject",1148 "objectType": "FillingRules",1149 "options": {1150 "mandatory": {1151 "extends": "StudioObject",1152 "objectType": "Rule",1153 "validatorType": "mandatory",1154 "data": {1155 "reference": true1156 }1157 }1158 }1159 }1160 }, {1161 "extents": "SurveyItem",1162 "objectType": "CheckboxQuestion",1163 "templateID": "CAD8",1164 "customID": "CAD8",1165 "dataType": "Array",1166 "label": {1167 "ptBR": {1168 "extends": "StudioObject",1169 "objectType": "Label",1170 "oid": "",1171 "plainText": "8. Por favor, assinale as razões para participar, como voluntário, do estudo:",1172 "formattedText": "8. Por favor, assinale as razões para participar, como voluntário, do estudo:"1173 },1174 "enUS": {1175 "extends": "StudioObject",1176 "objectType": "Label",1177 "oid": "",1178 "plainText": "",1179 "formattedText": ""1180 },1181 "esES": {1182 "extends": "StudioObject",1183 "objectType": "Label",1184 "oid": "",1185 "plainText": "",1186 "formattedText": ""1187 }1188 },1189 "options": [{1190 "extents": "StudioObject",1191 "objectType": "CheckboxAnswerOption",1192 "dataType": "Boolean",1193 "label": {1194 "ptBR": {1195 "extends": "StudioObject",1196 "objectType": "Label",1197 "oid": "",1198 "plainText": "Irá auxiliar em minha formação",1199 "formattedText": "Irá auxiliar em minha formação"1200 },1201 "enUS": {1202 "extends": "StudioObject",1203 "objectType": "Label",1204 "oid": "",1205 "plainText": "",1206 "formattedText": ""1207 },1208 "esES": {1209 "extends": "StudioObject",1210 "objectType": "Label",1211 "oid": "",1212 "plainText": "",1213 "formattedText": ""1214 }1215 }1216 }, {1217 "extents": "StudioObject",1218 "objectType": "CheckboxAnswerOption",1219 "dataType": "Boolean",1220 "label": {1221 "ptBR": {1222 "extends": "StudioObject",1223 "objectType": "Label",1224 "oid": "",1225 "plainText": "Experiência em campo",1226 "formattedText": "Experiência em campo"1227 },1228 "enUS": {1229 "extends": "StudioObject",1230 "objectType": "Label",1231 "oid": "",1232 "plainText": "",1233 "formattedText": ""1234 },1235 "esES": {1236 "extends": "StudioObject",1237 "objectType": "Label",1238 "oid": "",1239 "plainText": "",1240 "formattedText": ""1241 }1242 }1243 }, {1244 "extents": "StudioObject",1245 "objectType": "CheckboxAnswerOption",1246 "dataType": "Boolean",1247 "label": {1248 "ptBR": {1249 "extends": "StudioObject",1250 "objectType": "Label",1251 "oid": "",1252 "plainText": "Curiosidade",1253 "formattedText": "Curiosidade"1254 },1255 "enUS": {1256 "extends": "StudioObject",1257 "objectType": "Label",1258 "oid": "",1259 "plainText": "",1260 "formattedText": ""1261 },1262 "esES": {1263 "extends": "StudioObject",1264 "objectType": "Label",1265 "oid": "",1266 "plainText": "",1267 "formattedText": ""1268 }1269 }1270 }, {1271 "extents": "StudioObject",1272 "objectType": "CheckboxAnswerOption",1273 "dataType": "Boolean",1274 "label": {1275 "ptBR": {1276 "extends": "StudioObject",1277 "objectType": "Label",1278 "oid": "",1279 "plainText": "Apenas preciso cumprir carga horária complementar em meu curso",1280 "formattedText": "Apenas preciso cumprir carga horária complementar em meu curso"1281 },1282 "enUS": {1283 "extends": "StudioObject",1284 "objectType": "Label",1285 "oid": "",1286 "plainText": "",1287 "formattedText": ""1288 },1289 "esES": {1290 "extends": "StudioObject",1291 "objectType": "Label",1292 "oid": "",1293 "plainText": "",1294 "formattedText": ""1295 }1296 }1297 }, {1298 "extents": "StudioObject",1299 "objectType": "CheckboxAnswerOption",1300 "dataType": "Boolean",1301 "label": {1302 "ptBR": {1303 "extends": "StudioObject",1304 "objectType": "Label",1305 "oid": "",1306 "plainText": "Interesse em seguir pesquisando o tema",1307 "formattedText": "Interesse em seguir pesquisando o tema"1308 },1309 "enUS": {1310 "extends": "StudioObject",1311 "objectType": "Label",1312 "oid": "",1313 "plainText": "",1314 "formattedText": ""1315 },1316 "esES": {1317 "extends": "StudioObject",1318 "objectType": "Label",1319 "oid": "",1320 "plainText": "",1321 "formattedText": ""1322 }1323 }1324 }, {1325 "extents": "StudioObject",1326 "objectType": "CheckboxAnswerOption",1327 "dataType": "Boolean",1328 "label": {1329 "ptBR": {1330 "extends": "StudioObject",1331 "objectType": "Label",1332 "oid": "",1333 "plainText": "Outro",1334 "formattedText": "Outro"1335 },1336 "enUS": {1337 "extends": "StudioObject",1338 "objectType": "Label",1339 "oid": "",1340 "plainText": "",1341 "formattedText": ""1342 },1343 "esES": {1344 "extends": "StudioObject",1345 "objectType": "Label",1346 "oid": "",1347 "plainText": "",1348 "formattedText": ""1349 }1350 }1351 }],1352 "metadata": {1353 "extents": "StudioObject",1354 "objectType": "MetadataGroup",1355 "options": [{1356 "extends": "StudioObject",1357 "objectType": "MetadataAnswer",1358 "dataType": "Integer",1359 "value": 1,1360 "label": {1361 "ptBR": {1362 "extends": "StudioObject",1363 "objectType": "Label",1364 "oid": "",1365 "plainText": "Não sabe responder",1366 "formattedText": "Não sabe responder"1367 },1368 "enUS": {1369 "extends": "StudioObject",1370 "objectType": "Label",1371 "oid": "",1372 "plainText": "",1373 "formattedText": ""1374 },1375 "esES": {1376 "extends": "StudioObject",1377 "objectType": "Label",1378 "oid": "",1379 "plainText": "",1380 "formattedText": ""1381 }1382 }1383 }, {1384 "extends": "StudioObject",1385 "objectType": "MetadataAnswer",1386 "dataType": "Integer",1387 "value": 2,1388 "label": {1389 "ptBR": {1390 "extends": "StudioObject",1391 "objectType": "Label",1392 "oid": "",1393 "plainText": "Não quer responder",1394 "formattedText": "Não quer responder"1395 },1396 "enUS": {1397 "extends": "StudioObject",1398 "objectType": "Label",1399 "oid": "",1400 "plainText": "",1401 "formattedText": ""1402 },1403 "esES": {1404 "extends": "StudioObject",1405 "objectType": "Label",1406 "oid": "",1407 "plainText": "",1408 "formattedText": ""1409 }1410 }1411 }]1412 },1413 "fillingRules": {1414 "extends": "StudioObject",1415 "objectType": "FillingRules",1416 "options": {1417 "mandatory": {1418 "extends": "StudioObject",1419 "objectType": "Rule",1420 "validatorType": "mandatory",1421 "data": {1422 "reference": true1423 }1424 }1425 }1426 }1427 }, {1428 "extents": "SurveyItem",1429 "objectType": "TextQuestion",1430 "templateID": "CAD9",1431 "customID": "CAD9",1432 "dataType": "String",1433 "label": {1434 "ptBR": {1435 "extends": "StudioObject",1436 "objectType": "Label",1437 "oid": "",1438 "plainText": "9. Qual a outra razão?",1439 "formattedText": "9. Qual a outra razão?"1440 },1441 "enUS": {1442 "extends": "StudioObject",1443 "objectType": "Label",1444 "oid": "",1445 "plainText": "",1446 "formattedText": ""1447 },1448 "esES": {1449 "extends": "StudioObject",1450 "objectType": "Label",1451 "oid": "",1452 "plainText": "",1453 "formattedText": ""1454 }1455 },1456 "metadata": {1457 "extents": "StudioObject",1458 "objectType": "MetadataGroup",1459 "options": []1460 },1461 "fillingRules": {1462 "extends": "StudioObject",1463 "objectType": "FillingRules",1464 "options": {1465 "mandatory": {1466 "extends": "StudioObject",1467 "objectType": "Rule",1468 "validatorType": "mandatory",1469 "data": {1470 "reference": true1471 }1472 }1473 }1474 }1475 }, {1476 "extents": "SurveyItem",1477 "objectType": "SingleSelectionQuestion",1478 "templateID": "CAD10",1479 "customID": "CAD10",1480 "dataType": "Integer",1481 "label": {1482 "ptBR": {1483 "extends": "StudioObject",1484 "objectType": "Label",1485 "oid": "",1486 "plainText": "10. Classifique de 1 a 5 sua satisfação com esse formulário:nn1 - Nada satisfeito (a)n3 - Satisfeito (a)n5 - Muito satisfeito (a)n",1487 "formattedText": "<span style='letter-spacing: 0.14px;'>10. Classifique de 1 a 5 sua satisfação com esse formulário:</span><div style='letter-spacing: 0.14px;'><br>1 - Nada satisfeito (a)<div>3 - Satisfeito (a)</div><div>5 - Muito satisfeito (a)</div></div>"1488 },1489 "enUS": {1490 "extends": "StudioObject",1491 "objectType": "Label",1492 "oid": "",1493 "plainText": "",1494 "formattedText": ""1495 },1496 "esES": {1497 "extends": "StudioObject",1498 "objectType": "Label",1499 "oid": "",1500 "plainText": "",1501 "formattedText": ""1502 }1503 },1504 "options": [{1505 "extents": "StudioObject",1506 "objectType": "AnswerOption",1507 "value": 1,1508 "dataType": "Integer",1509 "label": {1510 "ptBR": {1511 "extends": "StudioObject",1512 "objectType": "Label",1513 "oid": "",1514 "plainText": "1",1515 "formattedText": "1"1516 },1517 "enUS": {1518 "extends": "StudioObject",1519 "objectType": "Label",1520 "oid": "",1521 "plainText": "",1522 "formattedText": ""1523 },1524 "esES": {1525 "extends": "StudioObject",1526 "objectType": "Label",1527 "oid": "",1528 "plainText": "",1529 "formattedText": ""1530 }1531 }1532 }, {1533 "extents": "StudioObject",1534 "objectType": "AnswerOption",1535 "value": 2,1536 "dataType": "Integer",1537 "label": {1538 "ptBR": {1539 "extends": "StudioObject",1540 "objectType": "Label",1541 "oid": "",1542 "plainText": "2",1543 "formattedText": "2"1544 },1545 "enUS": {1546 "extends": "StudioObject",1547 "objectType": "Label",1548 "oid": "",1549 "plainText": "",1550 "formattedText": ""1551 },1552 "esES": {1553 "extends": "StudioObject",1554 "objectType": "Label",1555 "oid": "",1556 "plainText": "",1557 "formattedText": ""1558 }1559 }1560 }, {1561 "extents": "StudioObject",1562 "objectType": "AnswerOption",1563 "value": 3,1564 "dataType": "Integer",1565 "label": {1566 "ptBR": {1567 "extends": "StudioObject",1568 "objectType": "Label",1569 "oid": "",1570 "plainText": "3",1571 "formattedText": "3"1572 },1573 "enUS": {1574 "extends": "StudioObject",1575 "objectType": "Label",1576 "oid": "",1577 "plainText": "",1578 "formattedText": ""1579 },1580 "esES": {1581 "extends": "StudioObject",1582 "objectType": "Label",1583 "oid": "",1584 "plainText": "",1585 "formattedText": ""1586 }1587 }1588 }, {1589 "extents": "StudioObject",1590 "objectType": "AnswerOption",1591 "value": 4,1592 "dataType": "Integer",1593 "label": {1594 "ptBR": {1595 "extends": "StudioObject",1596 "objectType": "Label",1597 "oid": "",1598 "plainText": "4",1599 "formattedText": "4"1600 },1601 "enUS": {1602 "extends": "StudioObject",1603 "objectType": "Label",1604 "oid": "",1605 "plainText": "",1606 "formattedText": ""1607 },1608 "esES": {1609 "extends": "StudioObject",1610 "objectType": "Label",1611 "oid": "",1612 "plainText": "",1613 "formattedText": ""1614 }1615 }1616 }, {1617 "extents": "StudioObject",1618 "objectType": "AnswerOption",1619 "value": 5,1620 "dataType": "Integer",1621 "label": {1622 "ptBR": {1623 "extends": "StudioObject",1624 "objectType": "Label",1625 "oid": "",1626 "plainText": "5",1627 "formattedText": "5"1628 },1629 "enUS": {1630 "extends": "StudioObject",1631 "objectType": "Label",1632 "oid": "",1633 "plainText": "",1634 "formattedText": ""1635 },1636 "esES": {1637 "extends": "StudioObject",1638 "objectType": "Label",1639 "oid": "",1640 "plainText": "",1641 "formattedText": ""1642 }1643 }1644 }],1645 "metadata": {1646 "extents": "StudioObject",1647 "objectType": "MetadataGroup",1648 "options": []1649 },1650 "fillingRules": {1651 "extends": "StudioObject",1652 "objectType": "FillingRules",1653 "options": {1654 "mandatory": {1655 "extends": "StudioObject",1656 "objectType": "Rule",1657 "validatorType": "mandatory",1658 "data": {1659 "reference": true1660 }1661 }1662 }1663 }1664 }, {1665 "extents": "SurveyItem",1666 "objectType": "ImageItem",1667 "templateID": "CAD11",1668 "customID": "CAD11",1669 "dataType": "String",1670 "url": "https://i.ytimg.com/vi/_1CF2IWZGZo/maxresdefault.jpg",1671 "footer": {1672 "ptBR": {1673 "extends": "StudioObject",1674 "objectType": "Label",1675 "oid": "",1676 "plainText": "Poxa...",1677 "formattedText": "Poxa..."1678 },1679 "enUS": {1680 "extends": "StudioObject",1681 "objectType": "Label",1682 "oid": "",1683 "plainText": "",1684 "formattedText": ""1685 },1686 "esES": {1687 "extends": "StudioObject",1688 "objectType": "Label",1689 "oid": "",1690 "plainText": "",1691 "formattedText": ""1692 }1693 }1694 }, {1695 "extents": "SurveyItem",1696 "objectType": "ImageItem",1697 "templateID": "CAD12",1698 "customID": "CAD12",1699 "dataType": "String",1700 "url": "http://bolaof1.com.br/imagens/memes/neutral-poker-face-no-text.jpg",1701 "footer": {1702 "ptBR": {1703 "extends": "StudioObject",1704 "objectType": "Label",1705 "oid": "",1706 "plainText": ":S",1707 "formattedText": ":S"1708 },1709 "enUS": {1710 "extends": "StudioObject",1711 "objectType": "Label",1712 "oid": "",1713 "plainText": "",1714 "formattedText": ""1715 },1716 "esES": {1717 "extends": "StudioObject",1718 "objectType": "Label",1719 "oid": "",1720 "plainText": "",1721 "formattedText": ""1722 }1723 }1724 }, {1725 "extents": "SurveyItem",1726 "objectType": "ImageItem",1727 "templateID": "CAD13",1728 "customID": "CAD13",1729 "dataType": "String",1730 "url": "http://kingofwallpapers.com/happy/happy-001.jpg",1731 "footer": {1732 "ptBR": {1733 "extends": "StudioObject",1734 "objectType": "Label",1735 "oid": "",1736 "plainText": "Uhuu!",1737 "formattedText": "Uhuu!"1738 },1739 "enUS": {1740 "extends": "StudioObject",1741 "objectType": "Label",1742 "oid": "",1743 "plainText": "",1744 "formattedText": ""1745 },1746 "esES": {1747 "extends": "StudioObject",1748 "objectType": "Label",1749 "oid": "",1750 "plainText": "",1751 "formattedText": ""1752 }1753 }1754 }, {1755 "extents": "SurveyItem",1756 "objectType": "TextItem",1757 "templateID": "CAD14",1758 "customID": "CAD14",1759 "dataType": "String",1760 "value": {1761 "ptBR": {1762 "extends": "StudioObject",1763 "objectType": "Label",1764 "oid": "",1765 "plainText": "Vlw flw",1766 "formattedText": "Vlw flw"1767 },1768 "enUS": {1769 "extends": "StudioObject",1770 "objectType": "Label",1771 "oid": "",1772 "plainText": "",1773 "formattedText": ""1774 },1775 "esES": {1776 "extends": "StudioObject",1777 "objectType": "Label",1778 "oid": "",1779 "plainText": "",1780 "formattedText": ""1781 }1782 }1783 }, {1784 "extents": "SurveyItem",1785 "objectType": "IntegerQuestion",1786 "templateID": "CAD15",1787 "customID": "CAD15",1788 "dataType": "Integer",1789 "label": {1790 "ptBR": {1791 "extends": "StudioObject",1792 "objectType": "Label",1793 "oid": "",1794 "plainText": "",1795 "formattedText": ""1796 },1797 "enUS": {1798 "extends": "StudioObject",1799 "objectType": "Label",1800 "oid": "",1801 "plainText": "",1802 "formattedText": ""1803 },1804 "esES": {1805 "extends": "StudioObject",1806 "objectType": "Label",1807 "oid": "",1808 "plainText": "",1809 "formattedText": ""1810 }1811 },1812 "metadata": {1813 "extents": "StudioObject",1814 "objectType": "MetadataGroup",1815 "options": []1816 },1817 "unit": {1818 "ptBR": {1819 "extends": "StudioObject",1820 "objectType": "Unit",1821 "oid": "",1822 "plainText": "",1823 "formattedText": ""1824 },1825 "enUS": {1826 "extends": "StudioObject",1827 "objectType": "Unit",1828 "oid": "",1829 "plainText": "",1830 "formattedText": ""1831 },1832 "esES": {1833 "extends": "StudioObject",1834 "objectType": "Unit",1835 "oid": "",1836 "plainText": "",1837 "formattedText": ""1838 }1839 },1840 "fillingRules": {1841 "extends": "StudioObject",1842 "objectType": "FillingRules",1843 "options": {1844 "mandatory": {1845 "extends": "StudioObject",1846 "objectType": "Rule",1847 "validatorType": "mandatory",1848 "data": {1849 "reference": false1850 }1851 },1852 "lowerLimit": {1853 "extends": "StudioObject",1854 "objectType": "Rule",1855 "validatorType": "lowerLimit",1856 "data": {1857 "reference": null1858 }1859 }1860 }1861 }1862 }],1863 "navigationList": [{1864 "extents": "StudioObject",1865 "objectType": "Navigation",1866 "origin": "CAD1",1867 "index": 0,1868 "inNavigations": [],1869 "isDefault": true,1870 "routes": [{1871 "extents": "StudioObject",1872 "objectType": "Route",1873 "name": "CAD1_CAD2",1874 "origin": "CAD1",1875 "destination": "CAD2",1876 "isDefault": true,1877 "conditions": []1878 }]1879 }, {1880 "extents": "StudioObject",1881 "objectType": "Navigation",1882 "origin": "CAD2",1883 "index": 1,1884 "inNavigations": [{1885 "origin": "CAD1",1886 "isDefaultPath": true,1887 "isDefaultRoute": true1888 }],1889 "isDefault": true,1890 "routes": [{1891 "extents": "StudioObject",1892 "objectType": "Route",1893 "name": "CAD2_CAD3",1894 "origin": "CAD2",1895 "destination": "CAD3",1896 "isDefault": true,1897 "conditions": []1898 }]1899 }, {1900 "extents": "StudioObject",1901 "objectType": "Navigation",1902 "origin": "CAD3",1903 "index": 2,1904 "inNavigations": [{1905 "origin": "CAD2",1906 "isDefaultPath": true,1907 "isDefaultRoute": true1908 }],1909 "isDefault": true,1910 "routes": [{1911 "extents": "StudioObject",1912 "objectType": "Route",1913 "name": "CAD3_CAD4",1914 "origin": "CAD3",1915 "destination": "CAD4",1916 "isDefault": true,1917 "conditions": []1918 }]1919 }, {1920 "extents": "StudioObject",1921 "objectType": "Navigation",1922 "origin": "CAD4",1923 "index": 3,1924 "inNavigations": [{1925 "origin": "CAD3",1926 "isDefaultPath": true,1927 "isDefaultRoute": true1928 }],1929 "isDefault": true,1930 "routes": [{1931 "extents": "StudioObject",1932 "objectType": "Route",1933 "name": "CAD4_CAD5",1934 "origin": "CAD4",1935 "destination": "CAD5",1936 "isDefault": true,1937 "conditions": []1938 }]1939 }, {1940 "extents": "StudioObject",1941 "objectType": "Navigation",1942 "origin": "CAD5",1943 "index": 4,1944 "inNavigations": [{1945 "origin": "CAD4",1946 "isDefaultPath": true,1947 "isDefaultRoute": true1948 }],1949 "isDefault": true,1950 "routes": [{1951 "extents": "StudioObject",1952 "objectType": "Route",1953 "name": "CAD5_CAD6",1954 "origin": "CAD5",1955 "destination": "CAD6",1956 "isDefault": true,1957 "conditions": []1958 }]1959 }, {1960 "extents": "StudioObject",1961 "objectType": "Navigation",1962 "origin": "CAD6",1963 "index": 5,1964 "inNavigations": [{1965 "origin": "CAD5",1966 "isDefaultPath": true,1967 "isDefaultRoute": true1968 }],1969 "isDefault": true,1970 "routes": [{1971 "extents": "StudioObject",1972 "objectType": "Route",1973 "name": "CAD6_CAD7",1974 "origin": "CAD6",1975 "destination": "CAD7",1976 "isDefault": true,1977 "conditions": []1978 }]1979 }, {1980 "extents": "StudioObject",1981 "objectType": "Navigation",1982 "origin": "CAD7",1983 "index": 6,1984 "inNavigations": [{1985 "origin": "CAD6",1986 "isDefaultPath": true,1987 "isDefaultRoute": true1988 }],1989 "isDefault": true,1990 "routes": [{1991 "extents": "StudioObject",1992 "objectType": "Route",1993 "name": "CAD7_CAD8",1994 "origin": "CAD7",1995 "destination": "CAD8",1996 "isDefault": true,1997 "conditions": []1998 }]1999 }, {2000 "extents": "StudioObject",2001 "objectType": "Navigation",2002 "origin": "CAD8",2003 "index": 7,2004 "inNavigations": [{2005 "origin": "CAD7",2006 "isDefaultPath": true,2007 "isDefaultRoute": true2008 }],2009 "isDefault": true,2010 "routes": [{2011 "extents": "StudioObject",2012 "objectType": "Route",2013 "name": "CAD8_CAD9",2014 "origin": "CAD8",2015 "destination": "CAD9",2016 "isDefault": true,2017 "conditions": []2018 }]2019 }, {2020 "extents": "StudioObject",2021 "objectType": "Navigation",2022 "origin": "CAD9",2023 "index": 8,2024 "inNavigations": [{2025 "origin": "CAD8",2026 "isDefaultPath": true,2027 "isDefaultRoute": true2028 }],2029 "isDefault": true,2030 "routes": [{2031 "extents": "StudioObject",2032 "objectType": "Route",2033 "name": "CAD9_CAD10",2034 "origin": "CAD9",2035 "destination": "CAD10",2036 "isDefault": true,2037 "conditions": []2038 }]2039 }, {2040 "extents": "StudioObject",2041 "objectType": "Navigation",2042 "origin": "CAD10",2043 "index": 9,2044 "inNavigations": [{2045 "origin": "CAD9",2046 "isDefaultPath": true,2047 "isDefaultRoute": true2048 }],2049 "isDefault": true,2050 "routes": [{2051 "extents": "StudioObject",2052 "objectType": "Route",2053 "name": "CAD10_CAD11",2054 "origin": "CAD10",2055 "destination": "CAD11",2056 "isDefault": true,2057 "conditions": []2058 }]2059 }, {2060 "extents": "StudioObject",2061 "objectType": "Navigation",2062 "origin": "CAD11",2063 "index": 10,2064 "inNavigations": [{2065 "origin": "CAD10",2066 "isDefaultPath": true,2067 "isDefaultRoute": true2068 }],2069 "isDefault": true,2070 "routes": [{2071 "extents": "StudioObject",2072 "objectType": "Route",2073 "name": "CAD11_CAD12",2074 "origin": "CAD11",2075 "destination": "CAD12",2076 "isDefault": true,2077 "conditions": []2078 }]2079 }, {2080 "extents": "StudioObject",2081 "objectType": "Navigation",2082 "origin": "CAD12",2083 "index": 11,2084 "inNavigations": [{2085 "origin": "CAD11",2086 "isDefaultPath": true,2087 "isDefaultRoute": true2088 }],2089 "isDefault": true,2090 "routes": [{2091 "extents": "StudioObject",2092 "objectType": "Route",2093 "name": "CAD12_CAD13",2094 "origin": "CAD12",2095 "destination": "CAD13",2096 "isDefault": true,2097 "conditions": []2098 }]2099 }, {2100 "extents": "StudioObject",2101 "objectType": "Navigation",2102 "origin": "CAD13",2103 "index": 12,2104 "inNavigations": [{2105 "origin": "CAD12",2106 "isDefaultPath": true,2107 "isDefaultRoute": true2108 }],2109 "isDefault": true,2110 "routes": [{2111 "extents": "StudioObject",2112 "objectType": "Route",2113 "name": "CAD13_CAD14",2114 "origin": "CAD13",2115 "destination": "CAD14",2116 "isDefault": true,2117 "conditions": []2118 }]2119 }, {2120 "extents": "StudioObject",2121 "objectType": "Navigation",2122 "origin": "CAD14",2123 "index": 13,2124 "inNavigations": [{2125 "origin": "CAD13",2126 "isDefaultPath": true,2127 "isDefaultRoute": true2128 }],2129 "isDefault": true,2130 "routes": [{2131 "extents": "StudioObject",2132 "objectType": "Route",2133 "name": "CAD14_CAD15",2134 "origin": "CAD14",2135 "destination": "CAD15",2136 "isDefault": true,2137 "conditions": []2138 }]2139 }]2140 };2141 }2142 function mockActivityFacadeService($injector) {2143 Mock.surveyActivity = $injector.get('ActivitySurveyFactory').create(Mock.surveyTemplate);2144 Mock.ActivityFacadeService = $injector.get('ActivityFacadeService');2145 Mock.ActivityFacadeService.surveyActivity = Mock.surveyActivity;2146 Injections.ActivityFacadeService = Mock.ActivityFacadeService;2147 }...

Full Screen

Full Screen

stmtBank.js

Source:stmtBank.js Github

copy

Full Screen

1/*2A store of valid xapi statements for testing and coverage purposes. Please use as needed.3https://github.com/adlnet/xAPI-Spec/blob/master/xAPI.md4*/5(function (obj) {6 var ADL = obj;7 if (typeof window !== 'undefined') {8 ADL = window.ADL = obj.ADL || {};9 }10 ADL.stmts = {11 /* Requirements:12 A Statement MUST use each property no more than one time.13 A Statement MUST use “actor”, “verb”, and “object”.14 A Statement MAY use its properties in any order.15 */16 /* An example of the simplest possible Statement using all properties that MUST or SHOULD be used: Actor-Verb-Object and Statement Id17 */18 "Base-Statement": {19 "actor": {20 "mbox": "mailto:xapi@adlnet.gov",21 "objectType": "Agent"22 },23 "verb": {24 "id": "http://adlnet.gov/expapi/verbs/created",25 "display": {26 "en-US": "created"27 }28 },29 "object": {30 "id": "http://example.adlnet.gov/xapi/example/activity",31 "objectType": "Activity"32 },33 "version": "1.0.1",34 "timestamp": "2016-01-25T20:24:01.770727+00:00",35 "stored": "2016-01-25T20:24:01.770727+00:00",36 "authority": {37 "mbox": "mailto:tyler.mulligan.ctr+xapi-tools@adlnet.gov",38 "name": "xapi-tools",39 "objectType": "Agent"40 },41 "id": "12345678-1234-5678-1234-567812345678"42 },43 /* Actor Agent - Simple statement featured at the xapi spec https://github.com/adlnet/xAPI-Spec/blob/master/xAPI.md#AppendixA44 features Actor-Verb-Object with UUID */45 "Actor-Agent": {46 "actor": {47 "mbox": "mailto:user@example.com",48 "name": "Project Tin Can API",49 "objectType": "Agent"50 },51 "verb": {52 "id": "http://adlnet.gov/expapi/verbs/created",53 "display": {54 "en-US": "created"55 }56 },57 "version": "1.0.1",58 "timestamp": "2016-01-25T20:20:48.295049+00:00",59 "object": {60 "definition": {61 "name": {62 "en-US": "simple statement"63 },64 "description": {65 "en-US": "A simple Experience API statement. Note that the LRS does not need to have any prior information about the Actor (learner), the verb, or the Activity/object."66 }67 },68 "id": "http://example.adlnet.gov/xapi/example/simplestatement",69 "objectType": "Activity"70 },71 "stored": "2016-01-25T20:20:48.295049+00:00",72 "authority": {73 "mbox": "mailto:tyler.mulligan.ctr+xapi-tools@adlnet.gov",74 "name": "xapi-tools",75 "objectType": "Agent"76 },77 "id": "fd41c918-b88b-4b20-a0a5-a4c32391aaa0"78 },79 /* Actor Group - Simple Statment with the Actor of type Identified Group */80 "Actor-Id-Group": {81 "actor": {82 "member": [83 {84 "mbox": "mailto:andrew@example.com",85 "name": "Andrew Downes",86 "objectType": "Agent"87 },88 {89 "openid": "http://aaron.openid.example.org",90 "name": "Aaron Silvers",91 "objectType": "Agent"92 }93 ],94 "account": {95 "homePage": "http://example.com/homePage",96 "name": "GroupAccount"97 },98 "name": "Example Group",99 "objectType": "Group"100 },101 "verb": {102 "id": "http://adlnet.gov/expapi/verbs/created",103 "display": {104 "en-US": "created"105 }106 },107 "version": "1.0.1",108 "timestamp": "2016-01-25T20:15:46.622339+00:00",109 "object": {110 "definition": {111 "name": {112 "en-US": "Example Activity"113 },114 "description": {115 "en-US": "Example activity description"116 }117 },118 "id": "http://example.adlnet.gov/xapi/example/activity",119 "objectType": "Activity"120 },121 "stored": "2016-01-25T20:15:46.622339+00:00",122 "authority": {123 "mbox": "mailto:tyler.mulligan.ctr+xapi-tools@adlnet.gov",124 "name": "xapi-tools",125 "objectType": "Agent"126 },127 "id": "65135a9a-b656-4445-9ffc-206ff22431c3"128 },129 /* Anonymous Group - the Actor is of type Anonymous Group */130 "Actor-Anon-Group": {131 "actor": {132 "member": [133 {134 "mbox": "mailto:andrew@example.com",135 "name": "Andrew Downes",136 "objectType": "Agent"137 },138 {139 "openid": "http://aaron.openid.example.org",140 "name": "Aaron Silvers",141 "objectType": "Agent"142 }143 ],144 "objectType": "Group"145 },146 "verb": {147 "id": "http://adlnet.gov/expapi/verbs/completed",148 "display": {149 "en-US": "completed"150 }151 },152 "version": "1.0.1",153 "timestamp": "2016-01-27T19:12:45.427205+00:00",154 "object": {155 "definition": {156 "name": {157 "en-US": "Example Activity"158 },159 "description": {160 "en-US": "Example activity description"161 }162 },163 "id": "http://example.adlnet.gov/xapi/example/activity",164 "objectType": "Activity"165 },166 "stored": "2016-01-27T19:12:45.427205+00:00",167 "authority": {168 "mbox": "mailto:tyler.mulligan.ctr+xapi-tools@adlnet.gov",169 "name": "xapi-tools",170 "objectType": "Agent"171 },172 "id": "8484d8a3-cd78-4883-bbb7-04bb12409fa9"173 },174 /* Actor Inverse Functional Identifier (IFI) mbox - Simple Statment with the Actor IFI mbox_sha1sum. */175 "Actor-Mbox": {176 "actor": {177 "mbox_sha1sum": "6a113390c5a05e6e345e0f559e03a1b294c2c3a3",178 "objectType": "Agent"179 },180 "verb": {181 "id": "http://adlnet.gov/expapi/verbs/created",182 "display": {183 "en-US": "created"184 }185 },186 "version": "1.0.1",187 "timestamp": "2016-01-25T20:10:38.397395+00:00",188 "object": {189 "definition": {190 "name": {191 "en-US": "Example Activity"192 },193 "description": {194 "en-US": "Example activity description"195 }196 },197 "id": "http://example.adlnet.gov/xapi/example/activity",198 "objectType": "Activity"199 },200 "stored": "2016-01-25T20:10:38.397395+00:00",201 "authority": {202 "mbox": "mailto:tyler.mulligan.ctr+xapi-tools@adlnet.gov",203 "name": "xapi-tools",204 "objectType": "Agent"205 },206 "id": "e179532e-ae03-4b86-a84f-aea691f1fd13"207 },208 /* Actor IFI Openid - Simple Statement with the Actor IFI openid */209 "Actor-Openid": {210 "actor": {211 "openid": "http://user.openid.example.com",212 "objectType": "Agent"213 },214 "verb": {215 "display": {216 "en-US": "created"217 },218 "id": "http://adlnet.gov/expapi/verbs/created"219 },220 "version": "1.0.1",221 "timestamp": "2016-01-25T20:05:53.282478+00:00",222 "object": {223 "definition": {224 "description": {225 "en-US": "Example activity description"226 },227 "name": {228 "en-US": "Example Activity"229 }230 },231 "id": "http://example.adlnet.gov/xapi/example/activity",232 "objectType": "Activity"233 },234 "stored": "2016-01-25T20:05:53.282478+00:00",235 "authority": {236 "mbox": "mailto:tyler.mulligan.ctr+xapi-tools@adlnet.gov",237 "name": "xapi-tools",238 "objectType": "Agent"239 },240 "id": "e038d689-2d58-4068-a8c9-2cd51c8aa4c8"241 },242 /* Actor IFI Account - simple statement with the Actor as an account.243 A user account on an existing system, such as a private system (LMS or244 intranet) or a public system (social networking site). https://github.com/adlnet/xAPI-Spec/blob/master/xAPI.md#4124-account-object */245 "Actor-Account": {246 "actor": {247 "account": {248 "homePage": "http://www.example.com",249 "name": "1625378"250 },251 "objectType": "Agent"252 },253 "verb": {254 "display": {255 "en-US": "created"256 },257 "id": "http://adlnet.gov/expapi/verbs/created"258 },259 "version": "1.0.1",260 "timestamp": "2016-01-25T20:00:31.763809+00:00",261 "object": {262 "definition": {263 "description": {264 "en-US": "Example activity description"265 },266 "name": {267 "en-US": "Example Activity"268 }269 },270 "id": "http://example.adlnet.gov/xapi/example/activity",271 "objectType": "Activity"272 },273 "stored": "2016-01-25T20:00:31.763809+00:00",274 "authority": {275 "mbox": "mailto:tyler.mulligan.ctr+xapi-tools@adlnet.gov",276 "name": "xapi-tools",277 "objectType": "Agent"278 },279 "id": "7a886f8b-e1c6-4470-8f33-54810b5a99e5"280 },281 /* Verb - Simple Statement with user defined verb282 https://github.com/adlnet/xAPI-Spec/blob/master/xAPI.md#413-verb */283 "Verb-User-Defined": {284 "verb": {285 "display": {286 "en-US": "perused"287 },288 "id": "http://user.com/xapi/verbs/perused"289 },290 "id": "591122cf-e208-4503-bcdb-279d4a1129a6",291 "version": "1.0.1",292 "timestamp": "2016-01-21T16:35:26.532503+00:00",293 "actor": {294 "openid": "http://user.openid.example.com",295 "objectType": "Agent"296 },297 "object": {298 "definition": {299 "description": {300 "en-US": "Example activity description"301 },302 "name": {303 "en-US": "Example Activity"304 }305 },306 "id": "http://example.adlnet.gov/xapi/example/activity",307 "objectType": "Activity"308 },309 "stored": "2016-01-21T16:35:26.532503+00:00",310 "authority": {311 "mbox": "mailto:tyler.mulligan.ctr+xapi-tools@adlnet.gov",312 "name": "xapi-tools",313 "objectType": "Agent"314 }315 },316 /* Verb - Simple Statement with predefined verb */317 "Verb-Predefined": {318 "verb": {319 "id": "http://adlnet.gov/expapi/verbs/preferred",320 "display": {321 "en-US": "preferred"322 }323 },324 "version": "1.0.1",325 "timestamp": "2016-01-21T16:30:02.244116+00:00",326 "object": {327 "definition": {328 "name": {329 "en-US": "Example Activity"330 },331 "description": {332 "en-US": "Example activity description"333 }334 },335 "id": "http://example.adlnet.gov/xapi/example/activity",336 "objectType": "Activity"337 },338 "actor": {339 "openid": "http://user.openid.example.com",340 "objectType": "Agent"341 },342 "stored": "2016-01-21T16:30:02.244116+00:00",343 "authority": {344 "mbox": "mailto:tyler.mulligan.ctr+xapi-tools@adlnet.gov",345 "name": "xapi-tools",346 "objectType": "Agent"347 },348 "id": "12d33361-b5fe-48dd-ab8c-8777cc9c45a5"349 },350 /* Object - Simple Statment with Object as an Activity351 https://github.com/adlnet/xAPI-Spec/blob/master/xAPI.md#414-object */352 "Object-Activity": {353 "object": {354 "definition": {355 "description": {356 "en-US": "Example activity description"357 },358 "name": {359 "en-US": "Example Activity"360 }361 },362 "id": "http://example.adlnet.gov/xapi/example/activity",363 "objectType": "Activity"364 },365 "verb": {366 "display": {367 "en-US": "attempted"368 },369 "id": "http://adlnet.gov/expapi/verbs/attempted"370 },371 "version": "1.0.1",372 "timestamp": "2016-01-21T16:09:30.685861+00:00",373 "actor": {374 "mbox": "mailto:user@example.com",375 "objectType": "Agent"376 },377 "stored": "2016-01-21T16:09:30.685861+00:00",378 "authority": {379 "mbox": "mailto:tyler.mulligan.ctr+xapi-tools@adlnet.gov",380 "name": "xapi-tools",381 "objectType": "Agent"382 },383 "id": "8d5a014c-0d8d-4bca-be53-d6dba346519b"384 },385 /* Object - Simple Statment with Object as an Agent */386 "Object-Agent": {387 "object": {388 "mbox": "mailto:instructor@example.com",389 "name": "Instructor",390 "objectType": "Agent"391 },392 "verb": {393 "display": {394 "en-US": "asked"395 },396 "id": "http://adlnet.gov/expapi/verbs/asked"397 },398 "version": "1.0.1",399 "timestamp": "2016-01-21T15:59:29.050208+00:00",400 "actor": {401 "mbox": "mailto:user@example.com",402 "objectType": "Agent"403 },404 "stored": "2016-01-21T15:59:29.050208+00:00",405 "authority": {406 "mbox": "mailto:tyler.mulligan.ctr+xapi-tools@adlnet.gov",407 "name": "xapi-tools",408 "objectType": "Agent"409 },410 "id": "f3d9ed54-c057-11e5-b464-005056a25e99"411 },412 /* Object - Simple Statement with Object as a Group */413 "Object-Group": {414 "object": {415 "member": [416 {417 "account": {418 "homePage": "http://www.example.com",419 "name": "13936749"420 },421 "name": "Bob",422 "objectType": "Agent"423 },424 {425 "openid": "http://carol.openid.example.org/",426 "name": "Carol",427 "objectType": "Agent"428 },429 {430 "mbox": "mailto:tom@example.com",431 "name": "Tom",432 "objectType": "Agent"433 },434 {435 "mbox_sha1sum": "ebd31e95054c018b10727de4db3ef2ec3a016ee9",436 "name": "Alice",437 "objectType": "Agent"438 }439 ],440 "name": "Students",441 "objectType": "Group"442 },443 "verb": {444 "display": {445 "en-US": "asked"446 },447 "id": "http://adlnet.gov/expapi/verbs/asked"448 },449 "version": "1.0.1",450 "timestamp": "2016-01-21T15:59:29.027893+00:00",451 "actor": {452 "mbox": "mailto:user@example.com",453 "objectType": "Agent"454 },455 "stored": "2016-01-21T15:59:29.027893+00:00",456 "authority": {457 "mbox": "mailto:tyler.mulligan.ctr+xapi-tools@adlnet.gov",458 "name": "xapi-tools",459 "objectType": "Agent"460 },461 "id": "f3d68632-c057-11e5-b464-005056a25e99"462 },463 /* Object - Simple Statement with Object as a Statement Reference*/464 "Object-StatementRef": {465 "object": {466 "id": "12345678-1234-5678-1234-567812345678",467 "objectType": "StatementRef"468 },469 "actor": {470 "mbox": "mailto:user@example.com",471 "objectType": "Agent"472 },473 "verb": {474 "id": "http://adlnet.gov/expapi/verbs/asked",475 "display": {476 "en-US": "asked"477 }478 },479 "version": "1.0.1",480 "timestamp": "2016-01-21T15:59:29.017173+00:00",481 "stored": "2016-01-21T15:59:29.017173+00:00",482 "authority": {483 "mbox": "mailto:tyler.mulligan.ctr+xapi-tools@adlnet.gov",484 "name": "xapi-tools",485 "objectType": "Agent"486 },487 "id": "f3d4e214-c057-11e5-b464-005056a25e99"488 },489 /* Object - Simple Statement with Object as a Sub-Statement */490 "Object-Sub-Statement": {491 "verb": {492 "id": "http://example.com/planned",493 "display": {494 "en-US": "planned"495 }496 },497 "version": "1.0.1",498 "timestamp": "2016-01-26T19:28:25.096469+00:00",499 "object": {500 "verb": {501 "id": "http://example.com/visited",502 "display": {503 "en-US": "will visit"504 }505 },506 "actor": {507 "mbox": "mailto:test@example.com",508 "objectType": "Agent"509 },510 "object": {511 "definition": {512 "name": {513 "en-US": "Some Awesome Website"514 }515 },516 "id": "http://example.com/website",517 "objectType": "Activity"518 },519 "objectType": "SubStatement"520 },521 "actor": {522 "mbox": "mailto:test@example.com",523 "objectType": "Agent"524 },525 "stored": "2016-01-26T19:28:25.096469+00:00",526 "authority": {527 "mbox": "mailto:tyler.mulligan.ctr+xapi-tools@adlnet.gov",528 "name": "xapi-tools",529 "objectType": "Agent"530 },531 "id": "29cf2f86-3f41-4efc-8f64-866c3ce8899c"532 },533 /* Simple statement with Object as a Sub-Statement whose Object is a Statement Reference*/534 "Object-Sub-Statement-with-StatementRef": {535 "verb": {536 "id": "http://verb.com/do0"537 },538 "version": "1.0.1",539 "timestamp": "2016-01-25T20:28:19.597807+00:00",540 "object": {541 "verb": {542 "id": "http://example.com/confirmed",543 "display": {544 "en": "confirmed"545 }546 },547 "actor": {548 "mbox": "mailto:agent@example.com",549 "objectType": "Agent"550 },551 "object": {552 "id": "9e13cefd-53d3-4eac-b5ed-2cf6693903bb",553 "objectType": "StatementRef"554 },555 "objectType": "SubStatement"556 },557 "actor": {558 "mbox": "mailto:tom@tom.com",559 "objectType": "Agent"560 },561 "stored": "2016-01-25T20:28:19.597807+00:00",562 "authority": {563 "mbox": "mailto:tyler.mulligan.ctr+xapi-tools@adlnet.gov",564 "name": "xapi-tools",565 "objectType": "Agent"566 },567 "id": "b5f9eb2c-588f-48b0-b845-71ed17cd074e"568 },569 /* Result section */570 "Result": {571 "verb": {572 "id": "http://adlnet.gov/expapi/verbs/attempted",573 "display": {574 "en-US": "attempted"575 }576 },577 "version": "1.0.1",578 "timestamp": "2016-01-25T20:40:21.350153+00:00",579 "object": {580 "definition": {581 "name": {582 "en-US": "simple CBT course"583 },584 "description": {585 "en-US": "A fictitious example CBT course."586 }587 },588 "id": "http://example.adlnet.gov/xapi/example/simpleCBT",589 "objectType": "Activity"590 },591 "actor": {592 "mbox": "mailto:example.learner@adlnet.gov",593 "name": "Example Learner",594 "objectType": "Agent"595 },596 "stored": "2016-01-25T20:40:21.350153+00:00",597 "result": {598 "completion": true,599 "score": {600 "scaled": 0.95601 },602 "success": true603 },604 "id": "0c808355-396c-4a3f-9bf2-5334e0f71493",605 "authority": {606 "mbox": "mailto:tyler.mulligan.ctr+xapi-tools@adlnet.gov",607 "name": "xapi-tools",608 "objectType": "Agent"609 }610 },611 /* A long example statement showcasing most of the properties available. This example shows a statement returned by an LRS including the authority and stored properties set by the LRS */612 "Long-Example": {613 "id": "6690e6c9-3ef0-4ed3-8b37-7f3964730bee",614 "actor": {615 "name": "Team PB",616 "mbox": "mailto:teampb@example.com",617 "member": [618 {619 "name": "Andrew Downes",620 "account": {621 "homePage": "http://www.example.com",622 "name": "13936749"623 },624 "objectType": "Agent"625 },626 {627 "name": "Toby Nichols",628 "openid": "http://toby.openid.example.org/",629 "objectType": "Agent"630 },631 {632 "name": "Ena Hills",633 "mbox_sha1sum": "ebd31e95054c018b10727ccffd2ef2ec3a016ee9",634 "objectType": "Agent"635 }636 ],637 "objectType": "Group"638 },639 "verb": {640 "id": "http://adlnet.gov/expapi/verbs/attended",641 "display": {642 "en-GB": "attended",643 "en-US": "attended"644 }645 },646 "result": {647 "extensions": {648 "http://example.com/profiles/meetings/resultextensions/minuteslocation": "X:\\meetings\\minutes\\examplemeeting.one"649 },650 "success": true,651 "completion": true,652 "response": "We agreed on some example actions.",653 "duration": "PT1H0M0S"654 },655 "context": {656 "registration": "ec531277-b57b-4c15-8d91-d292c5b2b8f7",657 "contextActivities": {658 "parent": [659 {660 "id": "http://www.example.com/meetings/series/267",661 "objectType": "Activity"662 }663 ],664 "category": [665 {666 "id": "http://www.example.com/meetings/categories/teammeeting",667 "objectType": "Activity",668 "definition": {669 "name": {670 "en": "team meeting"671 },672 "description": {673 "en": "A category of meeting used for regular team meetings."674 },675 "type": "http://example.com/expapi/activities/meetingcategory"676 }677 }678 ],679 "other": [680 {681 "id": "http://www.example.com/meetings/occurances/34257",682 "objectType": "Activity"683 },684 {685 "id": "http://www.example.com/meetings/occurances/3425567",686 "objectType": "Activity"687 }688 ]689 },690 "instructor" :691 {692 "name": "Andrew Downes",693 "account": {694 "homePage": "http://www.example.com",695 "name": "13936749"696 },697 "objectType": "Agent"698 },699 "team":700 {701 "name": "Team PB",702 "mbox": "mailto:teampb@example.com",703 "objectType": "Group"704 },705 "platform" : "Example virtual meeting software",706 "language" : "tlh",707 "statement" : {708 "objectType":"StatementRef",709 "id" :"6690e6c9-3ef0-4ed3-8b37-7f3964730bee"710 }711 },712 "timestamp": "2013-05-18T05:32:34.804Z",713 "stored": "2013-05-18T05:32:34.804Z",714 "authority": {715 "account": {716 "homePage": "http://cloud.scorm.com/",717 "name": "anonymous"718 },719 "objectType": "Agent"720 },721 "version": "1.0.0",722 "object": {723 "id": "http://www.example.com/meetings/occurances/34534",724 "definition": {725 "extensions": {726 "http://example.com/profiles/meetings/activitydefinitionextensions/room": {"name": "Kilby", "id" : "http://example.com/rooms/342"}727 },728 "name": {729 "en-GB": "example meeting",730 "en-US": "example meeting"731 },732 "description": {733 "en-GB": "An example meeting that happened on a specific occasion with certain people present.",734 "en-US": "An example meeting that happened on a specific occasion with certain people present."735 },736 "type": "http://adlnet.gov/expapi/activities/meeting",737 "moreInfo": "http://virtualmeeting.example.com/345256"738 },739 "objectType": "Activity"740 }741 },742 }...

Full Screen

Full Screen

predicate-test.js

Source:predicate-test.js Github

copy

Full Screen

1/**2 * Copyright (c) 2015-present, Facebook, Inc.3 *4 * This source code is licensed under the MIT license found in the5 * LICENSE file in the root directory of this source tree.6 */7import { describe, it } from 'mocha';8import { expect } from 'chai';9import {10 GraphQLScalarType,11 GraphQLEnumType,12 GraphQLInputObjectType,13 GraphQLInterfaceType,14 GraphQLObjectType,15 GraphQLUnionType,16 GraphQLList,17 GraphQLNonNull,18 GraphQLString,19 isType,20 isScalarType,21 isObjectType,22 isInterfaceType,23 isUnionType,24 isEnumType,25 isInputObjectType,26 isListType,27 isNonNullType,28 isInputType,29 isOutputType,30 isLeafType,31 isCompositeType,32 isAbstractType,33 isWrappingType,34 isNullableType,35 isNamedType,36 assertType,37 assertScalarType,38 assertObjectType,39 assertInterfaceType,40 assertUnionType,41 assertEnumType,42 assertInputObjectType,43 assertListType,44 assertNonNullType,45 assertInputType,46 assertOutputType,47 assertLeafType,48 assertCompositeType,49 assertAbstractType,50 assertWrappingType,51 assertNullableType,52 assertNamedType,53 getNullableType,54 getNamedType,55} from '../';56const ObjectType = new GraphQLObjectType({ name: 'Object' });57const InterfaceType = new GraphQLInterfaceType({ name: 'Interface' });58const UnionType = new GraphQLUnionType({ name: 'Union', types: [ObjectType] });59const EnumType = new GraphQLEnumType({ name: 'Enum', values: { foo: {} } });60const InputObjectType = new GraphQLInputObjectType({ name: 'InputObject' });61const ScalarType = new GraphQLScalarType({62 name: 'Scalar',63 serialize() {},64 parseValue() {},65 parseLiteral() {},66});67describe('Type predicates', () => {68 describe('isType', () => {69 it('returns true for unwrapped types', () => {70 expect(isType(GraphQLString)).to.equal(true);71 expect(() => assertType(GraphQLString)).not.to.throw();72 expect(isType(ObjectType)).to.equal(true);73 expect(() => assertType(ObjectType)).not.to.throw();74 });75 it('returns true for wrapped types', () => {76 expect(isType(GraphQLNonNull(GraphQLString))).to.equal(true);77 expect(() => assertType(GraphQLNonNull(GraphQLString))).not.to.throw();78 });79 it('returns false for type classes (rather than instances)', () => {80 expect(isType(GraphQLObjectType)).to.equal(false);81 expect(() => assertType(GraphQLObjectType)).to.throw();82 });83 it('returns false for random garbage', () => {84 expect(isType({ what: 'is this' })).to.equal(false);85 expect(() => assertType({ what: 'is this' })).to.throw();86 });87 });88 describe('isScalarType', () => {89 it('returns true for spec defined scalar', () => {90 expect(isScalarType(GraphQLString)).to.equal(true);91 expect(() => assertScalarType(GraphQLString)).not.to.throw();92 });93 it('returns true for custom scalar', () => {94 expect(isScalarType(ScalarType)).to.equal(true);95 expect(() => assertScalarType(ScalarType)).not.to.throw();96 });97 it('returns false for wrapped scalar', () => {98 expect(isScalarType(GraphQLList(ScalarType))).to.equal(false);99 expect(() => assertScalarType(GraphQLList(ScalarType))).to.throw();100 });101 it('returns false for non-scalar', () => {102 expect(isScalarType(EnumType)).to.equal(false);103 expect(() => assertScalarType(EnumType)).to.throw();104 });105 });106 describe('isObjectType', () => {107 it('returns true for object type', () => {108 expect(isObjectType(ObjectType)).to.equal(true);109 expect(() => assertObjectType(ObjectType)).not.to.throw();110 });111 it('returns false for wrapped object type', () => {112 expect(isObjectType(GraphQLList(ObjectType))).to.equal(false);113 expect(() => assertObjectType(GraphQLList(ObjectType))).to.throw();114 });115 it('returns false for non-object type', () => {116 expect(isObjectType(InterfaceType)).to.equal(false);117 expect(() => assertObjectType(InterfaceType)).to.throw();118 });119 });120 describe('isInterfaceType', () => {121 it('returns true for interface type', () => {122 expect(isInterfaceType(InterfaceType)).to.equal(true);123 expect(() => assertInterfaceType(InterfaceType)).not.to.throw();124 });125 it('returns false for wrapped interface type', () => {126 expect(isInterfaceType(GraphQLList(InterfaceType))).to.equal(false);127 expect(() => assertInterfaceType(GraphQLList(InterfaceType))).to.throw();128 });129 it('returns false for non-interface type', () => {130 expect(isInterfaceType(ObjectType)).to.equal(false);131 expect(() => assertInterfaceType(ObjectType)).to.throw();132 });133 });134 describe('isUnionType', () => {135 it('returns true for union type', () => {136 expect(isUnionType(UnionType)).to.equal(true);137 expect(() => assertUnionType(UnionType)).not.to.throw();138 });139 it('returns false for wrapped union type', () => {140 expect(isUnionType(GraphQLList(UnionType))).to.equal(false);141 expect(() => assertUnionType(GraphQLList(UnionType))).to.throw();142 });143 it('returns false for non-union type', () => {144 expect(isUnionType(ObjectType)).to.equal(false);145 expect(() => assertUnionType(ObjectType)).to.throw();146 });147 });148 describe('isEnumType', () => {149 it('returns true for enum type', () => {150 expect(isEnumType(EnumType)).to.equal(true);151 expect(() => assertEnumType(EnumType)).not.to.throw();152 });153 it('returns false for wrapped enum type', () => {154 expect(isEnumType(GraphQLList(EnumType))).to.equal(false);155 expect(() => assertEnumType(GraphQLList(EnumType))).to.throw();156 });157 it('returns false for non-enum type', () => {158 expect(isEnumType(ScalarType)).to.equal(false);159 expect(() => assertEnumType(ScalarType)).to.throw();160 });161 });162 describe('isInputObjectType', () => {163 it('returns true for input object type', () => {164 expect(isInputObjectType(InputObjectType)).to.equal(true);165 expect(() => assertInputObjectType(InputObjectType)).not.to.throw();166 });167 it('returns false for wrapped input object type', () => {168 expect(isInputObjectType(GraphQLList(InputObjectType))).to.equal(false);169 expect(() =>170 assertInputObjectType(GraphQLList(InputObjectType)),171 ).to.throw();172 });173 it('returns false for non-input-object type', () => {174 expect(isInputObjectType(ObjectType)).to.equal(false);175 expect(() => assertInputObjectType(ObjectType)).to.throw();176 });177 });178 describe('isListType', () => {179 it('returns true for a list wrapped type', () => {180 expect(isListType(GraphQLList(ObjectType))).to.equal(true);181 expect(() => assertListType(GraphQLList(ObjectType))).not.to.throw();182 });183 it('returns false for an unwrapped type', () => {184 expect(isListType(ObjectType)).to.equal(false);185 expect(() => assertListType(ObjectType)).to.throw();186 });187 it('returns true for a non-list wrapped type', () => {188 expect(isListType(GraphQLNonNull(GraphQLList(ObjectType)))).to.equal(189 false,190 );191 expect(() =>192 assertListType(GraphQLNonNull(GraphQLList(ObjectType))),193 ).to.throw();194 });195 });196 describe('isNonNullType', () => {197 it('returns true for a non-null wrapped type', () => {198 expect(isNonNullType(GraphQLNonNull(ObjectType))).to.equal(true);199 expect(() =>200 assertNonNullType(GraphQLNonNull(ObjectType)),201 ).not.to.throw();202 });203 it('returns false for an unwrapped type', () => {204 expect(isNonNullType(ObjectType)).to.equal(false);205 expect(() => assertNonNullType(ObjectType)).to.throw();206 });207 it('returns true for a not non-null wrapped type', () => {208 expect(isNonNullType(GraphQLList(GraphQLNonNull(ObjectType)))).to.equal(209 false,210 );211 expect(() =>212 assertNonNullType(GraphQLList(GraphQLNonNull(ObjectType))),213 ).to.throw();214 });215 });216 describe('isInputType', () => {217 it('returns true for an input type', () => {218 expect(isInputType(InputObjectType)).to.equal(true);219 expect(() => assertInputType(InputObjectType)).not.to.throw();220 });221 it('returns true for a wrapped input type', () => {222 expect(isInputType(GraphQLList(InputObjectType))).to.equal(true);223 expect(() =>224 assertInputType(GraphQLList(InputObjectType)),225 ).not.to.throw();226 expect(isInputType(GraphQLNonNull(InputObjectType))).to.equal(true);227 expect(() =>228 assertInputType(GraphQLNonNull(InputObjectType)),229 ).not.to.throw();230 });231 it('returns false for an output type', () => {232 expect(isInputType(ObjectType)).to.equal(false);233 expect(() => assertInputType(ObjectType)).to.throw();234 });235 it('returns false for a wrapped output type', () => {236 expect(isInputType(GraphQLList(ObjectType))).to.equal(false);237 expect(() => assertInputType(GraphQLList(ObjectType))).to.throw();238 expect(isInputType(GraphQLNonNull(ObjectType))).to.equal(false);239 expect(() => assertInputType(GraphQLNonNull(ObjectType))).to.throw();240 });241 });242 describe('isOutputType', () => {243 it('returns true for an output type', () => {244 expect(isOutputType(ObjectType)).to.equal(true);245 expect(() => assertOutputType(ObjectType)).not.to.throw();246 });247 it('returns true for a wrapped output type', () => {248 expect(isOutputType(GraphQLList(ObjectType))).to.equal(true);249 expect(() => assertOutputType(GraphQLList(ObjectType))).not.to.throw();250 expect(isOutputType(GraphQLNonNull(ObjectType))).to.equal(true);251 expect(() => assertOutputType(GraphQLNonNull(ObjectType))).not.to.throw();252 });253 it('returns false for an input type', () => {254 expect(isOutputType(InputObjectType)).to.equal(false);255 expect(() => assertOutputType(InputObjectType)).to.throw();256 });257 it('returns false for a wrapped input type', () => {258 expect(isOutputType(GraphQLList(InputObjectType))).to.equal(false);259 expect(() => assertOutputType(GraphQLList(InputObjectType))).to.throw();260 expect(isOutputType(GraphQLNonNull(InputObjectType))).to.equal(false);261 expect(() =>262 assertOutputType(GraphQLNonNull(InputObjectType)),263 ).to.throw();264 });265 });266 describe('isLeafType', () => {267 it('returns true for scalar and enum types', () => {268 expect(isLeafType(ScalarType)).to.equal(true);269 expect(() => assertLeafType(ScalarType)).not.to.throw();270 expect(isLeafType(EnumType)).to.equal(true);271 expect(() => assertLeafType(EnumType)).not.to.throw();272 });273 it('returns false for wrapped leaf type', () => {274 expect(isLeafType(GraphQLList(ScalarType))).to.equal(false);275 expect(() => assertLeafType(GraphQLList(ScalarType))).to.throw();276 });277 it('returns false for non-leaf type', () => {278 expect(isLeafType(ObjectType)).to.equal(false);279 expect(() => assertLeafType(ObjectType)).to.throw();280 });281 it('returns false for wrapped non-leaf type', () => {282 expect(isLeafType(GraphQLList(ObjectType))).to.equal(false);283 expect(() => assertLeafType(GraphQLList(ObjectType))).to.throw();284 });285 });286 describe('isCompositeType', () => {287 it('returns true for object, interface, and union types', () => {288 expect(isCompositeType(ObjectType)).to.equal(true);289 expect(() => assertCompositeType(ObjectType)).not.to.throw();290 expect(isCompositeType(InterfaceType)).to.equal(true);291 expect(() => assertCompositeType(InterfaceType)).not.to.throw();292 expect(isCompositeType(UnionType)).to.equal(true);293 expect(() => assertCompositeType(UnionType)).not.to.throw();294 });295 it('returns false for wrapped composite type', () => {296 expect(isCompositeType(GraphQLList(ObjectType))).to.equal(false);297 expect(() => assertCompositeType(GraphQLList(ObjectType))).to.throw();298 });299 it('returns false for non-composite type', () => {300 expect(isCompositeType(InputObjectType)).to.equal(false);301 expect(() => assertCompositeType(InputObjectType)).to.throw();302 });303 it('returns false for wrapped non-composite type', () => {304 expect(isCompositeType(GraphQLList(InputObjectType))).to.equal(false);305 expect(() =>306 assertCompositeType(GraphQLList(InputObjectType)),307 ).to.throw();308 });309 });310 describe('isAbstractType', () => {311 it('returns true for interface and union types', () => {312 expect(isAbstractType(InterfaceType)).to.equal(true);313 expect(() => assertAbstractType(InterfaceType)).not.to.throw();314 expect(isAbstractType(UnionType)).to.equal(true);315 expect(() => assertAbstractType(UnionType)).not.to.throw();316 });317 it('returns false for wrapped abstract type', () => {318 expect(isAbstractType(GraphQLList(InterfaceType))).to.equal(false);319 expect(() => assertAbstractType(GraphQLList(InterfaceType))).to.throw();320 });321 it('returns false for non-abstract type', () => {322 expect(isAbstractType(ObjectType)).to.equal(false);323 expect(() => assertAbstractType(ObjectType)).to.throw();324 });325 it('returns false for wrapped non-abstract type', () => {326 expect(isAbstractType(GraphQLList(ObjectType))).to.equal(false);327 expect(() => assertAbstractType(GraphQLList(ObjectType))).to.throw();328 });329 });330 describe('isWrappingType', () => {331 it('returns true for list and non-null types', () => {332 expect(isWrappingType(GraphQLList(ObjectType))).to.equal(true);333 expect(() => assertWrappingType(GraphQLList(ObjectType))).not.to.throw();334 expect(isWrappingType(GraphQLNonNull(ObjectType))).to.equal(true);335 expect(() =>336 assertWrappingType(GraphQLNonNull(ObjectType)),337 ).not.to.throw();338 });339 it('returns false for unwrapped types', () => {340 expect(isWrappingType(ObjectType)).to.equal(false);341 expect(() => assertWrappingType(ObjectType)).to.throw();342 });343 });344 describe('isNullableType', () => {345 it('returns true for unwrapped types', () => {346 expect(isNullableType(ObjectType)).to.equal(true);347 expect(() => assertNullableType(ObjectType)).not.to.throw();348 });349 it('returns true for list of non-null types', () => {350 expect(isNullableType(GraphQLList(GraphQLNonNull(ObjectType)))).to.equal(351 true,352 );353 expect(() =>354 assertNullableType(GraphQLList(GraphQLNonNull(ObjectType))),355 ).not.to.throw();356 });357 it('returns false for non-null types', () => {358 expect(isNullableType(GraphQLNonNull(ObjectType))).to.equal(false);359 expect(() => assertNullableType(GraphQLNonNull(ObjectType))).to.throw();360 });361 });362 describe('getNullableType', () => {363 it('returns undefined for no type', () => {364 expect(getNullableType()).to.equal(undefined);365 expect(getNullableType(null)).to.equal(undefined);366 });367 it('returns self for a nullable type', () => {368 expect(getNullableType(ObjectType)).to.equal(ObjectType);369 const listOfObj = GraphQLList(ObjectType);370 expect(getNullableType(listOfObj)).to.equal(listOfObj);371 });372 it('unwraps non-null type', () => {373 expect(getNullableType(GraphQLNonNull(ObjectType))).to.equal(ObjectType);374 });375 });376 describe('isNamedType', () => {377 it('returns true for unwrapped types', () => {378 expect(isNamedType(ObjectType)).to.equal(true);379 expect(() => assertNamedType(ObjectType)).not.to.throw();380 });381 it('returns false for list and non-null types', () => {382 expect(isNamedType(GraphQLList(ObjectType))).to.equal(false);383 expect(() => assertNamedType(GraphQLList(ObjectType))).to.throw();384 expect(isNamedType(GraphQLNonNull(ObjectType))).to.equal(false);385 expect(() => assertNamedType(GraphQLNonNull(ObjectType))).to.throw();386 });387 });388 describe('getNamedType', () => {389 it('returns undefined for no type', () => {390 expect(getNamedType()).to.equal(undefined);391 expect(getNamedType(null)).to.equal(undefined);392 });393 it('returns self for a unwrapped type', () => {394 expect(getNamedType(ObjectType)).to.equal(ObjectType);395 });396 it('unwraps wrapper types', () => {397 expect(getNamedType(GraphQLNonNull(ObjectType))).to.equal(ObjectType);398 expect(getNamedType(GraphQLList(ObjectType))).to.equal(ObjectType);399 });400 it('unwraps deeply wrapper types', () => {401 expect(402 getNamedType(GraphQLNonNull(GraphQLList(GraphQLNonNull(ObjectType)))),403 ).to.equal(ObjectType);404 });405 });...

Full Screen

Full Screen

pouchdb.cronapi.js

Source:pouchdb.cronapi.js Github

copy

Full Screen

1(function () {2 'use strict';3 /**4 * @categoryName {{localDatabase}}5 */6 this.cronapi.pouchdb = {};7 //Ref: https://pouchdb.com/8 9 /**10 * @type function11 * @name {{createLocalDatabase}}12 * @description {{createLocalDatabaseDescription}}13 * @returns {ObjectType.OBJECT}14 */15 this.cronapi.pouchdb.createLocalDatabase = function (/** @type {ObjectType.STRING} @description {{databaseName}} */ dbName, /** @type {ObjectType.STRING} @description {{adapterType}} @blockType util_dropdown @keys idb|websql|cordova-sqlite|memory|localstorage @values idb|websql|cordova-sqlite|memory|localstorage */ adapterType) {16 let db = new PouchDB(dbName || 'myDB.db', { adapter: adapterType });17 return db;18 };19 /**20 * @type function21 * @name {{createRemoteDatabase}}22 * @description {{createRemoteDatabaseDescription}}23 * @returns {ObjectType.OBJECT}24 */25 this.cronapi.pouchdb.createRemoteDatabase = function (/** @type {ObjectType.STRING} @description {{databaseName}} */ dbName,/** @type {ObjectType.STRING} @description {{username}} */ username, /** @type {ObjectType.STRING} @description {{password}} */ password) {26 let options = {27 auth: {28 username: username,29 password: password30 }31 };32 let db = new PouchDB(dbName || 'myDB.db', options);33 return db;34 };35 /**36 * @type function37 * @name {{getDatabaseInfo}}38 * @description {{getDatabaseInfoDescription}}39 */40 this.cronapi.pouchdb.getDatabaseInfo = function (/** @type {ObjectType.OBJECT} @description {{databaseRef}} */ db, /**@type {ObjectType.STATEMENTSENDER} @description {{error}} */ statementError, /**@type {ObjectType.STATEMENTSENDER} @description {{success}} */ statementSuccess) {41 db.info(function (err, response) {42 if (err) {43 statementError(err);44 } else {45 statementSuccess(response);46 }47 });48 };49 /**50 * @type function51 * @name {{compactDatabase}}52 * @description {{compactDatabaseDescription}}53 */54 this.cronapi.pouchdb.compactDatabase = function (/** @type {ObjectType.OBJECT} @description {{databaseRef}} */ db, /** @type {ObjectType.OBJECT} @description {{options}} */ options, /**@type {ObjectType.STATEMENTSENDER} @description {{error}} */ statementError, /**@type {ObjectType.STATEMENTSENDER} @description {{success}} */ statementSuccess) {55 db.compact(options, function (err, response) {56 if (err) {57 statementError(err);58 } else {59 statementSuccess(response);60 }61 });62 };63 /**64 * @type function65 * @name {{deleteDatabase}}66 * @description {{deleteDatabaseDescription}}67 */68 this.cronapi.pouchdb.deleteDatabase = function (/** @type {ObjectType.OBJECT} @description {{databaseRef}} */ db, /** @type {ObjectType.OBJECT} @description {{options}} */ options, /**@type {ObjectType.STATEMENTSENDER} @description {{error}} */ statementError, /**@type {ObjectType.STATEMENTSENDER} @description {{success}} */ statementSuccess) {69 db.destroy(options, function (err, response) {70 if (err) {71 statementError(err);72 } else {73 statementSuccess(response);74 }75 });76 };77 /**78 * @type function79 * @name {{updateDoc}}80 * @description {{updateDocDescription}}81 */82 this.cronapi.pouchdb.updateDoc = function (/** @type {ObjectType.OBJECT} @description {{databaseRef}} */ db, /** @type {ObjectType.OBJECT} @description {{doc}} */ doc, /** @type {ObjectType.OBJECT} @description {{options}} */ options, /**@type {ObjectType.STATEMENTSENDER} @description {{error}} */ statementError, /**@type {ObjectType.STATEMENTSENDER} @description {{success}} */ statementSuccess) {83 84 if(options == null) options = {};85 db.put(doc, options, function (err, response) {86 if (err) {87 statementError(err);88 } else {89 statementSuccess(response);90 }91 });92 };93 /**94 * @type function95 * @name {{createDoc}}96 * @description {{createDocDescription}}97 */98 this.cronapi.pouchdb.createDoc = function (/** @type {ObjectType.OBJECT} @description {{databaseRef}} */ db, /** @type {ObjectType.OBJECT} @description {{doc}} */ doc, /** @type {ObjectType.OBJECT} @description {{options}} */ options, /**@type {ObjectType.STATEMENTSENDER} @description {{error}} */ statementError, /**@type {ObjectType.STATEMENTSENDER} @description {{success}} */ statementSuccess) {99 db.post(doc, options, function (err, response) {100 if (err) {101 statementError(err);102 } else {103 statementSuccess(response);104 }105 });106 };107 /**108 * @type function109 * @name {{createDocLote}}110 * @description {{createDocLoteDescription}}111 */112 this.cronapi.pouchdb.createDocLote = function (/** @type {ObjectType.OBJECT} @description {{databaseRef}} */ db, /** @type {ObjectType.OBJECT} @description {{docs}} */ docs, /** @type {ObjectType.OBJECT} @description {{options}} */ options, /**@type {ObjectType.STATEMENTSENDER} @description {{error}} */ statementError, /**@type {ObjectType.STATEMENTSENDER} @description {{success}} */ statementSuccess) {113 db.bulkDocs(docs, options , function (err, response) {114 if (err) {115 statementError(err);116 } else {117 statementSuccess(response);118 }119 });120 };121 /**122 * @type function123 * @name {{putAttachment}}124 * @description {{putAttachmentDescription}}125 */126 this.cronapi.pouchdb.putAttachment = function (/** @type {ObjectType.OBJECT} @description {{databaseRef}} */ db, /** @type {ObjectType.STRING} @description {{docId}} */ docId,/** @type {ObjectType.STRING} @description {{docRev}} */ docRev, /** @type {ObjectType.STRING} @description {{attachmentId}} */ attachmentId, /** @type {ObjectType.OBJECT} @description {{attachment}} */ attachment, /** @type {ObjectType.STRING} @description {{attachmentType}} */ attachmentType, /**@type {ObjectType.STATEMENTSENDER} @description {{error}} */ statementError, /**@type {ObjectType.STATEMENTSENDER} @description {{success}} */ statementSuccess) {127 db.putAttachment(docId, attachmentId, docRev, attachment, attachmentType, function (err, response) {128 if (err) {129 statementError(err);130 } else {131 statementSuccess(response);132 }133 });134 };135 /**136 * @type function137 * @name {{getAttachment}}138 * @description {{getAttachmentDescription}}139 */140 this.cronapi.pouchdb.getAttachment = function (/** @type {ObjectType.OBJECT} @description {{databaseRef}} */ db, /** @type {ObjectType.STRING} @description {{docId}} */ docId, /** @type {ObjectType.STRING} @description {{attachmentId}} */ attachmentId, /**@type {ObjectType.STATEMENTSENDER} @description {{error}} */ statementError, /**@type {ObjectType.STATEMENTSENDER} @description {{success}} */ statementSuccess) {141 db.getAttachment(docId, attachmentId, function (err, response) {142 if (err) {143 statementError(err);144 } else {145 statementSuccess(response);146 }147 });148 };149 /**150 * @type function151 * @name {{removeAttachment}}152 * @description {{removeAttachmentDescription}}153 */154 this.cronapi.pouchdb.removeAttachment = function (/** @type {ObjectType.OBJECT} @description {{databaseRef}} */ db, /** @type {ObjectType.STRING} @description {{docId}} */ docId, /** @type {ObjectType.STRING} @description {{attachmentId}} */ attachmentId,/** @type {ObjectType.STRING} @description {{docRev}} */ docRev, /**@type {ObjectType.STATEMENTSENDER} @description {{error}} */ statementError, /**@type {ObjectType.STATEMENTSENDER} @description {{success}} */ statementSuccess) {155 db.removeAttachment(docId, attachmentId, docRev, function (err, response) {156 if (err) {157 statementError(err);158 } else {159 statementSuccess(response);160 }161 });162 };163 /**164 * @type function165 * @name {{getDoc}}166 * @description {{getDocDescription}}167 */168 this.cronapi.pouchdb.getDoc = function (/** @type {ObjectType.OBJECT} @description {{databaseRef}} */ db, /** @type {ObjectType.STRING} @description {{docId}} */ docId, /** @type {ObjectType.OBJECT} @description {{options}} */ options, /**@type {ObjectType.STATEMENTSENDER} @description {{error}} */ statementError, /**@type {ObjectType.STATEMENTSENDER} @description {{success}} */ statementSuccess) {169 db.get(docId, options, function (err, response) {170 if (err) {171 statementError(err);172 } else {173 statementSuccess(response);174 }175 });176 };177 /**178 * @type function179 * @name {{getAllDoc}}180 * @description {{getAllDocDescription}}181 */182 this.cronapi.pouchdb.getAllDoc = function (/** @type {ObjectType.OBJECT} @description {{databaseRef}} */ db, /** @type {ObjectType.OBJECT} @description {{options}} */ options, /**@type {ObjectType.STATEMENTSENDER} @description {{error}} */ statementError, /**@type {ObjectType.STATEMENTSENDER} @description {{success}} */ statementSuccess) {183 db.allDocs(options, function (err, response) {184 if (err) {185 statementError(err);186 } else {187 statementSuccess(response);188 }189 });190 };191 /**192 * @type function193 * @name {{notifyChanges}}194 * @description {{notifyChangesDescription}}195 * @returns {ObjectType.OBJECT}196 */197 this.cronapi.pouchdb.notifyChanges = function (/** @type {ObjectType.OBJECT} @description {{databaseRef}} */ db, /** @type {ObjectType.OBJECT} @description {{options}} */ options, /**@type {ObjectType.STATEMENTSENDER} @description {{error}} */ statementError, /**@type {ObjectType.STATEMENTSENDER} @description {{statementChange}} */ statementChange, /**@type {ObjectType.STATEMENTSENDER} @description {{statementComplete}} */ statementComplete) {198 let changes = db.changes(options)199 .on('change', function (change) {200 statementChange(change);201 }).on('complete', function (info) {202 statementComplete(info);203 }).on('error', function (err) {204 statementError(err)205 });206 return changes;207 };208 /**209 * @type function210 * @name {{cancelNotifyChanges}}211 * @description {{cancelNotifyChangesDescription}}212 */213 this.cronapi.pouchdb.cancelNotifyChanges = function (/** @type {ObjectType.OBJECT} @description {{changesRef}} */ changesRef) {214 changesRef.cancel();215 };216 /**217 * @type function218 * @name {{deleteDoc}}219 * @description {{deleteDocDescription}}220 */221 this.cronapi.pouchdb.deleteDoc = function (/** @type {ObjectType.OBJECT} @description {{databaseRef}} */ db, /** @type {ObjectType.OBJECT} @description {{doc}} */ doc, /** @type {ObjectType.OBJECT} @description {{options}} */ options, /**@type {ObjectType.STATEMENTSENDER} @description {{error}} */ statementError, /**@type {ObjectType.STATEMENTSENDER} @description {{success}} */ statementSuccess) {222 db.remove(doc, options, function (err, response) {223 if (err) {224 statementError(err);225 } else {226 statementSuccess(response);227 }228 });229 };230 /**231 * @type function232 * @name {{deleteDocById}}233 * @description {{deleteDocByIdDescription}}234 */235 this.cronapi.pouchdb.deleteByIdDoc = function (/** @type {ObjectType.OBJECT} @description {{databaseRef}} */ db, /** @type {ObjectType.STRING} @description {{docId}} */ docId, /** @type {ObjectType.STRING} @description {{revId}} */ revId, /** @type {ObjectType.OBJECT} @description {{options}} */ options, /**@type {ObjectType.STATEMENTSENDER} @description {{error}} */ statementError, /**@type {ObjectType.STATEMENTSENDER} @description {{success}} */ statementSuccess) {236 db.remove(docId, revId, options, function (err, response) {237 if (err) {238 statementError(err);239 } else {240 statementSuccess(response);241 }242 });243 };244 /**245 * @type function246 * @name {{query}}247 * @description {{queryDescription}}248 */249 this.cronapi.pouchdb.query = function (/** @type {ObjectType.OBJECT} @description {{databaseRef}} */ db, /**@type {ObjectType.STATEMENTSENDER} @description {{statementMap}} */ statementMap, /**@type {ObjectType.STATEMENTSENDER} @description {{error}} */ statementError, /**@type {ObjectType.STATEMENTSENDER} @description {{success}} */ statementSuccess) {250 db.query(statementMap, function (err, response) {251 if (err) {252 statementError(err);253 } else {254 statementSuccess(response);255 }256 });257 };258 /**259 * @type function260 * @name {{emit}}261 * @description {{emitDescription}}262 */263 this.cronapi.pouchdb.emit = function (/** @type {ObjectType.OBJECT} @description {{doc}} */ doc, /** @type {ObjectType.OBJECT} @description {{options}} */ options) {264 emit(doc, options)265 };...

Full Screen

Full Screen

pouchdb.cronapi.min.js

Source:pouchdb.cronapi.min.js Github

copy

Full Screen

1(function(){"use strict";2/**3 * @categoryName {{localDatabase}}4 */this.cronapi.pouchdb={},5//Ref: https://pouchdb.com/6/**7 * @type function8 * @name {{createLocalDatabase}}9 * @description {{createLocalDatabaseDescription}}10 * @returns {ObjectType.OBJECT}11 */12this.cronapi.pouchdb.createLocalDatabase=function(/** @type {ObjectType.STRING} @description {{databaseName}} */n,/** @type {ObjectType.STRING} @description {{adapterType}} @blockType util_dropdown @keys idb|websql|cordova-sqlite|memory|localstorage @values idb|websql|cordova-sqlite|memory|localstorage */t){return new PouchDB(n||"myDB.db",{adapter:t})},13/**14 * @type function15 * @name {{createRemoteDatabase}}16 * @description {{createRemoteDatabaseDescription}}17 * @returns {ObjectType.OBJECT}18 */19this.cronapi.pouchdb.createRemoteDatabase=function(/** @type {ObjectType.STRING} @description {{databaseName}} */n,/** @type {ObjectType.STRING} @description {{username}} */t,/** @type {ObjectType.STRING} @description {{password}} */c){return new PouchDB(n||"myDB.db",{auth:{username:t,password:c}})},20/**21 * @type function22 * @name {{getDatabaseInfo}}23 * @description {{getDatabaseInfoDescription}}24 */25this.cronapi.pouchdb.getDatabaseInfo=function(/** @type {ObjectType.OBJECT} @description {{databaseRef}} */n,/**@type {ObjectType.STATEMENTSENDER} @description {{error}} */t,/**@type {ObjectType.STATEMENTSENDER} @description {{success}} */c){n.info(function(n,o){n?t(n):c(o)})},26/**27 * @type function28 * @name {{compactDatabase}}29 * @description {{compactDatabaseDescription}}30 */31this.cronapi.pouchdb.compactDatabase=function(/** @type {ObjectType.OBJECT} @description {{databaseRef}} */n,/** @type {ObjectType.OBJECT} @description {{options}} */t,/**@type {ObjectType.STATEMENTSENDER} @description {{error}} */c,/**@type {ObjectType.STATEMENTSENDER} @description {{success}} */o){n.compact(t,function(n,t){n?c(n):o(t)})},32/**33 * @type function34 * @name {{deleteDatabase}}35 * @description {{deleteDatabaseDescription}}36 */37this.cronapi.pouchdb.deleteDatabase=function(/** @type {ObjectType.OBJECT} @description {{databaseRef}} */n,/** @type {ObjectType.OBJECT} @description {{options}} */t,/**@type {ObjectType.STATEMENTSENDER} @description {{error}} */c,/**@type {ObjectType.STATEMENTSENDER} @description {{success}} */o){n.destroy(t,function(n,t){n?c(n):o(t)})},38/**39 * @type function40 * @name {{updateDoc}}41 * @description {{updateDocDescription}}42 */43this.cronapi.pouchdb.updateDoc=function(/** @type {ObjectType.OBJECT} @description {{databaseRef}} */n,/** @type {ObjectType.OBJECT} @description {{doc}} */t,/** @type {ObjectType.OBJECT} @description {{options}} */c,/**@type {ObjectType.STATEMENTSENDER} @description {{error}} */o,/**@type {ObjectType.STATEMENTSENDER} @description {{success}} */i){null==c&&(c={}),n.put(t,c,function(n,t){n?o(n):i(t)})},44/**45 * @type function46 * @name {{createDoc}}47 * @description {{createDocDescription}}48 */49this.cronapi.pouchdb.createDoc=function(/** @type {ObjectType.OBJECT} @description {{databaseRef}} */n,/** @type {ObjectType.OBJECT} @description {{doc}} */t,/** @type {ObjectType.OBJECT} @description {{options}} */c,/**@type {ObjectType.STATEMENTSENDER} @description {{error}} */o,/**@type {ObjectType.STATEMENTSENDER} @description {{success}} */i){n.post(t,c,function(n,t){n?o(n):i(t)})},50/**51 * @type function52 * @name {{createDocLote}}53 * @description {{createDocLoteDescription}}54 */55this.cronapi.pouchdb.createDocLote=function(/** @type {ObjectType.OBJECT} @description {{databaseRef}} */n,/** @type {ObjectType.OBJECT} @description {{docs}} */t,/** @type {ObjectType.OBJECT} @description {{options}} */c,/**@type {ObjectType.STATEMENTSENDER} @description {{error}} */o,/**@type {ObjectType.STATEMENTSENDER} @description {{success}} */i){n.bulkDocs(t,c,function(n,t){n?o(n):i(t)})},56/**57 * @type function58 * @name {{putAttachment}}59 * @description {{putAttachmentDescription}}60 */61this.cronapi.pouchdb.putAttachment=function(/** @type {ObjectType.OBJECT} @description {{databaseRef}} */n,/** @type {ObjectType.STRING} @description {{docId}} */t,/** @type {ObjectType.STRING} @description {{docRev}} */c,/** @type {ObjectType.STRING} @description {{attachmentId}} */o,/** @type {ObjectType.OBJECT} @description {{attachment}} */i,/** @type {ObjectType.STRING} @description {{attachmentType}} */u,/**@type {ObjectType.STATEMENTSENDER} @description {{error}} */e,/**@type {ObjectType.STATEMENTSENDER} @description {{success}} */a){n.putAttachment(t,o,c,i,u,function(n,t){n?e(n):a(t)})},62/**63 * @type function64 * @name {{getAttachment}}65 * @description {{getAttachmentDescription}}66 */67this.cronapi.pouchdb.getAttachment=function(/** @type {ObjectType.OBJECT} @description {{databaseRef}} */n,/** @type {ObjectType.STRING} @description {{docId}} */t,/** @type {ObjectType.STRING} @description {{attachmentId}} */c,/**@type {ObjectType.STATEMENTSENDER} @description {{error}} */o,/**@type {ObjectType.STATEMENTSENDER} @description {{success}} */i){n.getAttachment(t,c,function(n,t){n?o(n):i(t)})},68/**69 * @type function70 * @name {{removeAttachment}}71 * @description {{removeAttachmentDescription}}72 */73this.cronapi.pouchdb.removeAttachment=function(/** @type {ObjectType.OBJECT} @description {{databaseRef}} */n,/** @type {ObjectType.STRING} @description {{docId}} */t,/** @type {ObjectType.STRING} @description {{attachmentId}} */c,/** @type {ObjectType.STRING} @description {{docRev}} */o,/**@type {ObjectType.STATEMENTSENDER} @description {{error}} */i,/**@type {ObjectType.STATEMENTSENDER} @description {{success}} */u){n.removeAttachment(t,c,o,function(n,t){n?i(n):u(t)})},74/**75 * @type function76 * @name {{getDoc}}77 * @description {{getDocDescription}}78 */79this.cronapi.pouchdb.getDoc=function(/** @type {ObjectType.OBJECT} @description {{databaseRef}} */n,/** @type {ObjectType.STRING} @description {{docId}} */t,/** @type {ObjectType.OBJECT} @description {{options}} */c,/**@type {ObjectType.STATEMENTSENDER} @description {{error}} */o,/**@type {ObjectType.STATEMENTSENDER} @description {{success}} */i){n.get(t,c,function(n,t){n?o(n):i(t)})},80/**81 * @type function82 * @name {{getAllDoc}}83 * @description {{getAllDocDescription}}84 */85this.cronapi.pouchdb.getAllDoc=function(/** @type {ObjectType.OBJECT} @description {{databaseRef}} */n,/** @type {ObjectType.OBJECT} @description {{options}} */t,/**@type {ObjectType.STATEMENTSENDER} @description {{error}} */c,/**@type {ObjectType.STATEMENTSENDER} @description {{success}} */o){n.allDocs(t,function(n,t){n?c(n):o(t)})},86/**87 * @type function88 * @name {{notifyChanges}}89 * @description {{notifyChangesDescription}}90 * @returns {ObjectType.OBJECT}91 */92this.cronapi.pouchdb.notifyChanges=function(/** @type {ObjectType.OBJECT} @description {{databaseRef}} */n,/** @type {ObjectType.OBJECT} @description {{options}} */t,/**@type {ObjectType.STATEMENTSENDER} @description {{error}} */c,/**@type {ObjectType.STATEMENTSENDER} @description {{statementChange}} */o,/**@type {ObjectType.STATEMENTSENDER} @description {{statementComplete}} */i){return n.changes(t).on("change",function(n){o(n)}).on("complete",function(n){i(n)}).on("error",function(n){c(n)})},93/**94 * @type function95 * @name {{cancelNotifyChanges}}96 * @description {{cancelNotifyChangesDescription}}97 */98this.cronapi.pouchdb.cancelNotifyChanges=function(/** @type {ObjectType.OBJECT} @description {{changesRef}} */n){n.cancel()},99/**100 * @type function101 * @name {{deleteDoc}}102 * @description {{deleteDocDescription}}103 */104this.cronapi.pouchdb.deleteDoc=function(/** @type {ObjectType.OBJECT} @description {{databaseRef}} */n,/** @type {ObjectType.OBJECT} @description {{doc}} */t,/** @type {ObjectType.OBJECT} @description {{options}} */c,/**@type {ObjectType.STATEMENTSENDER} @description {{error}} */o,/**@type {ObjectType.STATEMENTSENDER} @description {{success}} */i){n.remove(t,c,function(n,t){n?o(n):i(t)})},105/**106 * @type function107 * @name {{deleteDocById}}108 * @description {{deleteDocByIdDescription}}109 */110this.cronapi.pouchdb.deleteByIdDoc=function(/** @type {ObjectType.OBJECT} @description {{databaseRef}} */n,/** @type {ObjectType.STRING} @description {{docId}} */t,/** @type {ObjectType.STRING} @description {{revId}} */c,/** @type {ObjectType.OBJECT} @description {{options}} */o,/**@type {ObjectType.STATEMENTSENDER} @description {{error}} */i,/**@type {ObjectType.STATEMENTSENDER} @description {{success}} */u){n.remove(t,c,o,function(n,t){n?i(n):u(t)})},111/**112 * @type function113 * @name {{query}}114 * @description {{queryDescription}}115 */116this.cronapi.pouchdb.query=function(/** @type {ObjectType.OBJECT} @description {{databaseRef}} */n,/**@type {ObjectType.STATEMENTSENDER} @description {{statementMap}} */t,/**@type {ObjectType.STATEMENTSENDER} @description {{error}} */c,/**@type {ObjectType.STATEMENTSENDER} @description {{success}} */o){n.query(t,function(n,t){n?c(n):o(t)})},117/**118 * @type function119 * @name {{emit}}120 * @description {{emitDescription}}121 */...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1const { chromium } = require('playwright');2(async () => {3 const browser = await chromium.launch({ headless: false });4 const page = await browser.newPage();5 const elementHandle = await page.$('text=Get started');6 const result = await elementHandle.evaluate(element => element.objectType());7 console.log(result);8 await browser.close();9})();10## 2. Playwright internal API: getAttribute() method11elementHandle.getAttribute(name[, options])12const { chromium } = require('playwright');13(async () => {14 const browser = await chromium.launch({ headless: false });15 const page = await browser.newPage();16 const elementHandle = await page.$('text=Get started');17 const result = await elementHandle.getAttribute('href');18 console.log(result);19 await browser.close();20})();21## 3. Playwright internal API: innerText() method22elementHandle.innerText([options])

Full Screen

Using AI Code Generation

copy

Full Screen

1const { chromium } = require('playwright');2(async () => {3 const browser = await chromium.launch();4 const context = await browser.newContext();5 const page = await context.newPage();6 const elementHandle = await page.$('body');7 const type = await elementHandle.objectType();8 console.log(type);9 await browser.close();10})();11const { chromium } = require('playwright');12(async () => {13 const browser = await chromium.launch();14 const context = await browser.newContext();15 const page = await context.newPage();16 await page.waitForSelector('#foo');17 await page.click('#foo');18 await browser.close();19})();

Full Screen

Using AI Code Generation

copy

Full Screen

1const { chromium } = require('playwright');2(async () => {3 const browser = await chromium.launch({ headless: false });4 const page = await browser.newPage();5 await page.waitForSelector('input[name="q"]');6 await page.type('input[name="q"]', 'Playwright');7 await page.waitForTimeout(2000);8 await page.keyboard.press('Enter');9 await page.waitForTimeout(2000);10 await page.keyboard.press('Escape');11 await page.waitForTimeout(2000);12 const searchResults = await page.$$('div.g');13 for (let i = 0; i < searchResults.length; i++) {14 const searchResult = searchResults[i];15 const searchResultType = await searchResult.objectType();16 console.log(searchResultType);17 }18 await browser.close();19})();20const { chromium } = require('playwright');21(async () => {22 const browser = await chromium.launch({ headless: false });23 const page = await browser.newPage();24 await page.waitForSelector('input[name="q"]');25 await page.type('input[name="q"]', 'Playwright');26 await page.waitForTimeout(2000);27 await page.keyboard.press('Enter');28 await page.waitForTimeout(2000);29 const searchResults = await page.$$('div.g');30 for (let i = 0; i < searchResults.length; i++) {31 const searchResult = searchResults[i];32 const searchResultContentFrame = await searchResult.contentFrame();33 if (searchResultContentFrame) {34 const searchResultText = await searchResultContentFrame.evaluate(35 () => document.querySelector('h3').textContent36 );37 console.log(searchResultText);38 }39 }40 await browser.close();41})();

Full Screen

Using AI Code Generation

copy

Full Screen

1const { chromium } = require('playwright');2(async () => {3 const browser = await chromium.launch();4 const page = await browser.newPage();5 const objectHandle = await page.evaluateHandle(() => document.body);6 console.log(await objectHandle.asElement().isIntersectingViewport());7 await browser.close();8})();9| `await objectHandle.asElement().isIntersectingViewport()` | ✅ Passes |10| `await objectHandle.asElement().boundingBox()` | ✅ Passes |11| `await objectHandle.asElement().isEditable()` | ✅ Passes |12| `await objectHandle.asElement().isDisabled()` | ✅ Passes |13| `await objectHandle.asElement().isDraggable()` | ✅ Passes |14| `await objectHandle.asElement().isDropTarget()` | ✅ Passes |15| `await objectHandle.asElement().isInShadowDOM()` | ✅ Passes |16| `await objectHandle.asElement().isFocused()` | ✅ Passes |17| `await objectHandle.asElement().isHidden()` | ✅ Passes |18| `await objectHandle.asElement().isHiddenWithinViewport()` | ✅ Passes |19| `await objectHandle.asElement().isHovered(

Full Screen

Using AI Code Generation

copy

Full Screen

1const { chromium } = require('playwright');2(async () => {3 const browser = await chromium.launch();4 const page = await browser.newPage();5 const title = await page.locator('text=Get Started').first().objectType();6 console.log(title);7 await browser.close();8})();9## 7. How to use the `frame()` method of Playwright Internal API10const { chromium } = require('playwright');11(async () => {12 const browser = await chromium.launch();13 const page = await browser.newPage();14 const frame = await page.frame({ name: 'playwright' });15 console.log(await frame.title());16 await browser.close();17})();18## 8. How to use the `selectOption()` method of Playwright Internal API19const { chromium } = require('playwright');20(async () => {21 const browser = await chromium.launch();22 const page = await browser.newPage();23 await page.click('text=Docs');24 await page.selectOption('select', 'api');25 await browser.close();26})();27## 9. How to use the `focus()` method of Playwright Internal API28const { chromium } = require('playwright');29(async () => {30 const browser = await chromium.launch();31 const page = await browser.newPage();32 await page.click('text=Docs');33 await page.focus('select');34 await browser.close();35})();36## 10. How to use the `waitForTimeout()` method of Playwright Internal API37const { chromium } = require('playwright');38(async () => {39 const browser = await chromium.launch();40 const page = await browser.newPage();41 await page.click('text=Docs');

Full Screen

Using AI Code Generation

copy

Full Screen

1const {chromium} = require('playwright');2(async() => {3 const browser = await chromium.launch();4 const page = await browser.newPage();5 const elementHandle = await page.$('input[name="q"]');6 const box = await elementHandle.boundingBox();7 console.log(box);8 await browser.close();9})();10const {chromium} = require('playwright');11(async() => {12 const browser = await chromium.launch();13 const page = await browser.newPage();14 const elementHandle = await page.$('input[name="q"]');15 const box = await elementHandle.boundingBox();16 console.log(box);17 await browser.close();18})();19const {chromium} = require('playwright');20(async() => {21 const browser = await chromium.launch();22 const page = await browser.newPage();23 const elementHandle = await page.$('input[name="q"]');24 const box = await elementHandle.boundingBox();25 console.log(box);26 await browser.close();27})();28const {chromium} = require('playwright');29(async() => {30 const browser = await chromium.launch();31 const page = await browser.newPage();32 const elementHandle = await page.$('input[name="q"]');33 const box = await elementHandle.boundingBox();34 console.log(box);35 await browser.close();36})();37const {chromium} = require('playwright');38(async() => {39 const browser = await chromium.launch();40 const page = await browser.newPage();41 const elementHandle = await page.$('input[name="q"]');42 const box = await elementHandle.boundingBox();43 console.log(box);44 await browser.close();45})();46const {chromium} = require('playwright');47(async() => {48 const browser = await chromium.launch();49 const page = await browser.newPage();

Full Screen

Using AI Code Generation

copy

Full Screen

1const { chromium } = require('playwright');2const { assert } = require('chai');3const path = require('path');4(async () => {5 const browser = await chromium.launch();6 const page = await browser.newPage();7 const selector = 'text=Get started';8 const element = await page.$(selector);9 const objectType = await element._object.objectType();10 assert.strictEqual(objectType, 'Node');11 await browser.close();12})();13const { chromium } = require('playwright');14const { assert } = require('chai');15const path = require('path');16(async () => {17 const browser = await chromium.launch();18 const page = await browser.newPage();19 const selector = 'text=Get started';20 await page.waitForSelector(selector);21 const element = await page.$(selector);22 const objectType = await element._object.objectType();23 assert.strictEqual(objectType, 'Node');24 await browser.close();25})();26const { chromium } = require('playwright');27const { assert } = require('chai');28const path = require('path');29(async () => {30 const browser = await chromium.launch();31 const page = await browser.newPage();32 await page.waitForFunction(() => document.querySelector('text=Get started'));33 const selector = 'text=Get started';34 const element = await page.$(selector);35 const objectType = await element._object.objectType();36 assert.strictEqual(objectType

Full Screen

Playwright tutorial

LambdaTest’s Playwright tutorial will give you a broader idea about the Playwright automation framework, its unique features, and use cases with examples to exceed your understanding of Playwright testing. This tutorial will give A to Z guidance, from installing the Playwright framework to some best practices and advanced concepts.

Chapters:

  1. What is Playwright : Playwright is comparatively new but has gained good popularity. Get to know some history of the Playwright with some interesting facts connected with it.
  2. How To Install Playwright : Learn in detail about what basic configuration and dependencies are required for installing Playwright and run a test. Get a step-by-step direction for installing the Playwright automation framework.
  3. Playwright Futuristic Features: Launched in 2020, Playwright gained huge popularity quickly because of some obliging features such as Playwright Test Generator and Inspector, Playwright Reporter, Playwright auto-waiting mechanism and etc. Read up on those features to master Playwright testing.
  4. What is Component Testing: Component testing in Playwright is a unique feature that allows a tester to test a single component of a web application without integrating them with other elements. Learn how to perform Component testing on the Playwright automation framework.
  5. Inputs And Buttons In Playwright: Every website has Input boxes and buttons; learn about testing inputs and buttons with different scenarios and examples.
  6. Functions and Selectors in Playwright: Learn how to launch the Chromium browser with Playwright. Also, gain a better understanding of some important functions like “BrowserContext,” which allows you to run multiple browser sessions, and “newPage” which interacts with a page.
  7. Handling Alerts and Dropdowns in Playwright : Playwright interact with different types of alerts and pop-ups, such as simple, confirmation, and prompt, and different types of dropdowns, such as single selector and multi-selector get your hands-on with handling alerts and dropdown in Playright testing.
  8. Playwright vs Puppeteer: Get to know about the difference between two testing frameworks and how they are different than one another, which browsers they support, and what features they provide.
  9. Run Playwright Tests on LambdaTest: Playwright testing with LambdaTest leverages test performance to the utmost. You can run multiple Playwright tests in Parallel with the LammbdaTest test cloud. Get a step-by-step guide to run your Playwright test on the LambdaTest platform.
  10. Playwright Python Tutorial: Playwright automation framework support all major languages such as Python, JavaScript, TypeScript, .NET and etc. However, there are various advantages to Python end-to-end testing with Playwright because of its versatile utility. Get the hang of Playwright python testing with this chapter.
  11. Playwright End To End Testing Tutorial: Get your hands on with Playwright end-to-end testing and learn to use some exciting features such as TraceViewer, Debugging, Networking, Component testing, Visual testing, and many more.
  12. Playwright Video Tutorial: Watch the video tutorials on Playwright testing from experts and get a consecutive in-depth explanation of Playwright automation testing.

Run Playwright Internal automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful