List of usage examples for com.google.gwt.gdata.client.blogger BlogPostQuery setPublishedMin
public final native void setPublishedMin(DateTime publishedMin) ;
From source file:com.google.gwt.gdata.sample.hellogdata.client.BloggerQueryBlogPostsDemo.java
License:Apache License
/** * Retrieves a posts feed for a blog using a Query object. * In GData, feed URIs can contain querystring parameters. The * GData query objects aid in building parameterized feed URIs. * Upon successfully receiving the posts feed, the post entries * are displayed to the user via the showData method. * The PublishedMin and PublishedMax parameters are used to * limit the range of posts to a given publishing period. * //from www.ja v a 2s . com * @param postsFeedUri The posts feed uri for a given blog. */ @SuppressWarnings("deprecation") private void queryPosts(String postsFeedUri) { final BlogPostQuery query = BlogPostQuery.newInstance(postsFeedUri); Date minDate = new Date(); minDate.setMonth(minDate.getMonth() - 1); query.setPublishedMin(DateTime.newInstance(minDate)); query.setPublishedMax(DateTime.newInstance(new Date())); showStatus("Querying Blogger for posts...", false); service.getBlogPostFeed(query, new BlogPostFeedCallback() { public void onFailure(CallErrorException caught) { showStatus("An error occurred while querying Blogger for Posts: " + caught.getMessage(), true); } public void onSuccess(BlogPostFeed result) { showData(result.getEntries()); } }); }