Example #1
0
  @Override
  public Node importNode(final ImportNodeParams params) {
    final Node importNode = params.getNode();

    return doCreate(
        CreateNodeParams.create()
            .setBinaryAttachments(params.getBinaryAttachments())
            .childOrder(importNode.getChildOrder())
            .data(importNode.data())
            .indexConfigDocument(importNode.getIndexConfigDocument())
            .insertManualStrategy(params.getInsertManualStrategy())
            .manualOrderValue(importNode.getManualOrderValue())
            .name(importNode.name().toString())
            .parent(importNode.parentPath())
            .setNodeId(importNode.id())
            .permissions(importNode.getPermissions())
            .build(),
        importNode.getTimestamp());
  }
Example #2
0
  private BinaryAttachments processBinaryAttachments(
      final VirtualFile nodeFile, final Node newNode) {
    final PropertyTree data = newNode.data();

    final ImmutableList<Property> binaryReferences =
        data.getProperties(ValueTypes.BINARY_REFERENCE);

    if (binaryReferences.isEmpty()) {
      return BinaryAttachments.empty();
    }

    final BinaryAttachments.Builder builder = BinaryAttachments.create();

    for (final Property binaryReference : binaryReferences) {
      addBinary(nodeFile, builder, binaryReference);
    }

    return builder.build();
  }