BrightSide Workbench Full Report + Source Code
org.turro.jpa.content.LastActivityContentProvider Class Reference
Inheritance diagram for org.turro.jpa.content.LastActivityContentProvider:
Collaboration diagram for org.turro.jpa.content.LastActivityContentProvider:

Public Member Functions

 LastActivityContentProvider ()
 
ContentRenderer loadCommand (MacroCommand macroCommand, IContact contact, String idContext)
 
- Public Member Functions inherited from org.turro.action.content.AbstractContentProvider
List< String > getHelpCommands ()
 
boolean itsMe (String command)
 
ContentRenderer loadCommand (String command, IContact contact, String idContext)
 
List< MacroCommand > getCommands ()
 

Additional Inherited Members

- Protected Attributes inherited from org.turro.action.content.AbstractContentProvider
final List< MacroCommand > commands = new ArrayList<>()
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 40 of file LastActivityContentProvider.java.

Constructor & Destructor Documentation

◆ LastActivityContentProvider()

org.turro.jpa.content.LastActivityContentProvider.LastActivityContentProvider ( )

Definition at line 42 of file LastActivityContentProvider.java.

42  {
43  addCommands();
44  }

Member Function Documentation

◆ loadCommand()

ContentRenderer org.turro.jpa.content.LastActivityContentProvider.loadCommand ( MacroCommand  macroCommand,
IContact  contact,
String  idContext 
)

Reimplemented from org.turro.action.content.AbstractContentProvider.

Definition at line 57 of file LastActivityContentProvider.java.

57  {
58  if(macroCommand.itsMe("last-activity(")) {
59  ContactActivityMap cam = (ContactActivityMap) ContentContext.getContent(idContext, () -> {
60  return LastActivities.getLastActivitySession(
61  new CheckDate().addDays(
62  -(macroCommand.getParameterValue(Integer.class, "days"))
63  ).getDate(),
64  macroCommand.getParameterValue(String.class, "path"), null);
65  });
66  StringWriter sw = new StringWriter();
67  //TODO: Call to LastActivities needs to be cached
68  LastActivityIterator di = new LastActivityIterator(
69  HeadlessApplication.getInstance().getConstructor(),
70  sw, contact, cam,
71  true, macroCommand.getParameterValue(String.class, "context"));
72  di.setPage(macroCommand.getParameterValue(Integer.class, "count"));
73  di.setAllowAttachments(true);
74  di.setAllowDescriptions(true);
75  di.setAllowInterest(true);
76  di.setAllowVotes(true);
77  di.setAllowComments(true);
78  di.setAllowPolls(true);
79  di.setSummaryTemplate(macroCommand.getParameterValue(String.class, "template"));
80  di.setNavigatorTop(false);
81  di.setNavigatorBottom(false);
82  di.load();
83  return new ContentRenderer(macroCommand, di, sw, (IContentIterator iterator, Writer writer) -> {
84  iterator.render();
85  return writer.toString();
86  });
87  }
88  return null;
89  }
Here is the call graph for this function:

The documentation for this class was generated from the following file: