<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>src/org/loststone/toodledo/exception/IncorrectUserPasswordException.java</filename>
    </added>
    <added>
      <filename>src/org/loststone/toodledo/exception/MissingPasswordException.java</filename>
    </added>
    <added>
      <filename>src/org/loststone/toodledo/exception/ToodledoApiException.java</filename>
    </added>
    <added>
      <filename>src/org/loststone/toodledo/request/GetUserIdRequest.java</filename>
    </added>
    <added>
      <filename>src/org/loststone/toodledo/response/GetUserIdResponse.java</filename>
    </added>
    <added>
      <filename>src/org/loststone/toodledo/xml/GetUserIdParser.java</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -58,6 +58,8 @@ Then, more advanced stuff:
 &lt;/ul&gt;
 &lt;h3&gt;&lt;a name=&quot;authentif&quot;&gt; Authentification &lt;/a&gt;&lt;/h3&gt;
 As this is a library, every program that uses it should be able to deal with more than one user concurrently. So, if you use the &lt;code&gt;initialize&lt;/code&gt; method in the interface you'll get a &lt;code&gt;AuthToken&lt;/code&gt;, this is an object which contains a key that will be valid for 4 hours, so, for every user you must cache or serialize or whatever that object. If you try to authenticate several times the same user (use the &lt;code&gt;initialize&lt;/code&gt; method for the same user) that user will be banned temporarily from using the API, and that's not good. So, use that call or get an &lt;code&gt;AuthToken&lt;/code&gt; manually and save that key for future use.
+&lt;p&gt;
+The &lt;code&gt;initialize&lt;/code&gt; method needs the userid, not the username, you can get the userid from the toodledo webpage, it's always a 15 or 16 hexadecimal string. If for any reason you cannot log into the webpage and get the userid for a user you can user the &lt;code&gt;getUserId&lt;/code&gt; method in the API. This method only requires the user e-mail and password. Take care using this method as it's sending the password in plain text format over the net as an http parameter. So, use it only if necessary.
 &lt;h3&gt;&lt;a name=&quot;utapi&quot;&gt; Using the API &lt;/a&gt;&lt;/h3&gt;
 No problem here, the API is very straightforward and easy to use, if you've got any doubt you can check the toodledo API documentation &lt;a href=&quot;http://www.toodledo.com/info/api_doc.php&quot;&gt;here&lt;/a&gt;.
 &lt;h3&gt;&lt;a name=&quot;ucstd&quot;&gt; Using the components as standalone &lt;/a&gt;&lt;/h3&gt;
@@ -67,8 +69,9 @@ All the requests use the commons-http package to do HTTP GET's to the REST API.
 You can contact me at: &lt;p&gt;
 &lt;ul&gt;
 	&lt;li&gt; e-mail / jabber: phlegias@gmail.com
+	&lt;li&gt; irc (freenode): grind_lant
 &lt;/ul&gt;
 &lt;hr&gt;
-&lt;i&gt;Last modified: &lt;/i&gt; 14/3/2009
+&lt;i&gt;Last modified: &lt;/i&gt; 20/3/2009
 &lt;/body&gt;
 &lt;/html&gt;</diff>
      <filename>doc/tutorial/index.html</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,7 @@
 package org.loststone.toodledo;
 
+import org.loststone.toodledo.exception.ToodledoApiException;
+
 /**
  * This class represents the goal in toodledo.
  * @author lant</diff>
      <filename>src/org/loststone/toodledo/Goal.java</filename>
    </modified>
    <modified>
      <diff>@@ -2,6 +2,9 @@ package org.loststone.toodledo;
 
 import java.util.List;
 
+import org.loststone.toodledo.exception.IncorrectUserPasswordException;
+import org.loststone.toodledo.exception.MissingPasswordException;
+import org.loststone.toodledo.exception.ToodledoApiException;
 import org.loststone.toodledo.util.AuthToken;
 
 /**
@@ -124,5 +127,17 @@ public interface ToodledoApi {
 	 */
 	List&lt;Goal&gt; getGoals(AuthToken auth) throws ToodledoApiException;
 	
+	/**
+	 * Get a userId.
+	 * &lt;b&gt;Warning&lt;/b&gt;. Please note that this call sends the password in PLAIN TEXT over the net
+	 * as an HTTP parameter.
+	 * @param e-mail.
+	 * @param password
+	 * @return The userId
+	 * @throws MissingPasswordException 
+	 * @throws IncorrectUserPasswordException 
+	 */
+	String getUserId(String eMail, String password) throws ToodledoApiException,
+		IncorrectUserPasswordException, MissingPasswordException;
 	
 }</diff>
      <filename>src/org/loststone/toodledo/ToodledoApi.java</filename>
    </modified>
    <modified>
      <diff>@@ -2,6 +2,9 @@ package org.loststone.toodledo;
 
 import java.util.List;
 
+import org.loststone.toodledo.exception.IncorrectUserPasswordException;
+import org.loststone.toodledo.exception.MissingPasswordException;
+import org.loststone.toodledo.exception.ToodledoApiException;
 import org.loststone.toodledo.request.AddContextRequest;
 import org.loststone.toodledo.request.AddFolderRequest;
 import org.loststone.toodledo.request.AddGoalRequest;
@@ -12,6 +15,7 @@ import org.loststone.toodledo.request.GetContextsRequest;
 import org.loststone.toodledo.request.GetFoldersRequest;
 import org.loststone.toodledo.request.GetGoalsRequest;
 import org.loststone.toodledo.request.GetTodosRequest;
+import org.loststone.toodledo.request.GetUserIdRequest;
 import org.loststone.toodledo.request.ModifyTodoRequest;
 import org.loststone.toodledo.request.Request;
 import org.loststone.toodledo.response.AddContextResponse;
@@ -24,11 +28,13 @@ import org.loststone.toodledo.response.GetContextsResponse;
 import org.loststone.toodledo.response.GetFoldersResponse;
 import org.loststone.toodledo.response.GetGoalsResponse;
 import org.loststone.toodledo.response.GetTodosResponse;
+import org.loststone.toodledo.response.GetUserIdResponse;
 import org.loststone.toodledo.response.ModifyTodoResponse;
 import org.loststone.toodledo.util.AuthToken;
 import org.loststone.toodledo.xml.ContextsParser;
 import org.loststone.toodledo.xml.FolderParser;
 import org.loststone.toodledo.xml.GetTodosParser;
+import org.loststone.toodledo.xml.GetUserIdParser;
 import org.loststone.toodledo.xml.GoalsParser;
 
 public class ToodledoApiImpl implements ToodledoApi {
@@ -165,4 +171,15 @@ public class ToodledoApiImpl implements ToodledoApi {
 			return -1;
 	}
 
+	@Override
+	public String getUserId(String mail, String password)
+			throws ToodledoApiException, IncorrectUserPasswordException, MissingPasswordException {
+		GetUserIdRequest request = new GetUserIdRequest(mail,password);
+		GetUserIdResponse response = (GetUserIdResponse)request.exec();
+		if(response.succeeded()) 
+			return new GetUserIdParser(response.getResponseContent()).getUserId();
+		else
+			return null;
+	}
+
 }</diff>
      <filename>src/org/loststone/toodledo/ToodledoApiImpl.java</filename>
    </modified>
    <modified>
      <diff>@@ -7,7 +7,7 @@ import org.apache.commons.httpclient.HttpException;
 import org.apache.commons.httpclient.HttpMethod;
 import org.apache.commons.httpclient.methods.GetMethod;
 import org.loststone.toodledo.Context;
-import org.loststone.toodledo.ToodledoApiException;
+import org.loststone.toodledo.exception.ToodledoApiException;
 import org.loststone.toodledo.response.AddContextResponse;
 import org.loststone.toodledo.response.Response;
 import org.loststone.toodledo.util.AuthToken;</diff>
      <filename>src/org/loststone/toodledo/request/AddContextRequest.java</filename>
    </modified>
    <modified>
      <diff>@@ -7,7 +7,7 @@ import org.apache.commons.httpclient.HttpException;
 import org.apache.commons.httpclient.HttpMethod;
 import org.apache.commons.httpclient.methods.GetMethod;
 import org.loststone.toodledo.Folder;
-import org.loststone.toodledo.ToodledoApiException;
+import org.loststone.toodledo.exception.ToodledoApiException;
 import org.loststone.toodledo.response.AddFolderResponse;
 import org.loststone.toodledo.response.Response;
 import org.loststone.toodledo.util.AuthToken;</diff>
      <filename>src/org/loststone/toodledo/request/AddFolderRequest.java</filename>
    </modified>
    <modified>
      <diff>@@ -7,7 +7,7 @@ import org.apache.commons.httpclient.HttpException;
 import org.apache.commons.httpclient.HttpMethod;
 import org.apache.commons.httpclient.methods.GetMethod;
 import org.loststone.toodledo.Goal;
-import org.loststone.toodledo.ToodledoApiException;
+import org.loststone.toodledo.exception.ToodledoApiException;
 import org.loststone.toodledo.response.AddGoalResponse;
 import org.loststone.toodledo.response.Response;
 import org.loststone.toodledo.util.AuthToken;</diff>
      <filename>src/org/loststone/toodledo/request/AddGoalRequest.java</filename>
    </modified>
    <modified>
      <diff>@@ -7,7 +7,7 @@ import org.apache.commons.httpclient.HttpException;
 import org.apache.commons.httpclient.HttpMethod;
 import org.apache.commons.httpclient.methods.GetMethod;
 import org.loststone.toodledo.Todo;
-import org.loststone.toodledo.ToodledoApiException;
+import org.loststone.toodledo.exception.ToodledoApiException;
 import org.loststone.toodledo.response.AddTodoResponse;
 import org.loststone.toodledo.response.Response;
 import org.loststone.toodledo.util.AuthToken;</diff>
      <filename>src/org/loststone/toodledo/request/AddTodoRequest.java</filename>
    </modified>
    <modified>
      <diff>@@ -6,7 +6,7 @@ import org.apache.commons.httpclient.HttpClient;
 import org.apache.commons.httpclient.HttpException;
 import org.apache.commons.httpclient.HttpMethod;
 import org.apache.commons.httpclient.methods.GetMethod;
-import org.loststone.toodledo.ToodledoApiException;
+import org.loststone.toodledo.exception.ToodledoApiException;
 import org.loststone.toodledo.response.DeleteResponse;
 import org.loststone.toodledo.response.Response;
 import org.loststone.toodledo.util.AuthToken;</diff>
      <filename>src/org/loststone/toodledo/request/DeleteTodoRequest.java</filename>
    </modified>
    <modified>
      <diff>@@ -6,7 +6,7 @@ import org.apache.commons.httpclient.HttpClient;
 import org.apache.commons.httpclient.HttpException;
 import org.apache.commons.httpclient.HttpMethod;
 import org.apache.commons.httpclient.methods.GetMethod;
-import org.loststone.toodledo.ToodledoApiException;
+import org.loststone.toodledo.exception.ToodledoApiException;
 import org.loststone.toodledo.response.GetContextsResponse;
 import org.loststone.toodledo.response.Response;
 import org.loststone.toodledo.util.AuthToken;</diff>
      <filename>src/org/loststone/toodledo/request/GetContextsRequest.java</filename>
    </modified>
    <modified>
      <diff>@@ -6,7 +6,7 @@ import org.apache.commons.httpclient.HttpClient;
 import org.apache.commons.httpclient.HttpException;
 import org.apache.commons.httpclient.HttpMethod;
 import org.apache.commons.httpclient.methods.GetMethod;
-import org.loststone.toodledo.ToodledoApiException;
+import org.loststone.toodledo.exception.ToodledoApiException;
 import org.loststone.toodledo.response.GetFoldersResponse;
 import org.loststone.toodledo.response.Response;
 import org.loststone.toodledo.util.AuthToken;</diff>
      <filename>src/org/loststone/toodledo/request/GetFoldersRequest.java</filename>
    </modified>
    <modified>
      <diff>@@ -6,7 +6,7 @@ import org.apache.commons.httpclient.HttpClient;
 import org.apache.commons.httpclient.HttpException;
 import org.apache.commons.httpclient.HttpMethod;
 import org.apache.commons.httpclient.methods.GetMethod;
-import org.loststone.toodledo.ToodledoApiException;
+import org.loststone.toodledo.exception.ToodledoApiException;
 import org.loststone.toodledo.response.GetGoalsResponse;
 import org.loststone.toodledo.response.Response;
 import org.loststone.toodledo.util.AuthToken;</diff>
      <filename>src/org/loststone/toodledo/request/GetGoalsRequest.java</filename>
    </modified>
    <modified>
      <diff>@@ -7,7 +7,7 @@ import org.apache.commons.httpclient.HttpException;
 import org.apache.commons.httpclient.HttpMethod;
 import org.apache.commons.httpclient.methods.GetMethod;
 import org.loststone.toodledo.Todo;
-import org.loststone.toodledo.ToodledoApiException;
+import org.loststone.toodledo.exception.ToodledoApiException;
 import org.loststone.toodledo.response.GetTodosResponse;
 import org.loststone.toodledo.response.Response;
 import org.loststone.toodledo.util.AuthToken;</diff>
      <filename>src/org/loststone/toodledo/request/GetTodosRequest.java</filename>
    </modified>
    <modified>
      <diff>@@ -7,7 +7,7 @@ import org.apache.commons.httpclient.HttpException;
 import org.apache.commons.httpclient.HttpMethod;
 import org.apache.commons.httpclient.methods.GetMethod;
 import org.loststone.toodledo.Todo;
-import org.loststone.toodledo.ToodledoApiException;
+import org.loststone.toodledo.exception.ToodledoApiException;
 import org.loststone.toodledo.response.ModifyTodoResponse;
 import org.loststone.toodledo.response.Response;
 import org.loststone.toodledo.util.AuthToken;</diff>
      <filename>src/org/loststone/toodledo/request/ModifyTodoRequest.java</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 package org.loststone.toodledo.response;
 
-import org.loststone.toodledo.ToodledoApiException;
+import org.loststone.toodledo.exception.ToodledoApiException;
 
 
 public class AddContextResponse extends Response {</diff>
      <filename>src/org/loststone/toodledo/response/AddContextResponse.java</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 package org.loststone.toodledo.response;
 
-import org.loststone.toodledo.ToodledoApiException;
+import org.loststone.toodledo.exception.ToodledoApiException;
 
 
 public class AddFolderResponse extends Response {</diff>
      <filename>src/org/loststone/toodledo/response/AddFolderResponse.java</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 package org.loststone.toodledo.response;
 
-import org.loststone.toodledo.ToodledoApiException;
+import org.loststone.toodledo.exception.ToodledoApiException;
 
 
 public class AddGoalResponse extends Response {</diff>
      <filename>src/org/loststone/toodledo/response/AddGoalResponse.java</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 package org.loststone.toodledo.response;
 
-import org.loststone.toodledo.ToodledoApiException;
+import org.loststone.toodledo.exception.ToodledoApiException;
 
 
 public class AddTodoResponse extends Response {</diff>
      <filename>src/org/loststone/toodledo/response/AddTodoResponse.java</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 package org.loststone.toodledo.response;
 
-import org.loststone.toodledo.ToodledoApiException;
+import org.loststone.toodledo.exception.ToodledoApiException;
 
 public class AuthorizeResponse extends Response {
 	</diff>
      <filename>src/org/loststone/toodledo/response/AuthorizeResponse.java</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 package org.loststone.toodledo.response;
 
-import org.loststone.toodledo.ToodledoApiException;
+import org.loststone.toodledo.exception.ToodledoApiException;
 
 
 public class DeleteResponse extends Response {</diff>
      <filename>src/org/loststone/toodledo/response/DeleteResponse.java</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 package org.loststone.toodledo.response;
 
-import org.loststone.toodledo.ToodledoApiException;
+import org.loststone.toodledo.exception.ToodledoApiException;
 
 
 public class GetContextsResponse extends Response {</diff>
      <filename>src/org/loststone/toodledo/response/GetContextsResponse.java</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 package org.loststone.toodledo.response;
 
-import org.loststone.toodledo.ToodledoApiException;
+import org.loststone.toodledo.exception.ToodledoApiException;
 
 
 public class GetFoldersResponse extends Response {</diff>
      <filename>src/org/loststone/toodledo/response/GetFoldersResponse.java</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 package org.loststone.toodledo.response;
 
-import org.loststone.toodledo.ToodledoApiException;
+import org.loststone.toodledo.exception.ToodledoApiException;
 
 
 public class GetGoalsResponse extends Response {</diff>
      <filename>src/org/loststone/toodledo/response/GetGoalsResponse.java</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 package org.loststone.toodledo.response;
 
-import org.loststone.toodledo.ToodledoApiException;
+import org.loststone.toodledo.exception.ToodledoApiException;
 
 
 public class GetTodosResponse extends Response {</diff>
      <filename>src/org/loststone/toodledo/response/GetTodosResponse.java</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 package org.loststone.toodledo.response;
 
-import org.loststone.toodledo.ToodledoApiException;
+import org.loststone.toodledo.exception.ToodledoApiException;
 
 
 public class ModifyTodoResponse extends Response {</diff>
      <filename>src/org/loststone/toodledo/response/ModifyTodoResponse.java</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 package org.loststone.toodledo.response;
 
-import org.loststone.toodledo.ToodledoApiException;
+import org.loststone.toodledo.exception.ToodledoApiException;
 
 /**
  * This class holds a response from the server.</diff>
      <filename>src/org/loststone/toodledo/response/Response.java</filename>
    </modified>
    <modified>
      <diff>@@ -9,7 +9,7 @@ import javax.xml.parsers.SAXParser;
 import javax.xml.parsers.SAXParserFactory;
 
 import org.loststone.toodledo.Goal;
-import org.loststone.toodledo.ToodledoApiException;
+import org.loststone.toodledo.exception.ToodledoApiException;
 import org.xml.sax.Attributes;
 import org.xml.sax.SAXException;
 import org.xml.sax.helpers.DefaultHandler;</diff>
      <filename>src/org/loststone/toodledo/xml/GoalsParser.java</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>src/org/loststone/toodledo/ToodledoApiException.java</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>d65b7f1f4f2ee0ee9b282e905d59bd1978c5d888</id>
    </parent>
  </parents>
  <author>
    <name>Marc</name>
    <email>phlegias@gmail.com</email>
  </author>
  <url>http://github.com/lant/toodledo-java/commit/27461b936fa005201efa5212fcfff4f15651d71d</url>
  <id>27461b936fa005201efa5212fcfff4f15651d71d</id>
  <committed-date>2009-03-20T16:00:46-07:00</committed-date>
  <authored-date>2009-03-20T16:00:46-07:00</authored-date>
  <message>- Added a new method to get the userid from the REST service
- Updated documentation.</message>
  <tree>71d848002dbf606ab583fe806d897903833ed5d6</tree>
  <committer>
    <name>Marc</name>
    <email>phlegias@gmail.com</email>
  </committer>
</commit>
