BrightSide Workbench Full Report + Source Code
AbstractDashboard.java
Go to the documentation of this file.
1
/*
2
* TurrĂ³ i Cutiller Foundation. License notice.
3
* Copyright (C) 2024 Lluis TurrĂ³ Cutiller <http://www.turro.org/>
4
*
5
* This program is free software: you can redistribute it and/or modify
6
* it under the terms of the GNU Affero General Public License as published by
7
* the Free Software Foundation, either version 3 of the License, or
8
* (at your option) any later version.
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU Affero General Public License for more details.
14
*
15
* You should have received a copy of the GNU Affero General Public License
16
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
*/
18
19
package
org.turro.dashboard;
20
21
import
java.io.IOException;
22
import
java.io.PrintWriter;
23
import
javax.servlet.ServletException;
24
import
org.turro.collections.CollectionHtmlIterator;
25
import
org.turro.elephant.impl.abstracts.AbstractElement;
26
31
public
abstract
class
AbstractDashboard
extends
AbstractElement
{
32
33
private
String fullTemplate, summaryTemplate, sclass;
34
private
int
count;
35
private
CollectionHtmlIterator
iterator;
36
37
@Override
38
public
void
loadData
() throws ServletException, IOException {
39
sclass =
getAttributes
().getAttributeValue(
"attrib:sclass"
,
""
);
40
count =
getAttributes
().getAttributeIntegerValue(
"attrib:count"
, 10);
41
fullTemplate =
getAttributes
().getAttributeValue(
"attrib:fullTemplate"
,
""
);
42
summaryTemplate =
getAttributes
().getAttributeValue(
"attrib:summaryTemplate"
,
""
);
43
iterator =
initIterator
();
44
// HtmlSearch dhs = getSearchEngine();
45
// if(dhs != null) {
46
// iterator.setSearchEngine(dhs);
47
// initSearchEngine();
48
// }
49
iterator.
setPage
(count);
50
iterator.
setFullTemplate
(fullTemplate);
51
iterator.
setSummaryTemplate
(summaryTemplate);
52
iterator.
load
();
53
setTitle
(iterator.
getTitle
());
54
if
(iterator.
isItem
()) {
55
setMetas
(iterator.
getMetas
());
56
}
else
{
57
setDefaultMetas
();
58
}
59
}
60
61
public
CollectionHtmlIterator
getIterator
() {
62
return
iterator;
63
}
64
65
public
String
getFullTemplate
() {
66
return
fullTemplate;
67
}
68
69
public
String
getSummaryTemplate
() {
70
return
summaryTemplate;
71
}
72
73
public
int
getCount
() {
74
return
count;
75
}
76
77
public
String
getSclass
() {
78
return
sclass;
79
}
80
81
@Override
82
public
String
getStart
() {
83
return
"<div class='dashboard "
+
getSclass
() +
"'>"
;
84
}
85
86
@Override
87
public
String
getEnd
() {
88
return
"</div>"
;
89
}
90
91
@Override
92
public
void
startConstruction
() throws ServletException, IOException {
93
PrintWriter out =
getConstructor
().
getOut
();
94
out.print(
getStart
());
95
out.print(
getStartBody
());
96
97
// if(!getIterator().isItem()) {
98
// DaoHtmlSearch dhs = getSearchEngine();
99
// if(dhs != null) {
100
// getIterator().setSearchEngine(dhs);
101
// }
102
// }
103
104
getIterator
().
render
();
105
106
out.print(
getEndBody
());
107
out.print(
getEnd
());
108
}
109
110
protected
abstract
CollectionHtmlIterator
initIterator
();
111
protected
abstract
void
initSearchEngine
();
112
113
// protected HtmlSearch getSearchEngine() {
114
// return HtmlSearch.getInstance(getConstructor(), ElephantContext.getContextVariable(getConstructor()));
115
// }
116
117
protected
DashboardContext
getDashboardContext
() {
118
return
DashboardContext
.
getInstance
(
constructor
);
119
}
120
121
}
org.turro.collections.CollectionHtmlIterator
Definition:
CollectionHtmlIterator.java:43
org.turro.collections.CollectionHtmlIterator.isItem
boolean isItem()
Definition:
CollectionHtmlIterator.java:143
org.turro.collections.CollectionHtmlIterator.load
void load()
Definition:
CollectionHtmlIterator.java:163
org.turro.collections.CollectionHtmlIterator.setSummaryTemplate
void setSummaryTemplate(String summaryTemplate)
Definition:
CollectionHtmlIterator.java:75
org.turro.collections.CollectionHtmlIterator.render
void render()
Definition:
CollectionHtmlIterator.java:186
org.turro.collections.CollectionHtmlIterator.getMetas
Collection< String > getMetas()
Definition:
CollectionHtmlIterator.java:181
org.turro.collections.CollectionHtmlIterator.setFullTemplate
void setFullTemplate(String fullTemplate)
Definition:
CollectionHtmlIterator.java:83
org.turro.collections.CollectionHtmlIterator.getTitle
String getTitle()
Definition:
CollectionHtmlIterator.java:177
org.turro.collections.CollectionIterator.setPage
void setPage(int page)
Definition:
CollectionIterator.java:43
org.turro.dashboard.AbstractDashboard
Definition:
AbstractDashboard.java:31
org.turro.dashboard.AbstractDashboard.getEnd
String getEnd()
Definition:
AbstractDashboard.java:87
org.turro.dashboard.AbstractDashboard.initIterator
abstract CollectionHtmlIterator initIterator()
org.turro.dashboard.AbstractDashboard.getSummaryTemplate
String getSummaryTemplate()
Definition:
AbstractDashboard.java:69
org.turro.dashboard.AbstractDashboard.getIterator
CollectionHtmlIterator getIterator()
Definition:
AbstractDashboard.java:61
org.turro.dashboard.AbstractDashboard.getFullTemplate
String getFullTemplate()
Definition:
AbstractDashboard.java:65
org.turro.dashboard.AbstractDashboard.initSearchEngine
abstract void initSearchEngine()
org.turro.dashboard.AbstractDashboard.getCount
int getCount()
Definition:
AbstractDashboard.java:73
org.turro.dashboard.AbstractDashboard.getStart
String getStart()
Definition:
AbstractDashboard.java:82
org.turro.dashboard.AbstractDashboard.getSclass
String getSclass()
Definition:
AbstractDashboard.java:77
org.turro.dashboard.AbstractDashboard.startConstruction
void startConstruction()
Definition:
AbstractDashboard.java:92
org.turro.dashboard.AbstractDashboard.getDashboardContext
DashboardContext getDashboardContext()
Definition:
AbstractDashboard.java:117
org.turro.dashboard.AbstractDashboard.loadData
void loadData()
Definition:
AbstractDashboard.java:38
org.turro.dashboard.DashboardContext
Definition:
DashboardContext.java:28
org.turro.dashboard.DashboardContext.getInstance
static DashboardContext getInstance(IConstructor constructor)
Definition:
DashboardContext.java:32
org.turro.elephant.impl.abstracts.AbstractElement
Definition:
AbstractElement.java:46
org.turro.elephant.impl.abstracts.AbstractElement.getEndBody
String getEndBody()
Definition:
AbstractElement.java:145
org.turro.elephant.impl.abstracts.AbstractElement.getAttributes
AttributeSupport getAttributes()
Definition:
AbstractElement.java:218
org.turro.elephant.impl.abstracts.AbstractElement.setDefaultMetas
void setDefaultMetas()
Definition:
AbstractElement.java:230
org.turro.elephant.impl.abstracts.AbstractElement.getStartBody
String getStartBody()
Definition:
AbstractElement.java:135
org.turro.elephant.impl.abstracts.AbstractElement.setTitle
void setTitle(String title)
Definition:
AbstractElement.java:77
org.turro.elephant.impl.abstracts.AbstractElement.setMetas
void setMetas(Collection< String > metas)
Definition:
AbstractElement.java:87
org.turro.elephant.impl.abstracts.AbstractElement.constructor
IConstructor constructor
Definition:
AbstractElement.java:48
org.turro.elephant.impl.abstracts.AbstractElement.getConstructor
IConstructor getConstructor()
Definition:
AbstractElement.java:97
org.turro.elephant.context.IConstructor.getOut
PrintWriter getOut()
TurroProjects
Public
BrightSide
elephant-www
src
main
java
org
turro
dashboard
AbstractDashboard.java
Generated on Tue Mar 12 2024 07:01:17 for BrightSide by
1.9.1