Configure the FormDataStore Layer
Info: This feature is available in brXM 14.3.0 and later.
Overview
The FormDataStore layer in Enterprise Forms provides temporary storage for form data to support the Post/Redirect/Get pattern. When a form is submitted, the posted data is stored temporarily before the redirect. This allows the data to be retrieved during the subsequent GET request. The FormDataStore layer abstracts this temporary storage, and you can select from multiple backend implementations.
Available FormDataStore Implementations
All FormDataStore implementations must implement the com.onehippo.cms7.eforms.hst.formdatastore.FormDataStore interface.
The following implementations are included:
com.onehippo.cms7.eforms.hst.formdatastore.RepositoryFormDataStore(default)
Stores form data in the content repository under the/formdatanode using the HST facility.com.onehippo.cms7.eforms.hst.formdatastore.CachingFormDataStore
Stores form data in memory. Optionally, it can use a cookie to persist the formMap ID instead of theu_u_i_drender parameter.
Configure the FormDataStore
Configure the FormDataStore layer at the following JCR node:
/hippo:configuration/hippo:modules/eforms/hippo:moduleconfig/eforms:formdatastore
Set the eforms:classname property to the fully qualified class name of the FormDataStore implementation you want to use.
If you use CachingFormDataStore, you can configure additional optional properties as described below.
Configuration Properties
| Property | Default | Description |
|---|---|---|
eforms:classname | com.onehippo.cms7.eforms.hst.formdatastore.RepositoryFormDataStore | Specifies the FormDataStore implementation class. Use either RepositoryFormDataStore or CachingFormDataStore. |
eforms:cachemaxageminutes | 10 | For CachingFormDataStore: Time in minutes before a cache entry is automatically removed after creation or replacement. |
eforms:cacheheapsize | 1000 | For CachingFormDataStore: Maximum number of entries allowed in the cache. |
eforms:cookiehttponly | true | For CachingFormDataStore: Sets the 'httpOnly' flag on the cookie if cookies are used. |
eforms:cookiemaxageminutes | -1 | For CachingFormDataStore: Sets the cookie's max age in minutes. Use -1 for a session cookie (recommended). |
eforms:cookiename | 'formMapId' | For CachingFormDataStore: Name of the cookie if cookies are used. |
eforms:cookiesecure | false | For CachingFormDataStore: Sets the 'secure' flag on the cookie if cookies are used. |
eforms:usecookie | false | For CachingFormDataStore: Use a cookie instead of the u_u_i_d render parameter to store the form map ID between storing and retrieving. |
Default RepositoryFormDataStore Configuration
By default, the configuration uses RepositoryFormDataStore:
/eforms:formdatastore: jcr:primaryType: hipposys:moduleconfig eforms:classname: com.onehippo.cms7.eforms.hst.formdatastore.RepositoryFormDataStore helptext: Property eforms:classname should contain an implementation of com.onehippo.cms7.eforms.hst.formdatastore.FormDataStore interface. Implementations RepositoryFormDataStore and CachingFormDataStore exist out-of-the-box.
Example CachingFormDataStore Configuration
The following example configures CachingFormDataStore and enables cookie-based storage for the formMap ID:
/eforms:formdatastore: jcr:primaryType: hipposys:moduleconfig eforms:cachemaxageminutes: 10 eforms:cacheheapsize: 1000 eforms:classname: com.onehippo.cms7.eforms.hst.formdatastore.CachingFormDataStore eforms:cookiehttponly: true eforms:cookiemaxageminutes: 10 eforms:cookiename: formMapId eforms:cookiesecure: false eforms:usecookie: true