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.om.registry;
1819import java.util.Iterator;
2021/***22 * This entry describes all the properties that should be present in23 * a RegistryEntry describing a Portlet.24 * <p>Each PortletEntry must have a type, which may be:25 * <dl>26 * <dt>abstract</dt><dd>The entry description is unsuitable for instanciating27 * a Portlet</dd>28 * <dt>instance</dt><dd>This entry may be used to create a Portlet and does not29 * depend on any other portlet entries</dd>30 * <dt>ref</dt><dd>This entry may be used to instanciate Portlets but depends on31 * another PortletEntry definition whose registry name can be retrieved by getParent()32 * </dd>33 * </dl></p>34 *35 * @author <a href="mailto:raphael@apache.org">Raphaël Luta</a>36 * @version $Id: PortletEntry.java,v 1.5 2004/02/23 03:11:39 jford Exp $37 */38publicinterfacePortletEntryextendsPortletInfoEntry39 {
4041publicstaticfinal String TYPE_REF = "ref";
42publicstaticfinal String TYPE_INSTANCE = "instance";
43publicstaticfinal String TYPE_ABSTRACT = "abstract";
4445publicfinalstatic String DEFAULT_GROUP = "Jetspeed";
46publicfinalstatic String DEFAULT_CATEGORY_REF = "General";
47publicfinalstatic String DEFAULT_CATEGORY_ABSTRACT = "Abstract";
4849/*** @return the URL associated with this portlet or null */50public String getURL();
5152/***53 * Sets the URL for this PortletEntry54 * @param url the new PortletEntry URL55 */56publicvoid setURL( String url );
5758/***59 * Determines whether to use the URL as part of the unique id to the portlet cache.60 * This can be used to control the lifetime of the portlet.61 * The URL is used in combination with the parameter names and values for this portlet62 * to uniquely identify to portlet. Parameters may also be optionally included in the cache key.63 * This value can be set in the portlet registry.64 *65 * @return true if the URL is to be part of the cache key.66 */67publicboolean isCachedOnURL();
6869/***70 * Determines whether to use the URL as part of the unique id to the portlet cache.71 * This can be used to control the lifetime of the portlet.72 * The URL is used in combination with the parameter names and values for this portlet73 * to uniquely identify to portlet. Parameters may also be optionally included in the cache key.74 * This value can be set in the portlet registry.75 *76 * @return cached set to true if want this portlet to be cached based on the url77 */78publicvoid setCachedOnURL(boolean cached);
7980/***81 * Gets the URL entry record for this portlet entry82 *83 * @return ContentURL the URL entry object84 */85publicContentURL getURLEntry();
8687/***88 * helper to get an instance of a cached parameter.89 *90 * @param name The parameter name.91 * @return The cached parameter entry.92 */93publicCachedParameter getCachedParameter( String name );
9495/*** @return the entry name from which this one is derived */96public String getParent();
9798/***99 * Sets the ancestor for this PortletEntry.100 * @param parent the new ancestor entry name. This name should101 * be defined in the system registry102 */103publicvoid setParent( String parent );
104105/*** @return true is this entry is only accessible by the106 * portal administrators.107 */108publicboolean isAdmin();
109110/*** @return true is the PortletEntry is marked as an application */111publicboolean isApplication();
112113/*** Sets the application status of this portlet entry. If an entry114 * is maked as application, the associated portlet will only be displayed115 * in Maximized mode and can be retrieved specifically116 *117 * @param application the new application status118 */119publicvoid setApplication( boolean application );
120121/*** @return the type of this entry */122public String getType();
123124/*** Sets the type of this entry. The type specifies whether it is125 * abstract, instance or ref126 *127 * @param type the new type for the PortletEntry128 */129publicvoid setType( String type );
130131132/***133 * Returns a list of the categories134 *135 * @return an iterator on the categories136 */137public Iterator listCategories();
138139/***140 * Test if a given category exists for this entry141 *142 * @param name the category name143 * @return true is the category exists in the default group144 */145publicboolean hasCategory(String name);
146147/***148 * Test if a given category exists for this entry, in the specified group of categories.149 *150 * @param name the category name151 * @param group the category group152 * @return true is the category exists in the specified group153 */154publicboolean hasCategory(String name, String group);
155156/***157 * Add a new category to this portlet entry in the default group.158 *159 * @param name the category name160 */161publicvoid addCategory(String name);
162163/***164 * Add a new category to this portlet entry.165 *166 * @param name the category name167 * @param group the category group name168 */169publicvoid addCategory(String name, String group);
170171/***172 * Remove a category from this portlet entry in the default group.173 *174 * @param name the category name175 */176publicvoid removeCategory(String name);
177178/***179 * Remove a category from this portlet entry in the specified group.180 *181 * @param name the media type name to remove.182 * @param group the category group name183 */184publicvoid removeCategory(String name, String group);
185186 }
187