mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
ALF-9157 Wiki Page Service CRUD unit tests (listing ones to follow)
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@29540 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -202,7 +202,7 @@ public class WikiPageServiceImpl implements WikiPageService
|
||||
).getChildRef();
|
||||
|
||||
// Store the content
|
||||
ContentWriter writer = contentService.getWriter(nodeRef, ContentModel.PROP_CONTENT, false);
|
||||
ContentWriter writer = contentService.getWriter(nodeRef, ContentModel.PROP_CONTENT, true);
|
||||
writer.setEncoding("UTF-8");
|
||||
writer.putContent(content);
|
||||
|
||||
@@ -223,11 +223,13 @@ public class WikiPageServiceImpl implements WikiPageService
|
||||
NodeRef nodeRef = page.getNodeRef();
|
||||
|
||||
// Handle the rename case
|
||||
boolean renamed = false;
|
||||
if(! nodeService.getProperty(nodeRef, ContentModel.PROP_NAME).equals(page.getTitle()))
|
||||
{
|
||||
try
|
||||
{
|
||||
fileFolderService.rename(nodeRef, page.getTitle());
|
||||
renamed = true;
|
||||
}
|
||||
catch(FileNotFoundException e)
|
||||
{
|
||||
@@ -245,6 +247,12 @@ public class WikiPageServiceImpl implements WikiPageService
|
||||
// Now do the tags
|
||||
taggingService.setTags(nodeRef, page.getTags());
|
||||
|
||||
// If we re-named, re-create the object
|
||||
if(renamed)
|
||||
{
|
||||
page = buildPage(nodeRef, page.getContainerNodeRef(), page.getTitle(), page.getContents());
|
||||
}
|
||||
|
||||
// All done
|
||||
return page;
|
||||
}
|
||||
|
Reference in New Issue
Block a user