#set ($layout="json.vm")
#set ($dummy = $dbtool)
#set ($res=${response.setContentType("application/json")})
#if($params.key)
#set ($repo=$repositories)
#set ($r=$repo.load($params.key))
#set ($repos=[ $repo ])
#{else}[
#set ($repos=$repositories.fetchAll())
#end
#set ($count=$repos.size())
#foreach ($r in $sorter.sort($repos,"name"))
#if ($count!=$velocityCount)
#set ($sep=",")
#else
#set ($sep="")
#end
{ "id": $r.id, "name": "$r.name", "description": "$!r.description", "type": "$!r.type", "url": "$r.url", "dist": "$!r.dist", "arch": "$!r.arch", "component": "$!r.component", "priority": $r.priority, "autoUpdate": $r.autoupdate}$!sep
#end
#if(!$params.key)
]
#end
