General Actions:
Log-in
Wiki:
L3D's Wiki
▼
:
Document Index
»
Space:
Blog
▼
:
Document Index
»
Page:
Migration
Search
Page Actions:
Export
▼
:
Export as PDF
Export as RTF
Export as HTML
More actions
▼
:
Print preview
View Source
Welcome to your wiki
»
Wiki blog
»
Manage blogs on this wiki
»
Blog migration
Wiki source code of
Blog migration
Last modified by
Administrator
on 2008/12/13 17:30
Content
·
Comments
(0)
·
Attachments
(0)
·
History
·
Information
Show line numbers
#if($request.migrate) #set($newContent = '#includeForm("Blog.BlogPostSheet")') #set($query = ", BaseObject obj where obj.name = doc.fullName and obj.className = 'XWiki.ArticleClass'") #foreach($article in $xwiki.searchDocuments($query)) #if($xwiki.hasAccessLevel('edit', $context.user, $article)) #set($articleDoc = $xwiki.getDocument($article)) #set($articleObj = $articleDoc.getObject('XWiki.ArticleClass')) #set($entryObj = $articleDoc.newObject('Blog.BlogPostClass')) #foreach($property in ['title', 'content', 'extract', 'category']) $!entryObj.set($property, $articleObj.getProperty($property).value) #end $!entryObj.set('published', 1) $!entryObj.set('publishDate', $articleDoc.creationDate) $!entryObj.set('hidden', 0) #set($discard = $articleDoc.removeObjects('XWiki.ArticleClass')) $articleDoc.setContent($newContent) $!articleDoc.save("Migrated old blog article to the new blog application", true) * Updated [$entryObj.title>$article] (in space [$articleDoc.space>${articleDoc.space}.WebHome]) #else * Skipping protected document [$article] #end #end Done. [Back to the blog>Blog.WebHome] #else Please confirm that you want to migrate old articles to the new blog application: <form action="$doc.getURL()" method="post"> <div><input type="submit" name="migrate" value="Confirm"/></div> </form> [Back to the blog>Blog.WebHome] #end
Quick Links
L3D Calendar
Wiki Dashboard
Document Index
Blog
Sandbox