use of jetbrains.buildServer.server.rest.data.problem.ProblemWrapper in project teamcity-rest by JetBrains.
the class InvestigationFinder method getPrefilteredItems.
@NotNull
@Override
public ItemHolder<InvestigationWrapper> getPrefilteredItems(@NotNull final Locator locator) {
final String problemDimension = locator.getSingleDimensionValue(PROBLEM_DIMENSION);
if (problemDimension != null) {
final ProblemWrapper problem = myProblemFinder.getItem(problemDimension);
return getItemHolder(problem.getInvestigations());
}
final String testDimension = locator.getSingleDimensionValue(TEST_DIMENSION);
if (testDimension != null) {
final STest test = myTestFinder.getItem(testDimension);
return getItemHolder(getInvestigationWrappers(test));
}
final String buildTypeDimension = locator.getSingleDimensionValue(BUILD_TYPE);
if (buildTypeDimension != null) {
final SBuildType buildType = myBuildTypeFinder.getBuildType(null, buildTypeDimension, false);
return getItemHolder(getInvestigationWrappersForBuildType(buildType));
}
@Nullable User user = null;
final String investigatorDimension = locator.getSingleDimensionValue(ASSIGNEE);
if (investigatorDimension != null) {
user = myUserFinder.getItem(investigatorDimension);
}
final String assignmentProjectDimension = locator.getSingleDimensionValue(ASSIGNMENT_PROJECT);
if (assignmentProjectDimension != null) {
@NotNull final SProject project = myProjectFinder.getItem(assignmentProjectDimension);
return getItemHolder(getInvestigationWrappersForProject(project, user));
}
final String affectedProjectDimension = locator.getSingleDimensionValue(AFFECTED_PROJECT);
if (affectedProjectDimension != null) {
@NotNull final SProject project = myProjectFinder.getItem(affectedProjectDimension);
return getItemHolder(getInvestigationWrappersForProjectWithSubprojects(project, user));
}
if (user != null) {
return getItemHolder(getInvestigationWrappersForProjectWithSubprojects(myProjectFinder.getRootProject(), user));
}
locator.markUnused(ASSIGNEE);
return getItemHolder(getInvestigationWrappersForProjectWithSubprojects(myProjectFinder.getRootProject(), null));
}
Aggregations