PLAT-15 Forms Config, Customization, and Extension

  • 1,392 views
Uploaded on

This session will cover the use of Forms in Share and demonstrate how to configure and customize them for your applications and data models. A working example will be used to show how to define forms …

This session will cover the use of Forms in Share and demonstrate how to configure and customize them for your applications and data models. A working example will be used to show how to define forms for custom types, how out of the box form controls can be configured and how new custom controls can be plugged-in. We’ll also discuss the various extension hook points the Forms Service provides.

More in: Technology , Business
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
1,392
On Slideshare
0
From Embeds
0
Number of Embeds
1

Actions

Shares
Downloads
58
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Forms Config, Customizaton & Extension Mike Hatfield • Senior UI Engineer • twitter @mikehatfield
  • 2. Agenda!•  Where Forms Are Used•  Configuration•  Customization•  Extension•  Demo•  Q&A
  • 3. Where Forms Are Used!
  • 4. Metadata !
  • 5. Advanced Search!
  • 6. Workflow !
  • 7. Datalists !
  • 8. Actions (4.0)!
  • 9. Admin Console (4.0)!
  • 10. Configuration!
  • 11. Global Defaults – form-config.xml
<config> <forms> <default-controls> ... </default-controls> <constraint-handlers> ... </constraint-handlers> <dependencies> ... </dependencies> </forms></config>
  • 12. 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>
  • 13. Default Constraint Handlers!<constraint-handlers> … <constraint type="MANDATORY” validation-handler="...mandatory” event="keyup" /> <constraint type="NUMBER” validation-handler=”...number” event="keyup" /> ...</constraint-handlers>
  • 14. Dependencies!<dependencies> <css src=” /accordion/accordion.css" /> <js src=“/accordion/accordion-min.js" /> ...</dependencies>
  • 15. 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)
  • 16. 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>
  • 17. 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>
  • 18. Node Form – Screenshot !
  • 19. 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>
  • 20. Node Form – Hiding the ʻAuthorʼ field!
  • 21. 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>
  • 22. Search Form

  • 23. Customization!
  • 24. 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>
  • 25. 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>!
  • 26. Custom Form Template! inwf:resourceTitle   bpm:priority   inwf:inviteeRole   bpm:comment   inwf:inviteOutcome  
  • 27. Extension!
  • 28. 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!
  • 29. 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
  • 30. Whatʼs New, Demo & Tips !
  • 31. 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)!
  • 32. Demo!•  Custom Type•  Custom Control•  Advanced Search•  FDK Unit Test Page • startLocation!
  • 33. 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!
  • 34. 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
  • 35. Questions ?!
  • 36. http://wiki.alfresco.com/wiki/Formshttp://wiki.alfresco.com/wiki/Share_Advanced_Search Learn More!