예제 #1
0
  @Override
  public Node update(final UpdateNodeParams params) {
    final Node persistedNode = nodeIdMap.get(params.getId());
    final EditableNode editableNode = new EditableNode(persistedNode);
    params.getEditor().edit(editableNode);

    final Node editedNode = editableNode.build();
    if (editedNode.equals(persistedNode)) {
      return persistedNode;
    }

    final Node.Builder updateNodeBuilder =
        Node.create(editedNode).permissions(persistedNode.getPermissions());

    return updateNodeBuilder.build();
  }
  private Node doUpdateNode(final Node node) {
    final UpdateNodeParams updateNodeParams =
        UpdateNodeParams.create()
            .id(node.id())
            .editor(editableNode -> editableNode.manualOrderValue = 10l)
            .build();

    return UpdateNodeCommand.create()
        .params(updateNodeParams)
        .indexServiceInternal(this.indexServiceInternal)
        .binaryBlobStore(this.binaryBlobStore)
        .storageService(this.storageService)
        .searchService(this.searchService)
        .build()
        .execute();
  }