Friday, November 23, 2012

Exploring the object model
-Visual Studio 2010 Server Explorer
--Sanitized view of a site's contents
--Good high level view from Site collection down
-SharePoint Manager 2010
--Can be downloaded from https://spm.codeplex.com
--More complete view from farm dowwn
--Allow changing certain properties
-Visual Studio 2010 Object explorer
-Red Gate .net Reflector Core Foundation Assembly
-Located in 14\ISAPI
-Microsoft.Sharepoint Core classes
-Microdogy.sharepoint.Client
 - Core classes for client application
-Microsoft.Sharepoint.Linq
- Linq to SharePoint
-Microsoft.Sharepoint.WorkflowActions
- Sharepoint specific workflow actions

Core Classes
SPSite
-SPWeb
--SPField
--SPContenttype
--SPFile
--SPList
---SPListItem
--SPUser 

SPContext Access to current request context via SPContext.Current
-Site
-Web
-List
-Listitem
-More SPContext is governed by the security context of Web.CurrentUser Security exception if code tries to access what use can't

 Common Conventions
Item name is title property
-SPWeb.Title
-SPList.Title
-SPContenttype.Title

 Collection Indexer Overload
-Ordinal overload
-GUID
-Title (If applicable)

Property changes persist by calling Update() 

Security, Identity and Impersonation
-Default runtime identity --Authenticated user
-Execution context --Current site collection
--SPContext.Current.Site
-Elevate Permission
--via impersonation
--New site collection object instance SPSecurity.RunWithElevatedPriviledge
-Delegate -Does not require user id or password
-Permission constrained by service account permission
-Require a new instance of SPSite for security context

 AllowUnsafeUpdate
-Property of
--SPSite
--SPWeb
-set to true to disable security validation on Update()
-Required if persisting anything within RunWithElevatedPriviledge
-Any exception, handled or otherwise, sets AllowUnsafeUpdates to false.

No comments: