460 likes | 805 Views
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.
E N D
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
What’s new in events? Improved Support for Events
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
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
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
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
What’s new in lists and how can I utilize these new functionalities? List Relationships and Joins
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
List lookups • Lookups form relationships between lists • One-to-many • Many-to-many Lookup Lookup 1 1 m m Clients Projects Timecards
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
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
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
What’s new for large lists and how to access them efficiently? Large List Support
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
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
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
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
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:
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:
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.
How to define field or list item validations? Field & List Item validation and improvements
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
List Item Validation • Items are validated against a custom formula when saved
List Item Field Validation • Similar to list item validation, each column can be validated using a custom field, or by referencing other fields
Defining validations from code • You can define the validation rules for list item or item field also from code – like from feature receiver
How the rendering logic of lists have been improved? XSL Based Views
XsltListViewWebPart • Replaces ListViewWebPart • Rich customization support through SPD • Schema agnostic • Better UX • In-Place Editing
Inside the XsltListViewWebPart CAML Query XmlDefinition SPDataSource XML Data XsltListViewWebPart HTML List Schema ListName XslCompiledTransform View Transform XSL
XsltListViewWebPart demo
Flexible form design for lists and forms in web parts InfoPath for list forms and web part usage
SharePoint List Solutions • List item forms can be changed to InfoPath forms • Access point from list or from SharePoint designer
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
© 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.