Friday, July 10, 2009
Fetch SharePoint Data Programmatically
FullTextSqlQuery - search
SPListItems and for each loop - object model
List Web Service - Search from remote client
SPQuery Object - Search the list
SPSiteDataQuery - Search across the site
PortalSiteMapProvider
Thursday, August 21, 2008
Monday, August 18, 2008
Feature Scope
Control
Custom Action
Custom Action Group
Hide Custom Action
List Instance
List Template
Module (File Set)
Receiver
Site (site collection)
Content Type
Content Type Binding
Control
Custom Action
Custom Action Group
Feature/Site Template Association
Field
Hide Custom Action
List Template
Module (File Set)
Workflow
WebApplication (Web application)
Control
Custom Action
Custom Action Group
Document Converter
Feature/Site Template Association
Hide Custom Action
Farm (farm)
Control
Custom Action
Custom Action Group
Feature/Site Template Association
Hide Custom Action
For more information http://msdn.microsoft.com/en-us/library/ms474383.aspx
SPSite.RootWeb.AllUsers | SiteUsers | Users - Difference
SPSite.RootWeb.AllUsers
SPSite.RootWeb.SiteUsers
SPSite.RootWeb.Users
"AllUsers" - Gets the collection of users from either member of the site or or who have browsed to the site as authenticated members of a domain group in the site.
"SiteUsers - Gets the collection of all users that belong to the site collection.
"Users" - Gets the collection of user objects that are explicitly assigned permissions on the Web site.
SPPrincipal - SPUser - SPWeb.EnsureUser() - SPUtility.ResolvePrincipal()
SPPrincipalInfo object is used to hold user details like, first name, last name, email id, login id with domain name.
SPPrincipalInfo userInfo = SPUtility.ResolvePrincipal(objWeb, "loginID", SPPrincipalType.All, SPPrincipalSource.All, null, false);
------------------------------------------------------------------------------------------------
SPWeb.EnsuerUser() will add ther user to site, if the user does not exist and return SPUser object. We can use SPUser object to update "SPUser" field type
Example:
SPUser objUser = objWeb.EnsureUser("domain\\loginname");
item["user"] = objUser;
-----------------------------------------------------------------------------------------------
Tuesday, August 12, 2008
SPUtility - Usefull methods
SPUtility.SendEmail() send email from WSS site.
SPUtility.GetGenericSetupPath() used to access files 12 hive folder.
SPUtility.Redirect() used to redirect to another page.
SPUtility.TrasfertoErrorPage() helps to redirect to error page
SPUtility.TransfertoSuccessPage() helps to redirect to success page.
Monday, August 4, 2008
Update Last Modified Date MetaData Property
// oSPListItem["Created"] = new DateTime(2007, 1, 1); // if you need to change created date
oSPListItem["Modified"] = System.DateTime.Now;
oSPListItem.UpdateOverwriteVersion();
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.splistitem.systemupdate.aspx
Tuesday, July 22, 2008
SPPersistedObject - Custom SharePoint Storage
Friday, July 4, 2008
An external storage API is available for WSS 3.0
Follow this link to know more http://support.microsoft.com/kb/938499/
Tuesday, June 17, 2008
Master Page behaviour in MOSS and WSS
Having single master page for all the sites?
If using MOSS, you can inherit from the top level master page. If you are using WSS, the out of the box functionality is that all sites utilize their own master page. You can, however, create a site template that uses the master page you wish and create all subsequent WSS sites from your template(s).
Master Page Inheritance
Master page files can be applied on a site level, but not on a page level. So a sub site can have a different master page specified than the parent, or it can inherit the master page file settings from the parent.
Wednesday, June 4, 2008
SharePoint ProcessBatchData Method for Batch Processing
StringBuilder sb = new StringBuilder();
sb .Append("
foreach (SPListItem item in CurrentList.Items)
{
sb.Append("
sb.Append("
sb.Append("
sb.Append("
sb.Append("
}
sb.Append("
try
{
SPContext.Current.Site.RootWeb.ProcessBatchData(sb.ToString());
}
catch (Exception ex)
{ throw ex; // Unable to delete}
Tuesday, June 3, 2008
Visual Studio : Get Assembly Public Key Shortcut
2. In the External Tools dialog, click Add and enter Get Assembly Public Key for the
Title.
3. Fill the Command textbox by browsing to sn.exe. It is typically installed at the following
location: C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\sn.exe.
4. In the Arguments textbox, type the following (case sensitive) -Tp "$(TargetPath)".
5. Enable the Use Output window checkbox.
Click OK. The new command is added to the Tools menu.