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


Java ListEntry.update方法代码示例

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


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

示例1: update

import com.google.gdata.data.spreadsheet.ListEntry; //导入方法依赖的package包/类
/**
 * Updates an existing entry.
 * 
 * See the comment in {@code delete} for why the entry is cached in a hash
 * map.
 * 
 * @param id the ID of the row to update
 * @param nameValuePairs the name value pairs, such as "name=Rosa" to change
 *        the row's name field to Rosa
 * @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 update(String id, String nameValuePairs) throws IOException,
    ServiceException {

  // The next line of code finds the entry to update.
  // See the javadoc on entriesCached.
  ListEntry entry = entriesCached.get(id);

  setEntryContentsFromString(entry, nameValuePairs);

  if (entry != null) {
    entry.update(); // This updates the existing entry.
    out.println("Updated!");
  } else {
    out.println("I don't know that ID.");
    out.println("In GData, you must get an entry before deleting it.");
    out.println("You might have to 'list' first.");
  }
}
 
开发者ID:google,项目名称:gdata-java-client,代码行数:33,代码来源:ListDemo.java

示例2: updateSyncPicasa

import com.google.gdata.data.spreadsheet.ListEntry; //导入方法依赖的package包/类
public static void updateSyncPicasa(Settings settings, String parseType, Object data, String picasaId, String imagePicasaURL, String isProcessed) throws IOException, ServiceException {
	String paramPIcasaId = DotoQuizStructure.getStructureKey(parseType, settings, "iAlbumIdPicasa");
	String paramImageURLPicasa = DotoQuizStructure.getStructureKey(parseType, settings, "iImageURLPicasa");
	String paramIsProcessed = DotoQuizStructure.getStructureKey(parseType, settings, "iIsProcessed");
	
	if(DATA_TYPE.EXCEL.toString().equals(settings.getDataType())) {
		Row rowData = (Row) data;
		
		if(StringUtils.hasValue(picasaId)) rowData.getCell(Integer.parseInt(paramPIcasaId)).setCellValue(picasaId);
		if(StringUtils.hasValue(imagePicasaURL)) rowData.getCell(Integer.parseInt(paramImageURLPicasa)).setCellValue(imagePicasaURL);
		rowData.getCell(Integer.parseInt(paramIsProcessed)).setCellValue(isProcessed);
	} else if(DATA_TYPE.GOOGLESHEET.toString().equals(settings.getDataType())) {
		ListEntry listEntry = (ListEntry) data;
		if(StringUtils.hasValue(picasaId)) listEntry.getCustomElements().setValueLocal(paramPIcasaId, picasaId);
		if(StringUtils.hasValue(imagePicasaURL)) listEntry.getCustomElements().setValueLocal(paramImageURLPicasa, imagePicasaURL);
		listEntry.getCustomElements().setValueLocal(paramIsProcessed, isProcessed);
		listEntry.update();
	}
}
 
开发者ID:Dotosoft,项目名称:dotoquiz-tools,代码行数:20,代码来源:GooglesheetClient.java

示例3: updateClearPicasa

import com.google.gdata.data.spreadsheet.ListEntry; //导入方法依赖的package包/类
public static void updateClearPicasa(Settings settings, String parseType, Object data) throws IOException, ServiceException {
  	String paramPIcasaId = DotoQuizStructure.getStructureKey(parseType, settings, "iAlbumIdPicasa");
String paramImageURLPicasa = DotoQuizStructure.getStructureKey(parseType, settings, "iImageURLPicasa");
String paramIsProcessed = DotoQuizStructure.getStructureKey(parseType, settings, "iIsProcessed");

String picasaId = "";
if(DATA_TYPE.EXCEL.toString().equals(settings.getDataType())) {
	Row rowData = (Row) data;
	picasaId = rowData.getCell(Integer.parseInt(paramPIcasaId)).getStringCellValue();
	rowData.getCell(Integer.parseInt(paramPIcasaId)).setCellValue(QuizConstant.EMPTY_STRING);
	rowData.getCell(Integer.parseInt(paramImageURLPicasa)).setCellValue(QuizConstant.EMPTY_STRING);
	rowData.getCell(Integer.parseInt(paramIsProcessed)).setCellValue(QuizConstant.EMPTY_STRING);
} else if(DATA_TYPE.GOOGLESHEET.toString().equals(settings.getDataType())) {
	ListEntry listEntry = (ListEntry) data;
	picasaId = listEntry.getCustomElements().getValue(paramPIcasaId);
	listEntry.getCustomElements().setValueLocal(paramPIcasaId, QuizConstant.EMPTY_STRING);
	listEntry.getCustomElements().setValueLocal(paramImageURLPicasa, QuizConstant.EMPTY_STRING);
	listEntry.getCustomElements().setValueLocal(paramIsProcessed, QuizConstant.EMPTY_STRING);
	listEntry.update();
}

log.info("Clear Data " + parseType + ": " + picasaId);
  }
 
开发者ID:Dotosoft,项目名称:dotoquiz-tools,代码行数:24,代码来源:GooglesheetClient.java

示例4: createsNewColumnForUserId

import com.google.gdata.data.spreadsheet.ListEntry; //导入方法依赖的package包/类
@Ignore
@Test
public void createsNewColumnForUserId() throws Exception {
    final SpreadSheetReader spreadsheet =
        JujacoreProgressServiceIntegrationTest.injector.getInstance(
            Key.get(SpreadSheetReader.class, Names.named("progress"))
        );
    final String title = "TEST_HEADER";
    final ListEntry header = spreadsheet.findRowByColumnValue(title, "");
    header.update();
    final CellEntry cell = spreadsheet.createNewHeader(title);
    MatcherAssert.assertThat(cell.getCell().getInputValue(), Is.is(title));
}
 
开发者ID:JujaLabs,项目名称:microservices,代码行数:14,代码来源:JujacoreProgressServiceIntegrationTest.java

示例5: updateSsEventEditUrl

import com.google.gdata.data.spreadsheet.ListEntry; //导入方法依赖的package包/类
/**
 * Updates the Google Base and/or Calendar edit URLs in the spreadsheet.
 * The storage of these edit URLs enables further runs of this code to 
 * publish events as new Calendar and Base entries only if the events had
 * not been previously published
 *
 * @param ssEditUrl The edit <code>URL</code> for the spreadsheet 
 * @param calEditUrl The edit URL to be set in the spreadsheet or null
 * @param baseEditUrl The edit URL to be set in the spreadsheet or null
 * @throws EPAuthenticationException
 * @throws IOException
 * @throws ServiceException 
 */
private void updateSsEventEditUrl(URL ssEditUrl, String calEditUrl, 
    String baseEditUrl) 
    throws EPAuthenticationException, IOException, ServiceException {
  SpreadsheetService ssService = getSsService();
  ListEntry ssEntry = ssService.getEntry(ssEditUrl, ListEntry.class);
  // remove spaces in the URL
  String calUrlFieldName = fieldMap.getCalendarUrlColumn();
  if (calEditUrl == null && 
      (ssEntry.getCustomElements().getValue(calUrlFieldName) == null || 
       "".equals(ssEntry.getCustomElements().getValue(calUrlFieldName)))){
    calEditUrl = " ";
  }
  if (calEditUrl != null) {
    ssEntry.getCustomElements().setValueLocal(
        calUrlFieldName,
        calEditUrl);
  }
  // remove spaces in the URL
  String baseUrlFieldName = fieldMap.getBaseUrlColumn();
  if (baseEditUrl == null &&
      (ssEntry.getCustomElements().getValue(baseUrlFieldName) == null ||
    "".equals(ssEntry.getCustomElements().getValue(baseUrlFieldName)))){
    baseEditUrl = " ";
  }    
  if (baseEditUrl != null) {
    ssEntry.getCustomElements().setValueLocal(
        baseUrlFieldName,
        baseEditUrl);
  }
  ssEntry.update();
}
 
开发者ID:google,项目名称:gdata-java-client,代码行数:45,代码来源:EventPublisher.java


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