Homepage | Products | OX Knowledge Base | Support | Try Now | Contact | Company
OX Logo
Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Rondrian Guest

    Default HTTP API question

    Hello

    I've done a quick hack to integrate ox calendar functions in a rcp. It's just a query for 'my' appointments on a specific day.
    It works fine.

    But now i need the calendar informations from an other user for some kind of "free & busy". I can't find how to do this through the wiki doc.
    May be I'm just blind but please help me out.

    best regards

  2. #2
    Rondrian Guest

    Default

    Ok, I have a look at the source and i found the action "freebusy" in the calendar module.
    Url example:
    /ajax/calendar?action=freebusy?id=<user/resourceId>?type=<Participant.USER(1) || Participant.RESOURCE(3)>?start=<start date>?end=<end date>

    Tow questions on this:
    1. Am I on the right way?
    2. If so, how can i get the userId effectively? I have a user login at my side.

    I'll document it in the wiki, but it would be great to have some feedback from the developer.

  3. #3
    Francisco Laguna Guest

    Default

    I think you're on the right track. I've dug around a bit and resolving a username is a bit complicated.

    To resolve a username you use the contact module and do a "search" (or a "all" ) in the contact folder with the id 6. The folder 6 contains all contacts that correspond to internal users. Now when you request field 524 you'll be awarded with the internal user id, add 500 (display_name) for good measure, and you're good. Something like the following should give you all internal users:

    http://localhost/ajax/contacts?actio...sion=replaceMe

  4. #4
    Join Date
    Feb 2007
    Posts
    251

    Default

    Quote Originally Posted by Rondrian View Post
    Ok, I have a look at the source and i found the action "freebusy" in the calendar module.
    Url example:
    /ajax/calendar?action=freebusy?id=<user/resourceId>?type=<Participant.USER(1) || Participant.RESOURCE(3)>?start=<start date>?end=<end date>

    Tow questions on this:
    1. Am I on the right way?
    Yes.
    Quote Originally Posted by Rondrian View Post
    2. If so, how can i get the userId effectively? I have a user login at my side.
    See the modules "groups" and "resource". Also, the folder with the ID 6 contains all internal users. The field "internal_userid" (column ID 524) of those contacts contains the user ID, too.

  5. #5
    Rondrian Guest

    Lightbulb

    thx for the reply :-)

    Quote Originally Posted by Francisco Laguna View Post
    I think you're on the right track. I've dug around a bit and resolving a username is a bit complicated.

    To resolve a username you use the contact module and do a "search" (or a "all" ) in the contact folder with the id 6. The folder 6 contains all contacts that correspond to internal users. Now when you request field 524 you'll be awarded with the internal user id, add 500 (display_name) for good measure, and you're good. Something like the following should give you all internal users:

    http://localhost/ajax/contacts?actio...sion=replaceMe
    That's exactly the information i need (folderid=6 etc)

    I'll do the wiki stuff in the evening

  6. #6
    Rondrian Guest

    Default

    I've done the wiki stuff. Please have a look at it.

    One additional question:
    the response is an array of objects like this

    {"data":[
    {"shown_as":1,"end_date":1172620800000,"start_date ":1172534400000,"id":23,"full_time":true}, {"shown_as":1,"end_date":1172620800000,"start_date ":1172534400000,"id":49,"full_time":true},
    {"shown_as":1,"end_date":1172577600000,"start_date ":1172566800000,"id":45}
    ],
    "timestamp":0}

    as you can see the "full_time" property is only present if true.
    This is hard to convert. Should it be like this, or is this a bug?

  7. #7
    Francisco Laguna Guest

    Default

    Excellent, thanks for updating the wiki.

    As for the weird full_time property. Per specification in the Wiki (you just wrote), this is to be expected ;-) Jokes aside: I see how this can be tedious, and I hope we can get the designers of this interface to comment on it.

    Aside from that:
    What language are you writing your client in? Do you write the parsing for these answers yourself or do you use a JSON library? I'd definitely recommend the latter, as it will save you a lot of headaches. http://www.json.org has a few suggestions for libraries.

  8. #8
    Rondrian Guest

    Default

    I'm writing it in Java for use in RCP.
    And of course I'm using Json-lib.

    I've written a query like solution, where I can map to my beans.

    I can map your columns to my bean properties and json properties to my bean properties.
    I use something like this:
    JSONObject jsonOb = JSONObject.fromString(responseStr);
    jsonOb.get("jsonproperty");

    But this get method throws an exception if its not present. So I have to implement a special way just for free and busy.

    But it's just at the beginning.
    Is there a place to submit the source and discuss it. It's a private project for the small company of my mother.
    I'd like to publish it under the Apache license, if there is some interest.

  9. #9
    Rondrian Guest

    Default

    Just another question:

    is it possibly to post a full list or property file of cloumn to property name to the wiki? I'm thinking of something like this:
    1=id
    2=created_by
    3=modified_by
    4=creation_date
    5=last_modified
    20=folder_id


    I've done this for my short beginning by hand, but this is stupid work.
    So if you have such a list please post it. Otherwise I'll collect it and post it in the wiki. But step by step.

  10. #10
    Join Date
    Feb 2007
    Posts
    251

    Default

    It's already in the wiki: Common Object Data, Detailed Task And Appointment Data, etc.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •