use of org.teiid.translator.google.api.metadata.SpreadsheetInfo in project teiid by teiid.
the class SpreadsheetConnectionImpl method updateRows.
@Override
public UpdateResult updateRows(String worksheetTitle, String criteria, List<UpdateSet> set) {
SpreadsheetInfo info = getSpreadsheetInfo();
org.teiid.translator.google.api.metadata.Worksheet sheet = info.getWorksheetByName(worksheetTitle);
return gdata.listFeedUpdate(info.getSpreadsheetKey(), sheet.getId(), criteria, set, sheet.getColumnsAsList());
}
use of org.teiid.translator.google.api.metadata.SpreadsheetInfo in project teiid by teiid.
the class SpreadsheetConnectionImpl4 method updateRows.
@Override
public UpdateResult updateRows(String worksheetTitle, String criteria, List<UpdateSet> set) {
SpreadsheetInfo info = getV2SpreadsheetInfo();
org.teiid.translator.google.api.metadata.Worksheet sheet = info.getWorksheetByName(worksheetTitle);
if (sheet == null) {
// $NON-NLS-1$
throw new SpreadsheetOperationException(SpreadsheetManagedConnectionFactory.UTIL.getString("not_visible"));
}
return gdata.listFeedUpdate(info.getSpreadsheetKey(), sheet.getId(), criteria, set, sheet.getColumnsAsList());
}
use of org.teiid.translator.google.api.metadata.SpreadsheetInfo in project teiid by teiid.
the class SpreadsheetConnectionImpl4 method getV2SpreadsheetInfo.
public SpreadsheetInfo getV2SpreadsheetInfo() {
SpreadsheetInfo info = v2spreadsheetInfo.get();
if (info == null) {
synchronized (v2spreadsheetInfo) {
info = v2spreadsheetInfo.get();
if (info == null) {
org.teiid.resource.adapter.google.gdata.SpreadsheetMetadataExtractor metadataExtractor = new org.teiid.resource.adapter.google.gdata.SpreadsheetMetadataExtractor();
metadataExtractor.setVisualizationAPI(googleDataProtocolAPI);
metadataExtractor.setGdataAPI(gdata);
info = metadataExtractor.extractMetadata(config.getSpreadsheetId(), true);
v2spreadsheetInfo.set(info);
}
}
}
return info;
}
use of org.teiid.translator.google.api.metadata.SpreadsheetInfo in project teiid by teiid.
the class SpreadsheetConnectionImpl4 method getSpreadsheetInfo.
@Override
public SpreadsheetInfo getSpreadsheetInfo() {
SpreadsheetInfo info = spreadsheetInfo.get();
if (info == null) {
synchronized (spreadsheetInfo) {
info = spreadsheetInfo.get();
if (info == null) {
SpreadsheetMetadataExtractor metadataExtractor = new SpreadsheetMetadataExtractor(sheetsAPI, googleDataProtocolAPI);
info = metadataExtractor.extractMetadata(config.getSpreadsheetId());
spreadsheetInfo.set(info);
}
}
}
return info;
}
use of org.teiid.translator.google.api.metadata.SpreadsheetInfo in project teiid by teiid.
the class SpreadsheetUpdateExecution method executeUpdate.
private UpdateResult executeUpdate() throws TranslatorException {
SpreadsheetInfo info = connection.getSpreadsheetInfo();
SpreadsheetUpdateVisitor updateVisitor = new SpreadsheetUpdateVisitor(info);
updateVisitor.visit((Update) command);
checkHeaders(updateVisitor.getWorksheetTitle());
result = connection.updateRows(updateVisitor.getWorksheetTitle(), updateVisitor.getCriteriaQuery(), updateVisitor.getChanges());
return result;
}
Aggregations