Showing posts with label Sharepoint object model. Show all posts
Showing posts with label Sharepoint object model. Show all posts

Wednesday, July 21, 2010

Sharepoint Object model

Sharepoint Object model

To programmatically deal with your Sharepoint services or officer server you need to
add the references Microsoft.Office.Server or Microsoft.Sharepoint to your
project.
You can find this references under
C:\Program Files\Common Files\microsoft shared\Web Server Extensions\12\ISAPI

These are my oftenly used classes.Here I categorised these classes

Document Library
SPDocumentLibrary
SPPictureLibrary

Features [ EventHandling in sharepoint you can find these in Feature.XML as attributes]
SPFeature
SPFeatureScope
SPFeatureProperty
SPElementDefinition

Site Level
SPSite
SPSiteCollection
SPWeb
SPSiteAdministration

List Level
SPList
SPListCollection
SPListItem


Solution Level

SPSolution
SPSolutionCollection
SPFeatureReceiver

Meeting

SPMeeting
MtgUtility

User Profile related [ Imports the namespace Microsoft.Office.Server.UserProfiles ]
UserProfiles
UserProfilesManager [ In moss 2007 installed farm,Its obsolete]

Tuesday, March 30, 2010

Sharepoint Website Collection.



Listing all the websites from the share point site and its owner.

SPSite site = new SPSite("http://localhost");
SPWeb web=site.AllWebs;
foreach(SPWeb web in collection)
{
DropDownList1.Items.Add(web.Author.ToString());
}


Listing all lists in the website
SPSite site = new SPSite("http://localhost/SiteDirectory/IT"); //IT-site name
SPWeb web = site.OpenWeb();
SPList list = web.Lists["Posts"]; // a List in the site
foreach(SPListItem col in list.Items)
{
DropDownList2.Items.Add(col.Title.ToString()); // Item in the List
}