Skip to main content

Posts

Showing posts from July, 2009

Changing the boundaries

Site Collections by default are stored in the content database for the web application. The diagram below illustrates this. Using the administration user interface you cannot create a new site collection with its own content database. This may lead you to create many web applications for your SharePoint site collections so that each one has its own database that can be backed up using SQL Server database backups and SharePoint backup and restore. Restoring the backups may become awkward as you will have to restore the whole content database unless you have a 3rd party disaster recovery tool in place. STSADM has an operation called "CreateSiteInNewDB". The command line definition for this command is: stsadm -o createsiteinnewdb -url -owneremail [-ownerlogin ] [-ownername ] [-secondaryemail ] [-secondarylogin ] [-secondaryname ] [-lcid ] [-sitetemplate ] [-title ] [-description ] [-hostheaderwebapplicationurl ] [-quota ] [-databaseuser ] [-databasepassword ] [-databasese

What makes for good SharePoint Documentation?

The title of the document I leave with my clients is "Technical Architecture, Design, and Procedures Document" (TADPD). It's a rather lengthy title, but I feel is fully describes what is contained therein. The document contains details on the portal's architecture, design details on the various components/features of the portal, and procedures on how to maintain and govern the portal after I have left the client. Here are those sections broken down into what I see as the five major categories: Architecture Planning. This section details all the physical and virtual server requirements for the portal, as well as how those requirements were decided upon. Additionally, the Authentication strategy for how users authenticate to the portal is also discussed. Subsections: Capacity Planning Physical Architecture Virtual Architecture (if used) Network Architecture Software Strategy Authentication Strategy Service Accounts Feature Technical Design. The design portion of the T

Adding document metadata with SPFileCollection.Add

In yet another flagrant display of “We won’t document it if it don’t work.”, the SPFileCollection.Add() overloads allowing you to specify file properties using a Hashtable. For example, Add(String, Byte[], Hashtable, Boolean) would imply that specifying the file URL, file bytes, a Hashtable containing metadata, and a true (to over-write any existing file with the same file name) might be a useful way to both add a file to a document library and adorn it with metadata. Except it doesn’t work real well. You are supposed to be able to declare and use a Hashtable in the following way: Hashtable archiveProperties = new Hashtable(); archiveProperties.Add("Supplier_x0020_Name", PostedFormValues[supplierName.ID]); archiveProperties.Add("Supplier_x0020_Code", PostedFormValues[supplierNumber.ID]); etc… SPFile newZipFile = destFolder.Files.Add(destURL, zip, archiveProperties, true); newZipFile.CheckIn(); What results is a file in a document library without any metadata. No

What does taxonomy mean to you?

Next time you are speaking about taxonomy in relation to SharePoint make sure you clarify what is meant by that. Taxonomy can mean many different things depending on the context of a conversation. When I am referring to taxonomy in relation to SharePoint this is how I break it down. Definition of Taxonomy: Division into ordered groups or categories Or The science, laws, or principles of classification; systematics. http://www.thefreedictionary.com/taxonomy Taxonomic Sections: This means to get a clear definition of each taxonomic section and the features/purpose of that section. I use the governance model which can be found in the sample governance plan at the Microsoft SharePoint Governance Resource Center for SharePoint Server 2007: http://technet.microsoft.com/en-us/office/sharepointserver/bb507202.aspx Navigation: Define how site users will navigate through the taxonomic sections and the sites within each section. Often there is a gap between the taxonomic sections for the divisi

Cancel Button in MOSS ASPX , ASCX forms

Hi All, One time i came across to a very good thing that we can have default cancel button that with without writing a code you can redirect to any source. (if not provided, default source) This button is functional. By functional means it will handle redirection automatically. Let's say, you would like to have a button Cancel (Sharepoint standard) and want that button to behave in same fashion as standard sharepoint cancel button does, then go for the below code : <wssuc:ButtonSection runat="server"> <Template_Buttons> <asp:PlaceHolder ID="PlaceHolder1" runat="server"> </asp:PlaceHolder> </Template_Buttons> </wssuc:ButtonSection> No code on cancel button. it redirects automatically to source. <%@ Register TagPrefix="wssuc" TagName="ButtonSection" Src="/_controltemplates/ButtonSection.ascx" %> There are also a number of attributes you can set on the ButtonSection control: ShowStan

SharePoint Spin Wheel “Operation in Progress”

Using Custom programming within SharePoint always takes time to execute and create a issue with impatient client. Client always think that we have not done a good job with coding so it will take a long time. Some time if some long operation is going on like creation of site or something like that then 3rd person thinks like process is hang up. So what we need to do is that do some indication screen like “In progress”. And the exciting news is SharePoint is providing built in function for “Operation in Progress” spinning wheel and object is called as “SPLongOperation”. You can use this object in various places like creating a custom SharePoint site, setting up properties, creating a Project in Different server, calling a web services, updating/adding multiple items in SharePoint…. Etc. Check the following snippet which is used in webpart. void btnSubmit_Click(object sender, EventArgs e) { SPLongOperation longoperation = new SPLongOperation(this.Page) longoperation.LeadingHTML = "Le

Howto: Remove an Event Receiver in SharePoint

Everyone and their brother shows you the quick and dirty method on how to add an event receiver to a list. Not many people show you how to remove them (Not even some of the Microsoft Press books…) There are 2 ways.. if you have the GUID of your event receiver, instantiate an instance of an SPEventReceiverDefintion object with that guid and then delete it. Else, here’s the long way: (I’m going under the assumption that you’re a good MOSS/WSS programmer and using Features to deploy your event handler…) public override void FeatureDeactivating(SPFeatureReceiverProperties properties) { using (SPWeb web = (SPWeb)properties.Feature.Parent) { SPDocumentLibrary paqa= (SPDocumentLibrary)web.Lists["PAQA"]; SPEventReceiverDefinitionCollection erdc = paqa.EventReceivers; SPEventReceiverDefinition erd = null;bool found = false; for (int i = 0; i < erdc.Count; ++i) { erd = erdc[i]; if (erd.Assembly == asmName && erd.Type == SPEventReceiverType.ItemAdded) { found = true; bre