Transcript
Page 1: PLAT-15 Forms Config, Customization, and Extension

Forms Config, Customizaton & Extension Mike Hatfield • Senior UI Engineer • twitter @mikehatfield

Page 2: PLAT-15 Forms Config, Customization, and Extension

Agenda!

•  Where Forms Are Used •  Configuration •  Customization •  Extension •  Demo •  Q & A

Page 3: PLAT-15 Forms Config, Customization, and Extension

Where Forms Are Used!

Page 4: PLAT-15 Forms Config, Customization, and Extension

Metadata !

Page 5: PLAT-15 Forms Config, Customization, and Extension

Advanced Search!

Page 6: PLAT-15 Forms Config, Customization, and Extension

Workflow !

Page 7: PLAT-15 Forms Config, Customization, and Extension

Datalists !

Page 8: PLAT-15 Forms Config, Customization, and Extension

Actions (4.0)!

Page 9: PLAT-15 Forms Config, Customization, and Extension

Admin Console (4.0)!

Page 10: PLAT-15 Forms Config, Customization, and Extension

Configuration!

Page 11: PLAT-15 Forms Config, Customization, and Extension

Global Defaults – form-config.xml <config> <forms> <default-controls> ... </default-controls> <constraint-handlers> ... </constraint-handlers> <dependencies> ... </dependencies> </forms> </config>

Page 12: PLAT-15 Forms Config, Customization, and Extension

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 13: PLAT-15 Forms Config, Customization, and Extension

Default Constraint Handlers!<constraint-handlers> … <constraint type="MANDATORY” validation-handler="...mandatory” event="keyup" />

<constraint type="NUMBER” validation-handler=”...number” event="keyup" /> ... </constraint-handlers>

Page 14: PLAT-15 Forms Config, Customization, and Extension

Dependencies!<dependencies> <css src=” /accordion/accordion.css" /> <js src=“/accordion/accordion-min.js" /> ... </dependencies>

Page 15: PLAT-15 Forms Config, Customization, and Extension

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 16: PLAT-15 Forms Config, Customization, and Extension

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 17: PLAT-15 Forms Config, Customization, and Extension

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 18: PLAT-15 Forms Config, Customization, and Extension

Node Form – Screenshot !

Page 19: PLAT-15 Forms Config, Customization, and Extension

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 20: PLAT-15 Forms Config, Customization, and Extension

Node Form – Hiding the ʻAuthorʼ field!

Page 21: PLAT-15 Forms Config, Customization, and Extension

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 22: PLAT-15 Forms Config, Customization, and Extension

Search Form

Page 23: PLAT-15 Forms Config, Customization, and Extension

Customization!

Page 24: PLAT-15 Forms Config, Customization, and Extension

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 25: PLAT-15 Forms Config, Customization, and Extension

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 26: PLAT-15 Forms Config, Customization, and Extension

Custom Form Template!

inwf:resourceTitle   bpm:priority  

inwf:inviteeRole   bpm:comment  

inwf:inviteOutcome  

Page 27: PLAT-15 Forms Config, Customization, and Extension

Extension!

Page 28: PLAT-15 Forms Config, Customization, and Extension

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 29: PLAT-15 Forms Config, Customization, and Extension

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 30: PLAT-15 Forms Config, Customization, and Extension

Whatʼs New, Demo & Tips!

Page 31: PLAT-15 Forms Config, Customization, and Extension

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 32: PLAT-15 Forms Config, Customization, and Extension

Demo!

•  Custom Type •  Custom Control •  Advanced Search •  FDK Unit Test Page • startLocation!

Page 33: PLAT-15 Forms Config, Customization, and Extension

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: PLAT-15 Forms Config, Customization, and Extension

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: PLAT-15 Forms Config, Customization, and Extension

Questions ?!

Page 36: PLAT-15 Forms Config, Customization, and Extension

Learn More!

http://wiki.alfresco.com/wiki/Forms http://wiki.alfresco.com/wiki/Share_Advanced_Search


Top Related