蜜豆视频

Publish Adaptive Forms with Edge Delivery Services

Publishing an Adaptive Form makes it available on Edge Delivery Services for end users to access and submit. This process involves three main phases: publishing the form, configuring security settings, and accessing the live form.

What you鈥檒l accomplish:

  • Publish your form to Edge Delivery Services
  • Configure security settings for form submission
  • Access and verify your published form
  • Set up proper URL routing and CORS policies

Prerequisites

  • Adaptive Form created using Edge Delivery Services template
  • Form tested and ready for production use
  • AEM Forms author permissions
  • Cloud Manager access (for production configuration)
  • Developer access to form block code (for submission setup)

Publishing Process Overview

Publishing forms to Edge Delivery Services follows a three-phase approach:

  • Phase 1: Form Publication - Publish your form to the CDN and verify publication status
  • Phase 2: Security Configuration - Set up CORS policies and referrer filters for secure submissions
  • Phase 3: Access and Validation - Test form functionality and validate the complete workflow

Each phase builds on the previous one to ensure secure, functional deployment.

Phase 1: Publish Your Form

Step 1: Initiate Publishing
  1. Access your form: Open your Adaptive Form in the Universal Editor

  2. Start publishing: Click the Publish icon in the toolbar

    Click Publish

Step 2: Review and Confirm
  1. Review publishing assets: The system shows all assets being published, including your form

    On Click Publish

  2. Confirm publishing: Click Publish to proceed

  3. Verify success: Look for the confirmation message

    Publish Success

Step 3: Verify Publication Status

Check status: Click the Publish icon again to view current status

Publish Status

Validation Checkpoint:

  • Form shows 鈥淧ublished鈥 status in the editor
  • No error messages during publishing process
  • Form appears in published assets list
Managing Published Forms

To unpublish a form:

  1. Open your form in the editor
  2. Click the three-dot menu (鈰) in the upper-right corner
  3. Select Unpublish

Unpublish form

Phase 2: Configure Security Settings

Why Security Configuration is Required

To enable secure form submissions, you must configure security settings that:

  • Allow Edge Delivery Services to submit data to AEM
  • Prevent unauthorized access to your AEM instance
  • Enable CORS (Cross-Origin Resource Sharing) for form submissions
  • Filter requests to only allow legitimate Edge Delivery domains
note important
IMPORTANT
Required for Production: These configurations are mandatory for form submissions to work in production environments.
Step 1: Configure Form Submission URL

Purpose: Direct form submissions to your AEM instance

File Location: blocks/form/constant.js in your Edge Delivery Services project

Configuration Examples:

code language-javascript
// Production Environment
export const submitBaseUrl = 'https://publish-p120-e12.adobeaemcloud.com';

// Local Development Environment
export const submitBaseUrl = 'http://localhost:4503';

// Staging Environment
export const submitBaseUrl = 'https://publish-staging-p120-e12.adobeaemcloud.com';

Validation Checkpoint:

  • constant.js file updated with correct AEM publish URL
  • URL matches your environment (production, staging, or local)
  • No trailing slash in the URL
Step 2: Configure CORS Settings

Purpose: Allow form submission requests from Edge Delivery Services domains

Implementation: Add CORS configuration to your AEM dispatcher or Apache configuration

code language-apache
# Local Development Environment
SetEnvIfExpr "env('CORSProcessing') == 'true' && req_novary('Origin') =~ m#(http://localhost(:\d+)?$)#" CORSTrusted=true

# Edge Delivery Services - Preview/Stage Environment
SetEnvIfExpr "env('CORSProcessing') == 'true' && req_novary('Origin') =~ m#(https://.*\.hlx\.page$)#" CORSTrusted=true

# Edge Delivery Services - Production Environment
SetEnvIfExpr "env('CORSProcessing') == 'true' && req_novary('Origin') =~ m#(https://.*\.hlx\.live$)#" CORSTrusted=true

Validation Checkpoint:

  • CORS rules applied to dispatcher configuration
  • All required domains (localhost, hlx.page, hlx.live) are included
  • Configuration deployed to target environment

Reference Documentation:

Step 3: Configure Referrer Filter

Purpose: Restrict write operations to authorized Edge Delivery Services domains

Implementation Method: Configure via Cloud Manager in AEM as a Cloud Service

Configuration File: Add to your project鈥檚 OSGi configuration

code language-json
{
  "allow.empty": false,
  "allow.hosts": [],
  "allow.hosts.regexp": [
    "https://.*\\.hlx\\.page:443",
    "https://.*\\.hlx\\.live:443"
  ],
  "filter.methods": [
    "POST",
    "PUT",
    "DELETE",
    "COPY",
    "MOVE"
  ],
  "exclude.agents.regexp": [
    ""
  ]
}

Configuration Breakdown:

  • allow.empty: Rejects requests without referrer headers
  • allow.hosts.regexp: Permits requests from Edge Delivery Services domains
  • filter.methods: Applies filtering to these HTTP methods
  • exclude.agents.regexp: User agents excluded from filtering

Validation Checkpoint:

  • Referrer filter configuration deployed via Cloud Manager
  • Configuration active on AEM publish instance
  • Test form submission works from Edge Delivery Services domain
  • Unauthorized domains are blocked from submitting forms

Reference Documentation:

Phase 3: Access Your Published Form

URL Structure for Edge Delivery Services

Standard URL Format:

code language-none
https://<branch>--<repo>--<owner>.aem.live/content/forms/af/<form_name>

URL Components:

  • <branch>: Git branch name (typically main)
  • <repo>: Repository name
  • <owner>: GitHub organization or username
  • <form_name>: Your form鈥檚 name (lowercase, hyphenated)

Environment-Specific URLs:

code language-none
# Production Environment (.aem.live)
https://main--universaleditor--wkndforms.aem.live/content/forms/af/wknd-form

# Preview Environment (.aem.page)
https://main--universaleditor--wkndforms.aem.page/content/forms/af/wknd-form
Final Validation Steps

Verify Form Accessibility:

  1. Test form loading: Visit your form URL and confirm it loads properly
  2. Test form submission: Fill out and submit the form to verify data processing
  3. Check responsive design: Test form on different devices and screen sizes
  4. Validate security: Ensure CORS and referrer filter are working correctly

Expected Results:

  • Form loads without errors
  • All form fields render correctly
  • Form submission processes successfully
  • Data appears in configured destination (spreadsheet, email, etc.)
  • No console errors related to CORS or security policies

Next Steps

recommendation-more-help
fbcff2a9-b6fe-4574-b04a-21e75df764ab