Presentation is loading. Please wait.

Presentation is loading. Please wait.

Microsoft Dynamics.

Similar presentations


Presentation on theme: "Microsoft Dynamics."— Presentation transcript:

1 Microsoft Dynamics

2 Microsoft Dynamics Essentials 1: Object Models, Web Services, Document I/O, Event, and Lists Mick Badran Breeze Training Consulting Trainer + Sharepoint Specialist Ryan Duguid Microsoft NZ Sharepoint Technical Specialist

3 Agenda WSS Object Model Fundamentals Security-Related Changes
Working Remotely with Lists Cross-Site Data Queries Event Handlers New Classes in the WSS Object Model

4 Object Models WSS 3.0 MOSS 2007 Microsoft.SharePoint.dll
Microsoft.Office.Server.dll Microsoft.Office.Server.Publishing.dll Microsoft.Office.Server.Policy.dll Microsoft.Office.Server.Search.dll Microsoft.SharePoint.Portal.dll Microsoft.Office.Workflow.Tasks.dll Microsoft.SharePoint.Publishing.dll Microsoft.SharePoint.Workflow.Actions.dll There is also the .NET Reflector on

5 Where can I use the WSS OM?
WSS Sites Web Parts ASP.NET Custom Controls and User Controls Application pages Feature activation event handlers Event handlers for lists, doc libs, sites & site collections ASP.NET applications and Web services Windows Forms and Console applications WSS Object Model Web Services Web Parts Web Pages Smart Clients Smart and Mobile Clients Code that programs against WSS object model must be run on the front end Web server

6 SPWebServer SPVirtualServer SPSite High Backward Compatibility
With WSS v2 Talking Points: The SDK is your best resource for learning about the different classes . What you will find on the slide are the top-level classes that match one of the levels in the server and site architecture. Point out the difference between SPSite and SPWeb. SPWeb SPList SPListItem

7 SPSite Object Represents site collection
User must be authenticated and authorised unless anonymous access is enabled Site Collection has an owner Site Collection contains hierarchy of child site(s)

8 SPWeb Objects Sites accessible through SPWeb objects
Often must use SPSite object to access SPWeb objects

9 Calling Dispose Many WSS OM objects follow IDisposable pattern
They use unmanaged resources that must be released Failure to call Dispose can cause serious memory leakage

10 SPList and SPListItem Just about everything in Sharepoint is a type of list. Lists are modeled using SPList objects Items modeled using SPListItem objects Document libraries can be accessed using SPList

11 SPFile and SPFolder Site represents hierarchy of files and folders
Files represented through SPFile objects Folders represented through SPFolder objects What can be done? Discover all files and folders within a site Add, move, copy, delete files and folders Return a page to its initial ghosted state Program against Web Part data on a Web Part Page

12 SPDocumentLibrary Document Library is more than a SPList object
Can convert SPList to SPDocumentLibrary Make extra functionality accessible

13 Exploring SharePoint using the Object Model
Office System Developer Conference 2006 Exploring SharePoint using the Object Model © 2006 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

14 Security-Related Changes
Impersonating SPSite constructor Methods exposed in the OM to check permissions before doing the calls Elevating permission level Item-level security

15 Elevating Permissions
Some aspects of WSS OM require privileged users Code fails when run by users without proper permission The behavior has been created by design (not a mistake!) Overriding this behavior sometime necessary SPSecurity.RunWithElevatedPrivileges solves this problem

16 Better support for security and OM programming
Office System Developer Conference 2006 Better support for security and OM programming © 2006 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

17 Querying Data with CAML
CAML = Collaborative Application Markup Language Used in SharePoint for Definition of the Sites, Lists and Views Querying of SharePoint content Executing CAML Queries SPQuery SPSiteDataQuery lists.asmx search.asmx

18 Executing CAML Queries
Office System Developer Conference 2006 Executing CAML Queries © 2006 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

19 Working Remotely with Lists
Remotely view and edit SharePoint List data Operations available: AddAttachment UpdateList DeleteList UpdateListItems GetAttachmentCollection AddList GetListItemChanges GetListAndView GetList GetListCollection GetListItems DeleteAttachment

20 An off-line client for a lists in SharePoint
Office System Developer Conference 2006 An off-line client for a lists in SharePoint © 2006 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

21 WSS v2 vs. WSS v3 Event Handlers
What is an event handlers? An event handler is a .NET assembly containing one or more classes handling events that are triggered by SharePoint WSS v2 only possible for document libraries executed in an asynchronous manner WSS v3 events architecture significantly improved Scope has been extended: lists, document libraries, content types, site, site collection Events supported for incoming messages Support for synchronous events and asynchronous events Synchronous events occur before the fact and are cancel-able Events are used in other scenarios Custom policies Features

22 Scope of Events Scope Description Base Class Item in a list or library
Actions users can do in a list include adding, modifying, deleting, check-in and check-out, ... SPItemEventReceiver List or library Trap changes to entities of list schema events, supporting list schema operations and the addition or removal of content types. SPListEventReceiver Web Events fired at the level of the site (e.g. adding and removing sites, creating and deleting lists) SPWebEventReceiver Provides a method for trapping the event when a list receives an message ( Received) SP EventReceiver Feature Trap the activation, deactivation, installation, or uninstallation of a Feature SPFeatureReceiver

23 Creating an Event Handler
.NET class library Reference to Microsoft.SharePoint.dll Custom class inheriting a WSS receiver class Override base methods using Microsoft.SharePoint; namespace Demos { public class MyEventHandler: SPItemEventReceiver { public override void ItemDeleting(SPItemEventProperties properties) { // do something and possibly cancel the event properties.Cancel = true; properties.ErrorMessage = “my message"; } public override void ItemDeleted(SPItemEventProperties properties) { // do something

24 Deploying a WSS v3 Event Handler
Compile class into strong-named assembly Deploy the DLL in GAC Register DLL as event handler in WSS v3 The WSS v2 way (only for document libraries) Programmatically via the object model Using the new WSS feature framework

25 Office System Developer Conference 2006
WSS Event Handlers © 2006 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

26 New Classes in WSS OM Navigation Content Types Recycle Bin Versioning
Workflow

27 Navigation WSS Navigation is extensible Add nodes through WSS UI
Adds nodes through code

28 Content Types SPContentTypeCollection SPContentType SPContentTypeId
SPFieldLinkCollection SPFieldLink SPXmlDocumentCollection

29 SPAudit and SPAuditEntry
WSS provides rich auditing support But doesn't make auditing usable OOB - you need MOSS Custom development required to make WSS auditing functional enable auditing using code now examine what's in WSS audit log

30 Working with Content Types
Office System Developer Conference 2006 Working with Content Types © 2006 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

31 Review WSS Object Model Fundamentals Security-Related Changes
Working Remotely with Lists Cross-Site Data Queries Event Handlers New Classes in the WSS Object Model


Download ppt "Microsoft Dynamics."

Similar presentations


Ads by Google