当前位置: 首页>>代码示例>>Java>>正文


Java ListFeed.getEntries方法代码示例

本文整理汇总了Java中com.google.gdata.data.spreadsheet.ListFeed.getEntries方法的典型用法代码示例。如果您正苦于以下问题:Java ListFeed.getEntries方法的具体用法?Java ListFeed.getEntries怎么用?Java ListFeed.getEntries使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.gdata.data.spreadsheet.ListFeed的用法示例。


在下文中一共展示了ListFeed.getEntries方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getSsEntryListHelper

import com.google.gdata.data.spreadsheet.ListFeed; //导入方法依赖的package包/类
/**
 * Retrieves all <code>ListEntry</code> objects from the spreadsheet
 *
 * @return <code>List</code> of <code>ListEntry</code> instances
 * @throws EPAuthenticationException 
 */
private List<ListEntry> getSsEntryListHelper() 
  throws EPAuthenticationException {
  List<ListEntry> returnList = null;

  try {
    SpreadsheetService ssService = getSsService();
    ListFeed listFeed = ssService.getFeed(ssUrl, ListFeed.class);
    returnList = listFeed.getEntries();
  } catch (com.google.gdata.util.AuthenticationException authEx) {
    throw new EPAuthenticationException("SS read access not available");
  } catch (com.google.gdata.util.ServiceException svcex) {
    System.err.println("ServiceException while retrieving " +
        "entry list: " + svcex.getMessage());
    returnList = null;
  } catch (java.io.IOException ioex) {
    System.err.println("IOException while retrieving " +
        "entry list: " + ioex.getMessage());
    returnList = null;
  }
  return returnList;
}
 
开发者ID:google,项目名称:gdata-java-client,代码行数:28,代码来源:EventPublisher.java

示例2: getAllEntries

import com.google.gdata.data.spreadsheet.ListFeed; //导入方法依赖的package包/类
private List<String> getAllEntries(ListFeed listFeed, String[] headerDefault)
  {
      List<String> returnValue = Lists.newArrayList();
Joiner joiner = Joiner.on(Properties.inputDelimiter.get());
Set<String> header = null;
List<ListEntry> entries = listFeed.getEntries();
if (entries != null && entries.size() > 0) {
	ListEntry listEntry = entries.get(0);
	if (listEntry != null)
		header = listEntry.getCustomElements().getTags();
}
if (header == null && headerDefault != null) {
	header = new LinkedHashSet<String>();
	for (String headerItem : headerDefault) {
		header.add(headerItem);
	}
}
      returnValue.add(joiner.join(header));
      for (ListEntry row : entries) {
          List<String> rowValues = Lists.newArrayList();
          for (String tag : header) {
              String value = row.getCustomElements().getValue(tag);
              if (value == null)
                  value = "";
              rowValues.add(value);
          }
          String rowValuesString = joiner.join(rowValues);
          returnValue.add(rowValuesString);
      }
      return returnValue;
  }
 
开发者ID:Netflix,项目名称:q,代码行数:32,代码来源:GoogleSheetsService.java

示例3: reverseAllEntries

import com.google.gdata.data.spreadsheet.ListFeed; //导入方法依赖的package包/类
/**
 * Lists all rows in the spreadsheet in reverse order.
 * 
 * @throws ServiceException when the request causes an error in the Google
 *         Spreadsheets service.
 * @throws IOException when an error occurs in communication with the Google
 *         Spreadsheets service.
 */
public void reverseAllEntries() throws IOException, ServiceException {

  ListQuery query = new ListQuery(listFeedUrl);
  query.setReverse(true);
  ListFeed feed = service.query(query, ListFeed.class);
  for (ListEntry entry : feed.getEntries()) {
    printAndCacheEntry(entry);
  }
}
 
开发者ID:google,项目名称:gdata-java-client,代码行数:18,代码来源:ListDemo.java

示例4: search

import com.google.gdata.data.spreadsheet.ListFeed; //导入方法依赖的package包/类
/**
 * Searches rows with a full text search string, finding any rows that match
 * all the given words.
 * 
 * @param fullTextSearchString a string like "Rosa 555" will look for the
 *        substrings Rosa and 555 to appear anywhere in the row
 * @throws ServiceException when the request causes an error in the Google
 *         Spreadsheets service.
 * @throws IOException when an error occurs in communication with the Google
 *         Spreadsheets service.
 */
public void search(String fullTextSearchString) throws IOException,
    ServiceException {
  ListQuery query = new ListQuery(listFeedUrl);
  query.setFullTextQuery(fullTextSearchString);
  ListFeed feed = service.query(query, ListFeed.class);

  out.println("Results for [" + fullTextSearchString + "]");

  for (ListEntry entry : feed.getEntries()) {
    printAndCacheEntry(entry);
  }
}
 
开发者ID:google,项目名称:gdata-java-client,代码行数:24,代码来源:ListDemo.java

示例5: getListRows

import com.google.gdata.data.spreadsheet.ListFeed; //导入方法依赖的package包/类
public List getListRows(Object worksheetEntryObject) throws Exception {
	WorksheetEntry worksheet = (WorksheetEntry) worksheetEntryObject; 
	// Fetch the list feed of the worksheet.
    URL listFeedUrl = worksheet.getListFeedUrl();
    ListFeed listFeed = service.getFeed(listFeedUrl, ListFeed.class);
    return listFeed.getEntries();
}
 
开发者ID:Dotosoft,项目名称:dotoquiz-tools,代码行数:8,代码来源:GooglesheetClient.java

示例6: doInBackground

import com.google.gdata.data.spreadsheet.ListFeed; //导入方法依赖的package包/类
@Override
protected Boolean doInBackground(String... params) {
	// TODO Auto-generated method stub
	
    try {
		
        GoogleOAuthParameters oauthParameters = new GoogleOAuthParameters();
        oauthParameters.setOAuthConsumerKey (Config.CLIENT_ID);
        oauthParameters.setOAuthConsumerSecret (Config.CLIENT_SECRET);
        oauthParameters.setOAuthType (OAuthType.TWO_LEGGED_OAUTH);
        oauthParameters.setScope ("https://spreadsheets.google.com/feeds/");
        
		SpreadsheetService service = new SpreadsheetService("QRScanner");
		service.useSsl();
		service.setOAuthCredentials (oauthParameters, new OAuthHmacSha1Signer ());
	
      // Notice that the url ends
      // with default/public/values.
      // That wasn't obvious (at least to me)
      // from the documentation.
      String urlString = Config.SPREADSHEET_PUBLIC_URL;

      // turn the string into a URL
      URL url = new URL(urlString);

      
      // You could substitute a cell feed here in place of
      // the list feed (TODO: Might be useful for updating)
      ListFeed feed = service.getFeed(url, ListFeed.class);
      //CellFeed cellfeed = service.getFeed(url, CellFeed.class);

      for (ListEntry entry : feed.getEntries()) {
        CustomElementCollection elements = entry.getCustomElements();
        String qrcontent = elements.getValue("qrcontent");
        String entrytimestamp = elements.getValue("entrytimestamp");
        
        Guest guest = new Guest(elements);
        
        m_eventGuests.addGuest(qrcontent, guest);
        
        if(qrcontent.equals(params[0]) && (entrytimestamp == null || entrytimestamp.equals("")) ) {
	        //TODO: Need to update Entry Time stamp column (preferable move this somewhere else)
        	//elements.setValueLocal("entrytimestamp", getCurrentDateTime());
        	return true;
        }
        else if(qrcontent.equals(params[0])) {
        	return false;
        }
      }
    } catch (Exception e) {
      e.printStackTrace();
    }
    return false;
}
 
开发者ID:samiyaakhtar,项目名称:eventscanner,代码行数:55,代码来源:ReadSpreadsheet.java

示例7: getSortedListRows

import com.google.gdata.data.spreadsheet.ListFeed; //导入方法依赖的package包/类
public List<ListEntry> getSortedListRows(WorksheetEntry worksheet, boolean isReverse, String columnSorted) throws IOException, ServiceException, URISyntaxException {
	// Fetch the sorted list feed of the worksheet
    URL listFeedUrl = new URI(worksheet.getListFeedUrl().toString() + "?reverse=" + (isReverse ? "true" : "false") + "?orderby=column:" + columnSorted).toURL();
    ListFeed listFeed = service.getFeed(listFeedUrl, ListFeed.class);
    return listFeed.getEntries();
}
 
开发者ID:Dotosoft,项目名称:dotoquiz-tools,代码行数:7,代码来源:GooglesheetClient.java

示例8: getListRowsByQuery

import com.google.gdata.data.spreadsheet.ListFeed; //导入方法依赖的package包/类
public List<ListEntry> getListRowsByQuery(WorksheetEntry worksheet, String query) throws IOException, ServiceException, URISyntaxException {
	// Fetch the sorted list feed of the worksheet
    URL listFeedUrl = new URI(worksheet.getListFeedUrl().toString() + "?sq=" + query).toURL();
    ListFeed listFeed = service.getFeed(listFeedUrl, ListFeed.class);
    return listFeed.getEntries();
}
 
开发者ID:Dotosoft,项目名称:dotoquiz-tools,代码行数:7,代码来源:GooglesheetClient.java

示例9: listAllEntries

import com.google.gdata.data.spreadsheet.ListFeed; //导入方法依赖的package包/类
/**
 * Lists all rows in the spreadsheet.
 * 
 * @throws ServiceException when the request causes an error in the Google
 *         Spreadsheets service.
 * @throws IOException when an error occurs in communication with the Google
 *         Spreadsheets service.
 */
public void listAllEntries() throws IOException, ServiceException {
  ListFeed feed = service.getFeed(listFeedUrl, ListFeed.class);

  for (ListEntry entry : feed.getEntries()) {
    printAndCacheEntry(entry);
  }
}
 
开发者ID:google,项目名称:gdata-java-client,代码行数:16,代码来源:ListDemo.java

示例10: getAllListEntries

import com.google.gdata.data.spreadsheet.ListFeed; //导入方法依赖的package包/类
/**
 * Gets a list of all the list entries.
 *
 * @return a list of all non-empty rows in the spreadsheet
 * @throws IOException if there was a problem contacting Google
 * @throws ServiceException if there was an error processnig the request
 */
public List<ListEntry> getAllListEntries()
    throws IOException, ServiceException {
  ListQuery query = new ListQuery(feedUrl);
  ListFeed feed = service.query(query, ListFeed.class);
  return feed.getEntries();
}
 
开发者ID:google,项目名称:gdata-java-client,代码行数:14,代码来源:ListFeedHelper.java

示例11: getFullTextSearch

import com.google.gdata.data.spreadsheet.ListFeed; //导入方法依赖的package包/类
/**
 * Gets a list of all entries that match a full-text search.
 *
 * Full-text searches look for the keywords you specify, that may
 * occur in any order in the row.  Right now only the simplest syntax
 * is supported, as a convenience feature.
 *
 * @param search the search string like "adam technical writer"
 * @return all matching entries
 * @throws IOException if there was a problem contacting Google
 * @throws ServiceException if there was an error processnig the request
 */
public List<ListEntry> getFullTextSearch(String search)
    throws IOException, ServiceException {
  ListQuery query = new ListQuery(feedUrl);
  query.setFullTextQuery(search);
  ListFeed feed = service.query(query, ListFeed.class);
  return feed.getEntries();
}
 
开发者ID:google,项目名称:gdata-java-client,代码行数:20,代码来源:ListFeedHelper.java

示例12: getStructuredQuery

import com.google.gdata.data.spreadsheet.ListFeed; //导入方法依赖的package包/类
/**
 * Gets a list of all entries that match a structured query.
 *
 * Structured queries are in format:
 *    name = 'adam' and (job = 'technical writer' or job = 'artist')
 *
 * In short, it is case-insensitive, supporting both SQL-like and
 * C-like syntaxes for all varieties of new and seasoned programmers.
 *
 * @param structuredQuery the search string
 * @return all matching entries
 * @throws IOException if there was a problem contacting Google
 * @throws ServiceException if there was an error processnig the request
 */
public List<ListEntry> getStructuredQuery(
     String structuredQuery)
     throws IOException, ServiceException {
  ListQuery query = new ListQuery(feedUrl);
  query.setFullTextQuery(structuredQuery);
  ListFeed feed = service.query(query, ListFeed.class);
  return feed.getEntries();
}
 
开发者ID:google,项目名称:gdata-java-client,代码行数:23,代码来源:ListFeedHelper.java


注:本文中的com.google.gdata.data.spreadsheet.ListFeed.getEntries方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。