Platform Explorer / Nuxeo Platform 6.0

Operation Directory.CreateEntries

Creates directory entries

Description

Creates directory entries. Entries are sent as a JSON array. Returning the created entries ids as a JSON array.
  • 5.7.1
  • 5.7-I20130322_1136

 

The entries parameter expects a JSON array containing at least one object. Each object must define two properties, id and label. An error occurs if one is missing.

The operation returns a JSON array filled with the ids.

Importantid must be unique. If an entry in this directory already exists with the same id, an error is thrown.

The string to pass must be like this:
[{"id":"id_1", "label":"label_1"}, ..., {"id":"id_n", "label":"label_n"}]
   => returns ["id_1", ..., "id_n"] in a blob.

Example with one entry:
[{"id":"01", "label":"Cool documentation is cool"}]

Example with 3 entries:
[{"id":"01", "label":"Cool documentation is cool"}, {"id":"02", "label":"And a cool web site too"}, {"id":"03", "label":"With cool examples"}]

Of course, a MVEL expression can be used. For example:
[{"id":"@{Document["myschema:code"]}", "label":"@{Document["dc:title"]}"}]

 
Operation id Directory.CreateEntries
Category Services
Label Creates directory entries
Requires
Since

Parameters

Name Description Type Required Default value
directoryName string yes  
entries string yes  

Signature

Inputs void
Outputs blob

Implementation information

Implementation class org.nuxeo.ecm.automation.core.operations.services.directory.CreateDirectoryEntries
Contributing component org.nuxeo.ecm.core.automation.featuresContrib

JSON definition

{
  "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" : [ ]
  } ]
}