EMMA Coverage Report (generated Fri Sep 15 10:32:43 EDT 2006)
[all classes][org.apache.pluto.driver.services.container]

COVERAGE SUMMARY FOR SOURCE FILE [PortletURLProviderImpl.java]

nameclass, %method, %block, %line, %
PortletURLProviderImpl.java0%   (0/1)0%   (0/8)0%   (0/81)0%   (0/24)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class PortletURLProviderImpl0%   (0/1)0%   (0/8)0%   (0/81)0%   (0/24)
PortletURLProviderImpl (HttpServletRequest, PortletWindow): void 0%   (0/1)0%   (0/13)0%   (0/4)
clearParameters (): void 0%   (0/1)0%   (0/6)0%   (0/2)
setAction (boolean): void 0%   (0/1)0%   (0/13)0%   (0/5)
setParameters (Map): void 0%   (0/1)0%   (0/30)0%   (0/7)
setPortletMode (PortletMode): void 0%   (0/1)0%   (0/7)0%   (0/2)
setSecure (): void 0%   (0/1)0%   (0/1)0%   (0/1)
setWindowState (WindowState): void 0%   (0/1)0%   (0/7)0%   (0/2)
toString (): String 0%   (0/1)0%   (0/4)0%   (0/1)

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 */
16package org.apache.pluto.driver.services.container;
17 
18import java.util.Iterator;
19import java.util.Map;
20 
21import javax.portlet.PortletMode;
22import javax.portlet.WindowState;
23import javax.servlet.http.HttpServletRequest;
24 
25import org.apache.pluto.PortletWindow;
26import org.apache.pluto.driver.url.PortalURL;
27import org.apache.pluto.driver.url.PortalURLFactory;
28import org.apache.pluto.driver.url.PortalURLParameter;
29import org.apache.pluto.spi.PortletURLProvider;
30 
31/**
32 * 
33 * @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a>
34 * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>
35 */
36public class PortletURLProviderImpl implements PortletURLProvider {
37 
38    private PortalURL url;
39    private String window;
40 
41    public PortletURLProviderImpl(HttpServletRequest request,
42                                  PortletWindow internalPortletWindow) {
43        url = PortalURLFactory.getFactory().createPortalURL(request);
44        this.window = internalPortletWindow.getId().getStringId();
45    }
46 
47    public void setPortletMode(PortletMode mode) {
48        url.setPortletMode(window, mode);
49    }
50 
51    public void setWindowState(WindowState state) {
52        url.setWindowState(window, state);
53    }
54 
55    public void setAction(boolean action) {
56        if (action) {
57            url.setActionWindow(window);
58        } else {
59            url.setActionWindow(null);
60        }
61    }
62 
63    public void setSecure() {
64        //url.setSecure(true);
65    }
66 
67    public void clearParameters() {
68        url.clearParameters(window);
69    }
70 
71    public void setParameters(Map parameters) {
72        Iterator it = parameters.entrySet().iterator();
73        while (it.hasNext()) {
74            Map.Entry entry = (Map.Entry) it.next();
75            PortalURLParameter param = new PortalURLParameter(
76                            window,
77                            (String) entry.getKey(),
78                            (String[]) entry.getValue());
79            url.addParameter(param);
80        }
81    }
82 
83    public String toString() {
84        return url.toString();
85    }
86 
87}

[all classes][org.apache.pluto.driver.services.container]
EMMA 2.0.5312 (C) Vladimir Roubtsov