Ignore:
Timestamp:
Oct 12, 2011, 1:13:15 PM (13 years ago)
Author:
djay
Message:

Fix tickets #63, #64 and #68

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/zoo-project/zoo-api/js/ZOO-api.js

    r278 r342  
    331331    return ZOO.String.isNumeric(value) ? parseFloat(value) : value;
    332332  }
     333};
     334
     335/**
     336 * Class: ZOO.Class
     337 * Object for creating CLASS
     338 */
     339ZOO.Class = function() {
     340  var len = arguments.length;
     341  var P = arguments[0];
     342  var F = arguments[len-1];
     343  var C = typeof F.initialize == "function" ?
     344    F.initialize :
     345    function(){ P.prototype.initialize.apply(this, arguments); };
     346
     347  if (len > 1) {
     348    var newArgs = [C, P].concat(
     349          Array.prototype.slice.call(arguments).slice(1, len-1), F);
     350    ZOO.inherit.apply(null, newArgs);
     351  } else {
     352    C.prototype = F;
     353  }
     354  return C;
     355};
     356/**
     357 * Function: create
     358 * Function for creating CLASS
     359 */
     360ZOO.Class.create = function() {
     361  return function() {
     362    if (arguments && arguments[0] != ZOO.Class.isPrototype) {
     363      this.initialize.apply(this, arguments);
     364    }
     365  };
     366};
     367/**
     368 * Function: inherit
     369 * Function for inheriting CLASS
     370 */
     371ZOO.Class.inherit = function (P) {
     372  var C = function() {
     373   P.call(this);
     374  };
     375  var newArgs = [C].concat(Array.prototype.slice.call(arguments));
     376  ZOO.inherit.apply(null, newArgs);
     377  return C.prototype;
     378};
     379/**
     380 * Function: inherit
     381 * Function for inheriting CLASS
     382 */
     383ZOO.inherit = function(C, P) {
     384  var F = function() {};
     385  F.prototype = P.prototype;
     386  C.prototype = new F;
     387  var i, l, o;
     388  for(i=2, l=arguments.length; i<l; i++) {
     389    o = arguments[i];
     390    if(typeof o === "function") {
     391      o = o.prototype;
     392    }
     393    ZOO.Util.extend(C.prototype, o);
     394  }
     395};
     396/**
     397 * Class: ZOO.Util
     398 * Object for utilities
     399 */
     400ZOO.Util = ZOO.Util || {};
     401/**
     402 * Function: extend
     403 * Function for extending object
     404 */
     405ZOO.Util.extend = function(destination, source) {
     406  destination = destination || {};
     407  if (source) {
     408    for (var property in source) {
     409      var value = source[property];
     410      if (value !== undefined) {
     411        destination[property] = value;
     412      }
     413    }
     414  }
     415  return destination;
    333416};
    334417
     
    61246207     */
    61256208    'complex': function(identifier,data) {
    6126       var input = new XML('<wps:Input xmlns:wps="'+this.namespaces['wps']+'"><ows:Identifier xmlns:ows="'+this.namespaces['ows']+'">'+identifier+'</ows:Identifier><wps:Data><wps:ComplexData><![CDATA['+data.value+']]></wps:ComplexData></wps:Data></wps:Input>');
    6127       input.*::Data.*::ComplexData.@mimeType = data.mimetype ? data.mimetype : 'application/json';
     6209      var input = new XML('<wps:Input xmlns:wps="'+this.namespaces['wps']+'"><ows:Identifier xmlns:ows="'+this.namespaces['ows']+'">'+identifier+'</ows:Identifier>'+(data.value?'<wps:Data><wps:ComplexData><![CDATA['+data.value+']]></wps:ComplexData></wps:Data>':(data.xlink?'<wps:Reference xmlns:xlink="'+this.namespaces['xlink']+'" xlink:href="'+data.xlink+'" mimeType="'+data.mimeType+'" />':''))+'</wps:Input>');
     6210      if(data.xlink)
     6211        input.*::Reference.@mimeType = data.mimetype ? data.mimetype : 'application/json';
     6212      else
     6213        input.*::Data.*::ComplexData.@mimeType = data.mimetype ? data.mimetype : 'application/json';
    61286214      if (data.encoding)
    61296215        input.*::Data.*::ComplexData.@encoding = data.encoding;
Note: See TracChangeset for help on using the changeset viewer.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png