Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-21574

vocabulary entries created with Directory.CreateEntries are not visible in widgets

    XMLWordPrintable

    Details

      Description

      1. in Studio make the operation available in Customization / Settings / Registries / Automation Operations:
        {
          "operations": [
            {
              "id" : "Directory.CreateEntries",
              "label" : "Creates directory entries",
              "category" : "Services",
              "requires" : null,
              "description" : "Creates directory entries. Entries are sent as a JSON array. Returning the created entries ids as a JSON array.",
              "url" : "Directory.CreateEntries",
              "signature" : [ "void", "blob" ],
              "params" : [ {
                "name" : "directoryName",
                "description" : "",
                "type" : "string",
                "required" : true,
                "widget" : null,
                "order" : 0,
                "values" : [ ]
              },
              {
                "name" : "entries",
                "description" : "",
                "type" : "string",
                "required" : true,
                "widget" : null,
                "order" : 0,
                "values" : [ ]
              }]
            }
          ]
        }
        
      2. create a simple vocabulary named projectcodes with several values
      3. create an automation chain containing the following:
        - Context.FetchDocument
        - Directory.CreateEntries:
            directoryName: projectcodes
            entries: "[{\"id\":\"@{Document.title}\", \"label\":\"@{Document.title}\"}]"
        
      4. add a user action on any document
      5. create a custom document type and add a string field as a single vocabulary widget pointing to the projectcodes vocabulary
      6. synchronize the project on the server
      7. create a document
      8. click the user action
      9. go to Admin / Vocabularies
      10. select the projectcodes vocabulary
      11. all the initial values are present and a new one matching the recently created document too.
      12. now create another document (the one with the vocabulary widget) and expand the vocabulary field -> only the initial values are present.

      Now try the following:

      1. go to Admin / Vocabularies
      2. click new and add a new vocabulary entry
      3. try and create a new custom document
      4. notice the entry created through the Admin tab is visible whereas the one created with the operation is not.

      The admin tab is using the DirectoryUIActionsBean.getCurrentDirectoryEntries method whereas the widget is using some other code.

      Please also note that restarting the server has no effect so that is probably not cache related.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 days, 3 hours
                3d 3h