ZooWebSite/2015/Code/ZOO-Services/Hello

Hello Worlds

Say hello in WPS !

The ZOO Services Hello Worlds aims at helping you get started in the creation of new WPS.

Use the language of your choice to say hello and much more.

Hello world

JavaScript

function hellojs(conf,inputs,outputs){
  outputs["result"]["value"]="Hello "+inputs["S"]["value"]+" from the JS World !";
  //SERVICE_SUCEEDED
  return Array(3,outputs);
}

Python

import zoo
def HelloPy(conf,inputs,outputs):
    outputs["Result"]["value"]="Hello "+inputs["a"]["value"]+" from Python World !"
    return zoo.SERVICE_SUCCEEDED

Java

import java.lang.*;
import java.util.*;
	public class HelloJava {
	    public static int HelloWorldJava(HashMap conf,HashMap inputs, HashMap outputs) {
	        HashMap tmp=(HashMap)(inputs.get("S"));
	        String v=tmp.get("value").toString();
	        HashMap hm1 = (HashMap)(outputs.get("Result"));
	        hm1.put("value",ZOO._("Hello "+v+" from JAVA World !!"));
	        return ZOO.SERVICE_SUCCEEDED;
	    }
	}

PHP

function HelloPHP(&$main_conf,&$inputs,&$outputs){
	  $tmp="Hello ".$inputs["S"]["value"]." from the PHP world !!";
	  $outputs["Result"]["value"]=zoo_Translate($tmp);
	  zoo_UpdateStatus($main_conf,"Final step",99);
	  return zoo_SERVICE_SUCCEEDED();
	}

Perl

sub HelloPL {
my ($main_conf,$real_inputs,$real_outputs) = @_;
$real_outputs->{"Result"}->{"value"}=$real_inputs->{"a"}->{"value"};
return 3;
}

Ruby

def helloRuby(conf,inputs,outputs)
  a=Zoo::Translate("Hello")
  b=Zoo::Translate("from the ruby world !")
  outputs["Result"]["value"]=Zoo::Translate("#{a} #{inputs["s"]["value"]} #{b}")
  return Zoo::SERVICE_SUCCEEDED
end

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