View Javadoc
1   package com.atlassian.plugin.web.api;
2   
3   import com.atlassian.plugin.web.WebInterfaceManager;
4   
5   import java.util.Map;
6   
7   /**
8    * <p> A dynamic web interface manager extends the existing {@link com.atlassian.plugin.web.WebInterfaceManager}
9    * interface with methods to retrieve items and sections that are created by {@link
10   * com.atlassian.plugin.web.api.provider.WebItemProvider}s and {@link com.atlassian.plugin.web.api.provider.WebSectionProvider}s
11   * as well as static items and sections returned by the existing WebInterfaceManager. </p> <p> Host applications and plugins should
12   * use these methods in favour of the WebInterfaceManager to retrieve pluggable items and sections since it allows for
13   * greater flexibility when writing plugins. </p>
14   *
15   * @since v3.0.2
16   */
17  public interface DynamicWebInterfaceManager extends WebInterfaceManager {
18      /**
19       * Returns a collection of web-items for the provided section. This collection is made up of both static web-items
20       * defined in atlassian-plugin.xmls as well as dynamic items provided by {@link
21       * com.atlassian.plugin.web.api.provider.WebItemProvider}s. For static items, no conditions will be applied.
22       * <p>
23       * At a minimum, context should provide a "request" {@link javax.servlet.http.HttpServletRequest} object to aid with
24       * rendering of links including contextpath.
25       *
26       * @param section the section in which web-items should be located
27       * @param context context to render urls, tooltips etc
28       * @return a collection of web-items for the provided section
29       */
30      Iterable<WebItem> getWebItems(final String section, final Map<String, Object> context);
31  
32      /**
33       * Same as {@link #getWebItems(String, java.util.Map)} but apply conditions for static web-items using the context
34       * provided.
35       * <p>
36       * At a minimum, context should provide a "request" {@link javax.servlet.http.HttpServletRequest} object to aid with
37       * rendering of links including contextpath.
38       */
39      Iterable<WebItem> getDisplayableWebItems(final String section, final Map<String, Object> context);
40  
41      /**
42       * Returns a collection of web-sections for the provided location. This collection is made up of both static
43       * web-sections defined in atlassian-plugin.xmls as well as dynamic sections provided by {@link
44       * com.atlassian.plugin.web.api.provider.WebSectionProvider}s. For static sections, no conditions will be applied.
45       * <p>
46       * At a minimum, context should provide a "request" {@link javax.servlet.http.HttpServletRequest} object to aid with
47       * rendering of links including contextpath.
48       *
49       * @param location the location in which web-sections should be located
50       * @param context  context to render urls, tooltips etc
51       * @return a collection of web-sections for the provided section
52       */
53      Iterable<WebSection> getWebSections(final String location, final Map<String, Object> context);
54  
55      /**
56       * Same as {@link #getWebSections(String, java.util.Map)} but apply conditions for static web-sections using the
57       * context provided.
58       * <p>
59       * At a minimum, context should provide a "request" {@link javax.servlet.http.HttpServletRequest} object to aid with
60       * rendering of links including contextpath.
61       */
62      Iterable<WebSection> getDisplayableWebSections(final String location, final Map<String, Object> context);
63  }