- AllDocs: holds information about all the documents (and all list items) for each document library and list
- AllLists: holds information about lists for each site
- AlllistData: holds information about all the list items for each list
- AllUserData: holds all the metadata which user provides in a document library
- GroupMembership: holds information about all the SharePoint group members
- Groups: holds information about all the SharePoint groups within each site collection
- ImmedSubscriptions: holds information about all the immediate subscriptions (alerts) for each user
- RoleAssignment: holds information about all the users or SharePoint groups that are assigned to roles
- Roles: holds information about all the SharePoint roles or permission levels for each site
- SchedSubscriptions: holds information about all the scheduled subscriptions (alerts) for each user
- Sites: holds information about all the site collections relevant to this content database
- UserInfo: holds information about all the users within each site collection
- Webs: holds information about all the specific sites (webs) in each site collection
Thursday, November 20, 2008
Tables within MOSS 2007
Understanding RunWithElevatedPrivileges
What happens when you use RunWithElevatedPrivileges ?
Without RunWithElevatedPrivileges delegate the Sharepoint identity will be the same as of the current user identity and you are able to do whatever your own permissions allow you to do.
With RunWithElevatedPrivilages delegate the Sharepoint set the identity to Sharepoint\System. The Sharepoint\System identity doesn't have anything to do with a windows identity so you shouldn't be tempted to look for this windows account. The Sharepoint\Sytem is a built-in identity of Sharepoint and it has full permissions in Sharepoint. Also RunWithElevatedPrivilages elevates the windows privilages which means that if you are running the elevated code from a web application the applicaion is basically using the identity of the account running the webApp pool.
Incase of winforms/console application, code runs with your credentials (or if using 'runas', it would use whatever credentials you told it to use). There is no impersonation going on here like with the web application, so a call a to RunWithElevatedPrivileges will effectively do nothing because there is no impersonation to temporarily halt. You can see this is the case if you were to execute this code snippet in a console application:
SPSecurity.RunWithElevatedPrivileges(delegate()
{
using (SPSite site = new SPSite(siteUrl))
{
using (SPWeb web = site.OpenWeb(webUrl))
{
System.Console.WriteLine(web.CurrentUser.LoginName);
System.Console.WriteLine(System.Security.Principal.WindowsIdentity.GetCurrent().Name);
System.Console.ReadKey();
}
}
});
Note here that web.CurrentUser.LoginName is coming from the WSS identity. If you 'runas' the web application's app pool identity, it would get correlated to SharePoint\System and thats what you would see on the first line of output.
Without RunWithElevatedPrivileges delegate the Sharepoint identity will be the same as of the current user identity and you are able to do whatever your own permissions allow you to do.
With RunWithElevatedPrivilages delegate the Sharepoint set the identity to Sharepoint\System. The Sharepoint\System identity doesn't have anything to do with a windows identity so you shouldn't be tempted to look for this windows account. The Sharepoint\Sytem is a built-in identity of Sharepoint and it has full permissions in Sharepoint. Also RunWithElevatedPrivilages elevates the windows privilages which means that if you are running the elevated code from a web application the applicaion is basically using the identity of the account running the webApp pool.
Incase of winforms/console application, code runs with your credentials (or if using 'runas', it would use whatever credentials you told it to use). There is no impersonation going on here like with the web application, so a call a to RunWithElevatedPrivileges will effectively do nothing because there is no impersonation to temporarily halt. You can see this is the case if you were to execute this code snippet in a console application:
SPSecurity.RunWithElevatedPrivileges(delegate()
{
using (SPSite site = new SPSite(siteUrl))
{
using (SPWeb web = site.OpenWeb(webUrl))
{
System.Console.WriteLine(web.CurrentUser.LoginName);
System.Console.WriteLine(System.Security.Principal.WindowsIdentity.GetCurrent().Name);
System.Console.ReadKey();
}
}
});
Note here that web.CurrentUser.LoginName is coming from the WSS identity. If you 'runas' the web application's app pool identity, it would get correlated to SharePoint\System and thats what you would see on the first line of output.
Wednesday, November 19, 2008
Hide Quick Launch using CSS
Add content editor webpart and insert this css in it.
<style>
.ms-navframe
{
display:none;
}
</style>
<style>
.ms-navframe
{
display:none;
}
</style>
Monday, November 17, 2008
The security validation for this page is invalid. Click Back in your Web browser, refresh the page, and try your operation again.
The security validation for this page is invalid. Click Back in your Web browser, refresh the page, and try your operation again.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Runtime.InteropServices.COMException: The security validation for this page is invalid. Click Back in your Web browser, refresh the page, and try your operation again.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[COMException (0x8102006d): The security validation for this page is invalid. Click Back in your Web browser, refresh the page, and try your operation again.]
Microsoft.SharePoint.Library.SPRequestInternalClass.UpdateRoleAssignment(String bstrUrl, Guid& pguidScopeId, Int32 lPrincipalID, Object& pvarArrIdRolesToAdd, Object& pvarArrIdRolesToRemove) +0
Microsoft.SharePoint.Library.SPRequest.UpdateRoleAssignment(String bstrUrl, Guid& pguidScopeId, Int32 lPrincipalID, Object& pvarArrIdRolesToAdd, Object& pvarArrIdRolesToRemove) +119
[SPException: The security validation for this page is invalid. Click Back in your Web browser, refresh the page, and try your operation again.]
OfficialMail.WebParts.TestWebPart.btn_Click(Object sender, EventArgs e) +94
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102
Solutions :
Central Administration > Application Management > Web Application General Settings ->Select web application
In Web Page Security Validation , change security validation is off.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Runtime.InteropServices.COMException: The security validation for this page is invalid. Click Back in your Web browser, refresh the page, and try your operation again.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[COMException (0x8102006d): The security validation for this page is invalid. Click Back in your Web browser, refresh the page, and try your operation again.]
Microsoft.SharePoint.Library.SPRequestInternalClass.UpdateRoleAssignment(String bstrUrl, Guid& pguidScopeId, Int32 lPrincipalID, Object& pvarArrIdRolesToAdd, Object& pvarArrIdRolesToRemove) +0
Microsoft.SharePoint.Library.SPRequest.UpdateRoleAssignment(String bstrUrl, Guid& pguidScopeId, Int32 lPrincipalID, Object& pvarArrIdRolesToAdd, Object& pvarArrIdRolesToRemove) +119
[SPException: The security validation for this page is invalid. Click Back in your Web browser, refresh the page, and try your operation again.]
OfficialMail.WebParts.TestWebPart.btn_Click(Object sender, EventArgs e) +94
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102
Solutions :
Central Administration > Application Management > Web Application General Settings ->Select web application
In Web Page Security Validation , change security validation is off.
Thursday, November 6, 2008
some useful links....
Go through this link that have more useful sharepoint tutorials link that useful for sharepoint developer.
http://sharepoint-exchange.blogspot.com/2008_02_01_archive.html
http://sharepoint-exchange.blogspot.com/2008_02_01_archive.html
MOSS 2007 User and Profiles import from Active Directory
Its very normal to have a scenario in which the user profile information in stored in directory service like Active Directory. Since personalization in sharepoint largely depends upon user profiles it becomes imperative to not only import the user information in AD into sharepoint as user profiles but also to run incremental imports to sync up user profiles with new information added into the Active directory.
As you know sharepoint integrates with Active directory and a user profile record gets created in sharepoint when an AD authenticated user first accesses a site. Assumption here is that the user already has adequate permissions on the site. As noted above incremental imports facilitate synchronizing user information stored in AD with the profile created in sharepoint.
The following steps need to be followed to configure import of user profiles from Active Directory -
Scenario-1 - All users are in the current domain.
1. Go to User Profile and Properties under Shared Services Administration.
2. Click on configure profile import link. Select current domain as the profile datasource.
3. Make sure default access account is specified and is valid.
4. Run full import or incremental report.
Scenario-2 - Users are scattered into multiple domains or other data sources.
1. Go to User Profile and Properties under shared services administration.
2. Click on Import New Connection. Add a new connection for each of the data sources where you users are located. Delete any unwanted connections that might already be there.
3. Configure the import as mentioned above and make sure that Custom source is selected.
4. Run the full import or incremental import.
Saturday, October 25, 2008
Copy Document Library file into local server using event handler
public override void ItemAdded(SPItemEventProperties properties)
{
try
{
//Copy Document Library file into local server using event handler
base.ItemAdded(properties);
DisableEventFiring();
SPWeb web = properties.OpenWeb();
web.AllowUnsafeUpdates = true;
SPList ilist = web.Lists[properties.ListId];
SPFolder folder = web.GetFolder(properties.ListTitle.ToString());
foreach (SPFile x in folder.Files)
{
if (properties.ListItemId == x.Item.ID)
{
string strpath = @"D:/Trushar/" + folder.Name.ToString() + "/" + x.Name.ToString();
//FileStream fs = new FileStream(@"D:/Trushar/MyDoc/Test1.jpg", FileMode.Create);
FileStream fs = new FileStream(strpath, FileMode.Create);
BinaryWriter binaryWriter = new BinaryWriter(fs);
byte[] fileData = (byte[])x.OpenBinary();
binaryWriter.Write(fileData);
binaryWriter.Close();
break;
}
}
EnableEventFiring();
}
catch (Exception ex )
{
}
}
{
try
{
//Copy Document Library file into local server using event handler
base.ItemAdded(properties);
DisableEventFiring();
SPWeb web = properties.OpenWeb();
web.AllowUnsafeUpdates = true;
SPList ilist = web.Lists[properties.ListId];
SPFolder folder = web.GetFolder(properties.ListTitle.ToString());
foreach (SPFile x in folder.Files)
{
if (properties.ListItemId == x.Item.ID)
{
string strpath = @"D:/Trushar/" + folder.Name.ToString() + "/" + x.Name.ToString();
//FileStream fs = new FileStream(@"D:/Trushar/MyDoc/Test1.jpg", FileMode.Create);
FileStream fs = new FileStream(strpath, FileMode.Create);
BinaryWriter binaryWriter = new BinaryWriter(fs);
byte[] fileData = (byte[])x.OpenBinary();
binaryWriter.Write(fileData);
binaryWriter.Close();
break;
}
}
EnableEventFiring();
}
catch (Exception ex )
{
}
}
Subscribe to:
Posts (Atom)

