Wednesday, September 23, 2009
Wednesday, September 16, 2009
MOSS 2007 limitations
However, I think you will see these limitations are such that they will have little impact in virtually any enviroment.
Microsoft Office SharePoint Server (MOSS) 2007 Limits
| Site Collections in a Web Application | 50,000 |
| Sites in a Site Collection | 250,000 |
| Sub-sites nested under a Site | 2,000 |
| Lists on a Site | 2,000 |
| Items in a List | 10,000,000 |
| Documents in a Library | 2,000,000 |
| Documents in a Folder | 2,000 |
| Maximum document file size | 2GB |
| Documents in an Index | 50,000,000 |
| Search Scopes | 1,000 |
| User Profiles | 5,000,000 |
Wednesday, September 2, 2009
MOSS 2007 webpart using CAML query
I have an announcement list and I am searching for a "Title" corresponding to a field called "Posted By" in the same list. I use the u2u CAML query builder to build CAML queries.Here goes my webpart code:
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Web.UI;
using System.Web.UI.WebControls.WebParts;
using Microsoft.SharePoint;
using System.Data;
using System.Diagnostics;
using System.Web.UI.WebControls;
using Microsoft.SharePoint.Utilities;
namespace WSPBuilderProject1
{
[Guid("be9d2bda-11ef-43e2-bad3-85e5238a1755")]
public class WebPartFeature1 : Microsoft.SharePoint.WebPartPages.WebPart
{
Label lbl;
protected override void CreateChildControls()
{
try
{ //Initializing my site collection url
string sUrl = "http://sm-cala-csx01:5318/sites/HRDep";
//Always use the "using" statement to ensure proper disposal of the SPWeb and SPSite objects.
using (SPSite siteCollectionOuter = new SPSite(sUrl))
{
//Initializing my web app url since my lists are in a subsite called Docs
using (SPWeb webapp = siteCollectionOuter.AllWebs["/sites/HRDep/Docs"])
{
//The list Ann Log to which I want to add data after Item is added to list Announcements
SPList annLog = webapp.Lists["Announcements"];
//Adding the Title field of the new item to my Ann Log list
SPQuery getItem = new SPQuery();
getItem.Query = "
SPListItemCollection items = annLog.GetItems(getItem);
lbl = new Label();
if (items != null)
{
string strTitle = SPEncode.HtmlEncode(items[0].DisplayName.ToString());
//HtmlEncode(items["Title"].ToString());
//QueryFieldNames["Title"].ToString();
lbl.Text = strTitle;
}
else
{
lbl.Text = "error";
}
this.Controls.Add(lbl);
}
}
}
catch (Exception ex)
{
//Writing any exceptions to the event viewer under a source called SharePoint Features
if (!EventLog.SourceExists("SharePoint Features"))
EventLog.CreateEventSource("SharePoint Features", "Application");
EventLog.WriteEntry("SharePoint Features", ex.ToString());
}
}
}
}
Tuesday, September 1, 2009
MOSS 2007: Event handler code to add item to a list
So, I used to ItemAdded method of the event handler.
The simple steps are as follows:
- I use the WSPBuilder project to create and deploy custom code on my portal since WSP builder makes my life really simple.You can download WSPBuilder add in to Visual Studio from here:http://wspbuilder.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=30858
- Now create a new project of type WSPBuilder .
- I named it "ListItemFetcher".
- Add a new item of the type "EventHandler". Keep the scope as "Web".It will automatically create a folder structure with feature.xml and element.xml.
- In the elements.xml make the receiver type as "ItemAdded" and for Announcements list make the template id as "104"
- Next open the EventHandler1.cs file and write the code for ItemAdded.
- Here is my code snippet.
using System.Collections.Generic;
using System.Text;
using Microsoft.SharePoint;
using System.Diagnostics;
namespace ListItemFetcher
{
public class EventHandler1 : SPItemEventReceiver
{
public override void ItemAdded(SPItemEventProperties properties)
{
try
{ //Initializing my site collection url
string sUrl = "http://sm-cala-csx01:5318/sites/HRDep";
//Always use the "using" statement to ensure proper disposal of the SPWeb and SPSite objects.
using (SPSite siteCollectionOuter = new SPSite(sUrl))
{
//Initializing my web app url since my lists are in a subsite called Docs
using (SPWeb webapp = siteCollectionOuter.AllWebs["/sites/HRDep/Docs"])
{
//The list Ann Log to which I want to add data after Item is added to list Announcements
SPList annLog = webapp.Lists["Ann Log"];
//Adding the Title field of the new item to my Ann Log list
string item = properties.AfterProperties["Title"].ToString();
SPListItem annLogNewItem = annLog.Items.Add();
annLogNewItem["Title"] = item;
annLogNewItem.Update();
} } }
catch (Exception ex)
{
//Writing any exceptions to the event viewer under a source called SharePoint Features
if (!EventLog.SourceExists("SharePoint Features"))
EventLog.CreateEventSource("SharePoint Features", "Application");
EventLog.WriteEntry("SharePoint Features", ex.ToString());
} } }}
- Now build and deploy the WSPBuilder project.If deploying to another machine use stsadm to deploy the WSP package.
Thursday, August 27, 2009
Excel Services :Example
MOSS 2007 : psconfig.exe
Use and Need of psconfig.exe in MOSS 2007
In SharePoint Products and Technologies, you can use the psconfig.exe command-line tool as an alternate interface to perform several operations that control how the SharePoint Products and Technologies are configured. You must be a member of the Administrators group on the local computer to perform these operations.
Here is a scenario I found where one would use psconfig instead of the MOSS graphical interface.
For example, if you want to use a SQL server installed on different domain than SharePoint, without using domains trust relationship, you have to connect to the SQL instance using SQL authentication. When creating, or connecting a server to a farm, the only way to use SQL authentication is to use psconfig.exe (located at 12\bin directory) tool.
More information on psconfig.exe:http://technet.microsoft.com/en-us/library/cc263093.aspx.
You can also refer to :http://blogs.msdn.com/yvan_duhamel/archive/2008/11/24/configuring-your-sharepoint-farm-through-psconfig-command-line-tool.aspx