How to Change the Home Page / Landing Page in MOSS 2007

To Change the Home Page or Landing Page in SharePoint,

Browse to

Site Actions ->

(Look And Feel) Welcome Page – Specify your Page URL.

Programmatically Read Alerts for Users in Site Collection

SPAlerCollection class can be used to get the Alert Collection for the User.

The below code snippet is used to read all alerts registered for the site collection users.

private
static
void GetAlerts()

{


SPSite currSite = new
SPSite(“http://uday”);


SPWeb currWeb = currSite.OpenWeb();


SPUserCollection collUsers = currWeb.Users;


try

{


foreach (SPUser usr in collUsers)

{


Console.WriteLine(“Alerts for the User : “ + usr.Name);


foreach (SPAlert alrt in usr.Alerts)

{


Console.WriteLine(alrt.Item.Title + ” –> “ + alrt.AlertFrequency);

}

}

}


catch

{

}


Console.ReadLine();

}

}



How to set the Interval for Alerts in SharePoint 2007

To set the timer job interval for alerts can set by using the setproperty for the property job-immediate-alerts command in stsadm.

Syntax:
STSADM -o getproperty -pn job-immediate-alerts –pv <property value> -url <URL of the Site>

Example:
STSADM -o getproperty -pn job-immediate-alerts –pv “every 2 minutes” -url http://uday


How to Edit InfoPath XML File in Forum Library Programmatically in SharePoint 2007

The below lines of code snippet is to update the infopath xml record(file)

SPWeb _web = SPContext.Current.Web;
SPList _list = _web.Lists[“SampleFormLib”];

MemoryStream myInStream = new MemoryStream(item.File.OpenBinary());
XmlTextReader reader = new XmlTextReader(myInStream);

XmlDocument doc = new XmlDocument();
doc.Load(reader);

reader.Close();
myInStream.Close();

XmlNamespaceManager nameSpaceManager = new XmlNamespaceManager(doc.NameTable);
nameSpaceManager.AddNamespace(“my”, “http://schemas.microsoft.com/office/infopath/2003/myXSD/2009-06-11T12:44:57“);

doc.DocumentElement.SelectSingleNode(“my:Status”, nameSpaceManager).InnerText = “Saved”;
doc.DocumentElement.SelectSingleNode(“my:SaveDate”, nameSpaceManager).InnerText = DateTime.Today.ToString();
System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();
SPFile newFile = _web.Folders[“SampleFormLib”].Files.Add(item.File.Name.ToString(), (encoding.GetBytes(doc.OuterXml)), true);
item.File.Update();

Make sure you execute item.File.Update() to commit the changes (I got the errors while execute item.Update() and spent couple of hours to find 🙁 )

Get Timer Job Interval for Alerts

To get the timer job interval for alerts can be retrieved by using the getproperty command in stsadm.

Syntax:
STSADM -o getproperty -pn job-immediate-alerts -url <URL of the Site>

Example:

STSADM -o getproperty -pn job-immediate-alerts -url http://uday
			

Download SharePoint 2010 Developer Documentation

Are you looking for SharePoint 2010 Developer Document, you can download it from here

Set Duration for New Icon Indicator in SharePoint

To Set the Duration for New icon in SharePoint (the indicator which shows next to new items) access the SharePoint WebApplication object and set the value for DaysToShowNewIndicator.



SPWebApplication WebApp = SPWebApplication.Lookup(new
Uri(WebAppURL.Text));

WebApp.DaysToShowNewIndicator = 3;

WebApp.Update();

Microsoft Office 2010 Technical Preview

Do you want to get the Technical Preview copy of Office 2010 Register Here

SharePoint 2010 System Requirement

SharePoint Team has announced the preliminary System Requirements for SharePoint 2010.

  1. SharePoint Server 2010 will be 64-bit only.
  2. SharePoint Server 2010 will require 64-bit Windows Server 2008 or 64-bit Windows Server 2008 R2.
  3. SharePoint Server 2010 will require 64-bit SQL Server 2008 or 64-bit SQL Server 2005.

Microsoft SharePoint Workspace 2010

Check the Video Here on: What’s new in SharePoint workspace 2010(Formerly Microsoft Office Groove)