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

COVERAGE SUMMARY FOR SOURCE FILE [PortletTitleTag.java]

nameclass, %method, %block, %line, %
PortletTitleTag.java0%   (0/1)0%   (0/2)0%   (0/33)0%   (0/9)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class PortletTitleTag0%   (0/1)0%   (0/2)0%   (0/33)0%   (0/9)
PortletTitleTag (): void 0%   (0/1)0%   (0/3)0%   (0/1)
doStartTag (): int 0%   (0/1)0%   (0/30)0%   (0/8)

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 */
16package org.apache.pluto.driver.tags;
17 
18import java.io.IOException;
19 
20import javax.servlet.jsp.JspException;
21import javax.servlet.jsp.tagext.TagSupport;
22 
23import org.apache.pluto.driver.AttributeKeys;
24 
25/**
26 * The portlet title tag is used to print the dynamic portlet title to the page.
27 * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>
28 * @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a>
29 * @version 1.0
30 * @since Oct 4, 2004
31 */
32public class PortletTitleTag extends TagSupport {
33        
34        // TagSupport Impl ---------------------------------------------------------
35        
36        /**
37     * Method invoked when the start tag is encountered. This method retrieves
38     * the portlet title and print it to the page.
39     * 
40         * @see org.apache.pluto.services.PortalCallbackService#setTitle(HttpServletRequest, PortletWindow, String)
41         * @see org.apache.pluto.driver.services.container.PortalCallbackServiceImpl#setTitle(HttpServletRequest, PortletWindow, String)
42         * 
43         * @throws JspException
44         */
45    public int doStartTag() throws JspException {
46            
47            // Ensure that the portlet title tag resides within a portlet tag.
48        PortletTag parentTag = (PortletTag) TagSupport.findAncestorWithClass(
49                        this, PortletTag.class);
50        if (parentTag == null) {
51            throw new JspException("Portlet title tag may only reside "
52                            + "within a pluto:portlet tag.");
53        }
54        
55        // Print out the portlet title to page.
56        try {
57            pageContext.getOut().print(pageContext.getRequest().getAttribute(
58                            AttributeKeys.PORTLET_TITLE));
59        } catch (IOException ex) {
60            throw new JspException(ex);
61        }
62        return SKIP_BODY;
63    }
64}
65 

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