Search in sources :

Example 6 with Worksheet

use of org.teiid.translator.google.api.metadata.Worksheet in project teiid by teiid.

the class AbstractSpreadsheetExecution method checkHeaders.

void checkHeaders(String worksheetTitle) throws TranslatorException {
    SpreadsheetInfo info = connection.getSpreadsheetInfo();
    Worksheet worksheet = info.getWorksheetByName(worksheetTitle);
    if (worksheet == null) {
        // $NON-NLS-1$
        throw new SpreadsheetOperationException(SpreadsheetExecutionFactory.UTIL.gs("missing_worksheet", worksheetTitle));
    }
    if (!worksheet.isHeaderEnabled()) {
        // $NON-NLS-1$
        throw new TranslatorException(SpreadsheetExecutionFactory.UTIL.gs("headers_required"));
    }
}
Also used : SpreadsheetInfo(org.teiid.translator.google.api.metadata.SpreadsheetInfo) SpreadsheetOperationException(org.teiid.translator.google.api.SpreadsheetOperationException) Worksheet(org.teiid.translator.google.api.metadata.Worksheet) TranslatorException(org.teiid.translator.TranslatorException)

Aggregations

Worksheet (org.teiid.translator.google.api.metadata.Worksheet)6 SpreadsheetInfo (org.teiid.translator.google.api.metadata.SpreadsheetInfo)5 SpreadsheetOperationException (org.teiid.translator.google.api.SpreadsheetOperationException)4 Column (org.teiid.translator.google.api.metadata.Column)4 IOException (java.io.IOException)2 Sheet (com.google.api.services.sheets.v4.model.Sheet)1 Spreadsheet (com.google.api.services.sheets.v4.model.Spreadsheet)1 SpreadsheetEntry (com.google.gdata.data.spreadsheet.SpreadsheetEntry)1 WorksheetEntry (com.google.gdata.data.spreadsheet.WorksheetEntry)1 ServiceException (com.google.gdata.util.ServiceException)1 Properties (java.util.Properties)1 BeforeClass (org.junit.BeforeClass)1 Test (org.junit.Test)1 MetadataFactory (org.teiid.metadata.MetadataFactory)1 Table (org.teiid.metadata.Table)1 TranslatorException (org.teiid.translator.TranslatorException)1 GoogleSpreadsheetConnection (org.teiid.translator.google.api.GoogleSpreadsheetConnection)1