protected Collection<?> getAllowedValueBeans(OrderableField field, Collection<?> allowedValues) {
   if (allowedValues == null) {
     return null;
   }
   if (field instanceof IssueTypeSystemField) {
     return IssueTypeJsonBean.shortBeans((Collection<IssueType>) allowedValues, baseUrls);
   }
   if (field instanceof PrioritySystemField) {
     return PriorityJsonBean.shortBeans((Collection<Priority>) allowedValues, baseUrls);
   }
   if (field instanceof AbstractVersionsSystemField) {
     return versionBeanFactory.createVersionBeans(
         (Collection<? extends Version>) allowedValues, false);
   }
   if (field instanceof ComponentsSystemField) {
     return ComponentJsonBean.shortBeans((Collection<ProjectComponent>) allowedValues, baseUrls);
   }
   if (field instanceof ResolutionSystemField) {
     return ResolutionBean.asBeans(
         (Collection<Resolution>) allowedValues,
         contextUriInfo,
         velocityRequestContextFactory.getJiraVelocityRequestContext().getCanonicalBaseUrl());
   }
   // Fallback to just return what comes in.
   return allowedValues;
 }
 public String getViewHtml(
     final User searcher,
     final SearchContext searchContext,
     final FieldValuesHolder fieldValuesHolder,
     final Map<?, ?> displayParameters,
     final Action action) {
   Map<String, Object> velocityParams =
       getVelocityParams(
           searcher, searchContext, null, fieldValuesHolder, displayParameters, action);
   velocityParams.put(
       "selectedObjects",
       getSelectedObjects(fieldValuesHolder, new VersionLabelFunction(searcher, true)));
   velocityParams.put(
       "baseurl", velocityRequestContextFactory.getJiraVelocityRequestContext().getBaseUrl());
   return renderViewTemplate("project-constants-searcher-view.vm", velocityParams);
 }
Example #3
0
 @Nullable
 @Override
 public <I, O> O runWithStaticBaseUrl(
     @Nullable final I input, @Nonnull final Function<I, O> runnable) {
   return factory.runWithStaticBaseUrl(input, runnable);
 }
Example #4
0
 @Nonnull
 @Override
 public String getCanonicalBaseUrl() {
   return trimToEmpty(factory.getJiraVelocityRequestContext().getCanonicalBaseUrl());
 }