This document provides an overview of Alfresco Forms including:
1. The architecture of Alfresco Forms including the Form Service, Form UI Component, and Forms Runtime.
2. Details on the Form Service Java API, Form Processors, and Form Filters which are used to customize forms.
3. How the Form UI Component works including the web script, options, event sequence, and FreeMarker templates used to render forms.
9. Node, Type, Workflow & Task implementationspublic Form generate(Item item, List<String> fields, List<String> forcedFields); public Object persist(Item item, FormData data); public booleanisApplicable(Item item); public booleanisActive();
10. Form Service – Form Filter 7 Similar to Servlet Filters Recommended way to customise Each FormProcessor has a FilterRegistry Filter is called for every item Do conditional checks in your filter Examples in RM
11. Form Service – Form Filter 8 public void beforeGenerate(ItemType item, List<String> fields, List<String> forcedFields, Form form); public void afterGenerate(ItemType item, List<String> fields, List<String> forcedFields, Form form); public void beforePersist(ItemType item, FormData data); public void afterPersist(ItemType item, FormData data, PersistTypepersistedObject); public booleanisActive();
12. REST API /api/formdefinitions Request 9 POST /api/formdefinitions Returns form definition JSON passed in JSON response POST /api/formprocessor Persists form data JSON or multipart/form-data passed in Response matches request type Examples of JSON will be seen in the demo
22. Form UI Component Event Sequence 13 Asks ConfigService for list of fields for item Sends list of fields (if any) to FormService FormService response “combined” with configuration for item “form” model is set (demo will show example) FreeMarker template is rendered Custom template used if configured FTL for each control is #included Forms Runtime initialisation code generated