KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > j2biz > blogunity > web > decorator > TrackbacksTableDecorator


1 /*
2  * $Id: TrackbacksTableDecorator.java,v 1.1 2005/01/10 03:12:56 keyboardsamurai Exp $
3  * Created on 10.01.2005
4  * Last commit on $Date: 2005/01/10 03:12:56 $ by $Author: keyboardsamurai $
5  * Copyright (c) 2005 j2biz Group, http://www.j2biz.com
6  * Koeln / Duesseldorf , Germany
7  *
8  * @author Juan Antonio Agudo
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23  *
24  */

25
26 package com.j2biz.blogunity.web.decorator;
27
28 import org.apache.commons.logging.Log;
29 import org.apache.commons.logging.LogFactory;
30
31 import com.j2biz.blogunity.pojo.Trackback;
32
33 /**
34  * @author tag Juan Antonio Agudo
35  * @since 0.2.2 (cian)
36  */

37 public class TrackbacksTableDecorator extends AbstractTableDecorator {
38     /**
39      * Logger for this class
40      */

41     private static final Log log = LogFactory.getLog(TrackbacksTableDecorator.class);
42  
43     public String JavaDoc getActions() {
44
45         Trackback trackback = (Trackback) getCurrentRowObject();
46         StringBuffer JavaDoc out = new StringBuffer JavaDoc();
47         out.append("<nobr>");
48         
49         // delete trackback
50
out.append("<a HREF=\"");
51         out.append(ctx);
52         out.append("/my/deleteTrackbackConfirm?id=");
53         out.append(trackback.getId());
54         out.append("\">");
55         out.append(getMessageForKey("DELETE"));
56         out.append("</a>");
57         
58         out.append("</nobr>");
59         return out.toString();
60     }
61     
62     public String JavaDoc getLoggedIp() {
63         Trackback trackback = (Trackback) getCurrentRowObject();
64         return "<a HREF=\"http://www.whois.net/?d="+trackback.getLoggedIp()+"\"a>"+trackback.getLoggedIp()+"</a>";
65     }
66
67     public String JavaDoc getDate() {
68         Trackback trackback = (Trackback) getCurrentRowObject();
69         return trackback.getDate().toString();
70     }
71     
72     public String JavaDoc getContent() {
73         Trackback trackback = (Trackback) getCurrentRowObject();
74         return trackback.getTrackbackContent();
75     }
76     
77     public String JavaDoc getUrl() {
78         Trackback trackback = (Trackback) getCurrentRowObject();
79         return trackback.getUrl();
80     }
81     
82     public String JavaDoc getTitle() {
83         Trackback trackback = (Trackback) getCurrentRowObject();
84         return trackback.getTitle();
85     }
86     
87     
88     
89
90 }
91
Popular Tags