use of com.enonic.xp.repository.RepositoryId 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));
}
use of com.enonic.xp.repository.RepositoryId in project xp by enonic.
the class ContextImplTest method testRepositoryId.
@Test
public void testRepositoryId() {
final ContextImpl context = createContext();
assertNull(context.getRepositoryId());
final RepositoryId value = RepositoryId.from("repo-id");
context.getLocalScope().setAttribute(value);
assertSame(value, context.getRepositoryId());
}
use of com.enonic.xp.repository.RepositoryId in project xp by enonic.
the class ProjectServiceImpl method doDelete.
private boolean doDelete(final ProjectName projectName) {
final DeleteRepositoryParams params = DeleteRepositoryParams.from(projectName.getRepoId());
final RepositoryId deletedRepositoryId = this.repositoryService.deleteRepository(params);
if (!ProjectConstants.DEFAULT_PROJECT_NAME.equals(projectName)) {
DeleteProjectRolesCommand.create().securityService(securityService).projectName(projectName).build().execute();
}
return deletedRepositoryId != null;
}
use of com.enonic.xp.repository.RepositoryId in project xp by enonic.
the class AbstractDumpReader method loadCommits.
@Override
public CommitsLoadResult loadCommits(final RepositoryId repositoryId, final LineProcessor<EntryLoadResult> processor) {
final PathRef tarFile = filePaths.commitMetaPath(repositoryId);
listener.loadingCommits(repositoryId);
final CommitsLoadResult.Builder builder = CommitsLoadResult.create();
if (!exists(tarFile)) {
return builder.build();
}
final EntriesLoadResult result = doLoadEntries(processor, tarFile);
return builder.successful(result.getSuccessful()).errors(result.getErrors().stream().map(error -> LoadError.error(error.getMessage())).collect(Collectors.toList())).build();
}
use of com.enonic.xp.repository.RepositoryId in project xp by enonic.
the class AbstractDumpReader method loadBranch.
@Override
public BranchLoadResult loadBranch(final RepositoryId repositoryId, final Branch branch, final LineProcessor<EntryLoadResult> processor) {
final PathRef tarFile = filePaths.branchMetaPath(repositoryId, branch);
listener.loadingBranch(repositoryId, branch, getBranchSuccessfulCountFromMeta(repositoryId, branch));
final BranchLoadResult.Builder builder = BranchLoadResult.create(branch);
if (!exists(tarFile)) {
return builder.build();
}
final EntriesLoadResult result = doLoadEntries(processor, tarFile);
return builder.successful(result.getSuccessful()).errors(result.getErrors().stream().map(error -> LoadError.error(error.getMessage())).collect(Collectors.toList())).build();
}
Aggregations