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

Public Member Functions

void loadData () throws ServletException, IOException
 
void startConstruction () throws ServletException, IOException
 
String getStart ()
 
String getEnd ()
 
- Public Member Functions inherited from org.turro.elephant.impl.abstracts.AbstractElement
 AbstractElement ()
 
String getId ()
 
String getType ()
 
String getTitle ()
 
void setTitle (String title)
 
Collection< String > getMetas ()
 
void setMetas (Collection< String > metas)
 
ElContext getContext ()
 
IConstructor getConstructor ()
 
void setConfiguration (IConstructor constructor, ElContext context)
 
String getStartTitle ()
 
String getEndTitle ()
 
String getStartBody ()
 
String getEndBody ()
 
String getStartFooter ()
 
String getEndFooter ()
 
String getStartOption ()
 
String getEndOption ()
 
boolean canDisplay ()
 
boolean isSelectable ()
 
boolean isInRole ()
 
boolean canPrint ()
 
String getElementFolder ()
 
boolean isOriginalContext ()
 
void setRootCategories (ElContext root)
 
String getTypeName ()
 
AttributeSupport getAttributes ()
 
void applyChanges ()
 
void populateFromParent ()
 
void setDefaultMetas ()
 
void setConfiguration (Element conf, Element factory)
 

Protected Attributes

String sclass
 
int count
 
boolean showDescriptions
 
Long item
 
AgreementSignature signature
 
IContact contact
 
- Protected Attributes inherited from org.turro.elephant.impl.abstracts.AbstractElement
IConstructor constructor
 
ElContext context
 
AttributeSupport attrSupport
 
Element conf = null
 
String[] types
 
String title
 
Collection< String > metas
 

Detailed Description

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

Definition at line 45 of file MyAgreementsDashboard.java.

Member Function Documentation

◆ getEnd()

String org.turro.agreements.MyAgreementsDashboard.getEnd ( )

Reimplemented from org.turro.elephant.impl.abstracts.AbstractElement.

Definition at line 121 of file MyAgreementsDashboard.java.

121  {
122  return "</div>";
123  }
Here is the caller graph for this function:

◆ getStart()

String org.turro.agreements.MyAgreementsDashboard.getStart ( )

Reimplemented from org.turro.elephant.impl.abstracts.AbstractElement.

Definition at line 116 of file MyAgreementsDashboard.java.

116  {
117  return "<div class='" + sclass + "agreement-web'>";
118  }
Here is the caller graph for this function:

◆ loadData()

void org.turro.agreements.MyAgreementsDashboard.loadData ( ) throws ServletException, IOException

This method loads element's data. It gets called within IConstructor.startConstruction() and before element's startConstruction() method.

Exceptions
javax.servlet.ServletException
java.io.IOException

Implements org.turro.elephant.context.IElement.

Definition at line 55 of file MyAgreementsDashboard.java.

55  {
56  sclass = getAttributes().getAttributeValue("attrib:sclass", "");
57  count = getAttributes().getAttributeIntegerValue("attrib:count", 10);
58  showDescriptions = getAttributes().getAttributeBooleanValue("attrib:showDescriptions", true);
59  fullTemplate = getAttributes().getAttributeValue("attrib:fullTemplate", "");
60  summaryTemplate = getAttributes().getAttributeValue("attrib:summaryTemplate", "");
61  agreementPath = getAttributes().getAttributeValue("attrib:agreementPath", null);
62 
63  contact = Authentication.getIContact();
64 
65  item = (Long) ObjectString.parseString(getConstructor().getParameter("item"), Long.class, true);
66 
67  if(item > 0) {
68  signature = new ElephantPU().find(AgreementSignature.class, item);
69  if(!signature.getIdContact().equals(contact.getId())) {
70  signature = null;
71  }
72  }
73 
74  if(signature != null) {
76  } else {
77  item = 0L;
78  }
79  }
Here is the call graph for this function:

◆ startConstruction()

void org.turro.agreements.MyAgreementsDashboard.startConstruction ( ) throws ServletException, IOException

This method start element's construction. It gets called within IConstructor.startConstruction().

Exceptions
javax.servlet.ServletException
java.io.IOException

Implements org.turro.elephant.context.IElement.

Definition at line 82 of file MyAgreementsDashboard.java.

82  {
83  PrintWriter out = getConstructor().getOut();
84  out.print(getStart());
85  out.print(getStartBody());
86 
87  ElephantMarker marker = new ElephantMarker(getConstructor());
88  if(!Strings.isBlank(agreementPath)) {
89  marker.put("agreementPath", ElephantContext.getRootWebPath() + agreementPath);
90  }
91  if(item > 0) {
92  prepareValues(marker, signature, 0);
93  marker.process("agreement", getFullTemplate());
94  } else {
95  AgreementsUtil agreements = new AgreementsUtil(contact);
96  if(agreements.getSignatures(null).isEmpty()) {
97  out.write("<h3>" + I_.get("Empty list") + "</h3>");
98  } else {
99  int index = 0;
100  for(AgreementSignature asig : agreements.getSignatures(null)) {
101  marker.put("divider", index > 0);
102  marker.put("header", index == 0);
103  marker.put("footer", index == agreements.getSignatures(null).size() - 1);
104  prepareValues(marker, asig, 0);
105  marker.process("agreement", getSummaryTemplate());
106  index++;
107  }
108  }
109  }
110 
111  out.print(getEndBody());
112  out.print(getEnd());
113  }
Here is the call graph for this function:

Member Data Documentation

◆ contact

IContact org.turro.agreements.MyAgreementsDashboard.contact
protected

Definition at line 52 of file MyAgreementsDashboard.java.

◆ count

int org.turro.agreements.MyAgreementsDashboard.count
protected

Definition at line 48 of file MyAgreementsDashboard.java.

◆ item

Long org.turro.agreements.MyAgreementsDashboard.item
protected

Definition at line 50 of file MyAgreementsDashboard.java.

◆ sclass

String org.turro.agreements.MyAgreementsDashboard.sclass
protected

Definition at line 47 of file MyAgreementsDashboard.java.

◆ showDescriptions

boolean org.turro.agreements.MyAgreementsDashboard.showDescriptions
protected

Definition at line 49 of file MyAgreementsDashboard.java.

◆ signature

AgreementSignature org.turro.agreements.MyAgreementsDashboard.signature
protected

Definition at line 51 of file MyAgreementsDashboard.java.


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