001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017: package org.apache.jetspeed.om.common.portlet;
018:
019: import java.io.Serializable;
020: import java.util.Collection;
021:
022: import org.apache.jetspeed.om.common.GenericMetadata;
023: import org.apache.jetspeed.om.common.JetspeedServiceReference;
024: import org.apache.jetspeed.om.common.UserAttribute;
025: import org.apache.jetspeed.om.common.UserAttributeRef;
026: import org.apache.pluto.om.portlet.PortletDefinition;
027: import org.apache.pluto.om.portlet.PortletDefinitionList;
028: import org.apache.pluto.om.servlet.WebApplicationDefinition;
029:
030: /**
031: * MutablePortletApplication
032: *
033: * Extends the <code>org.apache.pluto.om.portlet.PortletApplicationDefinition</code>
034: * interface adding mutator methods for those attributes that do not have them
035: * so as to make manipulating the portlet OM easier.
036: *
037: * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
038: * @author <a href="mailto:weaver@apache.org">Scott T. Weaver</a>
039: * @version $Id: MutablePortletApplication.java 545987 2007-06-11 01:46:18Z taylor $
040: *
041: */
042: public interface MutablePortletApplication extends PortletApplication,
043: Serializable {
044: public static final String PREFS_ROOT = "portlet_application";
045:
046: /**
047: * Sets the metadata from the extended jetspeed-portlet.xml
048: *
049: * @param metadata
050: */
051: public void setMetadata(GenericMetadata metadata);
052:
053: /**
054: * Associates the web application definition with this portlet application defintion.
055: *
056: * @param wad
057: */
058: void setWebApplicationDefinition(WebApplicationDefinition wad);
059:
060: /**
061: * @param name
062: */
063: void setName(String name);
064:
065: /**
066: * @param pd
067: */
068: void addPortletDefinition(PortletDefinition pd);
069:
070: /**
071: * @param portlets
072: */
073: void setPortletDefinitionList(PortletDefinitionList portlets);
074:
075: /**
076: * <p>Adds a user attribute to the user attribute set.</p>
077: * @param userAttribute The user attribute.
078: */
079: void addUserAttribute(UserAttribute userAttribute);
080:
081: /**
082: * <p>Adds a user attribute to the user attribute set.</p>
083: * @param userAttribute The user attribute.
084: */
085: void addUserAttribute(String name, String description);
086:
087: /**
088: * <p>Sets a user-attribute-ref to the collection of user attribute refs associated
089: * with this portlet application.</p>
090: */
091: void setUserAttributeRefs(Collection userAttributeRefs);
092:
093: /**
094: * <p>Adds a user attribute ref to the user attribute ref set.</p>
095: * @param userAttributeRef The user attribute ref.
096: */
097: void addUserAttributeRef(UserAttributeRef userAttributeRef);
098:
099: /**
100: * <p>Sets a user-attribute to the collection of user attributes associated
101: * with this portlet application.</p>
102: */
103: void setUserAttributes(Collection userAttributes);
104:
105: void setApplicationIdentifier(String applicationIndentifier);
106:
107: /**
108: * @param string
109: */
110: void setDescription(String string);
111:
112: /**
113: *
114: * @param version
115: */
116: void setVersion(String version);
117:
118: /**
119: * Sets the Portlet Application type.
120: * Valid values are:
121: * <p>
122: * {@link MutablePortletApplication#WEBAPP} - A standard web application, stored in the web application
123: * server's web application space.
124: * <p>
125: * {@link MutablePortletApplication#LOCAL} - A local portlet application stored within Jetspeed's web application.
126: * <p>
127: * @param type The type of portlet application.
128: */
129: void setApplicationType(int type);
130:
131: /**
132: * Marks this application as a standard web application,
133: * stored in the web application server's web application space.
134: */
135: public static final int WEBAPP = 0;
136:
137: /**
138: * Marks this application as a LOCAL portlet application,
139: * stored in Jetspeed managed portlet application space.
140: */
141: public static final int LOCAL = 1;
142:
143: /**
144: * Marks this application as a INTERNAL portlet application,
145: * stored in Jetspeed managed portlet application space.
146: */
147: public static final int INTERNAL = 2;
148:
149: /**
150: * Adds a Jetspeed component service to the collection of component services allowed for this application.
151: *
152: * @param service The component service being added.
153: */
154: void addJetspeedService(JetspeedServiceReference service);
155:
156: /**
157: * The checksum on the portlet XML from the last deployment
158: *
159: * @param checksum
160: */
161: void setChecksum(long checksum);
162:
163: /**
164: * The checksum on the portlet XML from the last deployment
165: *
166: * @return
167: */
168: long getChecksum();
169:
170: /**
171: * <p>
172: * Set the Jetspeed Security Constraint reference for this portlet application.
173: * This security constraint name references a Jetspeed-specific Security Constraint.
174: * Security Constraints are not Java Security Permissions, but a
175: * Jetspeed specific way of securing portlets, also known as PSML constraints.
176: * See the <i>page.security</i> file for examples of defining security constraint definitions.
177: * If the portlet application does not define a constraint, then no security constraints
178: * will be applied to this portlet. Security constraints for a portlet are normally
179: * checking during the render process of a portlet.
180: * </p>
181: *
182: * @param constraint The name of the Security Definition defined in
183: * the Jetspeed Security Constraints
184: */
185: void setJetspeedSecurityConstraint(String constraint);
186:
187: }
|