Wednesday, March 3, 2010

12 Hive in sharepoint

SharePoint development relies on “12-hive” folder and each who writes code for SharePoint uses that folder intensively. SharePoint uses that folder to store features, log, content types are other stuff.

12 hive folder structure is not private and you can find full description all folders in google, the core folders you should know about are the following:

\ADMISAPI - The directory contain the web service used used by the SharePoint Central Administration and appears as a virtual directory.
\BIN - The directory contains all the core binary files, utilities that are used by Windows SharePoint Services. Your command line tools such as STSADM.EXE reside in this folder
\BIN\LCIDD - A directory will be created for each language will be created that contains language specific binary files.
\CONFIG - This directory contains a set of configuration, binary and resource files used by SharePoint. Some files are the default values which will be copied to web site instances.
\DATA - SharePoint uses this directory structure for the indexing services where content will be indexed.
\HCCab\LCID - This directory has a set of cab files containing manifest and content information used by the SharePoint help sytem
\HELP - The folder contains a compiled html help file (.chm) used by the configuration wizard.
\ISAPI - This directory contains all the standard Web Services for SharePoint and some additional DLL’s, resources and configuration files that the web services use. Every web application provisioned in SharePoint will have a virtual directory strong>/_vti/_bin that points to this directory, thus giving each web application it’s own set of web services.
\ISAPI\HELP - This directory contains all the help files used by SharePoint. The folder also contains LCID sub directories for each language installed thus globalising the help system.
\LOGS - This is the directory that you will visiting frequently whilst doing development and administration as it contains the log files of what SharePoint did and what errors occurred.
\RESOURCES - This directory contains the core.resx file used for creating language packs for SharePoint. If you are going to be localising your SharePoint sites with different languages and cultures, this is the folder to do it in.
\TEMPLATE - This directory structure contains the core web site functionality in SharePoint, that is the features, templates, configurations, resources of a web site. What is important to note about this directory structure is that the Virtual Path Provider hides and masks this directory structure, thus it appears under each web site, list in a completely different structure

How to: Create or Delete Lists

To create a new list, use the one of the Add methods of the SPListCollection class.

The following example adds a new Generic, Events, or Announcements list, based on user input. A Switch clause is used to determine the type of list that the user specifies and sets the type of list template accordingly.



SPWeb mySite = SPContext.Current.Web;
SPListCollection lists = mySite.Lists;

string listTitle = TextBox1.Text;
string listDescription = TextBox2.Text;
string listType = ListBox1.SelectedItem.Text;

SPListTemplateType listTemplateType = new SPListTemplateType();

switch(listType)
{
case "Generic List":
{
listTemplateType = SPListTemplateType.GenericList;
break;
}

case "Events":
{
listTemplateType = SPListTemplateType.Events;
break;
}

case "Announcements":
{
listTemplateType = SPListTemplateType.Announcements;
break;
}
}

lists.Add(listTitle, listDescription, listTemplateType);