views:

10

answers:

0
myService = new SpreadsheetService("openentry-catalog-1");
   myService.setAuthSubToken(sessionToken, null);
   SpreadsheetEntry spreadsheet = (SpreadsheetEntry) spreadsheetEntry;
   WorksheetEntry worksheet = spreadsheet.getWorksheets().get(2);
   this.addNewProducts(worksheet, photos);

private void addNewProducts(WorksheetEntry entry, List<PhotoInfoDTO> photos){

  String[] tags = {"Page Name", "Page Content", "Hidden"};
  for(PhotoInfoDTO photo : photos){
   try{
    ListEntry newEntry = new ListEntry();
    newEntry.getCustomElements().setValueLocal(tags[0], photo.getImageCode());
    newEntry.getCustomElements().setValueLocal(tags[1], photo.getImageName());
    newEntry.getCustomElements().setValueLocal(tags[2], photo.getImageDescription());
    myService.insert(entry.getListFeedUrl(),newEntry);
   }catch(Exception e){
    e.printStackTrace();
   }
  }
 }

In the above code, (SpreadsheetEntry) spreadsheetEntry is a newly created SpreadsheetEntry using DocumnetListEntry. Page Name, Page Content, Hidden are the first row in the worksheet.