Hi Jacky,
Thanks for uncovering this bug in the client library. There are a
couple other parameters that aren't getting encoded either. I'll file
a bug and try to get this fixed in the next release.
Cheers,
Lane
On May 10, 8:22 pm, "Jacky.S" <[EMAIL PROTECTED]> wrote:
> Hi Lane,
>
> Here is my code to set Minimum Start Time and updatedMin.
>
> public CalendarEventFeed searchForEvent(long startDate, long
> updatedMin) {
> // parse the google search query event
> CalendarQuery myQuery = createQuery();
>
> // parse the google date time according the timezone
> if (startDate != -1) {
> myQuery.setMinimumStartTime(new DateTime(startDate,
> TimeZone.getDefault().getOffset(startDate) / 60000));
> myQuery.setUpdatedMin(new DateTime(updatedMin,
> TimeZone.getDefault().getOffset(startDate) / 60000));
> }
>
> return executeQuery(myQuery);
> }
>
> Both of the parameter (long)startDate and (long)updatedMin are value
> of Date.
> startDate = An java.util.Date Object.getTime();
> updatedMin = An java.util.Date Object.getTime();
>
> Now I'm using the gdata.java-1.0.10 instead of gdata.java-1.0.9. And I
> confirmed the problem again.
> I have tried to debug this problem in
> URI getQueryUri() API in Query.java
> I found that the original source code is like this:
>
> if (updatedMin != null) {
> ...
> queryBuf.append(updatedMin.toString());
> }
>
> and if I use this code I would got the parameter in URI like this:
> queryBuf.toString() = "...updated-
> Min=2007-04-25T12:27:30.000+08:00..."
> The updated-Min values in URI is different from start date time value
> that is well encoded in the URI.
> So I tried to modify the above part like this:
>
> if (updatedMin != null) {
> ...
> queryBuf.append(URLEncoder.encode(updatedMin.toString(),
> "UTF-8"));
> }
>
> Then it got passed. I think that all characters like '-', '+' and ':'
> would be encoded in URI as parameters.
>
> FYI.
>
> Thanks,
>
> Jacky
>
> On 5月11日, 上午1时24分, "Lane LiaBraaten (Google)" <[EMAIL PROTECTED]>
> wrote:
>
> > Hi Jacky,
>
> > I haven't seen this problem myself, but if it's a bug I want to report
> > it. Can you post the DateTime parameter you're using and maybe some
> > sample code?
>
> > Thanks in advance,
> > Lane
>
> > On May 9, 9:51 pm, "Jacky.S" <[EMAIL PROTECTED]> wrote:> Hi,
>
> > > When I used JAVA Client API to query events for google calendar, if I
> > > called the APIsetUpdatedMinand pass a DateTime parameter, then I
> > > would received an Error as "Bad Request... updated-min".
>
> > > I tried to debug this problem and found that the updated Date value
> > > have not been encoded. Once I encoded, it got passed.
>
> > > I wondered that if it was a BUG because I'm not sure about I'm using
> > > the latest JAVA client version. So you can ignoral this thread if my
> > > version was out of date:)
>
> > > Thanks,
>
> > > Jacky
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Calendar Data API" group.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/google-calendar-help-dataapi?hl=en
-~----------~----~----~----~------~----~------~--~---