Ambil programatis Daftar Perpustakaan Dokumen

Potongan kode berikut digunakan untuk mengambil daftar perpustakaan dokumen.

SPWeb _web = SPContext.Current.Web;

SPListCollection ListColl = _web.Lists;

foreach (SPList _lst di ListColl)

{

jika (_lst.BaseTemplate == SPListTemplateType.DocumentLibrary)

26 November, 2009 | Tags: , , | Kategori: MOSS 2007, SharePoint Object Model | Tinggalkan komentar

Cara Gunakan File Sumber dalam SharePoint 2007

Buat file Sumberdaya menggunakan Visual Studio IDE

Salin file sumber daya ke 12 sarang sumber daya folder

GetLocalized metode dari SPUtility untuk membaca nilai dari file sumber daya

Sintaksis:

SPUtility.GetLocalizedString(“$Sumber Daya:<<ResourceFileName,ResourceKeyName>>”, “<<ResourceFileName>>”, panjang);

Contoh:

SPUtility.GetLocalizedString(“$Sumber Daya:MyResources,FirstName”, “MyResources”, panjang);

Contoh Sumber:

8 November, 2009 | Tags: , , | Kategori: MOSS 2007, SharePoint Object Model | Satu komentar

Pemrograman Baca Tanda untuk Pengguna di Situs Koleksi

Kelas SPAlerCollection dapat digunakan untuk mendapatkan Alert Koleksi untuk Pengguna.

Di bawah potongan kode digunakan untuk membaca semua tanda terdaftar untuk pengguna situs koleksi.

private static void GetAlerts()

{

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

SPWeb currWeb = currSite.OpenWeb();

SPUserCollection […]

Cara menetapkan Interval untuk Tanda di 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.

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

Contoh: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”; […]

Get Timer Job Interval for Alerts

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

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

Contoh:

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

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();

[…]

SPDisposeCheck Dirilis!

SPDisposeCheck V1.3.1 telah dirilis pada MSDN Kode Gallery, http://code.msdn.microsoft.com/SPDisposeCheck. Alat ini akan membantu meningkatkan kualitas rakitan SharePoint Anda. Ini akan memeriksa majelis SharePoint dan periksa bahwa Anda benar membuang benda SharePoint tertentu (Benda IDisposable yang meliputi SPSite dan SPWeb). The tool is based upon the guidance published in this […]

Pemrograman Perbarui Daftar Konten di SharePoint

Hi Pengembang,

The Below is the Sample Code to update the Sharepoint list content programmatically by using SharePoint Object Model.

SPSite Site = new SPSite(“http://localhost:21000”); SPWeb Web = Site.OpenWeb(); SPList List = Web.Lists[“Address Book”]; SPListItem ListItem = List.GetItemById(0);

string FullName = string.Empty;

FullName = ListItem[“FirstName”].ToString() + ListItem[“LastName”].ToString(); SPListItem[“FullName”] = FullName; ListItem.Update();