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.util.Collection;
020:
021: import javax.portlet.PortletMode;
022: import javax.portlet.WindowState;
023:
024: import org.apache.jetspeed.om.common.GenericMetadata;
025: import org.apache.pluto.om.portlet.PortletApplicationDefinition;
026: import org.apache.pluto.om.portlet.PortletDefinition;
027:
028: /**
029: * PortletApplication
030: *
031: * Extends the <code>org.apache.pluto.om.portlet.PortletApplicationDefinition</code>
032: * interface adding methods for those attributes that do not have them
033: * so as to make manipulating the portlet OM easier.
034: *
035: * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
036: * @version $Id: PortletApplication.java 516448 2007-03-09 16:25:47Z ate $
037: */
038: public interface PortletApplication extends
039: PortletApplicationDefinition {
040: /**
041: * Returns the metadata from the extended jetspeed-portlet.xml
042: *
043: * @return Jetspeed specific metadata
044: */
045: public GenericMetadata getMetadata();
046:
047: /**
048: * Gets the name of the Portlet Application.
049: *
050: * @return Name of the application
051: */
052: String getName();
053:
054: /**
055: * @return
056: */
057: Collection getPortletDefinitions();
058:
059: /**
060: * Finds a portlet by portlet name, searching this portlet application's collection.
061: *
062: * @param name The portlet name.
063: * @return A Portlet Definition
064: */
065: PortletDefinition getPortletDefinitionByName(String name);
066:
067: /**
068: * <p>Gets the collection of user attribute refs associated
069: * with this portlet application.</p>
070: */
071: Collection getUserAttributeRefs();
072:
073: /**
074: * <p>Gets the collection of user attributes associated
075: * with this portlet application.</p>
076: */
077: Collection getUserAttributes();
078:
079: String getApplicationIdentifier();
080:
081: /**
082: * @return
083: */
084: String getDescription();
085:
086: /**
087: * Gets the Portlet Application type.
088: * Valid values are:
089: * <p>
090: * {@link MutablePortletApplication#WEBAPP} - A standard web application, stored in the web application
091: * server's web application space.
092: * <p>
093: * {@link MutablePortletApplication#LOCAL} - A local portlet application stored within Jetspeed's web application.
094: * <p>
095: * @return The type of portlet application.
096: */
097: int getApplicationType();
098:
099: /**
100: * Gets a collection of all Jetspeed Services allowed for this application.
101: *
102: * @see org.apache.jetspeed.om.common.JetspeedServiceReference
103: * @return The collection of services of type <code>JetspeedServiceReference</code>.
104: */
105: Collection getJetspeedServices();
106:
107: Collection getCustomPortletModes();
108:
109: Collection getCustomWindowStates();
110:
111: PortletMode getMappedPortletMode(PortletMode mode);
112:
113: WindowState getMappedWindowState(WindowState state);
114:
115: PortletMode getCustomPortletMode(PortletMode mode);
116:
117: WindowState getCustomWindowState(WindowState state);
118:
119: Collection getSupportedPortletModes();
120:
121: Collection getSupportedWindowStates();
122:
123: /**
124: * <p>
125: * Get the Jetspeed Security Constraint reference for this portlet application.
126: * This security constraint name references a Jetspeed-specific Security Constraint.
127: * Security Constraints are not Java Security Permissions, but a
128: * Jetspeed specific way of securing portlets, also known as PSML constraints.
129: * See the <i>page.security</i> file for examples of defining security constraint definitions.
130: * If a Jetspeed Security Constraint is not defined for a portlet, the constraint
131: * applied will then fallback to the constraint defined for the portlet application.
132: * If the portlet application does not define a constraint, then no security constraints
133: * will be applied to this portlet. Security constraints for a portlet are normally
134: * checking during the render process of a portlet.
135: * </p>
136: *
137: * @return The name of the Security Definition applied to this portlet, defined in
138: * the Jetspeed Security Constraints
139: */
140: String getJetspeedSecurityConstraint();
141:
142: /**
143: * Returns true if the portlet application is a layout application
144: * Layouts are not "general" portlets, but instead used to group together
145: * other layouts and portlet fragments
146: *
147: * @return true when this app is a Jetspeed layout application
148: */
149: boolean isLayoutApplication();
150:
151: }
|