KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > portal > server > theme > strategy > StrategyResponse


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7
8 package org.jboss.portal.server.theme.strategy;
9
10 import org.jboss.portal.server.plugins.windowstate.WindowState;
11
12 import java.util.List JavaDoc;
13 import java.util.Map JavaDoc;
14
15 /**
16  * Response of a layout strategy to communicate with the strategy interceptor.
17  * <p>The layout strategy can create a strategy response, and send it back to the strategy interceptor.
18  * The interceptor can then modify the request's state according to the desired changes expressed in the
19  * strategy response.</p>
20  *
21  * @author <a HREF="mailto:mholzner@novell.com">Martin Holzner</a>.
22  * @version <tt>$Revision: 1.3 $</tt>
23  */

24 public interface StrategyResponse
25 {
26    /**
27     * Get the URI of the layout to use.
28     * Note: this URI can only be one of the layout URIs defined in the layout of this request
29     * If the strategy does not return a URI, the strategy interceptor will test if the response contains
30     * a state, and if so, will try to get the URI for that state from the layout
31     *
32     * @return the URI of the layout to delegate to
33     * @see org.jboss.portal.server.theme.PortalLayout#getURI()
34     * @see org.jboss.portal.server.theme.PortalLayout#getURI(String)
35     * @see #getState
36     * @see #setURI
37     */

38    String JavaDoc getLayoutURI();
39
40    /**
41     * Get a map of portlets that should change their window state, with the new state in the value
42     *
43     * @return a map of portlets with changed window states (key: portlet context: value: window state)
44     * @see PortletContext
45     * @see WindowState
46     * @see #addWindowStateChange
47     */

48    Map JavaDoc getWindowStateChangeMap();
49
50    /**
51     * Get the list of portlets (portlet context) that should not be rendered by the portlet container.
52     *
53     * @return the list of portlets that should not be rendered
54     * @see PortletContext
55     * @see #addNoRender
56     */

57    List JavaDoc getExcludedList();
58
59    /**
60     * Get the list of portlet contexts that have been modified.
61     * <p>The portlet context allows to change the region and order of the portlet in that region. If the strategy alters
62     * any of those values, it must propagate the change via this list.</p>
63     *
64     * @return a <code>java.util.List</code> of <code>org.jboss.portal.core.theme.strategy.PortletContext</code>
65     * @see PortletContext
66     * @see #addModified
67     */

68    List JavaDoc getModifiedPortletContextList();
69
70    /**
71     * Add a portlet to the list of portlets that are excluded from the render process.
72     *
73     * @param portlet the portlet to exclude
74     */

75    void addNoRender(PortletContext portlet);
76
77    /**
78     * Add a portlet to the list of portlets that have been modified by the strategy.
79     * Possible changes are in region assignment, and ordering inside a region
80     *
81     * @param portlet the portlet that has been modified
82     * @see PortletContext
83     * @see #getModifiedPortletContextList
84     */

85    void addModified(PortletContext portlet);
86
87    /**
88     * Add a portlet to the list of portlets that received a new window state by the strategy.
89     *
90     * @param portlet the portlet that got the new window state
91     * @param state the new window state
92     * @see PortletContext
93     * @see WindowState
94     * @see #getWindowStateChangeMap
95     */

96    void addWindowStateChange(PortletContext portlet, WindowState state);
97
98    /**
99     * Reset all the state of this response.
100     * <p>After the reset, the response's is equal to the state after it was created</p>
101     */

102    void reset();
103
104    /**
105     * Set the layout URI to use
106     *
107     * @param layoutURI the layout URI to use
108     * @see #getLayoutURI
109     */

110    void setURI(String JavaDoc layoutURI);
111
112    /**
113     * Set the state for this strategy response.
114     * <p>The state is used to find a layout URI that is more atuned to this particular state</p>
115     *
116     * @param state the state to use when looking for a layout URI
117     * @see org.jboss.portal.server.theme.PortalLayout#getURI(String)
118     */

119    void setState(String JavaDoc state);
120
121    /**
122     * Get the state for this strategy response
123     *
124     * @return the state for this strategy response
125     * @see #setState
126     */

127    String JavaDoc getState();
128 }
129
Popular Tags