GroovyRTM Quick Start

  9 posts   Feedicon  
Replies: 8 - Last Post: July 21, 2011 06:40
by: Anonymous User
« Older Topic » Newer Topic
showing 1 - 9 of 9
 
Posted: July 13, 2009 16:55 by Eric Wendelin

I've created a quick-start project that can help get your running your own GroovyRTM app in no time. It includes optimal project structure and a setup RtmService.properties file (but you have to put your own RTM API key and shared secret in there).

It also has Java code that runs the application authorization gamut for you. I wrote it for an email question and thought it'd be valuable to you as well!

Download it here

 
Posted: August 31, 2009 07:52 by Anonymous User
Hi Eric,

I finally got the code to work Smile. I'm able to log into RTM and add tasks! So, if I understand this right, the authentication process is a one-off thing for RTM? Now that I'm authenticated (for the given pair of api-key/secret), would I be asked to authenticate again, later? I've tried to run the app multiple times and it doesn't seem to ask for authentication now.

Oh, and I think you need to modify the Authentication example a bit as currently the testLogin() method throws an exception. So, if that happens, your authentication code wouldn't execute!

In any case, thanks for all the help!

Cheers,
-Kodeninja
 
Posted: August 31, 2009 23:10 by Eric Wendelin

Great to hear!

Once authenticated, you don't need to re-authenticate until you revoke access through the "Third Party Services" page of your RTM account.

Thanks for the heads up on the testLogin() exception. I'll check it out and make any necessary updates.

If you see anything else feel free to contact me however you want :)

-Eric

 
Posted: September 20, 2009 21:20 by Anonymous User
Okay, so how do you "switch users"?

How does groovyRTM "store" what RTM user you are working with?
 
Posted: July 21, 2011 06:40 by Anonymous User
KUkdix <a href="http://cclyrtsrldex.com/">cclyrtsrldex</a>, bqccthumvrin, [link=http://envplqynypoo.com/]envplqynypoo[/link], http://typcgkhepyaa.com/
 
Posted: September 20, 2009 21:15 by Anonymous User
I've been playing with GroovyRTM and am really enjoying what I've seen so far. I would like to create some small utilities to augment the RTM features and for the time being this would be strictly for personal use.

So, I've been able to build the GroovyRtmAuth application and run it successfully, but I am very confused about the authorization piece. When I run the app (on Ubuntu) it pops up firefox and prompts me to "Allow access" in my RTM account. Once I do this no matter what I try when I rerun it, it just shows "Groovy RTM already authorized!". Great! But I don't understand how it's working. I've cleared my Firefox cache/private data, deleted the entire project directory and redownload/built it, and removed access to the application from my RTM account. Yet, it still shows "Groovy RTM already authorized!".

I also added "rtm.tasksAdd("Try GroovyRTM!");" below the line "//TODO: Put your application logic or button here so users can click a button when done", however this did not report an error and did not add a task. I assume the problem is that I am no longer giving access to the application in RTM, but since I can't get the firefox piece to re-run I don't know how to add it back.

Also, a couple of questions:
- wouldn't the expected users of this library write Groovy code? Why are the examples in standard Java?
- Is the Java API mentioned on the RTM site, somehow not compatible with groovy?
- I noticed I couldn't create a post in the general discussion, is that intentional?

Thanks for you hard work on this, I hope to understand better.
 
Posted: September 24, 2009 16:23 by Eric Wendelin

Some answers to your questions:

  • Groovy basically IS Java with a lot of syntactic sugar. You can use GroovyRTM and write your application in Java, Groovy, Scala, Jython, JavaFX... you see where I'm going ;)
  • Sure you could use the Java API (rtmjava) with Groovy but frankly that project is horribly incomplete (most RTM methods not implemented) and untested IMHO.
  • Anonymous posting should be enabled. Make sure you click on "General Discussion" on the project page. If it's not working let me know, I frankly have the kenai.com hookup ;)
 
Posted: September 20, 2009 23:54 by Anonymous User
Okay, I think I'm understanding a little better now after digging into the code a bit. (BTW, I'm totally unfamiliar with java/groovy). Apparently there is a prefs file that stores the userToken: ~/.java/.userPrefs/org/eriwen/rtm/prefs.xml, if you delete the org directory it will cause the app to relaunch firefox and get a new token.

However, what was causing my confusion was that the GroovyRtmAuth app was saying I was authenticated, it really meant that there was a stored token for my user. A more robust test app would need to call checkToken and handle the "Login failed / Invalid auth token" exception more gracefully.

So, if I write an app that I install on multiple computers (for the same user), I will have to use the RTM site to get my AuthToken on each computer. Or find a secondary channel for propagating the token between systems.


 
Posted: September 24, 2009 16:18 by Eric Wendelin

Yes, that is a problem I need to fix. Right now Groovy RTM does not have a good way to tell you that the stored authToken is invalid. Basically you have to do a checkToken() and if it throws an RTMException, call removeAuthToken() like you suggested.

GroovyRTM actually uses the Java Preferences mechanism to store auth tokens because it is the only mechanism I can think of that's guaranteed to be there in all Java environments.

Right now all other applications require you to authorize once on every machine, so I don't see that as a problem.

This is currently how you would manage multiple users, but I might consider splitting the authorization method calls so that you store an auth token yourself and tie it to a username or something. That would make user switching much easier. Can you see a case where someone might want to actually manage multiple RTM accounts with the same application?

Thanks a ton for your feedback. I will add the the Issue Tracker and if you email me at emwendelin@gmail.com I'll give you status updates.

showing 1 - 9 of 9
Replies: 8 - Last Post: July 21, 2011 06:40
by: Anonymous User
« Older Topic » Newer Topic
  • Mysql
  • Glassfish
  • Jruby
  • Rails
  • Nblogo
Terms of Use; Privacy Policy;
© 2010, Oracle Corporation and/or its affiliates
(revision 20120127.ac94057)
 
 
Close
loading
Please Confirm
Close