SharePoint 2010 Developer Quick Start<br />
SharePointDesignerImprovements<br />Add lists, columns, forms , custom actions without the need to go to the browser.<br /...
Development lifecycle<br />
Demo – Designer<br />
PowerShell<br />2007 administration = STSADM.EXE + extensions and console applications<br />Replaced with PowerShell<br />...
PowerShell Tools<br />
PowerShell 101<br />Get-Command -pssnapinMicrosoft.SharePoint.PowerShell<br />Get-Help Get-SPSite<br />Get-Help Get-SPSite...
SharePoint 2010 Developer Dashboard<br />
Correlation ID<br />
Visual Studio 2010 SharePoint Tools<br />End-to-end SharePoint 2010 developer story<br />SharePoint Explorer for site expl...
Demo – VS 2010<br />
Feature Improvements<br />Feature Versioning & Upgrade (ALM)<br />New Events<br />Workflow Association<br />Property Bag<b...
Feature Versioning & Upgrade<br />Version Range – BeginVersion/EndVersion<br />Upgrade Elements<br />CustomUpgradeAction<b...
Upgrade Scenario	<br />
EventsAdded…<br />Site Events<br />SiteDeleting/SiteDeleted<br />WebDeleting/WebDeleted<br />WebMoving/WebMoved<br />WebAd...
Post Synchronous Events<br />WSS 3.0 “after” events are exclusively asynchronous<br />Problem when wanting to do post proc...
Event Impersonation Improvements<br />WSS 3.0 events run in context of user who triggered the event<br />Certain things tr...
Feature Property Bag<br />Promote Feature Properties into Web/Site property bag<br />Root web<br />Web<br />Folder<br />Li...
Web Templates<br />Replacement and Improved Framework for STP -- Save as Template->WSP<br />Exports everything +content(op...
Relational Lists: Joins<br />With relational lists, SPF 4.0 adds support for joins<br />Joins can only be implemented by d...
Querying Large Lists<br />If throttling is enabled & list limit exceeded threshold, users won’t be able to query lists by ...
Content Iterator<br />SPQuery query = new SPQuery(); query.Query = "<Where><Eq><FieldRef Name="MyIndexedField"/><Value Typ...
Questions ?@laneyvbhttp://laneyvb.blogspot.com<br />
Upcoming SlideShare
Loading in …5
×

SharePoint 2010 Development

3,365 views

Published on

Presentation for MOSSIG Feb 2010 on SharePoint 2010 development.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
3,365
On SlideShare
0
From Embeds
0
Number of Embeds
48
Actions
Shares
0
Downloads
72
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • SharePoint Designer has gone through many significant changes and is now a solid development toolSharePoint objects such as lists and workflow associations are seen as first class objects in the new UIEach SharePoint object has a summary pageThe new workflow designer is much more powerfulSPD can create reusable workflows – this was a big problem in SPD 2007Prototypes created in SPD can be migrated into Visual Studio 2010
  • The SharePoint team has now gotten in line with many other server product teams at Microsoft and made SharePoint Server 2010 completely administrate-able through PowerShell scriptsBoth dev’s and admins need to get to know powershell, as a dev it will replace some of the console admin apps typically written as well as setup and tear down scripts for deployments.
  • Windowspowershell plus load snapinSharePoint management shell from sharepoint menuISE – can limited debugVisual studio for custom cmdlet creation + third party tools
  • Get all sharepoint commands
  • The developer dashboard has been introduced with SharePoint Server 2010. It shows diagnostics and performance-related statistics.How long did the request take to run?What event handlers were fired?In what sequence did these event handlers fire?At the moment is enabled via code/powershell. Can be set to on , off or ondemand
  • The Visual Studio 2010 SharePoint Tools (SPT) represents a significant step forward for professional developers using SharePoint. SharePoint Explorer fallows quick exploration through a siteThis makes it possible to launch browser at specific place within siteSharePoint 2010 introduce a new project structure as well as project tmplates and project item templates. There are designers to create things like features and solution packages.One of the most appealing aspects of SPT is that it is extensibleYou can add your own custom project templates and item templatesYou can add menu commands into the Visual Studio UI.
  • Version Range denotes the target version to upgrade. Any feature with this version or newer, or where a version does not exist will be upgraded to the EndVersion. The feature version is updated to reflect this new EndVersion.ApplyElementManifest – allows for an additional manifest file to be added to the featureCustomUpgradeAction -- allows for the passing of one or more parameters to a feature receiver’s FeatureUpgrading method.AddContentTypeField – Adds a new field to a provisioned content type. The element takes a ContentTypeId, FieldId, and a bool PushDown which denotes ifThe system should propagates the change to child lists and content types. (Optional)MapFile – Maps a file that has not been customized to a different path on the front-end web server or to simply rename a file. V2V Upgrade most likely scenario.
  • Highlight that code may run well after you intended e.g. when feature is enabled on site b the first version will run, then the upgrading code.If lots of versions have been incremented this could be a lot of code to run onfeature activation.
  • WebAdding/ WebProvisioned only fired for sub webs, not for the root web of the site collection.Plus despite naming they are a pair sync and async.
  • SPF 4.0 introduces concept of synchronous post-eventsAllows developer to do a little post-processing after the commit of the action, but before user is presented with the result of the post
  • In WSS 3.0 when a workflow triggered an event by adding/changing something in a task list, the task item’s identity would be the system account that executed the workflowIn SPF 4.0 the same is true, but the SPEventPropertiesBase now contains properties that contain the user name &amp; user token of the person who actually triggered the effective action (like started the workflow)
  • An elements manifest (eg. elements.xml) file can contain a new element section called PropertyBag. This element allows key/value pairs to be promoted into their parent object such as a web, sub web, folder, list item, or file (note no List object here). This allows the developer to avoid writing code which promotes feature properties into property bag elements of these objects. Each value is added to or updated within the Hashtable object which implements the property bag at the parent. Currently two type DateTime and Int32 are enforced in that if the current value is of either of these types for any key which exists an update to these values need to be of the same time or the value in the Hashtable will be set to NULL.Note supported: Farm, WebApplication, ..ListSo this means this will not work for a Farm or WebApplication feature, only supported scope Web.
  • All of the information is saved as a real solution which VS can open. Developers can build on top of.There is a tie back, they were created from the same WSP, they get the new functionality, features, etc.WebTemplate feature Element – provides a way to deploy site collection specific site definitions. WebTemplate has it’s own site definition (onet.xml), which is merged with the oob site definition template.$ListId:Lists/Announcements – replaced with list GUID when provisioned – this new options is utilize as part of the wsp saving process. You can also utilize this by your self, which provides you a way to customize the view aspx pages etc.
  • Finally support for joins! Joins can be implemented using CAML query, but much easier to use LINQ CAML schema updated to support LINQ based joins LINQ will generate the CAML under the covers… LINQ much easier to write than new CAML schema Can also create joins via API using two new properties: SPQuery.Join &amp; SPQuery.ProjectedFields
  • Throttled lists, which is triggered by exceeding the upper limit, will cause queries with a result set in excess of the upper limit to throw an exceptionHowever, this can be overridden by users with required permissions via code
  • Ensure you include one of the three OrderBy clauses—ContentIterator.ItemEnumerationOrderByID, ContentIterator.ItemEnumerationOrderByPath, or ContentIterator.ItemEnumerationOrderByNVPField—that enables the index to be used.Without an OrderBy clause, your query could be blocked. SharePoint Server 2010 adds a default OrderBy clause that orders by content type, which ensures that folders are returned before list items. Unless you override this behavior with one of the three OrderBy clauses listed above, your query cannot take full advantage of using indexed fields, and it will be blocked whenever the query is not designed to be restrictive enough to return fewer than the maximum number of items. The following code example shows how to use the ContentIterator.ItemEnumerationOrderByNVPField clause. The example assumes that you are querying an indexed field.
  • Ensure you include one of the three OrderBy clauses—ContentIterator.ItemEnumerationOrderByID, ContentIterator.ItemEnumerationOrderByPath, or ContentIterator.ItemEnumerationOrderByNVPField—that enables the index to be used.Without an OrderBy clause, your query could be blocked. SharePoint Server 2010 adds a default OrderBy clause that orders by content type, which ensures that folders are returned before list items. Unless you override this behavior with one of the three OrderBy clauses listed above, your query cannot take full advantage of using indexed fields, and it will be blocked whenever the query is not designed to be restrictive enough to return fewer than the maximum number of items. The following code example shows how to use the ContentIterator.ItemEnumerationOrderByNVPField clause. The example assumes that you are querying an indexed field.
  • SharePoint 2010 Development

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

    ×