Presentation is loading. Please wait.

Presentation is loading. Please wait.

HOME EVIDENCE EXECUTION MICROSOFT SOLUTIONS SERVICES PARTNERS Custom Field Controls and SharePoint Web Content Management Chakkaradeep Chandran Robert.

Similar presentations


Presentation on theme: "HOME EVIDENCE EXECUTION MICROSOFT SOLUTIONS SERVICES PARTNERS Custom Field Controls and SharePoint Web Content Management Chakkaradeep Chandran Robert."— Presentation transcript:

1 HOME EVIDENCE EXECUTION MICROSOFT SOLUTIONS SERVICES PARTNERS Custom Field Controls and SharePoint Web Content Management Chakkaradeep Chandran Robert Stewart

2 HOME EVIDENCE EXECUTION MICROSOFT SOLUTIONS SERVICES PARTNERS  Intergen – “powered by Microsoft Office SharePoint” Demo  The relationship between page layouts, content types and site columns in Publishing Sites  The role of Content Types in a Publishing Site  Custom Field Types  Web Parts Vs Field Controls as content regions  Custom field type development topics Session Objectives

3 HOME EVIDENCE EXECUTION MICROSOFT SOLUTIONS SERVICES PARTNERS Demo Intergen “powered by Microsoft Office SharePoint” demo

4 HOME EVIDENCE EXECUTION MICROSOFT SOLUTIONS SERVICES PARTNERS  SharePoint provides Web Content Management (WCM) functionality out of the box  WCM features are provided primarily by the Publishing Site feature  Several standard SharePoint components work together to provide WCM functionality  Key Components of a Publishing Site  Site Columns  Content Types  Field Controls  Page Layouts  Document Libraries  Lists SharePoint and WCM

5 HOME EVIDENCE EXECUTION MICROSOFT SOLUTIONS SERVICES PARTNERS TitleDescriptionPage ContentPage Image Vincent van GoghGogh was a Dutch Post-Impressionist artist who live in the 1800s. Van Gogh spent his early adult life working for a firm of art dealers. After a brief spell as a teacher… PortraitOne.jpg Title Description Page Content Page Image Vincent van Gogh Gogh was a Dutch Post- Impressionist artist who live in the 1800s. 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. Vincent van Gogh Gogh was a Dutch Post- Impressionist artist who live in the 1800s. 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. GeneralPage Content Type Title Description Page Content Page Image GeneralPageLayout.aspx Page Layouts, Content Types, Site Columns

6 HOME EVIDENCE EXECUTION MICROSOFT SOLUTIONS SERVICES PARTNERS Custom Field Types  SharePoint and WSS include many field types  Text  Choice Fields  Hyperlink or Picture  Publishing HTML  Field Type == Data Type  Create custom field types to satisfy requirements not met by out of the box field types  Field types also provide field rendering facilities  Field controls deliver or capture the content in a Publishing Page  Field controls are tightly coupled with the type of the field

7 HOME EVIDENCE EXECUTION MICROSOFT SOLUTIONS SERVICES PARTNERS Web Parts Vs Field Types  Both allow you to add content regions to a page layout  Rule of thumb:  Use field controls for content and Web Parts for functionality  Since a field control is bound to a specific field of an item, it offers complete versioning/history  Web Parts do not offer complete versioning/history Field ControlsWeb Parts PersonalizationNoYes StorageContent is stored in a field in page’s underlying list Content is stored with and/or managed by Web Part Suggested UseAtomic content rendering and editing Functionality VersioningComplete historyNo history

8 HOME EVIDENCE EXECUTION MICROSOFT SOLUTIONS SERVICES PARTNERS Custom Field Control - Components Demo

9 HOME EVIDENCE EXECUTION MICROSOFT SOLUTIONS SERVICES PARTNERS Custom Field Field Control Rendering Template Rendering Control Field Class SPFieldMultiChoice SPFieldMultiColumn Field Value SPFieldMultiColumnValueSPFieldMultiChoiceValue Field Type Definition fldtypes _.xml {.......} {....} Demo Development Components

10 HOME EVIDENCE EXECUTION MICROSOFT SOLUTIONS SERVICES PARTNERS Field Control – Rendering Template & Rendering Control Demo

11 HOME EVIDENCE EXECUTION MICROSOFT SOLUTIONS SERVICES PARTNERS Field Control – Rendering Template Edit ModeDisplay Mode Rendering Template Demo

12 HOME EVIDENCE EXECUTION MICROSOFT SOLUTIONS SERVICES PARTNERS Field Control – Rendering Control Edit ModeDisplay Mode  Every rendering control has at least one rendering template associated with it  A RenderingTemplate object is defined as a RenderingTemplate element in an.ascx file  The rendering template is referenced by its ID value in the rendering control object's TemplateName property Demo

13 HOME EVIDENCE EXECUTION MICROSOFT SOLUTIONS SERVICES PARTNERS Rendering Control – BaseFieldControl Demo Edit ModeDisplay Mode

14 HOME EVIDENCE EXECUTION MICROSOFT SOLUTIONS SERVICES PARTNERS Rendering Control – CreateChildControls Demo Edit ModeDisplay Mode

15 HOME EVIDENCE EXECUTION MICROSOFT SOLUTIONS SERVICES PARTNERS Demo InPagePod Field – Rendering Template & Rendering Control

16 HOME EVIDENCE EXECUTION MICROSOFT SOLUTIONS SERVICES PARTNERS  Rendering Template  Rendering Control  Naming Convention - field_type_nameFieldControl  Edit Mode  Display Mode  The Rendering Template is referenced by its ID value in the Rendering Control object's TemplateName property  BaseFieldControl-derived rendering control handles interaction with users  Its plain simple HTML/ASCX code Field Control – Summary Demo

17 HOME EVIDENCE EXECUTION MICROSOFT SOLUTIONS SERVICES PARTNERS Field Class Demo

18 HOME EVIDENCE EXECUTION MICROSOFT SOLUTIONS SERVICES PARTNERS Field Class SPFieldBooleanSPFieldChoiceSPFieldCurrencySPFieldLookupSPFieldMultiColumnSPFieldMultiChoiceSPFieldMultiLineTextSPFieldNumberSPFieldRatingScaleSPFieldTextSPFieldUrlSPFieldUser  This is a class whose instances can represent particular fields that are based on your custom field type  This class must inherit from SPField or one of the classes in Windows SharePoint Services that derive from it Demo

19 HOME EVIDENCE EXECUTION MICROSOFT SOLUTIONS SERVICES PARTNERS Demo InPagePod Field – Field Class

20 HOME EVIDENCE EXECUTION MICROSOFT SOLUTIONS SERVICES PARTNERS  Naming Convention - field_type_nameField  Field class should inherit either SPField or one of the various other SPField classes  InPagePod inherits from SPFieldMultiColumn  Override the FieldRenderingControl method which returns the control that can be used to render the field in Edit and Display mode  Field Class object handles interactions with the content database Field Class – Summary Demo

21 HOME EVIDENCE EXECUTION MICROSOFT SOLUTIONS SERVICES PARTNERS Field Value Demo

22 HOME EVIDENCE EXECUTION MICROSOFT SOLUTIONS SERVICES PARTNERS Field Value titleImgUrl;podContent;contentImageUrl String Value Custom Value Class ;#TitleImage;#PodContent;#ContentImage;# Demo

23 HOME EVIDENCE EXECUTION MICROSOFT SOLUTIONS SERVICES PARTNERS Field Value – Saving Field Values Demo

24 HOME EVIDENCE EXECUTION MICROSOFT SOLUTIONS SERVICES PARTNERS Demo InPagePod Field – Field Value

25 HOME EVIDENCE EXECUTION MICROSOFT SOLUTIONS SERVICES PARTNERS  Naming Convention - field_type_nameFieldValue  String Value  Custom Value Class  A custom field value class must implement at least two constructors, and usually only two  SharePoint delimiter - ;# Field Value– Summary Demo

26 HOME EVIDENCE EXECUTION MICROSOFT SOLUTIONS SERVICES PARTNERS Field Validation Demo

27 HOME EVIDENCE EXECUTION MICROSOFT SOLUTIONS SERVICES PARTNERS Field Validation Demo Field Validation Rendering Control When Saving Field ValuesOverride Validate Method Field Class Override GetValidatedString Method (before committing to the content database) (before saving the Publishing page)

28 HOME EVIDENCE EXECUTION MICROSOFT SOLUTIONS SERVICES PARTNERS Validate When Saving Field Values Demo

29 HOME EVIDENCE EXECUTION MICROSOFT SOLUTIONS SERVICES PARTNERS Overriding Validate Method Demo ;#TitleImage;#PodContent;#ContentImage;#

30 HOME EVIDENCE EXECUTION MICROSOFT SOLUTIONS SERVICES PARTNERS Overriding GetValidatedString Method Demo ;#TitleImage;#PodContent;#ContentImage;#

31 HOME EVIDENCE EXECUTION MICROSOFT SOLUTIONS SERVICES PARTNERS Demo InPagePod Field – Field Validation

32 HOME EVIDENCE EXECUTION MICROSOFT SOLUTIONS SERVICES PARTNERS  Validate the control values before setting the field values in the Field Control class  Set the IsValid to true  Set the ErrorMessage to an appropriate error message  Override the Validate method in the Field Control class  Set the IsValid to true  Set the ErrorMessage to an appropriate error message  Override the GetValidatedString in the Field class  Throw SPFieldValidationException as an error Field Validation – Summary Demo

33 HOME EVIDENCE EXECUTION MICROSOFT SOLUTIONS SERVICES PARTNERS Field Type Definition Demo

34 HOME EVIDENCE EXECUTION MICROSOFT SOLUTIONS SERVICES PARTNERS Field Type Definition Demo fldtypes*.xml fldtypes_spconf.xml

35 HOME EVIDENCE EXECUTION MICROSOFT SOLUTIONS SERVICES PARTNERS Demo InPagePod Field – Field Type Definition

36 HOME EVIDENCE EXECUTION MICROSOFT SOLUTIONS SERVICES PARTNERS Custom Field Type Deployment Demo

37 HOME EVIDENCE EXECUTION MICROSOFT SOLUTIONS SERVICES PARTNERS Custom Field – Deployment Demo *.ascx *.cs (.dll) fldtypes*.xml Rendering Template Rendering Control Class Field Control Class Field Class Field Value Class Field Type Definition *.WSP 12\TEMPLATE\CONTROLTEMPLATES\ GAC 12\TEMPLATE\XML\

38 HOME EVIDENCE EXECUTION MICROSOFT SOLUTIONS SERVICES PARTNERS Session Summary Demo *.WSP SPFieldBooleanSPFieldChoiceSPFieldCurrencySPFieldLookupSPFieldMultiColumnSPFieldMultiChoice............

39 HOME EVIDENCE EXECUTION MICROSOFT SOLUTIONS SERVICES PARTNERS  Web Content Management Resource Center for SharePoint Server  http://bit.ly/moss-wcm  SharePoint Server Developer Center  http://bit.ly/moss-dev  MSDN: How to Create a Custom Field Control  http://bit.ly/custom-field-control  Chaks’ Blog  http://bit.ly/chaks  Robert Stewart’s Blog  http://bit.ly/robert-stewart Resources Demo

40 HOME EVIDENCE EXECUTION MICROSOFT SOLUTIONS SERVICES PARTNERS Thank You chaks@intergen.co.nz robs@intergen.co.nz


Download ppt "HOME EVIDENCE EXECUTION MICROSOFT SOLUTIONS SERVICES PARTNERS Custom Field Controls and SharePoint Web Content Management Chakkaradeep Chandran Robert."

Similar presentations


Ads by Google