Book Image

Learning PrimeFaces Extensions Development

By : Sudheer Jonna
Book Image

Learning PrimeFaces Extensions Development

By: Sudheer Jonna

Overview of this book

Table of Contents (14 chapters)
Learning PrimeFaces Extensions Development
About the Author
About the Reviewers

Understanding and implementing fully controlled custom exporter

The custom exporter provides full control to the developer for making the changes according to his requirements and design. You can implement the custom requirements in both PDFExporter and ExcelExporter implementations.

You have to use the Service Loader concept throughout the application to implement the custom exporter feature.

Proceed with the following steps to implement the custom exporter feature:

  1. Create the META-INF folder under the classpath resources folder and create the services folder under the META-INF folder by navigating to Resources | META-INF | Services.

  2. Create the ExporterFactory file with the full absolute path as org.primefaces.extensions.component.exporter.ExporterFactory.

  3. Add the implementation class of ExporterFactory in the web project.

    For example, the JobHub application provided CustomExporterFactory as an implementation of ExporterFactory.

    In the following code, you will call either default or custom file...