|
Groovy Documentation | |||||||
| FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | PROPERTY | CONSTR | METHOD | DETAIL: FIELD | PROPERTY | CONSTR | METHOD | |||||||
java.lang.Objectorg.eriwen.rtm.GroovyRtm
class GroovyRtm
Provides a Java/Groovy API to access Remember The Milk using their REST API. More details available at http://www.rememberthemilk.com/services/api/
| Field Summary | |
|---|---|
java.lang.String |
currentUser
|
| Property Summary | |
|---|---|
java.lang.Object |
lastCallTimeMillis
|
| Constructor Summary | |
GroovyRtm(java.lang.String configFilePath)
|
|
GroovyRtm(java.lang.String key, java.lang.String sharedSecret, java.lang.String permissions = 'delete')
|
|
| Method Summary | |
|---|---|
boolean
|
authCheckToken(java.lang.String token)
Checks if the stored auth token is valid by calling the rtm.auth.checkToken REST method from the RTM API |
java.lang.String
|
authGetFrob()
Gets an RTM Frob for use with authentication |
java.lang.String
|
authGetToken()
Given a frob, gets a new Auth token from RTM. |
java.lang.String
|
contactsAdd(java.lang.String contact)
Adds a new contact |
java.lang.String
|
contactsDelete(java.lang.String contactId)
Deletes a contact |
java.util.List
|
contactsGetList()
Retrieves a List of contacts (id, fullname, and username) |
void
|
enforceMinDelay()
Forces successive calls to the RTM API to be spaced by at least the milliseconds specified in API_DELAY_THRESHOLD by putting the execution thread to sleep and synchronizing on the variable used to keep track |
groovy.util.slurpersupport.GPathResult
|
execMethod(java.util.List params)
Ensures application is authenticated before sending params to be executed |
groovy.util.slurpersupport.GPathResult
|
execTimelineMethod(java.util.List params)
Adds a timeline to the passed List of URL parameters, creating a timeline if one does not exist |
groovy.util.slurpersupport.GPathResult
|
execUnauthenticatedMethod(java.util.List params)
Ensures all criteria is met for making the call to the RTM REST API |
java.lang.String
|
getAuthToken(java.lang.String user = null)
|
java.lang.String
|
getAuthUrl()
Initiates RTM authorization by requesting a frob and getting the associated URL |
java.lang.String
|
getNewAuthToken()
|
java.lang.String
|
groupsAdd(java.lang.String groupName)
Adds a new group |
java.lang.String
|
groupsAddContact(java.lang.String contactId, java.lang.String groupId)
Adds a contact to the specified group |
java.lang.String
|
groupsDelete(java.lang.String groupId)
Deletes a group |
java.util.Map
|
groupsGetGroupByName(java.lang.String groupName)
Retrieves a Map representing the group with name groupName |
java.util.List
|
groupsGetList()
Retrieves a List of groups (id and name) |
java.lang.String
|
groupsRemoveContact(java.lang.String contactId, java.lang.String groupId)
Deletes a contact from the specified group |
boolean
|
isAuthenticated(java.lang.String user = null)
|
TaskList
|
listsAdd(java.lang.String listName, java.lang.String filter = null)
Adds a task list |
TaskList
|
listsArchive(java.lang.String listId)
Archives an existing task list |
TaskList
|
listsDelete(java.lang.String listId)
Deletes an existing task list |
java.util.List
|
listsGetList()
Retrieves a List of task lists |
TaskList
|
listsGetListByName(java.lang.String listName)
Retrieves a Map representing the list with name listName |
boolean
|
listsSetDefaultList(java.lang.String listId = null)
Sets the given list as default (new tasks go there unless specified otherwise), or Inbox if the list isn't provided |
TaskList
|
listsSetName(java.lang.String listId, java.lang.String newName)
Sets the name of a given list |
TaskList
|
listsUnarchive(java.lang.String listId)
Un-archives an existing, archived task list |
java.util.List
|
locationsGetList()
Retrieves a List of locations (id and name) |
java.util.Map
|
locationsGetLocationByName(java.lang.String locationName)
Retrieves a location specified by name |
void
|
removeAuthToken(java.lang.String user = null)
|
void
|
setAuthToken(java.lang.String token, java.lang.String user = null)
|
java.util.Map
|
settingsGetList()
Retrieves a Map of user settings (timezone, time format, language, etc.) |
Task
|
tasksAdd(java.lang.String name, java.lang.String listId = null, java.lang.Object parse = false)
Adds a task to a list, optionally parsing out a due date |
Task
|
tasksAdd(java.lang.String name, java.lang.String priority, java.lang.String due, java.lang.String estimate, java.lang.String repeat, java.lang.String tags, java.lang.String locationId, java.lang.String url, java.lang.String listId = null)
Adds a task with lots of options to a given or default list. |
Task
|
tasksAddTags(java.lang.String listId, java.lang.String taskseriesId, java.lang.String taskId, java.lang.String tags)
Adds tags to an existing task |
Task
|
tasksComplete(java.lang.String listId, java.lang.String taskseriesId, java.lang.String taskId)
Completes a task |
Task
|
tasksDelete(java.lang.String listId, java.lang.String taskSeriesId, java.lang.String taskId)
Deletes a specified task |
java.util.List
|
tasksGetList(java.lang.String listId = null, java.lang.String filter = null, java.lang.String lastSync = null)
Retrieves a List of tasks |
Task
|
tasksMovePriority(java.lang.String listId, java.lang.String taskseriesId, java.lang.String taskId, boolean increasePriority)
Adjusts the specified task's priority 1 step up or down |
Task
|
tasksMovePriority(java.lang.String listId, java.lang.String taskseriesId, java.lang.String taskId, java.lang.String direction)
Adjusts the specified task's priority 1 step up or down |
Task
|
tasksMoveTo(java.lang.String fromListId, java.lang.String taskseriesId, java.lang.String taskId, java.lang.String toListId)
Moves a given task to another list |
Note
|
tasksNotesAdd(java.lang.String listId, java.lang.String taskseriesId, java.lang.String taskId, java.lang.String noteTitle, java.lang.String noteText)
Adds a new note to a task |
boolean
|
tasksNotesDelete(java.lang.String noteId)
Adds a new note to a task |
Note
|
tasksNotesEdit(java.lang.String noteId, java.lang.String noteTitle, java.lang.String noteText)
Modifies a note |
Task
|
tasksPostpone(java.lang.String listId, java.lang.String taskseriesId, java.lang.String taskId)
Postpones a task 1 day |
Task
|
tasksRemoveTags(java.lang.String listId, java.lang.String taskseriesId, java.lang.String taskId, java.lang.String tags)
Removes tags from an existing task |
Task
|
tasksSetDueDate(java.lang.String listId, java.lang.String taskseriesId, java.lang.String taskId, java.lang.String due = null, boolean hasDueTime = false, boolean parse = false)
Sets the due date of a task |
Task
|
tasksSetEstimate(java.lang.String listId, java.lang.String taskseriesId, java.lang.String taskId, java.lang.String estimate = null)
Sets the estimate of a task |
Task
|
tasksSetLocation(java.lang.String listId, java.lang.String taskseriesId, java.lang.String taskId, java.lang.String locationId = null)
Sets the location of a task |
Task
|
tasksSetName(java.lang.String listId, java.lang.String taskseriesId, java.lang.String taskId, java.lang.String name)
Sets the name of a task |
Task
|
tasksSetPriority(java.lang.String listId, java.lang.String taskseriesId, java.lang.String taskId, java.lang.String priority = null)
Sets the priority of a task |
Task
|
tasksSetRecurrence(java.lang.String listId, java.lang.String taskseriesId, java.lang.String taskId, java.lang.String repeat = null)
Sets the recurrance of a task |
Task
|
tasksSetTags(java.lang.String listId, java.lang.String taskseriesId, java.lang.String taskId, java.lang.String tags = null)
Sets the tags of a task |
Task
|
tasksSetUrl(java.lang.String listId, java.lang.String taskseriesId, java.lang.String taskId, java.lang.String url = null)
Sets the URL of a task |
Task
|
tasksUncomplete(java.lang.String listId, java.lang.String taskseriesId, java.lang.String taskId)
Un-completes a completed task |
boolean
|
testEcho()
Checks the API key and tests connectivity to Remember The Milk |
boolean
|
testLogin()
Checks if the application is logged in |
java.lang.String
|
timeConvert(java.lang.String toTimezone, java.lang.String fromTimezone = null, java.util.Date time = null)
Returns the specified time in the desired timezone. |
java.lang.String
|
timeParse(java.lang.String text, java.lang.String timezoneId = null, boolean europeanFormat = false)
Returns the specified time in the desired timezone. |
java.lang.String
|
timelinesCreate()
Creates a timeline to allow operations to be undone |
java.util.List
|
timezonesGetList()
Retrieves a List of timezones (id, name, dst, offset, currentOffset) |
Timezone
|
timezonesGetTimezoneByName(java.lang.String timezoneName)
Retrieves a timezone specified by name |
boolean
|
transactionsUndo(java.lang.String transactionId)
Reverts the affects of an action. |
| Methods inherited from class java.lang.Object | |
|---|---|
| java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
| Field Detail |
|---|
public java.lang.String currentUser
| Property Detail |
|---|
java.lang.Object lastCallTimeMillis
| Constructor Detail |
|---|
GroovyRtm(java.lang.String configFilePath)
GroovyRtm(java.lang.String key, java.lang.String sharedSecret, java.lang.String permissions = 'delete')
| Method Detail |
|---|
boolean authCheckToken(java.lang.String token)
java.lang.String authGetFrob()
java.lang.String authGetToken()
null if an error occurred
java.lang.String contactsAdd(java.lang.String contact)
contact - should be a username or email address of a Remember The Milk user.null if an error occurred
java.lang.String contactsDelete(java.lang.String contactId)
contactId - the numeric ID of the contactnull if an error occurred
java.util.List contactsGetList()
null if an error occurred
void enforceMinDelay()
groovy.util.slurpersupport.GPathResult execMethod(java.util.List params)
params - List of URL query parametersGPathResult XML result from the RTM call
groovy.util.slurpersupport.GPathResult execTimelineMethod(java.util.List params)
params - List of URL query parametersGPathResult XML result from the RTM call
groovy.util.slurpersupport.GPathResult execUnauthenticatedMethod(java.util.List params)
params - List of URL query parametersGPathResult XML result from the RTM call
java.lang.String getAuthToken(java.lang.String user = null)
java.lang.String getAuthUrl()
getAuthUrl
java.lang.String getNewAuthToken()
java.lang.String groupsAdd(java.lang.String groupName)
groupName - a valid name for a group of contactsnull if an error occurred
java.lang.String groupsAddContact(java.lang.String contactId, java.lang.String groupId)
contactId - the numeric ID of an existing RTM contactgroupId - the numeric ID of an existing RTM groupnull if an error occurred
java.lang.String groupsDelete(java.lang.String groupId)
groupId - the numeric ID of the groupnull if an error occurred
java.util.Map groupsGetGroupByName(java.lang.String groupName)
String - group name to search fornull otherwise
java.util.List groupsGetList()
java.lang.String groupsRemoveContact(java.lang.String contactId, java.lang.String groupId)
contactId - the numeric ID of an existing RTM contactgroupId - the numeric ID of an existing RTM groupnull if an error occurred
boolean isAuthenticated(java.lang.String user = null)
TaskList listsAdd(java.lang.String listName, java.lang.String filter = null)
listName - a valid name for a task listfilter - a String with query words used to create a "Smart" listnull if an error occurred
TaskList listsArchive(java.lang.String listId)
listId - an existing list's IDnull if an error occurred
TaskList listsDelete(java.lang.String listId)
listId - an existing list's IDnull if an error occurred
java.util.List listsGetList()
null if an error occurred
TaskList listsGetListByName(java.lang.String listName)
null otherwise
boolean listsSetDefaultList(java.lang.String listId = null)
listId - the numeric ID of the task list to set as default. If null, will default to the user's Inbox
TaskList listsSetName(java.lang.String listId, java.lang.String newName)
listId - an existing list's IDnewName - the new name of the listnull if an error occurred
TaskList listsUnarchive(java.lang.String listId)
listId - an existing list's IDnull if an error occurred
java.util.List locationsGetList()
java.util.Map locationsGetLocationByName(java.lang.String locationName)
locationName - the name of an existing locationnull
if an error occurred
void removeAuthToken(java.lang.String user = null)
void setAuthToken(java.lang.String token, java.lang.String user = null)
java.util.Map settingsGetList()
Task tasksAdd(java.lang.String name, java.lang.String listId = null, java.lang.Object parse = false)
name - a valid name for a tasklistId - ID of the list to add the task to. Defaults to the user's default listparse - enables parsing the task name for a due date if true (default is false)null if an error occurred
Task tasksAdd(java.lang.String name, java.lang.String priority, java.lang.String due, java.lang.String estimate, java.lang.String repeat, java.lang.String tags, java.lang.String locationId, java.lang.String url, java.lang.String listId = null)
name - a valid name for a taskpriority - the priority of the task. Can be nulldue - a due date for the task. Can be nullestimate - the estimated effort. Can be nullrepeat - string representing how often this task should repeat. Can be nulltags - the tags associated with the task. Can be nulllocationId - the ID of the location to associate with the task. Can be nullurl - a URL to associate with the task. Can be nulllistId - ID of the list to add the task to. Defaults to the user's default listnull if an error occurred
Task tasksAddTags(java.lang.String listId, java.lang.String taskseriesId, java.lang.String taskId, java.lang.String tags)
listId - ID of the list containing the task to be modifiedtaskseriesId - ID of the taskseries containing the task to be modifiedtaskId - ID of the task to be modifiedtags - comma separated list of tags to addnull if an error occurred
Task tasksComplete(java.lang.String listId, java.lang.String taskseriesId, java.lang.String taskId)
listId - ID of the list containing the task to be modifiedtaskseriesId - ID of the taskseries containing the task to be modifiedtaskId - ID of the task to be modifiednull if an error occurred
Task tasksDelete(java.lang.String listId, java.lang.String taskSeriesId, java.lang.String taskId)
listId - ID of the list containing the task to be modifiedtaskseriesId - ID of the taskseries containing the task to be modifiedtaskId - ID of the task to be modifiednull if an error occurred
java.util.List tasksGetList(java.lang.String listId = null, java.lang.String filter = null, java.lang.String lastSync = null)
listId - (optional) if specified, the list from which to get tasks. Defaults to all listsfilter - (optional) if specified, a filter to be applied to tasks.lastSync - (optional) An ISO 8601 formatted time value. If last_sync is provided, only tasks modified since last_sync will be returned
Task tasksMovePriority(java.lang.String listId, java.lang.String taskseriesId, java.lang.String taskId, boolean increasePriority)
listId - ID of the list containing the task to be modifiedtaskseriesId - ID of the taskseries containing the task to be modifiedtaskId - ID of the task to be modifiedincreasePriority - will increase priority by 1 if true otherwise decreasenull if an error occurred
Task tasksMovePriority(java.lang.String listId, java.lang.String taskseriesId, java.lang.String taskId, java.lang.String direction)
listId - ID of the list containing the task to be modifiedtaskseriesId - ID of the taskseries containing the task to be modifiedtaskId - ID of the task to be modifieddirection - "up" or "down"null if an error occurred
Task tasksMoveTo(java.lang.String fromListId, java.lang.String taskseriesId, java.lang.String taskId, java.lang.String toListId)
fromListId - ID of the list containing the task to be modifiedtaskseriesId - ID of the taskseries containing the task to be modifiedtaskId - ID of the task to be modifiedtoListId - ID of the list to move the task tonull if an error occurred
Note tasksNotesAdd(java.lang.String listId, java.lang.String taskseriesId, java.lang.String taskId, java.lang.String noteTitle, java.lang.String noteText)
listId - ID of the list containing the task to be modifiedtaskseriesId - ID of the taskseries containing the task to be modifiedtaskId - ID of the task to be modifiednoteTitle - title of the notenoteText - body of the notenull if an error occurred
boolean tasksNotesDelete(java.lang.String noteId)
noteId - ID of the note
Note tasksNotesEdit(java.lang.String noteId, java.lang.String noteTitle, java.lang.String noteText)
noteId - ID of the note to be modifiednoteTitle - new title of the notenoteText - new body of the notenull if an error occurred
Task tasksPostpone(java.lang.String listId, java.lang.String taskseriesId, java.lang.String taskId)
listId - ID of the list containing the task to be modifiedtaskseriesId - ID of the taskseries containing the task to be modifiedtaskId - ID of the task to be modifiednull if an error occurred
Task tasksRemoveTags(java.lang.String listId, java.lang.String taskseriesId, java.lang.String taskId, java.lang.String tags)
listId - ID of the list containing the task to be modifiedtaskseriesId - ID of the taskseries containing the task to be modifiedtaskId - ID of the task to be modifiedtags - comma separated list of tags to removenull if an error occurred
Task tasksSetDueDate(java.lang.String listId, java.lang.String taskseriesId, java.lang.String taskId, java.lang.String due = null, boolean hasDueTime = false, boolean parse = false)
listId - ID of the list containing the task to be modifiedtaskseriesId - ID of the taskseries containing the task to be modifiedtaskId - ID of the task to be modifieddue - (optional) Due date for a task, in ISO 8601 format. If parse is specified and has a value of 1, due is parsed as per rtm.time.parse. due is parsed in the context of the user's Remember The Milk timezone.hasDueTime - (optional) true if this date has a time associated with it. Default is falseparse - (optional) Specifies whether to parse due with rtm.time.parse. Default is falsenull if an error occurred
Task tasksSetEstimate(java.lang.String listId, java.lang.String taskseriesId, java.lang.String taskId, java.lang.String estimate = null)
listId - ID of the list containing the task to be modifiedtaskseriesId - ID of the taskseries containing the task to be modifiedtaskId - ID of the task to be modifiedestimate - (optional) The time estimate for a task. Specified in units of days, hours or minutes. If left as null, any existing time estimate will be unset.null if an error occurred
Task tasksSetLocation(java.lang.String listId, java.lang.String taskseriesId, java.lang.String taskId, java.lang.String locationId = null)
listId - ID of the list containing the task to be modifiedtaskseriesId - ID of the taskseries containing the task to be modifiedtaskId - ID of the task to be modifiedlocationId - (optional) The id of a location. If left as null, any existing location will be unset.null if an error occurred
Task tasksSetName(java.lang.String listId, java.lang.String taskseriesId, java.lang.String taskId, java.lang.String name)
listId - ID of the list containing the task to be modifiedtaskseriesId - ID of the taskseries containing the task to be modifiedtaskId - ID of the task to be modifiedname - new name for the tasknull if an error occurred
Task tasksSetPriority(java.lang.String listId, java.lang.String taskseriesId, java.lang.String taskId, java.lang.String priority = null)
listId - ID of the list containing the task to be modifiedtaskseriesId - ID of the taskseries containing the task to be modifiedtaskId - ID of the task to be modifiedpriority - (optional) "1", "2", "3" or "N". If left as null, priority defaults to "N"null if an error occurred
Task tasksSetRecurrence(java.lang.String listId, java.lang.String taskseriesId, java.lang.String taskId, java.lang.String repeat = null)
listId - ID of the list containing the task to be modifiedtaskseriesId - ID of the taskseries containing the task to be modifiedtaskId - ID of the task to be modifiedrepeat - (optional) The recurrence pattern for a task. Valid values of repeat are detailed here. An empty value unsets any existing recurrence pattern.null if an error occurred
Task tasksSetTags(java.lang.String listId, java.lang.String taskseriesId, java.lang.String taskId, java.lang.String tags = null)
listId - ID of the list containing the task to be modifiedtaskseriesId - ID of the taskseries containing the task to be modifiedtaskId - ID of the task to be modifiedtags - (optional) A comma delimited list of tags. An empty value removes any existing tags.null if an error occurred
Task tasksSetUrl(java.lang.String listId, java.lang.String taskseriesId, java.lang.String taskId, java.lang.String url = null)
listId - ID of the list containing the task to be modifiedtaskseriesId - ID of the taskseries containing the task to be modifiedtaskId - ID of the task to be modifiedurl - (optional) The URL associated with a task. Valid protocols are http, https, ftp and file. If left empty, any existing URL will be unsetnull if an error occurred
Task tasksUncomplete(java.lang.String listId, java.lang.String taskseriesId, java.lang.String taskId)
listId - ID of the list containing the task to be modifiedtaskseriesId - ID of the taskseries containing the task to be modifiedtaskId - ID of the task to be modifiednull if an error occurred
boolean testEcho()
boolean testLogin()
java.lang.String timeConvert(java.lang.String toTimezone, java.lang.String fromTimezone = null, java.util.Date time = null)
toTimezone - Target timezone. A list of valid timezones can be retrieved with timezonesGetListfromTimezone - (optional) Originating timezone. Defaults to UTC if left nulltime - (optional) Time to convert in ISO 8601 format. Defaults to now
java.lang.String timeParse(java.lang.String text, java.lang.String timezoneId = null, boolean europeanFormat = false)
timezoneId - (optional) If specified, text is parsed in the context of timezone. A list of valid timezones can be retrieved with timezonesGetList. Defaults to UTCeuropeanFormat - (optional) true indicates an European date format (14/02/2006). false indicates an American date format (02/14/2006). This value is used in case a date is ambiguous. Default is false
java.lang.String timelinesCreate()
java.util.List timezonesGetList()
Timezone timezonesGetTimezoneByName(java.lang.String timezoneName)
timezoneName - the name of a timezonenull
if the timezone could not be found
boolean transactionsUndo(java.lang.String transactionId)
transactionId - the ID of a transaction within a timeline
Groovy Documentation