KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > portal > server > LayoutServer


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;
9
10 import org.jboss.portal.common.MediaType;
11 import org.jboss.portal.server.metadata.LayoutRegistrationMetaData;
12 import org.jboss.portal.server.theme.LayoutException;
13 import org.jboss.portal.server.theme.PortalLayout;
14 import org.jboss.portal.server.theme.PortalRenderSet;
15 import org.jboss.portal.server.theme.strategy.AbstractLayoutStrategy;
16 import org.jboss.portal.server.theme.strategy.LayoutStrategy;
17
18 /**
19  * TODO: A description of this class.
20  *
21  * @author <a HREF="mailto:mholzner@novell.com">Martin Holzner</a>.
22  * @version <tt>$Revision: 1.3 $</tt>
23  */

24 public interface LayoutServer
25 {
26    /**
27     * Add a layout.
28     *
29     * @param metaData the meta information about the layout
30     * @throws LayoutException
31     * @jmx.managed-operation
32     * @jmx.managed-parameter name="metaData"
33     * type="org.jboss.portal.server.metadata.LayoutRegistrationMetaData"
34     */

35    void addLayout(LayoutRegistrationMetaData metaData) throws LayoutException;
36
37    /**
38     * Set the default layout (on a global level).
39     *
40     * @param name the name of the layout to set as default
41     * @throws LayoutException
42     * @jmx.managed-attribute
43     */

44    void setDefaultLayout(String JavaDoc name) throws LayoutException;
45
46    /**
47     * Get the layout for the provided registration id.
48     *
49     * @param id the registration id of the layout to get
50     * @param defaultOnNull true, if the default layout (if any is defined) should be
51     * returned in case the requested layout is not found
52     * @return the requested layout , of the default layout, or null
53     * @jmx.managed-operation
54     * @jmx.managed-parameter name="id"
55     * type="org.jboss.portal.server.ServerRegistrationID"
56     * @jmx.managed-parameter name="defaultOnNull"
57     * type="boolean"
58     */

59    PortalLayout getLayout(ServerRegistrationID id, boolean defaultOnNull);
60
61    /**
62     * Get the layout for the provided name.
63     *
64     * @param name the name of the layout to request
65     * @param defaultOnNull true, if the default layout (if any is defined) should be
66     * returned in case the requested layout is not found
67     * @return the requested layout , of the default layout, or null
68     * @jmx.managed-operation
69     * @jmx.managed-parameter name="name"
70     * type="java.lang.String"
71     * @jmx.managed-parameter name="defaultOnNull"
72     * type="boolean"
73     */

74    PortalLayout getLayout(String JavaDoc name, boolean defaultOnNull);
75
76    /**
77     * Remove all layouts that are hosted in the provided application.
78     *
79     * @param appName the name of the application that hosts the layout(s) to be removed
80     * @throws LayoutException
81     * @jmx.managed-operation
82     * @jmx.managed-parameter name="appName"
83     * type="java.lang.String"
84     */

85    void removeLayouts(String JavaDoc appName) throws LayoutException;
86
87    /**
88     * @param strategy
89     * @jmx.managed-operation
90     * @jmx.managed-parameter name="strategy"
91     * type="org.jboss.portal.server.theme.strategy.AbstractLayoutStrategy"
92     */

93    void addStrategy(AbstractLayoutStrategy strategy);
94
95    /**
96     * Get the layout strategy that was defined for the provided layout.
97     * <p>In the layout descriptor (portal-layouts.xml) a strategy can be defined to be used in conjunction with every
98     * layout that is defined in this file. The layout must be defined per media type. The portal provides a default implementation
99     * on a strategy which can be accessed by passing null as the layout.</p>
100     *
101     * @param layout the layout to get the strategy for (or null for the default layout strategy)
102     * @param mediaType the media type (content type ; mime type) of the strategy
103     * @return an implementation of a LayoutStrategy or null if no strategy was found
104     * @jmx.managed-operation
105     * @jmx.managed-parameter name="layout"
106     * type="org.jboss.portal.server.theme.PortalLayout"
107     * @jmx.managed-parameter name="mediaType"
108     * type="org.jboss.portal.common.MediaType"
109     */

110    public LayoutStrategy getStrategy(PortalLayout layout, MediaType mediaType);
111
112    /**
113     * @param strategyName
114     * @param mediaType
115     * @return
116     * @jmx.managed-operation
117     * @jmx.managed-parameter name="strategyName"
118     * type="java.lang.String"
119     * @jmx.managed-parameter name="mediaType"
120     * type="org.jboss.portal.common.MediaType"
121     */

122    public LayoutStrategy getStrategy(String JavaDoc strategyName, MediaType mediaType);
123
124    /**
125     * Remove all strategies that are hosted in the provided application.
126     *
127     * @param appName the name of the application that hosts the strategie(s) to be removed
128     * @throws LayoutException
129     * @jmx.managed-operation
130     * @jmx.managed-parameter name="appName"
131     * type="java.lang.String"
132     */

133    void removeStrategies(String JavaDoc appName) throws LayoutException;
134
135    /**
136     * @param renderSet
137     * @jmx.managed-operation
138     * @jmx.managed-parameter name="renderSet"
139     * type="org.jboss.portal.server.theme.PortalRenderSet"
140     */

141    void addRenderSet(PortalRenderSet renderSet);
142
143    /**
144     * Get the render set for the provided layout.
145     *
146     * @param layout
147     * @param mediaType
148     * @return
149     * @jmx.managed-operation
150     * @jmx.managed-parameter name="layout"
151     * type="org.jboss.portal.server.theme.PortalLayout"
152     * @jmx.managed-parameter name="mediaType"
153     * type="org.jboss.portal.common.MediaType"
154     */

155    PortalRenderSet getRenderSet(PortalLayout layout, MediaType mediaType);
156
157    /**
158     * Get the render set for the provided layout.
159     *
160     * @param renderSetName
161     * @param mediaType
162     * @return
163     * @jmx.managed-operation
164     * @jmx.managed-parameter name="renderSetName"
165     * type="java.lang.String"
166     * @jmx.managed-parameter name="mediaType"
167     * type="org.jboss.portal.common.MediaType"
168     */

169    PortalRenderSet getRenderSet(String JavaDoc renderSetName, MediaType mediaType);
170
171    /**
172     * Remove all rendersets that are hosted in the provided application.
173     *
174     * @param appName the name of the application that hosts the render set(s) to be removed
175     * @throws LayoutException
176     * @jmx.managed-operation
177     * @jmx.managed-parameter name="appName"
178     * type="java.lang.String"
179     */

180    void removeRenderSets(String JavaDoc appName) throws LayoutException;
181 }
182
Popular Tags