Search in sources :

Example 6 with BinaryAttachments

use of com.enonic.xp.node.BinaryAttachments 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

BinaryAttachments (com.enonic.xp.node.BinaryAttachments)6 PropertyTree (com.enonic.xp.data.PropertyTree)3 Node (com.enonic.xp.node.Node)3 UpdateNodeParams (com.enonic.xp.node.UpdateNodeParams)2 ByteSource (com.google.common.io.ByteSource)2 Test (org.junit.jupiter.api.Test)2 Application (com.enonic.xp.app.Application)1 ContentInheritType (com.enonic.xp.content.ContentInheritType)1 ContentPath (com.enonic.xp.content.ContentPath)1 Property (com.enonic.xp.data.Property)1 NodeMapper (com.enonic.xp.lib.node.mapper.NodeMapper)1 AttachedBinary (com.enonic.xp.node.AttachedBinary)1 BinaryAttachment (com.enonic.xp.node.BinaryAttachment)1 EditableNode (com.enonic.xp.node.EditableNode)1 ImportNodeParams (com.enonic.xp.node.ImportNodeParams)1 ScriptValue (com.enonic.xp.script.ScriptValue)1 BinaryReference (com.enonic.xp.util.BinaryReference)1