Code source wiki de Install
Modifié par Vincent Massol le 2011/08/12 21:26
Afficher les derniers auteurs
| author | version | line-number | content |
|---|---|---|---|
| 1 | = Meeting Manager Code Install = | ||
| 2 | |||
| 3 | {{velocity}} | ||
| 4 | #if(!$xwiki.hasAdminRights()) | ||
| 5 | {{error}} | ||
| 6 | You are running this script as a non admin. It will have no effect. Login as admin. | ||
| 7 | {{/error}} | ||
| 8 | #else | ||
| 9 | This script automatically set the owner of the pages in MMCode. This will allow the priviledged scripts included in them to work. | ||
| 10 | #end | ||
| 11 | |||
| 12 | #if(!$xwiki.exists("XWiki.MapExtension")) | ||
| 13 | {{warning}}The Map Extension component is not installed properly. You will need to download the Map Extension component from http://code.xwiki.org and install it{{/warning}} | ||
| 14 | #end | ||
| 15 | #if(!$xwiki.exists("XWiki.LiveValidation")) | ||
| 16 | {{warning}}The Live Validation Extension component is not installed properly. You will need to download the LiveValidation Extension component from http://code.xwiki.org and install it{{/warning}} | ||
| 17 | #end | ||
| 18 | #if(!$xwiki.exists("XWiki.DatePickerExtension")) | ||
| 19 | {{warning}}The DatePicker Extension component is not installed properly. You will need to download the DatePicker Extension component from http://code.xwiki.org and install it{{/warning}} | ||
| 20 | #end | ||
| 21 | #if(!$xwiki.exists("XWiki.ModalBox")) | ||
| 22 | {{warning}}The ModalBox Extension component is not installed properly. You will need to download the ModalBox Extension component from http://code.xwiki.org and install it{{/warning}} | ||
| 23 | #end | ||
| 24 | |||
| 25 | #if($request.confirm=="1") | ||
| 26 | Assigning programming rights to the following pages: | ||
| 27 | #else | ||
| 28 | [[Confirm assigning programming rights to the following pages:>>$doc.fullName?confirm=1]] | ||
| 29 | #end | ||
| 30 | |||
| 31 | #foreach($item in $xwiki.searchDocuments("where doc.web='MMCode' or doc.fullName like 'XWiki.Meeting%' or doc.fullName in ('XWiki.ModalBox', 'XWiki.MapExtension', 'XWiki.LiveValidation', 'XWiki.DatePickerExtension')")) | ||
| 32 | * $item #if($request.confirm=="1") $xwiki.getDocument($item).save() #end | ||
| 33 | |||
| 34 | #end | ||
| 35 | |||
| 36 | #set($transdoc = $xwiki.getDocument("XWiki.XWikiPreferences")) | ||
| 37 | #set($ok = $transdoc.use("XWiki.XWikiPreferences")) | ||
| 38 | #set($transprefs = $transdoc.getValue("documentBundles")) | ||
| 39 | #if($transprefs.indexOf("MMCode.MeetingManagerTranslations")==-1) | ||
| 40 | #if($request.confirm=="1") | ||
| 41 | #set($transprefs = "${transprefs},MMCode.MeetingManagerTranslations") | ||
| 42 | #set($ok = $transdoc.set("documentBundles", $transprefs)) | ||
| 43 | #set($ok = $transdoc.save()) | ||
| 44 | #end | ||
| 45 | * Added translation bundle to XWiki Preferences | ||
| 46 | #end | ||
| 47 | |||
| 48 | ## fixing the meeting template to have no date set | ||
| 49 | ## otherwise we can't use the date selection | ||
| 50 | #set($templatedoc = $xwiki.getDocument("MMCode.MeetingClassTemplate")) | ||
| 51 | #set($ok = $templatedoc.use("MMCode.MeetingClass")) | ||
| 52 | #if($templatedoc.display("date")!="01/01/2000") | ||
| 53 | * Fixing template default date | ||
| 54 | #if($request.confirm=="1") | ||
| 55 | #set($ok = $templatedoc.set("date", "01/01/2000")) | ||
| 56 | #set($ok = $templatedoc.set("starttime", "00:00")) | ||
| 57 | #set($ok = $templatedoc.set("endtime", "00:00")) | ||
| 58 | #set($ok = $templatedoc.save()) | ||
| 59 | #end | ||
| 60 | #end | ||
| 61 | {{/velocity}} |