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;
1819import java.util.Iterator;
2021import org.apache.jetspeed.om.profile.Entry;
22import org.apache.jetspeed.om.profile.PSMLDocument;
23import org.apache.jetspeed.om.profile.Profile;
24import org.apache.jetspeed.portal.Portlet;
2526/***27 * This interface provides an easy, object-oriented approach to modifing 28 * a portlet instance's persistent attributes.29 * It provides methods for getting, setting and removing attributes from 30 * portlet instance persistence storage. 31 *32 * In a Jetspeed 1.4x PSML profile, the default XML format for an instance and attribute is:33 *34 * <entry>35 * <parameter name="someName" value="someValue"/>36 *37 * @author <a href="mailto:sweaver@rippe.com">Scott Weaver</a>38 * @author <a href="mailto:david@bluesunrise.com">David Sean Taylor</a> 39 * @version $Id: PortletInstance.java,v 1.3 2004/02/23 04:05:35 jford Exp $40 */41publicinterfacePortletInstance42 {
43/***44 * Retrieves an attributes value associated with a named object from a45 * portlet instance's persistence storage. 46 *47 * @param name The name of the attribute48 * @param defaultValue The default value if the attribute is not found.49 * @return String The attribute value, or the defaultValue if not found.50 */51 String getAttribute(String name, String defaultValue);
5253/***54 * Retrieves an attributes value associated with a named object from a55 * portlet instance's persistence storage. 56 *57 * @param name The name of the attribute58 * @return String The attribute value, or the empty string if not found.59 */60 String getAttribute(String name);
616263/***64 * Sets a portlet instance attribute into persistence storage.65 *66 * @param name The name of the attribute.67 * @param value The value of the attribute.68 */69void setAttribute(String name, String value);
7071/***72 * Removes a portlet instance attribute from persistence storage.73 *74 * @param name The name of the attribute.75 */76void removeAttribute(String name);
7778/***79 * Removes all portlet instance attributes from persistence storage.80 *81 */82void removeAllAttributes();
8384/***85 * Retrieves a list of all of the attributes of this portlet instance86 * as <code>org.apache.jetspeed.om.profile.Parameter</code> objects.87 *88 * @return java.util.Iterator89 */90 Iterator getAttributes();
9192/***93 * Retrieves a list of all attributes names for all the attributes94 * contained within this portlet instance.95 *96 * @return java.util.Iterator97 */98 Iterator getAttributeNames();
99100/***101 * Returns the PSMLDocument that contains this portlet instance.102 *103 * @return org.apache.jetspeed.om.profile.PSMLDocument104 * 105 */106PSMLDocument getDocument();
107108/***109 * Returns the Profile instance containing this portlet instance. 110 *111 * @return org.apache.jetspeed.om.profile.Profile112 */113Profile getProfile();
114115/***116 * Returns the PSML OM instance associated with this instance.117 *118 * @return org.apache.jetspeed.om.profile.Entry119 */120Entry getEntry();
121122/***123 * Returns the parent portlet of this PortletInstance.124 *125 * @return org.apache.jetspeed.portal.Portlet 126 */127Portlet getPortlet();
128129/***130 * Retrieves the name of the parent portlet as it is defined within the portlet registry.131 *132 * @return String The name of the portlet.133 */134 String getName();
135136/***137 * Retrieves the title (if it is defined) of the parent portlet as it is defined 138 * within the portlet registry.139 *140 * @return String The title of the portlet.141 */142 String getTitle();
143144/***145 * Retrieves the description (if it is defined) of the parent portlet as it 146 * is defined within the portlet registry.147 * 148 * @return String The description of the portlet.149 */150 String getDescription();
151152153 }