/** * Asserts that module class implements {@link com.atlassian.jira.plugin.projectpanel.ProjectTabPanel} * * @throws com.atlassian.plugin.PluginParseException if {@link com.atlassian.jira.plugin.projectpanel.ProjectTabPanel} class is not assignable from module class */ protected void assertModuleClass() throws PluginParseException { assertModuleClassImplements(ProjectTabPanel.class); }
public ModuleDescriptor createProjectTabPanelModuleDescriptor(JiraAuthenticationContext context, ModuleFactory moduleFactory) { return new ProjectTabPanelModuleDescriptor(context, moduleFactory); }
public ModuleDescriptor createProjectTabPanelModuleDescriptor(JiraAuthenticationContext context, ModuleFactory moduleFactory) { return new ProjectTabPanelModuleDescriptorImpl(context, moduleFactory); }
public String getHtml(BrowseContext ctx) { final Map<String, Object> startingParams = JiraVelocityUtils.getDefaultVelocityParams(authenticationContext); startingParams.put("i18n", authenticationContext.getI18nHelper()); startingParams.put("project", ctx.getProject()); startingParams.put("fieldVisibility", fieldVisibilityManager); return descriptor.getHtml("view", startingParams); }
public String getHtml(final BrowseContext ctx) { return descriptor.getHtml("view", createVelocityParams(ctx)); }
private List<ProjectTabPanelModuleDescriptor> getProjectTabPanels(final Project project) { final List<ProjectTabPanelModuleDescriptor> projectTabPanels = new ArrayList<ProjectTabPanelModuleDescriptor>(pluginAccessor.getEnabledModuleDescriptorsByClass(ProjectTabPanelModuleDescriptor.class)); final BrowseProjectContext ctx = new BrowseProjectContext(authenticationContext.getLoggedInUser(), project); for (final Iterator<ProjectTabPanelModuleDescriptor> iterator = projectTabPanels.iterator(); iterator.hasNext();) { final ProjectTabPanelModuleDescriptor descriptor = iterator.next(); if (!descriptor.getModule().showPanel(ctx)) { iterator.remove(); } } Collections.sort(projectTabPanels, ModuleDescriptorComparator.COMPARATOR); return projectTabPanels; }
private List<OptionData> getReportData(Project project) { final List<ProjectTabPanelModuleDescriptor> projectTabPanels = getProjectTabPanels(project); final List<OptionData> tabPanels = new ArrayList<OptionData>(projectTabPanels.size()); for (ProjectTabPanelModuleDescriptor tab : projectTabPanels) { tabPanels.add(new OptionData(tab.getLabel(), null, "/browse/" + project.getKey() + "?selectedTab=" + tab.getCompleteKey())); } return tabPanels; }
/** * Return a view consiting of an index of all labels. */ private String getAllView(BrowseContext browseContext, HttpServletRequest req, CustomField customField, Collection<CustomField> labelFields) throws Exception { setView(ALL_LABELS_VIEW); String result; Collection<String> labels = LabelUtils.getLabels(browseContext.getUser(), customField, browseContext.getProject().getId()); HashSet<String> uniqueLabels = new HashSet<String>(); uniqueLabels.addAll(labels); AlphabeticalLabelGroupingSupport alphaSupport = new AlphabeticalLabelGroupingSupport(uniqueLabels); Map<String, Object> startingParams = new HashMap<String, Object>(); startingParams.put("labelCount", uniqueLabels.size()); startingParams.put("alphaSupport", alphaSupport); startingParams.put("customField", customField); startingParams.put("labelFields", labelFields); startingParams.put("labelUtils", new LabelUtils()); startingParams.put("searchService", searchService); startingParams.put("projectId", browseContext.getProject().getId()); startingParams.put("currentView", getCurrentView(req)); result = descriptor.getHtml("view-all", startingParams); return result; }
startingParams.put("currentView", getCurrentView(req)); result = descriptor.getHtml("view", startingParams); return result;
return descriptor.getHtml("viewprojectreviews", params);