Search in sources :

Example 1 with ImportNodeParams

use of com.enonic.xp.node.ImportNodeParams in project xp by enonic.

the class ImportContentCommand method doExecute.

private ImportContentResult doExecute() {
    final Node importNode = ImportContentFactory.create().params(params).contentDataSerializer(contentDataSerializer).build().execute();
    final ImportNodeParams importNodeParams = ImportNodeParams.create().importNode(importNode).binaryAttachments(params.getBinaryAttachments()).insertManualStrategy(params.getInsertManualStrategy()).dryRun(params.isDryRun()).importPermissions(params.isImportPermissions()).importPermissionsOnCreate(params.isImportPermissionsOnCreate()).build();
    final ImportNodeResult result = nodeService.importNode(importNodeParams);
    return ImportContentResult.create().content(translator.fromNode(result.getNode(), false)).build();
}
Also used : Node(com.enonic.xp.node.Node) ImportNodeResult(com.enonic.xp.node.ImportNodeResult) ImportNodeParams(com.enonic.xp.node.ImportNodeParams)

Example 2 with ImportNodeParams

use of com.enonic.xp.node.ImportNodeParams in project xp by enonic.

the class NodeImporter method importNode.

private ImportNodeResult importNode(final VirtualFile nodeFolder, final ProcessNodeSettings.Builder processNodeSettings, final Node serializedNode, final NodePath importNodePath) {
    final BinaryAttachments binaryAttachments = processBinaryAttachments(nodeFolder, serializedNode);
    final ProcessNodeSettings settings = processNodeSettings.build();
    final Node importNode = ImportNodeFactory.create().importNodeIds(this.importNodeIds).importPermissions(this.importPermissions).serializedNode(serializedNode).importPath(importNodePath).processNodeSettings(settings).build().execute();
    final ImportNodeParams importNodeParams = ImportNodeParams.create().importNode(importNode).binaryAttachments(binaryAttachments).insertManualStrategy(settings.getInsertManualStrategy()).dryRun(this.dryRun).importPermissions(this.importPermissions).importPermissionsOnCreate(this.importPermissions).build();
    return this.nodeService.importNode(importNodeParams);
}
Also used : BinaryAttachments(com.enonic.xp.node.BinaryAttachments) Node(com.enonic.xp.node.Node) ImportNodeParams(com.enonic.xp.node.ImportNodeParams)

Aggregations

ImportNodeParams (com.enonic.xp.node.ImportNodeParams)2 Node (com.enonic.xp.node.Node)2 BinaryAttachments (com.enonic.xp.node.BinaryAttachments)1 ImportNodeResult (com.enonic.xp.node.ImportNodeResult)1