This presentation is for explaining the basics of SharePoint Object Model/Web Services. These sessions are done online. Check more details @ http://manish-sharepoint.blogspot.com/2009/02/online-training-on-sharepoint.html
1. Online Training on SharePoint 2007 Check Training Details @Training Details Moss Experts http://manish-sharepoint.blogspot.com/
2. SharePoint Object Model, Web Services, Features and Solutions Moss Experts http://manish-sharepoint.blogspot.com/
3. Features of SharePoint Object Model SharePoint will use ASP.NET instead of ISAPI for base page execution Server Object Model for programmatic access to SharePoint data Exposing Data via XML web services for access from remote machines Managed code object model on the server Accessible via ASP.NET or any other server process Exposes almost of all of the data stored in WSS Implemented in C# Add Microsoft.SharePointdll from Program Filesommon Filesicrosoft Sharedeb Server Extensions2SAPI http://manish-sharepoint.blogspot.com/
4. SharePoint Object Model It gives us full access to SharePoint Only available on the server http://manish-sharepoint.blogspot.com/
5. Examples of what can be done with the Object Model: Add, edit, delete, and retrieve data from SharePoint Lists Create new lists and set list metadata (e.g. the fields in a list) Set web properties Work with documents in document libraries. Perform administrative tasks such as creating webs, adding users, creating roles, etc. Pretty much any functionality in the UI can be automated through the OM! http://manish-sharepoint.blogspot.com/
8. The SPFarm object is the highest object within the Windows SharePoint Services object model hierarchy. The Servers property gets a collection representing all the servers in the deployment, and the Services property gets a collection representing all the services. Each SPServer object represents a physical server computer. The ServiceInstances property provides access to the set of individual service instances that run on the individual computer. An SPWebService object provides access to configuration settings for a specific logical service or application. The WebApplications property gets the collection of Web applications that run the service. An SPDatabaseServiceInstance object represents a single instance of a database service running on the server computer. Each SPWebApplication object represents a load-balanced Web application based in Internet Information Services (IIS). The SPWebApplication object provides access to credentials and other server farm wide application settings. The Sites property gets the collection of site collections within the Web application, and the ContentDatabases property collection of content databases used in the Web application. An SPContentDatabase object inherits from the SPDatabase class and represents a database that contains user data for a SharePoint Web application. An SPSiteCollection object represents the collection of site collections within the Web application. http://manish-sharepoint.blogspot.com/
10. Each SPSite object, represents a set of logically related SPWeb objects. Such a set is commonly called a "site collection Each site collection includes any number of SPWeb objects, and each object has members that can be used to manage a site, including its template and theme, as well as to access files and folders on the site. Each SPList object has members that are used to manage the list or access items in the list. The GetItems method can be used to perform queries that return specific items. The Fields property returns an SPFieldCollection object that represents all the fields, or columns, in the list, and the Items property returns an SPListItemCollection object that represents all the items, or rows, in the list. Each SPField object has members that contain settings for the field. Each SPListItem object represents a single row in the list. http://manish-sharepoint.blogspot.com/
11. Example Objects Security SPGroup SPGroupCollection SPSite SPUser SPUserCollection Documents SPDocumentLibrary SPFile SPFileCollection SPFolder List Data SPField SPFieldCollection SPListCollection SPList SPListItemCollection SPListItem SPView Administration SPGlobalAdmin SPQuota SPVirtualServer http://manish-sharepoint.blogspot.com/
12. Accessing Data in a MOSS List Get a SPList or SPDocumentLibrary object. SPListmylist = web.Lists[“Events”]; You can then call the .Items property to get all of the items: SPListItemCollection items = mylist.Items; If you only want a subset of the items, call the GetItems method and pass a SPQuery object SPListItemCollection items = mylist.GetItems(query); http://manish-sharepoint.blogspot.com/
13. Full Example SPWeb web = SPControl.GetContextWeb(Context); SPList tasks = web.Lists["Tasks"]; SPListItemCollection items=tasks.Items; foreach(SPListItem item in items) { output.Write(item["Title"].ToString() + item["Status"].ToString() + "<br>"); } http://manish-sharepoint.blogspot.com/
14. Code Example -- Enumerate sites and lists SPSitemySite = SPContext.Current.Site; SPWebCollectionsubSites = mySite.AllWebs; for (inti=0;i<subSites.Count;i++) { SPListCollection lists = subSites[i].Lists; for (int j=0;j<lists.Count;j++) { Response.Write(SPEncode.HtmlEncode(subSites[i].Title) + " :: " + SPEncode.HtmlEncode(lists[j].Title) + "<BR>"); } } http://manish-sharepoint.blogspot.com/
15. SharePoint Web Services SharePoint have web services APIs for accessing content. The web services layer is built on top of the server OM. Web Services are available remotely Allows manipulation of Lists, Webs, Views, List Items, etc. Functionality will be similar to server object model. Not all OM functionality available http://manish-sharepoint.blogspot.com/
16. Getting Started With Web Services Create a Windows Application In Visual Studio, choose ‘Add Web Reference’ Enter http://<server>/_vti_bin/lists.asmxto access the lists web service Other services include: UserGroups.asmx – users and groups Webs.asmx – Web information Views.asmx – View information Subscription.asmx – Subscriptions http://manish-sharepoint.blogspot.com/
17.
18. Features make it easier to activate or deactivate functionality.