19 package org.turro.dashboard;
21 import java.io.IOException;
22 import java.io.PrintWriter;
23 import javax.servlet.ServletException;
24 import org.turro.elephant.context.ElephantContext;
25 import org.turro.elephant.impl.abstracts.AbstractElement;
26 import org.turro.jpa.iterator.DaoHtmlIterator;
27 import org.turro.jpa.search.DaoHtmlSearch;
35 private String fullTemplate, summaryTemplate, sclass;
37 private boolean allowInterest, allowComments, allowVotes, allowDescriptions,
38 allowAttachments, allowFiles, allowPolls, restricted,
39 allowRanking, allowMatching, allowSorting, doMatching;
43 public void loadData() throws ServletException, IOException {
44 sclass =
getAttributes().getAttributeValue(
"attrib:sclass",
"");
45 count =
getAttributes().getAttributeIntegerValue(
"attrib:count", 10);
46 restricted =
getAttributes().getAttributeBooleanValue(
"attrib:restricted",
false);
47 fullTemplate =
getAttributes().getAttributeValue(
"attrib:fullTemplate",
"");
48 summaryTemplate =
getAttributes().getAttributeValue(
"attrib:summaryTemplate",
"");
49 allowInterest =
getAttributes().getAttributeBooleanValue(
"attrib:allowInterest",
true);
50 allowComments =
getAttributes().getAttributeBooleanValue(
"attrib:allowComments",
true);
51 allowVotes =
getAttributes().getAttributeBooleanValue(
"attrib:allowVotes",
true);
52 allowAttachments =
getAttributes().getAttributeBooleanValue(
"attrib:allowAttachments",
true);
53 allowDescriptions =
getAttributes().getAttributeBooleanValue(
"attrib:allowDescriptions",
true);
54 allowFiles =
getAttributes().getAttributeBooleanValue(
"attrib:allowFiles",
true);
55 allowPolls =
getAttributes().getAttributeBooleanValue(
"attrib:allowPolls",
true);
56 allowRanking =
getAttributes().getAttributeBooleanValue(
"attrib:allowRanking",
false);
57 allowMatching =
getAttributes().getAttributeBooleanValue(
"attrib:allowMatching",
false);
58 allowSorting =
getAttributes().getAttributeBooleanValue(
"attrib:allowSorting",
false);
59 doMatching =
getAttributes().getAttributeBooleanValue(
"attrib:doMatching",
false);
99 return summaryTemplate;
107 return allowInterest;
111 return allowComments;
119 return allowDescriptions;
123 return allowAttachments;
143 return allowMatching;
160 return "<div class='dashboard " +
getSclass() +
"'>";
abstract void initSearchEngine()
boolean isAllowMatching()
abstract DaoHtmlIterator initIterator()
boolean isAllowDescriptions()
boolean isAllowInterest()
boolean isAllowComments()
boolean isAllowAttachments()
String getSummaryTemplate()
DaoHtmlIterator getIterator()
DaoHtmlSearch getSearchEngine()
static String getContextVariable(IConstructor constructor)
AttributeSupport getAttributes()
void setTitle(String title)
void setMetas(Collection< String > metas)
IConstructor getConstructor()
void setAllowAttachments(boolean allowAttachments)
void setAllowInterest(boolean allowInterest)
void setFullTemplate(String fullTemplate)
void setDoMatching(boolean doMatching)
void setAllowDescriptions(boolean allowDescriptions)
void setSearchEngine(DaoHtmlSearch searchEngine)
void setAllowSorting(boolean allowSorting)
void setRestricted(boolean restricted)
void setAllowComments(boolean allowComments)
Collection< String > getMetas()
void setAllowMatching(boolean allowMatching)
void setSummaryTemplate(String summaryTemplate)
void setAllowVotes(boolean allowVotes)
void setAllowRanking(boolean allowRanking)
void setAllowFiles(boolean allowFiles)
void setAllowPolls(boolean allowPolls)
static DaoHtmlSearch getInstance(IConstructor constructor, String context)