Guvnor AtomPub interface

    How to use AtomPub interface:

     

    1. Access the repository based on packages: The base URL is http://host:portnumber/repository/packages

     

     

    a). Get package list:

     

    A HTTP GET request to URL http://host:portnumber/repository/packages returns a list of packages in the repository in Atom Feed format. An example looks like below:

     

    <feed xml:base="http://localhost:9080/repository/packages">

       <title type="text">Packages</title>

     

       <entry xml:base="http://localhost:9080/repository/packages">

         <title type="text">defaultPackage</title>

         <link href="http://localhost:9080/repository/packages/defaultPackage"/>

       </entry>

     

       <entry xml:base="http://localhost:9080/repository/packages">

         <title type="text">testPackage1</title>

         <link href="http://localhost:9080/repository/packages/testPackage1"/>

       </entry>

    </feed>

     

     

    This allows users to navigate from packages to a specific package using the URL link returned.

     

    b). Get a specific pacakge:

     

    A HTTP GET request to URL http://host:portnumber/repository/packages/testPackage1 returns testPackag1 in the repository in Atom Entry format. An example looks like below:

     

    <entry xml:base="http://localhost:9080/repository/packages/testPackage1">

       <title type="text">testPackage1</title>

       <id>5632cf6c-0ef5-4ccc-b7e5-293285c4ce19</id>

       <link href="http://localhost:9080/repository/packages/testPackage1"/>

       <summary type="text">desc1</summary>

       <updated>2008-10-17T08:12:42.046Z</updated>

       <content type="text">This is the actual content of testPackage1</content>

    </entry>

     

    c). Create a package:

     

    A HTTP POST request to URL http://host:portnumber/repository/packages with the data:

     

    <entry xml:base="http://localhost:9080/repository/packages">

       <title type="text">testPackage1</title>

    </entry>

     

    creates a package named testPackage1 in the repository

     

    d). Update a package:

     

    A HTTP PUT request to URL http://host:portnumber/repository/packages with the data:

     

    <entry xml:base="http://localhost:9080/repository/packages">

       <title type="text">testPackage1</title>

       <summary type="text">desc2</summary>

       <content type="text">This is the actual content of testPackage1</content>

    </entry>

     

    updates testPackage1 in the repository

     

    e). Delete a package:


    A HTTP DELETE request to URL http://host:portnumber/repository/packages/testPackage1 deletes the package testPackage1

     

    f). Get asset list under the pacakge:

     

    A HTTP GET request to URL http://host:portnumber/repository/packages/testPackage1/assets returns a list of assets under the testPackage1 in the repository in Atom feed format. An example looks like below:

     

    <feed xmlns="http://www.w3.org/2005/Atom" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:base="http://localhost:9080/repository/packages/testPackage1/assets">

       <title type="text">Packages</title>

       <entry xml:base="http://localhost:9080/repository/packages/testPackage1/assets">

         <title type="text">testAsset1</title>

         <link href="http://localhost:9080/repository/packages/packageName/asset/testAsset1" />

       </entry>

     

       <entry xml:base="http://localhost:9080/repository/packages/testPackage1/assets">

         <title type="text">testAsset2</title>

         <link href="http://localhost:9080/repository/packages/packageName/asset/testAsset2" />

       </entry>

    </feed>

     

    g). Get an asset:

     

    Again a HTTP GET request to URL http://host:portnumber/repository/packages/testPackage1/assets/testAsset1 returns the testAsset1 under the testPackage1 in the repository in Atom entry format

     

    f). History and versions:

     

    A HTTP GET request to URL http://host:portnumber/repository/packages/testPackage1/assets/myassets/versions  returns a list of versions in Atom feed format. An  example looks like below:

     

    A HTTP GET request to URL http://host:portnumber/repository/packages/{packageName}/assets/{artifactName}/versions/{versionName}  returns an asset with specified version name in Atom Entry format. An  example looks like below:

     

    g). Asset attributes/metadata:

     

    A HTTP GET request to URL http://host:portnumber/repository/packages/testPackage1/assets/{assetName}/metadatatypes  returns a list of metadata types(names) belong to the specified asert in Atom feed format. An  example looks like below:

     

    A HTTP POST request to URL http://host:portnumber/repository/packages/testPackage1/assets/{assetName}/metadatatypes

    with the data:

     

    <entry xml:base="http://localhost:9080/repository/packages/testPackage1/assets/myasset/metadatatypes">

       <title type="text">mycustomedTag</title>

    </entry>

     

    creates a metadate named mycustomedTag for myasset

     

     

    2. Access the repository based on categories:The base URL is http://host:portnumber/repository/categories

     

     

    3. The mapping between Atom Entry element and Drools PackageItem is as below:

     

    atom:title   - PackageItem.name

    atom:id      - PackageItem.UUID

    atom:updated - PackageItem.lastModified

    atom:summary - PackageItem.description

     

     

    To be defined:

    * Collections: packages?

    * Binary stuff

    * Subscribe for particular categories, statuses etc. - use the URLs

    * Paging?

    * Querying?

    * Versioning - how to get history - URL - again??

     

    * Repository standard? (see google group)