General Actions:
Log-in
Register
Wiki:
Main wiki
▼
:
Document Index
»
Space:
XemManager
▼
:
Document Index
»
Page:
Install
Search
en
Page Actions:
Export
▼
:
Export as PDF
Export as RTF
Export as HTML
More actions
▼
:
Print preview
View Source
Main wiki
»
Space XemManager
»
Install
Wiki source code of
Install
Last modified by
Administrator
on 2012/03/21 17:40
Content
·
Comments
(0)
·
Annotations
(0)
·
Attachments
(1)
·
History
·
Information
Hide line numbers
1: #set($WikiManager = $services.wikimanager) 2: #if(!$WikiManager) 3: #error($msg.get("wikimanager.pluginnotenabled")) 4: #end 5: #if(!$services.applicationmanager) 6: #error($msg.get("xapp.pluginnotenabled")) 7: #end 8: 9: #set($Exception = $WikiManager.DefaultException) 10: 11: #set($confirm = $request.getParameter("confirm")) 12: 13: ############################################### 14: 15: #set($templateName = "templatexe") 16: 17: #set($templateList = $WikiManager.getWikiTemplateList()) 18: 19: #set($templateExists = false) 20: #foreach($template in $templateList) 21: #if($template.wikiName == $templateName) 22: #set($templateExists = true) 23: #end 24: #end 25: 26: #if($templateExists == false) 27: #if($confirm && $confirm == 1) 28: #set($result = $WikiManager.createWikiTemplate($templateName, "XWiki Entreprise (default xwiki)", "template-xe.xar")) 29: #if ($result == $Exception.ERROR_NOERROR) 30: #info($msg.get("xem.install.success")) 31: #elseif ($result == $Exception.ERROR_XWIKI_ACCESS_DENIED) 32: #error($msg.get("notallowed")) 33: #else 34: #error($msg.get("xem.install.error", [$context.lastexception])) 35: #end 36: #else 37: #set($urlyes = $doc.getURL("view", "confirm=1")) 38: #set($urlno = $doc.getURL("view")) 39: 40: #xwikimessageboxstart($msg.get("xem.answer.install.title") $msg.get("xem.answer.install.actions")) 41: $msg.get("xem.answer.install.actions.template") 42: <div class="buttons"> 43: <a href="$urlyes"><input type="button" class="button" value="$msg.get("yes")" onclick="location='$urlyes'; return false;"/></a><a href="$urlno"><input type="button" class="button" value="$msg.get("no")" onclick="location='$urlno'; return false;"/></a> 44: </div> 45: #xwikimessageboxend() 46: #end 47: #else 48: #info($msg.get("xem.install.noneed")) 49: #end