• Save
SharePoint Custom Field Controls
Upcoming SlideShare
Loading in...5
×
 

SharePoint Custom Field Controls

on

  • 20,866 views

 

Statistics

Views

Total Views
20,866
Views on SlideShare
20,437
Embed Views
429

Actions

Likes
8
Downloads
0
Comments
1

5 Embeds 429

http://www.chakkaradeep.com 300
http://www.slideshare.net 112
http://dagama2012 15
http://sharepointitaly.blogspot.it 1
http://www.linkedin.com 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

CC Attribution License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel

11 of 1

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • Can you provided a downloadable version of this PPT?
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    SharePoint Custom Field Controls SharePoint Custom Field Controls Presentation Transcript

    • Custom Field Controls and SharePoint Web Content Management
      Chakkaradeep Chandran
      Robert Stewart
    • Session Overview
      • SharePoint artefacts and Web Content Management
      • Intergen – “powered by Microsoft Office SharePoint” Demo
      • Role of Content Types, Site Columns in a Publishing Site
      • Custom Field Types
      • Web Parts Vs Field Controls as content regions
      • Custom field type development topics
    • SharePoint and WCM
      • 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
    • Demo
      Intergen “powered by Microsoft Office SharePoint” demo
    • Page Layouts, Content Types, Site Columns
      GeneralPage Content Type
      Title
      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.
      Description
      Page Content
      Page Image
      GeneralPageLayout.aspx
    • Custom Field Types
      • SharePoint and WSS include many field types
      • Text
      • Choice Fields
      • Hyperlink or Picture
      • Publishing HTML
      • Create custom field types to satisfy requirements not met by out of the box field types
      • Field Type == Data Type
      • Field type provide field rendering facilities
      • Field controls are tightly coupled with the type of the field
      • Field controls deliver or capture the content in a Publishing Page
    • Web Parts Vs Field Controls
      • 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
    • Demo
      Custom Field Control - Components
    • Development Components
      Demo
      {.......}
      {....}
    • Demo
      Field Control – Rendering Template &
      Rendering Control
    • Field Control – Rendering Template
      Demo
      Rendering Template
      Edit Mode
      Display Mode
    • Field Control – Rendering Control
      Demo
      Edit Mode
      Display 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
    • Rendering Control – BaseFieldControl
      Demo
      Edit Mode
      Display Mode
    • Rendering Control – CreateChildControls
      Demo
      Edit Mode
      Display Mode
    • Demo
      InPagePod Field – Rendering Template & Rendering Control
    • Field Control – Summary
      Demo
      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
    • Demo
      Field Class
    • Field Class
      Demo
      • 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
      InPagePod Field – Field Class
    • Field Class – Summary
      Demo
      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 FieldRenderingControlproperty 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
    • Demo
      Field Value
    • Field Value
      Demo
      String Value
      (Or)
      titleImgUrl;podContent;contentImageUrl
      Custom Value Class
      SPFieldMultiColumnSPFieldMultiColumnValue
      SPFieldUrl
      SPFieldUrlValue
      ;#TitleImage;#PodContent;#ContentImage;#
    • Field Value – Saving Field Values
      Demo
    • Demo
      InPagePod Field – Field Value
    • Field Value– Summary
      Demo
      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 - ;#
    • Demo
      Field Validation
    • Field Validation
      Demo
      (when the Publishing
      Page is validated)
      (before committing to
      the content database)
    • Validate When Saving Field Values
      Demo
    • Overriding Validate Method
      Demo
      ;#TitleImage;#PodContent;#ContentImage;#
    • Overriding GetValidatedString Method
      Demo
      ;#TitleImage;#PodContent;#ContentImage;#
    • Demo
      InPagePod Field – Field Validation
    • Field Validation – Summary
      Demo
      Validate the control values before setting the field values in the Field Control class
      Set the IsValidto false
      Set the ErrorMessageto an appropriate error message
      Override the Validate method in the Field Control class
      Set the IsValidto false
      Set the ErrorMessageto an appropriate error message
      Override the GetValidatedString in the Field class
      Throw SPFieldValidationException as an error
    • Demo
      Field Type Definition
    • Field Type Definition
      Demo
      fldtypes_spconf.xml
      fldtypes*.xml
    • Demo
      InPagePod Field – Field Type Definition
    • Demo
      Custom Field Type Deployment
    • Custom Field – Deployment
      Demo
      *.ascx
      Rendering Template
      12TEMPLATECONTROLTEMPLATES
      Rendering Control Class
      *.cs (.dll)
      Field Control Class
      fldtypes*.xml
      GAC
      Field Class
      Field Value Class
      Field Type Definition
      12TEMPLATEXML
      *.WSP
    • Custom Field – Usage
      Demo
    • Session Summary
      Demo
      *.WSP
    • Resources
      Demo
      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
    • Thank You
      chaks@intergen.co.nz
      robs@intergen.co.nz