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

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 31 of file AttachParser.java.

Member Function Documentation

◆ doExecute()

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

Reimplemented from org.turro.parser.AbstractParser.

Definition at line 39 of file AttachParser.java.

39  {
40  boolean done = false;
41  if("attachment".equals(getMacroName()) ||
42  "attachment-ro".equals(getMacroName()) ||
43  "attachment-rot".equals(getMacroName())) {
44  AttachCtrl ac = new AttachCtrl(constructor);
45  IContact contact = (IContact) constructor.findAttribute("loggedIContact");
46  Entities.getController(getToken(1)).configureCtrl(ac, contact);
47  ac.setPublicOnly(true);
48  ac.setLastOnly(true);
49  ac.setEntityPath(getToken(1));
50  ac.setTreeTemplate(getToken(2));
51  ac.setReadOnly(!"attachment".equals(getMacroName()));
52  ac.renderAttachments();
53  done = true;
54  } else if("self-attachments".equals(getMacroName()) ||
55  "self-attachments-ro".equals(getMacroName()) ||
56  "self-attachments-rot".equals(getMacroName())) {
57  IContact contact = (IContact) constructor.findAttribute("loggedIContact");
58  if(contact != null && contact.isValid()) {
59  AttachCtrl ac = new AttachCtrl(constructor);
60  ac.setPublicOnly(true);
61  ac.setLastOnly(true);
62  ac.setEntityPath("/contact/" + contact.getId());
63  ac.setReadOnly(!"self-attachments".equals(getMacroName()));
64  ac.renderAttachments();
65  done = true;
66  }
67  }
68  return done;
69  }
Here is the call graph for this function:

◆ explainMacros()

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

Reimplemented from org.turro.parser.AbstractParser.

Definition at line 72 of file AttachParser.java.

72  {
73  macros.addMacro("attachment")
74  .addParameter("entityPath", false)
75  .addParameter("template", true, "tree")
76  .addPossibleValue("editableTree");
77  macros.addMacro("attachment-ro")
78  .addParameter("entityPath", false)
79  .addParameter("template", true, "tree-ro");
80  macros.addMacro("attachment-rot")
81  .addParameter("entityPath", false)
82  .addParameter("template", true, "tree-rot");
83  macros.addMacro("self-attachments")
84  .addParameter("template", true, "tree");
85  macros.addMacro("self-attachments-ro")
86  .addParameter("template", true, "tree-ro");
87  macros.addMacro("self-attachments-rot")
88  .addParameter("template", true, "tree-rot");
89  }
Here is the call graph for this function:

◆ getParserName()

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

Reimplemented from org.turro.parser.AbstractParser.

Definition at line 34 of file AttachParser.java.

34  {
35  return "Attachments";
36  }

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