Package com.groiss.reporting.data.impl
Class DateReportingData
java.lang.Object
com.groiss.reporting.export.AbstractReportingExportable
com.groiss.reporting.data.impl.DefaultReportingData
com.groiss.reporting.data.impl.DateReportingData
- All Implemented Interfaces:
NumericValue
,ReportingData
,ReportingExportable
,Cloneable
,Comparable<ReportingExportable>
Reporting data type for date values
-
Field Summary
Fields inherited from class com.groiss.reporting.data.impl.DefaultReportingData
a, alias, attributeHasUserdefType, dontUseMappedString, e, value
-
Constructor Summary
ConstructorDescriptionDateReportingData
(Entity e, Attribute a) DateReportingData
(Date d, String df) DateReportingData
(Date d, String df, boolean expand) -
Method Summary
Modifier and TypeMethodDescriptionvoid
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.int
completeSeries
(Set<ReportingExportable> series, Query q) invoked for matrix-style reports to be able to add missing entries in the givenseries
static Collection<ReportingExportable>
completeSeries
(Set<ReportingExportable> series, String dateformat, Date min, Date max, boolean expand) getBeginAndEnd
(Date val, String df) protected static Timestamp
protected static Timestamp
calculate timestamp of implicit conditionstatic JSONPage
static Date
getDateObject
(String date, boolean enddate) static Date
getDateObject
(String date, boolean enddate, TimeZone tz) static JSONPage
static String
static String
getIsoDateString
(Date d, TimeZone tz) getMinMax
(ReportingData rd, Query q) static String
static void
protected void
init()
final boolean
static boolean
isParseEndDateOperator
(String operator) void
setDateformat
(String df) final void
setExpandForDrilldown
(boolean expandForDrilldown) void
Sets the value of this object.toText()
Used for CSV/EXCEL/XML export...Methods inherited from class com.groiss.reporting.data.impl.DefaultReportingData
add, addIgnoreCaseComponents, addSelectAttributeToQuery, avg, checkTempJoin, compare2, getAlias, getAttribute, getBaseType, getColumnRenderer, getDBData, getEntity, getMappedValue, getMappedValues, getOperatorList, getValue, hasAttributeUserdefinedType, hasMappedValues, pairList, pairList, pairList, pairList, setAlias, setAttribute, setAttributeHasUserdefinedType, setEntity, setMappedValue, setValue, splitValueAttribute, toHtml, toJson, toString
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
-
CONDUNITS
-
myCondUnits
-
weekval
-
dateformat
-
expandForDrilldown
protected boolean expandForDrilldown
-
-
Constructor Details
-
DateReportingData
-
DateReportingData
public DateReportingData() -
DateReportingData
-
DateReportingData
-
-
Method Details
-
init
protected void init() -
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
- Overrides:
addClientConditionWidgetOptions
in classDefaultReportingData
- 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
-
setValue
Description copied from interface:ReportingData
Sets the value of this object. Value is gained from resultset.- Specified by:
setValue
in interfaceReportingData
- Overrides:
setValue
in classDefaultReportingData
- Parameters:
rs
- - the result set of the queryselectAttribute
- - the xml-element attribute of the queryq
- - the query object- See Also:
-
setExpandForDrilldown
public final void setExpandForDrilldown(boolean expandForDrilldown) -
isExpandForDrilldown
public final boolean isExpandForDrilldown() -
toText
Description copied from interface:ReportingExportable
Used for CSV/EXCEL/XML export...- Specified by:
toText
in interfaceReportingExportable
- Overrides:
toText
in classDefaultReportingData
- Returns:
- the String representation of this Object
-
getTimeZone
- Returns:
- always returns
ThreadContext.getThreadTimeZone()
-
compareTo
- Specified by:
compareTo
in interfaceComparable<ReportingExportable>
- Specified by:
compareTo
in interfaceReportingExportable
- Overrides:
compareTo
in classDefaultReportingData
-
getSQLPlaceholder
-
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
- Overrides:
addConditionToQuery
in classDefaultReportingData
- Parameters:
q
- - the query Object, where condtion has to be addedc
- - the xml element of type condition
-
getBeginAndEnd
-
getDate
-
getDate
calculate timestamp of implicit condition- Parameters:
startDate
- mostly todayoffset
- the offset to addunit
- the unit of the offsetexact
- true if it should be calculated exactly- Returns:
- the calculated timestamp
-
getDateformat
-
setDateformat
-
getIsoDateString
-
getIsoDateString
-
getDateObject
-
getDateObject
-
getDateDisplayString
-
isParseEndDateOperator
- Parameters:
operator
-- Returns:
-
getExampleDate
-
completeSeries
public static Collection<ReportingExportable> completeSeries(Set<ReportingExportable> series, String dateformat, Date min, Date max, boolean expand) -
increment
-
getMinMax
-
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
- Overrides:
completeSeries
in classDefaultReportingData
- 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.)
-