1 package com.atlassian.plugin.web;
2
3 import com.atlassian.plugin.web.descriptors.WebItemModuleDescriptor;
4 import com.atlassian.plugin.web.descriptors.WebPanelModuleDescriptor;
5 import com.atlassian.plugin.web.descriptors.WebSectionModuleDescriptor;
6 import com.atlassian.plugin.web.model.WebPanel;
7
8 import java.util.List;
9 import java.util.Map;
10
11 /**
12 * A simple manager to provide sections of the web interface through plugins.
13 */
14 public interface WebInterfaceManager
15 {
16 /**
17 * @return True if there are any sections for the given location.
18 */
19 boolean hasSectionsForLocation(String location);
20
21 /**
22 * @return A list of all WebSectionModuleDescriptors for the given location.
23 */
24 List<WebSectionModuleDescriptor> getSections(String location);
25
26 /**
27 * @return A list of all AbstractWebLinkFragmentModuleDescriptor <i>viewable in a given context</i> in the given location.
28 */
29 List<WebSectionModuleDescriptor> getDisplayableSections(String location, Map<String,Object> context);
30
31 /**
32 * @return A list of all WebItemModuleDescriptors for the given section.
33 */
34 List<WebItemModuleDescriptor> getItems(String section);
35
36 /**
37 * @return A list of all AbstractWebLinkFragmentModuleDescriptor <i>viewable in a given context</i> in the given section.
38 */
39 List<WebItemModuleDescriptor> getDisplayableItems(String section, Map<String,Object> context);
40
41 /**
42 *
43 * @param location
44 * @return A list of all {@link com.atlassian.plugin.web.model.WebPanel} module instances
45 * for the given location.
46 */
47 List<WebPanel> getWebPanels(String location);
48
49 /**
50 *
51 * @param location
52 * @param context
53 * @return A list of all {@link com.atlassian.plugin.web.model.WebPanel} module instances
54 * <i>viewable in a given context</i> in the given location.
55 */
56 List<WebPanel> getDisplayableWebPanels(String location, Map<String,Object> context);
57
58 /**
59 * @param location
60 * @return A list of all {@link com.atlassian.plugin.web.descriptors.WebPanelModuleDescriptor} module instances
61 * for the given location.
62 */
63 List<WebPanelModuleDescriptor> getWebPanelDescriptors(String location);
64
65 /**
66 * @param location
67 * @param context
68 * @return A list of all {@link com.atlassian.plugin.web.descriptors.WebPanelModuleDescriptor} module instances
69 * <i>viewable in a given context</i> in the given location.
70 */
71 List<WebPanelModuleDescriptor> getDisplayableWebPanelDescriptors(String location, Map<String, Object> context);
72
73 /**
74 * Refresh the contents of the web interface manager.
75 */
76 void refresh();
77
78 /**
79 * @return The web fragment helper for this implementation.
80 */
81 WebFragmentHelper getWebFragmentHelper();
82 }