Your SlideShare is downloading. ×
0
SharePoint Custom Field Controls
SharePoint Custom Field Controls
SharePoint Custom Field Controls
SharePoint Custom Field Controls
SharePoint Custom Field Controls
SharePoint Custom Field Controls
SharePoint Custom Field Controls
SharePoint Custom Field Controls
SharePoint Custom Field Controls
SharePoint Custom Field Controls
SharePoint Custom Field Controls
SharePoint Custom Field Controls
SharePoint Custom Field Controls
SharePoint Custom Field Controls
SharePoint Custom Field Controls
SharePoint Custom Field Controls
SharePoint Custom Field Controls
SharePoint Custom Field Controls
SharePoint Custom Field Controls
SharePoint Custom Field Controls
SharePoint Custom Field Controls
SharePoint Custom Field Controls
SharePoint Custom Field Controls
SharePoint Custom Field Controls
SharePoint Custom Field Controls
SharePoint Custom Field Controls
SharePoint Custom Field Controls
SharePoint Custom Field Controls
SharePoint Custom Field Controls
SharePoint Custom Field Controls
SharePoint Custom Field Controls
SharePoint Custom Field Controls
SharePoint Custom Field Controls
SharePoint Custom Field Controls
SharePoint Custom Field Controls
SharePoint Custom Field Controls
SharePoint Custom Field Controls
SharePoint Custom Field Controls
SharePoint Custom Field Controls
SharePoint Custom Field Controls
SharePoint Custom Field Controls
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

SharePoint Custom Field Controls

15,449

Published on

Published in: Technology
1 Comment
8 Likes
Statistics
Notes
  • Can you provided a downloadable version of this PPT?
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total Views
15,449
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
1
Likes
8
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. Custom Field Controls and SharePoint Web Content Management<br />Chakkaradeep Chandran <br />Robert Stewart<br />
  • 2. Session Overview<br /><ul><li>SharePoint artefacts and Web Content Management
  • 3. Intergen – “powered by Microsoft Office SharePoint” Demo
  • 4. Role of Content Types, Site Columns in a Publishing Site
  • 5. Custom Field Types
  • 6. Web Parts Vs Field Controls as content regions
  • 7. Custom field type development topics</li></li></ul><li>SharePoint and WCM<br /><ul><li>SharePoint provides Web Content Management (WCM) functionality out of the box
  • 8. WCM features are provided primarily by the Publishing Site feature
  • 9. Several standard SharePoint components work together to provide WCM functionality
  • 10. Key Components of a Publishing Site
  • 11. Site Columns
  • 12. Content Types
  • 13. Field Controls
  • 14. Page Layouts
  • 15. Document Libraries
  • 16. Lists</li></li></ul><li>Demo<br />Intergen “powered by Microsoft Office SharePoint” demo<br />
  • 17. Page Layouts, Content Types, Site Columns<br />GeneralPage Content Type<br />Title<br />Title<br />Description<br />Page Content<br />Page Image<br />Vincent van Gogh<br />Gogh was a Dutch Post-Impressionist artist who live in the 1800s.<br />Van Gogh spent his early adult life working for a firm of art dealers. After a brief spell as a teacher, he became a missionary worker in a very poor mining region. He did not embark upon a career as an artist until 1880. <br />Vincent van Gogh<br />Gogh was a Dutch Post-Impressionist artist who live in the 1800s.<br />Van Gogh spent his early adult life working for a firm of art dealers. After a brief spell as a teacher, he became a missionary worker in a very poor mining region. He did not embark upon a career as an artist until 1880. <br />Description<br />Page Content<br />Page Image<br />GeneralPageLayout.aspx<br />
  • 18. Custom Field Types<br /><ul><li>SharePoint and WSS include many field types
  • 19. Text
  • 20. Choice Fields
  • 21. Hyperlink or Picture
  • 22. Publishing HTML
  • 23. Create custom field types to satisfy requirements not met by out of the box field types
  • 24. Field Type == Data Type
  • 25. Field type provide field rendering facilities
  • 26. Field controls are tightly coupled with the type of the field
  • 27. Field controls deliver or capture the content in a Publishing Page</li></li></ul><li>Web Parts Vs Field Controls<br /><ul><li>Both allow you to add content regions to a page layout
  • 28. Rule of thumb:
  • 29. Use field controls for content and Web Parts for functionality
  • 30. Since a field control is bound to a specific field of an item, it offers complete versioning/history
  • 31. Web Parts do not offer complete versioning/history</li></li></ul><li>Demo<br />Custom Field Control - Components<br />
  • 32. Development Components<br />Demo<br />{.......}<br />{....}<br />
  • 33. Demo<br />Field Control – Rendering Template &amp;<br />Rendering Control<br />
  • 34. Field Control – Rendering Template<br />Demo<br />Rendering Template<br />Edit Mode<br />Display Mode<br />
  • 35. Field Control – Rendering Control<br />Demo<br />Edit Mode<br />Display Mode<br /><ul><li> Every rendering control has at least one rendering template associated with it
  • 36. A RenderingTemplate object is defined as a RenderingTemplate element in an .ascx file
  • 37. The rendering template is referenced by its ID value in the rendering control object's TemplateName property</li></li></ul><li>Rendering Control – BaseFieldControl<br />Demo<br />Edit Mode<br />Display Mode<br />
  • 38. Rendering Control – CreateChildControls<br />Demo<br />Edit Mode<br />Display Mode<br />
  • 39. Demo<br />InPagePod Field – Rendering Template &amp; Rendering Control<br />
  • 40. Field Control – Summary<br />Demo<br />Rendering Template<br />Rendering Control<br />Naming Convention - field_type_nameFieldControl<br />Edit Mode<br />Display Mode<br />The Rendering Template is referenced by its ID value in the Rendering Control object&amp;apos;s TemplateName property<br />BaseFieldControl-derived rendering control handles interaction with users<br />Its plain simple HTML/ASCX code<br />
  • 41. Demo<br />Field Class<br />
  • 42. Field Class<br />Demo<br /><ul><li>This is a class whose instances can represent particular fields that are based on your custom field type
  • 43. This class must inherit from SPField or one of the classes in Windows SharePoint Services that derive from it</li></li></ul><li>Demo<br />InPagePod Field – Field Class<br />
  • 44. Field Class – Summary<br />Demo<br />Naming Convention - field_type_nameField<br />Field class should inherit either SPField or one of the various other SPField classes<br />InPagePod inherits from SPFieldMultiColumn<br />Override the FieldRenderingControlproperty which returns the control that can be used to render the field in Edit and Display mode<br />Field Class object handles interactions with the content database<br />
  • 45. Demo<br />Field Value<br />
  • 46. Field Value<br />Demo<br />String Value<br />(Or)<br />titleImgUrl;podContent;contentImageUrl<br />Custom Value Class<br />SPFieldMultiColumnSPFieldMultiColumnValue<br />SPFieldUrl<br />SPFieldUrlValue<br />;#TitleImage;#PodContent;#ContentImage;#<br />
  • 47. Field Value – Saving Field Values<br />Demo<br />
  • 48. Demo<br />InPagePod Field – Field Value<br />
  • 49. Field Value– Summary<br />Demo<br />Naming Convention - field_type_nameFieldValue<br />String Value<br />Custom Value Class<br />A custom field value class must implement at least two constructors, and usually only two<br />SharePoint delimiter - ;#<br />
  • 50. Demo<br />Field Validation<br />
  • 51. Field Validation<br />Demo<br />(when the Publishing <br />Page is validated)<br />(before committing to <br />the content database)<br />
  • 52. Validate When Saving Field Values<br />Demo<br />
  • 53. Overriding Validate Method<br />Demo<br />;#TitleImage;#PodContent;#ContentImage;#<br />
  • 54. Overriding GetValidatedString Method<br />Demo<br />;#TitleImage;#PodContent;#ContentImage;#<br />
  • 55. Demo<br />InPagePod Field – Field Validation<br />
  • 56. Field Validation – Summary<br />Demo<br />Validate the control values before setting the field values in the Field Control class<br />Set the IsValidto false<br />Set the ErrorMessageto an appropriate error message<br />Override the Validate method in the Field Control class<br />Set the IsValidto false<br />Set the ErrorMessageto an appropriate error message<br />Override the GetValidatedString in the Field class<br />Throw SPFieldValidationException as an error<br />
  • 57. Demo<br />Field Type Definition<br />
  • 58. Field Type Definition<br />Demo<br />fldtypes_spconf.xml<br />fldtypes*.xml<br />
  • 59. Demo<br />InPagePod Field – Field Type Definition<br />
  • 60. Demo<br />Custom Field Type Deployment<br />
  • 61. Custom Field – Deployment<br />Demo<br />*.ascx<br />Rendering Template<br />12TEMPLATECONTROLTEMPLATES<br />Rendering Control Class<br />*.cs (.dll)<br />Field Control Class<br />fldtypes*.xml<br />GAC<br />Field Class<br />Field Value Class<br />Field Type Definition<br />12TEMPLATEXML<br />*.WSP<br />
  • 62. Custom Field – Usage<br />Demo<br />
  • 63. Session Summary<br />Demo<br />*.WSP<br />
  • 64. Resources<br />Demo<br />Web Content Management Resource Center for SharePoint Server<br />http://bit.ly/moss-wcm<br />SharePoint Server Developer Center<br />http://bit.ly/moss-dev<br />MSDN: How to Create a Custom Field Control<br />http://bit.ly/custom-field-control<br />Chaks’ Blog<br />http://bit.ly/chaks<br />Robert Stewart’s Blog<br />http://bit.ly/robert-stewart<br />
  • 65. Thank You<br />chaks@intergen.co.nz<br />robs@intergen.co.nz<br />

×