Monday, February 14, 2011

Getting Intellisense with Visual Studio (& a little wiser with your life)

So if you're out there creating a content type programmatically, you know you're up against something formidable. You have to write a bunch of XML & you dont get any help from Visual Studio. Seriously, SharePoint development has to use more classes & less XML.

Fret not though, use the following link to add intellisense to creating SharePoint XML through Visual Studio:

http://www.andrewconnell.com/blog/archive/2006/10/20/4944.aspx

Basically, you just refer to wss.xsd found at 12\Templates\XML\wss.xsd in the schemas property of the XML file in Visual Studio.

Next tip, you know that content types form the base of everything in SharePoint, so if you ever need to find all the content types that SharePoint ships with, here's where you need to look:

12\Template\Features\ctypes\ctypeswss.xml

Easy to remember, if you're looking for the schema, go to hive\templates\XML\wss.xsd & if you're looking for content types definitions, go to hive\temples\features\ctypes & find ctypeswss.xml.

Looking at the content types defined, I realized that many of the fields that we assume exist with a content type, are created because they are defined in this ctypeswss.xml. For e.g. I always wondered about where the created_by & modified_by & modified_date fields were defined with the document library items. I realized that they exist, because they are FieldsRefs by the content type & that they are hidden by definition.

Last tip, if you ever need to find SP logs, they exist at Hive\Logs.

That brings me to getting wiser in life ... it's simple ... in the mad rush of our fast paced lives, you need to find that time of the day where you're alone & calm & then think ... have patience, this too shall pass.

No comments:

Post a Comment