General Actions:
Log-in
Wiki:
CC09
▼
:
Document Index
»
Space:
Blog
▼
:
Document Index
»
Page:
CreatePost
Search
Page Actions:
Export
▼
:
Export as PDF
Export as RTF
Export as HTML
More actions
▼
:
Print preview
View Source
Welcome to the C&C 09 Doctoral Consortium Wiki
»
The Wiki Blog
»
Create a new blog post
Wiki source code of
Create a new blog post
Last modified by
Hal Eden
on 2010/08/16 23:39
Content
·
Comments
(0)
·
Attachments
(0)
·
History
·
Information
Hide line numbers
1: {{include document="Blog.BlogCode"/}} 2: 3: {{velocity filter="none"}} 4: {{html clean="false" wiki="false"}} 5: #if($hasEdit) 6: $xwiki.jsx.use($blogScriptsDocumentName)## 7: ## 8: ## 9: ## 10: #set($name = "$!request.entryTitle") 11: #if($name == '') 12: ## First step, display the create form 13: #set($space = "$!request.entrySpace") 14: #if($space == '') 15: #set($space = $doc.space) 16: #end 17: <form action="${xwiki.getURL('Blog.CreatePost', 'view', 'xpage=plain')}" id="newBlogPost" method="post"> 18: <div> 19: <input type="hidden" name="entrySpace" value="$space"/> 20: #if($doc.getObject($blogCategoryClassname)) 21: <input type="hidden" name="category" value="${escapetool.xml(${doc.fullName})}"/> 22: #end 23: <label class="createPost" for="entryTitle">$msg.get('xe.blog.post.createpost') </label><input type="text" id="entryTitle" name="entryTitle" value="$msg.get('xe.blog.post.title')" class="withTip"/> <span class="buttonwrapper"><input type="submit" value="${escapetool.xml($msg.get('xe.blog.post.create'))}" class="button"/></span> 24: </div> 25: </form> 26: #else 27: ## Second step, form submitted, create the document 28: #set($space = "$!request.entrySpace") 29: #if($space == '') 30: #set($space = 'Main') 31: #end 32: ## Remove . and : from the document name, as they have a special meaning in XWiki document names 33: #set($postDocName = "${space}.${name.replaceAll('[.:]', '')}") 34: ## Get the target blog document, to set it as the parent 35: #getBlogDocument($space $blogDoc) 36: #set($parent = $blogDoc.fullName) 37: #set($title = $util.encodeURI($name)) 38: #if("$!request.category" != '') 39: #set($category = "&${blogPostClassname}_${blogPostObjectNumber}_category=${escapetool.url(${request.category})}") 40: #end 41: $response.sendRedirect($xwiki.getURL($postDocName, 'inline', "template=${blogPostTemplate}&parent=${parent}&title=${title}&${blogPostClassname}_0_title=${title}$!{category}")) 42: #end## name == '' 43: #elseif("$!request.entryTitle" != '')## !hasEdit && form submitted 44: #template('accessdenied.vm') 45: #end## hasEdit 46: {{/html}} 47: {{/velocity}}
Recent Blog Posts
Problems with the Bibliography System
Welcome to the Wiki
First blog post
Blog Entries
Blog Archive
2009
(3)
Quick Links
Wiki Dashboard
Document Index
Blog
Sandbox
My Recent Modifications
recentComments