19 package org.turro.agreements;
21 import java.io.IOException;
22 import java.io.PrintWriter;
23 import java.util.logging.Level;
24 import java.util.logging.Logger;
25 import javax.servlet.ServletException;
26 import org.turro.string.ObjectString;
27 import org.turro.string.Strings;
28 import org.turro.auth.Authentication;
29 import org.turro.elephant.context.ElephantContext;
30 import org.turro.elephant.context.IElement;
31 import org.turro.elephant.db.ElephantPU;
32 import org.turro.elephant.entities.db.AgreementSignature;
33 import org.turro.elephant.impl.abstracts.AbstractElement;
34 import org.turro.elephant.layout.IManageable;
35 import org.turro.elephant.layout.IRenderable;
36 import org.turro.elephant.security.IDefendable;
37 import org.turro.i18n.I_;
38 import org.turro.marker.ElephantMarker;
39 import org.turro.plugin.contacts.IContact;
47 protected String
sclass, fullTemplate, summaryTemplate, agreementPath;
55 public void loadData() throws ServletException, IOException {
59 fullTemplate =
getAttributes().getAttributeValue(
"attrib:fullTemplate",
"");
60 summaryTemplate =
getAttributes().getAttributeValue(
"attrib:summaryTemplate",
"");
61 agreementPath =
getAttributes().getAttributeValue(
"attrib:agreementPath",
null);
88 if(!Strings.isBlank(agreementPath)) {
93 marker.
process(
"agreement", getFullTemplate());
97 out.write(
"<h3>" +
I_.
get(
"Empty list") +
"</h3>");
101 marker.
put(
"divider", index > 0);
102 marker.
put(
"header", index == 0);
104 prepareValues(marker, asig, 0);
105 marker.
process(
"agreement", getSummaryTemplate());
117 return "<div class='" +
sclass +
"agreement-web'>";
135 String link = getItemLink(
signature, page);
137 marker.
put(
"path", link);
138 marker.
put(
"all", getPageLink());
142 }
catch (Exception ex) {
143 Logger.getLogger(MyAgreementsDashboard.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(
null), ex);
148 private String getItemLink(AgreementSignature
signature,
int page) {
152 private String getPageLink() {
156 private String getSummaryTemplate() {
157 return Strings.isBlank(summaryTemplate) ?
"mySummary" : summaryTemplate;
160 private String getFullTemplate() {
161 return Strings.isBlank(fullTemplate) ?
"myFull" : fullTemplate;
static String createURL(IConstructor constructor, AgreementSignature signature, IContact contact, boolean accept)
List< AgreementSignature > getSignatures(String action)
AgreementSignature signature
static IContact getIContact()
static String getRootWebPath()
AttributeSupport getAttributes()
static String get(String msg)
void process(String rootTmpl, String tmpl)
Object put(Object key, Object value)
String getParameter(String param)
void setTitle(String title)
IConstructor getConstructor()