KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > portal > server > theme > render > RenderContext


1 /*****************************************
2  * *
3  * JBoss Portal: The OpenSource Portal *
4  * *
5  * Distributable under LGPL license. *
6  * See terms of license at gnu.org. *
7  * *
8  *****************************************/

9
10 package org.jboss.portal.server.theme.render;
11
12 import org.jboss.portal.common.MediaType;
13 import org.jboss.portal.server.PortalRequest;
14 import org.jboss.portal.server.PortalResponse;
15 import org.jboss.portal.server.theme.RegionOrientation;
16 import org.w3c.dom.Document JavaDoc;
17
18 import javax.servlet.http.HttpServletRequest JavaDoc;
19
20 /**
21  * A render context allows all pieces that create markup a way to access relevant information for the current
22  * request and render process.
23  * <p>A render context is created for each portal request and render tag. It contains all the information needed to
24  * generate the markup of one region tag for the portal response.</p>
25  *
26  * @author <a HREF="mailto:mholzner@novell.com>Martin Holzner</a>
27  * @version $LastChangedRevision$, $LastChangedDate$
28  */

29 public interface RenderContext
30 {
31    /**
32     * Get the StringBuffer that holds the markup to write back as response.
33     * <p>This is ment to be a convenient way to accumulate the markup generated by the
34     * individual processes involved in the rendering of the response. Each renderer in the render set
35     * simply appends it's markup to this buffer.</p>
36     *
37     * @return the StringBuffer that contains the generated markup
38     */

39    StringBuffer JavaDoc getMarkupFragment();
40
41    /**
42     * Get the xml dom document that holds the markup to write bach as response (perhaps after its been xsl transformed)
43     * This is for apps that rather build the result in XML (instead of a StringBuffer).
44     *
45     * @return the Document that represents the generated markup
46     * @see #getMarkupFragment()
47     */

48    Document JavaDoc getMarkupFragmentAsDom();
49
50    /**
51     * Get the media type for this render process
52     *
53     * @return the media type for this render process
54     */

55    MediaType getContentType();
56
57    /**
58     * Get the region orientation for this render process
59     *
60     * @return the region orientation for this render process
61     */

62    RegionOrientation getRegionOrientation();
63
64    /**
65     * Get the servlet request that is currently being serviced
66     *
67     * @return
68     */

69    HttpServletRequest JavaDoc getHttpServletRequest();
70
71    /**
72     * Get the portal request that is currently being serviced
73     *
74     * @return the portal request that is currently being serviced
75     */

76    PortalRequest getPortalRequest();
77
78    /**
79     * Get the portal response for the current request
80     *
81     * @return the portal response for the current request
82     */

83    PortalResponse getPortalResponse();
84
85    /**
86     * Get the implementation of the region renderer to use in this context
87     *
88     * @return a region renderer to use for this context
89     * @throws RenderException
90     */

91    RegionRenderer getRegionRenderer() throws RenderException;
92
93    /**
94     * Get the implementation of the window renderer to use in this context
95     *
96     * @return a window renderer to use for this context
97     * @throws RenderException
98     */

99    WindowRenderer getWindowRenderer() throws RenderException;
100
101    /**
102     * Get the implemetation of the decoration renderer to use in this context
103     *
104     * @return a decoration renderer to use for this context
105     * @throws RenderException
106     */

107    DecorationRenderer getDecorationRenderer() throws RenderException;
108
109    /**
110     * Get the implementation of the portlet renderer to use for this context
111     *
112     * @return a portlet renderer to use for thsi context
113     * @throws RenderException
114     */

115    PortletRenderer getPortletRenderer() throws RenderException;
116 }
117
Popular Tags