Search in sources :

Example 6 with RepositoryIds

use of com.enonic.xp.repository.RepositoryIds in project xp by enonic.

the class IndexResource method updateSettings.

@POST
@Path("updateSettings")
public UpdateIndexSettingsResultJson updateSettings(final UpdateIndexSettingsRequestJson request) {
    final RepositoryIds.Builder repositoryIds = RepositoryIds.create();
    if (!isNullOrEmpty(request.repositoryId)) {
        repositoryIds.add(RepositoryId.from(request.repositoryId));
    } else {
        repositoryIds.addAll(this.repositoryService.list().getIds());
    }
    final UpdateIndexSettingsResult result = this.indexService.updateIndexSettings(UpdateIndexSettingsParams.create().repositories(repositoryIds.build()).settings(request.settings.toString()).requireClosedIndex(request.requireClosedIndex).build());
    return UpdateIndexSettingsResultJson.create(result);
}
Also used : UpdateIndexSettingsResult(com.enonic.xp.index.UpdateIndexSettingsResult) RepositoryIds(com.enonic.xp.repository.RepositoryIds) Path(javax.ws.rs.Path) POST(javax.ws.rs.POST)

Aggregations

RepositoryIds (com.enonic.xp.repository.RepositoryIds)6 RepositoryId (com.enonic.xp.repository.RepositoryId)2 Path (java.nio.file.Path)2 Test (org.junit.jupiter.api.Test)2 Branch (com.enonic.xp.branch.Branch)1 Context (com.enonic.xp.context.Context)1 ContextAccessor (com.enonic.xp.context.ContextAccessor)1 ContextBuilder (com.enonic.xp.context.ContextBuilder)1 EventPublisher (com.enonic.xp.event.EventPublisher)1 UpdateIndexSettingsResult (com.enonic.xp.index.UpdateIndexSettingsResult)1 AttachedBinary (com.enonic.xp.node.AttachedBinary)1 FindNodesByParentParams (com.enonic.xp.node.FindNodesByParentParams)1 FindNodesByParentResult (com.enonic.xp.node.FindNodesByParentResult)1 Node (com.enonic.xp.node.Node)1 NodeBranchEntries (com.enonic.xp.node.NodeBranchEntries)1 NodeId (com.enonic.xp.node.NodeId)1 RefreshMode (com.enonic.xp.node.RefreshMode)1 RestoreResult (com.enonic.xp.node.RestoreResult)1 UpdateNodeParams (com.enonic.xp.node.UpdateNodeParams)1 InternalContext (com.enonic.xp.repo.impl.InternalContext)1