Reporting Function: Add New Feature Type
From Geoikia-english
Contents |
Introduction
If a map layer or a feature type is added to the WFS, a Jasper Report is also to be made. The chart below shows the steps needed to add a new Feature Type:
Generate subreports for a new Feature Type
The delivery includes a ZIP file called "GeoideUtilities.zip. Unpack the zip file anywhere on your Windows workstation. The directory you choose here will be further described as WORKDIR. The zip file contains the following files:
- JasperReportGenerator.jar
- jasperReportGenerator.bat
- jasperReportGeneratorAll.bat
- rapportage.properties (local-file: multilinguistic)
- rapportageMetadataISO19139.jasper (Help Report)
- Directory “metadata” (includes iso19139-files)
With the batch files (2) and (3), you can set up the jar file (1). To generate a Feature Type use jasperReportGenerator.bat (2). To generate all Feature Types use jasperReportGeneratorAll.bat (3).
Generate subreport
1. Navigate with a dos prompt to the WORKDIR.
2. Enter the following command:
- jasperReportGenerator.bat featuretypeName
In the same directory (WORKDIR), a featuretypeNaam.jrxml file is then generated. You will use this later.
Generate test data
1.Replace 'featuretypenaam' (feature type name) at the very end of the URL below, with the desired name of the Feature Type.
- http://geoloket.milieudienstzou.nl/mdzou2/ogcwebservice?SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&NAMESPACE=xmlns(app=http://www.deegree.org/app)MAXFEATURES=30&&TYPENAME=featuretypenaam
2. Then paste the customized URL in your browser.
3. Save the response of the URL to a file for instance called “featuretypeNaam.xml”. Do this in the browser by clicking on File → Save As. Save this file in the WORKDIR.
Generate iso metadata file
You can generate an iso metadata file from (for instance) a shape file. Do this by means of the save as function in ArcGIS 9.3 to import and store metadata in the iso 19139 format.
1. Generate the metadata file according the following naming convention:
A metadata file must have a filename equal to the name of the feature type with the suffix/extension ".iso.xml"
2. Place this file in the directory "metadata". This directory is a subdirectory of the WORKDIR.
Generate custom report by iReport
1. Start iReport and open the newly generated featuretypeNaam.jrxml
2. Create a new data source by clicking on the button circled in red:
3. Click on New and select the XML file data source.
4. Click on Next.
5. Type in the name of the feature type.
6. Browse to the file featuretypeNaam.xml and select it.
7. Select Use the report when XPath expression filling the report.
8. Fill in at date pattern "yyyy-MM-dd'T'HH:mm:ss.SSS".
9. Number pattern to fill in "###0".
10. Click on Save.
11. Close the window Connections/Data Sources
- At this point, you have opened a report and configured an associated data source. Because the specified data source is intended for this feature type, you can test it with real data and see whether it matches with the report requirements.
Before the report can be generated, you must initialize the report parameters. The only parameter which has to have a value is the parameter FULLY_QUALIFIED_METADATA_PATH. This should be in the path of the WORKDIR/metadata. Follow these steps to adjust this parameter’s value:
12. Click on View → Reportparameters
13.(Scroll down and) double click on the parameter FULLY_QUALIFIED_METADATA_PATH
14. Fill the Default Value Expression with the full path to the WORKDIR/metadata, surrounded by double quotes. N.B.: Use forward slashes in the path:
15. Click on OK.
16. Close the parameter window.
Now you have generated and configured all needed for executing the report. Run the report:
17. Click on:
- Now a report is displayed.
18. You can then customize the report according to your needs. For example, change titles and add fields/columns.
19. Run the report again to see if your changes are correct.
In order to find the compiled reports you can preferably check the option Use the report directory to compile. The compiled reports are then written to the WORKDIR:
20. Click on Options → Options
21. Select the tab Compiler:
22. Check Use the report to compile directory.
Delivering report to web-application
You can now deliver a file featuretypeNaam.jasper to the web application.
1. Navigate to the WORKDIR and copy the featuretypeNaam.jasper file to the Geoide web-application on the test-server and also in the directory where the Geoide web application is installed.
2. Then copy featuretypeNaam.jasper to the directory: WEB-INF/reports/subreports
3. Also copy the iso-file to the directory: metadata
> Main Page > Configuring the Geoide Viewer with the Geoide Author > Reporting Function > Reporting Function: Add New Feature Type








