sharepoint 2010 development
DESCRIPTION
Presentation for MOSSIG Feb 2010 on SharePoint 2010 development.TRANSCRIPT
![Page 1: SharePoint 2010 Development](https://reader033.vdocument.in/reader033/viewer/2022051610/5488cd83b47959e20c8b582f/html5/thumbnails/1.jpg)
SharePoint 2010 Developer Quick Start
![Page 2: SharePoint 2010 Development](https://reader033.vdocument.in/reader033/viewer/2022051610/5488cd83b47959e20c8b582f/html5/thumbnails/2.jpg)
SharePoint Designer Improvements
• Add lists, columns, forms , custom actions without the need to go to the browser.
• Fine grained designer control
• SPD work migrates to Visual Studio 2010– SPD customization work exported to .wsp files– .wsp files imported into Visual Studio
![Page 3: SharePoint 2010 Development](https://reader033.vdocument.in/reader033/viewer/2022051610/5488cd83b47959e20c8b582f/html5/thumbnails/3.jpg)
Development lifecycle
Prototype in Designer
Export to WSP
Import to Visual Studio 2010Refine features
Deploy
![Page 4: SharePoint 2010 Development](https://reader033.vdocument.in/reader033/viewer/2022051610/5488cd83b47959e20c8b582f/html5/thumbnails/4.jpg)
Demo – Designer
![Page 5: SharePoint 2010 Development](https://reader033.vdocument.in/reader033/viewer/2022051610/5488cd83b47959e20c8b582f/html5/thumbnails/5.jpg)
PowerShell
• 2007 administration = STSADM.EXE + extensions and console applications
• Replaced with PowerShell– PowerShell support effectively replaces STSADM.EXE– SharePoint admins/devs must learn PowerShell basics– You can write powerful scripts against WSS OM– You can develop custom PowerShell snap-ins
![Page 6: SharePoint 2010 Development](https://reader033.vdocument.in/reader033/viewer/2022051610/5488cd83b47959e20c8b582f/html5/thumbnails/6.jpg)
PowerShell Tools
![Page 7: SharePoint 2010 Development](https://reader033.vdocument.in/reader033/viewer/2022051610/5488cd83b47959e20c8b582f/html5/thumbnails/7.jpg)
PowerShell 101
• Get-Command -pssnapin Microsoft.SharePoint.PowerShell
• Get-Help Get-SPSite
• Get-Help Get-SPSite –Examples
• Get-Command -noun "SPService*" | Sort Noun | Select Noun –Unique
• Get-Command -noun "SPService*" | Sort Noun | Select Noun –Unique > text.txt
![Page 8: SharePoint 2010 Development](https://reader033.vdocument.in/reader033/viewer/2022051610/5488cd83b47959e20c8b582f/html5/thumbnails/8.jpg)
SharePoint 2010 Developer Dashboard
![Page 9: SharePoint 2010 Development](https://reader033.vdocument.in/reader033/viewer/2022051610/5488cd83b47959e20c8b582f/html5/thumbnails/9.jpg)
Correlation ID
![Page 10: SharePoint 2010 Development](https://reader033.vdocument.in/reader033/viewer/2022051610/5488cd83b47959e20c8b582f/html5/thumbnails/10.jpg)
Visual Studio 2010 SharePoint Tools• End-to-end SharePoint 2010 developer story
– SharePoint Explorer for site exploration– SharePoint 2010 project and item templates– Visual designers for core scenarios– Migration path for Visual Studio 2008 for WSS 3.0– Extensible by 3rd party developers
• Benefits to SharePoint developers– Abstracts away details of RootFiles directory– Abstracts away details of building .wsp file– Lessens/eliminates need for external utilities
![Page 11: SharePoint 2010 Development](https://reader033.vdocument.in/reader033/viewer/2022051610/5488cd83b47959e20c8b582f/html5/thumbnails/11.jpg)
Demo – VS 2010
![Page 12: SharePoint 2010 Development](https://reader033.vdocument.in/reader033/viewer/2022051610/5488cd83b47959e20c8b582f/html5/thumbnails/12.jpg)
Feature Improvements
• Feature Versioning & Upgrade (ALM)• New Events• Workflow Association• Property Bag• UI Version• Web Templates• New custom action options
![Page 13: SharePoint 2010 Development](https://reader033.vdocument.in/reader033/viewer/2022051610/5488cd83b47959e20c8b582f/html5/thumbnails/13.jpg)
Feature Versioning & Upgrade• Version Range – BeginVersion/EndVersion• Upgrade Elements
– CustomUpgradeAction• Parameters
– ApplyElementManifest– MapFile – FromPath/ToPath– AddContentTypeField
![Page 14: SharePoint 2010 Development](https://reader033.vdocument.in/reader033/viewer/2022051610/5488cd83b47959e20c8b582f/html5/thumbnails/14.jpg)
Upgrade Scenario
Site A Feature X 1.0
Deployed
Site B Feature X Not
Deployed
Site A Feature X 1.0
Upgraded
Site B Feature X
Not Deployed
Site A Feature X 1.0
Upgraded
Site B Feature X 1.0 Deployed
+ Upgraded
![Page 15: SharePoint 2010 Development](https://reader033.vdocument.in/reader033/viewer/2022051610/5488cd83b47959e20c8b582f/html5/thumbnails/15.jpg)
EventsAdded…• Item Events
– ContextEvent– ItemAdding/ItemAdded– ItemUpdating/ItemUpdated– ItemDeleting/ItemDeleted– ItemCheckingIn/ItemCheckedIn– ItemCheckingOut/ItemCheckedOut– ItemUncheckingOut/ItemUncheckedOut– ItemAttachmentAdding/ItemAttachmentAdded– ItemAttachmentDeleting/ItemAttachmentDeleted– ItemFileMoving/ItemFileMoved– ItemFileConverted
• Workflow Events– WorkflowStarting/WorkflowStarted– WorkflowPostponed– WorkflowCompleted
Site EventsSiteDeleting/SiteDeletedWebDeleting/WebDeletedWebMoving/WebMovedWebAdding/WebProvisioned
List EventsEmailReceivedFieldAdding/FieldAddedFieldUpdating/FieldUpdatedFieldDeleting/FieldDeletedListAdding/ListAddedListDeleting/ListDeleted
![Page 16: SharePoint 2010 Development](https://reader033.vdocument.in/reader033/viewer/2022051610/5488cd83b47959e20c8b582f/html5/thumbnails/16.jpg)
Post Synchronous Events
• WSS 3.0 “after” events are exclusively asynchronous
• Problem when wanting to do post processing after item submitted, but before displaying to user
• SPF 4.0 adds new property on receiver definition to change “after” event to synchronous– SPEventReceiverDefinition.Synchronization
![Page 17: SharePoint 2010 Development](https://reader033.vdocument.in/reader033/viewer/2022051610/5488cd83b47959e20c8b582f/html5/thumbnails/17.jpg)
Event Impersonation Improvements• WSS 3.0 events run in context of user who
triggered the event• Certain things trigger events to run under
System Account (workflow, etc), but doesn’t permit reverting back to user who triggered action
• SPF 4.0 now adds the originating user & user token on SPEventPropertiesBase
![Page 18: SharePoint 2010 Development](https://reader033.vdocument.in/reader033/viewer/2022051610/5488cd83b47959e20c8b582f/html5/thumbnails/18.jpg)
Feature Property Bag• Promote Feature Properties into Web/Site
property bag– Root web– Web– Folder– List Item
• No direct VS designer support• Updates value if exists, otherwise adds
– Types enforced: DateTime, Int32
![Page 19: SharePoint 2010 Development](https://reader033.vdocument.in/reader033/viewer/2022051610/5488cd83b47959e20c8b582f/html5/thumbnails/19.jpg)
Web Templates
• Replacement and Improved Framework for STP -- Save as Template->WSP
• Exports everything +content(optional) +onet.xml• Stored in Solution Gallery or at the Farm• $ListId:Lists/someListName• Considerations
– Use VS WSP import to trim or ‘featurize’ items– Web Templates are Features and can be upgraded
![Page 20: SharePoint 2010 Development](https://reader033.vdocument.in/reader033/viewer/2022051610/5488cd83b47959e20c8b582f/html5/thumbnails/20.jpg)
Relational Lists: Joins
• With relational lists, SPF 4.0 adds support for joins
• Joins can only be implemented by developers using the API, CAML or SharePoint Designer 2010
• New properties on SPQuery:– SPQuery.Join– SPQuery.ProjectedFields
• Use SPLinq instead of CAML to join two lists in code
![Page 21: SharePoint 2010 Development](https://reader033.vdocument.in/reader033/viewer/2022051610/5488cd83b47959e20c8b582f/html5/thumbnails/21.jpg)
Querying Large Lists
• If throttling is enabled & list limit exceeded threshold, users won’t be able to query lists by default via API
• Can override querying the large list settings provided Web App configured to allow it
• Override using:– SPQuery.RequestThrottleOverride– SPSiteDataQuery.RequestThrottleOverride
• Only users with proper permissions get override ability (set via policies)
![Page 22: SharePoint 2010 Development](https://reader033.vdocument.in/reader033/viewer/2022051610/5488cd83b47959e20c8b582f/html5/thumbnails/22.jpg)
Content Iterator
SPQuery query = new SPQuery(); query.Query = "<Where><Eq><FieldRef Name=\"MyIndexedField\"/><Value Type=\"Text\">FieldValue</Value></Eq></Where>" + ContentIterator.ItemEnumerationOrderByNVPField;
ContentIterator ci = new ContentIterator();
ci.MaxItemsPerQuery = 500;
ci.ProcessItemsInList(query,
delegate(SPListItem item)
{ // Work on each item. },
delegate(SPListItem item, Exception e)
{ // Handle an exception that was thrown while iterating. // Return true so that ContentIterator rethrows the exception. return true; } );
![Page 23: SharePoint 2010 Development](https://reader033.vdocument.in/reader033/viewer/2022051610/5488cd83b47959e20c8b582f/html5/thumbnails/23.jpg)
Questions ?
@laneyvbhttp://laneyvb.blogspot.com