Examples of GoogleData


Examples of sample.data.GoogleData

    /*
    GoogleDataManager googleDataManager = GoogleDataManagerFactory.getOauthManager(
        APPLICATION_NAME,
        request.getParameter("ids"));
    */
    GoogleData googleData = googleDataManager.getGoogleData();

    // First, users must login to use the application.
    nextUrl = LOGIN_VIEW_URL;
    if (googleData.isLoggedIn()) {

      // Second, users must authorize this application to access their Google Analytics account.
      nextUrl = AUTHORIZATION_VIEW_URL;
      if (googleData.isTokenValid()) {

        // Third, users can see results.
        nextUrl = RESULTS_VIEW_URL;
      }
    }
View Full Code Here

Examples of sample.data.GoogleData

        // The user is starting the AuthSub authorization process.
        nextUrl = authManager.getAuthorizationRedirectUrl(request.getRequestURL());
      }
    }

    GoogleData googleData = authManager.getGoogleData();

    if (googleData.getAuthorizationErrorMessage() != null) {
      // Forward users to the authorization page.
      request.setAttribute("googleData", googleData);
      ServletContext sc = getServletContext();
      RequestDispatcher dispatcher = sc.getRequestDispatcher(MainServlet.AUTHORIZATION_VIEW_URL);
      dispatcher.forward(request, response);
View Full Code Here

Examples of sample.data.GoogleData

   * any errors that occurred.
   * @param tokenValid if the authorization token was valid.
   * @return the authentication and authorization data.
   */
  public GoogleData getGoogleData() {
    GoogleData googleData = new GoogleData();

    // Set the authentication data.
    googleData.setIsLoggedIn(userService.isUserLoggedIn());
    String authenticationUrl = userService.isUserLoggedIn()
        ? userService.createLogoutURL(HOME_URL)
        : userService.createLoginURL(HOME_URL);
    googleData.setAuthenticationUrl(authenticationUrl);

    // Set the authorization data.
    googleData.setAuthorizationUrl(AuthorizationServlet.AUTHORIZATION_HANDLER);
    googleData.setAuthorizationErrorMessage(authService.getAuthServiceError());

    return googleData;
  }
View Full Code Here

Examples of sample.data.GoogleData

   * @param userToken holds the authorized session token.
   */
  public GoogleData getGoogleData() {

    // Put the data from the API requests into a Google Data object.
    GoogleData googleData = new GoogleData();

    // Get authentication data.
    String authenticationUrl = userService.isUserLoggedIn()
        ? userService.createLogoutURL(MainServlet.MAIN_URL)
        : userService.createLoginURL(MainServlet.MAIN_URL);
    googleData.setAuthenticationUrl(authenticationUrl);
    googleData.setIsLoggedIn(userService.isUserLoggedIn());

    // Get Google Analytics account data.
    googleData.setAccountList(analyticsWrapper.getAccountList());
    googleData.setAccountListError(analyticsWrapper.getAccountListError());

    // Get Google Analytics profile data.
    googleData.setTableId(analyticsWrapper.getTableId());
    googleData.setDataList(analyticsWrapper.getDataList());
    googleData.setDataListError(analyticsWrapper.getDataListError());

    // Get authorization data.
    googleData.setTokenValid(analyticsWrapper.isTokenValid());
    String authorizationUrl = analyticsWrapper.isTokenValid()
        ? AuthorizationServlet.REVOKE_TOKEN_HANDLER
        : AuthorizationServlet.AUTHORIZATION_HANDLER;
    googleData.setAuthorizationUrl(authorizationUrl);

    return googleData;
  }
View Full Code Here

Examples of spanishgringo.data.GoogleData

    /*
    GoogleDataManager googleDataManager = GoogleDataManagerFactory.getOauthManager(
        APPLICATION_NAME,
        request.getParameter("ids"));
    */
    GoogleData googleData = googleDataManager.getGoogleData();

    // First, users must login to use the application.
    nextUrl = LOGIN_VIEW_URL;
    if (googleData.isLoggedIn()) {

      // Second, users must authorize this application to access their Google Analytics account.
      nextUrl = AUTHORIZATION_VIEW_URL;
      if (googleData.isTokenValid()) {
        if(request.getParameter("ajax") != null && request.getParameter("ajax").equals("true")) {
          // Third, users can see results. Ajax Response
          nextUrl = RESULTS_VIEW_URL_AJAX;
        }else {
        // Third, users can see results. Full Page Response
View Full Code Here

Examples of spanishgringo.data.GoogleData

        // The user is starting the AuthSub authorization process.
        nextUrl = authManager.getAuthorizationRedirectUrl(request.getRequestURL());
      }
    }

    GoogleData googleData = authManager.getGoogleData();

    if (googleData.getAuthorizationErrorMessage() != null) {
      // Forward users to the authorization page.
      request.setAttribute("googleData", googleData);
      ServletContext sc = getServletContext();
      RequestDispatcher dispatcher = sc.getRequestDispatcher(MainServlet.AUTHORIZATION_VIEW_URL);
      dispatcher.forward(request, response);
View Full Code Here

Examples of spanishgringo.data.GoogleData

   * any errors that occurred.
   * @param tokenValid if the authorization token was valid.
   * @return the authentication and authorization data.
   */
  public GoogleData getGoogleData() {
    GoogleData googleData = new GoogleData();

    // Set the authentication data.
    googleData.setIsLoggedIn(userService.isUserLoggedIn());
    String authenticationUrl = userService.isUserLoggedIn()
        ? userService.createLogoutURL(HOME_URL)
        : userService.createLoginURL(HOME_URL);
    googleData.setAuthenticationUrl(authenticationUrl);

    // Set the authorization data.
    googleData.setAuthorizationUrl(AuthorizationServlet.AUTHORIZATION_HANDLER);
    googleData.setAuthorizationErrorMessage(authService.getAuthServiceError());

    return googleData;
  }
View Full Code Here

Examples of spanishgringo.data.GoogleData

   * @param userToken holds the authorized session token.
   */
  public GoogleData getGoogleData() {

    // Put the data from the API requests into a Google Data object.
    GoogleData googleData = new GoogleData();

    // Get authentication data.
    String authenticationUrl = userService.isUserLoggedIn()
        ? userService.createLogoutURL(MainServlet.MAIN_URL)
        : userService.createLoginURL(MainServlet.MAIN_URL);
    googleData.setAuthenticationUrl(authenticationUrl);
    googleData.setIsLoggedIn(userService.isUserLoggedIn());

    // Get Google Analytics account data.
    googleData.setAccountList(analyticsWrapper.getAccountList(true));
    googleData.setAccountListError(analyticsWrapper.getAccountListError());
    googleData.setSegmentList(analyticsWrapper.getSegmentList());

    // Get Google Analytics profile data.
    googleData.setTableId(analyticsWrapper.getTableId());
    googleData.setProfileName(analyticsWrapper.getProfileName());
    googleData.setDataList(analyticsWrapper.getDataList());
    googleData.setDataListError(analyticsWrapper.getDataListError());
    googleData.setProfileName(analyticsWrapper.getProfileName());
    googleData.setEndDate(analyticsWrapper.getEndDate());
    googleData.setStartDate(analyticsWrapper.getStartDate());
    googleData.setSegment(analyticsWrapper.getSegment());
    googleData.setSegmentName(analyticsWrapper.getSegmentName());
    googleData.setQueryURL(analyticsWrapper.getQueryURL());

    // Get authorization data.
    googleData.setTokenValid(analyticsWrapper.isTokenValid());
    String authorizationUrl = analyticsWrapper.isTokenValid()
        ? AuthorizationServlet.REVOKE_TOKEN_HANDLER
        : AuthorizationServlet.AUTHORIZATION_HANDLER;
    googleData.setAuthorizationUrl(authorizationUrl);

    return googleData;
  }
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.