Archive for September, 2007

SharePoint Solution Generator::Creating a site definiton from an existing site

Ok to get started I have created a new team site, based on the standard team site template. I have created two Custom Lists in the site named Employees and Employee Education respectively both with some added columns like Employee Name, Employee Address, Phone, Degree, College , Grade etc.
 
Now lets start SharePoint Solution Generator and start creating a site definition solution.
 
 
1) Run SharePoint Solution Generator.
 
 
2) Click on Site Definition and Click Next.
 

 
3) Now choose a site instance you would like to create a site definition template from, or else you can specify a URL also . Once done please click Next.
 

>

4) Specify the location to Save your site definition and also specify the project name.;

5) Finally press finish to proceed with generating the solution.

 6) Click on "Click here to open the generated solution".

 7) The result is a C# site definition solution with the following elements in it:

8) Start debbuging the solution. The following is the output.

—— Build started: Project: Oz Site Definiton, Configuration: Debug Any CPU ——

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Csc.exe /noconfig /nowarn:1701,1702 /errorreport:prompt /warn:4 /define:DEBUG;TRACE /reference:"C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\ISAPI\Microsoft.SharePoint.dll" /reference:"C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\ISAPI\Microsoft.SharePoint.Security.dll" /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Web.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.XML.dll /debug+ /debug:full /keyfile:Properties\Temporary.snk /optimize- /out:obj\Debug\Oz_Site_Definiton.dll /target:library Properties\AssemblyInfo.cs "Site Provisioning Handler\SiteProvisioning.cs" "Site Provisioning Handler\SiteProvisioning.Internal.cs"

Compile complete — 0 errors, 0 warnings

Oz Site Definiton -> C:\Documents and Settings\uzubair\My Documents\SharePoint Definitions\Oz Site Definiton\bin\Debug\Oz_Site_Definiton.dll

—— Deploy started: Project: Oz Site Definiton, Configuration: Debug Any CPU ——

—— Generate Oz_Site_Definiton.wsp file and setup batch file——

Creating solution …

Operation completed successfully.

Creating setup batch file …

Operation completed successfully.

—— Add and deploy Oz_Site_Definiton.wsp to the SharePoint ——

Adding solution …

Operation completed successfully.

Deploying solution …

Operation completed successfully.

—— Activate features in solution if necessary ——

No features in this solution were activated

Restarting IIS …

Operation completed successfully.

========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========

========== Deploy: 1 succeeded, 0 failed, 0 skipped ==========

9) We can now create an instance of our new site definition. If we go to the create site screen there appeared an extra template selection tab called "Development" where our new site definition appears:

 

10) Select your definition as a site template and create site and it all works !!

 
 

Comments (9)

How to include items from folders within your CAML query Results

 

By default, only items out of the root folder are returned but there is a property you can set to get the results out of a folder (or all of them if you write a small loop).

SPSite site = new SPSite("http://usmanz");
if (site != null)
{
   SPWeb web = site.OpenWeb();
   foreach (SPList docLib in web.Lists)
   {
     if (docLib.Title == "Shared Documents")
     {
     foreach (SPFolder subFolder in  docLib.RootFolder.SubFolders)
     {
        SPQuery query = new SPQuery();
        query.Query = "<OrderBy><FieldRef Name=’Title’/></OrderBy>";
       query.Folder = subFolder;
        System.Data.DataTable table = docLib.GetItems(query).GetDataTable();
     }
   }
 }
}

 

Leave a Comment

Guidelines using SharePoint 2007

I found these guidelines in Blogs, articles on the internet but I wanted to group them together. 
 

 

Limit 

# site collections in a web application 

50.000 

# sites in a site collection

250.000 

# subsites nested in a site 

2000 

# lists 

2000 

# items in a list 

10.000.000 

# documents in library 

2.000.000

# documents in folder

2000

# documents in index

50.000.000

Maximum document file size

2 GB

# search scopes

1000

# user profiles

5.000

 

These guidelines are not hard limits, meaning if you have 2005 lists on a site, your site will still work. The only thing that could happen by adding more items is that your performance could decrease.

 

Leave a Comment

STSADM.EXE Tool Complete list of administrative operations

The Stsadm.exe tool allows you to perform various administration tasks at the command line prompt. You can also use the command line to execute various scripts such as creating a backup schedule. Stsadm.exe includes administrative operations not found under the Central Administration site.
 

Usage:
           stsadm.exe -o <operation> [<parameters>]
           stsadm.exe -help [<operation>]

Operations:
              
activatefeature
           addalternatedomain
           addcontentdb
           adddataconnectionfile
           addexemptuseragent
           addpath
           addpermissionpolicy
           addsolution
           addtemplate
           adduser
           addwppack
           addzoneurl
           allowuserformwebserviceproxy
           allowwebserviceproxy
           associatewebapp
           authentication
           backup
           backuphistory
           binddrservice
           blockedfilelist
           canceldeployment
           changepermissionpolicy
           copyappbincontent
           createadminvs
           createcmsmigrationprofile
           creategroup
           createsite
           createsiteinnewdb
           createssp
           createweb
           databaserepair
           deactivatefeature
           deleteadminvs
           deletealternatedomain
           deletecmsmigrationprofile
           deleteconfigdb
           deletecontentdb
           deletegroup
           deletepath
           deletepermissionpolicy
           deletesite
           deletesolution
           deletessp
           deletessptimerjob
           deletetemplate
           deleteuser
           deleteweb
           deletewppack
           deletezoneurl
           deploysolution
           deploywppack
           disablessc
           displaysolution
           editcmsmigrationprofile
           editcontentdeploymentpath
           editssp
           email
           enablecmsurlredirect
           enablessc
           enumalternatedomains
           enumcontentdbs
           enumdataconnectionfiledependants
           enumdataconnectionfiles
           enumdeployments
           enumexemptuseragents
           enumformtemplates
           enumgroups
           enumroles
           enumservices
           enumsites
           enumsolutions
           enumssp
           enumssptimerjobs
           enumsubwebs
           enumtemplates
           enumusers
           enumwppacks
           enumzoneurls
           execadmsvcjobs
           export
           extendvs
           extendvsinwebfarm
           formtemplatequiescestatus
           getadminport
           getdataconnectionfileproperty
           getformtemplateproperty
           getproperty
           getsitedirectoryscanschedule
           getsitelock
           geturlzone
           import
           installfeature
           managepermissionpolicylevel
           migrateuser
           moveossindex
           movepropagationlocation
           osearch
           preparetomove
           profilechangelog
           provisionservice
           quiescefarm
           quiescefarmstatus
           quiesceformtemplate
           reconvertallformtemplates
           registerwsswriter
           removedataconnectionfile
           removedrservice
           removeexemptuseragent
           renameserver
           renameweb
           restore
           restoressp
           retractsolution
           retractwppack
           runcmsmigrationprofile
           runcontentdeploymentjob
           scanforfeatures
           searchdiacriticsensitive
           setadminport
           setapppassword
           setconfigdb
           setcontentdeploymentjobschedule
           setdataconnectionfileproperty
           setdefaultssp
           setformtemplateproperty
           setholdschedule
           setpolicyschedule
           setproperty
           setrecordsrepositoryschedule
           setsearchandprocessschedule
           setsearchserver
           setsharedwebserviceauthn
           setsitedirectoryscanschedule
           setsitelock
           setsspport
           setworkflowconfig
           siteowner
           spsearch
           sync
           syncsolution
           unextendvs
           uninstallfeature
           unquiescefarm
           unquiesceformtemplate
           unregisterwsswriter
           updateaccountpassword
           updatealerttemplates
           updatefarmcredentials
           upgradesolution
           userrole
           verifyformtemplate

Examples:
stsadm.exe -o addpath -url http://server/sites -type wildcardinclusion
stsadm.exe -o adduser
           -url http://server/site
           -userlogin DOMAIN\name
           -useremail someone@example.com
           -role reader
           -username "Your Name"
           -siteadmin
stsadm.exe -o backup -url http://server/site -filename backup.dat -overwrite
stsadm.exe -o backup -directory c:\backup -backupmethod full
stsadm.exe -o createadminvs
           -admapcreatenew
           -admapidname StsAdminVs
           -admapidtype configurableid
           -admapidlogin DOMAIN\user
           -admapidpwd Password
stsadm.exe -o createsite -url http://server/site
           -ownerlogin DOMAIN\name
           -owneremail someone@example.com
stsadm.exe -o createweb -url http://server/site/web
stsadm.exe -o deletesite -url http://server/site
stsadm.exe -o deleteweb -url http://server/site/web
stsadm.exe -o enumsites -url http://server
stsadm.exe -o enumsubwebs -url http://server/site/web
stsadm.exe -o enumusers -url http://server/site/web
stsadm.exe -o extendvs -url http://server:80
           -ownerlogin DOMAIN\name
           -owneremail someone@example.com
stsadm.exe -o renameweb -url http://server/site/web1 -newname web2
stsadm.exe -o restore -url http://server/site -filename backup.dat
stsadm.exe -o restore -directory c:\backup -restoremethod overwrite
stsadm.exe -o setconfigdb -databaseserver server
stsadm.exe -o unextendvs -url http://server

For information about other operations and parameters,
use "stsadm.exe -help" or "stsadm.exe -help <operation>"

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\BIN>stsa
dm -help getproperty

stsadm.exe -o getproperty
           -propertyname <property name>
           [-url <url>]

SharePoint cluster properties:
        avallowdownload
        avcleaningenabled
        avdownloadscanenabled
        avnumberofthreads
        avtimeout
        avuploadscanenabled
        database-connection-timeout
        data-retrieval-services-enabled
        data-retrieval-services-oledb-providers
        data-retrieval-services-response-size
        data-retrieval-services-timeout
        data-retrieval-services-update
        dead-site-auto-delete
        dead-site-notify-after
        dead-site-num-notifications
        defaultcontentdb-password
        defaultcontentdb-server
        defaultcontentdb-user
        delete-web-send-email
        irmaddinsenabled
        irmrmscertserver
        irmrmsenabled
        irmrmsusead
        job-dead-site-delete
        job-sqm-timer
        job-usage-analysis
        job-watson-trigger
        large-file-chunk-size
        token-timeout

SharePoint virtual server properties:
        alerts-enabled
        alerts-limited
        alerts-maximum
        change-log-expiration-enabled
        change-log-retention-period
        data-retrieval-services-enabled
        data-retrieval-services-inherit
        data-retrieval-services-oledb-providers
        data-retrieval-services-response-size
        data-retrieval-services-timeout
        data-retrieval-services-update
        days-to-show-new-icon
        dead-site-auto-delete
        dead-site-notify-after
        dead-site-num-notifications
        defaultquotatemplate
        defaulttimezone
        delete-web-send-email
        job-change-log-expiration
        job-dead-site-delete
        job-diskquota-warning
        job-immediate-alerts
        job-recycle-bin-cleanup
        job-usage-analysis
        job-workflow
        max-file-post-size
        peoplepicker-onlysearchwithinsitecollection
        peoplepicker-searchadcustomquery
        peoplepicker-searchadforests
        presenceenabled
        recycle-bin-cleanup-enabled
        recycle-bin-enabled
        recycle-bin-retention-period
        second-stage-recycle-bin-quota
        send-ad-email

 

NOTE: To use stsadm.exe you must be a member of the administrator group.

 

Comments (11)

CAML in the Object Model

CAML (Collaborative Application Markup Language) is an XML-based query language that helps you querying, building and customizing Web sites based on Windows SharePoint Services. Today I would like to give you a brief overview of some of the methods that allow the use of CAML. Some examples are as listed below:

 

         Adding columns to a list.

         Retrieve field schema in a list.

         Use SPQuery to filter items based on some condition.

         Use SPSiteDataQuery to query list items across multiple lists, which may be located in multiple Web sites in the same Web site collection.

 

Adding columns to a list

 

Ok to start off I have a list named “Assignments” based on the tasks template, on my SharePoint root site, by default the list has the columns as shown in the figure below.

 

 

 

 

I want to use CAML and add a new column named “Rating” to the list. I can do this easily like this.

 

 

SPSite MySite = new SPSite("http://usmanz&quot;);

SPWeb MyWeb = MySite.RootWeb;

 

SPList TargetList = MyWeb.Lists["Assignments"];

 

SPFieldCollection fields = TargetList.Fields;

 

string fieldCAML = "<Field Type=\"Number\" DisplayName=\"Rating\" Name=\"Rating\"></Field>";

 

fields.AddFieldAsXml(fieldCAML); 

 
Seems simple enough? ok Now lets look into how can we filter out list items based on some condition using CAML. I will use the same assignments list for this example.
 
//Query to filter out list items where Rating = 5
 

SPQuery query = new SPQuery();
query.Query =
"<Where><Eq><FieldRef Name=’Rating’/><ValueType=’Text’>5</Value></Eq></Where>"; SPListItemCollection items = list.GetItems(query);

 //Query to filter out list items where Rating = 5 and
//also order the items in ascending order based on the modified column

 SPQuery query = new SPQuery();

query.Query = "<Where><Eq><FieldRef Name=’Rating’/><ValueType=’Text’>5</Value></Eq></Where><OrderBy><FieldRef Name=’Modified’ Ascending=’TRUE’/></OrderBy>";

SPListItemCollection items = list.GetItems(query);

Well that again was quite simple, now lets say I want to query across multiple lists, which may be located in multiple Web sites in the same Web site collection. For this we will use the SPSiteDataQuery Class. Its quite simple to use.
 
 
SPSiteDataQuery query = new SPSiteDataQuery();
query.Webs = "<Webs Scope=\"Recursive\">";
 
//only look through tasks lists. 107 is for a list based on tasks template
 
query.Lists = "<Lists ServerTemplate=\"107\" />";
 
//sets the inner XML that describes the view fields used in the query.
 
query.ViewFields = "<FieldRef Name=\"Title\" />“ ;
 
//get only the items where the start date is equal to  7/01/2006
 
query.Query= "<Where>" +
  "<Eq>" +
    "<FieldRef Name=\"StartDate\" />" +
    "<Value Type=\"DateTime\">7/01/2006 </Value>" +
  "</Gt>" +
"</Where>";

 
DataTable dt = rootWeb.GetSiteData(query);
 
 

Comments (16)

Free Books

Leave a Comment

Nice Article::10 reasons to deploy Microsoft Office SharePoint Server 2007

 
This is a nice article I found on the internet "10 reasons to deploy Microsoft Office SharePoint Server 2007" . The article gives you a good idea of some impressive features in Microsoft Office SharePoint 2007. Click here to read the article :).

Leave a Comment

Setup Error::”This product requires ASP.NET v2.0 to be set to ‘Allow’ in the list of IIS Web Server Extensions”

While I was installing WSS 3.0 on my home machine I came across the following error
 
"Setup is unable to proceed due to the following error(s):
This product requires ASP.NET v2.0 to be set to ‘Allow’ in the list of Internet Information Services (IIS) Web Server Extensions. If it is not available in the list, reinstall ASP.Net v2.0.

Correct the issue(s) listed above and re-run setup.
"  
 
It was a very confusing error since it clearly stated in my IIS Web Service Extensions page that "ASP.NET v2.0.50727 " is listed as "Allowed". I googled up the error and came across a very good forum on which the same error was being discussed and some solutions were posted.
 
To get pass this error run the following command aspnet_regiis.exe -i on the following path \\Windows\Microsoft.Net\Framework\v2.0.50727
 


If you are using x64 machine and you still get the error, please run

\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\aspnet_regiis.exe -i

Notice in this case we have Framework64 Folder instead of the simple Framework folder.

I hope this post was useful to you.

 

 

Comments (19)

System requirements for installing Office SharePoint Server 2007 and Office Project Server 2007

Well lets start!! so first of all before jumping into how to handle various installation scenarios of Office SharePoint Server 2007 and Office Project Server 2007 I thought we should discuss the system requirements first.  The thing to remember is that Office SharePoint Server 2007 and Office Project Server 2007 have identical system requirements for installation. So lets breakdown the preparation of the system into simple and easy to follow steps.
 
Step-1:

Hardware and software requirements:

Prior to installing Office SharePoint Server 2007 and Office Project Server 2007 its always good that you get a detailed information of the hardware and software requirements. This article outlines in great detail the software and hardware requirements. Click here for the article.

Step-2:

Download and Install Microsoft .NET Framework version 3.0

e Microsoft .NET Framework version 3.0 download contains the Windows Workflow Foundation technology, which is required by workflow features. Please note that there are seperate versions for x86 based computers and x64 based computers make sure you download and install the appropriate version for your computer. Click here to download.

Step-3:

Enable ASP.NET 2.0

  1.  Click Start, point to All Programs, point to Administrative Tools, and then click Internet Information Services (IIS) Manager.

 

  2.  In the IIS Manager tree, click the plus sign (+) next to the server name, and then click the Web Service Extensions folder.

 
  3.  In the details pane, click ASP.NET v2.0.50727, and then click Allow.
 

  

Database server

The database server computer must be running Microsoft SQL Server 2005 or Microsoft SQL Server 2000 with the most recent service pack.

The Office SharePoint Server 2007 and Office Project Server 2007 Setup programs automatically create the necessary databases when you install and configure them. Optionally, you can preinstall the required databases if that is required by your IT environment or policies.

If you are using SQL Server 2005, you must also change the surface area settings.

Configure surface area settings in SQL Server 2005

1.

Click Start, point to All Programs, point to Microsoft SQL Server 2005, point to Configuration Tools, and then click SQL Server Surface Area Configuration.

2.

In the SQL Server 2005 Surface Area Configuration dialog box, click Surface Area Configuration for Services and Connections.

3.

In the tree view, expand the node for your instance of SQL Server, expand the Database Engine node, and then click Remote Connections.

4.

Select Local and Remote Connections, select Using both TCP/IP and named pipes, and then click OK.

 

Comments (5)

Deploying Office SharePoint Server 2007 and Office Project Server 2007 to a new environment

 

Comments (1)

« Newer Posts