You will find two recent sets of changes to the Sun Software Library of interest:

  • Authentication changes
  • Batch tagging

Authentication Changes

The JSON object returned from a validate, login, or logout request now does not contain collection information for the id of the person logging in or logging out of the Suns Software Library in its body.

Prior to this change, collection information for a user was included in the JSON response body for an authentication request.


Thus, the JSON response body to a login request would be the following, without colllection information:

{"UserList": {
 "items": [{"entity": {
   "updatedAt": "2008-11-14 18:34:37 GMT",
         "id": 174,
         "lastName": "Doe",
         "tcAccepted": "2008-11-14 18:34:37 GMT",
         "createdAt": "2008-11-14 18:34:37 GMT",
         "screenName": "johndoe",
         "emailAddress": "johndoe@gmail.com",
         "cwpUsername": "johndoe@gmail.com",
         "cwpPrincipalID": "oOlVxABXOtrqYbCPMp7n",
         "firstName": "John"
   }}],
    "itemsReturned": 1,
    "itemsFound": 1,
    "totalItems": 151
}}


Note on URI Login Change

The URI for login and logout has changed from:

  •  /session/json/login to /api/session/login
  • /session/json/logout to /api/session/logout

Batch Tagging

You can use the API to add tags in batch rather than in "single" mode. Batch taggging employs single-API parameters, plus additional parameters for batch tagging. The API can pass either the tag to be added or its id. 

Parameters

  • add_tag - tag to be added
  • add_tag_id - ID of the tag to be added

Batch Tagging Operation Considerations

All parameters except "id" are multi-valued, so many tags may be added and removed in a single operation. This is what is meant by batch tagging: more than one operation in a single call. Batch tagging enables you to stack up operations.

It is not recommended that there be concurrent single operations, but that all events should be done at one time via batch tagging.

Processing Order

Note that order is not significant when stacking up the parameters, but that processing occurs in the following order:

  1. tags identified by ID to be deleted.
  2. tags identified by name to be deleted.
  3. tags identified by ID to be added.
  4. tags identified by name to be added.

Additional Batch Tagging Conditions

Additionally, note the following conditions that are important for batch tag processing:

  • Tags identified by ID that do not exist will cause an error.
  • Tags identified by name, to be deleted, will cause an error.
  • Existing tags which are not currently associated with the target entity, which are included for deletion, will result in no changes but no error.

Example

/api/tags/software?id=92136&add_tag=Developer%20Tools&add_tag=IDE

Using this example, two tags will be added to the software with id of 92136, "Developer Tools" and "IDE"

Batch Deletion

Tags can be deleted in batch rather than in "single" mode. Batch taggging employs single-API parameters, plus additional parameters for batch tagging. The API can pass either the tag to be deleted or its id.

Parameters

  • delete_tag - tag to be deleted
  • delete_tag_id - ID of tag to be deleted

Example

http://library.network.com/CatalogQueryServer/api/tags/software?id=92136&delete_tag=Developer%20Tools&delete_tag=IDE






Comments:

Post a Comment:
  • HTML Syntax: NOT allowed

This blog copyright 2009 by Ari Shamash