Operation Document.Create
Create
Description
Create a new document in the input folder. You can initialize the document properties using the 'properties' parameter. The properties are specified as key=value pairs separated by a new line. The key used for a property is the property xpath. To specify multi-line values you can use a \ charcater followed by a new line.Example:
dc:title=The Document Title. Returns the created document.
dc:description=foo bar
Usage example: creating a button that creates a new document of type Note, but copies specific fields of the currently select document.
- Fetch > Context document
- Execution context > Set context variable
- Name: DocTitle
- Value: @{Document.title} @{Document.versionLabel}
- Execution context > Set context variable
- Name: DocDescription
- Value: @{Document.description}
- Document > Get Parent
- Document > Create
- Type: Note
- Name: @{docTitle}
- Properties:
- dc:title=@{docTitle}
- dc:description=@{docDescription}
- User Interface > Refresh
- User Interface > Add Info Message
- Message: The document has been created
You can also find an example using this operation here: Add a "Create a new version of current module" button
Operation id | Document.Create |
---|---|
Category | Document |
Label | Create |
Requires | |
Since |
Parameters
Name | Description | Type | Required | Default value |
---|---|---|---|---|
type | string | yes | ||
name | string | no | ||
properties | properties | no |
Signature
Inputs | document, documents |
---|---|
Outputs | document, documents |
Implementation information
Implementation class | org.nuxeo.ecm.automation.core.operations.document.CreateDocument |
---|---|
Contributing component | BuiltIn |
JSON definition
{ "id" : "Document.Create", "label" : "Create", "category" : "Document", "requires" : null, "description" : "Create a new document in the input folder. You can initialize the document properties using the 'properties' parameter. The properties are specified as <i>key=value</i> pairs separated by a new line. The key used for a property is the property xpath. To specify multi-line values, you can use a \\ character followed by a new line. <p>Example:<pre>dc:title=The Document Title<br>dc:description=foo bar</pre>. Returns the created document.", "url" : "Document.Create", "signature" : [ "document", "document", "documents", "documents" ], "params" : [ { "name" : "type", "description" : "", "type" : "string", "required" : true, "widget" : null, "order" : 0, "values" : [ ] }, { "name" : "name", "description" : "", "type" : "string", "required" : false, "widget" : null, "order" : 0, "values" : [ ] }, { "name" : "properties", "description" : "", "type" : "properties", "required" : false, "widget" : null, "order" : 0, "values" : [ ] } ] }