19 package org.turro.publication.content;
21 import java.io.StringWriter;
22 import java.io.Writer;
23 import org.turro.action.content.AbstractContentProvider;
24 import org.turro.action.content.ContentRenderer;
25 import org.turro.action.content.IContentIterator;
26 import org.turro.annotation.ContentProvider;
27 import org.turro.command.MacroCommand;
28 import org.turro.elephant.context.HeadlessApplication;
29 import org.turro.plugin.contacts.IContact;
42 private void addCommands() {
43 MacroCommand mc =
new MacroCommand(
"publications");
44 mc.addParameter(
"context",
"",
true);
45 mc.addParameter(
"categoryId", Long.valueOf(0),
true);
46 mc.addParameter(
"groupId", Long.valueOf(0),
true);
47 mc.addParameter(
"count", Integer.valueOf(10),
true);
48 mc.addParameter(
"template",
"summary",
true);
49 mc.addParameter(
"notSent", Boolean.FALSE,
true);
50 mc.addParameter(
"lang",
"",
true);
51 mc.addParameter(
"asBlogger", Boolean.FALSE,
true);
52 mc.addParameter(
"future", Boolean.FALSE,
true);
58 if(macroCommand.itsMe(
"publications(")) {
59 StringWriter sw =
new StringWriter();
63 macroCommand.getParameterValue(String.class,
"context"));
64 pi.
setGroupId(macroCommand.getParameterValue(Long.class,
"groupId"));
65 pi.
setCategoryId(macroCommand.getParameterValue(Long.class,
"categoryId"));
66 pi.
setPage(macroCommand.getParameterValue(Integer.class,
"count"));
75 pi.
setLang(macroCommand.getParameterValue(String.class,
"lang"));
76 pi.
setNotSent(macroCommand.getParameterValue(Boolean.class,
"notSent"));
77 pi.
setBlogger(macroCommand.getParameterValue(Boolean.class,
"asBlogger"));
78 pi.
setFuture(macroCommand.getParameterValue(Boolean.class,
"future"));
85 return writer.toString();
final List< MacroCommand > commands
static HeadlessApplication getInstance()
IConstructor getConstructor()
void setAllowAttachments(boolean allowAttachments)
void setAllowInterest(boolean allowInterest)
void setAllowDescriptions(boolean allowDescriptions)
void setAllowComments(boolean allowComments)
void setNavigatorBottom(boolean navigatorBottom)
void setSearchOption(boolean searchOption)
void setSummaryTemplate(String summaryTemplate)
void setNavigatorTop(boolean navigatorTop)
void setAllowVotes(boolean allowVotes)
void setAllowFiles(boolean allowFiles)
void setAllowPolls(boolean allowPolls)
void setCategoryId(long categoryId)
void setNotSent(boolean notSent)
void setBlogger(boolean blogger)
void setGroupId(long groupId)
void setLang(String lang)
void setFuture(boolean future)
PublicationContentProvider()
ContentRenderer loadCommand(MacroCommand macroCommand, IContact contact, String idContext)