#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('/') #* * 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 $o[$v] #else View default (no title found for $v). #end if #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 #else #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 "formats" in $obj["input"] #set cFormats=[] #for j in range(len($obj["input"]["formats"])) #set $cFormats+=[$obj["input"]["formats"][$j]["mediaType"]] #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 $obj["minOccurs"]>0 #set $largs["required"]=True #end if $printControl($largs) #else #if "literalDataDomains" in $obj["input"] #set cDataDomain=$obj["input"]["literalDataDomains"][0] #set largs={"id": $obj["id"],"title": $cDataDomain["dataType"]["name"],"type": "input_value", "name": $cName,} #if $obj["minOccurs"]>0 #set $largs["required"]=True #end if #if "anyValue" in $cDataDomain["valueDefinition"] #set $largs["ph"]="Value" $printControl($largs) #else #if "allowedValues" in $cDataDomain["valueDefinition"] #set $largs["options"]=$cDataDomain["valueDefinition"]["allowedValues"] $printControl($largs) #else ELSE $obj #end if #end if #if "defaultValue" in $cDataDomain #end if #else $obj ELSE #end if #end if #if $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()) 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": "Provider","content": $printProvider($conf),"class": "show"}) $printCard({"id": "contact","title": "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 #set $cid="JOBSOCKET-"+$conf["lenv"]["usid"]

Inputs

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

'+$cInput["description"]+'

'+$printInputContent($cInput)}) #end for

Outputs

#for i in range(len(values["outputs"])) #set cOutput=$values["outputs"][$i] #set cName=$cOutput["id"].replace(".","_") #set cFormats=[] #if "formats" in $cOutput["output"] #for j in range(len($cOutput["output"]["formats"])) #set cFormats+=[$cOutput["output"]["formats"][$j]["mediaType"]] #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"]})})
#end if #try #if "links" in $values #for i in range(len($values["links"])) #if $i%2==0

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

$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 #end if #if hasattr($values, "__len__") and isinstance($values,list) and len($values)>0 #if "jobs" not in $urlCompnents #* * Processes list *# #else #* * Jobs list *# #end if #for i in range(len($values)) #if "jobs" not in $urlCompnents #* * Processes list *# #else #* * Jobs list *# #set cValue=$values[$i] #end if #end for
# Title Version# Message Links
$values[$i]["id"] $values[$i]["title"] #if "version" in $values[$i]#$values[$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: Tue Mar 9 16:33:11 CET 2021
#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