#macro (listApps)
 #set($results = $xwiki.search("select doc.fullName from XWikiDocument doc where web = 'Applications'"))
 #if ($results.size() > 0)
  #foreach ($item in $results)
   #set($doc = $xwiki.getDocument($item))
    * [$doc.getName()>$item]
  #end
 #end
#end


#macro (displayServersByEnvironment $text $zones)
 #set($results = $xwiki.search("select doc.fullName from XWikiDocument doc, BaseObject obj, StringProperty prop where doc.fullName=obj.name and obj.className='XWiki.ServerClass' and prop.id.id=obj.id and prop.name='Environnement' and prop.value='$text'"))
 #if ($results.size() > 0)
  #foreach ($item in $results)
   #set($doc = $xwiki.getDocument($item))
    * [$doc.getName()>$item]
   #if ($zones == true)
    #findZones($item)
   #end
  #end
 #end
#end

#macro (displayAllServers)
 #set($results = $xwiki.search("select doc.fullName from XWikiDocument doc, BaseObject obj where doc.fullName=obj.name and obj.className='XWiki.ServerClass'"))
 #if ($results.size() > 0)
   #foreach ($item in $results)
    #set($doc = $xwiki.getDocument($item))
     * [$doc.getName()>$item] ($doc.display("Environnement"))
   #end
 #end
#end

#macro (findZones $text)
 #set($results = $xwiki.search("select doc.fullName from XWikiDocument doc, BaseObject obj, StringProperty prop where doc.fullName=obj.name and obj.className='XWiki.Test1Class' and prop.id.id=obj.id and prop.name='Master' and prop.value='$text'"))
 #if ($results.size() > 0)
  #foreach ($item in $results)
  #set($doc = $xwiki.getDocument($item))
    ** [$doc.getName()>$item]
  #end
 #end
#end