Examples of SpreadsheetService


Examples of com.google.gdata.client.spreadsheet.SpreadsheetService

  }
 
  private static void testLogin(String userName, String password)
    throws AuthenticationException
  {
    SpreadsheetService service = new SpreadsheetService(DocsPlugin.APPLICATION_NAME);
   
    service.setUserCredentials(userName, password);
  }
View Full Code Here

Examples of com.google.gdata.client.spreadsheet.SpreadsheetService

  public static void initializeService()
    throws AuthenticationException
  {
    try
    {
      spreadsheetService = new SpreadsheetService(APPLICATION_NAME);
      docsService = new DocsService(APPLICATION_NAME);
     
      DocsCredentials credentials = DocsPlugin.getUserCredentials();
     
      if (credentials == null)
View Full Code Here

Examples of com.google.gdata.client.spreadsheet.SpreadsheetService

       
  public void login(Creditionals creditionals) throws AuthenticationException {
            if (!creditionals.equals(this.creditionals) || !isLogedIn) {
                Configuration.log("Try to create DocsService");
    service = new DocsService(APP_NAME);
                spreadsheetService = new SpreadsheetService(APP_NAME);
                Configuration.log("DocsService created");
                try {
                    Configuration.log("Try to login");
                    service.setUserCredentials(creditionals.getUserName(),creditionals.getPassword());
                    spreadsheetService.setUserCredentials(creditionals.getUserName(),creditionals.getPassword());
View Full Code Here

Examples of com.google.gdata.client.spreadsheet.SpreadsheetService

*
*/
public class GDocParser {
    public static String onSupport2() throws AuthenticationException, MalformedURLException, IOException,
        ServiceException, URISyntaxException {
        SpreadsheetService service = new SpreadsheetService("MySpreadsheetIntegration-foo");
        URL url = new URL("https://spreadsheets.google.com/feeds/spreadsheets/private/full?title=GSS-Dev-Schedule");
        SpreadsheetFeed feed = service.getFeed(url, SpreadsheetFeed.class);
        List<SpreadsheetEntry> spreadsheets = feed.getEntries();
        SpreadsheetEntry spreadsheet = spreadsheets.get(0);
        WorksheetFeed worksheetFeed = service.getFeed(spreadsheet.getWorksheetFeedUrl(), WorksheetFeed.class);
        List<WorksheetEntry> worksheets = worksheetFeed.getEntries();
        WorksheetEntry worksheet = worksheets.get(0);
        // fetch A1 only
        URL cellFeedUrl = new URI(worksheet.getCellFeedUrl().toString() + "?min-row=1&max-row=1&min-col=1&max-col=1")
            .toURL();
        CellFeed cellFeed = service.getFeed(cellFeedUrl, CellFeed.class);
        // Iterate through each cell, printing its value.
        String onSupport = cellFeed.getEntries().get(0).getCell().getValue();
        return onSupport;
    }
View Full Code Here

Examples of com.google.gdata.client.spreadsheet.SpreadsheetService

      String message = "Document URL is empty";
      log.debug(message);
      return message;
    }
    String key;
    SpreadsheetService service = new SpreadsheetService("GSpread Connection Service");
    try {
      key = GSpreadConfig.extractKey(documentURL);
    } catch (DataServiceFault e) {
      String message = "Invalid documentURL:" + documentURL;
      log.warn(message);
      return message;
    }
    if (protectedTokens == null) {
      protectedTokens = "";
    }
    if (passwordProvider == null) {
      passwordProvider = "";
    }
    if (!(DBUtils.isEmptyString(protectedTokens) && DBUtils.isEmptyString(passwordProvider))) {
      OMFactory fac = OMAbstractFactory.getOMFactory();
      OMElement dataEl = fac.createOMElement("data", null);
      OMElement passwordManagerEl = fac.createOMElement("passwordManager", null);
        OMElement protectedTokensEl = fac.createOMElement("protectedTokens", null);
        protectedTokensEl.setText(protectedTokens);
        OMElement passwordProviderEl = fac.createOMElement("passwordProvider", null);
        passwordProviderEl.setText(passwordProvider);
        passwordManagerEl.addChild(protectedTokensEl);
        passwordManagerEl.addChild(passwordProviderEl);   
            dataEl.addChild(passwordManagerEl);
            SecretResolver secretResolver = SecretResolverFactory.create(dataEl, false);
            if (secretResolver.isInitialized() && secretResolver.isTokenProtected(password)) {
                resolvePwd = secretResolver.resolve(password);
            } else {
                resolvePwd = password;
            }
    } else {
      resolvePwd = password;
    }
    if (!visibility.equals("public")) {
      if (DBUtils.isEmptyString(user)) {
        String message = "User name field is empty";
        log.error(message);
        return message;
      }
      if (DBUtils.isEmptyString(resolvePwd)) {
        String message = "Password field is empty";
        log.error(message);
        return message;
      }
      try {
        service.setUserCredentials(user, resolvePwd);
      } catch (AuthenticationException e) {
        String message = "Invalid User Credentials";
        log.error(message,e);
        return message;
      }
    }
    String worksheetFeedURL = GSpreadConfig.BASE_WORKSHEET_URL + key + "/" + visibility
        + "/basic";
      try {
      URL url = new URL(worksheetFeedURL);
      try {
        service.getFeed(url,  CellFeed.class);
        String message = "Google spreadsheet connection is successfull ";
        log.debug(message);
    return message;
      } catch (IOException e) {
        String message = "URL Not found:" + documentURL;
View Full Code Here

Examples of com.google.gdata.client.spreadsheet.SpreadsheetService

    this.username = this.getProperty(DBConstants.GSpread.USERNAME);
    this.password = DBUtils.resolvePasswordValue(this.getDataService(), this.getProperty(DBConstants.GSpread.PASSWORD));
    this.visibility = this.getProperty(DBConstants.GSpread.VISIBILITY);
    this.key = extractKey(this.getProperty(GSpread.DATASOURCE));   
    if (!dataService.isServiceInactive()) {
        this.service = new SpreadsheetService(this.getDataService().getName() +
            ":" + this.getConfigId());
    }
    /* register registry service listener */
    DataServicesDSComponent.registerRegistryServiceListener(this);
  }
 
View Full Code Here

Examples of com.google.gdata.client.spreadsheet.SpreadsheetService

  private PicasawebService photoService;

  public GDataDocumentsProxy() {
    this.documentsService = new DocsService("Avicena-v1");
    this.photoService = new PicasawebService("Avicena-v1");
    this.spreadsheetService = new SpreadsheetService("Avicena-v1");
  }
View Full Code Here

Examples of com.google.gdata.client.spreadsheet.SpreadsheetService

    }
   
    private List<WorksheetEntry> getWorksheetEntriesForDoc(URL docUrl, String token) throws IOException, ServiceException {
        if (token != null) {
            try {
                SpreadsheetService spreadsheetService = GDataExtension.getSpreadsheetService(token);
                SpreadsheetEntry spreadsheetEntry = spreadsheetService.getEntry(docUrl, SpreadsheetEntry.class);
                return spreadsheetEntry.getWorksheets();
            } catch (ServiceException e) {
                // Ignore and fall through, pretending that we're not logged in.
            }
        }
View Full Code Here

Examples of com.google.gdata.client.spreadsheet.SpreadsheetService

        }
        return getWorksheetEntriesForDoc(docUrl);
    }
   
    private List<WorksheetEntry> getWorksheetEntriesForDoc(URL docUrl) throws IOException, ServiceException {
        SpreadsheetService spreadsheetService = GDataExtension.getSpreadsheetService(null);
        String visibility = "public";
        FeedURLFactory factory = FeedURLFactory.getDefault();
        String key = GDataExtension.getSpreadsheetID(docUrl);
        docUrl = factory.getWorksheetFeedUrl(key, visibility, "values");
        WorksheetFeed feed = spreadsheetService.getFeed(docUrl, WorksheetFeed.class);
        return feed.getEntries();
    }
View Full Code Here

Examples of com.google.gdata.client.spreadsheet.SpreadsheetService

        JSONObject options,
        List<Exception> exceptions) {
   
        String docType = JSONUtilities.getString(options, "docType", null);
        if ("spreadsheet".equals(docType)) {
            SpreadsheetService service = GDataExtension.getSpreadsheetService(token);
            parse(
                service,
                project,
                metadata,
                job,
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.