You are here

updateComment

public Comment updateComment(Node node, Comment comment, String content) throws SkyVaultServiceException update the content of the specified comment.

Parameters

Node node
The node with the specified comment.
Comment comment
The comment to update.
String content
A string representing the new content.

Returns

Returns the Comment that was updated.

Exception

Throws an SkyVaultServiceException if the operation cannot be completed.

Example


    CommentService cs = session.getServiceRegistry().getCommentService();
    
    Node node = getTestNode(session, "ClimbingVolcanoes.JPG");
    
    if (node != null) {
    
        // getComments
        List<Comment> comments = cs.getComments(node);
    
        for (Comment c : comments) {
            Log.d(TAG, "Comment:");
            Log.d(TAG, "canDelete:" + c.canDelete());
            Log.d(TAG, "canEdit:" + c.canEdit());
            Log.d(TAG, "Content:" + c.getContent());
            Log.d(TAG, "createdBy:" + c.getCreatedBy());
            Log.d(TAG, "creationTime:"
                  + c.getCreationTime().getTime().toString());
            Log.d(TAG, "identifier:" + c.getIdentifier());
            Log.d(TAG, "modificationTime:"
                  + c.getModificationTime().getTime().toString());
            Log.d(TAG, "name:" + c.getName());
            Log.d(TAG, "title:" + c.getTitle());
            Log.d(TAG, "isEdited:" + c.isEdited());
            Log.d(TAG, "--------");
        }
    
        try {
    
            // addComment
            Comment comment = cs.addComment(node, "This is my very interesting comment!");
    
            // updateComment
            comment = cs.updateComment(node, comment, "This is my updated comment!");
    
            // deleteComment
            cs.deleteComment(node, comment);
    
        }
        catch(AlfrescoServiceException e){
            Log.d(TAG, "Exception: " + e.toString());
        }
    }