use of org.kie.workbench.common.services.refactoring.model.index.terms.valueterms.ValueModuleNameIndexTerm in project kie-wb-common by kiegroup.
the class RefactoringQueryServiceImpl method convertToRefactoringPageRequest.
private RefactoringPageRequest convertToRefactoringPageRequest(QueryOperationRequest refOpRequest) {
RefactoringPageRequest request = new RefactoringPageRequest(FindAllChangeImpactQuery.NAME, new HashSet<>(), refOpRequest.getStartRowIndex(), refOpRequest.getPageSize());
request.getQueryTerms().addAll(refOpRequest.getQueryTerms());
// add project info
String projectName = refOpRequest.getModuleName();
if (projectName != null && projectName != QueryOperationRequest.ALL) {
ValueModuleNameIndexTerm valueIndexTerm = new ValueModuleNameIndexTerm(projectName);
Set<ValueIndexTerm> queryTerms = new HashSet<ValueIndexTerm>(1);
queryTerms.add(valueIndexTerm);
request.getQueryTerms().addAll(queryTerms);
}
String projectRootPathURI = refOpRequest.getModuleRootPathURI();
if (projectRootPathURI != null && projectRootPathURI != QueryOperationRequest.ALL) {
ValueModuleRootPathIndexTerm valueIndexTerm = new ValueModuleRootPathIndexTerm(projectRootPathURI);
Set<ValueIndexTerm> queryTerms = new HashSet<ValueIndexTerm>(1);
queryTerms.add(valueIndexTerm);
request.getQueryTerms().addAll(queryTerms);
}
String branchName = refOpRequest.getBranchName();
if (branchName != null && branchName != QueryOperationRequest.ALL) {
ValueBranchNameIndexTerm valueIndexTerm = new ValueBranchNameIndexTerm(branchName);
Set<ValueIndexTerm> queryTerms = new HashSet<ValueIndexTerm>(1);
queryTerms.add(valueIndexTerm);
request.getQueryTerms().addAll(queryTerms);
}
return request;
}
Aggregations