18 package org.turro.elephant.impl.context.action;
20 import com.sun.syndication.feed.synd.SyndFeed;
21 import com.sun.syndication.feed.synd.SyndFeedImpl;
22 import com.sun.syndication.io.FeedException;
23 import com.sun.syndication.io.SyndFeedOutput;
24 import java.io.IOException;
25 import javax.servlet.ServletException;
26 import org.turro.elephant.context.ElephantContext;
27 import org.turro.elephant.context.IAction;
28 import org.turro.elephant.context.IElement;
29 import org.turro.elephant.feed.IRSSable;
30 import org.turro.elephant.impl.abstracts.AbstractAction;
31 import org.turro.elephant.web.ElContext;
32 import org.turro.elephant.web.ElContextMap;
49 boolean isAJAX =
false;
54 if (
"print".equals(action)) {
63 }
else if (
"read".equals(action)) {
68 printContext(context, 1,
false);
72 }
else if (
"rss".equals(action)) {
87 private void printContext(
ElContext context,
int level,
boolean title)
throws ServletException, IOException {
88 if(level <= 0)
return;
89 if(context.canPrint() && context.getWebContext().isWikiPage()) {
91 if(title)
constructor.
getOut().print(
"<div class='context-title'>" + context.getName() +
"</div>");
92 context.getElement().startConstruction();
94 printContext(ctx, level-1, title);
99 private void rssContext(ElContext context)
throws IOException, FeedException {
102 IElement el = context.getElement();
103 if(el instanceof IRSSable) {
104 SyndFeed feed =
new SyndFeedImpl();
105 feed.setFeedType(
"rss_1.0");
109 feed.setDescription(context.getName());
110 feed.setEntries(((IRSSable) el).getSyndEntries());
111 SyndFeedOutput output =
new SyndFeedOutput();
static String getSiteName()
static String getServerUrl(String scheme)
static String getEncoding()
boolean getBooleanParameter(String param)
int getIntParameter(String param, int defaultValue)
String getActionParameter()
static ElContext getContext(IConstructor constructor)
TreeSet< ElContext > getChildren()
String getParameter(String param)
HttpServletResponse getResponse()
void redirect(String path)
void setStopper(String stopper)
void setRenderingContext(ElContext context)
void forceIsAContext(ElContext context)