Summary: Converting an address book from a XML format to PDF
Creating an appropriate XML file for Apache FOP and adding a Java method, the developer should add a button to the Main Window to parse the all XML files (contact information( in a given directory (db/contacts/) and generate a single PDF.
Pre-requisites: A fair knowledge of Java SE and of a basic configuration of Apache FOP ([login to view URL]) are required to complete the assignment.
## Deliverables
Use case:
1) The user has all her / his contacts in a given XML format (that you cannot modify as it's a standard) that are in the db/contacts folder. Three xml files as example are attached. Assume that all the available tags are used in the examples.
1222604443796-2
1222604443796-1
1222604443796-0
Note: the file can have whatever name and do not have a xml estension (actually they have no extension at all). All the file in the given directory are XML and should be parsed
2) The user click on a "generate PDF" button in the main window of the GUI (not working / complete example of [login to view URL] is attached, let me know if you need more info).
3) A single PDF is generate that should be similar (don't worry too much about font & size, as long the output is reasonable) to the [login to view URL] attached(the OpenOffice I used to make it is attached as well). Possibly the user should be prompt where to save the file or the file should be open with the default viewer in the current window or the application should let know the user that the process is completed and where the file is.
- Empty fields should NOT be displayed in the output as for the given example.
- Fields that are not in the examples should be ignored but the export process should not fail
4) During the processing the button should be disabled and enabled again at the end:
[login to view URL](false);
(code missing...)
[login to view URL](true);
I will take myself to integrate the button / method in the real Ui and the FOP jar in the classpath but apart from that the code should be fully working, aka with instruction on where to deploy the XML files or any other required artifact.
Expert result:
- one xml file for FOP
- one (or more) method(s) for the new button in the UI that start the FOP conversion for all the files in the given directory.