View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    * 
9    *      http://www.apache.org/licenses/LICENSE-2.0
10   * 
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  package org.apache.jetspeed.om.common.portlet;
18  
19  import java.util.Collection;
20  
21  import javax.portlet.PortletMode;
22  import javax.portlet.WindowState;
23  
24  import org.apache.jetspeed.om.common.GenericMetadata;
25  import org.apache.pluto.om.portlet.PortletApplicationDefinition;
26  import org.apache.pluto.om.portlet.PortletDefinition;
27  
28  
29  /***
30   * PortletApplication
31   *
32   * Extends the <code>org.apache.pluto.om.portlet.PortletApplicationDefinition</code>
33   * interface adding methods for those attributes that do not have them
34   * so as to make manipulating the portlet OM easier.
35   *
36   * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
37   * @version $Id: PortletApplication.java 516448 2007-03-09 16:25:47Z ate $
38   */
39  public interface PortletApplication extends PortletApplicationDefinition
40  {
41      /***
42       * Returns the metadata from the extended jetspeed-portlet.xml
43       * 
44       * @return Jetspeed specific metadata
45       */
46      public GenericMetadata getMetadata();
47  
48      /***
49       * Gets the name of the Portlet Application.
50       * 
51       * @return Name of the application
52       */
53      String getName();
54      
55      /***
56       * @return
57       */
58      Collection getPortletDefinitions();
59  
60      /***
61       * Finds a portlet by portlet name, searching this portlet application's collection.
62       * 
63       * @param name The portlet name.
64       * @return A Portlet Definition
65       */
66      PortletDefinition getPortletDefinitionByName(String name);
67      
68      /***
69       * <p>Gets the collection of user attribute refs associated
70       * with this portlet application.</p>
71       */
72      Collection getUserAttributeRefs();
73  
74      /***
75       * <p>Gets the collection of user attributes associated
76       * with this portlet application.</p>
77       */
78      Collection getUserAttributes();
79  
80      String getApplicationIdentifier();
81  
82      /***
83       * @return
84       */
85      String getDescription();
86  
87      /***
88       * Gets the Portlet Application type.
89       * Valid values are:
90       * <p>
91       *      {@link MutablePortletApplication#WEBAPP} - A standard web application, stored in the web application
92       *               server's web application space.
93       * <p>
94       *      {@link MutablePortletApplication#LOCAL} - A local portlet application stored within Jetspeed's web application.
95       * <p>
96       * @return The type of portlet application.
97       */
98      int getApplicationType();
99      
100     /***
101      * Gets a collection of all Jetspeed Services allowed for this application.
102      * 
103      * @see org.apache.jetspeed.om.common.JetspeedServiceReference
104      * @return The collection of services of type <code>JetspeedServiceReference</code>.
105      */
106     Collection getJetspeedServices();
107     
108     Collection getCustomPortletModes();        
109     Collection getCustomWindowStates();
110     
111     PortletMode getMappedPortletMode(PortletMode mode);
112     WindowState getMappedWindowState(WindowState state);
113     PortletMode getCustomPortletMode(PortletMode mode);
114     WindowState getCustomWindowState(WindowState state);
115         
116     Collection getSupportedPortletModes();
117     Collection getSupportedWindowStates();
118     
119     /***
120      * <p>
121      * Get the Jetspeed Security Constraint reference for this portlet application.
122      * This security constraint name references a Jetspeed-specific Security Constraint.
123      * Security Constraints are not Java Security Permissions, but a 
124      * Jetspeed specific way of securing portlets, also known as PSML constraints.
125      * See the <i>page.security</i> file for examples of defining security constraint definitions.
126      * If a Jetspeed Security Constraint is not defined for a portlet, the constraint 
127      * applied will then fallback to the constraint defined for the portlet application.
128      * If the portlet application does not define a constraint, then no security constraints
129      * will be applied to this portlet. Security constraints for a portlet are normally
130      * checking during the render process of a portlet.
131      * </p>
132      * 
133      * @return The name of the Security Definition applied to this portlet, defined in 
134      *                  the Jetspeed Security Constraints 
135      */    
136     String getJetspeedSecurityConstraint();    
137     
138     /***
139      * Returns true if the portlet application is a layout application
140      * Layouts are not "general" portlets, but instead used to group together
141      * other layouts and portlet fragments
142      * 
143      * @return true when this app is a Jetspeed layout application
144      */
145     boolean isLayoutApplication();
146     
147 }