[appengine-java] Re: Writing to google spreadsheet from GAE

2011-09-19 Thread Brandon Donnelson
The Java gdata works great as an api accessing the spreadsheet. If you only 
want access to your own spreadsheet you can hardcode your authentication, 
otherwise oauth is what you want.

Here is one of my examples doing 
it. http://code.google.com/p/gwt-examples/wiki/DemoGwtGData
Another great example by Ikai 
- 
http://ikaisays.com/2011/05/26/setting-up-an-oauth-provider-on-google-app-engine/

Once you have your oauth token, you an access the spreadsheet api easily on 
the server side.

public void test() {

String scope = "https://spreadsheets.google.com/feeds/";;
AppTokenJdo appToken = AppTokenStore.getToken(scope);

String consumerKey = sp.getOAuthConsumerKey();
String consumerSecret = sp.getOAuthConsumerSecret();

String token = appToken.getAccessTokenKey();
String tokenSecret = appToken.getAccessTokenSecret();

GoogleOAuthParameters oauthParameters = new GoogleOAuthParameters();
oauthParameters.setOAuthConsumerKey(consumerKey);
oauthParameters.setOAuthConsumerSecret(consumerSecret);
oauthParameters.setOAuthToken(token);
oauthParameters.setOAuthTokenSecret(tokenSecret);

//log.info("Token " + token + " TokenSecret: " + tokenSecret + " 
ConsumerKey: " + consumerKey + " ConsumerSecret: " + consumerSecret);

SpreadsheetService service = new 
SpreadsheetService("Gone_Vertical_LLC-CoreSystem_v1");
try {
  service.setOAuthCredentials(oauthParameters, new OAuthHmacSha1Signer());
} catch (OAuthException e) {
  e.printStackTrace();
}

URL url = null;
try {
  url = new 
URL("https://spreadsheets.google.com/feeds/spreadsheets/private/full";);
} catch (MalformedURLException e1) {
  e1.printStackTrace();
}
SpreadsheetFeed feed = null;
try {
  feed = service.getFeed(url, SpreadsheetFeed.class);
} catch (IOException e) {
  e.printStackTrace();
} catch (ServiceException e) {
  e.printStackTrace();
}
List spreadsheets = feed.getEntries();
for (int i = 0; i < spreadsheets.size(); i++) {
  SpreadsheetEntry entry = spreadsheets.get(i);
  //System.out.println("\t" + entry.getTitle().getPlainText());
}

  }


Brandon Donnelson
http://gwt-examples.googlecode.com

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine-java/-/8MIfMW6nxEcJ.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: Writing to google spreadsheet from GAE

2011-09-19 Thread niraj
Daniel ,

Would you mind posting the sample code. OR the link to the samples
that helped you code the application

On Sep 19, 7:24 am, Daniel Florey  wrote:
> I've been able to access spreadsheets from GAE without problems.
> The only problem is the limited upload size for URLFetch that makes it
> impossible to upload large pre-populated sheets.
> Other than that it worked without problmes...

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: Writing to google spreadsheet from GAE

2011-09-19 Thread Daniel Florey
I've been able to access spreadsheets from GAE without problems.
The only problem is the limited upload size for URLFetch that makes it 
impossible to upload large pre-populated sheets.
Other than that it worked without problmes...

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine-java/-/cI_21ja-m10J.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: Writing to google spreadsheet from GAE

2011-09-17 Thread niraj
I tried and gave up because:
1. Google spreadsheets requires Oauth2.0
2. Google AppEngine does not support Oauth2.0

It is possible to write to spreadhseets via GWT - client side - not
via appengine

On Sep 17, 2:40 pm, Gerald Tan  wrote:
> It should 
> be:http://code.google.com/apis/spreadsheets/data/3.0/developers_guide.html

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: Writing to google spreadsheet from GAE

2011-09-17 Thread Gerald Tan
It should be: 
http://code.google.com/apis/spreadsheets/data/3.0/developers_guide.html

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine-java/-/W9ZjHjouJHAJ.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.