Wiki source code of Categories Location Migrator
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | {{job id="{{velocity}}$!request.jobId{{/velocity}}" start="{{velocity}}$!request.confirm{{/velocity}}"}} | ||
| 2 | {{groovy}} | ||
| 3 | services.blog.migrateCategoryLocation(services.wiki.currentWikiId) | ||
| 4 | {{/groovy}} | ||
| 5 | {{/job}} | ||
| 6 | |||
| 7 | {{velocity}} | ||
| 8 | #if ($hasAdmin && $services.blog.hasLegacyCategoryAssignments()) | ||
| 9 | #if ("$!request.jobId" == '') | ||
| 10 | #set ($jobId = "$datetool.get('yyyy-MM-dd')/$datetool.get('HH-mm-ss-SSS')") | ||
| 11 | #set ($categoryStatement = "from doc.object(Blog.CategoryClass) as category where doc.space = 'Blog' and doc.name <> 'CategoryTemplate'") | ||
| 12 | #set ($categories = $services.query.xwql($categoryStatement).execute()) | ||
| 13 | #set ($categoriesSize = $categories.size()) | ||
| 14 | #if ($categoriesSize > 0) | ||
| 15 | $services.localization.render('blog.migration.status.categories', [$services.wiki.currentWikiId, $categoriesSize]) | ||
| 16 | #foreach ($result in $categories) | ||
| 17 | $result | ||
| 18 | #end | ||
| 19 | [[$services.localization.render('blog.migration.start')>>$doc.fullName||queryString="jobId=$!{escapetool.url($jobId)}&confirm=true" class="btn btn-primary"]] | ||
| 20 | #end | ||
| 21 | #elseif ($!request.confirm) | ||
| 22 | $response.sendRedirect($doc.getURL('view',"jobId=$request.jobId")) | ||
| 23 | #end | ||
| 24 | #end | ||
| 25 | {{/velocity}} |