1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.seasar.tuigwaa.plugin.database;
17
18 import org.seasar.tuigwaa.cms.core.CmsRequest;
19 import org.seasar.tuigwaa.cms.core.CmsResponse;
20 import org.seasar.tuigwaa.plugin.AbstractTgwPlugin;
21 import org.seasar.tuigwaa.plugin.PluginException;
22 import org.seasar.tuigwaa.plugin.PluginRequest;
23 import org.seasar.tuigwaa.system.Constants;
24 import org.seasar.tuigwaa.util.TgwContext;
25
26 import com.isenshi.util.CharUtil;
27 import com.isenshi.util.HtmlBuffer;
28
29 /***
30 * @author nishioka
31 */
32 public class TableFeedPlugin extends AbstractTgwPlugin {
33
34 public String doHTMLView(CmsRequest req, CmsResponse res,
35 PluginRequest prequest) throws PluginException {
36
37 String[] args = prequest.getArgs();
38
39 String pageName = args[0];
40 String entityDisplayName = args[1];
41
42 String filterName = (existArg(args, 2))?args[2]:"";
43
44 String siteName = req.getSiteName();
45 String entityName = getEntity(siteName, entityDisplayName).getName();
46 String contextPath = TgwContext.getContextPath();
47
48 String link = contextPath + "/" + TgwContext.getSiteName()
49 + "/tableFeed.do?" + Constants.PARAM_ENTITY_NAME + "="
50 + entityName + "&" + Constants.PARAM_ENTITY_FILTER + "="
51 + CharUtil.urlEncode(filterName) + "&"
52 + Constants.PARAM_PAGENAME + "=" + CharUtil.urlEncode(pageName);
53
54 HtmlBuffer buf = new HtmlBuffer();
55 buf.appendStartTag("a");
56 buf.appendAttribute("href", link);
57 buf.appendStartTag("img");
58
59 buf.appendAttribute("src", contextPath + "/TGW-RES/img/rss20.gif");
60 buf.endTag();
61 buf.endTag();
62 return buf.toString();
63 }
64 }