KickJava   Java API By Example, From Geeks To Geeks.

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


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.theme.PortalLayout;
11
12 import javax.servlet.http.HttpServletRequest JavaDoc;
13 import java.util.Collection JavaDoc;
14
15 /**
16  * A strategy context is a state holder for the evaluation of the layout strategy.
17  * <p>An implementation of the strategy context is passed by the strategy interceptor to the lauout strategy, in
18  * order to provide the strategy with the state of the current portal request.</p>
19  *
20  * @author <a HREF="mailto:mholzner@novell.com">Martin Holzner</a>.
21  * @version <tt>$Revision: 1.2 $</tt>
22  */

23 public interface StrategyContext
24 {
25    /**
26     * Get a list of all the portlets assigned to the requested page.
27     *
28     * @return a <code>java.util.List</code> of <code>org.jboss.portal.core.theme.strategy.PortletContext</code>
29     */

30    Collection JavaDoc getPortletList();
31
32    /**
33     * Get the targeted portlet for the current request, if any.
34     * <p>If the current request is dedicated to a particular portlet (action or render request for this portlet), make
35     * this information available.<p>
36     *
37     * @return the portlet that is currently targeted, or null if this is not a request dedicated to a particular portlet
38     */

39    PortletContext getTargetPortlet();
40
41    /**
42     * Get the layout that is currently active for the request.
43     * <p>The layout is the jsp or servlet that will handle the generation of the page's markup.</p>
44     *
45     * @return the current layout for the request
46     */

47    PortalLayout getLayout();
48
49    /**
50     * Get the name of the currently requested portal.
51     * <p>The current portal is usually implicitely requested via the requested page, which belongs to one and
52     * only one portal.</p>
53     *
54     * @return the name of the requested portal (for this request)
55     */

56    String JavaDoc getPortalName();
57
58    /**
59     * Get the name of the page that was requested
60     *
61     * @return the name of the current page
62     */

63    String JavaDoc getPageName();
64
65    /**
66     * Get the names of all the regions of the current page.
67     *
68     * @return all the regions available on the current page
69     */

70    String JavaDoc[] getRegions();
71
72    /**
73     * Create a new strategy response.
74     *
75     * @return a new strategy response
76     */

77    StrategyResponse createResponse();
78
79    /**
80     * Get a reference to the <code>javax.servlet.http.HttpServletRequest</code>
81     *
82     * @return the HttpServletRequest instance of this portal request
83     */

84    HttpServletRequest JavaDoc getHttpServletRequest();
85 }
86
Popular Tags