Search in sources :

Example 31 with UpdateNodeParams

use of com.enonic.xp.node.UpdateNodeParams in project xp by enonic.

the class ModifyNodeHandler method execute.

@Override
public Object execute() {
    final Node node = getExistingNode();
    final ScriptValue updatedNodeScriptValue = applyEditor(node);
    final BinaryAttachments binaryAttachments = getBinaryAttachments(updatedNodeScriptValue);
    final UpdateNodeParams updateNodeParams = UpdateNodeParams.create().id(node.id()).editor(createEditor(updatedNodeScriptValue)).setBinaryAttachments(binaryAttachments).build();
    final Node updatedNode = this.nodeService.update(updateNodeParams);
    return new NodeMapper(updatedNode, false);
}
Also used : ScriptValue(com.enonic.xp.script.ScriptValue) BinaryAttachments(com.enonic.xp.node.BinaryAttachments) Node(com.enonic.xp.node.Node) EditableNode(com.enonic.xp.node.EditableNode) UpdateNodeParams(com.enonic.xp.node.UpdateNodeParams) NodeMapper(com.enonic.xp.lib.node.mapper.NodeMapper)

Aggregations

UpdateNodeParams (com.enonic.xp.node.UpdateNodeParams)31 Node (com.enonic.xp.node.Node)24 PropertyTree (com.enonic.xp.data.PropertyTree)13 CreateNodeParams (com.enonic.xp.node.CreateNodeParams)11 Test (org.junit.jupiter.api.Test)11 BinaryReference (com.enonic.xp.util.BinaryReference)10 NodePath (com.enonic.xp.node.NodePath)8 ByteSource (com.google.common.io.ByteSource)6 NodeIds (com.enonic.xp.node.NodeIds)4 User (com.enonic.xp.security.User)4 Assertions.assertEquals (org.junit.jupiter.api.Assertions.assertEquals)4 Assertions.assertTrue (org.junit.jupiter.api.Assertions.assertTrue)4 BeforeEach (org.junit.jupiter.api.BeforeEach)4 Content (com.enonic.xp.content.Content)3 Context (com.enonic.xp.context.Context)3 NodeBinaryReferenceException (com.enonic.xp.node.NodeBinaryReferenceException)3 NodeId (com.enonic.xp.node.NodeId)3 NodeNotFoundException (com.enonic.xp.node.NodeNotFoundException)3 PrincipalKey (com.enonic.xp.security.PrincipalKey)3 PrincipalNotFoundException (com.enonic.xp.security.PrincipalNotFoundException)3