Пример #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());
  }
Пример #2
0
  private void processNodeFolder(
      final VirtualFile nodeFolder, final ProcessNodeSettings.Builder processNodeSettings) {
    try {
      final Node node = processNodeSource(nodeFolder, processNodeSettings);

      try {
        if (!node.getChildOrder().isManualOrder()) {
          importFromDirectoryLayout(nodeFolder);
        } else {
          importFromManualOrder(nodeFolder);
        }
      } catch (Exception e) {
        result.addError("Error when parsing children of " + node.path(), e);
      }

    } catch (Exception e) {
      result.addError(
          "Could not import node in folder ["
              + nodeFolder.getPath().getPath()
              + "]: "
              + e.getMessage(),
          e);
    }
  }