Forms config and customisation
-
Upload
gavin-cornwell -
Category
Software
-
view
66 -
download
0
Transcript of Forms config and customisation
![Page 1: Forms config and customisation](https://reader034.fdocuments.net/reader034/viewer/2022042611/5883c11a1a28ab5c378b6a2f/html5/thumbnails/1.jpg)
Forms Config, Customization, & Extension!
Gavin Cornwell, Development Manager, Services Team, Alfresco!
![Page 2: Forms config and customisation](https://reader034.fdocuments.net/reader034/viewer/2022042611/5883c11a1a28ab5c378b6a2f/html5/thumbnails/2.jpg)
Agenda!
• Where Forms Are Used • Demo • Configuration • Customization • Extension • Q & A
![Page 3: Forms config and customisation](https://reader034.fdocuments.net/reader034/viewer/2022042611/5883c11a1a28ab5c378b6a2f/html5/thumbnails/3.jpg)
Where Forms Are Used!
![Page 4: Forms config and customisation](https://reader034.fdocuments.net/reader034/viewer/2022042611/5883c11a1a28ab5c378b6a2f/html5/thumbnails/4.jpg)
Metadata !
![Page 5: Forms config and customisation](https://reader034.fdocuments.net/reader034/viewer/2022042611/5883c11a1a28ab5c378b6a2f/html5/thumbnails/5.jpg)
Advanced Search!
![Page 6: Forms config and customisation](https://reader034.fdocuments.net/reader034/viewer/2022042611/5883c11a1a28ab5c378b6a2f/html5/thumbnails/6.jpg)
Workflow !
![Page 7: Forms config and customisation](https://reader034.fdocuments.net/reader034/viewer/2022042611/5883c11a1a28ab5c378b6a2f/html5/thumbnails/7.jpg)
Datalists !
![Page 8: Forms config and customisation](https://reader034.fdocuments.net/reader034/viewer/2022042611/5883c11a1a28ab5c378b6a2f/html5/thumbnails/8.jpg)
Actions (4.0)!
![Page 9: Forms config and customisation](https://reader034.fdocuments.net/reader034/viewer/2022042611/5883c11a1a28ab5c378b6a2f/html5/thumbnails/9.jpg)
Admin Console (4.0)!
![Page 10: Forms config and customisation](https://reader034.fdocuments.net/reader034/viewer/2022042611/5883c11a1a28ab5c378b6a2f/html5/thumbnails/10.jpg)
Demo!
• Custom Type • Custom Control • Advanced Search • FDK • startLocation!• Custom “foldername” NodeLocator!
• Built-in NodeLocators; ancestor, doclib, userhome!
• Unit Test Page!
![Page 11: Forms config and customisation](https://reader034.fdocuments.net/reader034/viewer/2022042611/5883c11a1a28ab5c378b6a2f/html5/thumbnails/11.jpg)
Configuration!
![Page 12: Forms config and customisation](https://reader034.fdocuments.net/reader034/viewer/2022042611/5883c11a1a28ab5c378b6a2f/html5/thumbnails/12.jpg)
Global Defaults – form-config.xml <config> <forms> <default-controls> ... </default-controls> <constraint-handlers> ... </constraint-handlers> <dependencies> ... </dependencies> </forms> </config>
![Page 13: Forms config and customisation](https://reader034.fdocuments.net/reader034/viewer/2022042611/5883c11a1a28ab5c378b6a2f/html5/thumbnails/13.jpg)
Default Controls!<default-controls> <type name="text” template="/org.../textfield.ftl" />
<type name=”datetime” template="/org.../date.ftl”> <control-param name="showTime”> true </control-param> </type> ... </default-controls>
![Page 14: Forms config and customisation](https://reader034.fdocuments.net/reader034/viewer/2022042611/5883c11a1a28ab5c378b6a2f/html5/thumbnails/14.jpg)
Default Constraint Handlers!<constraint-handlers> … <constraint type="MANDATORY” validation-handler="...mandatory” event="keyup" />
<constraint type="NUMBER” validation-handler=”...number” event="keyup" /> ... </constraint-handlers>
![Page 15: Forms config and customisation](https://reader034.fdocuments.net/reader034/viewer/2022042611/5883c11a1a28ab5c378b6a2f/html5/thumbnails/15.jpg)
Dependencies!<dependencies> <css src=” /accordion/accordion.css" /> <js src=“/accordion/accordion-min.js" /> ... </dependencies>
![Page 16: Forms config and customisation](https://reader034.fdocuments.net/reader034/viewer/2022042611/5883c11a1a28ab5c378b6a2f/html5/thumbnails/16.jpg)
Custom Type (dcforms:presentation)!
• Name (d:text) inherited from cm:content • Code (d:text) • Abstract (d:text) • Level (d:text with LIST constraint) • Duration (d:int) • When (d:datetime) • Rating (d:int) • Presenter (association to cm:person)
![Page 17: Forms config and customisation](https://reader034.fdocuments.net/reader034/viewer/2022042611/5883c11a1a28ab5c378b6a2f/html5/thumbnails/17.jpg)
Node Form – Visibility !<config evaluator="node-type” condition="dcforms:presentation"> <forms> <form> <field-visibility> <show id="dcforms:code" /> <show id="cm:name" /> <show id="dcforms:abstract" /> <show id="dcforms:presenter" /> <show id="dcforms:duration" /> <show id="dcforms:when" /> <show id="dcforms:level" /> <show id="dcforms:rating" /> </field-visibility> <appearance>….</appearance> </form> </forms> </config>
![Page 18: Forms config and customisation](https://reader034.fdocuments.net/reader034/viewer/2022042611/5883c11a1a28ab5c378b6a2f/html5/thumbnails/18.jpg)
Node Form – Appearance !<appearance> <set id="" label-id="form.set.general” appearance="title”/> <set id="time" label="Time” appearance="title”/> <set id="feedback" label="Feedback" appearance=”panel”/>
<field id="dcforms:abstract"> <control template="/org/…/controls/textarea.ftl" /> </field> <field id="dcforms:rating" set="feedback” /> <field id="dcforms:when" set="time" /> <field id="dcforms:duration" set="time" /> </appearance>
![Page 19: Forms config and customisation](https://reader034.fdocuments.net/reader034/viewer/2022042611/5883c11a1a28ab5c378b6a2f/html5/thumbnails/19.jpg)
Node Form – Screenshot !
![Page 20: Forms config and customisation](https://reader034.fdocuments.net/reader034/viewer/2022042611/5883c11a1a28ab5c378b6a2f/html5/thumbnails/20.jpg)
Node Form – Hiding the ʻAuthorʼ field!<config evaluator="node-type" condition="cm:content"> <forms> <form> <field-visibility> <hide id="cm:author" /> </field-visibility> </form> </forms> </config>
![Page 21: Forms config and customisation](https://reader034.fdocuments.net/reader034/viewer/2022042611/5883c11a1a28ab5c378b6a2f/html5/thumbnails/21.jpg)
Node Form – Hiding the ʻAuthorʼ field!
![Page 22: Forms config and customisation](https://reader034.fdocuments.net/reader034/viewer/2022042611/5883c11a1a28ab5c378b6a2f/html5/thumbnails/22.jpg)
Search Form!<config evaluator="model-type" condition="dcforms:presentation"> <forms> <form id="search"> <field-visibility> <show id="cm:name" /> <show id="dcforms:code" /> <show id="dcforms:level" /> <show id="dcforms:when" /> </field-visibility> <appearance> <field id="dcforms:when"> <control template="/org/alfresco/components/form/controls/daterange.ftl" /> </field> </appearance> </form> </forms> </config>
![Page 23: Forms config and customisation](https://reader034.fdocuments.net/reader034/viewer/2022042611/5883c11a1a28ab5c378b6a2f/html5/thumbnails/23.jpg)
Search Form
![Page 24: Forms config and customisation](https://reader034.fdocuments.net/reader034/viewer/2022042611/5883c11a1a28ab5c378b6a2f/html5/thumbnails/24.jpg)
Customization!
![Page 25: Forms config and customisation](https://reader034.fdocuments.net/reader034/viewer/2022042611/5883c11a1a28ab5c378b6a2f/html5/thumbnails/25.jpg)
Custom Control – YUI Slider!
• Root location for custom controls • shared/classes/alfresco/web-extension/site-webscripts!
<field id="dcforms:rating" set="feedback"> <control template="/devcon/progress.ftl" /> </field>
![Page 26: Forms config and customisation](https://reader034.fdocuments.net/reader034/viewer/2022042611/5883c11a1a28ab5c378b6a2f/html5/thumbnails/26.jpg)
Custom Form Template!<config evaluator="task-type" condition="inwf:activitiInvitePendingTask"> <forms> <form> <view-form template="/org/alfresco/components/form/invite-task-form.ftl”/> <edit-form template="/org/alfresco/components/form/invite-task-form.ftl”/> <field-visibility> <show id="inwf:resourceTitle" /> <show id="inwf:resourceDescription" /> <show id="inwf:inviteeRole" /> <show id="bpm:priority" /> <show id="bpm:comment" /> <show id="inwf:inviteOutcome" /> </field-visibility> </form> </forms> </config>!
![Page 27: Forms config and customisation](https://reader034.fdocuments.net/reader034/viewer/2022042611/5883c11a1a28ab5c378b6a2f/html5/thumbnails/27.jpg)
Custom Form Template!
inwf:resourceTitle bpm:priority
inwf:inviteeRole bpm:comment
inwf:inviteOutcome
![Page 28: Forms config and customisation](https://reader034.fdocuments.net/reader034/viewer/2022042611/5883c11a1a28ab5c378b6a2f/html5/thumbnails/28.jpg)
Extension!
![Page 29: Forms config and customisation](https://reader034.fdocuments.net/reader034/viewer/2022042611/5883c11a1a28ab5c378b6a2f/html5/thumbnails/29.jpg)
Form Processors!
• Pluggable Form Processors • Driven by “itemKind”!• Provide implementation to generate and persist form!• OOTB Form Processors!
• Node, Type, Workflow, Task, Action & JMX!
• Form Filter • Allows pre and post processing of fields!
![Page 30: Forms config and customisation](https://reader034.fdocuments.net/reader034/viewer/2022042611/5883c11a1a28ab5c378b6a2f/html5/thumbnails/30.jpg)
NodeLocatorService (picker startLocation)!
• Returns a NodeRef • Implement NodeLocator Interface • NodeRef getNode(NodeRef, Map<String, Serializable>);!• Specify ID for “startLocation” param value!
• REST API • /api/workspace/SpacesStore/…/nodelocator/ancestor?type=xyz !
• https://wiki.alfresco.com/wiki/NodeLocatorService
![Page 31: Forms config and customisation](https://reader034.fdocuments.net/reader034/viewer/2022042611/5883c11a1a28ab5c378b6a2f/html5/thumbnails/31.jpg)
Whatʼs New & Tips!
![Page 32: Forms config and customisation](https://reader034.fdocuments.net/reader034/viewer/2022042611/5883c11a1a28ab5c378b6a2f/html5/thumbnails/32.jpg)
Whatʼs New in 4.0!
• JMX Form Processor • Action Form Processor • Association Control • Customizable startLocation !• rootNode option (stops navigation beyond node)!
• Category Control • Root node configurable!• Include sub categories option (for search)!
![Page 33: Forms config and customisation](https://reader034.fdocuments.net/reader034/viewer/2022042611/5883c11a1a28ab5c378b6a2f/html5/thumbnails/33.jpg)
Tips!
• Log4J settings • org.alfresco.repo.forms=debug!• org.alfresco.web.config.forms=debug!• org.alfresco.web.scripts.forms=debug!
• Eclipse (breakpoints) • FormUIGet for UI!• FilteredFormProcessor for server!
![Page 34: Forms config and customisation](https://reader034.fdocuments.net/reader034/viewer/2022042611/5883c11a1a28ab5c378b6a2f/html5/thumbnails/34.jpg)
Tips!
• Forms Development Kit (FDK) • Form Console (/<app>/page/form-console)!• Unit Test Page (/<app>/page/fdk-unit-tests)!• Debug control & template (dumps model)!
• Cntrl, Cntrl, Shift, Shift
![Page 35: Forms config and customisation](https://reader034.fdocuments.net/reader034/viewer/2022042611/5883c11a1a28ab5c378b6a2f/html5/thumbnails/35.jpg)
Questions ?!
![Page 36: Forms config and customisation](https://reader034.fdocuments.net/reader034/viewer/2022042611/5883c11a1a28ab5c378b6a2f/html5/thumbnails/36.jpg)
Learn More!
http://wiki.alfresco.com/wiki/Forms http://wiki.alfresco.com/wiki/Share_Advanced_Search