1 | /* |
2 | * Copyright 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 | package org.apache.pluto.driver.services.container; |
17 | |
18 | import javax.servlet.http.HttpServletRequest; |
19 | |
20 | import org.apache.pluto.PortletWindow; |
21 | import org.apache.pluto.driver.AttributeKeys; |
22 | import org.apache.pluto.driver.core.ResourceURLProviderImpl; |
23 | import org.apache.pluto.spi.PortalCallbackService; |
24 | import org.apache.pluto.spi.PortletURLProvider; |
25 | import org.apache.pluto.spi.ResourceURLProvider; |
26 | |
27 | import java.util.Map; |
28 | import java.util.Collections; |
29 | |
30 | /** |
31 | * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a> |
32 | * @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a> |
33 | * @version 1.0 |
34 | * @since Sep 22, 2004 |
35 | */ |
36 | public class PortalCallbackServiceImpl implements PortalCallbackService { |
37 | |
38 | // Constructor ------------------------------------------------------------- |
39 | |
40 | /** |
41 | * Default no-arg constructor. |
42 | */ |
43 | public PortalCallbackServiceImpl() { |
44 | // Do nothing. |
45 | } |
46 | |
47 | |
48 | // PortalCallbackService Impl ---------------------------------------------- |
49 | |
50 | /** |
51 | * Method invoked by the container when the portlet sets its title. This |
52 | * method binds the dynamic portlet title to the servlet request for later |
53 | * use. |
54 | */ |
55 | public void setTitle(HttpServletRequest request, |
56 | PortletWindow portletWindow, |
57 | String title) { |
58 | request.setAttribute(AttributeKeys.PORTLET_TITLE, title); |
59 | } |
60 | |
61 | public PortletURLProvider getPortletURLProvider( |
62 | HttpServletRequest request, |
63 | PortletWindow portletWindow) { |
64 | return new PortletURLProviderImpl(request, portletWindow); |
65 | } |
66 | |
67 | public ResourceURLProvider getResourceURLProvider( |
68 | HttpServletRequest request, |
69 | PortletWindow portletWindow) { |
70 | return new ResourceURLProviderImpl(request, portletWindow); |
71 | } |
72 | |
73 | public Map getRequestProperties(HttpServletRequest request, |
74 | PortletWindow portletWindow) { |
75 | // TODO: currently this method returns an empty map. |
76 | return Collections.EMPTY_MAP; |
77 | } |
78 | |
79 | public void setResponseProperty(HttpServletRequest request, |
80 | PortletWindow portletWindow, |
81 | String property, |
82 | String value) { |
83 | // TODO: currently this method does nothing. |
84 | } |
85 | |
86 | public void addResponseProperty(HttpServletRequest request, |
87 | PortletWindow portletWindow, |
88 | String property, |
89 | String value) { |
90 | // TODO: currently this method does nothing. |
91 | } |
92 | } |
93 | |