Hi,
I try to convert a website in xwiki.blog application
For each page I create a groovy script that creates a blog post
The script is successful with three exceptions;
1) Would like to maintain the original author
So I create a xwiki.user (this works)
Then I would like to set the document property with
{{groovy}}
... (the first part of the script)
vArticle.set("creator",'XWiki.FamilievandenMeulengraaf')
vArticle.save()
{{/groovy}}
But looking at the post it still has creator as the user running the code
2) Categories
I've created a few categories in the blog application
So I would like to set the category attribute, where the class-attribute definition of the
post = Database Tree
{{groovy}}
...
vObjArticle.set("Category",'???')
...
{{/groovy}}
Does any body know what to put in '???', since a category can be multiple entries
???
3)
When I run the script a postpage is created, I see a link in the new documents frame.
When I go to it it displays OK, but when I go to the blog application it does not show in
the blog indexes (recently, categories (explained under 2)) or historical)
Only when I go to the page, click edit object and directly click save it will show up in
he blog
What could be the reason for this,
The code looks like (XXXX = title of the post)
{{groovy}}
vArticle = xwiki.getDocument("CdlsArticle.XXXXXX")
vArticle.setContent('{{include
document="CdlsArticle.ArticlePostSheet"/}}')
vArticle.setParent("CdlsArticle.WebHome")
vArticle.set("language","nl")
vArticle.set("translation","1")
vObjArticle =
vArticle.getObject("CdlsArticle.ArticlePostClass",true)
...
def vTitle = "XXXXX"
vObjArticle.set("title",vTitle)
...
def vExtractHeader = '....'
def vExtractText = '....'
def vExtractPicture = 'image:photo.cdlsnl@xxxx.jpg
vObjArticle.set("extract",vExtractHeader + vExtractText +
vExtractPicture)
.. etcetera
..
vObjArticle.set("published",'1')
vArticle.save()
{{/groovy}}