19 package org.turro.jpa.content;
21 import java.io.StringWriter;
22 import java.io.Writer;
23 import org.amic.util.date.CheckDate;
24 import org.turro.action.content.AbstractContentProvider;
25 import org.turro.action.content.ContentContext;
26 import org.turro.action.content.ContentRenderer;
27 import org.turro.action.content.IContentIterator;
28 import org.turro.activity.ContactActivityMap;
29 import org.turro.activity.LastActivities;
30 import org.turro.annotation.ContentProvider;
31 import org.turro.command.MacroCommand;
32 import org.turro.elephant.context.HeadlessApplication;
33 import org.turro.plugin.contacts.IContact;
46 private void addCommands() {
47 MacroCommand mc =
new MacroCommand(
"last-activity");
48 mc.addParameter(
"context",
"",
true);
49 mc.addParameter(
"count", Integer.valueOf(50),
true);
50 mc.addParameter(
"days", Integer.valueOf(7),
true);
51 mc.addParameter(
"path",
"",
true);
52 mc.addParameter(
"template",
"summary",
true);
58 if(macroCommand.itsMe(
"last-activity(")) {
61 new CheckDate().addDays(
62 -(macroCommand.getParameterValue(Integer.class,
"days"))
64 macroCommand.getParameterValue(String.class,
"path"),
null);
66 StringWriter sw =
new StringWriter();
71 true, macroCommand.getParameterValue(String.class,
"context"));
72 di.setPage(macroCommand.getParameterValue(Integer.class,
"count"));
79 di.setSummaryTemplate(macroCommand.getParameterValue(String.class,
"template"));
80 di.setNavigatorTop(
false);
81 di.setNavigatorBottom(
false);
85 return writer.toString();
final List< MacroCommand > commands
static Object getContent(String context, Supplier onDefault)
static ContactActivityMap getLastActivitySession(Date from, String entityPath, String type)
static HeadlessApplication getInstance()
IConstructor getConstructor()
void setAllowAttachments(boolean allowAttachments)
void setAllowPolls(boolean allowPolls)
void setAllowVotes(boolean allowVotes)
void setAllowInterest(boolean allowInterest)
void setAllowComments(boolean allowComments)
void setAllowDescriptions(boolean allowDescriptions)
ContentRenderer loadCommand(MacroCommand macroCommand, IContact contact, String idContext)
LastActivityContentProvider()