Uploaded image for project: 'Nuxeo JS Client'
  1. Nuxeo JS Client
  2. NXJS-199

Add helper function to clean up directory entries

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.18.0
    • Fix Version/s: 4.0.0
    • Component/s: Node.js

      Description

      Since v3.2 of the JS client, running the following code

      nuxeo.directory('nature')
        .fetchAll()
        .then(function(data) {
          console.log(JSON.stringify(data.entries, null, 2))
        })
      

      produces the following results

      {
        "_baseOptions": {
          "schemas": [],
          "enrichers": {},
          "fetchProperties": {},
          "translateProperties": {},
          "headers": {
            "Authorization": "Basic !!!REMOVED!!!",
            "Accept": "application/json"
          },
          "timeout": 30000,
          "httpTimeout": 30000
        },
        "_directory": {
          "_baseOptions": {
            "schemas": [],
            "enrichers": {},
            "fetchProperties": {},
            "translateProperties": {},
            "headers": {},
            "httpTimeout": 30000
          },
          "_nuxeo": {
            "_baseOptions": {
              "schemas": [],
              "enrichers": {},
              "fetchProperties": {},
              "translateProperties": {},
              "headers": {},
              "httpTimeout": 30000
            },
            "_baseURL": "http://localhost:8080/nuxeo/",
            "_restURL": "http://localhost:8080/nuxeo/api/v1/",
            "_automationURL": "http://localhost:8080/nuxeo/api/v1/automation/",
            "_auth": {
              "method": "basic",
              "username": "Administrator",
              "password": "Administrator"
            },
            "_authenticationRefreshedListeners": [],
            "connected": false,
            "_activeRequests": 0
          },
          "_directoryName": "nature",
          "_path": "directory/nature"
        },
        "properties": {
          "ordering": 10000000,
          "obsolete": 0,
          "id": "article",
          "label": "label.directories.nature.article"
        },
        "_dirtyProperties": {
          "ordering": 10000000,
          "obsolete": 0,
          "id": "article",
          "label": "label.directories.nature.article"
        },
        "entity-type": "directoryEntry",
        "directoryName": "nature",
        "id": "article"
      }
      .
      .
      .
      

      Compare of REST api v1 directory entry type from Nuxeo documentation

      // NUXEO DOC https://doc.nuxeo.com/rest-api/1/directory-entry-entity-type/
      {
        "entity-type": "directoryEntry",
        "directoryName": string,
        "id": string,
        "properties": object,
        "contextParameters": object
      }
      

      Requesting ability to remove extra parameters so that the console.log output matches the REST API Directory Entry output above.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: