- Timestamp:
- Jul 1, 2015, 12:57:36 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-project/zoo-client/lib/js/wps-client/wps-payload.js
r517 r719 85 85 } else if (params.request == 'Execute') { 86 86 return this.getPayload_Execute(params); 87 } else if (params.request == 'Dismiss') { 88 return this.getPayload_Dismiss(params); 87 89 } else { 88 90 console.log("#### UNKNOWN REQUEST ####"); … … 107 109 */ 108 110 getPayload_GetCapabilities: function(params) { 109 return templates["payload_GetCapabilities"].render(params); 111 var id="payload_GetCapabilities"; 112 if(params.version=="2.0.0") 113 id+="2"; 114 return templates[id].render(params); 110 115 }, 111 116 … … 128 133 */ 129 134 getPayload_DescribeProcess: function(params) { 135 var id="payload_DescribeProcess"; 136 if(params.version=="2.0.0") 137 id+="2"; 130 138 if (params.Identifier) { 131 139 if ($.isArray(params.Identifier)) { 132 return templates[ "payload_DescribeProcess"].render({identifiers: params.Identifier,language: params.language});140 return templates[id].render({identifiers: params.Identifier,language: params.language}); 133 141 } 134 142 else { 135 return templates[ "payload_DescribeProcess"].render({identifiers: [params.Identifier],language: params.language});143 return templates[id].render({identifiers: [params.Identifier],language: params.language}); 136 144 } 137 145 } 138 146 // TODO: no Identifier 139 147 }, 148 149 /** 150 * The getPayload_Dismiss function is used to generate a valid 151 * WPS XML Dimiss request using the 152 * [payload_Dismiss.mustache]{@link http://zoo-project.org/trac/browser/trunk/zoo-project/zoo-client/lib/tpl/payload_Dismiss.mustache} 153 * template. 154 * 155 * @static 156 * @param {Object} params - The object representing the request. 157 * @returns {string} - The corresponding XML request 158 * @example 159 * // log the XML request in console 160 * var request_params = { 161 * jobId: ["XXXX","XXX"] 162 * }; 163 * console.log(wpsPayload.getPayload_DescribeProcess(request_params)); 164 */ 165 getPayload_Dismiss: function(params) { 166 var id="payload_Dismiss"; 167 params.version="2.0.0"; 168 if (params.jobid) { 169 if ($.isArray(params.jobid)) { 170 return templates[id].render({jobid: params.jobid}); 171 } 172 else { 173 return templates[id].render({jobid: [params.jobid]}); 174 } 175 } 176 // TODO: no Identifier 177 }, 178 140 179 141 180 /** … … 159 198 */ 160 199 getPayload_Execute: function(params) { 200 var id="payload_Execute"; 201 if(params.version=="2.0.0") 202 id+="2"; 161 203 if (params.DataInputs) { 162 204 for (var i = 0; i < params.DataInputs.length; i++) { … … 210 252 211 253 // Complex data from payload callback. 212 console.log("CALLBACK");213 console.log(params.DataInputs[i]);214 254 if (params.DataInputs[i].complexPayload_callback) { 215 255 params.DataInputs[i].value = window[params.DataInputs[i].complexPayload_callback]; 216 console.log(params.DataInputs[i].value);217 256 } 218 257 … … 245 284 } 246 285 247 return templates[ "payload_Execute"].render(params);286 return templates[id].render(params); 248 287 }, 249 288
Note: See TracChangeset
for help on using the changeset viewer.