Ignore:
Timestamp:
Jan 8, 2013, 3:54:57 PM (10 years ago)
Author:
djay
Message:

Fix issue in JS support and for binary RawDataOutput?. Add Content-Length and Content-Disposition (optional) to response header. Add support to JS ZOO-API for sending headers and handling multi-valued inputs.

File:
1 edited

Legend:

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

    r377 r383  
    61596159    var body = new XML('<wps:Execute service="WPS" version="1.0.0" xmlns:wps="'+this.namespaces['wps']+'" xmlns:ows="'+this.namespaces['ows']+'" xmlns:xlink="'+this.namespaces['xlink']+'" xmlns:xsi="'+this.namespaces['xsi']+'" xsi:schemaLocation="'+this.schemaLocation+'"><ows:Identifier>'+this.identifier+'</ows:Identifier>'+this.buildDataInputsNode(inputs)+this.buildDataOutputsNode(outputs)+'</wps:Execute>');
    61606160    body = body.toXMLString();
    6161     var response = ZOO.Request.Post(this.url,body,['Content-Type: text/xml; charset=UTF-8']);
     6161    var headers=['Content-Type: text/xml; charset=UTF-8'];
     6162      if(arguments.length>2){
     6163        headers[headers.length]=arguments[2];
     6164      }
     6165    var response = ZOO.Request.Post(this.url,body,headers);
    61626166    return response;
    61636167  },
     
    62496253     */
    62506254    'literal': function(identifier,data) {
    6251       var input = new XML('<wps:Input xmlns:wps="'+this.namespaces['wps']+'"><ows:Identifier xmlns:ows="'+this.namespaces['ows']+'">'+identifier+'</ows:Identifier><wps:Data><wps:LiteralData>'+data.value+'</wps:LiteralData></wps:Data></wps:Input>');
     6255        if(data && !eval(data["isArray"])){
     6256            var input = new XML('<wps:Input xmlns:wps="'+this.namespaces['wps']+'"><ows:Identifier xmlns:ows="'+this.namespaces['ows']+'">'+identifier+'</ows:Identifier><wps:Data><wps:LiteralData>'+data.value+'</wps:LiteralData></wps:Data></wps:Input>');
    62526257      if (data.type)
    62536258        input.*::Data.*::LiteralData.@dataType = data.type;
     
    62566261      input = input.toXMLString();
    62576262      return input;
     6263        }else if(data){
     6264            var inputf="";
     6265            for(i=0;i<parseInt(data["length"]);i++){
     6266                var input = new XML('<wps:Input xmlns:wps="'+this.namespaces['wps']+'"><ows:Identifier xmlns:ows="'+this.namespaces['ows']+'">'+identifier+'</ows:Identifier><wps:Data><wps:LiteralData>'+data.value[i]+'</wps:LiteralData></wps:Data></wps:Input>');
     6267                if (data.type)
     6268                    input.*::Data.*::LiteralData.@dataType = data.type;
     6269                if (data.uom)
     6270                    input.*::Data.*::LiteralData.@uom = data.uom;
     6271                inputf += input.toXMLString();
     6272            }
     6273            return inputf;
     6274        }
     6275       
    62586276    }
    62596277  },
     
    62726290    for (var attr in inputs) {
    62736291      data = inputs[attr];
    6274       if (data.mimetype || data.type == 'complex')
     6292        if (data && (data.mimetype || data.type == 'complex'))
    62756293        builder = this.buildInput['complex'];
    6276       else if (data.type == 'reference' || data.type == 'url')
     6294        else if (data && (data.type == 'reference' || data.type == 'url'))
    62776295        builder = this.buildInput['reference'];
    62786296      else
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