Menu

#44 Remote API write mode

open
nobody
None
5
2010-08-27
2010-08-27
J_C_
No

I extended Remote API to add or adjust an item.

The new methods are:
item.put
item.put.history

Method's descriptions:
----------------------------------------------------------------------------------------------------------------------------------------
* http://<myserver>/jtrac/api?method=item.put&prefixCode=<space prefix code>&summary=<Summary field content>&detail=<Detail field content>&cusTim01=<Custom field content>&cusInt02=<Custom field content>...&toUser=<Username to assign the item>&isTest=<Test indicator to test the operation or to apply it, possible values are: y- it is test, n- it is not test, create the item)
* example:
* http://<myserver>/jtrac/api?method=item.put&prefixCode=MYSPACE&summary=Remote+test+creation&detail=Remote+test+creation&cusTim01=2010-03-31&cusInt02=3&toUser=prthomas&isTest=y
- test if an item can be created and assigned to prthomas user in the space with prefix code MYSPACE
*http://<myserver>/jtrac/api?method=item.put&prefixCode=MYSPACE&summary=Remote+test+creation&detail=Remote+test+creation&cusTim01=2010-03-31&cusInt02=3&toUser=prthomas&isTest=n
- create an item and assign it to prthomas user in the space with prefix code MYSPACE
----------------------------------------------------------------------------------------------------------------------------------------
* http://<myserver>/jtrac/api?method=item.put.history&refId=<item id>&cusTim01=<Custom field content>&cusInt02=<Custom field content>...&toStatus=<new status code>&toUser=<Username to assign the item>&comment=<comment field content>&isTest=<Test indicator to test the operation or to apply it, possible values are: y- it is test, n- it is not test, create the item)
* example:
* http://<myserver>/jtrac/api?method=item.put.history&refId=MYSPACE-1&cusTim01=2010-03-31&cusInt02=3&toStatus=2&toUser=prthomas&comment=Test+comment&isTest=y
- test if a new comment can be created for MYSPACE-1 item and if this can change to status code 2 and be assigned to prthomas user
*http://<myserver>/jtrac/api?method=item.put.history&refId=MYSPACE-1&cusTim01=2010-03-31&cusInt02=3&toStatus=2&toUser=prthomas&comment=Test+comment&isTest=n
- create a new comment for MYSPACE-1 item and change it to status code 2 and assigned it to prthomas user
*http://<myserver>/jtrac/api?method=item.put.history&refId=MYSPACE-1&comment=Test+comment&isTest=n
- create a new comment for MYSPACE-1 item
----------------------------------------------------------------------------------------------------------------------------------------

We have to consider the following remarks in the parameters' values:
- Date values must be in the pattern yyyy-MM-dd
- Spaces between words must be as '+' (plus sign)
- use the 'isTest' parameter for verifying first if the operation can be done.
- Returns XML data to show the result of the operation

I attach the files modified and added:
- info/jtrac/exception/JtracGenericException.java
- info/jtrac/web/RestMultiActionController.java

Juan Carlos

Discussion

  • Manfred Wolff

    Manfred Wolff - 2010-08-30

    The attached file is not a valid zip archive, so unfortunately I cannot open it.

     
  • J_C_

    J_C_ - 2010-08-30

    jtracRemoteApiWrite

     
  • Manfred Wolff

    Manfred Wolff - 2010-08-30

    Thanks. Seems only be an issue with firefox on windows. I will look into it.

     
  • Manfred Wolff

    Manfred Wolff - 2010-08-31

    Hi Juan.

    In the zip archive there is a file missing, which is imported in RestMultiActionController: info.jtrac.Messages. Please provide the file otherwise I can't test it.

    A detailed documentation of the REST interface were helpful. I didn't find any documentaion either of the new feature nor of the old.

    Thanks
    Manfred

     
  • J_C_

    J_C_ - 2010-08-31

    Missing file Messages.java

     
  • J_C_

    J_C_ - 2010-09-03

    I attached the missing file.

    Juan Carlos

     
  • Manfred Wolff

    Manfred Wolff - 2010-09-06

    Thanks. If I understand the message class then I need also an updated message.properties with the key-value pairs of the new messages ;-)

    Manfred

     
  • J_C_

    J_C_ - 2010-09-06

    I attach the messages properties files for EN default and ES_MX

     
  • J_C_

    J_C_ - 2010-09-06

    I attached the messages properties files.

    Juan Carlos

     

Log in to post a comment.