1 / 46

List Enhancements and Customizations in SharePoint 2010

List Enhancements and Customizations in SharePoint 2010. Name Title Company. Agenda. Improved Support for Events List Relationships and Joins Field & List Item validation and improvements Large List Support XSL Based Views InfoPath for list forms and web part usage.

lihua
Download Presentation

List Enhancements and Customizations in SharePoint 2010

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. List Enhancements and Customizations in SharePoint 2010 Name Title Company

  2. Agenda • Improved Support for Events • List Relationships and Joins • Field & List Item validation and improvements • Large List Support • XSL Based Views • InfoPath for list forms and web part usage

  3. What’s new in events? Improved Support for Events

  4. New & Improved Events • New events in SPF 2010 • WebAdding & WebProvisioned • ListAdding & ListAdded • ListDeleting & ListDeleted • New Registration Capabilities • Site collection level event registration to support new events • SPSite & SPWeb event receiver registration via Features

  5. 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 2010 adds new property on receiver definition to change “after” event to synchronous • SPEventReceiverDefinition.Synchronization

  6. Cancelling Events & Custom Error Pages • WSS 3.0 provided capability to cancel synchronous events & returning an error message • SPF 2010 introduces capability to cancel error and redirect user to custom error page • Not possible on post synchronous events • Synchronous cancel with redirection URL • Office clients support cancellation, but not redirection

  7. 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 2010 now adds the originating user & user token on SPEventPropertiesBase

  8. Events in Visual Studio 2010 Tools

  9. New & Improved Events demo

  10. What’s new in lists and how can I utilize these new functionalities? List Relationships and Joins

  11. Relational Lists & Joins • SPF 2010 introduces the capability to have a relationship behavior enforced by a Lookup field • New investments: • Projected fields into child lists • Joins • Relational integrity between parent & child lists • Introduces also new security considerations and possible issues

  12. List lookups • Lookups form relationships between lists • One-to-many • Many-to-many Lookup Lookup 1 1 m m Clients Projects Timecards

  13. List relationships and data integrity • One-to-many relationships can be used to: • Trigger Cascade Delete • Restrict Delete Lookup Lookup 1 1 m m Clients Projects Timecards

  14. List joins and projections • Query within and across lists: • Join lists using lookup columns • Lookup to multiple columns Lookup Lookup 1 1 m m Clients Projects Timecards Query Result Set

  15. Projected Fields and joins • Projected Fields • Extra field pulled from parent list into view of child list • Via browser interface, users add a lookup • User can select a secondary fields to pull into the child list • 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 easily

  16. Relational Lists: Projected Fields

  17. Relational Lists & Joins demo

  18. What’s new for large lists and how to access them efficiently? Large List Support

  19. Large List Support • SPF 2010 lists can now support 50M items • Under read scenarios • Platform Investments: • Configuration options for administrators per Web application (Central Administration) • Site collection & list administrators can request exemptions from the throttle(for expensive queries) • Throttling in place by default

  20. Managing Large Lists • Web Application Settings: • List view threshold (w/ warning threshold) • Allow object model override • Enables developers with sufficient permissions to programmatically use the List View Threshold for administrators and auditors, which is higher than the normal user's List View Threshold by default: • List View Threshold: 5,000 items • List View Threshold for Administrators and Auditors: 20,000 items • Daily window time for expensive queries without threshold

  21. Managing Large Lists (2) • List level settings • Kicks in when the item amount in list meets certain threshold • List administrators can see warnings & messages when lists exceed thresholds from list settings page • Note. Warnings are based on item count on the list, not on the item amount on single view

  22. Content Iteration – handling items in batches • Scenarios: • Moving all items tagged with “Confidential” to another repository • Reporting on all content in a site about to go live in the next month • Processing all content in a library that is expiring within the next month • Enforcing metadata consistency or change across a corpus of content • Solution: ContentIterator

  23. Threshold query.Query =“<where><Lt><FieldRef Name=‘Expiration’/>” +    “<Value type=‘DateTime’>2009-07-01</Value></Lt></where>” query.ViewAttributes = “Scope=‘Recursive’”;SPListItemCollection items = list.GetItems(query); Foreach (SpListItem iteminitems) {// Add to report} List 20,000 All items: Expiration < 07/01/2009 6,000 Expiration >= 07/01/2009 14,000 Sorted by index: 5,000 Threshold! SPQuery:

  24. Using ContentIterator query.Query =“<where><Lt><FieldRef Name=‘Expiration’/>” +    “<Value type=‘DateTime’>2009-07-01</Value></Lt></where>”ContentIterator ci =newContentIterator();ci.ProcessListItems(list,query,true,// Recursive query2000,// Page size of 2000delegate(SPListItemCollection items) {// Process the items batch by batch},delegate(SPListItemCollection items, Exception e) {// Handle exception   }); List 20,000 All items: Expiration < 07/01/2009 6,000 Expiration >= 07/01/2009 14,000 Sorted by index: 2k 2k 2k SPQuery:

  25. Wide List Limits & Threshold • Support for number of fields that makeup a SPListItem • SPF 2010 – SPListItems are limited to 6 rows • SPListItem limited to 8KB of data • List view lookup threshold = eight • Exception thrown if code tries to select fields from more than eight fields from the joined lists • If no view fields specified (maximal view), only the first eight pulled and only the IDs for the remaining lookups will be retrieved.

  26. Using content iterator to handling list items demo

  27. How to define field or list item validations? Field & List Item validation and improvements

  28. Unique Column Constraints • Lists can now contain columns that require all values in all items in the list for that column to be unique • Scoped at SPList, not SPFolder, level • Unique columns must be indexed (automatically configured) • When making existing column unique, existing data is validated • Uniqueness determined by SQL collation • Ex: Case sensitive / insensitive

  29. List Item Validation • Items are validated against a custom formula when saved

  30. List Item Field Validation • Similar to list item validation, each column can be validated using a custom field, or by referencing other fields

  31. Defining validations from code • You can define the validation rules for list item or item field also from code – like from feature receiver

  32. List item and field validations demo

  33. How the rendering logic of lists have been improved? XSL Based Views

  34. XsltListViewWebPart • Replaces ListViewWebPart • Rich customization support through SPD • Schema agnostic • Better UX • In-Place Editing

  35. Inside the XsltListViewWebPart CAML Query XmlDefinition SPDataSource XML Data XsltListViewWebPart HTML List Schema ListName XslCompiledTransform View Transform XSL

  36. XsltListViewWebPart demo

  37. Flexible form design for lists and forms in web parts InfoPath for list forms and web part usage

  38. InfoPath 2010 and SharePoint 2010

  39. SharePoint List Solutions • List item forms can be changed to InfoPath forms • Access point from list or from SharePoint designer

  40. Creating an InfoPath List Form

  41. Example usage of InfoPath form in web part

  42. InfoPath forms in lists and in sites demo

  43. Summary • Improved Support for Events • List Relationships and Joins • Large List Support • Field & List Item validation and improvements • XSL Based Views • InfoPath for list forms and web part usage

  44. © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

More Related