You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

Thalia Business Layer APIs
v. 1.7

There are two sets of Thalia back-end APIs.  They are both implemented using the java servlet technology. The first set is the more traditional. It uses the HTTP Get and Post method. Inputs are passed to the API through HTTP request parameters and the APIs return the results in XML format. The second is the new REST style API. It utilizes four of the HTTP methods: Get for retrieval, Post for create, Put for update, and Delete for deletion. Inputs are passed in XML format in the HTTP request body and the API return the results in XML format. We are looking to fully utilize the REST style API in our front end and phase out the traditional set of APIs.

Thalia REST API

Because most of the browsers and other web tools still don't support Put and Delete, our APIs will take an optional parameter method which can be delete or put to bypass the client limitations.
In a RESTful design, the objects and their functions in an application are divided as resources and are identified as URIs which is  uniquely addressable using the http syntax and self-descriptive. It separates the server from its client and can handle request from any client that uses the resource syntax.
The resources we identified in our application are library, libraries, authz(authorization), authzs, bulk (for bulk operations), category, categories (for tagging), item, and items, map, maps (for collection and slideshow), user, and users. Each URI supports one or more of the four HTTP methods.
Our REST API uses https for client authentication. Our rest apis all take two parameters:

user and method. The user parameter is used for proxy. Only domain admins can use this parameter. If a domain admin wants to see what libraries the user smith can see, he can do baseuri/libraries?user=smith. If the current user is not a domain admin, this parameter is ignored.
The  method parameter is provided as a walkaround for those clients that do not support Http Delete and Put. The user can use the universally supported POST method, but override it to do a Delete or Put. For example, to delete a library, the user can do POST baseuri/library/[id]?method=DELETE.

library:          

Method: GET

URI:                   baseuri/library/[library id]    

   baseuri/library/[library id]/items

   baseuri/library

Description: retrieve information about the library identified by the library id. If the items option is specified in the uri, the items inside the album are also displayed. The third url will return the current user's default library. If the user is a domain user, his/her personal library id will be returned. If the user is a guest, the public library id will be returned. Note, only the library id will be returned for the third url, not the full xml text.

Error conditions:If the library id does not exist, a status *"*error getting library 25eefdb4-ed1f-11db-b242-453c40fc1275 : Node does not exist: workspace://HST/25eefdb4-ed1f-11db-b242-453c40fc1275" will be returned.
 If the id does not point to a library, a status "id e796eb50-ede6-11db-acd7-85ce9f1fbf15 is not a library" will be returned.
 If the user does not have rights to view this library, a status "error getting library 08049d62-ede7-11db-acd7-85ce9f1fbf15 : Access Denied. You do not have the appropriate permissions to perform this operation" will be returned.

Input: none

Sample output 1:

<status result="true"><library>
                          <id>e876eb2a-ede6-11db-acd7-85ce9f1fbf15</id>
                          <title>Public</title>
                          <description>Public Library</description>
                          <createdBy>thaliaAdmin</createdBy>
                          <createDate>05-04-2007 06:53 PM </createDate>
                          <modifiedBy>thaliaAdmin</modifiedBy>
                          <modifiedDate>05-05-2007 08:53 PM </modifiedDate>
                           <items>1</items>
  </library>
</status>
Sample output 2:
<status result="true">
<library>
          <id>e876eb2a-ede6-11db-acd7-85ce9f1fbf15</id>
          <title>Public</title>
          <description>Public Library</description>
          <createdBy>thaliaAdmin</createdBy>
          <createDate>2007-04-18T15:56:33.625-04:00</createDate>
          <modifiedBy>dongq</modifiedBy>
          <modifiedDate>2007-04-19T12:48:13.203-04:00</modifiedDate>
<items>1</items>
           <item-list>
                           <item>
                        <libraryid>8a43ffae-f271-11db-b5bc-05f275694451</libraryid>
                                          <id>c33eec3a-ee95-11db-acd7-85ce9f1fbf15</id>
                                          <title>flowers</title>
                                          <description>Spring flowers</description>
                                          <createdBy>dongq</createdBy>
                                          <createDate>05-04-2007 04:53 PM </createDate>
                                          <modifiedBy>dongq</modifiedBy>
                                <modifiedDate>05-05-2007 05:13 PM </modifiedDate>  
<thumbnail>http://localhost:8180/alfresco/guestDownload/direct/workspace/HST/c60a1a39-ee95-11db-acd7-85ce9f1fbf15/thumbnail</thumbnail>
<medium>http://localhost:8180/alfresco/guestDownload/direct/workspace/HST/c611462d-ee95-11db-acd7-85ce9f1fbf15/medium</medium>
<large>http://localhost:8180/alfresco/guestDownload/direct/workspace/HST/c6160120-ee95-11db-acd7-85ce9f1fbf15/large</large>
                     </item>
                          <count>1</count>
     </item-list>
  </library>
</status>
Sample Output 3:
<status result="true">
          <defaultlibrary>0234fca3-f41c-11db-a4b1-1f881e9789dc</defaultlibrary>
</status>

Method: Delete

URI:             baseuri/library/[library id]

Description: delete the album identified by the album id.

Error conditions:

If the library id is missing, a status "no library provided" will be returned.

If the user is a guest, a status "Guest is not allowed to delete libraries" will be returned.  If the library id does not exist, a status *"*error getting library 25eefdb4-ed1f-11db-b242-453c40fc1275 : Node does not exist: workspace://HST/25eefdb4-ed1f-11db-b242-453c40fc1275" will be returned.
If the id does not point to a library, a status "id e796eb50-ede6-11db-acd7-85ce9f1fbf15 is not a library" will be returned.
If the id points to a personal library, a status "can not delete personal library" will be returned.
If the id points to a public library, a status "can not delete Public library" will be returned.
If the user does not have rights to delete this library, a status "error deleting library 08049d62-ede7-11db-acd7-85ce9f1fbf15 : Access Denied. You do not have the appropriate permissions to perform this operation" will be returned.

Input: noneSample output 1:
     <status result="true">
     </status>
Sample output 2:
     <status result="false">
<error> can not delete a personal library</error>
     </status>

Method: POST

Uri:              baseuri/library
Description: create a library. After the library is created, an authorization is created which gives the user admin rights on the library. It supports creating multiple libraries.
Error Conditions:
     If the input xml is empty or if it is mal-formatted, a status "Invalid XML input" will be returned.
     If the library title is missing, a status "Must specify library title" will be returned.
    If the user is a guest, a status "Guest is not allowed to add libraries" will be returned.
Input: library has two fields, title and description. Title is mandatory.
Sample input:
     <library>
                     <title>test</title>
                     <description>a test library</description>
     </library>           
Sample output 1:
<status result="true">
<library>
                          <id>e876eb2a-ede6-11db-acd7-85ce9f1fbf15</id>
                          <title>test</title>
                          <description>a test library</description>
                          <createdBy>dongq</createdBy>
                          <createDate>05-04-2007 05:53 PM</createDate>
                          <modifiedBy>dongq</modifiedBy>
                          <modifiedDate>05-04-2007 08:03 PM</modifiedDate>
                           <items>0</items>
  </library>
</status>
Sample output 2:
<status result="false">
<error>Must specifiy library title</error>
</status>

Method: PUT

Uri:              base/uri/library/[library id]
Description: modified a library. Both title and description can be modified:

Error conditions:

If the library id is missing, a status "No library provided" will be returned.

If the xml input is empty or of wrong format, a status "Invalid XML input" is returned.  

If the user is a guest, a status "Guest is not allowed to update libraries" will be returned.  If the library id does not exist, a status *"*error getting library 25eefdb4-ed1f-11db-b242-453c40fc1275 : Node does not exist: workspace://HST/25eefdb4-ed1f-11db-b242-453c40fc1275" will be returned.
If the id does not point to a library, a status "id e796eb50-ede6-11db-acd7-85ce9f1fbf15 is not a library" will be returned.
If the id points to a public library, a status "can not update the Public library" will be returned.
If the user does not have rights to delete this library, a status "error updating library 08049d62-ede7-11db-acd7-85ce9f1fbf15 : Access Denied. You do not have the appropriate permissions to perform this operation" will be returned.
Input: library has two fields, title and description. You only need to supply the changing attributes. For example, if you are changing description, there is no need to also give us the unchanged title.
Sample input:
<library>
<title>Spring 2006</title>
<description>Pictures we took in Spring 2006</description>
</library>
Sample output:
<status result="true">
                     </status>

libraries:

Method: GET

    Uri:         
baseuri/libraries  
baseuri/libraries/all
Description: retrieves information on all libraries the user can see. If the all option is specified, items inside each library will also be displayed.
Input: none
Sample output:
<status result="true">
<library-list>
           <library>
                          <id>ea5632ac-ede6-11db-acd7-85ce9f1fbf15</id>
                          <title>dongq's Library</title>
                          <description>dongq's Personal Library</description>
                          <createdBy>dongq</createdBy>
                          <createDate>05-04-2007 04:53 PM</createDate>
                          <modifiedBy>dongq</modifiedBy>
                          <modifiedDate>05-04-2007 17:53 PM</modifiedDate>
                           <items>2</items>
     </library>
<library>
                          <id>e876eb2a-ede6-11db-acd7-85ce9f1fbf15</id>
                          <title>Public</title>
                          <description>Public Library</description>
                          <createdBy>thaliaAdmin</createdBy>
                          <createDate>05-04-2007 04:53 PM</createDate>
                          <modifiedBy>dongq</modifiedBy>
                          <modifiedDate>05-04-2007 04:57 PM</modifiedDate>
                           <items>1</items>
     </library>
<library>
                          <id>db5ad200-ee9d-11db-acd7-85ce9f1fbf15</id>
                          <title>Spring 2006</title>
                          <description>Pictures we took in Spring 2006</description>
                    <createdBy>dongq</createdBy>
                          <createDate>05-04-2007 04:00 PM</createDate>
                          <modifiedBy>dongq</modifiedBy>
                          <modifiedDate>05-04-2007 05:53 PM </modifiedDate>
                           <items>0</items>
     </library>
  </library-list>
</status>

authz:

Method: GET

Uri:              baseuri/authz/role/[role name]/qualifier/[qualifier id]
Description:  retrieves if the user has the authorization to do function X with the qualifier Y. Role names are admin, read, download, and write.  Qualifier id is the id of a library, a collection, or slideshow
Error Conditions:
If the role or qualifier is missing, a status "Not enough parameters" will be returned.
If the role is not one of the recognized three, a status "Error getting authorization: xxx is not recognized" will be returned
Input: none
Sample output:
     <status result="true" />
    

Method: DELETE

Uri:              baseuri/authz
Description: deletes an authorization identified. It supports deleting multiple authorizations.
Error Condition:
If the input xml file is empty or is mal-formatted, a status "Invalid XML input" will be returned.
If the client is a guest, a status "Guest is not allowed delete authorizations" will be returned.
If one of the authorization triplet is missing, a status "Error deleting authorization: information missing" will be returned.
If the role is not one of the recognized three, a status "Error deleting authorization: xxx is not recognized."
Input: authz has three parts: user, role, and qualifier. All three are mandatory. User is the user name, role is one of "read", "write", "download", or "admin". Qualifier is the id of a library, collection or slideshow. We have a special user account "public" which refers to everybody including guests.
Sample input:
<authz user="dtanner" role="write" qualifier="db5ad200-ee9d-11db-acd7-85ce9f1fbf15"/>
Sample output:
<status result="true" />

Method: POST

Uri:              baseuri/authz
Description: creates an authorization. It supports creating multiple authorizations.
Error conditions:
If the input xml file is empty or is mal-formatted, a status "Invalid XML input" will be returned.
If the client is a guest, a status "Guest is not allowed to create authorizations" will be returned.
If one of the authorization triplet is missing, a status "Error creating authorization: information missing" will be returned.
If the role is not one of the recognized three, a status "Error creating authorization: xxx is not recognized."
If the qualifier does not exist, a status "Error creating authorization: Node does not exist."
If the qualifier is not of type library, collection, or slideshow, a status "Error creating authorization: xxx is not of the type library, collection, or slideshow" will be returned.
Input: authz has three parts: user, role, and qualifier. All three are mandatory. User is the user name, role is one of "read", "write", "download", or "admin". Qualifier is the id of a library, collection, slideshow.  We have a special user account "public" which opens the access to everybody including guests.
Sample input:
<authz user="dtanner" role="write" qualifier="db5ad200-ee9d-11db-acd7-85ce9f1fbf15"/>
Sample output:
<status result="true" />

authzs:

Method: GET

    Uri:         
baseuri/authzs/functions
baseuri/authzs/qualifier/[qualifier id]
baseuri/authzs/qualifier/[qualifier id]/user/[user name]   
                                               
Error conditions:
     If the qualifier id is missing, "No qualifier specified" status will be return.
Description: The first uri retrieves all the available functions. The second uri retrieves all authorizations on a specific library, collection, or slideshow. The third one is similar to the second, but the result is filtered by the user name. We have a special user account "public" which refers to everybody including guests.
Input: none
Sample output 1:
<status result="true">
<function-list>
          <function>admin</function>
          <function>write</function>
          <function>read</function>
</function-list>
</status>
Sample output 2:
<status result="true">
<authorization_list>
<authz user="dongq" role="admin" qualifier="db5ad200-ee9d-11db-acd7-85ce9f1fbf15" />
          <authz user="dtanner" role="write" qualifier="db5ad200-ee9d-11db-acd7-85ce9f1fbf15" />
</authorization_list>
</status>

bulk:

Method: POST

Uri:              baseuri/bulk
Description: Bulk importing items into the libraries. The user can either supply a zip file or a directory on the server. If a zip file is supplied, we will unzip the files into a temp directory. There are two types of bulk importing: with metadata file and with user supplied metadata.
The bulk import with a metadata file will get the meta data info from the meta data file. The default metadata file name is AssetMetadata.txt unless it if specified in the xml input. The meta data file should be a tab delimited text file. The first line of the file should specify the column header. The column header should contain the file name and some data fields name. The bulk import will try to match the header fields with the Dublin core meta data fields. If the domain specific metadata is present for that domain, it will be used when doing the match. If the domain specific info is not present, the header will be matched using the hard-coded Dublin core fields. For the fields that don't match the Dublin core fields, we will try to apply them as categories and tags. If the user is a domain admin, tags will be created if they don't exist already and then applied to the new item. If the user is a regular user, new tags will not be created and the field will be skipped if it is not already a tag in the repository.
The import with user supplied metadata has the Dublin core fields in the xml and those metadata will be applied to all the items in the bulk import. The user can also specify a list of categories to be applied to all the items.
The bulk import base directory is specified in the xml file as "bulkPath". The detail of the bulk import operation is logged as BulkResultxxx.xml. The xxx is the date time stamp.
Error Conditions:
If the user is a guest, a status of "Guest is not allowed to do bulk import" is returned.
If the xml input can't be parsed, a status of "Invalid XML input" is returned.
If the bulk import directory is not specified or if the zip file is not successfully unzipped to a temp directory, a status of "Bulk image directory is not provided" is returned.
If the bulk import directory does not exist, a status of "Bulk image directory does not exist" is returned.
If the zip file does not exist, a status of "xxx does not exist" is returned.
If the zip file is not of correct format, a starus of "error opening zip file" is returned.
     If an existing library id is specified, but the library id doesn't exist, a status of "Error: node does not exist" is returned.
If an existing library id is specified, but the library id doesn't point to a library, a status of "Error: id xxx is not of the type library".
If an existing library id is specified, but the user does not have write permission to it, a status of "The user doesn't have permission to write to library xxxx" will be returned.
If the meta data file can not be read for some reason, the status indicating the IOException will be returned.
The above errors will make the bulk import stop. Individual item import errors (such as image does not exist, categories failed to create, the meta data contain illegal characers) will be logged in the log file, but the import will continue.
   Input:
      The bulk upload has several fields: zipfile, directory, metadatafile, itemsperlibrary, libraryid, librarytitle, and librarydescription. The user has to supply either zipfile or directory. It should be a relative path under the base import directory. metadatafile is the name of the metadata file for HST import. If this field is missing we will try the default meta data file. Itemsperlibrary specifies how many items maximum should each library holds. If the field is missing, all items go to the same library. If the field present, we will create [librarytitle]-1, [librarytitle]-2 , etc to split the items among several libraries. libraryid is the id of an existing library to import to. If id is present, librarytitle and librarydescription fields are ignored. If the id is not present, we will try to create a new library using the title and description. If title is not present, we will use the directory name or the zip file name without the zip extension.
    In addition to those fields related to the bulk upload itself, the user can also supply any Dublin core metadata fields (title, description, contributor, coverage, creator, date, format, identifier, language, publisher, rights ,relation, source, subject, type
    The xml can also contain a list of categories.
   If the metadata file is present, both the Dublin core fields and category list will be ignored. We will first look at the column headers of the metadata file, try to match them with the Dublin core fields. If the domain specific mapping info is present, we will use this info when we do the matching. If the domain specific mappng is not present, we will try to match the columns with the hard coded list of Dublin core column headers. For those headers we can not find a match, we will try to apply them as tags. We will first try to match the categories with existing ones in the repository. If it exists, we apply it to the item. If it does not exist, 
     Sample input 1:
    <bulk>
     <directory>hst</directory>
     <metadatafile>davinci.txt</metadatafile>
     <librarytitle>hst library</librarytitle>
     <itemsperlibrary>200</itemsperlibrary>
    </bulk>
Sample input 2:
    <bulk>
     <zipfile>pictures.zip</zipfile>
     <librarytitle>Test</librarytitle>
     <librarydescription>my test library</librarydescription>
    <description>Vacation pictures summer 2007</description>
     <creator>dongq</creator>
     <language>English</language>
    </bulk>
Sample output:
<status result="true">       
<library-list>
<library>
          <id>2b1e726d-1dd4-11dc-a5c5-99b52061c55f</id>
     </library>
<library>
          <id>51c9966c-1dd4-11dc-a5c5-99b52061c55f</id>
  </library>
<library>
          <id>89a42e07-1dd5-11dc-a5c5-99b52061c55f</id>
  </library>
  </library-list>
<summary>                    
<processed>909</processed>   
<succeed>709</succeed>       
<failed>200</failed>         
</summary>                   
</status>      

tag:

Method:  PUT

Uri:              baseuri/tag/category/[category id]/item/[itemid]
                     baseuri/tag
Description: The first uri tags the item specified by itemid with the category specified by categoryid. The second uri supports multi-tagging and tags according to the input xml.
Error conditions:
     If the url doesn't have all the required parts, a status "Not enough parameters" will be returned.
     If the request user is a guest, a status of "Guest is not allowed to tag items" will be returned.
     If the item id doesn't exist in the system, a status of "Error : node does not exist" will be returned.
If the item id doesn't point to an item, a status of "Error : id xxx is not of the type item" will be returned.
If the category id doesn't exist in the system, a status of "Error : node does not exist" will be returned.
If the category id doesn't point to an item, a status of "Error : id xxx is not of the type category" will be returned.
If the user doesn't have permission to untag, a status "Error tagging item: Access Denied. You do not have the appropriate permissions to perform this operation" will be returned.
If the category is already applied to the item, a status "Category already applied to item" will be returned.
Input: For uri 2, the input is a list of tags. A tag has two mandatory field: categoryid and itemid.
Sample input:
<tag-list>
<tag itemid="287fff47-17c7-11dc-baa4-d13693c80112" categoryid="2608484f-17c7-11dc-baa4-d13693c80112"/>
<tag itemid="131de86d-17c7-11dc-baa4-d13693c80112" categoryid="2608484f-17c7-11dc-baa4-d13693c80112"/>
</tag-list>
Sample output:
<status result="true"/>
</status>

Method: DELETE

Uri: baseuri/tag/category/[category id]/item/[item id]
        taseuri/tag
Description:
The first uri untags the item specified by itemid with the category specified by categoryid. The second uri supports multi untagging and untags according to the input xml.
Error Conditions:
     If the request user is a guest, a status of "Guest is not allowed to untag items" will be returned.
     If the url doesn't have all the required parts, a status "Not enough parameters" will be returned.
     If the item id doesn't exist in the system, a status of "Error : node does not exist" will be returned.
If the item id doesn't point to an item, a status of "Error : id xxx is not of the type item" will be returned.
If the user doesn't have permission to untag, a status "Error removing tag: Access Denied. You do not have the appropriate permissions to perform this operation" will be returned.
If the tag is not on the item, a status "Item doesn't have this tag" will be returned.
Input: For uri 2, the input is a list of tags. A tag has two mandatory field: categoryid and itemid.
Sample input:
<tag-list>
<tag itemid="287fff47-17c7-11dc-baa4-d13693c80112" categoryid="2608484f-17c7-11dc-baa4-d13693c80112"/>
<tag itemid="131de86d-17c7-11dc-baa4-d13693c80112" categoryid="2608484f-17c7-11dc-baa4-d13693c80112"/>
</tag-list>
Sample output:
<status result="true"/>
</status>

categories:

Method: GET

Uri:              baseuri/categories
                     Baseuri/categories/all
                     baseuri/categories/category/[category id]
                     baseuri/categories/item/[item id]
Description: the first url will retrieve all the top level categories. The second url will retrieve all the top level categories, and will also get its immediate children. The third url will retrieve all the subcategories under the specified category. The fourth url will retrieve all the categories applied to the specified item.
Error Conditions:
     If the item id is missing in the fourth url, a status of "Item id is missing" will be returned.
     If the item id doesn't exist, a status of "Error : node does not exist" will be returned.
    If the item id doesn't point to an item, a status of "Error : id xxx is not of the type item" will be returned.
     If the category id is missing in the third url, a status of "Category id is missing" will be returned.
     If the syntax does not match the above specified, a status of "Invalid syntax" will be returned.
Input: none            
Sample output:
<status result="true">
<category-list>
             <category id="b73854cc-f271-11db-b5bc-05f275694451" name="animal" />
             <category id="c1b4f679-f271-11db-b5bc-05f275694451" name="people" />
  </category-list>
</status>
Sample output for URI 2:
<status result="true">
<category-list>
<category id="4a9c520f-0a42-11dc-8d09-e14924d0213e" name="lab">
<subcategory-list>
<category id="4b2690b7-0a42-11dc-8d09-e14924d0213e" name="martinos" />
<count>1</count>
</subcategory-list>
</category>
<category id="4837ade1-0a42-11dc-8d09-e14924d0213e" name="program">
<subcategory-list>
<category id="48864319-0a42-11dc-8d09-e14924d0213e" name="phd-memp" />
<category id="f811d61c-0a42-11dc-8d09-e14924d0213e" name="md" />
<count>2</count>
</subcategory-list>
</category>
<category id="96771264-0a41-11dc-8d09-e14924d0213e" name="setting">
<subcategory-list>
                          <category id="96c8189c-0a41-11dc-8d09-e14924d0213e" name="lab" />
                          <category id="a43d39d8-0a41-11dc-8d09-e14924d0213e" name="hospital" />
                          <category id="abc8606a-0a41-11dc-8d09-e14924d0213e" name="teaching" />
                          <category id="b336ff67-0a41-11dc-8d09-e14924d0213e" name="faculty" />
                          <category id="dd354521-0a41-11dc-8d09-e14924d0213e" name="meeting" />
          <category id="e278515c-0a41-11dc-8d09-e14924d0213e" name="administration" />
                          <category id="fa05faf3-0a41-11dc-8d09-e14924d0213e" name="building" />
                          <category id="2a9c5580-0a42-11dc-8d09-e14924d0213e" name="student" />
                          <category id="8123d2aa-0a42-11dc-8d09-e14924d0213e" name="classroom" />
                          <category id="f8ce2153-0a42-11dc-8d09-e14924d0213e" name="students" />
                          <count>10</count>
  </subcategory-list>
</category>
</category-list>
</status>

category:

Method: POST

Uri:              baseuri/category 
Description: Creates a top level category or a subcategory. It supports creating multiple categories.
Error Conditions:
If the xml input is empty or mal-formated, a status "Invalid XML input" will be returned.
If the request user is not a domain admin, a status "xxx is not authorized to create new categories" will be returned.
If the category name is missing in the input xml, a status "Category name is missing" will be returned.
If the category's parent id doesn't exist in the system, a status of "Error : node does not exist" will be returned.
If the parent id doesn't point to a category, a status of "Error : id xxx is not of the type category" will be returned.
If the category already exist, a status of "Category xxx already exists" will be returned.
Input: category has two fields, parentid and name. name is mandatory. Parentid is optional. If the parentid is missing, it means we want to create a top-level category. Otherwise, we will create a subcategory under the parentid.
Sample Input 1:
<category name="amimal"/>
Sample Input 2:
<category parentid=" b73854cc-f271-11db-b5bc-05f275694451" name="dog"/>
Sample output:
<status result="true"/>
     <category id= "b73854cc-f271-11db-b5bc-05f275694451" name="animal"/>
</status>
Note the id in output show the id of the category itself, it is not the parentid.

Method: DELETE

Uri:             
baseuri/category/[category id]  
Description: deletes a category identified by the category id.  As a walkaround for bug th-91, we don't allow user to delete category that is in use. (tagged onto items)
Error conditions:
If the request user is not a domain admin, a status "xxx is not authorized to delete categories" will be returned.
If the category id doesn't exist in the system, a status of "Error : node does not exist" will be returned.
If the parent id doesn't point to a category, a status of "Error : id xxx is not of the type category" will be returned.
If the category or any of its subcategories is in use (tagged onto items), a status of  "category xxx has been tagged on item(s). Please remove the tags before deleting the categories".
Sample output:
<status result="true"/>
</status>

item:

Method: GET

Uri:              baseuri/item/[item id]
                     baseuri/item/[item id]/download
                     baseuri/item/[item id]/library
Description: The first url retrieve information on the item identified by the item id. The second url downloads the binary content (image) of the item identified the item id.  
     The third url will return the parent library of the item specified by the item id.
Error Conditions:
If the item id is not provided in the uri, a status "No item provided" is returned.
     If the item does not exists, a status "Error getting item xxx: Node does not exist." Is returned.
     If the id does not point to an item, a status "Id xxx is not an item" is returned.
     If the client does not have permission to view this item, a status "Error getting item xxxx: Access denied. You do not have the appropriate permission to perform this operation."
Input: none
Sample output for url 1:
<status result="true">
<item>
<librar-id>8a43ffae-f271-11db-b5bc-05f275694451</libraryid>
          <id>c33eec3a-ee95-11db-acd7-85ce9f1fbf15</id>
          <title>flowers</title>
          <description>Spring flowers</description>
          <createdBy>dongq</createdBy>
          <createDate>05-04-2007 04:53 PM</createDate>
          <modifiedBy>dongq</modifiedBy>
          <modifiedDate>200705-04-2007 04:55 PM</modifiedDate>
           <mimeType>image/jpeg</mimeType>
          <size>615466</size>
<tag-list>
                           <tag>vacation 2007</tag>
                           <tag>beach</tag>
                           <tag>kids</tag>
    </tag-list>
<thumbnail>http://localhost:8180/alfresco/guestDownload/direct/workspace/HST/c60a1a39-ee95-11db-acd7-85ce9f1fbf15/thumbnail</thumbnail>
<medium>http://localhost:8180/alfresco/guestDownload/direct/workspace/HST/c611462d-ee95-11db-acd7-85ce9f1fbf15/medium</medium>
<large>http://localhost:8180/alfresco/guestDownload/direct/workspace/HST/c6160120-ee95-11db-acd7-85ce9f1fbf15/large</large>
</item>
</status>
Sample output for url 2: the image or an error message
Sample output for url 3:
<status result="true">
<library>
                          <id>1d6c38be-17c5-11dc-baa4-d13693c80112</id>
                          <title>dongq's Library</title>
                          <description>dongq's Personal Library</description>
                          <createdBy>dongq</createdBy>
                          <createDate>06-10-2007 10:40 PM</createDate>
                          <modifiedBy>dongq</modifiedBy>
                          <modifiedDate>06-14-2007 00:16 AM</modifiedDate>
  </library>
</status>

Method: PUT

Uri:              baseuri/item/[item id]
                     baseuri/item
Description: Syntax 1 Modifies the item identified by the item id. Syntax 2 is multi-editing.
Error Conditions:
If the item id is provided in the uri, and user is trying to do multi-editing by specifying multiple items in the xml, a status "Wrong syntax trying to do multi editing" is returned.
If the input xml text is empty or is mal-formatted, a status "Invalid XML input" is returned.
If the client is guest, a status "Guest is not allowed to update items" is returned.
     If the item does not exists, a status "Error getting item xxx: Node does not exist." Is returned.
If the id does not point to an item, a status "Id xxx is not an item" is returned.
If the client does not have permission to view this item, a status "Error getting item xxxx: Access denied. You do not have the appropriate permission to perform this operation."
Input: Items have the following field: libraryId, id and Dublin core metadata fields (title, description, contributor, coverage, creator, date, format, identifier, language, publisher, relation, rights, source, subject, type). While editing, you only need to supply the changed attributes. For example, if you only want to edit description, there is no need to give us title, and all the other fields that you don't want to change.  Tagging is added or modified here also.
Sample input 1:
<item>
<id>c33eec3a-ee95-11db-acd7-85ce9f1fbf15</id>
<title>flowers</title>
<tag-list>
                           <tag>vacation 2007</tag>
                           <tag>beach</tag>
                           <tag>kids</tag>
           </tag-list>
<description>Spring flowers</description>
<contributor>Qing Dong</contributor>
<format>jpge</format>
</item>
Sample input 2:
<item-list>
     <item>
<id>c33eec3a-ee95-11db-acd7-85ce9f1fbf15</id>
<contributor>Joe Smith</contributor>
</item>
<item>
<id>c456ab-ee95-11db-acd7-85ce9f1fbf15</id>
<contributor>Joe Smith</contributor>
</item>
<item>
<id>556678-ee95-11db-acd7-85ce9f1fbf15</id>
<contributor>Joe Smith</contributor>
</item>
</item-list>
Sample output:
<status result="true">
</status>

Method: POST

Uri:             
baseuri/item
baseuri/item/import
baseuri/item/move
baseuri/item/copy
Description: The first url uploads an item. The second url imports items that are already on the server. The second url supports multiple imports. The third url moves an item to another library. The detail is supplied by the xml text and it supports multi-moves. The fourth url copies an item to another library. The detail is supplied by the xml text and it supports multi-copys.
Error Conditions for url 1:
If the request is not a multipart request, a status "Not multipart request" is returned.
If the file is not updated as "master", a status "No file uploaded" is returned.
If the item metadata is not present or if it is mal-formatted, a status "Invalid XML input" is returned. 
If the client is a guest, a status "Guest is not allowed to upload content" is returned.
If the library id is not present, a status "Library ID is not specified" is returned.
If the library id does not exist, a status "Error:  node does not exist" is returned.
If the library id does not point to a library, a status "Error id xxx is not of the type library" is returned.
Input: Items have the following field: libraryId, id and Dublin core metadata fields (title, description, contributor, coverage, creator, date, format, identifier, language, publisher, relation, rights, source, subject, type). Only libraryId is mandatory.  Tagging info can be added here also.
Error Conditions for url 2:
If the items metadata is not present or if it is mal-formatted, a status "Invalid XML input" is returned. 
If the server file name is not present in the url, a status "Missing file name" is returned.
If the client is a guest, a status "Guest is not allowed to upload content" is returned.
If the library id is not present, a status "Library ID is not specified" is returned.
If the library id does not exist, a status "Error:  node does not exist" is returned.
If the library id does not point to a library, a status "Error id xxx is not of the type library" is returned.
Input: Items have the following field: libraryId, id and Dublin core metadata fields (title, description, contributor, coverage, creator, date, format, identifier, language, publisher,relation, rights, source, subject, type). Only libraryId is mandatory.  We have three additional fields in url2 to support import: serverfilename, clientfilename, mimetype. We assume that the serverfilename is on the temp directory on the server and the temp directory is defined in web.xml.  Tagging info can be added here also.
Error Condition for url 3 and 4:
If the items metadata is not present or if it is mal-formatted, a status "Invalid XML input" is returned. 
If the item id does not exist, a status "Error:  node does not exist" is returned.
If the item id does not point to an item, a status "Error id xxx is not of the type item" is returned.
If the target library id does not exist, a status "Error:  node does not exist" is returned.
If the target library id does not point to a library, a status "Error id xxx is not of the type library" is returned.
If the user doesn't have permission to move/copy the item, a status "Error moving item xxxx:
Access denied. You do not have the appropriate permission to perform this operation" is returned.
Sample input  for url 1:
<item>
<libraryid>e876eb2a-ede6-11db-acd7-85ce9f1fbf15</libraryid>
<title>flowers</title>
<description>Spring flowers</description>
<contributor>Jane Smith</contributor>
<creator>John Smith</creator>
<date>3-3-2006</date>
<format>jpeg</format>
<language>English</language>
<publisher>none</publisher>
<rights>unspecified</rights>
<source>personal album</source>
<type>none</type>
<tag-list>
                           <tag>vacation 2007</tag>
                           <tag>beach</tag>
                           <tag>kids</tag>
            </tag-list>
</item>
Sample input for url 2:
<item-list>
<item>
<libraryid>8a43ffae-f271-11db-b5bc-05f275694451</libraryid>
<serverfilename>xyz.jpg</serverfilename>
<clientfilename>sophie.jpg</clientfilename>
<mimetype>image/jpeg</mimetype>
<tag-list>
                           <tag>vacation 2007</tag>
                           <tag>beach</tag>
                           <tag>kids</tag>
           </tag-list>
</item>
<item>
<libraryid>8a43ffae-f271-11db-b5bc-05f275694451</libraryid>
<serverfilename>xyz1.jpg</serverfilename>
<clientfilename>bella.jpg</clientfilename>
<mimetype>image/jpeg</mimetype>
<item>
</item-list>
Sample input for url 3 & 4: (please not that the library id here is the target library to which the item will be moved/copied. It is not the item's parent library id)
<item-list>
<item>
<libraryid> e876eb2a-ede6-11db-acd7-85ce9f1fbf15</libraryid>
<id>1c095c3c-eedd-11db-acd7-85ce9f1fbf15</id>
</item>
<item>
<libraryid>734mv08ur -ede6-11db-acd7-85ce9f1fbf15</libraryid>
<id>5mdo4-eedd-11db-acd7-85ce9f1fbf15</id>
</item>
</item-list>
Sample output for url 1:
<status result="true">
<item>
        <libraryid>e876eb2a-ede6-11db-acd7-85ce9f1fbf15</libraryid>
                          <id>1c095c3c-eedd-11db-acd7-85ce9f1fbf15</id>
                          <title>flowers</title>
                          <description>Spring flowers</description>
                          <createdBy>state</createdBy>
        <createDate>05-01-2007 04:53 PM </createDate>
                          <modifiedBy>state</modifiedBy>
                          <modifiedDate>05-01-2007 04:53 PM</modifiedDate>
                          <contributor>Jane Smith</contributor>
                          <creator>John Smith</creator>
                          <date>3-3-2006</date>
                          <format>jpeg</format>
                          <language>English</language>
                          <publisher>none</publisher>
                          <rights>unspecified</rights>
                          <source>personal album</source>
                          <type>none</type>
                           <mimeType>image/jpeg</mimeType>
                          <size>615466</size>
<thumbnail>http://localhost:8180/alfresco/guestDownload/direct/workspace/HST/1cfc95eb-eedd-11db-acd7-85ce9f1fbf15/thumbnail</thumbnail>
<medium>http://localhost:8180/alfresco/guestDownload/direct/workspace/HST/1d03c1df-eedd-11db-acd7-85ce9f1fbf15/medium</medium>
<large>http://localhost:8180/alfresco/guestDownload/direct/workspace/HST/1d087cd2-eedd-11db-acd7-85ce9f1fbf15/large</large>
  </item>
</status>
Sample output for url  2:
<status-list>
<status result="true">
<item>
          <libraryid>8a43ffae-f271-11db-b5bc-05f275694451</libraryid>
          <id>397f2fd8-f820-11db-9b7e-ed7f80aef056</id>
          <title>sophie.jpg</title>
          <createdBy>dongq</createdBy>
          <createDate>05-04-2007 06:12 PM</createDate>
          <modifiedBy>dongq</modifiedBy>
          <modifiedDate>05-04-2007 06:12 AM </modifiedDate>
           <mimeType>image/jpeg</mimeType>
          <size>615466</size>
          <thumbnail>http://isda-thalia-1.mit.edu:8180/alfresco/guestDownload/direct/workspace/HST/3adb3d79-f820-11db-9b7e-ed7f80aef056/thumbnail</thumbnail>
        <medium>http://isda-thalia-1.mit.edu:8180/alfresco/guestDownload/direct/workspace/HST/3ae9955d-f820-11db-9b7e-ed7f80aef056/medium</medium>
          <large>http://isda-thalia-1.mit.edu:8180/alfresco/guestDownload/direct/workspace/HST/3af0c150-f820-11db-9b7e-ed7f80aef056/large</large>
</item>
</status>
<status result="true">
<item>
          <libraryid>8a43ffae-f271-11db-b5bc-05f275694451</libraryid>
        <id>53aab64d-f820-11db-9b7e-ed7f80aef056</id>
          <title>bella.jpg</title>
          <createdBy>dongq</createdBy>
          <createDate>05-04-2007 06:12 PM </createDate>
        <modifiedBy>dongq</modifiedBy>
        <modifiedDate>05-04-2007 06:12 PM</modifiedDate>
           <mimeType>image/jpeg</mimeType>
          <size>615466</size>
          <thumbnail>http://isda-thalia-1.mit.edu:8180/alfresco/guestDownload/direct/workspace/HST/5576eadc-f820-11db-9b7e-ed7f80aef056/thumbnail</thumbnail>
        <medium>http://isda-thalia-1.mit.edu:8180/alfresco/guestDownload/direct/workspace/HST/557e15d0-f820-11db-9b7e-ed7f80aef056/medium</medium>
        <large>http://isda-thalia-1.mit.edu:8180/alfresco/guestDownload/direct/workspace/HST/558541c3-f820-11db-9b7e-ed7f80aef056/large</large>
</item>
</status>
</status-list>
Sample output  for url 3 & 4:
<status-list>
<status result="true">
</status>
<status result="true">
</status>
</status-list>

Method: DELETE

Uri:              baseuri/item/[item id]
                     Baseuri/item
Description: The first uri deletes the item identified by item id. The second uri supports bulk delete and the bulk info is passed in via xml.
Error Conditions:
If the item id is not provided in the uri, and no info is passed via xml, a status "No item provided" is returned.
If the client is guest, a status "Guest is not allowed to delete items" is returned.
     If the item does not exists, a status "Error getting item xxx: Node does not exist" is returned.
If the id does not point to an item, a status "Id xxx is not an item" is returned.
If the client does not have permission to view this item, a status "Error getting item xxxx: Access denied. You do not have the appropriate permission to perform this operation."
Input for uri 1: none
Input for uri 2:
<item-list>
<item>
<id>147b148f-f8d3-11db-9b7e-ed7f80aef056</id>
</item>
<item>
<id>c99691b6-f858-11db-9b7e-ed7f80aef056</id>
</item>
<item>
<id>b0146ae7-f858-11db-9b7e-ed7f80aef056</id>
</item>
</item-list>
Sample output for uri 1:
<status result="true">
</status>
Sample output for uri 2:
<status-list>
<status result="true">
</status>
<status result="true">
</status>
<status result="true">
</status>
</status-list>

items:

Method: GET 

Uri:             
baseuri/items/library/[library id]
baseuri/items/category/[categoryid]
baseuri/items/tag/[tag names]/[all]
Description: The first url gets all the items in the library identified by album id.
The second url gets all the items categorized by the category specified by category id.
The third url gets all the items tagged by one or more tags separated by space. If a tag itself contains spaces, use quotes.  It will return only the items owned by the users. If you want all the items visible to the users, use the "all" option.
Error Condition for url 1:
     If the uri syntax is incorrect, a status "Invalid syntax" is returned.
    If the library Id is not specified in the uri, a status "Library ID is not specified" is returned.
     If the library does not exists, a status "Error :  Node does not exist." Is returned.
If the id does not point to a library, a status "Id xxx is not a library" is returned.
Error Condition for url 2:
If the uri syntax is incorrect, a status "Invalid syntax" is returned.
    If the category Id is not specified in the uri, a status "Category ID is not specified" is returned.
     If the category does not exists, a status "Error finding category :  Node does not exist." Is returned.
If the id does not point to a category, a status "Error: Id xxx is not a category" is returned.
Error Condition for url 3:
If no tag is specified, a status "Tag is not specified" is returned.
Input: none
Sample output:
<status result="true">
<item-list>
           <item>
                           <libraryid>e876eb2a-ede6-11db-acd7-85ce9f1fbf15</libraryid>
                          <id>c33eec3a-ee95-11db-acd7-85ce9f1fbf15</id>
                          <title>cat</title>
                          <description>My Cat Sam</description>
                          <createdBy>dongq</createdBy>
                          <createDate>05-04-2007 04:12 PM</createDate>
                          <modifiedBy>state</modifiedBy>
                          <modifiedDate>05-04-2007 06:12 PM</modifiedDate>
                          <contributor>Qing Dong</contributor>
                          <format>jpge</format>
                           <mimeType>image/jpeg</mimeType>
                          <size>615466</size>
<thumbnail>http://localhost:8180/alfresco/guestDownload/direct/workspace/HST/c60a1a39-ee95-11db-acd7-85ce9f1fbf15/thumbnail</thumbnail>
<medium>http://localhost:8180/alfresco/guestDownload/direct/workspace/HST/c611462d-ee95-11db-acd7-85ce9f1fbf15/medium</medium>
<large>http://localhost:8180/alfresco/guestDownload/direct/workspace/HST/c6160120-ee95-11db-acd7-85ce9f1fbf15/large</large>
     </item>
     <item>
                     <libraryid>e876eb2a-ede6-11db-acd7-85ce9f1fbf15</libraryid>
                          <id>1c095c3c-eedd-11db-acd7-85ce9f1fbf15</id>
                          <title>flowers</title>
                          <description>Spring flowers</description>
                          <createdBy>state</createdBy>
                          <createDate>05-06-2007 06:19 PM</createDate>
                          <modifiedBy>state</modifiedBy>
                    <modifiedDate>05-06-2007 08:12 PM</modifiedDate>
                          <contributor>Jane Smith</contributor>
                          <creator>John Smith</creator>
                          <date>3-3-2006</date>
                          <format>jpeg</format>
                          <language>English</language>
                          <publisher>none</publisher>
                          <rights>unspecified</rights>
                          <source>personal album</source>
                          <type>none</type>
<mimeType>image/jpeg</mimeType>
                          <size>615466</size>
<thumbnail>http://localhost:8180/alfresco/guestDownload/direct/workspace/HST/1cfc95eb-eedd-11db-acd7-85ce9f1fbf15/thumbnail</thumbnail>
<medium>http://localhost:8180/alfresco/guestDownload/direct/workspace/HST/1d03c1df-eedd-11db-acd7-85ce9f1fbf15/medium</medium>
<large>http://localhost:8180/alfresco/guestDownload/direct/workspace/HST/1d087cd2-eedd-11db-acd7-85ce9f1fbf15/large</large>
     </item>
          <count>2</count>
</item-list>
</status>

Method: PUT

Uri:              baseuri/items
Description: searching for items given search criteria.
Error Conditions:
If the search xml input is not valid, a status of "Invalid XML input" will be returned
Input:
     Search can be performed on any Dublin core fields: description, title, contributor, coverage, creator, date, format, identifier, language, publisher, relation, rights, source, subject, type. Search can also be performed on audit field createdby and parent field libraryid. Search can also be performed on a list of categories. Search can also be performed on a list of tags. All the fields above can be combined. Search can also be performed on a keyword. If a keyword is present, it will ignore all other fields and search all fields with the keyword value. The xml can also have sort parameters_: title, create date, modify date, mime type._
Sample input 1:
<search>
<keyword>flower</keyword>
<sort>title</sort>
</search>
Sample input 2:
<search>
<title>flower</title>
<language>English</language>
<createdby>dongq</createdby>
<libraryid>0b8269e3-fa08-11db-bb62-4745336857f3</libraryid>
<category-list>
<category id="38f1c784-0254-11dc-9cde-4fc3a815cc06"/>
<category id="6f50b1da-0254-11dc-9cde-4fc3a815cc06"/>
</category-list>
<tag-list>
<tag>beach</tag>
<tag>vacation 2007</tag>
</tag-list>
<sort>create date</sort>
</search>
Sample output:
<status result="true">
<item-list>
<item>
<libraryid>031260f2-fa08-11db-bb62-4745336857f3</libraryid>
<id>21d8fa92-fff5-11db-9cde-4fc3a815cc06</id>
<title>Sophie</title>
<description>Sophie in Summer</description>
<createdBy>dongq</createdBy>
<createDate>05-11-2007 03:23 PM</createDate>
<modifiedBy>dongq</modifiedBy>
<modifiedDate>05-11-2007 03:23 PM</modifiedDate>
<mimeType>image/pjpeg</mimeType>
<size>51236</size>
<tag-list>
<tag>beach</tag>
<tag>vacation 2007</tag>
<tag>kids</tag>
</tag-list>
<contributor>Qing Dong</contributor>
<thumbnail>http://isda-thalia-1.mit.edu:8180/alfresco/guestDownload/direct/workspace/HST/22c9c341-fff5-11db-9cde-4fc3a815cc06/thumbnail</thumbnail>
<medium>http://isda-thalia-1.mit.edu:8180/alfresco/guestDownload/direct/workspace/HST/22d33925-fff5-11db-9cde-4fc3a815cc06/medium</medium>
<large>http://isda-thalia-1.mit.edu:8180/alfresco/guestDownload/direct/workspace/HST/22d7f418-fff5-11db-9cde-4fc3a815cc06/large</large>
</item>
<item>
<libraryid>031260f2-fa08-11db-bb62-4745336857f3</libraryid>
<id>2a644c56-fa08-11db-bb62-4745336857f3</id>
<title>bella</title>
<description>Bella in Summer</description>
<createdBy>dongq</createdBy>
<createDate>05-04-2007 02:24 AM</createDate>
<modifiedBy>dongq</modifiedBy>
<modifiedDate>05-14-2007 04:05 PM</modifiedDate>
<mimeType>image/pjpeg</mimeType>
<size>388546</size>
<contributor>Qing Dong</contributor>
<tag-list>
<tag>beach</tag>
<tag>vacation 2007</tag>
</tag-list>
<thumbnail>http://isda-thalia-1.mit.edu:8180/alfresco/guestDownload/direct/workspace/HST/2b46e436-fa08-11db-bb62-4745336857f3/thumbnail</thumbnail>
<medium>http://isda-thalia-1.mit.edu:8180/alfresco/guestDownload/direct/workspace/HST/2b4b9f2a-fa08-11db-bb62-4745336857f3/medium</medium>
<large>http://isda-thalia-1.mit.edu:8180/alfresco/guestDownload/direct/workspace/HST/2b57860d-fa08-11db-bb62-4745336857f3/large</large>
</item>
<item>
<libraryid>0b8269e3-fa08-11db-bb62-4745336857f3</libraryid>
<id>8db5cd0c-fda3-11db-ac65-756002f21ce0</id>
<title>kids</title>
<description>Bella, Sophie, and Mia</description>
<createdBy>dongq</createdBy>
<createDate>05-08-2007 04:34 PM</createDate>
<modifiedBy>dongq</modifiedBy>
<modifiedDate>05-14-2007 04:08 PM</modifiedDate>
<mimeType>image/pjpeg</mimeType>
<size>74213</size>
<contributor>Qing Dong</contributor>
<thumbnail>http://isda-thalia-1.mit.edu:8180/alfresco/guestDownload/direct/workspace/HST/8f5e25eb-fda3-11db-ac65-756002f21ce0/thumbnail</thumbnail>
<medium>http://isda-thalia-1.mit.edu:8180/alfresco/guestDownload/direct/workspace/HST/8f67c2df-fda3-11db-ac65-756002f21ce0/medium</medium>
<large>http://isda-thalia-1.mit.edu:8180/alfresco/guestDownload/direct/workspace/HST/8f6ec7c2-fda3-11db-ac65-756002f21ce0/large</large>
</item>
<item>
<libraryid>0b8269e3-fa08-11db-bb62-4745336857f3</libraryid>
<id>58f07e88-fa08-11db-bb62-4745336857f3</id>
<title>Kids and Cats</title>
<description>Bella, Sophie, and the cats</description>
<createdBy>dongq</createdBy>
<createDate>05-04-2007 02:26 AM</createDate>
<modifiedBy>dongq</modifiedBy>
<modifiedDate>05-14-2007 04:09 PM</modifiedDate>
<mimeType>image/pjpeg</mimeType>
<size>615466</size>
<contributor>Qing Dong</contributor>
<thumbnail>http://isda-thalia-1.mit.edu:8180/alfresco/guestDownload/direct/workspace/HST/59ce3468-fa08-11db-bb62-4745336857f3/thumbnail</thumbnail>
<medium>http://isda-thalia-1.mit.edu:8180/alfresco/guestDownload/direct/workspace/HST/59d5605c-fa08-11db-bb62-4745336857f3/medium</medium>
<large>http://isda-thalia-1.mit.edu:8180/alfresco/guestDownload/direct/workspace/HST/59d7d15f-fa08-11db-bb62-4745336857f3/large</large>
</item>
<count>4</count>
</item-list>
</status>

map:

Method: GET

Uri:              baseuri/map/[map id]
                     baseuri/map/[map id]/content
                     baseuri/map/[map id]/items
Description: The first uri retrieves information about the map identified by map id. The second uri retrieves the map content. The third uri retrieves the item info included in the collection (It will retrieve the metadata associated with items in libraries instead of in collection).
Error Conditions:
If the map id is not specified in the uri, a status of "No map Id provided" will be returned.
If the map id does not exist, a status of "Error: Node does not exist" will be returned.
If the map id does not point to a map object, a status of "Error: id xxx is not of the type collection".
If the user doesn't have rights to see this map, a status of "Error: Access Denied. You do not have the appropriate permissions to perform this operation".
Input: None
Sample output for uri 1:
<status result="true">
<displaymap>
                          <type>COLLECTION</type>
                          <id>941d92ea-fa08-11db-bb62-4745336857f3</id>
                          <title>test map</title>
                          <createdBy>dongq</createdBy>
                          <createDate>05-04-2007 03:50 PM</createDate>
                          <modifiedBy>dongq</modifiedBy>
                          <modifiedDate>>05-04-2007 03:54 PM</modifiedDate>
     </displaymap>
</status>
Sample output for uri 2:
<status result="true">
           <map>
                           <page>
                                           <item>
                                          <id>d8c8c9ee-f9f6-11db-b13f-3fb3f7e47bf8</id>
                                          <title>bella and Sam</title>
                                     </item>
                     </page>
     </map>
</status>
Sample output for uri 3: <span style="color: #990000">status result</span><span style="color: #0000ff">="</span>true<span style="color: #0000ff">"></span>
<item-list>
<item>
                          <id>33081f79-17d7-11dc-b94c-6de5bdf91ac0</id>
                          <title>bellasam4.JPG</title>
                          <createdBy>dongq</createdBy>
                          <createDate>06-11-2007 00:49 AM</createDate>
                          <modifiedBy>dongq</modifiedBy>
                          <modifiedDate>06-11-2007 00:49 AM</modifiedDate>
                          <mimeType>image/jpeg</mimeType>
                          <size>74931</size>
                          <thumbnail>http://isda-thalia-1.mit.edu:8180/alfresco/guestDownload/direct/workspace/AP/337a6958-17d7-11dc-b94c-6de5bdf91ac0/thumbnail</thumbnail>
                          <medium>http://isda-thalia-1.mit.edu:8180/alfresco/guestDownload/direct/workspace/AP/33e49ceb-17d7-11dc-b94c-6de5bdf91ac0/medium</medium>
                          <large>http://isda-thalia-1.mit.edu:8180/alfresco/guestDownload/direct/workspace/AP/344c115d-17d7-11dc-b94c-6de5bdf91ac0/large</large>
     </item>
<item>
                          <id>c19fb93c-17d7-11dc-b94c-6de5bdf91ac0</id>
                          <title>bella4.jpg</title>
                          <createdBy>dongq</createdBy>
                          <createDate>06-11-2007 00:53 AM</createDate>
                          <modifiedBy>dongq</modifiedBy>
                          <modifiedDate>06-11-2007 00:53 AM</modifiedDate>
                          <mimeType>image/jpeg</mimeType>
                          <size>388546</size>
                          <thumbnail>http://isda-thalia-1.mit.edu:8180/alfresco/guestDownload/direct/workspace/AP/c21bee2b-17d7-11dc-b94c-6de5bdf91ac0/thumbnail</thumbnail>
                          <medium>http://isda-thalia-1.mit.edu:8180/alfresco/guestDownload/direct/workspace/AP/c28de9ed-17d7-11dc-b94c-6de5bdf91ac0/medium</medium>
                          <large>http://isda-thalia-1.mit.edu:8180/alfresco/guestDownload/direct/workspace/AP/c322fe10-17d7-11dc-b94c-6de5bdf91ac0/large</large>
  </item>
          <count>2</count>
  </item-list>
  </status>

Method: POST

Uri:              baseuri/map
Description:
Creates a map. After a map is created, an authorization will be created to give the user admin rights to the map. It will return the xml text for the newly created map.
Error Conditions:
If the user is a guest, a status of "Guest is not allowed to add collections" will be returned.
If can't parse the xml input, a status of "Invalid XML input" will be returned.
If the map's type or title is not specified, a status of "Title or type is missing".
Input: the display map has the following fields: type (can be collection, slideshow, or savedsearch), title and description. The text enclosed in the <map> element (including <map>) is extracted and saved as map content. Because the map content itself is xml, it needs to be enclosed in the xml cdata block. The map content is not parse and is saved and returned as it is passed in.
 
Sample input:
<displaymap>
                          <type>COLLECTION</type> 
                          <title>test map</title> 
                           <map>
                           <![CDATA[
                                           <page>
                                           <item>
                                          <id>d8c8c9ee-f9f6-11db-b13f-3fb3f7e47bf8</id>
                                          <title>bella and Sam</title>
                                     </item>
                                     </page>
                     ]]>
                     </map>
     </displaymap>
Sample output:
<status result="true">
<displaymap>
                          <type>COLLECTION</type>
                          <id>941d92ea-fa08-11db-bb62-4745336857f3</id>
                          <title>test map</title>
                          <createdBy>dongq</createdBy>
                          <createDate>05-04-2007 03:50 PM</createDate>
                          <modifiedBy>dongq</modifiedBy>
                          <modifiedDate>05-05-2007 01:50 PM</modifiedDate>
     </displaymap>
</status>

Method: DELETE      

Uri:              baseuri/map/[map id]
Description: Deletes the map identified by map id.
Error Conditions:
If the user is a guest, a status of "Guest is not allowed to delete collections" will be returned.
If the map id is not specified in the uri, a status of "No map Id provided" will be returned.
If the map id does not exist, a status of "Error: Node does not exist" will be returned.
If the map id does not point to a map object, a status of "Error: id xxx is not of the type collection".
If the user doesn't have rights to see this map, a status of "Error: Access Denied. You do not have the appropriate permissions to perform this operation".
Sample input: None
Sample output:
<status result="true">
</status>

Method: PUT

Uri:              baseuri/map/[map id]
Description: Modifies the map identified by map id.
Error Conditions:
     If the user is a guest, a status of "Guest is not allowed to update collections" will be returned.
If the map id is not specified in the uri, a status of "No map Id provided" will be returned.
If can't parse the xml input, a status of "Invalid XML input" will be returned.
If the map's type is not specified, a status of "Map type is missing".
If the map id does not exist, a status of "Error: Node does not exist" will be returned.
If the map id does not point to a map object of the correct type, a status of "Error: id xxx is not of the type collection".
If the user doesn't have rights to see this map, a status of "Error: Access Denied. You do not have the appropriate permissions to perform this operation".
Input: the display map has the following fields: type (can be collection, slideshow, or savedsearch), id, title and description. The text enclosed in the <map> element (including <map>) is extracted and saved as map content. . Because the map content itself is xml, it needs to be enclosed in the xml cdata block. The map content is not parse and is saved and returned as it is passed in. You only need to supply the changing attributes. For example, if you are changing description, there is no need to also give us the unchanged title. However, type is always mandatory.
Sample input:
        <displaymap>
                          <type>COLLECTION</type>
                          <id>941d92ea-fa08-11db-bb62-4745336857f3</id>
                          <title>test map modified</title> 
                           <map>
                           <![CDATA[
                                           <page>
                                           <item>
                                          <id>d8c8c9ee-f9f6-11db-b13f-3fb3f7e47bf8</id>
                                          <title>bella and Sam</title>
                                     </item>
                                     </page>
                     ]]>
                     </map>
     </displaymap>
Sample output:
<status result="true" />

maps:

Method: GET

Uri:              baseuri/maps/collection
                     baseuri/maps/slideshow
                     baseuri/maps/savedsearch
                     baseuri/maps/item/[item id]
Description:
                     URI 1, 2, 3, get display maps of the corresponding type.
                     URI 4 get all the display maps that reference the specific item
Error Conditions:
     If a unknown map type is specified, a status "Unknown map type" is returned.
Input: None
Sample output for uri 1-3:
<status result="true">
<map-list>
<displaymap>
          <type>COLLECTION</type>
          <id>a7f76808-fa78-11db-bb62-4745336857f3</id>
          <title>test map 2</title>
          <createdBy>dongq</createdBy>
          <createDate>05-04-2007 3:50 PM</createDate>
        <modifiedBy>dongq</modifiedBy>
          <modifiedDate>05-04-2007 3:50 PM</modifiedDate>
<map>
           <![CDATA[
<page>
<item>
                          <id>d8c8c9ee-f9f6-11db-b13f-3fb3f7e47bf8</id>
                    <title>bella and Sam</title>
                </item>
                     </page>
 ]]>
    </map>
</displaymap>
<displaymap>
          <type>COLLECTION</type>
          <id>941d92ea-fa08-11db-bb62-4745336857f3</id>
          <title>test map 2</title>
          <createdBy>dongq</createdBy>
        <createDate>05-04-2007 02:27 AM</createDate>
          <modifiedBy>dongq</modifiedBy>
          <modifiedDate>05-04-2007 04:53 PM</modifiedDate>
 <map>
            <![CDATA[
<page>
 <item>
                    <id>d8c8c9ee-f9f6-11db-b13f-3fb3f7e47bf8</id>
                    <title>bella and Sam 2</title>
                     </item>
                     </page>
      ]]>
     </map>
</displaymap>
</map-list>
</status>
Sample output for uri 4:
<status result="true">
           <collections>
<displaymap>
                                          <type>COLLECTION</type>
                                          <id>8fd4237d-fd7f-11db-ac65-756002f21ce0</id>
                                          <title>test map 2</title>
                     </displaymap>
                           <displaymap>
                                <type>COLLECTION</type>
                                          <id>163828b2-fda2-11db-ac65-756002f21ce0</id>
                                          <title>test map 3</title>
                     </displaymap>
     </collections>
           <slideshows>
<displaymap>
                                          <type>SLIDESHOW</type>
                                          <id>df04d083-fd7f-11db-ac65-756002f21ce0</id>
                                          <title>test slideshow</title>
                     </displaymap>
     </slideshows>
</status>

user:

Method: GET

Uri:              baseuri/user/[user name]
Description: retrieves information about the user identified by the user name.
Error Conditions:
If the user name is not provided in the url, a status "No user provided" will be returned
If the client is a guest, a status "Guest is not allowed to retrieve user info" will be returned.
If the user does not exist, a status "User xxx does not exist" will be returned.
Input: none
Sample output:
<status result="true">
<user>
                    <name>dtanner</name>
                           <firstname>David</firstname>
<lastname>Tanner</lastname>
<emailaddress>dtanner@mit.edu</emailaddress>
                       <organization>MIT</organization>
                          <isAdmin>false</isAdmin>
     </user>
</status>

Method: POST

Uri:              baseuri/user
Description: Registers a user. It supports registering multiple users. After a user is registered, a user space and personal library will be created. The user will have permission to create libraries, collections, and slideshows. The user will also have write access to the public library.
Error Conditions:
     If the xml input is empty or mal-formated, a status "Invalid XML input" will be returned.
     If the user name is not provided, a status "User name is not provided" will be returned.
     If the user name is the same as the special "public" account, a status "public is a reserved user name" will be returned.
If the client is not a domain admin, a status "xxx is not authorized to register new users in domain" will be returned.
If the user already exists in the domain, a status "User xxx already exists" will be returned.
Input: user fields are name, firstname, lastname, emailaddress, organization, isAdmin. Only the name field is mandatory. Organization defaults to MIT, and isAdmin defaults to false.
Sample Input:
<user>
<name>jsmith</name>
<firstname>John</firstname>
<lastname>Smith</lastname>
<emailaddress>jsmith@mit.edu</emailaddress>
</user>
Sample output:
     <status result="true">
     </status>

Method: PUT

Uri:              baseuri/user/[user name]
Description: Modified the user identified by the user name.
Error Conditions:
If the user name is missing in the url, a status "No user provided" will return.
If the xml input is empty or mal-formated, a status "Invalid XML input" will be returned.
If the user name in the xml is different from the user name in the uri, a status "User name can not be modified" will be returned.
If the client is not a domain admin, a status "xxx is not authorized to update user information in domain" will be returned.
Input:
user fields are name, firstname, lastname, emailaddress, organization, isAdmin. Only the name field is mandatory. Organization defaults to MIT, and isAdmin defaults to false.
Sample input:
<user>
<name>jsmith</name>
<firstname>John</firstname>
<lastname>Smith</lastname>
<emailaddress>jsmith@mit.edu</emailaddress>
<isAdmin>true</isAdmin>
</user>
Sample output:
<status result="true">
</status>

Method: DELETE

Uri:              baseuri/user/[user name]
Description: Delete the user identified by the user name.
Error Conditons:
If the user name is missing in the url, a status "No user provided" will return.
If the client is not a domain admin, a status "xxx is not authorized to unregister user in domain" will be returned.
If the user does not exist, a status "Error unregistering user xxxx : user does not exist." will be returned.
Input: none
Sample output:
<status result="true>
</status>

users:

Method: GET

Uri:              baseuri/users
Description: Retrieves all the users in the domain.
Error Conditions:
If the client is a guest, a status "Guest is not allowed retrieve user info" will be returned.
Input: none
Sample output:
<status result="true">
      <user-list>
                           <user>
                                          <name>dongq</name>
                                          <organization>MIT</organization>
                                          <isAdmin>true</isAdmin>
                     </user>
                           <user>
                                <name>dtanner</name>
                                          <organization>MIT</organization>
                                          <isAdmin>false</isAdmin>
                     </user>
                           <user>
                                          <name>state</name>
                                          <organization>MIT</organization>
                                          <isAdmin>false</isAdmin>
                     </user>
<user>
                                          <name>jsmith</name>
                                          <firstname>John</firstname>
                                          <lastname>Smith</lastname>
                                          <emailaddress>jsmith@mit.edu</emailaddress>
                                          <organization>MIT</organization>
                                          <isAdmin>true</isAdmin>
                     </user>
     </user-list>
</status>

metadata:

Method: PUT

Uri:              baseuri/metadata
Description: modifies (or adds) the domain specific metadata mapping info to the domain
Error Conditions:
If the client is not a domain admin, a status of "xxx is not authorized to save mapping file" is returned.
Input: any valid xml text
Sample output:
<status result="true">
</status>

Method: GET

Uri:              baseuri/metadata
Description: retrieves the domain specific metadata mapping info for the domain
Error Conditions:
Input: none
Sample output:
<status result="true">
[any valid xml text that was saved using PUT]
</status>

info:

Method: GET

Uri:              baseuri/info

Description: retrieves the server info including information on the build and about alfresco server.

Error Conditions:

A "No server info available" status is returned if the server info can not be provided for any reason.

Input: None

Sample Output:<status result="true">
<service-info>
<build-info>
                                          <code-date>2007/06/20 23:37:23</code-date>
                                          <revision>678</revision>
                                          <build-date>2007/06/20 23:47:24</build-date>
                     </build-info>
<alfresco-info>
                                          <build>54</build>
                                          <schema>41</schema>
                                          <version>2.0.1</version>
                                          <server>isda-thalia-1.mit.edu:8180</server>
                     </alfresco-info>
     </service-info>
 </status>

  • No labels