Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-13282 Add Introspection API
  3. NXP-14114

Add RestAPI endpoint for types and schemas

    XMLWordPrintable

    Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.9.3
    • Component/s: Rest API

      Description

      Endpoints

      Export all doc types:

       /nuxeo/api/v1/config/types

      Export one doc type:

       /nuxeo/api/v1/config/types/{doctype}

      Export all doc schemas:

       /nuxeo/api/v1/config/schemas

      Export one doc schema:

       /nuxeo/api/v1/config/schemas/{schema}

      Export all facets:

       /nuxeo/api/v1/config/facets

      Export one facet:

       /nuxeo/api/v1/config/facet/{facetname}

      Question : do we want some kind of type adapter for the normal document endpoint ?

      Format

      We have different format / marshaling options when exporting a doctype.

      export all

      The idea is to export a structure that contains both the doctypes and the schemas .
      This is was was done in the nuxeo-doctypes-io.

      {
        "doctypes" : {
          "Workspace" : {
            "parent" : "Folder",
            "facets" : [ "SuperSpace", "Folderish" ],
            "schemas" : [ "file", "webcontainer", "publishing", "files", "common", "dublincore" ]
          },
          "File" : {
            "parent" : "Document",
            "facets" : [ "Downloadable", "Commentable", "Asset", "Versionable", "Publishable", "HasRelatedText" ],
            "schemas" : [ "common", "file", "dublincore", "uid", "files", "dam_common", "ip_rights", "relatedtext" ]
          },
          ...
        }   
       "schemas" : {
          "common" : {
            "@prefix" : "",
            "icon" : "string",
            "icon-expanded" : "string",
            "size" : "long"
          },
          "dublincore" : {
            "@prefix" : "dc",
            "creator" : "string",
            "source" : "string",
            "nature" : "string",
            "contributors" : "string[]",
            "created" : "date",
            "description" : "string",
            "rights" : "string",
            "subjects" : "string[]",
            "publisher" : "string",
            "valid" : "date",
            "format" : "string",
            "issued" : "date",
            "modified" : "date",
            "language" : "string",
            "coverage" : "string",
            "expired" : "date",
            "lastContributor" : "string",
            "title" : "string"
          }, 
          ...
        }
      }     
      

      This structure is handy when you want to introspect everything in one call : typically this was the initial use case for Mule connector.

      Document centred export

      For other use case, we may want to retrieve a definition from a single doc type and have evything embedded inside the same entity :

          "File" : {
            "parent" : "Document",
            "facets" : [ "Downloadable", "Commentable", "Asset", "Versionable", "Publishable", "HasRelatedText" ],
            "schemas" : {
              "common" : {
                "@prefix" : "",
                "icon" : "string",
                "icon-expanded" : "string",
                "size" : "long"
               },
             "dublincore" : {
               "@prefix" : "dc",
               "creator" : "string",
               "source" : "string",
               "nature" : "string",
               "contributors" : "string[]",
               "created" : "date",
               "description" : "string",
               "rights" : "string",
               "subjects" : "string[]",
               "publisher" : "string",
               "valid" : "date",
               "format" : "string",
               "issued" : "date",
               "modified" : "date",
               "language" : "string",
               "coverage" : "string",
               "expired" : "date",
               "lastContributor" : "string",
               "title" : "string"
              }, 
            ...
           }
          }
      

      The inline schemas could also be returned as simple urls pointing to the schema end point

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: