use of com.enonic.xp.repository.RepositorySettings in project xp by enonic.
the class RepositoryNodeTranslator method toNode.
public static Node toNode(final Repository repository) {
final PropertyTree repositoryNodeData = new PropertyTree();
toNodeData(repository.getBranches(), repositoryNodeData);
final RepositorySettings repositorySettings = repository.getSettings();
toNodeData(repositorySettings.getIndexDefinitions(), repositoryNodeData);
toNodeData(repository.getData(), repositoryNodeData);
return Node.create().id(NodeId.from(repository.getId())).childOrder(ChildOrder.defaultOrder()).data(repositoryNodeData).name(repository.getId().toString()).parentPath(RepositoryConstants.REPOSITORY_STORAGE_PARENT_PATH).permissions(SystemConstants.SYSTEM_REPO_DEFAULT_ACL).attachedBinaries(repository.getAttachments()).build();
}
use of com.enonic.xp.repository.RepositorySettings in project xp by enonic.
the class NodeRepositoryServiceImpl method create.
@Override
public void create(final CreateRepositoryParams params) {
final RepositoryId repositoryId = params.getRepositoryId();
final RepositorySettings repositorySettings = params.getRepositorySettings();
createIndex(params, IndexType.VERSION, Map.ofEntries(mergeWithDefaultMapping(repositorySettings, repositoryId, IndexType.VERSION), mergeWithDefaultMapping(repositorySettings, repositoryId, IndexType.BRANCH), mergeWithDefaultMapping(repositorySettings, repositoryId, IndexType.COMMIT)));
createIndex(params, IndexType.SEARCH, Map.ofEntries(mergeWithDefaultMapping(repositorySettings, repositoryId, IndexType.SEARCH)));
indexServiceInternal.waitForYellowStatus(resolveIndexNames(repositoryId));
}
use of com.enonic.xp.repository.RepositorySettings in project xp by enonic.
the class RepositoryNodeTranslator method toRepository.
public static Repository toRepository(final Node node) {
final PropertyTree nodeData = node.data();
final RepositorySettings repositorySettings = RepositorySettings.create().indexDefinitions(toIndexConfigs(nodeData)).build();
final PropertyTree repositoryData = toRepositoryData(nodeData);
return Repository.create().id(RepositoryId.from(node.id().toString())).branches(toBranches(nodeData)).settings(repositorySettings).data(repositoryData).attachments(node.getAttachedBinaries()).build();
}
use of com.enonic.xp.repository.RepositorySettings in project xp by enonic.
the class CreateRepositoryHandler method execute.
public RepositoryMapper execute() {
final RepositorySettings repositorySettings = RepositorySettings.create().indexDefinitions(indexDefinitions).build();
final CreateRepositoryParams createRepositoryParams = CreateRepositoryParams.create().repositoryId(repositoryId).repositorySettings(repositorySettings).rootPermissions(rootPermissions).rootChildOrder(rootChildOrder).build();
final Repository repository = repositoryServiceSupplier.get().createRepository(createRepositoryParams);
return repository == null ? null : new RepositoryMapper(repository);
}
Aggregations