mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
ALF-9153 Convert the discussions single post update webscript to de-lucened java backed
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@29772 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -184,6 +184,7 @@ public class DiscussionServiceImpl implements DiscussionService
|
||||
post.setModifier((String)props.get(ContentModel.PROP_MODIFIER));
|
||||
post.setCreatedAt((Date)props.get(ContentModel.PROP_CREATED));
|
||||
post.setModifiedAt((Date)props.get(ContentModel.PROP_MODIFIED));
|
||||
post.setUpdatedAt((Date)props.get(ContentModel.PROP_UPDATED));
|
||||
|
||||
// Now do the discussion ones
|
||||
post.setTitle((String)props.get(ContentModel.PROP_TITLE));
|
||||
@@ -401,6 +402,20 @@ public class DiscussionServiceImpl implements DiscussionService
|
||||
writer.setEncoding("UTF-8");
|
||||
writer.putContent(post.getContents());
|
||||
|
||||
// Mark it as having been updated
|
||||
Date updatedAt = new Date();
|
||||
nodeService.setProperty(nodeRef, ContentModel.PROP_UPDATED, updatedAt);
|
||||
if(post instanceof PostInfoImpl)
|
||||
{
|
||||
((PostInfoImpl)post).setUpdatedAt(updatedAt);
|
||||
((PostInfoImpl)post).setModifiedAt(updatedAt);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Re-create to get the updated date
|
||||
post = buildPost(nodeRef, post.getTopic(), post.getSystemName(), post.getContents());
|
||||
}
|
||||
|
||||
// All done
|
||||
return post;
|
||||
}
|
||||
|
Reference in New Issue
Block a user