Google calendar events

Hi All, First of all if you managed to import google calendar events I would love to know about your way-of-work. I want to retrieve all events from a certain google Calendar account. I went through all formal steps (like generating client id etc) and will need to use the Oauth 2.0 mechanism. Part of this mechanism is a redirect and in order to have everything work out well I thought about copying the Java code from google into a separate action. While deploying for eclipse I retrieve an error and I suggest this is because of the imported object libraries. I'm a Java Noob; am I right this type of code is never going to work within a mendix Java action ? import; import; import; import; import; import; import; import; import; import; import; import; ... public void setUp() throws IOException { HttpTransport httpTransport = new NetHttpTransport(); JacksonFactory jsonFactory = new JacksonFactory(); // The clientId and clientSecret are copied from the API Access tab on // the Google APIs Console String clientId = "YOUR_CLIENT_ID"; String clientSecret = "YOUR_CLIENT_SECRET"; // Or your redirect URL for web based applications. String redirectUrl = "urn:ietf:wg:oauth:2.0:oob"; String scope = ""; // Step 1: Authorize --> String authorizationUrl = new GoogleAuthorizationRequestUrl(clientId, redirectUrl, scope) .build(); // Point or redirect your user to the authorizationUrl. System.out.println("Go to the following link in your browser:"); System.out.println(authorizationUrl); // Read the authorization code from the standard input stream. BufferedReader in = new BufferedReader(new InputStreamReader(; System.out.println("What is the authorization code?"); String code = in.readLine(); // End of Step 1 <-- // Step 2: Exchange --> AccessTokenResponse response = new GoogleAuthorizationCodeGrant(httpTransport, jsonFactory, clientId, clientSecret, code, redirectUrl).execute(); // End of Step 2 <-- GoogleAccessProtectedResource accessProtectedResource = new GoogleAccessProtectedResource( response.accessToken, httpTransport, jsonFactory, clientId, clientSecret, response.refreshToken); Calendar service = Calendar.builder(httpTransport, jsonFactory) .setApplicationName("YOUR_APPLICATION_NAME") .setHttpRequestInitializer(accessProtectedResource) .build(); ... }
1 answers

This looks like console app. Replace the


with values from an entity.