Klasse ReportService
- Autor:
- Ralph Soika
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungcomputeDynamicDate(String xmlDate) This method parses axml tag and computes a dynamic date by parsing the attributes: DAY_OF_MONTH DAY_OF_YEAR MONTH YEAR ADD (FIELD,OFFSET) customNumberFormat(String pattern, String locale, double value) This method converts a double value into a custom number format including an optional locale.Returns a list of all reports sorted by name.findReport(String reportID) Returns a Report Entity by its identifier.getDataSource(ItemCollection reportEntity, int pageSize, int pageIndex, String sortBy, boolean sortReverse, Map<String, String> params) Returns the data source defined by a report.replaceDateString(String content) This method replaces all occurrences of<date>tags with the corresponding dynamic date.transformDataSource(ItemCollection report, List<ItemCollection> data, String fileName) Transforms a datasource based on the XSL template from a report into a FileData object.voidupdateReport(ItemCollection aReport) updates a Entity Report Object.
-
Konstruktordetails
-
ReportService
public ReportService()
-
-
Methodendetails
-
findReport
Returns a Report Entity by its identifier. The identifier can either be the $uniqueId of the report or the report name. The method returns null if no report with the given identifier exists.- Parameter:
reportID- - name of the report or its $uniqueId.- Gibt zurück:
- ItemCollection representing the Report
-
findAllReports
Returns a list of all reports sorted by name.- Gibt zurück:
- list of ItemCollection objects.
-
updateReport
updates a Entity Report Object. The Entity representing a report must have at least the attributes : txtQuery, numMaxCount, numStartPost, txtName. txtName is the unique key to be use to get a query. The method checks if a report with the same key allready exists. If so this report will be updated. If no report exists the new report will be created- Parameter:
report-
-
getDataSource
public List<ItemCollection> getDataSource(ItemCollection reportEntity, int pageSize, int pageIndex, String sortBy, boolean sortReverse, Map<String, String> params) throws QueryExceptionReturns the data source defined by a report.The method executes the lucene search query defined by the Report. The values of the returned entities will be cloned and formated in case a itemList is provided.
The method parses the attribute txtname for a formating expression to format the item value. E.g.:
datDate<format locale="de" label="Date">yy-dd-mm</format>Optional the lucene search query my contain params which will be replaced by a given param Map:
($created:{date_from})In this example the literal ?{date_from} will be replaced with the given value provided in the param map.
- Parameter:
params- - optional parameter list to be mapped to the JQPL statementreportName- - name of the report to be executedstartPos- - optional start position to query entitiesmaxcount- - optional max count of entities to queryitemList- - optional attribute list of items to be returned- Gibt zurück:
- collection of entities
- Löst aus:
QueryException
-
transformDataSource
public FileData transformDataSource(ItemCollection report, List<ItemCollection> data, String fileName) throws jakarta.xml.bind.JAXBException, IOException, TransformerException Transforms a datasource based on the XSL template from a report into a FileData object.- Parameter:
report- - the report definitiondata- - the data sourcefileName-- Gibt zurück:
- FileData object containing the transformed data source.
- Löst aus:
jakarta.xml.bind.JAXBExceptionTransformerExceptionIOException
-
computeDynamicDate
This method parses axml tag and computes a dynamic date by parsing the attributes: DAY_OF_MONTH DAY_OF_YEAR MONTH YEAR ADD (FIELD,OFFSET) e.g.
<date DAY_OF_MONTH="1" MONTH="2" />results in 1. February of the current year
<date DAY_OF_MONTH="ACTUAL_MAXIMUM" MONTH="12" ADD="MONTH,-1" />results in 30.November of current year
- Parameter:
xmlDate-- Gibt zurück:
-
replaceDateString
This method replaces all occurrences of<date>tags with the corresponding dynamic date. See computeDynamicdate.- Parameter:
content-- Gibt zurück:
-
customNumberFormat
This method converts a double value into a custom number format including an optional locale."###,###.###", "en_UK", 123456.789 "EUR #,###,##0.00", "de_DE", 1456.781- Parameter:
pattern-value-- Gibt zurück:
-