Groovy Documentation

org.eriwen.rtm
[Groovy] Class RtmCollectionParser

java.lang.Object
  org.eriwen.rtm.RtmCollectionParser

class RtmCollectionParser

Utility class used to house RTM XML parsing methods

Authors:
@author Eric Wendelin


Method Summary
TaskList parseList(groovy.util.slurpersupport.GPathResult listXml)

Creates a java.util.LinkedHashMap from XML representing an RTM List.

java.util.List parseLists(groovy.util.slurpersupport.GPathResult listsXml)

Creates a java.util.LinkedHashMap from XML representing an RTM List.

Note parseNote(groovy.util.slurpersupport.GPathResult noteXml)

Creates a java.util.LinkedHashMap from XML representing an RTM Note.

java.util.LinkedHashMap parseSettings(groovy.util.slurpersupport.GPathResult settingsXml)

Creates a java.util.LinkedHashMap from XML representing RTM settings.

Task parseTask(groovy.util.slurpersupport.GPathResult taskXml)

Creates a java.util.LinkedHashMap from XML representing an RTM Task.

java.util.List parseTaskList(groovy.util.slurpersupport.GPathResult response)

Creates a java.util.List of LinkedHashMaps representing RTM tasks from the XML returned by the RTM API.

java.util.List parseTimezones(groovy.util.slurpersupport.GPathResult timezonesXml)

Creates a java.util.LinkedHashMap from XML representing RTM Timezones.

 
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()
 

Method Detail

parseList

TaskList parseList(groovy.util.slurpersupport.GPathResult listXml)
Creates a java.util.LinkedHashMap from XML representing an RTM List. For instance, the XML:
   <rsp stat="ok">
       <transaction id="234"/>
       <list id="123" name="New List" deleted="0" locked="0" archived="0" position="-1" smart="0"/>
   </rsp>
   
   
Will become: ['transaction_id':'234', 'id':'123', 'name':'New List', 'deleted':'0', 'locked':'0', 'archived':'0', 'position':'-1', 'smart':'0']


parseLists

java.util.List parseLists(groovy.util.slurpersupport.GPathResult listsXml)
Creates a java.util.LinkedHashMap from XML representing an RTM List. For instance, the XML:
   <rsp stat="ok">
       <lists>
       <list id="123" name="New List" deleted="0" locked="0" archived="0" position="-1" smart="0"/>
       <list id="124" name="Other List" deleted="0" locked="0" archived="0" position="0" smart="1"/>
       </lists>
   </rsp>
   
   
Will become: [ ['id':'123', 'name':'New List', 'deleted':'0', 'locked':'0', 'archived':'0', 'position':'-1', 'smart':'0'] ['id':'124', 'name':'Other List', 'deleted':'0', 'locked':'0', 'archived':'0', 'position':'0', 'smart':'1'] ]


parseNote

Note parseNote(groovy.util.slurpersupport.GPathResult noteXml)
Creates a java.util.LinkedHashMap from XML representing an RTM Note. For instance, the XML:
   <rsp stat="ok">
       <transaction id="234"/>
       <note id="169624" created="2009-05-07T11:26:49Z" modified="2009-05-07T11:26:49Z" title="Note Title">Note Body</note>
   </rsp>
   
   
Will become: ['transaction_id':'234', 'id':'169624', 'title':'Note Title', 'text':'Note Body']


parseSettings

java.util.LinkedHashMap parseSettings(groovy.util.slurpersupport.GPathResult settingsXml)
Creates a java.util.LinkedHashMap from XML representing RTM settings. For instance, the XML:
   <rsp stat="ok">
       <settings>
           <timezone>Australia/Sydney</timezone>
           <dateformat>0</dateformat>
           <timeformat>0</timeformat>
           <defaultlist>123456</defaultlist>
       </settings>
   </rsp>
   
   
Will become: ['timezone':'Australia/Sydney', 'dateformat':'0', 'timeformat': '0', 'defaultlist':'123456']


parseTask

Task parseTask(groovy.util.slurpersupport.GPathResult taskXml)
Creates a java.util.LinkedHashMap from XML representing an RTM Task. For instance, the XML:
   <rsp stat="ok">
       <transaction id="123"/>
       <list id="100">
         <taskseries id="101" created="2009-05-07T10:19:54Z" modified="2009-05-07T10:19:54Z"
                    name="Get Bananas" source="api" location_id="234" url="http://eriwen.com">
           <rrule every="1">FREQ=DAILY;INTERVAL=1</rrule>
           <tags><tag>yay</tag><tag>bananas</tag></tags>
           <participants/>
           <notes/>
           <task id="102" due="2009-05-07T10:19:54Z" has_due_time="1" added="2009-05-07T10:19:54Z"
                completed="" deleted="" priority="2" postponed="0" estimate="4 hours"/>
         </taskseries>
       </list>
   </rsp>
   
   
Will become: ['transaction_id':'123', 'name':'Get Bananas', 'list_id':'100', 'taskseries_id':'101', 'task_id':'102', 'priority': '2', 'due':'2009-05-07T10:19:54Z', 'has_due_time':'1', 'completed':'', 'deleted':'', 'estimate':'4 hours', 'repeat':'FREQ=DAILY;INTERVAL=1', 'url':'http://eriwen.com', 'location':'234', 'tags':'yay, bananas', 'notes':'', 'participants':'']


parseTaskList

java.util.List parseTaskList(groovy.util.slurpersupport.GPathResult response)
Creates a java.util.List of LinkedHashMaps representing RTM tasks from the XML returned by the RTM API. For example:
   <rsp stat="ok">
     <tasks>
       <list id="100">
         <taskseries id="101" created="2009-05-07T10:19:54Z" modified="2009-05-07T10:19:54Z"
                    name="Get Bananas" source="api">
           <tags/>
           <participants/>
           <notes/>
           <task id="102" due="" has_due_time="0" added="2009-05-07T10:19:54Z"
                completed="" deleted="" priority="N" postponed="0" estimate=""/>
         </taskseries>
         <taskseries id="103" created="2009-05-07T10:19:54Z" modified="2009-05-07T10:19:54Z"
                    name="Buy Coffee" source="api">
           <tags>
               <tag>mmm</tag>
               <tag>tasty</tag>
           </tags>
           <participants/>
           <notes/>
           <task id="104" due="" has_due_time="0" added="2009-05-07T10:19:54Z"
                completed="" deleted="" priority="2" postponed="1" estimate="3 hrs"/>
         </taskseries>
       </list>
       <list id="105">
         <taskseries id="106" created="2009-05-07T10:19:54Z" modified="2009-05-07T10:19:54Z"
                    name="Do Some Work" source="api">
           <tags/>
           <participants/>
           <notes/>
           <task id="107" due="" has_due_time="0" added="2009-05-07T10:19:54Z"
                completed="" deleted="" priority="3" postponed="0" estimate="4 hrs"/>
         </taskseries>
       </list>
     </tasks>
   </rsp>
   
   
Will become: [ ['name':'Get Bananas', 'list_id':'100', 'taskseries_id':'101', 'task_id':'102', 'priority': 'N', 'due':'', 'has_due_time':'0', 'completed':'', 'deleted':'', 'estimate':'', 'repeat':'', 'url':'', 'location':'', 'tags':'', 'notes':'', 'participants':''], ['name':'Buy Coffee', 'list_id':'100', 'taskseries_id':'103', 'task_id':'104', 'priority': '2', 'due':'', 'has_due_time':'0', 'completed':'', 'deleted':'', 'estimate':'3 hrs', 'repeat':'', 'url':'', 'location':'', 'tags':'mmm, good', 'notes':'', 'participants':''], ['name':'Do Some Work', 'list_id':'105', 'taskseries_id':'106', 'task_id':'107', 'priority': '3', 'due':'', 'has_due_time':'0', 'completed':'', 'deleted':'', 'estimate':'4 hrs', 'repeat':'', 'url':'', 'location':'', 'tags':'', 'notes':'', 'participants':''] ]


parseTimezones

java.util.List parseTimezones(groovy.util.slurpersupport.GPathResult timezonesXml)
Creates a java.util.LinkedHashMap from XML representing RTM Timezones. For instance, the XML:
   <rsp stat="ok">
       <timezones>
         <timezone id="216" name="Asia/Hong_Kong" dst="0" offset="28800" current_offset="25200" />
         <timezone id="217" name="Asia/Hovd" dst="1" offset="28800" current_offset="25200" />
       </timezones>
   </rsp>
   
   
Will become: [ ['id':'216', 'name':'Asia/Hong_Kong', 'dst':'0', 'offset','28800', 'currentOffset';'25200'], ['id':'217', 'name':'Asia/Hovd', 'dst':'1', 'offset','28800', 'currentOffset';'25200'] ]


 

Groovy Documentation