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  
18   */
19  
20  package org.apache.pluto.services.property;
21  
22  import org.apache.pluto.PortletContainerServices;
23  import java.util.*;
24  
25  import javax.servlet.http.HttpServletRequest;
26  import javax.servlet.http.HttpServletResponse;
27  import org.apache.pluto.om.window.PortletWindow;
28  
29  
30  /***
31   * The static accessor for the <CODE>PropertyManagerService</CODE>.
32   *
33   * @see   PropertyManagerService
34   **/
35  public class PropertyManager
36  {
37  
38  
39      public static void setResponseProperties(PortletWindow window,
40                                               HttpServletRequest request,
41                                               HttpServletResponse response,
42                                               Map properties)
43      {
44          if (getService() != null)
45          {
46              getService().setResponseProperties( window, request, response, properties);
47          }
48      }
49  
50      public static Map getRequestProperties(PortletWindow window,
51                                             HttpServletRequest request)
52      {
53          if (getService() == null)
54          {
55              return null;
56          }
57  
58          return getService().getRequestProperties( window, request);
59      }
60  
61      private static PropertyManagerService getService()
62      {
63          return(PropertyManagerService)PortletContainerServices.get(PropertyManagerService.class);
64      }
65  }