1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.jetspeed.portal;
18
19 import org.apache.jetspeed.util.MimeType;
20 import org.apache.turbine.util.RunData;
21 import org.apache.ecs.ConcreteElement;
22 import java.util.Map;
23 import java.io.Serializable;
24
25 /***
26 * A PortletController is responsible for laying out and rendering the content of
27 * a PortletSet.
28 * <p>As such, it also provides 2 additionnal services :
29 * <ul>
30 * <li>factory for the creating appropriate PortletSet;Constraints
31 * <li>customization facilities for handling the addition of a new portlet
32 * within the set and moving entries around within the set
33 * </ul>
34 *
35 * @author <a href="mailto:raphael@apache.org">Raphaël Luta</a>
36 * @author <a href="mailto:burton@apache.org">Kevin A. Burton</a>
37 * @version $Id: PortletController.java,v 1.54 2004/02/23 04:05:35 jford Exp $
38 */
39 public interface PortletController extends Serializable
40 {
41
42 /***
43 * Initialize this PortletController. This method must be called after
44 * the Config object has been set and whenever it is changed
45 */
46 public void init();
47
48 /***
49 * Sets the configuration object for this controller instance
50 *
51 * @param conf the controller configuration
52 */
53 public void setConfig(PortletControllerConfig conf);
54
55 /***
56 * Returns the configuration object for this object
57 *
58 * @return a configuration object
59 */
60 public PortletControllerConfig getConfig();
61
62 /***
63 * Sets the PotletSet to render by this controller
64 *
65 * @param portlets the portlet set to render
66 */
67 public void setPortlets(PortletSet portlets);
68
69 /***
70 * Returns the PortletSet to render by this controller
71 *
72 * @return the portlet set that should currently be rendered by this
73 * controller
74 */
75 public PortletSet getPortlets();
76
77 /***
78 * Renders the content of the PortletSet for the current request
79 *
80 * @param rundata the RunData for the request
81 * @return the rendered content for this set or null if the content
82 * was written directly on the writer available in RunData
83 */
84 public ConcreteElement getContent( RunData rundata );
85
86 /***
87 * Tests whether the controller supports outputting content for
88 * a specific mime type
89 *
90 * @param mimeType the requested mime type
91 * @return true if the requested mime type is supported by this controller
92 */
93 public boolean supportsType( MimeType mimeType );
94
95 /***
96 * Creates a constraint object based on an original source.
97 *
98 * @param original the source for this constraint object
99 * @return a new Constraints object appropriate for this controller
100 */
101 public PortletSet.Constraints getConstraints( Map original );
102
103 }