Package com.groiss.reporting.data.impl
Class DefaultReportingData
java.lang.Object
com.groiss.reporting.export.AbstractReportingExportable
com.groiss.reporting.data.impl.DefaultReportingData
- All Implemented Interfaces:
NumericValue
,ReportingData
,ReportingExportable
,Cloneable
,Comparable<ReportingExportable>
- Direct Known Subclasses:
DateReportingData
,PersistentData
,TimeInterval
public class DefaultReportingData
extends AbstractReportingExportable
implements NumericValue, Cloneable
Parent class of several reporting data classes.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionadd
(NumericValue v2) Adds the Values of two NumericValue Objectsvoid
addClientConditionWidgetOptions
(JSONObject json, boolean paramAtExec, Element condition) add clientcondition attributes to attribute storevoid
addConditionToQuery
(Query q, Element c) Adds the XMLAttribute as a conditon to the query.static void
addIgnoreCaseComponents
(DivComponent root, boolean checked) void
addSelectAttributeToQuery
(Query q, Element select) Adds the XMLAttribute as a select attribute to the query.avg
(long count) Calculates the average of a numeric data.protected void
checkTempJoin
(Query q, String tablename_new, String alias_new, String entity_new, String entity_orig, String alias_orig) static int
int
completeSeries
(Set<ReportingExportable> series, Query q) invoked for matrix-style reports to be able to add missing entries in the givenseries
getAlias()
protected Class<?>
Defines Columnrenderer which implements the render function (used in ep 9.0)static String
protected String
getMappedValue
(Object key) get ALL possible key-value-pairs forAttribute
getAttribute()
key is the value stored in the DB, value is the value used for displaygetOperatorList
(boolean comesFromParamMask) getValue()
boolean
protected boolean
void
void
void
setAttributeHasUserdefinedType
(boolean attributeHasUserdefType) void
protected void
setMappedValue
(String key, String value) set internal fields for a possible mapped value. is used when restoring/completing series incompleteSeries(Set, Query)
by creating synthetic data-instancesvoid
Sets the value for this objectvoid
Sets the value of this object.static String[]
splitValueAttribute
(String value, String operator, boolean paramAtExec) toHtml()
toJson()
Export Data to Json (used in ep 9.0)toString()
toText()
Used for CSV/EXCEL/XML export...Methods inherited from class com.groiss.reporting.export.AbstractReportingExportable
getSortText
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.groiss.reporting.export.ReportingExportable
getSortText
-
Field Details
-
value
-
e
-
a
-
alias
-
dontUseMappedString
protected boolean dontUseMappedString -
attributeHasUserdefType
protected boolean attributeHasUserdefType
-
-
Constructor Details
-
DefaultReportingData
-
DefaultReportingData
public DefaultReportingData()
-
-
Method Details
-
setAttribute
- Specified by:
setAttribute
in interfaceReportingData
- Parameters:
a
- - set the attribute of schema which refers to this object
-
setEntity
- Specified by:
setEntity
in interfaceReportingData
- Parameters:
e
- - set the entity
-
getAttribute
- Specified by:
getAttribute
in interfaceReportingData
- Returns:
- the attribute of schema, which refers to this object
-
getEntity
- Specified by:
getEntity
in interfaceReportingData
- Returns:
- the entity of schema, which contains the attribute
-
setAlias
-
getAlias
-
pairList
-
pairList
-
pairList
-
pairList
-
getDBData
-
toHtml
- Returns:
- the HTML representation of this Object.
-
toString
-
toText
Description copied from interface:ReportingExportable
Used for CSV/EXCEL/XML export...- Specified by:
toText
in interfaceReportingExportable
- Returns:
- the String representation of this Object
-
addSelectAttributeToQuery
Description copied from interface:ReportingData
Adds the XMLAttribute as a select attribute to the query. Has to callQuery.addSelect(String, String, String, String, boolean, boolean)
andQuery.addSelectIndexOfAttrib(Element, int)
!- Specified by:
addSelectAttributeToQuery
in interfaceReportingData
- Parameters:
q
- - the query Object, where select attribute is addedselect
- - the xml element of type attribute
-
checkTempJoin
-
getBaseType
-
addConditionToQuery
Description copied from interface:ReportingData
Adds the XMLAttribute as a conditon to the query. Has to callQuery.addCondition(String, String, String, String, List)
- Specified by:
addConditionToQuery
in interfaceReportingData
- Parameters:
q
- - the query Object, where condtion has to be addedc
- - the xml element of type condition
-
setValue
Description copied from interface:ReportingData
Sets the value of this object. Value is gained from resultset.- Specified by:
setValue
in interfaceReportingData
- Parameters:
rs
- - the result set of the queryselectAttribute
- - the xml-element attribute of the queryq
- - the query object- See Also:
-
compareTo
- Specified by:
compareTo
in interfaceComparable<ReportingExportable>
- Specified by:
compareTo
in interfaceReportingExportable
-
compare2
-
getValue
- Specified by:
getValue
in interfaceReportingExportable
- Returns:
- the value of this object
-
getOperatorList
- Specified by:
getOperatorList
in interfaceReportingData
- Parameters:
comesFromParamMask
- true if list is taken for parameter of execution.- Returns:
- a list of pairs of string representing the available operators. The key string of the pair is the xml representation of the operator, the second string the i18n value.
-
addClientConditionWidgetOptions
public void addClientConditionWidgetOptions(JSONObject json, boolean paramAtExec, Element condition) Description copied from interface:ReportingData
add clientcondition attributes to attribute store- Specified by:
addClientConditionWidgetOptions
in interfaceReportingData
- Parameters:
json
- the json object of this attributeparamAtExec
- indicates if method is called in normal condition or param-at-execution modecondition
- the optional <condition> element. Can be used to mimic special behavior for parameter-at-execution scenarios
-
hasMappedValues
protected boolean hasMappedValues()- Returns:
-
getMappedValues
get ALL possible key-value-pairs forAttribute
getAttribute()
key is the value stored in the DB, value is the value used for display- Returns:
-
getMappedValue
- Returns:
- the mapped value for a single key. will only be called if
hasMappedValues()
istrue
-
setMappedValue
set internal fields for a possible mapped value. is used when restoring/completing series incompleteSeries(Set, Query)
by creating synthetic data-instances- Parameters:
key
- the keyvalue
- the mapped value
-
addIgnoreCaseComponents
-
splitValueAttribute
-
add
Description copied from interface:NumericValue
Adds the Values of two NumericValue Objects- Specified by:
add
in interfaceNumericValue
- Parameters:
v2
- the second NumericValue to add- Returns:
- the Object with the added NumericValue
-
avg
Description copied from interface:NumericValue
Calculates the average of a numeric data.- Specified by:
avg
in interfaceNumericValue
- Parameters:
count
- the amount of NumericValue Objects- Returns:
- a NumericValue Object containing the average value
-
setValue
Description copied from interface:ReportingExportable
Sets the value for this object- Specified by:
setValue
in interfaceReportingExportable
- Parameters:
val
- - the value object
-
getColumnRenderer
Description copied from interface:ReportingExportable
Defines Columnrenderer which implements the render function (used in ep 9.0)- Specified by:
getColumnRenderer
in interfaceReportingExportable
- Returns:
- the dojo-module
-
toJson
Description copied from interface:ReportingExportable
Export Data to Json (used in ep 9.0)- Specified by:
toJson
in interfaceReportingExportable
- Returns:
- the data
-
completeSeries
Description copied from interface:ReportingData
invoked for matrix-style reports to be able to add missing entries in the givenseries
- Specified by:
completeSeries
in interfaceReportingData
- Parameters:
series
- the current values from the DBq
- the query- Returns:
- the full series (e.g. for dates all dates from t1-t2, for persistents all elements of a certain type etc.)
-
setAttributeHasUserdefinedType
public void setAttributeHasUserdefinedType(boolean attributeHasUserdefType) - Parameters:
attributeHasUserdefType
- the attributeHasUserdefType to set
-
hasAttributeUserdefinedType
public boolean hasAttributeUserdefinedType()- Returns:
- the attributeHasUserdefType
-