Alfresco introduced Share, it’s own collaboration portal based on Spring Surf technology and they have a pretty good idea to reduce the coding effort for building forms for your custom data types. It is called Forms Engine. Here we will point out some alternatives to Alfresco Share.
The following diagram pretty much explains the whole idea. You have services on Alfresco side that can return metadata about a particular node for form creation, persist the form, validate the posted values, etc.
In between you have some facilities on Share that can render the form and consume the configuration using this underlying services.
And finally on browser side you have forms engine that can manage the rendered form, client side validations, fancy AJAX interactions, etc.
See the following steps taken from Forms Developer Guide that explains the flow in detail.
- The browser requests a page that contains the Form UI Component.
- The Form UI Component uses the ConfigService to look for XML form configuration for the item requested.
- If configuration was found for the item a list of fields to be displayed is determined and passed to the formdefinitions REST API, if no configuration is found the REST API is called without any parameters.
But Share is not the only option to use if you want something similar. You could continue to use your favorite UI framework and provide the same flexibility.
Take the following webscript as an example, what it does it to dump the metadata of a given node recursively. It outputs everything you need about that particular node, the attributes, the type of the attributes, the relationships, aspects, etc.
It is even better than the one provided Alfresco by default, because this webscript returns all the metadata about a node recursively including all the children nodes which also enables you to build nested forms.
What you have to know is to develop a form builder for your favorite UI framework of your choice. For example I developed a generic form builder for GWT using the output coming from this webscript. You are not bound to Share 🙂