01: /*
02: JSPWiki - a JSP-based WikiWiki clone.
03:
04: Copyright (C) 2001-2002 Janne Jalkanen (Janne.Jalkanen@iki.fi)
05:
06: This program is free software; you can redistribute it and/or modify
07: it under the terms of the GNU Lesser General Public License as published by
08: the Free Software Foundation; either version 2.1 of the License, or
09: (at your option) any later version.
10:
11: This program is distributed in the hope that it will be useful,
12: but WITHOUT ANY WARRANTY; without even the implied warranty of
13: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14: GNU Lesser General Public License for more details.
15:
16: You should have received a copy of the GNU Lesser General Public License
17: along with this program; if not, write to the Free Software
18: Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19: */
20: package com.ecyrd.jspwiki.tags;
21:
22: import com.ecyrd.jspwiki.ui.TemplateManager;
23:
24: /**
25: * Provides easy access to TemplateManager.addResourceRequest(). You may use
26: * any of the request types defined there.
27: *
28: * @author jalkanen
29: *
30: */
31: public class RequestResourceTag extends WikiTagBase {
32: private static final long serialVersionUID = 0L;
33:
34: private String m_type;
35: private String m_resource;
36:
37: public void initTag() {
38: super .initTag();
39: m_type = m_resource = null;
40: }
41:
42: public int doWikiStartTag() throws Exception {
43: if (m_type != null && m_resource != null) {
44: TemplateManager.addResourceRequest(m_wikiContext, m_type,
45: m_resource);
46: }
47:
48: return SKIP_BODY;
49: }
50:
51: public String getResource() {
52: return m_resource;
53: }
54:
55: public void setResource(String r) {
56: m_resource = r;
57: }
58:
59: public String getType() {
60: return m_type;
61: }
62:
63: public void setType(String type) {
64: m_type = type;
65: }
66:
67: }
|