19 package org.turro.financials.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(
"contracts");
44 mc.addParameter(
"status",
"active",
true)
45 .setPossibleValuesString(
"active|closed|all");
46 mc.addParameter(
"context",
"",
true);
47 mc.addParameter(
"count", Integer.valueOf(10),
true);
48 mc.addParameter(
"intervention", Boolean.TRUE,
true);
49 mc.addParameter(
"type", Integer.valueOf(0),
true);
50 mc.addParameter(
"template",
"summary",
true);
56 if(macroCommand.itsMe(
"contracts(")) {
57 StringWriter sw =
new StringWriter();
61 macroCommand.getParameterValue(String.class,
"context"));
62 if(macroCommand.getParameterValue(String.class,
"status").equals(
"active")) {
64 }
else if(macroCommand.getParameterValue(String.class,
"status").equals(
"closed")) {
67 ci.
setPage(macroCommand.getParameterValue(Integer.class,
"count"));
77 ci.
setType(macroCommand.getParameterValue(Integer.class,
"type"));
83 return writer.toString();
final List< MacroCommand > commands
static HeadlessApplication getInstance()
IConstructor getConstructor()
void setCheckParticipation(boolean checkParticipation)
void setStatus(int status)
FinancialsContentProvider()
ContentRenderer loadCommand(MacroCommand macroCommand, IContact contact, String idContext)
void setAllowAttachments(boolean allowAttachments)
void setAllowInterest(boolean allowInterest)
void setAllowDescriptions(boolean allowDescriptions)
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)