#import zoo #import html,os #set removeCacheFile=False #set strUrl=$inputs["tmpl"]["xlink:href"] #set currentUrl=$strUrl.replace($openapi["openapi"]["rootUrl"],"") #if $currentUrl=="/" #set currentKey="root" #set $currentUrl="/index" #else #set currentKey=$currentUrl #end if #set urlCompnents=$currentUrl.split('/') #* // TODO: don't set the "id" parameter within the response Object, in // other case it can be seen seen within the UI textarea (at the // bottom, that may be hidden too) * Load the JSON content from the API *# #try #import json #if "cache_file" in $inputs["tmpl"] #set values=json.load(open($inputs["tmpl"]["cache_file"], encoding='utf-8')) #else #set values=json.loads($inputs["tmpl"]["value"]) #end if #except Exception as e $e #set values={} #end try #def findLink($val,$key) #if "links" in $val #for i in range(len($val["links"])) #if $val["links"][$i]["rel"]==$key #return $val["links"][$i]["href"] #end if #end for #return None #else #return None #end if #end def #if "id" in $values#$values["id"]#else##if $currentKey in $openapi and "title" in $openapi[$currentKey]#$openapi[$currentKey]["title"]#else#Landing Page#end if##end if#
#def printRel($o,$v) #if $v in $o $zoo._($o[$v]) #else #if $v.count("http")>0 #set ov=$v.split("/") #set ov1=$ov[len(ov)-1] #if $ov1 in $o $zoo._($o[$ov1]) #end if #else $zoo._("View default (no title found for ")$v). #end if #end if #end def #* *# #def printBboxInput(obj) #if "type" not in $obj #set oType="input_value" #else #set oType=$obj["type"] #end if
$obj["title"]
#set placeholders=["minx","miny","maxx","maxy"] #for i in range(4) =1)#required#end if#/> #end for
Please set a value for $obj["id"].
crs
Please set a value for $obj["id"].
#end def #* *# #def printControl(obj) #if "type" not in $obj #set oType="format" #else #set oType=$obj["type"] #end if
$obj["title"]
#if "ph" in $obj and $obj["title"]!="bool" #else #if $obj["title"]=="bool" #set $obj["options"]=["true","false"]; #end if #end if #if "required" in $obj
Please set a value for $obj["id"].
#end if
#end def #def printCard(obj)

$obj["content"]
#end def #def printInputContent($obj) #set cName=$obj["id"].replace(".","_") #if "oneOf" in $obj["schema"] #set cFormats=[] #for j in range(len($obj["schema"]["oneOf"])) #if "contentMediaType" in $obj["schema"]["oneOf"][$j] #set $cFormats+=[$obj["schema"]["oneOf"][$j]["contentMediaType"]] #end if #end for $printControl({"title": "format","type": "input_format","name": $cName,"options":$cFormats}) #set largs={"id": $obj["id"],"title": "href","type": "input_value","name": $cName,"ph":"URL"} #if "nullable" not in $obj["schema"] and ("minOccurs" not in $obj or $obj["minOccurs"]>0) #set $largs["required"]=True #end if $printControl($largs) #else #if "type" in $obj["schema"] and "properties" not in $obj["schema"] #set cDataDomain=$obj["schema"] #set largs={"id": $obj["id"],"title": $cDataDomain["type"],"type": "input_value", "name": $cName,} #if "nullable" not in $obj["schema"] and ("minOccurs" not in $obj or $obj["minOccurs"]>0) #set $largs["required"]=True #end if #if "valueDefinition" in $cDataDomain and "anyValue" in $cDataDomain["valueDefinition"] #set $largs["ph"]="Value" $printControl($largs) #else #if "enum" in $cDataDomain #set $largs["options"]=$cDataDomain["enum"] $printControl($largs) #else #set $largs["ph"]="Value" $printControl($largs) #end if #end if #if "default" in $obj["schema"] #end if #else $printBboxInput($obj) #end if #end if #if "maxOccurs" in $obj and ($obj["maxOccurs"]=="unbounded" or $obj["maxOccurs"]>1)
#end if #end def #def printProvider(conf) #set provider=$conf["provider"] $provider["providerName"]

#end def #def printContact(conf) #set provider=$conf["provider"] #set alt=$openapi["provider_alt"] #set elements=list($alt.keys()) $zoo._("Address") #for i in ["addressDeliveryPoint","addressCity","addressAdministrativeArea","addressPostalCode","addressCountry","addressElectronicMailAddress","phoneVoice","phoneFacsimile"] #if i!="addressElectronicMailAddress" and $provider[$i]!="False"

#if i=="phoneVoice" Phone #end if $provider[$i]

#else #if i=="addressElectronicMailAddress" Email

$provider[$i]

#end if #end if #end for #end def #def printIndentification(conf) #set provider=$conf["provider"] $printCard({"id": "provider","title": $zoo._("Provider"),"content": $printProvider($conf),"class": "show"}) $printCard({"id": "contact","title": $zoo._("Contact"),"content": $printContact($conf),"class": "show","attrs":'itemprop="address" itemscope itemtype="https://schema.org/PostalAddress"'}) #end def #if $currentKey=="root"
#end if

#if "id" in $values#$values["id"]: #end if##if "title" in $values#$html.escape($values["title"])#else##if len($urlCompnents)==2#$currentUrl[1:].title()#else#$currentUrl[1:]#end if##end if#

#if "description" in $values#

$html.escape($values["description"])

#end if# #if $currentKey=="root"
#for i in $conf["identification"]["keywords"].split(',') #end for
License: $openapi["openapi"]["license_name"] #end if #if "inputs" in $values #try #set $cid="JOBSOCKET-"+$conf["lenv"]["usid"]

Inputs

#for i in values["inputs"] #set cInput=$values["inputs"][$i] #set $cInput["id"]=$i #set cName=$i.replace(".","_") #try $printCard({"id": $cName, "title": $i,"content":'

'+$cInput["description"]+'

'+$printInputContent($cInput)}) #except Exception as e $i $e #end try #end for

Outputs

#for i in values["outputs"] #set cOutput=$values["outputs"][$i] #set $cOutput["id"]=$i #set cName=$i.replace(".","_") #set cFormats=[] #if "oneOf" in $cOutput["schema"] #for j in range(len($cOutput["schema"]["oneOf"])) #if "contentMediaType" in $cOutput["schema"]["oneOf"][$j] #set cFormats+=[$cOutput["schema"]["oneOf"][$j]["contentMediaType"]] #else #set cFormats+=["application/json"] #end if #end for #end if #set cTransmissions=[] #for j in range(len($values["outputTransmission"])) #set cTransmissions+=[$values["outputTransmission"][$j]] #end for #set cContent="

"+$cOutput["description"]+"

" #if len(cFormats)>0 #set $cContent+=$printControl({"id": $cOutput["id"], "title": "format","type": "format","name": $cName,"options":$cFormats}) #end if #if len(cTransmissions)>0 #set $cContent+=$printControl({"id": $cOutput["id"], "title": "transmission","type": "transmission","name": $cName,"options":$cTransmissions}) #end if $printCard({"id": $cName+"_"+str($i),"title": $cOutput["id"],"content": $cContent}) #end for

Execution options

#set cContent="" #set cUrl=$openapi["openapi"]["publisherurl"]+cid+"&type=" #for a in ["successUri","inProgressUri","failedUri"] #set $cContent+=$printControl({"title": $a,"type": "main_value","name": $a,"ph":"URL","value":$cUrl+$a.replace("Uri","")}) #end for $printCard({"id":"ModeOne","title":"Subscribers","content": $cContent}) $printCard({"id":"ModeTwo","title":"Response","content": $printControl({"title":"format","type": "main_value","name": "format","options":["document","raw"]})}) $printCard({"id":"ModeThree","title":"Mode","content": $printControl({"title":"mode","type": "main_value","name": "mode","options":["async","sync"]})})
#except Exception as e $e #end try #end if #try #if "links" in $values #for i in range(len($values["links"])) #if $i%2==0 #if "title" in $values["links"][$i]

$values["links"][$i]["title"]

#end if

$printRel($openapi["links_title"],$values["links"][$i]["rel"])

#if $i+1<=len($values["links"]) and len($values["links"])>1 and ($values["links"][$i+1]["rel"]=="alternate" or $values["links"][$i+1]["rel"]=="service-doc")

$printRel($openapi["links_title"],$values["links"][$i+1]["rel"])

#end if #end if #end for #end if #except Exception as e $e #end try #if "conformsTo" in $values #end if #if "jobs" in $urlCompnents #set $removeCacheFile=True #try #set lValues=$values["jobs"] #except #set lValues=$values #end try #else #if "processes" in $values #set lValues=$values["processes"] #else #set lValues=None #end if #end if #if hasattr($lValues, "__len__") and isinstance($lValues,list) and len($lValues)>0 #if "jobs" not in $urlCompnents #* * Processes list *# #else #* * Jobs list *# #end if #for i in range(len($lValues)) #if "jobs" not in $urlCompnents #* * Processes list *# #else #* * Jobs list *# #set cValue=$lValues[$i] #end if #end for
# Title Version# Message Links
$lValues[$i]["id"] $lValues[$i]["title"] #if "version" in $lValues[$i]#$lValues[$i]["version"]#else#1.0.0#end if# #if "status" in $cValue and $cValue["status"]=="successful" #else #if "status" in $cValue and $cValue["status"]=="failed" #end if #end if $cValue["jobID"] $cValue["message"]
#end if
$json.dumps(values)

$openapi["openapi"]["rootUrl"]$(currentUrl).html
Last modified: Sat Feb 19 15:43:34 CET 2022
#if $currentKey=="root"
$printIndentification($conf)
#end if #if "cache_file" in $inputs["tmpl"] and $removeCacheFile #import os $(os.remove($inputs["tmpl"]["cache_file"])) #end if