1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.jetspeed.om.common.portlet;
18
19 import java.io.Serializable;
20 import java.util.Collection;
21 import java.util.Locale;
22
23 import org.apache.jetspeed.om.common.GenericMetadata;
24 import org.apache.jetspeed.om.common.ParameterComposite;
25 import org.apache.jetspeed.om.common.preference.PreferenceComposite;
26 import org.apache.pluto.om.common.DescriptionSet;
27 import org.apache.pluto.om.common.DisplayName;
28 import org.apache.pluto.om.common.DisplayNameSet;
29 import org.apache.pluto.om.common.Language;
30 import org.apache.pluto.om.common.LanguageSet;
31 import org.apache.pluto.om.common.ParameterSet;
32 import org.apache.pluto.om.common.Preference;
33 import org.apache.pluto.om.common.PreferenceSet;
34 import org.apache.pluto.om.common.SecurityRoleRef;
35 import org.apache.pluto.om.common.SecurityRoleRefSet;
36 import org.apache.pluto.om.portlet.ContentType;
37 import org.apache.pluto.om.portlet.ContentTypeSet;
38 import org.apache.pluto.om.portlet.PortletApplicationDefinition;
39 import org.apache.pluto.om.portlet.PortletDefinition;
40 import org.apache.pluto.om.portlet.PortletDefinitionCtrl;
41
42 /***
43 *
44 * PortletDefinitionComposite
45 *
46 * @author <a href="mailto:weaver@apache.org">Scott T. Weaver</a>
47 * @version $Id: PortletDefinitionComposite.java 516448 2007-03-09 16:25:47Z ate $
48 *
49 */
50 public interface PortletDefinitionComposite extends PortletDefinition, PortletDefinitionCtrl, Serializable
51 {
52 public static final String PORTLETS_PREFS_ROOT = "portlets";
53
54 GenericMetadata getMetadata();
55
56 void setMetadata(GenericMetadata metadata);
57
58 void addLanguage(Language lang);
59
60 void addLanguage(String title, String shortTitle, String keywords, Locale locale);
61
62 void addContentType(ContentType cType);
63
64 void addContentType(String contentType, Collection modes);
65
66 void setLanguageSet(LanguageSet languages);
67
68 String getResourceBundle();
69
70 Collection getSupportedLocales();
71
72 /***
73 * The PreferenceSet is a collection user-defineable preferences
74 * that this portlet can use to process its logic.
75 *
76 * @param preferences
77 */
78 void setPreferenceSet(PreferenceSet preferences);
79
80 void setInitParameterSet(ParameterSet parameters);
81
82 void setContentTypeSet(ContentTypeSet contentTypes);
83
84 void setInitSecurityRoleRefSet(SecurityRoleRefSet securityRefs);
85
86 /***
87 * Convenience method for directly adding init parameters
88 * to this <code>PortletDefinition.</code>. This has the
89 * same affect as
90 * <code>((ParameterSetCtrl)PortletDefinition.getInitParamaterSet()).add()</code>
91 * @param name Name of parameter to set
92 * @param value new value of said parameter
93 * @return ParameterComposite newly created parameter
94 */
95 ParameterComposite addInitParameter(String name, String value);
96
97 /***
98 * Same as <code>setInitParameter(name, title) plus allows a
99 * description to inlcuded.
100 * @see org.apache.jetspeed.om.common.portlet.PortletApplicationComposite#addInitParameter(java.lang.String, java.lang.String)
101 * @param name Name of parameter to set
102 * @param value new value of the parameter
103 * @param DescriptionSet containing locale-specific descriptions of the parameter
104 * @return ParameterComposite newly created parameter
105 */
106 ParameterComposite addInitParameter(String name, String value, DescriptionSet description);
107
108 /***
109 * Same as <code>setInitParameter(name, title) plus allows you
110 * to define one initial localized desription.
111 *
112 * @see org.apache.jetspeed.om.common.portlet.PortletApplicationComposite#addInitParameter(java.lang.String, java.lang.String)
113 * @param name Name of parameter to set
114 * @param value new value of the parameter
115 * @param description A description for this parameter
116 * @param locale The locale the description
117 * @return ParameterComposite newly created parameter
118 */
119 ParameterComposite addInitParameter(String name, String value, String description, Locale locale);
120
121 /***
122 * Setter for setting expiration cache time for this portlet
123 */
124 void setExpirationCache(String cache);
125
126 void setPortletApplicationDefinition(PortletApplicationDefinition pad);
127
128 PreferenceComposite addPreference(String name, String[] values);
129
130 void addPreference(Preference preference);
131
132 void setPortletIdentifier(String portletIndentifier);
133
134 String getPortletIdentifier();
135
136 /***
137 * A portlet's unique name is a string formed by the combination of a portlet's
138 * unique within it's parent application plus the parent application's
139 * unique name within the portlet container using ":" as a delimiter.
140 * <br/>
141 * <strong>FORMAT: </strong> <i>application name</i>:<i>portlet name</i>
142 * <br/>
143 * <strong>EXAMPLE: </strong> com.myapp.portletApp1:weather-portlet
144 *
145
146 * @return Name that uniquely indetifies this portlet within the container. If
147 * either the name of the portlet is <code>null</code> or this portlet has not
148 * yet been assigned to an portlet application, <code>null</code> is returned.
149 */
150 String getUniqueName();
151
152 /***
153 * Returns localized text of this PortletDefinitions display name.
154 *
155 * @param locale Locale to get the display name for
156 * @return Localized text string of the display name or <code>null</code>
157 * if no DisplayName exists for this locale
158 */
159 String getDisplayNameText(Locale locale);
160
161 /***
162 * Returns localized text of this PortletDefinitions description.
163 *
164 * @param locale Locale to get the description for
165 * @return Localized text string of the display name or <code>null</code>
166 * if no Description exists for this locale
167 */
168 String getDescriptionText(Locale locale);
169
170 void addDescription(Locale locale, String description);
171
172 DescriptionSet getDescriptionSet();
173
174 void addDisplayName(Locale locale, String displayName);
175
176 /***
177 *
178 * <p>
179 * addDisplayName
180 * </p>
181 *
182 * @param displayName
183 *
184 */
185 void addDisplayName(DisplayName displayName);
186
187 DisplayNameSet getDisplayNameSet();
188
189 String getPreferenceValidatorClassname();
190
191 void setPreferenceValidatorClassname(String classname);
192
193 /***
194 *
195 * <p>
196 * addSecurityRoleRef
197 * </p>
198 *
199 * Adds the <code>securityRef</code> to the existing
200 * set of SecurityRoleRefs of this PortletDefinition
201 *
202 * @param securityRef SecurityRoleRef to add.
203 *
204 */
205 void addSecurityRoleRef(SecurityRoleRef securityRef);
206
207 SecurityRoleRef addSecurityRoleRef(String roleName, String roleLink);
208
209 /***
210 * <p>
211 * Get the Jetspeed Security Constraint reference for this portlet.
212 * This security constraint name references a Jetspeed-specific Security Constraint.
213 * Security Constraints are not Java Security Permissions, but a
214 * Jetspeed specific way of securing portlets, also known as PSML constraints.
215 * See the <i>page.security</i> file for examples of defining security constraint definitions.
216 * If a Jetspeed Security Constraint is not defined for a portlet, the constraint
217 * applied will then fallback to the constraint defined for the portlet application.
218 * If the portlet application does not define a constraint, then no security constraints
219 * will be applied to this portlet. Security constraints for a portlet are normally
220 * checking during the render process of a portlet.
221 * </p>
222 *
223 * @return The name of the Security Definition applied to this portlet, defined in
224 * the Jetspeed Security Constraints
225 */
226 String getJetspeedSecurityConstraint();
227
228 /***
229 * <p>
230 * Set the Jetspeed Security Constraint reference for this portlet.
231 * This security constraint name references a Jetspeed-specific Security Constraint.
232 * Security Constraints are not Java Security Permissions, but a
233 * Jetspeed specific way of securing portlets, also known as PSML constraints.
234 * See the <i>page.security</i> file for examples of defining security constraint definitions.
235 * If the portlet application does not define a constraint, then no security constraints
236 * will be applied to this portlet. Security constraints for a portlet are normally
237 * checking during the render process of a portlet.
238 * </p>
239 *
240 * @param constraint The name of the Security Definition defined in
241 * the Jetspeed Security Constraints
242 */
243 void setJetspeedSecurityConstraint(String constraint);
244 }