View Javadoc

1   /*
2    * Copyright 2003,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 at
7    * 
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * 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 and
14   * limitations under the License.
15   */
16  
17  package org.apache.pluto.services.property;
18  
19  import org.apache.pluto.services.ContainerService;
20  import java.util.*;
21  
22  import javax.servlet.http.HttpServletRequest;
23  import javax.servlet.http.HttpServletResponse;
24  import org.apache.pluto.om.window.PortletWindow;
25  
26  /***
27   * The <code>PropertyManagerService</code> interface is a container service
28   * providing the portlet container with external defined properties.
29   * This interface allows to associate properties with the portlet request
30   * and portlet response.
31   * <br> 
32   * This service represents an abstract layer to make the property 
33   * management independent of the portlet container and to allow
34   * diverse special implementations. 
35   * 
36   * <p>This SPI interface can be implemented by the portal.</p>
37   **/
38  public interface PropertyManagerService extends ContainerService 
39  {
40  
41      /***
42       * Sets the given property map defined by the portlet window in its response.  
43       * <br>
44       * The purpose of this method is to provide the portal framework
45       * with a new map of properties set by the portlet. The map can be empty, but not NULL
46       * <br>
47       * This method can be called multiple times during one request by the portlet container
48       * 
49       * @param window the portlet window of this property
50       * @param request the servlet request
51       * @param response the servlet response
52       * @param properties the String/String array map containing the
53       *                  properties to be set.
54       **/
55      public void setResponseProperties(PortletWindow window,
56                                        HttpServletRequest request,
57                                        HttpServletResponse response,
58                                        Map properties);
59  
60      /***
61       * Returns all properties for the given portlet window 
62       * defined in the portal as String/String array map.
63       * They will be made available to the portlet through the
64       * portlet request.
65       * <br>
66       * The purpose of this method is to allow the portal framework
67       * to create a map of properties and make it available to the portlet container.
68       * <br>
69       * This method can be called multiple times during one request by the portlet container
70       * <br>
71       * The return value cannot be null.
72       *
73       * @param window the portlet window of this property
74       * @param request the servlet request
75       * 
76       * @return		a <code>Map</code> containing
77       *                  all properties. If there are no properties of
78       *                  that name returns an empty <code>Map</code>.    
79       **/          
80      public Map getRequestProperties(PortletWindow window,
81                                      HttpServletRequest request);
82  
83  }