1/*2 * Copyright 2000-2001,2004 The Apache Software Foundation.3 * 4 * Licensed under the Apache License, Version 2.0 (the "License");5 * you may not use this file except in compliance with the License.6 * You may obtain a copy of the License at7 * 8 * http://www.apache.org/licenses/LICENSE-2.09 * 10 * Unless required by applicable law or agreed to in writing, software11 * distributed under the License is distributed on an "AS IS" BASIS,12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.13 * See the License for the specific language governing permissions and14 * limitations under the License.15 */1617packageorg.apache.jetspeed.portal;
1819//standard java stuff20import java.util.Map;
2122//jetspeed support23import org.apache.jetspeed.capability.CapabilityMap;
24import org.apache.jetspeed.om.SecurityReference;
25import org.apache.jetspeed.util.Config;
26import org.apache.jetspeed.util.MetaData;
2728/***29Defines a configuration for Portlets. A PortletConfig provides information30about the running environment of a given Portlet.3132@author <a href="mailto:burton@apache.org">Kevin A. Burton</a>33@version $Id: PortletConfig.java,v 1.50 2004/02/23 04:05:35 jford Exp $34*/3536publicinterfacePortletConfigextendsConfig37 {
3839/***40 Init this PortletConfig providing the basic info.41 */42publicvoid init( String url, Map init_params );
4344/***45 Returns the portlet current PortletSet46 */47publicPortletSet getPortletSet();
4849/***50 Set the context (PortletSet) for this portlet51 */52publicvoid setPortletSet(PortletSet set);
5354/***55 Returns the portlet current PortletSet56 */57public Map getLayout();
5859/***60 Set the context (PortletSet) for this portlet61 */62publicvoid setLayout(Map constraints);
6364/***65 * Returns the current skin mapping. This method is used for configuration. Use66 * getPortletSkin() to find skin use by the Layout engine.67 *68 * @return Current skin mapping or null if no skin is defined in PSML.69 */70public Map getSkin();
7172/***73 * Set the context (PortletSet) for this portlet74 *75 * @deprecated use setPortletSkin instead76 */77publicvoid setSkin(Map skin);
7879/***80 Returns the portlet current PortletSet81 */82publicint getPosition();
8384/***85 Set the context (PortletSet) for this portlet86 */87publicvoid setPosition(int position);
8889/***90 Returns this Portlet's Metainfo or null it none exists. The Metainfo can91 be used to determine an optional title or description for this Portlet.92 */93publicMetaData getMetainfo();
9495/***96 Set the metainfo for the Portlet97 */98publicvoid setMetainfo(MetaData metainfo);
99100/***101 Portlets can have external configuration information other than just102 parameters. A URL can define an external configuration file or HTML file103 that this Portlet can parse out.104105 The main reason for using setURL/getURL is because the remote URL is cached106 within Jetspeed so future requests won't have any latency.107 */108public String getURL();
109110/***111 Used to define a Portlet's URL.112 */113publicvoid setURL(String url);
114115/***116 * Determines whether to use the URL as part of the unique id to the portlet cache.117 * This can be used to control the lifetime of the portlet. 118 * The URL is used in combination with the parameter names and values for this portlet119 * to uniquely identify to portlet. Parameters may also be optionally included in the cache key.120 * This value can be set in the portlet registry.121 *122 * @return true if the URL is to be part of the cache key.123 */124publicboolean isCachedOnURL();
125126/***127 * Determines whether to use the URL as part of the unique id to the portlet cache.128 * This can be used to control the lifetime of the portlet. 129 * The URL is used in combination with the parameter names and values for this portlet130 * to uniquely identify to portlet. Parameters may also be optionally included in the cache key.131 * This value can be set in the portlet registry.132 *133 * @return cached set to true if want this portlet to be cached based on the url134 */135publicvoid setCachedOnURL(boolean cached);
136137138/***139 Returns a parameter (or defaultValue) that was given to a Portlet. This can be140 by a Portlet to obtain further information of itself.141 The parameter is returned even if it is defined in the context and not directly142 in the portlet config143 */144public String getLayout(String name, String defaultValue);
145146/***147 Returns a parameter (or defaultValue) that was given to a Portlet. This can be148 by a Portlet to obtain further information of itself.149 The parameter is returned even if it is defined in the context and not directly150 in the portlet config151 */152public String getSkin(String name, String defaultValue);
153154/***155 Sets a skin parameter value in the local config156 */157publicvoid setSkin(String name, String value);
158159/***160 * Retrieves the Skin object that should be used for this portlet. If 161 * the current portlet does not have a skin, then skin is retrieve from162 * the parent portlet set of the system default is now skins are defined163 * in the portlet set.164 *165 * getSkin() can be used for configuration.166 *167 * @return the Skin object that should be used.168 */169publicPortletSkin getPortletSkin();
170171/***172 * Sets the PortletSkin to use for this Portlet173 *174 * @param skin the new skin to use175 */176publicvoid setPortletSkin(PortletSkin skin);
177178/***179 * Retrieves the constraints associated with this portlet180 *181 * @return the Constraints object182 */183public PortletSet.Constraints getConstraints();
184185/***186 * Sets the layout constraints in the current portlet set187 *188 * @param constraints the constrints object associated with this portlet189 * in the current set190 */191publicvoid setConstraints(PortletSet.Constraints constraints);
192193/***194 */195publicCapabilityMap getCapabilityMap();
196197/***198 */199publicvoid setCapabilityMap( CapabilityMap cm );
200201publicvoid setPortletId(String portletId);
202public String getPortletId();
203publicvoid setPageId(String pageId);
204public String getPageId();
205206/*** Getter for property securityRef.207 * @return Value of property securityRef.208 */209publicSecurityReference getSecurityRef();
210211/*** Setter for property securityRef.212 * @param securityRef New value of property securityRef.213 */214publicvoid setSecurityRef(SecurityReference securityRef);
215216 }