Example usage for com.google.gwt.gdata.client.blogger BlogFeedCallback BlogFeedCallback

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

Introduction

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

Prototype

BlogFeedCallback

Source Link

Usage

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

License:Apache License

/**
 * Retrieve the Blogger blogs feed using the Blogger service and
 * the blogs feed uri. In GData all get, insert, update and delete methods
 * always receive a callback defining success and failure handlers.
 * Here, the failure handler displays an error message while the
 * success handler obtains the first Blog entry and
 * calls getPosts to retrieve the posts feed for that blog.
 * /*from   w ww. j  ava2s . c  om*/
 * @param blogsFeedUri The uri of the blogs feed
 */
private void getBlogs(String blogsFeedUri) {
    showStatus("Loading blog feed...", false);
    service.getBlogFeed(blogsFeedUri, new BlogFeedCallback() {
        public void onFailure(CallErrorException caught) {
            showStatus("An error occurred while retrieving the Blogger Blog " + "feed: " + caught.getMessage(),
                    true);
        }

        public void onSuccess(BlogFeed result) {
            BlogEntry[] entries = result.getEntries();
            if (entries.length == 0) {
                showStatus("You have no Blogger blogs.", false);
            } else {
                BlogEntry targetBlog = entries[0];
                String postsFeedUri = targetBlog.getEntryPostLink().getHref();
                getPosts(postsFeedUri);
            }
        }
    });
}

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

License:Apache License

/**
 * Retrieve the Blogger blogs feed using the Blogger service and
 * the blogs feed uri. In GData all get, insert, update and delete methods
 * always receive a callback defining success and failure handlers.
 * Here, the failure handler displays an error message while the
 * success handler picks up the first Blog entry and
 * calls queryPosts to retrieve a posts feed for that blog.
 * //from  ww w .j a  v  a 2  s .c  o  m
 * @param blogsFeedUri The uri of the blogs feed
 */
private void getBlogs(String blogsFeedUri) {
    showStatus("Loading blog feed...", false);
    service.getBlogFeed(blogsFeedUri, new BlogFeedCallback() {
        public void onFailure(CallErrorException caught) {
            showStatus("An error occurred while retrieving the Blogger Blog " + "feed: " + caught.getMessage(),
                    true);
        }

        public void onSuccess(BlogFeed result) {
            BlogEntry[] entries = result.getEntries();
            if (entries.length == 0) {
                showStatus("You have no Blogger blogs.", false);
            } else {
                BlogEntry targetBlog = entries[0];
                String postsFeedUri = targetBlog.getEntryPostLink().getHref();
                queryPosts(postsFeedUri);
            }
        }
    });
}

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

License:Apache License

/**
 * Retrieve the Blogger blogs feed using the Blogger service and
 * the blogs feed uri. In GData all get, insert, update and delete methods
 * always receive a callback defining success and failure handlers.
 * Here, the failure handler displays an error message while the
 * success handler calls showData to display the blog entries.
 * /* ww  w  .j  av a 2s  . c  o m*/
 * @param blogsFeedUri The uri of the blogs feed
 */
private void getBlogs(String blogsFeedUri) {
    showStatus("Loading blog feed...", false);
    service.getBlogFeed(blogsFeedUri, new BlogFeedCallback() {
        public void onFailure(CallErrorException caught) {
            showStatus("An error occurred while retrieving the Blogger Blog " + "feed: " + caught.getMessage(),
                    true);
        }

        public void onSuccess(BlogFeed result) {
            BlogEntry[] entries = result.getEntries();
            if (entries.length == 0) {
                showStatus("You have no Blogger blogs.", false);
            } else {
                showData(result.getEntries());
            }
        }
    });
}