use of com.enonic.xp.lib.node.mapper.NodeMapper 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);
}
use of com.enonic.xp.lib.node.mapper.NodeMapper in project xp by enonic.
the class CreateNodeHandler method execute.
@Override
public Object execute() {
final ScriptValueTranslatorResult params = getParams(this.params);
final CreateNodeParams createNodeParams = new CreateNodeParamsFactory().create(params);
final Node node = this.nodeService.create(createNodeParams);
return new NodeMapper(node);
}
Aggregations