BrightSide Workbench Full Report + Source Code
org.turro.parser.ElephantParser Class Reference
Inheritance diagram for org.turro.parser.ElephantParser:
Collaboration diagram for org.turro.parser.ElephantParser:

Public Member Functions

String getParserName ()
 
- Public Member Functions inherited from org.turro.parser.AbstractParser
 AbstractParser ()
 
ParserMacroSet getParserMacros ()
 
boolean execute (IConstructor constructor, PrintWriter out, String[] tokens)
 

Protected Member Functions

boolean doExecute ()
 
void explainMacros (ParserMacroSet macros)
 
- Protected Member Functions inherited from org.turro.parser.AbstractParser
String getMacroName ()
 
String getToken (String name)
 
String getToken (String name, boolean defParameter)
 
String getToken (String name, String def)
 
String getToken (int index)
 
String getToken (int index, boolean defParameter)
 
String getToken (int index, String def)
 
int getTokenSize ()
 
String getDefaultFor (int index)
 
void prepareProperties (ElephantMarker marker, String properties)
 

Additional Inherited Members

- Protected Attributes inherited from org.turro.parser.AbstractParser
IConstructor constructor
 
String[] tokens
 
PrintWriter out
 
String parserName
 
ParserMacroSet parserMacros = new ParserMacroSet()
 

Detailed Description

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

Definition at line 40 of file ElephantParser.java.

Member Function Documentation

◆ doExecute()

boolean org.turro.parser.ElephantParser.doExecute ( )
protected

Reimplemented from org.turro.parser.AbstractParser.

Definition at line 48 of file ElephantParser.java.

48  {
49  boolean done = false;
50  if("polls".equals(getMacroName()) || "poll-list".equals(getMacroName())) {
51  boolean grouped = "polls".equals(getMacroName());
52  PollIterator pi = new PollIterator(constructor, ElephantContext.getRootWebPath() + "/user/mypolls");
53  pi.setNavigatorTop(grouped);
54  pi.setNavigatorBottom(grouped);
55  pi.setPublicOnly("true".equals(getToken(2)));
56  pi.setRestricted(true);
57  pi.setPage((Integer) ObjectString.parseNativeString(getToken(1), Integer.class, true));
58  pi.load();
59  pi.render();
60  done = true;
61  } else if("time-tracker".equals(getMacroName())) {
62  TimeTrackerCtrl ttc = new TimeTrackerCtrl();
63  if(getTokenSize() == 2) {
64  out.write(ttc.createRightNowURL("redir=/user/timetracker;type=entity;entityPath=" + getToken(1)));
65  } else {
66  ttc.render(constructor);
67  }
68  done = true;
69  } else if("anonymous".equals(getMacroName())) {
70  AnonymousCtrl anonymous = new AnonymousCtrl();
71  anonymous.renderAnswerForm(constructor);
72  done = true;
73  } else if("last-activity".equals(getMacroName()) || "last-activity-summary".equals(getMacroName())) {
74  IContact contact = Authentication.getIContact();
75  LastActivityIterator dci = new LastActivityIterator(constructor, out, contact,
76  LastActivities.getLastActivity(contact),
77  false, Strings.isBlank(getToken(1)) ? null : ElephantContext.getRootWebPath() + getToken(2));
78  dci.setPage((Integer) ObjectString.parseNativeString(getToken(2), Integer.class, true));
79  if(getMacroName().contains("summary")) {
80  dci.setNavigatorTop(false);
81  dci.setNavigatorBottom(false);
82  }
83  dci.setSummaryTemplate(getToken(3));
84  dci.render();
85  done = true;
86  } else if("entity-graph".equals(getMacroName())) {
87  EntityGraph.DOT(out);
88  done = true;
89  } else if("activity-summary".equals(getMacroName())) {
90  ActivitySummary.render(constructor);
91  done = true;
92  }
93  return done;
94  }
Here is the call graph for this function:

◆ explainMacros()

void org.turro.parser.ElephantParser.explainMacros ( ParserMacroSet  macros)
protected

Reimplemented from org.turro.parser.AbstractParser.

Definition at line 97 of file ElephantParser.java.

97  {
98  macros.addMacro("polls")
99  .addParameter("count", true, "10")
100  .addParameter("public", true, "true");
101  macros.addMacro("poll-list")
102  .copyParametersFrom("polls", macros);
103  macros.addMacro("time-tracker")
104  .addParameter("entityPath", true);
105  macros.addMacro("anonymous");
106  macros.addMacro("last-activity")
107  .addParameter("context", true)
108  .addParameter("count", true, "10")
109  .addParameter("template", true, "summary");
110  macros.addMacro("last-activity-summary")
111  .copyParametersFrom("last-activity", macros);
112  }
Here is the call graph for this function:

◆ getParserName()

String org.turro.parser.ElephantParser.getParserName ( )

Reimplemented from org.turro.parser.AbstractParser.

Definition at line 43 of file ElephantParser.java.

43  {
44  return "Elephant";
45  }

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