Clover Coverage Report - itracker
Coverage timestamp: Tue May 1 2012 16:42:12 CEST
46   143   23   3.07
12   98   0.5   15
15     1.53  
1    
 
 
  FormatPaginationLinkTag       Line # 28 46 23 0% 0.0
 
No Tests
 
1    /*
2    * This software was designed and created by Jason Carroll.
3    * Copyright (c) 2002, 2003, 2004 Jason Carroll.
4    * The author can be reached at jcarroll@cowsultants.com
5    * ITracker website: http://www.cowsultants.com
6    * ITracker forums: http://www.cowsultants.com/phpBB/index.php
7    *
8    * This program is free software; you can redistribute it and/or modify
9    * it only under the terms of the GNU General Public License as published by
10    * the Free Software Foundation; either version 2 of the License, or
11    * (at your option) any later version.
12    *
13    * This program is distributed in the hope that it will be useful,
14    * but WITHOUT ANY WARRANTY; without even the implied warranty of
15    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16    * GNU General Public License for more details.
17    */
18   
19    package org.itracker.web.taglib;
20   
21    import java.net.MalformedURLException;
22   
23    import javax.servlet.jsp.JspException;
24    import javax.servlet.jsp.tagext.BodyTagSupport;
25   
26    import org.apache.struts.taglib.TagUtils;
27   
 
28    public final class FormatPaginationLinkTag extends BodyTagSupport {
29    /**
30    *
31    */
32    private static final long serialVersionUID = 1L;
33   
34    private String text = null;
35   
36    private String order = null;
37    private String page = null;
38    private Integer projectId = null;
39    private int start = 0;
40    private String styleClass = null;
41   
 
42  0 toggle public String getOrder() {
43  0 return order;
44    }
45   
 
46  0 toggle public void setOrder(String value) {
47  0 order = value;
48    }
49   
 
50  0 toggle public String getPage() {
51  0 return page;
52    }
53   
 
54  0 toggle public void setPage(String value) {
55  0 page = value;
56    }
57   
 
58  0 toggle public Integer getProjectId() {
59  0 return projectId;
60    }
61   
 
62  0 toggle public void setProjectId(Integer value) {
63  0 projectId = value;
64    }
65   
 
66  0 toggle public int getStart() {
67  0 return start;
68    }
69   
 
70  0 toggle public void setStart(int value) {
71  0 start = value;
72    }
73   
 
74  0 toggle public String getStyleClass() {
75  0 return styleClass;
76    }
77   
 
78  0 toggle public void setStyleClass(String value) {
79  0 styleClass = value;
80    }
81   
 
82  0 toggle public int doStartTag() throws JspException {
83  0 StringBuffer buf = new StringBuffer("<a href=\"");
84  0 try {
85    // buf.append(RequestUtils.computeURL(pageContext, null, null, page, null, null, null, false));
86  0 buf.append(TagUtils.getInstance().computeURL(pageContext, null, null, page, null, null, null, null, false));
87    } catch(MalformedURLException murle) {
88  0 buf.append(page);
89    }
90  0 buf.append("?start=" + start);
91  0 if(projectId != null) {
92  0 buf.append("&projectId=" + projectId);
93    }
94  0 if(order != null && order.trim().length() > 0) {
95  0 buf.append("&order=" + order);
96    }
97  0 buf.append("\"");
98  0 if(styleClass != null) {
99  0 buf.append("class=\"" + styleClass + "\"");
100    }
101  0 buf.append(">");
102    // ResponseUtils.write(pageContext, buf.toString());
103  0 TagUtils.getInstance().write(pageContext, buf.toString());
104  0 text = null;
105  0 return (EVAL_BODY_BUFFERED);
106    }
107   
 
108  0 toggle public int doAfterBody() throws JspException {
109  0 if (bodyContent != null) {
110  0 String value = bodyContent.getString().trim();
111  0 if (value.length() > 0) {
112  0 text = value;
113    }
114    }
115  0 return (SKIP_BODY);
116    }
117   
 
118  0 toggle public int doEndTag() throws JspException {
119  0 StringBuffer results = new StringBuffer();
120  0 if (text != null) {
121  0 results.append(text);
122    }
123  0 results.append("</a>");
124    // ResponseUtils.write(pageContext, results.toString());
125  0 TagUtils.getInstance().write(pageContext, results.toString());
126  0 clearState();
127  0 return (EVAL_PAGE);
128    }
129   
 
130  0 toggle public void release() {
131  0 super.release();
132  0 clearState();
133    }
134   
 
135  0 toggle private void clearState() {
136  0 text = null;
137  0 order = null;
138  0 page = null;
139  0 projectId = null;
140  0 start = 0;
141  0 styleClass = null;
142    }
143    }