# lowcodemindsglobal/app-appian-plugin-excel-export architecture

> Architecture diagram of the GitHub repository lowcodemindsglobal/app-appian-plugin-excel-export, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/lowcodemindsglobal/app-appian-plugin-excel-export
- Repository: https://github.com/lowcodemindsglobal/app-appian-plugin-excel-export

## Overview

#### 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: [`src/main/java/com/lowcodeminds/appian/plugins/excel/ProtectedExcelExport.java`](https://github.com/lowcodemindsglobal/app-appian-plugin-excel-export/blob/main/src/main/java/com/lowcodeminds/appian/plugins/excel/ProtectedExcelExport.java) (ProtectedExcelExport), [`src/main/resources/appian-plugin.xml`](https://github.com/lowcodemindsglobal/app-appian-plugin-excel-export/blob/main/src/main/resources/appian-plugin.xml) (Plug-in descriptor), [`src/main/java/com/lowcodeminds/appian/plugins/excel/ExcelGenerator.java`](https://github.com/lowcodemindsglobal/app-appian-plugin-excel-export/blob/main/src/main/java/com/lowcodeminds/appian/plugins/excel/ExcelGenerator.java) (ExcelGenerator), [`pom.xml`](https://github.com/lowcodemindsglobal/app-appian-plugin-excel-export/blob/main/pom.xml) (Maven build policy)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_appian["Appian Integration"]
  node_descriptor["Plug-in descriptor<br/>Appian metadata<br/>[appian-plugin.xml]"]
  node_labels["Resource bundle<br/>localized labels"]
  node_process["Appian process model<br/>caller"]
  node_datasource[("JNDI datasource<br/>Appian-managed database access")]
  node_content_service["Appian Content Service<br/>document upload API"]
  node_document_store[("Appian document storage<br/>document repository")]
end

subgraph group_service["Smart Service"]
  node_service_entry{{"ProtectedExcelExport<br/>Smart Service"}}
  node_sheet_data["SQLSheetData&#91;&#93;<br/>plug-in CDT<br/>[SQLSheetData.java]"]
  node_config["ExcelExportConfig<br/>configuration model"]
  node_export_error["ExcelGenerationException<br/>domain exception"]
end

subgraph group_generation["Workbook Pipeline"]
  node_queries["Read-only SQL results<br/>result sets"]
  node_generator["ExcelGenerator<br/>workbook generator"]
  node_protected_workbook["Protected XLSX workbook<br/>generated document"]
end

subgraph group_build["Packaging"]
  node_pom["Maven build policy<br/>build descriptor<br/>[pom.xml]"]
  node_poi["Relocated Apache POI<br/>bundled XLSX library"]
  node_sdk["Appian plug-in SDK<br/>compile-time SDK"]
  node_plugin_jar["Deployable shaded JAR<br/>Appian plug-in artifact"]
end

node_descriptor -->|"registers"| node_service_entry
node_descriptor -->|"declares CDT"| node_sheet_data
node_labels -->|"supplies labels"| node_descriptor
node_process -->|"invokes"| node_service_entry
node_sheet_data -->|"sheet/query input"| node_service_entry
node_service_entry -->|"validates and normalizes"| node_config
node_service_entry -.->|"reports invalid export"| node_export_error
node_config -->|"generation rules"| node_generator
node_service_entry -->|"resolves via JNDI"| node_datasource
node_datasource -->|"executes validated SELECTs"| node_queries
node_queries -->|"maps results"| node_generator
node_generator -->|"creates and protects"| node_protected_workbook
node_service_entry -->|"uploads workbook"| node_content_service
node_protected_workbook -->|"upload payload"| node_content_service
node_content_service -->|"persists"| node_document_store
node_pom -->|"depends on"| node_sdk
node_pom -->|"shades and relocates"| node_poi
node_pom -->|"packages"| node_plugin_jar
node_plugin_jar -->|"contains"| node_descriptor
node_plugin_jar -->|"contains"| node_service_entry
node_poi -->|"XLSX implementation"| node_generator

click node_descriptor "https://github.com/lowcodemindsglobal/app-appian-plugin-excel-export/blob/main/src/main/resources/appian-plugin.xml"
click node_labels "https://github.com/lowcodemindsglobal/app-appian-plugin-excel-export/blob/main/src/main/resources/com/lowcodeminds/plugins/advance-excel-export/protectedExcelExport_en_US.properties"
click node_service_entry "https://github.com/lowcodemindsglobal/app-appian-plugin-excel-export/blob/main/src/main/java/com/lowcodeminds/appian/plugins/excel/ProtectedExcelExport.java"
click node_sheet_data "https://github.com/lowcodemindsglobal/app-appian-plugin-excel-export/blob/main/src/main/java/com/lowcodeminds/appian/plugins/excel/SQLSheetData.java"
click node_config "https://github.com/lowcodemindsglobal/app-appian-plugin-excel-export/blob/main/src/main/java/com/lowcodeminds/appian/plugins/excel/ExcelExportConfig.java"
click node_export_error "https://github.com/lowcodemindsglobal/app-appian-plugin-excel-export/blob/main/src/main/java/com/lowcodeminds/appian/plugins/excel/ExcelGenerationException.java"
click node_generator "https://github.com/lowcodemindsglobal/app-appian-plugin-excel-export/blob/main/src/main/java/com/lowcodeminds/appian/plugins/excel/ExcelGenerator.java"
click node_pom "https://github.com/lowcodemindsglobal/app-appian-plugin-excel-export/blob/main/pom.xml"
click node_sdk "https://github.com/lowcodemindsglobal/app-appian-plugin-excel-export/blob/main/lib/appian-plug-in-sdk.jar"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_descriptor,node_labels,node_process,node_datasource,node_content_service,node_document_store toneBlue
class node_service_entry,node_sheet_data,node_config,node_export_error toneAmber
class node_queries,node_generator,node_protected_workbook toneMint
class node_pom,node_poi,node_sdk,node_plugin_jar toneRose
```

## Components

### Appian Integration

- [Plug-in descriptor](https://github.com/lowcodemindsglobal/app-appian-plugin-excel-export/blob/main/src/main/resources/appian-plugin.xml): Appian metadata · Registers the Smart Service, CDT, compatibility, and palette metadata. · `src/main/resources/appian-plugin.xml`
- [Resource bundle](https://github.com/lowcodemindsglobal/app-appian-plugin-excel-export/blob/main/src/main/resources/com/lowcodeminds/plugins/advance-excel-export/protectedExcelExport_en_US.properties): localized labels · `src/main/resources/com/lowcodeminds/plugins/advance-excel-export/protectedExcelExport_en_US.properties`
- **Appian process model**: caller · Invokes the Smart Service with export inputs.
- **JNDI datasource**: Appian-managed database access
- **Appian Content Service**: document upload API · Stores the completed workbook in the requested Appian folder.
- **Appian document storage**: document repository

### Smart Service

- [ProtectedExcelExport](https://github.com/lowcodemindsglobal/app-appian-plugin-excel-export/blob/main/src/main/java/com/lowcodeminds/appian/plugins/excel/ProtectedExcelExport.java): Smart Service · Validates, queries, generates, and uploads the export. · `src/main/java/com/lowcodeminds/appian/plugins/excel/ProtectedExcelExport.java`
- [SQLSheetData[]](https://github.com/lowcodemindsglobal/app-appian-plugin-excel-export/blob/main/src/main/java/com/lowcodeminds/appian/plugins/excel/SQLSheetData.java): plug-in CDT · Binds each sheet name to one SQL SELECT query. · `src/main/java/com/lowcodeminds/appian/plugins/excel/SQLSheetData.java`
- [ExcelExportConfig](https://github.com/lowcodemindsglobal/app-appian-plugin-excel-export/blob/main/src/main/java/com/lowcodeminds/appian/plugins/excel/ExcelExportConfig.java): configuration model · Normalizes formats, protection, and editable-column rules. · `src/main/java/com/lowcodeminds/appian/plugins/excel/ExcelExportConfig.java`
- [ExcelGenerationException](https://github.com/lowcodemindsglobal/app-appian-plugin-excel-export/blob/main/src/main/java/com/lowcodeminds/appian/plugins/excel/ExcelGenerationException.java): domain exception · `src/main/java/com/lowcodeminds/appian/plugins/excel/ExcelGenerationException.java`

### Workbook Pipeline

- **Read-only SQL results**: result sets · One result set is produced per configured sheet query.
- [ExcelGenerator](https://github.com/lowcodemindsglobal/app-appian-plugin-excel-export/blob/main/src/main/java/com/lowcodeminds/appian/plugins/excel/ExcelGenerator.java): workbook generator · Creates worksheets and maps database values into formatted cells. · `src/main/java/com/lowcodeminds/appian/plugins/excel/ExcelGenerator.java`
- **Protected XLSX workbook**: generated document · Headers and non-editable cells are locked; sheet operations are restricted.

### Packaging

- [Maven build policy](https://github.com/lowcodemindsglobal/app-appian-plugin-excel-export/blob/main/pom.xml): build descriptor · Defines dependencies and shaded-JAR packaging. · `pom.xml`
- **Relocated Apache POI**: bundled XLSX library · Shaded to avoid Appian server classpath conflicts.
- [Appian plug-in SDK](https://github.com/lowcodemindsglobal/app-appian-plugin-excel-export/blob/main/lib/appian-plug-in-sdk.jar): compile-time SDK · `lib/appian-plug-in-sdk.jar`
- **Deployable shaded JAR**: Appian plug-in artifact · Targets Appian 24.4+.

## Connections

- 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
