示例#1
0
  public ComponentsSearcher(
      VelocityTemplatingEngine templatingEngine,
      VelocityRequestContextFactory contextFactory,
      FieldVisibilityManager fieldVisibilityManager,
      ComponentResolver componentResolver,
      ApplicationProperties applicationProperties,
      ProjectComponentManager componentManager,
      ProjectManager projectManager,
      JqlOperandResolver operandResolver,
      FieldFlagOperandRegistry fieldFlagOperandRegistry,
      PermissionManager permissionManager) {
    final SimpleFieldSearchConstantsWithEmpty searchConstants =
        SystemSearchConstants.forComponent();

    searcherInformation =
        new GenericSearcherInformation<SearchableField>(
            searchConstants.getSearcherId(),
            "common.filters.incomponents",
            Collections.<Class<? extends FieldIndexer>>singletonList(ComponentsIndexer.class),
            fieldReference,
            SearcherGroupType.PROJECT);

    searchRenderer =
        new ComponentSearchRenderer(
            applicationProperties,
            fieldVisibilityManager,
            componentManager,
            projectManager,
            searchConstants,
            searcherInformation.getNameKey(),
            templatingEngine,
            contextFactory,
            permissionManager);

    searchInputTransformer =
        new ComponentSearchInputTransformer(
            searchConstants.getJqlClauseNames(),
            searchConstants.getUrlParameter(),
            operandResolver,
            fieldFlagOperandRegistry,
            componentResolver);
  }
  public PrioritySearcher(
      FieldVisibilityManager fieldVisibilityManager,
      final ConstantsManager constantsManager,
      JqlOperandResolver operandResolver,
      VelocityRequestContextFactory velocityRequestContextFactory,
      ApplicationProperties applicationProperties,
      VelocityManager velocityManager,
      PriorityResolver priorityResolver,
      FieldFlagOperandRegistry fieldFlagOperandRegistry) {
    final IssueConstantInfoResolver<Priority> constantInfoResolver =
        new IssueConstantInfoResolver<Priority>(priorityResolver);
    final SearchContextVisibilityChecker searchContextVisibilityChecker =
        new AlwaysVisibleSearchContextVisibilityChecker();

    final SimpleFieldSearchConstants constants = SystemSearchConstants.forPriority();

    this.searchInformation =
        new GenericSearcherInformation<SearchableField>(
            constants.getSearcherId(),
            "navigator.filter.matchingpriorities",
            Collections.<Class<? extends FieldIndexer>>singletonList(PriorityIndexer.class),
            fieldReference,
            SearcherGroupType.ISSUE);
    this.searchInputTransformer =
        new IssueConstantSearchInputTransformer<Priority>(
            constants.getJqlClauseNames(),
            constantInfoResolver,
            operandResolver,
            fieldFlagOperandRegistry,
            searchContextVisibilityChecker,
            priorityResolver);
    this.searchRenderer =
        new PrioritySearchRenderer(
            searchInformation.getNameKey(),
            constantsManager,
            velocityRequestContextFactory,
            applicationProperties,
            velocityManager,
            fieldVisibilityManager);
  }