19 package org.turro.students.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() {
44 MacroCommand mc =
new MacroCommand(
"challenges");
45 mc.addParameter(
"status",
"active",
true)
46 .setPossibleValuesString(
"active|closed|all");
47 mc.addParameter(
"context",
"",
true);
48 mc.addParameter(
"count", Integer.valueOf(10),
true);
49 mc.addParameter(
"restricted", Boolean.FALSE,
true);
50 mc.addParameter(
"studentRelated", Boolean.FALSE,
true);
51 mc.addParameter(
"challengerRelated", Boolean.FALSE,
true);
52 mc.addParameter(
"responseFrom", Integer.valueOf(15),
true);
53 mc.addParameter(
"template",
"summary",
true);
59 if(macroCommand.itsMe(
"challenges(")) {
60 StringWriter sw =
new StringWriter();
64 macroCommand.getParameterValue(String.class,
"context"));
65 ci.
setStatus(macroCommand.getParameterValue(String.class,
"status"));
66 ci.
setPage(macroCommand.getParameterValue(Integer.class,
"count"));
75 ci.
setRestricted(macroCommand.getParameterValue(Boolean.class,
"restricted"));
76 ci.
setStudentRelated(macroCommand.getParameterValue(Boolean.class,
"studentRelated"));
78 ci.
setResponseFrom(macroCommand.getParameterValue(Integer.class,
"responseFrom"));
84 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 setRestricted(boolean restricted)
void setAllowComments(boolean allowComments)
void setNavigatorBottom(boolean navigatorBottom)
void setSummaryTemplate(String summaryTemplate)
void setNavigatorTop(boolean navigatorTop)
void setAllowVotes(boolean allowVotes)
void setAllowFiles(boolean allowFiles)
void setAllowPolls(boolean allowPolls)
void setStatus(String status)
void setStudentRelated(boolean studentRelated)
void setResponseFrom(int days)
void setChallengerRelated(boolean challengerRelated)
ChallengeContentProvider()
ContentRenderer loadCommand(MacroCommand macroCommand, IContact contact, String idContext)