Wiki source code of Install Ideas Application
Last modified by Andrey Che on 2018/12/10 14:09
Hide last authors
| |
1.1 | 1 | {{velocity}} |
| 2 | #set($hql = ",BaseObject as obj where doc.fullName=obj.name and obj.className='Ideas.IdeasClass' and obj.id not in (select obj2.id from BaseObject as obj2, StringProperty as prop where obj2.className='Ideas.IdeasClass' and obj2.id=prop.id.id and prop.id.name='status')") | ||
| 3 | #set($list = $services.query.hql($hql).execute()) | ||
| 4 | #if($list.size()==0) | ||
| 5 | The ideas application is already upgraded | ||
| 6 | #elseif($request.confirm=="1") | ||
| 7 | #foreach($item in $list) | ||
| 8 | * upgrading [[$item]] | ||
| 9 | #set($itemdoc = $xwiki.getDocument($item)) | ||
| 10 | #set($ok = $itemdoc.use("Ideas.IdeasClass")) | ||
| 11 | #set($ok = $itemdoc.set("status", "open")) | ||
| 12 | #set($ok = $itemdoc.save()) | ||
| 13 | #end | ||
| 14 | #set($list = $services.query.hql($hql).execute()) | ||
| 15 | #if($list.size()==0) | ||
| 16 | The ideas application has been upgraded successfully. | ||
| 17 | #else | ||
| 18 | Upgrade has failed | ||
| 19 | #end | ||
| 20 | #else | ||
| 21 | The ideas application needs to be upgraded. Click [[confirm>>||queryString="confirm=1"]] to upgrade. | ||
| 22 | #end | ||
| 23 | {{/velocity}} |