#18 Retrieve XML format of Topics

closed-accepted
nobody
None
5
2008-06-20
2008-02-28
rob_webset
No

I was looking at how an external program (in this case a "release report" I'm writing for Scmbug) would retrieve details about topics for a given bugid. (I'm actually only after if a review was generated and if it is still open at this point - but may want more in the future)

I didn't want to try and go directly into the codestriker database as that would be a bit nasty. However I was very pleased after a reasonable about of studying that the code to do it is relatively simple. I was even able to achieve this without really updating any existing "Action" related code.

I have attached a diff of this, the code I used to test this was simply:

use CodestrikerClient;

my $client = CodestrikerClient->new('http://.../codestriker/codestriker.pl');
my $xml_data = $client->get_topics_xml("33466");

print $xml_data;

So remarkably simple and opens up a whole world of possibilities for reports.

What do you think, is this something you would be happy for codestriker to support?

Discussion

  • David Sitsky
    David Sitsky
    2008-02-28

    Logged In: YES
    user_id=208928
    Originator: NO

    Hi Rob,

    I have been thinking about this for a while actually - doing a nice REST interface for Codestriker where external clients could retrieve topic information in a nice XML format, and add new comments and perform all other actions in this way.

    This is part of the reason why I am ripping up Render.pm and putting the output into a template, so that an XML version can be easily written using another template. Once this is complete, we should be able to do your task in a similar fashion. We'll need to decide on a suitable XML format for representing topics, comments and so forth. Are you keen to look at that?

    My motivation would be so that we could have IDEs (or other programs) interfacing with Codestriker via a REST interface.

     
  • rob_webset
    rob_webset
    2008-02-29

    Logged In: YES
    user_id=1137102
    Originator: YES

    Sounds interesting, but a fair bit of work.

    I don't know anything about REST so would most probably need some tips etc.

    I did find a mini tutorial on-line: http://learn-rest.blogspot.com/

    Overall I think this sort of thing would be very useful.

    Rob

     
  • rob_webset
    rob_webset
    2008-04-03

    Logged In: YES
    user_id=1137102
    Originator: YES

    Hi David,

    Attached is another go at the patch, this time using a template as you suggested. I wanted to start with a simple one to begin with, then maybe over time it may be suitable to extend this with more information.

    Thanks

    Rob

    File Added: xml_topicview.patch.txt

     
  • rob_webset
    rob_webset
    2008-06-19

    Logged In: YES
    user_id=1137102
    Originator: YES

    Hi David

    Another patch - this one goes through the ViewTopic.pm action controller

    Hope this is OK

    Thanks

    Rob

    File Added: xml_display_patch.txt

     
  • rob_webset
    rob_webset
    2008-06-19

    XML Topic using a template

     
    Attachments
  • rob_webset
    rob_webset
    2008-06-19

    Logged In: YES
    user_id=1137102
    Originator: YES

    This patch moves the interface onto the ListTopics.pm file

    File Added: xml_list_patch.txt

     
  • David Sitsky
    David Sitsky
    2008-06-20

    • status: open --> closed-accepted