Platform Explorer / Nuxeo Platform LTS 2015 7.10

Operation DocumentMultivaluedProperty.addItem

Add entry into multi-valued metadata

Description

Add value into the field expressed by the xpath parameter. This field must be a multivalued metadata.

'checkExists' parameter enables to add value only if doesn't already exists in the field:

  • if checked, the value will not be added if it exists already in the list
  • if not checked the value will be always added.

    Remark: only works for a field that stores a list of scalars (string, boolean, date, int, long) and not list of complex types.

Operation id DocumentMultivaluedProperty.addItem
AliasesAddEntryToMultivaluedProperty
Category Document
Label Add entry into multi-valued metadata
Requires
Since

Parameters

Name Description Type Required Default value
value serializable yes  
xpath string yes  
checkExists boolean no true 
save boolean no true 

Signature

Inputs document, documents
Outputs document, documents

Implementation information

Implementation class org.nuxeo.ecm.automation.core.operations.document.AddEntryToMultiValuedProperty
Contributing component org.nuxeo.ecm.core.automation.coreContrib

JSON definition

{
  "id" : "DocumentMultivaluedProperty.addItem",
  "aliases" : [ "AddEntryToMultivaluedProperty" ],
  "label" : "Add entry into multi-valued metadata",
  "category" : "Document",
  "requires" : null,
  "description" : "Add value into the field expressed by the xpath parameter. This field must be a multivalued metadata.<p> 'checkExists' parameter enables to add value only if doesn't already exists in the field: <ul><li> if checked, the value will not be added if it exists already in the list</li><li>if not checked the value will be always added</li</ul>.<p> Remark: <b>only works for a field that stores a list of scalars (string, boolean, date, int, long) and not list of complex types.</b></p><p>Save parameter automatically saves the document in the database. It has to be turned off when this operation is used in the context of the empty document created, about to create, before document modification, document modified events.</p>",
  "url" : "DocumentMultivaluedProperty.addItem",
  "signature" : [ "document", "document", "documents", "documents" ],
  "params" : [ {
    "name" : "value",
    "description" : "",
    "type" : "serializable",
    "required" : true,
    "widget" : null,
    "order" : 0,
    "values" : [ ]
  }, {
    "name" : "xpath",
    "description" : "",
    "type" : "string",
    "required" : true,
    "widget" : null,
    "order" : 0,
    "values" : [ ]
  }, {
    "name" : "checkExists",
    "description" : "",
    "type" : "boolean",
    "required" : false,
    "widget" : null,
    "order" : 0,
    "values" : [ "true" ]
  }, {
    "name" : "save",
    "description" : "",
    "type" : "boolean",
    "required" : false,
    "widget" : null,
    "order" : 0,
    "values" : [ "true" ]
  } ],
  "widgets" : [ {
    "name" : "xpath",
    "type" : "codearea",
    "labels" : {
      "any" : "XPath"
    },
    "translated" : true,
    "handlingLabels" : false,
    "fields" : [ {
      "fieldName" : "xpath",
      "propertyName" : "xpath"
    } ],
    "properties" : {
      "any" : {
        "height" : "100%",
        "language" : "xpath",
        "width" : "100%"
      }
    }
  } ]
}