Key classes in the SharePoint object model
Document Libraries (Microsoft.Sharepoint)
SPDocumentLibrary
SPPictureLibrary
Features (Microsoft.Sharepoint)
SPFeatureDefinition
SPElementDefinition
SPFeatureProperty
SPFeatureScope
SPFeature
Sites (Microsoft.SharePoint)
SPSite
SPSiteCollection
SPSiteAdministration
SPWeb
Business Data Catalog (Microsoft.Office.Server.ApplicationRegistry.Administration)
EntityCollection
ApplicationRegistry
Meetings (Microsoft.SharePoint.Meetings)
SPMeeting
MtgUtility
Solutions (Microsoft.SharePoint.Administration)
SPSolution
SPFeatureReceiver
SPSolutionCollection
Lists (Microsoft.SharePoint)
SPList
SPListItem
SPListItemCollection
User Profiles (Microsoft.Office.Server.UserProfiles)
UserProfile
UserProfileManager
=============================================================
CabLib Compress ERROR: Could not flush cabinet: Could not create cabinet file Title is required
If you get this error during building WSP it is because your files have “read only" properties. Check Out files (in Visual Studio or another editor) or Right Click folder -> Properties and Uncheck "Read only".
Build WSP again.
Build WSP again.
The search request was unable to connect to the Search Service.
In order to resolve this error "The search request was unable to connect to the Search Service.":
1. Go to the server:
Run > Type “Services.msc” - >
- Start a SharePoint search service;
- Start Indexing service;
- IISReset
1. Go to the server:
Run > Type “Services.msc” - >
- Start a SharePoint search service;
- Start Indexing service;
- IISReset
Sharepoint Service Error: A deployment or retraction is already under way for the solution *.wsp
Sharepoint Service Error: A deployment or retraction is already under way for the solution *.wsp
To resolve this problem do the next steps:
Click "Start", click "Run" type cmd
The operation below shows you all runnig deploying process:
C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN>stsadm -o enumdeployments
Base on GUI of process you can cancel it. Use next operation for that:
C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN>stsadm -o canceldeployment -id "GUID job ID"
To resolve this problem do the next steps:
Click "Start", click "Run" type cmd
The operation below shows you all runnig deploying process:
C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN>stsadm -o enumdeployments
Base on GUI of process you can cancel it. Use next operation for that:
C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN>stsadm -o canceldeployment -id "GUID job ID"
Security Permission Inheritance
SPSite site = SPContext.Current.Site;
SPWeb web = SPContext.Current.Web;
// Test to see if the site has unique permissionsif (web.HasUniqueRoleAssignments)
{
Response.Write(web.Title + " does not inherit permissions
" );
}
else
{
Response.Write(web.Title + " inherits permissions
" );
}
SPWeb web = SPContext.Current.Web;
// Test to see if the site has unique permissionsif (web.HasUniqueRoleAssignments)
{
Response.Write(web.Title + " does not inherit permissions
" );
}
else
{
Response.Write(web.Title + " inherits permissions
" );
}
Uncustomized and Customized Pages
Ghosted - Uncustomized
Unghosted - Customized
In WSS v3 pages exist in one of two states: customized or uncustomized. An uncustomized page is one that is listed in the site's contents database, but the actual source of the page (the file) resides on the file system, and the content database simply contains a link pointing to the file. A customized page is also listed in the content database, but the source of the page is also stored in the database. Future requests for that page (in the context of a specific site) will be served from the database, not from the file system.
Unghosted - Customized
In WSS v3 pages exist in one of two states: customized or uncustomized. An uncustomized page is one that is listed in the site's contents database, but the actual source of the page (the file) resides on the file system, and the content database simply contains a link pointing to the file. A customized page is also listed in the content database, but the source of the page is also stored in the database. Future requests for that page (in the context of a specific site) will be served from the database, not from the file system.
SharePoint Development using C#
Before you start developing you need a reference to "using Microsoft.SharePoint;" namespace.
Working with a list
Short description of some classes:
Site Organization Classes
SPContext -
SPWebCollection -
SPListCollection -
SPWeb - represents site;
SPSite - represents site collection;
SPList -
List Classes
SPField -
SPView -
SPListItem -
Getting the Current WebsiteSPWeb web = SPContext.Current.Web;
Site Collection Navigation
SPSite siteCollection = SPContext.Current.Site;
SPWeb rootWeb = siteCollection.RootWeb;
TreeNode rootNode = new TreeNode(rootWeb.Title);
treeSiteCollection.Nodes.Add(rootNode);
addSubWebsToTree(rootWeb, rootNode);
Create a listSPWeb web = SPContext.Current.Web;
web.AllowUnsafeUpdates = true;
SPList list;
try
{
list = web.Lists["Student Assignments"];
}
catch(Exception ex)
{
System.Guid listID
= web.Lists.Add("Student Assignments", "", SPListTemplateType.Tasks);
list = web.Lists[listID];
}
Creating a column in a list
SPFieldCollection fields = list.Fields;
SPField gradeField;
if (fields.ContainsField("Grade"))
{
gradeField = fields["Grade"];
}
else
{
fields.Add("Grade", SPFieldType.Number, false);
}
Adding Field to default view of the listSPView defaultView = list.DefaultView;
if (!defaultView.ViewFields.Exists("Grade"))
{
defaultView.ViewFields.Add("Grade");
defaultView.Update();
}
Creating a new list item
SPListItemCollection items = list.Items;
SPListItem newItem = items.Add();
newItem["Title"] = "Homework 1";
newItem["DueDate"] = System.DateTime.Now;
newItem["Grade"] = 5; newItem.Update();
Working with a list
Short description of some classes:
Site Organization Classes
SPContext -
SPWebCollection -
SPListCollection -
SPWeb - represents site;
SPSite - represents site collection;
SPList -
List Classes
SPField -
SPView -
SPListItem -
Getting the Current WebsiteSPWeb web = SPContext.Current.Web;
Site Collection Navigation
SPSite siteCollection = SPContext.Current.Site;
SPWeb rootWeb = siteCollection.RootWeb;
TreeNode rootNode = new TreeNode(rootWeb.Title);
treeSiteCollection.Nodes.Add(rootNode);
addSubWebsToTree(rootWeb, rootNode);
Create a listSPWeb web = SPContext.Current.Web;
web.AllowUnsafeUpdates = true;
SPList list;
try
{
list = web.Lists["Student Assignments"];
}
catch(Exception ex)
{
System.Guid listID
= web.Lists.Add("Student Assignments", "", SPListTemplateType.Tasks);
list = web.Lists[listID];
}
Creating a column in a list
SPFieldCollection fields = list.Fields;
SPField gradeField;
if (fields.ContainsField("Grade"))
{
gradeField = fields["Grade"];
}
else
{
fields.Add("Grade", SPFieldType.Number, false);
}
Adding Field to default view of the listSPView defaultView = list.DefaultView;
if (!defaultView.ViewFields.Exists("Grade"))
{
defaultView.ViewFields.Add("Grade");
defaultView.Update();
}
Creating a new list item
SPListItemCollection items = list.Items;
SPListItem newItem = items.Add();
newItem["Title"] = "Homework 1";
newItem["DueDate"] = System.DateTime.Now;
newItem["Grade"] = 5; newItem.Update();
Single Sign On Administration
Single Sign On –allow users to authenticate once into SharePoint and then access other applications such as Siebel or SAP using mapped credentials from encrypted credentials database. Administrators and developers use supporting application interfaces to manage single sign on credentials
Application Definition – metadata (username, passwords, group) about an application that that will be accessible through single sign on.
Application Definition – metadata (username, passwords, group) about an application that that will be accessible through single sign on.
Solution Deployment
Solution is a cab file with a manifest file that contains:
Solution is very similar to a web part package in SharePoint 2003
- Feature definitions
- Site Definitions
- Resources –Assemblies (DLLs) that implement related functionality
Solution is very similar to a web part package in SharePoint 2003
Site Definitions in 2007: Folder Structure
Program files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\
•GLOBAL – contains “Global Template” site definition
•SiteTemplates
- STS- default.aspx
- XML
- onet.xml – references features
- does not contain base types
- does not contain list templates
- MPS
•FEATURES – contains all SharePoint and custom features
- CustomList
- Navigation
- DocumentLibrary – document library feature
- ListTemplates- DocLib.xml
- DocLib
- Schema.xml – DOES NOT CONTAIN
- Upload.aspx
- No allitems.aspx or editform.aspx
•GLOBAL – contains “Global Template” site definition
•SiteTemplates
- STS- default.aspx
- XML
- onet.xml – references features
- does not contain base types
- does not contain list templates
- MPS
•FEATURES – contains all SharePoint and custom features
- CustomList
- Navigation
- DocumentLibrary – document library feature
- ListTemplates- DocLib.xml
- DocLib
- Schema.xml – DOES NOT CONTAIN
- Upload.aspx
- No allitems.aspx or editform.aspx
No comments:
Post a Comment