Search in sources :

Example 1 with RepoPath

use of com.enonic.xp.impl.server.rest.model.RepoPath in project xp by enonic.

the class ImportRunnableTask method run.

@Override
public void run(final TaskId id, final ProgressReporter progressReporter) {
    final RepoPath targetRepoPath = params.getTargetRepoPath();
    final NodeImportResult result = getContext(params.getTargetRepoPath()).callWith(() -> {
        final ImportNodesParams.Builder builder = ImportNodesParams.create().exportName(params.getExportName()).targetNodePath(targetRepoPath.getNodePath()).dryRun(params.isDryRun()).includeNodeIds(params.isImportWithIds()).includePermissions(params.isImportWithPermissions()).xsltFileName(emptyToNull(params.getXslSource())).xsltParams(params.getXslParams()).nodeImportListener(new ImportListenerImpl(progressReporter));
        return this.exportService.importNodes(builder.build());
    });
    if (targetIsSystemRepo(targetRepoPath)) {
        initializeStoredRepositories();
    }
    progressReporter.info(NodeImportResultJson.from(result).toString());
}
Also used : RepoPath(com.enonic.xp.impl.server.rest.model.RepoPath) ImportNodesParams(com.enonic.xp.export.ImportNodesParams) ImportListenerImpl(com.enonic.xp.impl.server.rest.task.listener.ImportListenerImpl) NodeImportResult(com.enonic.xp.export.NodeImportResult)

Aggregations

ImportNodesParams (com.enonic.xp.export.ImportNodesParams)1 NodeImportResult (com.enonic.xp.export.NodeImportResult)1 RepoPath (com.enonic.xp.impl.server.rest.model.RepoPath)1 ImportListenerImpl (com.enonic.xp.impl.server.rest.task.listener.ImportListenerImpl)1