How lowcodemindsglobal/app-appian-plugin-excel-export works
Purpose and deployment model
This is an Appian Smart Service plug-in that executes validated read-only SQL against an Appian JNDI data source and produces a protected multi-sheet .xlsx document. It is packaged as a shaded Maven JAR for Appian 24.4+, with Apache POI relocated to avoid server classpath conflicts. The plug-in descriptor is src/main/resources/appian-plugin.xml; build/dependency policy is defined in pom.xml.
Appian entry point and contract
ProtectedExcelExport is the Smart Service implementation invoked by Appian process models. It exposes inputs for sheet/query definitions, JNDI source, editable-column rules, destination folder/document metadata, formats, styling, and a sheet-protection password.
• src/main/java/com/lowcodeminds/appian/plugins/excel/ProtectedExcelExport.java
• src/main/resources/appian-plugin.xml
• src/main/java/com/lowcodeminds/appian/plugins/excel/SQLSheetData.java
SQLSheetData[] is a plug-in-defined CDT, not a generic map or JSON payload. Each element binds one output sheet name to one SQL SELECT query.
Validation boundary
Before execution, the Smart Service validates the request: sheet count and names, SQL restrictions, required values, and scoped editable-column prefixes. This boundary prevents invalid Excel layouts and rejects unsafe/nonconforming SQL before database access. Validation also ensures a sheetName:column editable rule references an included sheet.
• src/main/java/com/lowcodeminds/appian/plugins/excel/ProtectedExcelExport.java
• src/main/java/com/lowcodeminds/appian/plugins/excel/ExcelExportConfig.java
• src/main/java/com/lowcodeminds/appian/plugins/excel/ExcelGenerationException.java
Configuration normalization
ExcelExportConfig converts Smart Service inputs into generator-oriented configuration, including default date/date-time formats, locked-header color, password, and case-insensitive editable-column matching. Unscoped column names apply to all sheets; sheet-qualified rules are additive and localized to that sheet.
• src/main/java/com/lowcodeminds/appian/plugins/excel/ExcelExportConfig.java
• src/main/java/com/lowcodeminds/appian/plugins/excel/SQLSheetData.java
Query-to-workbook generation
The service resolves the configured JNDI datasource and executes each sheet’s SQL query. Result sets flow into ExcelGenerator, which creates one worksheet per query and maps database values into Excel cells, applying configured date and timestamp number formats.
• src/main/java/com/lowcodeminds/appian/plugins/excel/ProtectedExcelExport.java
• src/main/java/com/lowcodeminds/appian/plugins/excel/ExcelGenerator.java
• src/main/java/com/lowcodeminds/appian/plugins/excel/ExcelExportConfig.java
Protection and document persistence
Workbook protection is column-level: editable data cells are unlocked, while other data cells and headers remain locked; worksheet operations such as row/column insertion and deletion are blocked. The supplied password protects sheet unprotection, rather than encrypting the XLSX file. The completed workbook is saved as an Appian document through Appian Content Service upload APIs into the requested Appian folder.
• src/main/java/com/lowcodeminds/appian/plugins/excel/ExcelGenerator.java
• src/main/java/com/lowcodeminds/appian/plugins/excel/ProtectedExcelExport.java
Platform resources and runtime dependencies
The runtime is the Appian application server: it provides Smart Service APIs, JNDI datasource configuration, Content Service/document storage, and the SLF4J backend. Apache POI is bundled and relocated in the deployable artifact. Appian discovers the service, CDT, compatibility floor, labels, and palette metadata from the descriptor and resource bundle.
• src/main/resources/appian-plugin.xml
• src/main/resources/com/lowcodeminds/plugins/advance-excel-export/protectedExcelExport_en_US.properties
• lib/appian-plug-in-sdk.jar
Main entry points: ProtectedExcelExport.java ProtectedExcelExport · appian-plugin.xml Plug-in descriptor · ExcelGenerator.java ExcelGenerator · pom.xml Maven build policy
Components 17
Appian Integration
- Plug-in descriptor · Registers the Smart Service, CDT, compatibility, and palette metadata.
src/main/resources/appian-plugin.xml - Resource bundle
src/main/resources/com/lowcodeminds/plugins/advance-excel-export/protectedExcelExport_en_US.properties - Appian process model · Invokes the Smart Service with export inputs.
- JNDI datasource
- Appian Content Service · Stores the completed workbook in the requested Appian folder.
- Appian document storage
Smart Service
- ProtectedExcelExport · Validates, queries, generates, and uploads the export.
src/main/java/com/lowcodeminds/appian/plugins/excel/ProtectedExcelExport.java - SQLSheetData[] · Binds each sheet name to one SQL SELECT query.
src/main/java/com/lowcodeminds/appian/plugins/excel/SQLSheetData.java - ExcelExportConfig · Normalizes formats, protection, and editable-column rules.
src/main/java/com/lowcodeminds/appian/plugins/excel/ExcelExportConfig.java - ExcelGenerationException
src/main/java/com/lowcodeminds/appian/plugins/excel/ExcelGenerationException.java
Workbook Pipeline
- Read-only SQL results · One result set is produced per configured sheet query.
- ExcelGenerator · Creates worksheets and maps database values into formatted cells.
src/main/java/com/lowcodeminds/appian/plugins/excel/ExcelGenerator.java - Protected XLSX workbook · Headers and non-editable cells are locked; sheet operations are restricted.
Packaging
- Maven build policy · Defines dependencies and shaded-JAR packaging.
pom.xml - Relocated Apache POI · Shaded to avoid Appian server classpath conflicts.
- Appian plug-in SDK
lib/appian-plug-in-sdk.jar - Deployable shaded JAR · Targets Appian 24.4+.
Connections 21
- Plug-in descriptor → ProtectedExcelExport: registers
- Plug-in descriptor → SQLSheetData[]: declares CDT
- Resource bundle → Plug-in descriptor: supplies labels
- Appian process model → ProtectedExcelExport: invokes
- SQLSheetData[] → ProtectedExcelExport: sheet/query input
- ProtectedExcelExport → ExcelExportConfig: validates and normalizes
- ProtectedExcelExport → ExcelGenerationException: reports invalid export
- ExcelExportConfig → ExcelGenerator: generation rules
- ProtectedExcelExport → JNDI datasource: resolves via JNDI
- JNDI datasource → Read-only SQL results: executes validated SELECTs
- Read-only SQL results → ExcelGenerator: maps results
- ExcelGenerator → Protected XLSX workbook: creates and protects
- ProtectedExcelExport → Appian Content Service: uploads workbook
- Protected XLSX workbook → Appian Content Service: upload payload
- Appian Content Service → Appian document storage: persists
- Maven build policy → Appian plug-in SDK: depends on
- Maven build policy → Relocated Apache POI: shades and relocates
- Maven build policy → Deployable shaded JAR: packages
- Deployable shaded JAR → Plug-in descriptor: contains
- Deployable shaded JAR → ProtectedExcelExport: contains
- Relocated Apache POI → ExcelGenerator: XLSX implementation