Wiki source code of Manage blogs on this wiki

Last modified by Michelle Shi on 2010/03/06 15:19

Show last authors
1 {{include document="Blog.BlogCode"/}}
2 {{velocity filter="none"}}
3 {{html clean="false" wiki="true"}}
4 #if($hasAdmin)
5 ##
6 ##
7 ## List existing blogs.
8 ## TODO: Display the number of articles in each blog
9 ## TODO: Provide some management links: delete, edit title, configure...
10 ##
11 = $msg.get('xe.blog.manage.existing') =
12
13 #foreach($item in $xwiki.wrapDocs($xwiki.searchDocuments(", BaseObject obj where obj.name = doc.fullName and obj.className = '$blogClassname'")))
14 #getBlogTitle($item $title)
15 #if($title != '')
16 * [[$title>>$item.fullName]]
17 #else
18 * [[$item.displayTitle>>$item.fullName]]
19 <p/>
20 #end
21 #end
22 ##
23 ##
24 ## New blog
25 ##
26
27 = $msg.get('xe.blog.manage.createnew') =
28
29 #set($title = "$!request.blogTitle")
30 #if($title != '')
31 #set($space = "$!request.blogSpace")
32 #if($space == '')
33 #warning($msg.get('xe.blog.manage.nospace'))
34 #else
35 #if("$!request.blogType" == 'main')
36 #set($blogDocName = "${space}.WebHome")
37 #else
38 #set($blogDocName = "${space}.Blog")
39 #end
40 #set($title = $util.encodeURI($title))
41 #set($parent = 'Main.WebHome')
42 $response.sendRedirect($xwiki.getURL($blogDocName, 'save', "parent=${parent}&title=${title}&template=${blogTemplate}&${blogClassname}_0_title=${title}"))
43 #end
44 #end
45 ##
46 ## Show the form
47 <form action="${xwiki.getURL('Blog.Management')}" id="newBlog" method="post">
48 <div>
49 <dl>
50 <dt><label for="blogSpace">$msg.get('xe.blog.manage.space')</label></dt>
51 <dd><input type="text" name="blogSpace" id="blogSpace" value=""/></dd>
52 <dt><label for="blogTitle">$msg.get('xe.blog.manage.title')</label></dt>
53 <dd><input type="text" name="blogTitle" id="blogTitle" value="$msg.get('xe.blog.manage.blogtitle')"/></dd>
54 <dt><label for="blogType">$msg.get('xe.blog.manage.blogtype')</label></dt>
55 <dd><select name="blogType" id="blogType">
56 <option value="inner" selected="selected">$msg.get('xe.blog.manage.inside')</option>
57 <option value="main">$msg.get('xe.blog.manage.main')</option>
58 </select></dd>
59 </dl>
60 <input type="submit" value="$msg.get('xe.blog.manage.create')"/>
61 </div>
62 </form>
63 #else ## !hasAdmin
64 #xwikimessageboxstart($msg.get('error') $msg.get('notallowed'))
65 #xwikimessageboxend()
66 #end
67
68 {{/html}}
69 {{/velocity}}



Failed to execute the [velocity] macro. Cause: [Error number 9001 in 3: The query [, BaseObject obj, IntegerProperty isPublished, IntegerProperty hidden, DateProperty publishDate  where doc.fullName <> 'Blog.BlogPostTemplate' and obj.name = doc.fullName and obj.className = 'Blog.BlogPostClass' and publishDate.id.id = obj.id and publishDate.id.name = 'publishDate' and isPublished.id.id = obj.id and isPublished.id.name = 'published' and hidden.id.id = obj.id and hidden.id.name = 'hidden' and (doc.creator = 'XWiki.XWikiGuest' or (isPublished.value = 1 and hidden.value = 0)) and isPublished.value = 1 and hidden.value <> 1 order by publishDate.value desc] requires programming right]. Click on this message for details.



Failed to execute the [velocity] macro. Cause: [Error number 9001 in 3: The query [, BaseObject obj, IntegerProperty isPublished, IntegerProperty hidden, DateProperty publishDate  where doc.fullName <> 'Blog.BlogPostTemplate' and obj.name = doc.fullName and obj.className = 'Blog.BlogPostClass' and publishDate.id.id = obj.id and publishDate.id.name = 'publishDate' and isPublished.id.id = obj.id and isPublished.id.name = 'published' and hidden.id.id = obj.id and hidden.id.name = 'hidden' and (doc.creator = 'XWiki.XWikiGuest' or (isPublished.value = 1 and hidden.value = 0)) and isPublished.value = 0 order by publishDate.value desc] requires programming right]. Click on this message for details.




Failed to execute the [velocity] macro. Cause: [Error number 9001 in 3: The query [, DBStringListProperty as categories join categories.list as category, BaseObject obj, IntegerProperty isPublished, IntegerProperty hidden, DateProperty publishDate  where doc.fullName <> 'Blog.BlogPostTemplate' and obj.name = doc.fullName and obj.className = 'Blog.BlogPostClass' and publishDate.id.id = obj.id and publishDate.id.name = 'publishDate' and isPublished.id.id = obj.id and isPublished.id.name = 'published' and hidden.id.id = obj.id and hidden.id.name = 'hidden' and (doc.creator = 'XWiki.XWikiGuest' or (isPublished.value = 1 and hidden.value = 0)) and obj.id = categories.id.id and categories.id.name='category' and category in ('Blog.News') order by publishDate.value desc] requires programming right]. Click on this message for details.



Failed to execute the [velocity] macro. Cause: [Error number 9001 in 3: The query [, BaseObject obj, IntegerProperty isPublished, IntegerProperty hidden, DateProperty publishDate  where doc.fullName <> 'Blog.BlogPostTemplate' and obj.name = doc.fullName and obj.className = 'Blog.BlogPostClass' and publishDate.id.id = obj.id and publishDate.id.name = 'publishDate' and isPublished.id.id = obj.id and isPublished.id.name = 'published' and hidden.id.id = obj.id and hidden.id.name = 'hidden' and (doc.creator = 'XWiki.XWikiGuest' or (isPublished.value = 1 and hidden.value = 0)) and (doc.space = 'Blog' or doc.parent = 'Blog.WebHome') order by year(publishDate.value)] requires programming right]. Click on this message for details.