sections.exporter.customExporter.xhtml Maven / Gradle / Ivy
The newest version!
This feature enables fully customizable exporter with the required functionalities with the help of Service Loader Concept.
Steps needs to follow:
- Step 1: Create a folder named META-INF under resouces folder.Below META-INF folder create another folder called services.
- Step 2: Creae a file with the name "ExporterFactory" as a service(Fully binary name of the service).
Here it should be org.primefaces.extensions.component.exporter.ExporterFactory.
- Step 3: Provide your own implementaions/providers of Exporter factory anywhere in your project.
And copy the absolute path of custom exporter factory implementation in the ExporterFactory file
How to do : Copy the file content of DefaultExporterFactory and rename the file as CustomExporterFactory.Copy the absolute path org.primefaces.extensions.showcase.util.CustomExporterFactory in ExporterFactory file.
- Step 4: Copy the exporter implementations and add your own changes.And call these custom implementations(Ex PDFCustomExporter,ExcelCustomExporter) instead built-in implmentations(Ex PDFExporter,ExcelExporter)
The below example demonstrates how the index column added using Custom Exporter feature.
${showcase:getFileContent('/sections/exporter/example-customExporterTables.xhtml')}
${showcase:getFileContent('/org/primefaces/extensions/showcase/controller/exporter/MessageTableController.java')}