# 4pointsolutions/fluentformsapi architecture

> Architecture diagram of the GitHub repository 4pointsolutions/fluentformsapi, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/4pointsolutions/fluentformsapi
- Repository: https://github.com/4pointsolutions/fluentformsapi

## Overview

#### Purpose and deployment model
This monorepo provides Java integrations for on-premise Adobe Experience Manager (AEM) Forms: a fluent in-process API, AEM-hosted REST endpoints, Java REST clients, and Spring Boot starters. The core and REST-server artifacts are deployed as OSGi bundles into AEM; client and Spring layers run externally and call AEM over HTTP. Maven reactor roots are `pom.xml`, `fluentforms/pom.xml`, `rest-services/pom.xml`, and `spring/pom.xml`.

#### Layered entry points
Consumers select one of four progressively higher-level entry paths:
- **AEM OSGi fluent API:** service factory and document abstractions for bundle developers: `fluentforms/core/src/main/java/com/_4point/aem/fluentforms/factory/ServerFactory.java`, `fluentforms/core/src/main/java/com/_4point/aem/fluentforms/api/Document.java`.
- **AEM REST server:** servlet-style resource classes expose document operations remotely: `rest-services/server/src/main/java/com/_4point/aem/docservices/rest_services/server/forms/RenderPdfForm.java`, `rest-services/server/src/main/java/com/_4point/aem/docservices/rest_services/server/output/GeneratePdfOutput.java`.
- **Java REST client:** adapters translate fluent service calls to REST requests: `rest-services/client/src/main/java/com/_4point/aem/docservices/rest_services/client/RestClient.java`, `rest-services/jersey-client/src/main/java/com/_4point/aem/docservices/rest_services/client/jersey/JerseyRestClient.java`.
- **Spring Boot:** auto-configured beans, proxy endpoints, and sample application entry points: `spring/fluentforms-spring-boot-autoconfigure/src/main/java/com/_4point/aem/fluentforms/spring/FluentFormsAutoConfiguration.java`, `spring/fluentforms-sample-cli-app/src/main/java/com/_4point/aem/fluentforms/sampleapp/SimpleSampleApplication.java`.

#### Fluent Forms core boundary
`fluentforms/core` defines typed service contracts and options around AEM’s native Forms APIs. Major domains are forms, assembler/PDF-A, PDF conversion, document assurance, PDF generation, output, and PDF utilities; representative contracts are `fluentforms/core/src/main/java/com/_4point/aem/fluentforms/api/forms/FormsService.java`, `fluentforms/core/src/main/java/com/_4point/aem/fluentforms/api/assembler/AssemblerService.java`, and `fluentforms/core/src/main/java/com/_4point/aem/fluentforms/api/output/OutputService.java`.

For each domain, public interfaces/options are separated from implementations. `*ServiceImpl` delegates through Adobe adapters, while “Traditional” implementations bind the existing AEM APIs; safe wrappers isolate exceptions/unsafe behavior. Examples: `fluentforms/core/src/main/java/com/_4point/aem/fluentforms/impl/forms/FormsServiceImpl.java`, `fluentforms/core/src/main/java/com/_4point/aem/fluentforms/impl/forms/AdobeFormsServiceAdapter.java`, `fluentforms/core/src/main/java/com/_4point/aem/fluentforms/impl/forms/SafeFormsServiceAdapterWrapper.java`.

#### REST request/response flow
External clients construct a configured `RestClient` and domain adapter; adapters serialize documents, template/data parameters, and options into HTTP requests to AEM REST resources. Server resources parse transport concerns then invoke Fluent Forms/AEM services and return document or operation results. Shared HTTP and parameter handling lives at the server boundary: `rest-services/server/src/main/java/com/_4point/aem/docservices/rest_services/server/FormParameters.java`, `rest-services/server/src/main/java/com/_4point/aem/docservices/rest_services/server/ServletUtils.java`.

`DataCache` is the notable stateful server subsystem, supporting cached request data/prefill beyond otherwise request-oriented transformations: `rest-services/server/src/main/java/com/_4point/aem/docservices/rest_services/server/data/DataCache.java`, `rest-services/server/src/main/java/com/_4point/aem/docservices/rest_services/server/data/DataCacheService.java`.

#### Spring integration and proxying
The default Spring Boot integration configures Fluent Forms service beans plus Spring `RestClient` transport; the Jersey variant substitutes Jersey transport and proxy handling. Auto-configuration is registered through `META-INF/spring` imports. Key boundaries: `spring/fluentforms-spring-boot-autoconfigure/src/main/java/com/_4point/aem/fluentforms/spring/AemConfiguration.java`, `spring/fluentforms-spring-boot-autoconfigure/src/main/java/com/_4point/aem/fluentforms/spring/AemProxyEndpoint.java`, `spring/fluentforms-jersey-spring-boot-autoconfigure/src/main/java/com/_4point/aem/fluentforms/spring/FluentFormsJerseyAutoConfiguration.java`.

Sample MVC and Jersey apps demonstrate application-owned endpoints, adaptive-form submission handling, and pluggable local/in-memory data persistence rather than being production platform modules.

#### Runtime and infrastructure
Material runtimes are Java 17/21, AEM 6.5 LTS as the OSGi host and Adobe Forms provider, Maven artifacts, and Spring Boot 4.x for starter consumers. Network boundaries include REST calls from external Java/Spring applications to AEM and optional reverse-proxy endpoints for AEM form assets/submissions. Artifacts are built/deployed through GitHub Actions workflows, notably `.github/workflows/build-and-deploy-all.yml`, and published/retrieved via GitHub Packages.

Main entry points: [`fluentforms/core/src/main/java/com/_4point/aem/fluentforms/api/forms/FormsService.java`](https://github.com/4pointsolutions/fluentformsapi/blob/master/fluentforms/core/src/main/java/com/_4point/aem/fluentforms/api/forms/FormsService.java) (Typed service contracts), [`rest-services/server/src/main/java/com/_4point/aem/docservices/rest_services/server/forms/RenderPdfForm.java`](https://github.com/4pointsolutions/fluentformsapi/blob/master/rest-services/server/src/main/java/com/_4point/aem/docservices/rest_services/server/forms/RenderPdfForm.java) (REST resources), [`.github/workflows/build-and-deploy-all.yml`](https://github.com/4pointsolutions/fluentformsapi/blob/master/.github/workflows/build-and-deploy-all.yml) (GitHub Actions), [`rest-services/client/src/main/java/com/_4point/aem/docservices/rest_services/client/RestClient.java`](https://github.com/4pointsolutions/fluentformsapi/blob/master/rest-services/client/src/main/java/com/_4point/aem/docservices/rest_services/client/RestClient.java) (REST client abstraction)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_aem["AEM OSGi runtime"]
  node_fluent_factory["Fluent service factory<br/>OSGi API entry point<br/>[ServerFactory.java]"]
  node_document_api["Document abstraction<br/>core API<br/>[Document.java]"]
  node_service_contracts["Typed service contracts<br/>core API<br/>[FormsService.java]"]
  node_service_impl["Service implementations<br/>core implementation"]
  node_safe_adapters["Safe Adobe adapters<br/>AEM adapter layer"]
  node_adobe_forms["Adobe Forms APIs<br/>AEM provider"]
  node_rest_resources["REST resources<br/>AEM REST server<br/>[RenderPdfForm.java]"]
  node_server_transport["Server transport handling<br/>REST boundary"]
  node_data_cache[("Request data cache<br/>stateful server service")]
end

subgraph group_external["External Java runtime"]
  node_rest_client["REST client abstraction<br/>Java client API<br/>[RestClient.java]"]
  node_jersey_client["Jersey transport<br/>REST client implementation"]
  node_spring_autoconfig["Spring auto-configuration<br/>Spring Boot starter"]
  node_spring_proxy["AEM proxy endpoint<br/>Spring endpoint"]
  node_spring_jersey["Spring Jersey variant<br/>Spring Boot starter"]
  node_sample_apps["Sample applications<br/>Spring applications"]
end

subgraph group_delivery["Build and delivery"]
  node_maven{{"Maven reactor<br/>build<br/>[pom.xml]"}}
  node_github_actions{{"GitHub Actions<br/>ci pipeline"}}
  node_packages[("GitHub Packages<br/>artifact registry")]
end

node_maven -->|"build workflow"| node_github_actions
node_github_actions -->|"publishes artifacts"| node_packages
node_packages -.->|"starter dependency"| node_spring_autoconfig
node_github_actions -->|"deploys OSGi bundle"| node_fluent_factory
node_fluent_factory -->|"creates services"| node_service_contracts
node_service_contracts -->|"uses documents"| node_document_api
node_service_contracts -->|"implemented by"| node_service_impl
node_service_impl -->|"delegates through"| node_safe_adapters
node_safe_adapters -->|"invokes"| node_adobe_forms
node_rest_resources -->|"uses"| node_server_transport
node_server_transport -->|"reads and stores prefill data"| node_data_cache
node_rest_resources -->|"invokes Fluent services"| node_service_contracts
node_rest_client -->|"HTTP requests to AEM"| node_rest_resources
node_jersey_client -->|"implements transport"| node_rest_client
node_spring_autoconfig -->|"configures beans"| node_rest_client
node_spring_jersey -->|"configures"| node_jersey_client
node_sample_apps -->|"uses starter"| node_spring_autoconfig
node_sample_apps -->|"exposes application endpoints"| node_spring_proxy
node_spring_proxy -.->|"proxies AEM HTTP"| node_rest_resources

click node_maven "https://github.com/4pointsolutions/fluentformsapi/blob/master/pom.xml"
click node_github_actions "https://github.com/4pointsolutions/fluentformsapi/blob/master/.github/workflows/build-and-deploy-all.yml"
click node_fluent_factory "https://github.com/4pointsolutions/fluentformsapi/blob/master/fluentforms/core/src/main/java/com/_4point/aem/fluentforms/factory/ServerFactory.java"
click node_document_api "https://github.com/4pointsolutions/fluentformsapi/blob/master/fluentforms/core/src/main/java/com/_4point/aem/fluentforms/api/Document.java"
click node_service_contracts "https://github.com/4pointsolutions/fluentformsapi/blob/master/fluentforms/core/src/main/java/com/_4point/aem/fluentforms/api/forms/FormsService.java"
click node_service_impl "https://github.com/4pointsolutions/fluentformsapi/blob/master/fluentforms/core/src/main/java/com/_4point/aem/fluentforms/impl/forms/FormsServiceImpl.java"
click node_safe_adapters "https://github.com/4pointsolutions/fluentformsapi/blob/master/fluentforms/core/src/main/java/com/_4point/aem/fluentforms/impl/forms/SafeFormsServiceAdapterWrapper.java"
click node_rest_resources "https://github.com/4pointsolutions/fluentformsapi/blob/master/rest-services/server/src/main/java/com/_4point/aem/docservices/rest_services/server/forms/RenderPdfForm.java"
click node_server_transport "https://github.com/4pointsolutions/fluentformsapi/blob/master/rest-services/server/src/main/java/com/_4point/aem/docservices/rest_services/server/FormParameters.java"
click node_data_cache "https://github.com/4pointsolutions/fluentformsapi/blob/master/rest-services/server/src/main/java/com/_4point/aem/docservices/rest_services/server/data/DataCacheService.java"
click node_rest_client "https://github.com/4pointsolutions/fluentformsapi/blob/master/rest-services/client/src/main/java/com/_4point/aem/docservices/rest_services/client/RestClient.java"
click node_jersey_client "https://github.com/4pointsolutions/fluentformsapi/blob/master/rest-services/jersey-client/src/main/java/com/_4point/aem/docservices/rest_services/client/jersey/JerseyRestClient.java"
click node_spring_autoconfig "https://github.com/4pointsolutions/fluentformsapi/blob/master/spring/fluentforms-spring-boot-autoconfigure/src/main/java/com/_4point/aem/fluentforms/spring/FluentFormsAutoConfiguration.java"
click node_spring_proxy "https://github.com/4pointsolutions/fluentformsapi/blob/master/spring/fluentforms-spring-boot-autoconfigure/src/main/java/com/_4point/aem/fluentforms/spring/AemProxyEndpoint.java"
click node_spring_jersey "https://github.com/4pointsolutions/fluentformsapi/blob/master/spring/fluentforms-jersey-spring-boot-autoconfigure/src/main/java/com/_4point/aem/fluentforms/spring/FluentFormsJerseyAutoConfiguration.java"
click node_sample_apps "https://github.com/4pointsolutions/fluentformsapi/blob/master/spring/fluentforms-sample-cli-app/src/main/java/com/_4point/aem/fluentforms/sampleapp/SimpleSampleApplication.java"

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_fluent_factory,node_document_api,node_service_contracts,node_service_impl,node_safe_adapters,node_adobe_forms,node_rest_resources,node_server_transport,node_data_cache toneBlue
class node_rest_client,node_jersey_client,node_spring_autoconfig,node_spring_proxy,node_spring_jersey,node_sample_apps toneAmber
class node_maven,node_github_actions,node_packages toneMint
```

## Components

### AEM OSGi runtime

Bundles deployed into AEM 6.5 LTS.

- [Fluent service factory](https://github.com/4pointsolutions/fluentformsapi/blob/master/fluentforms/core/src/main/java/com/_4point/aem/fluentforms/factory/ServerFactory.java): OSGi API entry point · Creates in-process Fluent Forms services. · `fluentforms/core/src/main/java/com/_4point/aem/fluentforms/factory/ServerFactory.java`
- [Document abstraction](https://github.com/4pointsolutions/fluentformsapi/blob/master/fluentforms/core/src/main/java/com/_4point/aem/fluentforms/api/Document.java): core API · Typed document input and output boundary. · `fluentforms/core/src/main/java/com/_4point/aem/fluentforms/api/Document.java`
- [Typed service contracts](https://github.com/4pointsolutions/fluentformsapi/blob/master/fluentforms/core/src/main/java/com/_4point/aem/fluentforms/api/forms/FormsService.java): core API · Forms, assembler, output, conversion, assurance, and utility contracts. · `fluentforms/core/src/main/java/com/_4point/aem/fluentforms/api/forms/FormsService.java`
- [Service implementations](https://github.com/4pointsolutions/fluentformsapi/blob/master/fluentforms/core/src/main/java/com/_4point/aem/fluentforms/impl/forms/FormsServiceImpl.java): core implementation · Domain implementations delegate to Adobe adapters. · `fluentforms/core/src/main/java/com/_4point/aem/fluentforms/impl/forms/FormsServiceImpl.java`
- [Safe Adobe adapters](https://github.com/4pointsolutions/fluentformsapi/blob/master/fluentforms/core/src/main/java/com/_4point/aem/fluentforms/impl/forms/SafeFormsServiceAdapterWrapper.java): AEM adapter layer · Wraps native Forms APIs and isolates unsafe behavior. · `fluentforms/core/src/main/java/com/_4point/aem/fluentforms/impl/forms/SafeFormsServiceAdapterWrapper.java`
- **Adobe Forms APIs**: AEM provider · Native on-premise AEM Forms services.
- [REST resources](https://github.com/4pointsolutions/fluentformsapi/blob/master/rest-services/server/src/main/java/com/_4point/aem/docservices/rest_services/server/forms/RenderPdfForm.java): AEM REST server · Exposes document operations over HTTP. · `rest-services/server/src/main/java/com/_4point/aem/docservices/rest_services/server/forms/RenderPdfForm.java`
- [Server transport handling](https://github.com/4pointsolutions/fluentformsapi/blob/master/rest-services/server/src/main/java/com/_4point/aem/docservices/rest_services/server/FormParameters.java): REST boundary · Parses parameters and handles servlet concerns. · `rest-services/server/src/main/java/com/_4point/aem/docservices/rest_services/server/FormParameters.java`
- [Request data cache](https://github.com/4pointsolutions/fluentformsapi/blob/master/rest-services/server/src/main/java/com/_4point/aem/docservices/rest_services/server/data/DataCacheService.java): stateful server service · Caches request data and prefill content. · `rest-services/server/src/main/java/com/_4point/aem/docservices/rest_services/server/data/DataCacheService.java`

### External Java runtime

Client and Spring applications run outside AEM.

- [REST client abstraction](https://github.com/4pointsolutions/fluentformsapi/blob/master/rest-services/client/src/main/java/com/_4point/aem/docservices/rest_services/client/RestClient.java): Java client API · Configures transport and domain adapters. · `rest-services/client/src/main/java/com/_4point/aem/docservices/rest_services/client/RestClient.java`
- [Jersey transport](https://github.com/4pointsolutions/fluentformsapi/blob/master/rest-services/jersey-client/src/main/java/com/_4point/aem/docservices/rest_services/client/jersey/JerseyRestClient.java): REST client implementation · Jersey-backed client transport variant. · `rest-services/jersey-client/src/main/java/com/_4point/aem/docservices/rest_services/client/jersey/JerseyRestClient.java`
- [Spring auto-configuration](https://github.com/4pointsolutions/fluentformsapi/blob/master/spring/fluentforms-spring-boot-autoconfigure/src/main/java/com/_4point/aem/fluentforms/spring/FluentFormsAutoConfiguration.java): Spring Boot starter · Provides Fluent Forms beans and default REST transport. · `spring/fluentforms-spring-boot-autoconfigure/src/main/java/com/_4point/aem/fluentforms/spring/FluentFormsAutoConfiguration.java`
- [AEM proxy endpoint](https://github.com/4pointsolutions/fluentformsapi/blob/master/spring/fluentforms-spring-boot-autoconfigure/src/main/java/com/_4point/aem/fluentforms/spring/AemProxyEndpoint.java): Spring endpoint · Optional reverse proxy for AEM form assets and submissions. · `spring/fluentforms-spring-boot-autoconfigure/src/main/java/com/_4point/aem/fluentforms/spring/AemProxyEndpoint.java`
- [Spring Jersey variant](https://github.com/4pointsolutions/fluentformsapi/blob/master/spring/fluentforms-jersey-spring-boot-autoconfigure/src/main/java/com/_4point/aem/fluentforms/spring/FluentFormsJerseyAutoConfiguration.java): Spring Boot starter · Substitutes Jersey transport and proxy handling. · `spring/fluentforms-jersey-spring-boot-autoconfigure/src/main/java/com/_4point/aem/fluentforms/spring/FluentFormsJerseyAutoConfiguration.java`
- [Sample applications](https://github.com/4pointsolutions/fluentformsapi/blob/master/spring/fluentforms-sample-cli-app/src/main/java/com/_4point/aem/fluentforms/sampleapp/SimpleSampleApplication.java): Spring applications · Demonstrate MVC, Jersey, submissions, and local persistence. · `spring/fluentforms-sample-cli-app/src/main/java/com/_4point/aem/fluentforms/sampleapp/SimpleSampleApplication.java`

### Build and delivery

- [Maven reactor](https://github.com/4pointsolutions/fluentformsapi/blob/master/pom.xml): build · Builds the monorepo artifacts. · `pom.xml`
- [GitHub Actions](https://github.com/4pointsolutions/fluentformsapi/blob/master/.github/workflows/build-and-deploy-all.yml): ci pipeline · Builds, deploys, and publishes artifacts. · `.github/workflows/build-and-deploy-all.yml`
- **GitHub Packages**: artifact registry

## Connections

- Maven reactor → GitHub Actions: build workflow
- GitHub Actions → GitHub Packages: publishes artifacts
- GitHub Packages → Spring auto-configuration: starter dependency
- GitHub Actions → Fluent service factory: deploys OSGi bundle
- Fluent service factory → Typed service contracts: creates services
- Typed service contracts → Document abstraction: uses documents
- Typed service contracts → Service implementations: implemented by
- Service implementations → Safe Adobe adapters: delegates through
- Safe Adobe adapters → Adobe Forms APIs: invokes
- REST resources → Server transport handling: uses
- Server transport handling → Request data cache: reads and stores prefill data
- REST resources → Typed service contracts: invokes Fluent services
- REST client abstraction → REST resources: HTTP requests to AEM
- Jersey transport → REST client abstraction: implements transport
- Spring auto-configuration → REST client abstraction: configures beans
- Spring Jersey variant → Jersey transport: configures
- Sample applications → Spring auto-configuration: uses starter
- Sample applications → AEM proxy endpoint: exposes application endpoints
- AEM proxy endpoint → REST resources: proxies AEM HTTP
