List of usage examples for com.google.gwt.gdata.client.gbase SnippetsQuery setBq
public final native void setBq(String bq) ;
From source file:com.google.gwt.gdata.sample.hellogdata.client.GoogleBaseQuerySnippetsForCamerasDemo.java
License:Apache License
/** * Retrieves a snippets feed using a Query object. * In GData, feed URIs can contain query string parameters. The * GData query objects aid in building parameterized feed URIs. * Upon successfully receiving the snippets feed, the snippet entries * are displayed to the user via the showData method. * We set the BQ parameter to search for digital cameras. * //from w w w . java 2 s. c o m * @param itemsFeedUri The items feed uri. */ private void querySnippets(String itemsFeedUri) { showStatus("Loading snippets feed...", false); SnippetsQuery query = SnippetsQuery.newInstance(itemsFeedUri); query.setMaxResults(25); query.setBq("digital camera [megapixels >= 4][price < 200.0][condition:new]"); service.getSnippetsFeed(query, new SnippetsFeedCallback() { public void onFailure(CallErrorException caught) { showStatus("An error occurred while retrieving the snippets feed: " + caught.getMessage(), true); } public void onSuccess(SnippetsFeed result) { SnippetsEntry[] entries = result.getEntries(); if (entries.length == 0) { showStatus("No snippets matched the search criteria.", false); } else { showData(entries); } } }); }
From source file:com.google.gwt.gdata.sample.hellogdata.client.GoogleBaseQuerySnippetsForConvertiblesDemo.java
License:Apache License
/** * Retrieves a snippets feed using a Query object. * In GData, feed URIs can contain query string parameters. The * GData query objects aid in building parameterized feed URIs. * Upon successfully receiving the snippets feed, the snippet entries * are displayed to the user via the showData method. * We set the BQ parameter to search for convertibles. * /* www .j av a 2 s .c o m*/ * @param itemsFeedUri The items feed uri. */ private void querySnippets(String itemsFeedUri) { showStatus("Loading snippets feed...", false); SnippetsQuery query = SnippetsQuery.newInstance(itemsFeedUri); query.setMaxResults(25); query.setBq("convertible [brand:Volkswagen][year >=2003]" + "[color:red][vehicle type:car]"); service.getSnippetsFeed(query, new SnippetsFeedCallback() { public void onFailure(CallErrorException caught) { showStatus("An error occurred while retrieving the snippets feed: " + caught.getMessage(), true); } public void onSuccess(SnippetsFeed result) { SnippetsEntry[] entries = result.getEntries(); if (entries.length == 0) { showStatus("No snippets matched the search criteria.", false); } else { showData(entries); } } }); }
From source file:com.google.gwt.gdata.sample.hellogdata.client.GoogleBaseQuerySnippetsForHousingDemo.java
License:Apache License
/** * Retrieves a snippets feed using a Query object. * In GData, feed URIs can contain query string parameters. The * GData query objects aid in building parameterized feed URIs. * Upon successfully receiving the snippets feed, the snippet entries * are displayed to the user via the showData method. * We set the BQ parameter to search for housing. * /* ww w . ja v a 2s . co m*/ * @param itemsFeedUri The items feed uri. */ private void querySnippets(String itemsFeedUri) { showStatus("Loading snippets feed...", false); SnippetsQuery query = SnippetsQuery.newInstance(itemsFeedUri); query.setMaxResults(25); query.setBq("[item type:housing][listing type:for sale]" + "[location:@\"San Jose, CA, USA\"+15mi][price < 700000 USD]"); service.getSnippetsFeed(query, new SnippetsFeedCallback() { public void onFailure(CallErrorException caught) { showStatus("An error occurred while retrieving the snippets feed: " + caught.getMessage(), true); } public void onSuccess(SnippetsFeed result) { SnippetsEntry[] entries = result.getEntries(); if (entries.length == 0) { showStatus("No snippets matched the search criteria.", false); } else { showData(entries); } } }); }
From source file:com.google.gwt.gdata.sample.hellogdata.client.GoogleBaseQuerySnippetsForJobsDemo.java
License:Apache License
/** * Retrieves a snippets feed using a Query object. * In GData, feed URIs can contain query string parameters. The * GData query objects aid in building parameterized feed URIs. * Upon successfully receiving the snippets feed, the snippet entries * are displayed to the user via the showData method. * We set the BQ query string to search for jobs. * //w w w . j ava 2 s .c o m * @param itemsFeedUri The items feed uri. */ private void querySnippets(String itemsFeedUri) { showStatus("Loading snippets feed...", false); SnippetsQuery query = SnippetsQuery.newInstance(itemsFeedUri); query.setMaxResults(25); query.setBq("[employer: Google][job type:full-time][job function:Marketing]"); service.getSnippetsFeed(query, new SnippetsFeedCallback() { public void onFailure(CallErrorException caught) { showStatus("An error occurred while retrieving the snippets feed: " + caught.getMessage(), true); } public void onSuccess(SnippetsFeed result) { SnippetsEntry[] entries = result.getEntries(); if (entries.length == 0) { showStatus("No snippets matched the search criteria.", false); } else { showData(entries); } } }); }
From source file:com.google.gwt.gdata.sample.hellogdata.client.GoogleBaseQuerySnippetsForRecipesDemo.java
License:Apache License
/** * Retrieves a snippets feed using a Query object. * In GData, feed URIs can contain query string parameters. The * GData query objects aid in building parameterized feed URIs. * Upon successfully receiving the snippets feed, the snippet entries * are displayed to the user via the showData method. * We set the BQ parameter to search for recipes. * /*from w ww . j a v a2 s .c o m*/ * @param itemsFeedUri The items feed uri. */ private void querySnippets(String itemsFeedUri) { showStatus("Loading snippets feed...", false); SnippetsQuery query = SnippetsQuery.newInstance(itemsFeedUri); query.setMaxResults(25); query.setBq("[item type:recipes][cuisine:chinese][course:main]" + "[main ingredient:chicken]"); service.getSnippetsFeed(query, new SnippetsFeedCallback() { public void onFailure(CallErrorException caught) { showStatus("An error occurred while retrieving the snippets feed: " + caught.getMessage(), true); } public void onSuccess(SnippetsFeed result) { SnippetsEntry[] entries = result.getEntries(); if (entries.length == 0) { showStatus("No snippets matched the search criteria.", false); } else { showData(entries); } } }); }