jsonContent

The Shared Platform implements a number of JSON REST Services that allows full customisation of interactions between client systems and the platform. jsonContent: Extract Read-Only Portal Content.

 Live document is here.

Description

Get one or more content items from the data portal

Filter Arguments


  • anytext

    • one or more phrases, separated by “|”

    • case insensitive

  • author

    • one or more authors, separated by “|”

    • filter on user_id not part or full name

  • creation_date

    • requires a min and max value, separated by “|”

    • dates must be international standard YYYYMMDD

    • eg. creation_date=20140616|20140925

  • depth

    • limit the level of the search

    • integer value

    • default = 0 returns folders in current context

    • value = 1 return all items in current content

    • value = -1 return all items in current and all sub folders

  • keywords

    • one or more phrases, separated by “|”

    • case sensitive

  • modification_date

    • requires a min and max value, separated by “|”

    • dates must be international standard YYYYMMDD

    • eg. creation_date=20140616|20140925

  • reporting_date

    • if object is a Stub then filter on reporting date else use modification date

    • requires a min and max value, separated by “|”

    • dates must be international standard YYYYMMDD

    • eg. reporting_date=20140616|20140925

  • state

    • one or more publication states, separated by “|”

    • eg. pending or published

  • types

    • one or more portal types, separated by “|”

    • case sensitive

    • types include: Metadata, Stub, Page, Folder, Image, File, MetadataCollection, Custodian


Return values


A list of content items as JSON objects of the form:

[
   {
       "body": "<h2>The body of the stub text goes here</h2>\r\n<p>Sub</p>",
       "leaf": true,
       "description": "A Stub used for testing purposes",
       "title": "testpage",
       "author": "Mike Metcalfe",
       "context_path": "http://test.dirisa.org/autotest/testpage",
       "children": [],
       "keywords": [
           "Jope Soap",
           "Project A",
           "Cape Town"
       ],
       "bread_crumbs": [
           {
               "path": "http://test.dirisa.org",
               "title": "Dirisa Portal",
               "id": "Plone",
               "uid": "Plone"
           },
           {
               "path": "http://test.dirisa.org/autotest",
               "title": "AutoTest",
               "id": "autotest",
               "uid": "8118e3fd5a2da0a9fc2272ef8c77dfc0"
           },
           {
               "path": "http://test.dirisa.org/autotest/testpage",
               "title": "testpage",
               "id": "testpage",
               "uid": "0bc67a75dd9bc95cd303c7adb8a15eaa"
           }
       ],
       "date": "2014/08/08",
       "review_state": "private",
       "exclude_from_nav": false,
       "type": "Document",
       "id": "testpage",
       "uid": "0bc67a75dd9bc95cd303c7adb8a15eaa"
   }
]


Notes

  • These methods were developed to extract data/content from the portal for harvesting purposes. They are not optimised for speed so searches should be directed app01 or the Plone catalog search facility.


To Do


* Make paths consistent between user and content methods. To be able to use the NoFrame skin the pull database path to the object should be available. Currently the content path is the URL and not the database path.

Refactor date parameter policy. Currently, filter is ignored if 2 parameters are not given.

* Standardise argument names wrt singular and plural like state and types?

* Extend API to return error messages

* Images inherit their review state from their parent folder hence filtering of images by review state has no effect. A workflow can be assigned to images.