Search in sources :

Example 1 with RepositoryMapper

use of com.enonic.xp.lib.repo.mapper.RepositoryMapper in project xp by enonic.

the class ModifyRepositoryHandler method editRepository.

private void editRepository(EditableRepository target) {
    final ScriptValue value = this.editor.call(new RepositoryMapper(target.source));
    updateRepositoryData(target, value);
}
Also used : ScriptValue(com.enonic.xp.script.ScriptValue) RepositoryMapper(com.enonic.xp.lib.repo.mapper.RepositoryMapper)

Example 2 with RepositoryMapper

use of com.enonic.xp.lib.repo.mapper.RepositoryMapper in project xp by enonic.

the class ModifyRepositoryHandler method execute.

public RepositoryMapper execute() {
    final RepositoryId repositoryId = RepositoryId.from(id);
    final UpdateRepositoryParams updateRepositoryParams = UpdateRepositoryParams.create().repositoryId(repositoryId).editor(this::editRepository).build();
    return new RepositoryMapper(repositoryServiceSupplier.get().updateRepository(updateRepositoryParams));
}
Also used : RepositoryMapper(com.enonic.xp.lib.repo.mapper.RepositoryMapper) UpdateRepositoryParams(com.enonic.xp.repository.UpdateRepositoryParams) RepositoryId(com.enonic.xp.repository.RepositoryId)

Example 3 with RepositoryMapper

use of com.enonic.xp.lib.repo.mapper.RepositoryMapper 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);
}
Also used : CreateRepositoryParams(com.enonic.xp.repository.CreateRepositoryParams) Repository(com.enonic.xp.repository.Repository) RepositoryMapper(com.enonic.xp.lib.repo.mapper.RepositoryMapper) RepositorySettings(com.enonic.xp.repository.RepositorySettings)

Aggregations

RepositoryMapper (com.enonic.xp.lib.repo.mapper.RepositoryMapper)3 CreateRepositoryParams (com.enonic.xp.repository.CreateRepositoryParams)1 Repository (com.enonic.xp.repository.Repository)1 RepositoryId (com.enonic.xp.repository.RepositoryId)1 RepositorySettings (com.enonic.xp.repository.RepositorySettings)1 UpdateRepositoryParams (com.enonic.xp.repository.UpdateRepositoryParams)1 ScriptValue (com.enonic.xp.script.ScriptValue)1