Example usage for com.google.gwt.gdata.client.blogger CommentEntry getContent

List of usage examples for com.google.gwt.gdata.client.blogger CommentEntry getContent

Introduction

In this page you can find the example usage for com.google.gwt.gdata.client.blogger CommentEntry getContent.

Prototype

public final native Text getContent() ;

Source Link

Document

Returns the content.

Usage

From source file:com.google.gwt.gdata.sample.hellogdata.client.BloggerCreateBlogPostCommentDemo.java

License:Apache License

/**
 * Create a blog comment by inserting a comment entry into
 * a blog comments feed.//  w  w  w  .ja  va 2s  . co m
 * Set the comment's contents to an arbitrary string. Here
 * we prefix the contents with 'GWT-Blogger-Client' so that
 * we can identify which comments were created by this demo.
 * On success and failure, display a status message.
 * 
 * @param blogId The ID of the blog containing the target post
 * @param postId The ID of the post to which to reply
 */
private void insertComment(String blogId, String postId) {
    showStatus("Creating blog comment entry...", false);
    CommentEntry comment = CommentEntry.newInstance();
    comment.setContent(Text.newInstance());
    comment.getContent().setText("GWT-Blogger-Client - Great post!");
    String commentsFeedUri = "http://www.blogger.com/feeds/" + blogId + "/" + postId + "/comments/default";
    service.insertEntry(commentsFeedUri, comment, new CommentEntryCallback() {
        public void onFailure(CallErrorException caught) {
            showStatus("An error occurred while creating the Blogger post " + "comment: " + caught.getMessage(),
                    true);
        }

        public void onSuccess(CommentEntry result) {
            showStatus("Created a comment.", false);
        }
    });
}