600 likes | 751 Views
SharePoint 2010. Session - 4. By: Usman Zafar Malik [MCTS: MOSS 2007], [MSCBSS: CRM 3.0 / 4.0], MCP. SharePoint 2010 Development. SharePoint 2010 Development. Content Types Site Columns List and Libraries List Definitions Event Receiver on Features Event Receiver on Lists
E N D
SharePoint 2010 Session - 4 By: Usman Zafar Malik [MCTS: MOSS 2007], [MSCBSS: CRM 3.0 / 4.0], MCP
SharePoint 2010 Development • Content Types • Site Columns • List and Libraries • List Definitions • Event Receiver on Features • Event Receiver on Lists • List Instances • Page Layouts
Site Columns What are site columns? • A column represents an attribute, or piece of metadata, that the user wants to manage for the items in the list or content type to which they added the column. Possible scopes • When you create a site column on a site, that site column also becomes available to any child sites, and thereby, the lists on those sites.
Site Columns <Field ID="{9A77BCEB-5230-48f2-93ED-D87DAAEC6998}" Name=“SC1" StaticName=“SC1" SourceID="http://schemas.microsoft.com/sharepoint/v4" Group=“Group Site Columns" DisplayName=“SC 1" Type="Text" Required="FALSE" Sealed="FALSE"> </Field>
Content Types What is content type? • A content type is simply a way to define a particular set of information. Possible scopes • Farm: No • Web Application: No • Site Collection: Yes • Web Site: Yes
Content Types • Two valid ways to construct a content type ID • Parent content type ID + two hexadecimal values (the two hexadecimal values cannot be "00") • Parent content type ID + "00" + hexadecimal GUID
Content Types <?xml version="1.0" encoding="utf-8"?> <Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <!-- Parent ContentType: Item (0x01) --> <ContentType ID="0x010058be2d7367e54e128230e227d79d6112" Name="DummySharePointProject - DummyContentType1" Group="Custom Content Types" Description="My Content Type" Inherits="TRUE" Version="0"> <FieldRefs> <FieldRef ID="{9A77BCEB-5230-48f2-93ED-D87DAAEC6998}" Name="SC1" /> <FieldRef ID="{6AAD913B-D930-49b5-8BCD-99FAB8857257}" Name="ExpiresOn" /> <FieldRef ID="{D38E97DA-CD82-4a77-9086-3B97A6D61A92}" Name="Activated" /> </FieldRefs> </ContentType> </Elements>
List Definitions What is List Definition? • List Definition as a Blueprint or template of a list using which you can create instances of list
List Instance What is List Instance? • An instance or object of List created from the List Definition. Possible scopes • Farm: No • Web Application: No • Site Collection: Yes • Web Site: Yes
Event Receivers What are Event Receivers? • In Simple words, Event Handlers. Perform an operation when an event occurred.
Event Receivers Types of Event Receivers List Events - Adding/eda new list field. - Updating/eda field. List Item Events - Adding/eda new list item or document. - Document checking/ed in or out. - Adding/edan attachment. - Deleting/edan item or document.
Event Receivers Types of Event Receivers List Email Events - A list received an email.Web Events - Deleting/eda site collection or site.- Creating/eda new site collection or sub site.Feature Events - Feature activating/ed or deactivating/ed.List Workflow Events - A workflow is starting/ed, postponed, or completed