Archive

Archive for the ‘SharePoint’ Category

SharePoint Feature Scopes

August 6th, 2009 Dominick Cosgrove No comments

Which SharePoint Versions am I running?

June 20th, 2009 Dominick Cosgrove 1 comment

To find the version of SharePoint you are running:

  1. Launch SharePoint Central Administration;
  2. Click the Operations tab;
  3. Click Servers in Farm under the Topology and Services heading;
  4. The version will be displayed within the Farm Information section.
Name Version  
MOSS 2010 or WSS 4.0 RTM    
MOSS 2007 or WSS 3.0 June 2009 Cumulative update (KB972569 & KB971538) 12.0.0.6510
MOSS 2007 or WSS 3.0 April 2009 Cumulative update (KB968857 & KB968850) 12.0.0.6504
MOSS 2007 or WSS 3.0 SP2 KB953334 & KB953338 12.0.0.6421
MOSS 2007 or WSS 3.0 Feb 2009 Cumulative update (KB963654 & KB961755) 12.0.0.6341  
MOSS 2007 or WSS 3.0 Aug 2008 Cumulative update (KB956057, KB957109 , KB956056) 12.0.0.6327  
MOSS 2007 or WSS 3.0 Infrastructure Update (KB951695 & KB951297) 12.0.0.6318  
MOSS 2007 or WSS 3.0 post-SP1 hotfix (KB948945) 12.0.0.6303  
MOSS 2007 or WSS 3.0 post-SP1 hotfix (KB941274) 12.0.0.6301  
MOSS 2007 or WSS 3.0 post-SP1 hotfix (KB941422) 12.0.0.6300  
MOSS 2007 or WSS 3.0 SP1 12.0.0.6219  
MOSS 2007 or WSS 3.0 October public update 12.0.0.6039  
MOSS 2007 or WSS 3.0 August 24, 2007 hotfix package 12.0.0.6036  
MOSS 2007 or WSS 3.0 RTM 12.0.0.4518  
MOSS 2007 or WSS 3.0 Beta 2 TR 12.0.0.4407  
MOSS 2007 or WSS 3.0 Beta 2 12.0.0.4017  
Office 12 (PDC image – pre-beta) 12.0.0.3111
(This version of Office does not have a support link in the Add/Remove programs dialog box).
 

Before installing any updates review the SharePoint software update procedures from Microsoft:

Deploy software updates for Office SharePoint Server 2007

http://technet.microsoft.com/en-us/library/cc263467.aspx

Deploy software updates for Windows SharePoint Services 3.0

http://technet.microsoft.com/en-us/library/cc288269.aspx

Categories: SharePoint Tags:

CAML.NET IntelliSense project

April 27th, 2009 Dominick Cosgrove No comments

MVP John Holliday has extended the wss.xsd schema to provide a rich CAML IntelliSense editing experience. By furnishing the out of the box schema with additional xs:annotation and xs:string, the IntelliSense now provides descriptions for each of the elements (from the SDK) and optional attribute values.

I highly recommend use this schema when developing your SharePoint features definitions.

The CAML.NET IntelliSense comes as an .msi installer to make your life even easier.

Thanks again to John Holliday

CAML.NET IntelliSense project

Categories: Development, SharePoint Tags:

How to add a SharePoint WebPart to a group other than Miscellaneous

April 20th, 2009 Dominick Cosgrove No comments

By default, SharePoint web parts are always put into a web part group called “Miscellaneous”.

All you need to do is locate your Feature Element Manifest XML file and add a Property Element called Group and assign it a value. This is normally the XML file that is in your WebPart Folder.

Nice and easy hey… enjoy :)

Get SharePoint Installation Directory Path

March 25th, 2009 Dominick Cosgrove No comments

If you need to get the SharePoint Installation Directory Path then you can use the SPUtility.GetGenericSetupPath method. For instance if you needed to get the path to a features directory to load some XML you could use the following syntax:

string FeaturesPath = SPUtility.GetGenericSetupPath(@”TEMPLATE\FEATURES\” + FeatureName)

The SPUtility Class is full of static methods for assisting you in your SharePoint Development.

Visio Models, Scenarios and Flowcharts for MOSS 2007

February 19th, 2009 Dominick Cosgrove No comments

Models
Model: Business Intelligence (http://go.microsoft.com/fwlink/?LinkID=73117&clcid=0×409 )
Model: Office SharePoint Server Application Security (http://go.microsoft.com/fwlink/?LinkID=73118&clcid=0×409)
Model: Office SharePoint Server Backup and Restore (http://go.microsoft.com/fwlink/?LinkID=73120&clcid=0×409)
Model: Office SharePoint Server Topologies (http://go.microsoft.com/fwlink/?LinkID=73122&clcid=0×409)
Model: Office SharePoint Server Baseline Site Hierarchies (http://go.microsoft.com/fwlink/?LinkID=73124&clcid=0×409)
Model: Office SharePoint Server Customization (http://go.microsoft.com/fwlink/?LinkID=73125&clcid=0×409)
Model: Office SharePoint Server Database Administration (http://go.microsoft.com/fwlink/?LinkID=73130&clcid=0×409)
Model: Office SharePoint Server Enterprise Content Management (http://go.microsoft.com/fwlink/?LinkID=73132&clcid=0×409)
Model: Office SharePoint Server Extranet Topologies (http://go.microsoft.com/fwlink/?LinkID=73153&clcid=0×409)
Model: Office SharePoint Server Inter-Farm Shared Services (http://go.microsoft.com/fwlink/?LinkID=73155&clcid=0×409)
Model: Office SharePoint Server Products Migration (http://go.microsoft.com/fwlink/?LinkID=73156&clcid=0×409)
Model: Office SharePoint Server Search Administration (http://go.microsoft.com/fwlink/?LinkID=73165&clcid=0×409)
Model: Office SharePoint Server Shared Services (http://go.microsoft.com/fwlink/?LinkID=73166&clcid=0×409)
Model: Upgrading Office SharePoint Server Products (http://go.microsoft.com/fwlink/?LinkID=73167&clcid=0×409)
Model: Upgrading SharePoint Portal Server 2003 to Office SharePoint Server (1 of 2) (http://go.microsoft.com/fwlink/?LinkID=73168&clcid=0×409)
Model: Upgrading SharePoint Portal Server Version 2 to Office SharePoint Server (2 of 2) (http://go.microsoft.com/fwlink/?LinkID=73169&clcid=0×409)
Scenarios

Scenario: Enterprise Content Management (http://go.microsoft.com/fwlink/?LinkID=73170&clcid=0×409)
Scenario: InfoPath Forms Services Customer Interaction Form (http://go.microsoft.com/fwlink/?LinkID=73171&clcid=0×409)
Scenario: InfoPath Forms Services Expense Reporting (http://go.microsoft.com/fwlink/?LinkID=73172&clcid=0×409)
Scenario: InfoPath Forms Services Insurance Claims (http://go.microsoft.com/fwlink/?LinkID=73173&clcid=0×409)
Scenario: InfoPath Forms Services Permits (http://go.microsoft.com/fwlink/?LinkID=73176&clcid=0×409)
Scenario: InfoPath Forms Services Supplier Survey (http://go.microsoft.com/fwlink/?LinkID=73177&clcid=0×409)
Scenario: Keeping Connections to Data Sources Current (http://go.microsoft.com/fwlink/?LinkID=73178&clcid=0×409)
Scenario: Large Corporate Internet Site (Infrequent Changes to Web Content) (http://go.microsoft.com/fwlink/?LinkID=73179&clcid=0×409)
Scenario: Office SharePoint Server Call Center (http://go.microsoft.com/fwlink/?LinkId=73557&clcid=0×409)
Scenario: Office SharePoint Server Corporate Intranet Portal Site (http://go.microsoft.com/fwlink/?LinkID=73181&clcid=0×409)
Scenario: Office SharePoint Server Departmental Portal Site (http://go.microsoft.com/fwlink/?LinkID=73182&clcid=0×409)
Scenario: Office SharePoint Server Equities Research (http://go.microsoft.com/fwlink/?LinkID=73183&clcid=0×409)
Scenario: Office SharePoint Server Informational Portal Site (http://go.microsoft.com/fwlink/?LinkID=73184&clcid=0×409)
Scenario: Office SharePoint Server Out-Hosted Portal Sites (ASPs) (http://go.microsoft.com/fwlink/?LinkID=73186&clcid=0×409)
Scenario: Online News Internet Site (Frequent Web Content Updates and Searching) (http://go.microsoft.com/fwlink/?LinkID=73187&clcid=0×409)
Scenario: Preserving “One Version of the Truth” for Distributed Workbooks (http://go.microsoft.com/fwlink/?LinkID=73188&clcid=0×409)
Scenario: Records Management in Office SharePoint Server (http://go.microsoft.com/fwlink/?LinkID=73189&clcid=0×409)
Scenario: Rendering Data from Spreadsheets to Web Parts (http://go.microsoft.com/fwlink/?LinkID=73190&clcid=0×409)
Flowcharts

Office SharePoint Server Planning Flowchart, Part I (application administrators) (http://go.microsoft.com/fwlink/?LinkID=73192&clcid=0×409)
Office SharePoint Server Planning Flowchart, Part II (IT pros) (http://go.microsoft.com/fwlink/?LinkID=73193&clcid=0×409)
Office SharePoint Server Deployment Flowchart (http://go.microsoft.com/fwlink/?LinkID=73191&clcid=0×409)

Categories: SharePoint Tags:

The use of List GUID and Item ID as URL Parameters

February 17th, 2009 Dominick Cosgrove No comments

Posted by Dominick Cosgrove at 9:34 AM Labels: , ,

The SPContext object has some very useful features. One of the freebie out of the box features is that it parses the URL and looks for the List GUID and Item ID. These can be used individually or in combination, providing an easy way to get the List instance or list item.

So if you pass in the List={GUID} as a URL parameter you can then get a reference to the list by SPContext.List.

Likewise if you provide both the List GUID and Item ID, e.g. _Layouts/myform.aspx?List={GUID}&ID={ItemID} you can get a reference to the list item by SPContext.Item.

Categories: SharePoint Tags:

SharePoint ServerTemplate ID’s

January 26th, 2009 Dominick Cosgrove No comments

This is a quick reference for all the SharePoint Server Template IDs.

100 Generic list   101 Document library
102 Survey   103 Links list
104 Announcements list   105 Contacts list
106 Events list   107 Tasks list
108 Discussion board   109 Picture library
110 Data sources   111 Site template gallery
112 User Information list   113 Web Part gallery
114 List template gallery   115 XML Form library
116 Master pages gallery   117 No-Code Workflows
118 Custom Workflow Process   119 Wiki Page library
120 Custom grid for a list   130 Data Connection library
140 Workflow History   150 Gantt Tasks list
200 Meeting Series list   201 Meeting Agenda list
202 Meeting Attendees list   204 Meeting Decisions list
207 Meeting Objectives list   210 Meeting text box
211 Meeting Things To Bring list   212 Meeting Workspace Pages list
300 Portal Sites list   301 Blog Posts list
302 Blog Comments list   303 Blog Categories list
850 Page Library   1100 Issue tracking
1200 Administrator tasks list   2002 Personal document library
2003 Private document library      

You can get the List Templates using SPWeb.ListTemplates

References:

http://msdn.microsoft.com/en-us/library/ms415091.aspx

Setting the value of a BDC field Programmatically

January 21st, 2009 Dominick Cosgrove No comments

You cannot set the value of a BDC (Business Data Catalog) field in the same way that you set standard fields in SharePoint e.g:

SPListItem item = myList.Items.Add();
item["Title"] = "Product Information";

Instead you must use the EncodeEntityInstanceId method of the EntityInstanceIdEncoder class of the  Microsoft.Office.Server.ApplicationRegistry.Infrastructure class library. First you can detect if your field is a BDC field by:

if(item.Fields["MyField"].TypeAsString == "BusinessData")

You then need to:

//Get a reference to the field
SPField myField = spItem.Fields["EmployeeID];

//Get the entity Name for the field
XmlDocument xmlData = new XmlDocument();
xmlData.LoadXml(myField.SchemaXml);
String entityName = xmlData.FirstChild.Attributes["RelatedFieldWssStaticName"].Value;

//Set the Entity Instance value
spItem[entityName] = EntityInstanceIdEncoder.EncodeEntityInstanceId(new object[] { "123456" });

//Set the field display value
spItem["EmployeeID"] = "123456;
1 comments  Saturday, January 24, 2009

Connected WebParts – No Filtered Parameters

Posted by Dominick Cosgrove at 9:05 PM Labels: ,

OK this may be obvious but it caught me out and god knows it caused me to tear my hair out for a while.

I was creating a custom consumer WebPart that I wanted to connect to a URL and BDC Filter WebParts. There are loads of examples out there of how to do this. Basically Windows SharePoint Services makes use of the connection framework and provides additional interfaces called IFilterValues and IItransformableFilterValues to make it easy to create Web Part connections for filtering scenarios.

The issue I had was once I implement the code as per the various examples on the web, there were no filter parameters available to when you configure the connection.

image

The problem lies with the ConsumerParameterCapabilities Enumeration, which is used by a consumer Web part to indicate supported filter parameter capabilities. The samples on the web all seem to use:

ConsumerParameterCapabilities.SupportsMultipleValues

and

ConsumerParameterCapabilities.SupportsAllValue

Unfortunately this did not seem sufficient for the BDC and URL filter WebParts, after some trail and error I established that the minimum required is:

ConsumerParameterCapabilities.SupportsAllValue

or

ConsumerParameterCapabilities.SupportsEmptyValue

How ever it does work if you specify all ConsumerParameterCapabilites. The ConsumerParameter method allows you to have or statements so you can effectively set the parameters like this:

parameters.Add(new ConsumerParameter(
                    "Personnel Number",
                    ConsumerParameterCapabilities.SupportsAllValue
                    |
                    ConsumerParameterCapabilities.SupportsEmptyValue
                    )

or

parameters.Add(new ConsumerParameter(
                    "Personnel Number",
                    ConsumerParameterCapabilities.SupportsAllValue
                    |
                    ConsumerParameterCapabilities.SupportsEmptyValue
                    |
                    ConsumerParameterCapabilities.SupportsMultipleValues
                    |
                    ConsumerParameterCapabilities.SupportsSingleValue
                    )
                );

So to summaries, make sure you are using the correct ConsumerParameterCapabilities for your provider webpart or else you will not see the parameters you are expecting to see.

References

Writing a Simple Filter Consumer Web Part Sample

MOSS 2007 Filter webparts part 1 – create your own provider and consumer

Query Child Content Types in your CAML Query

January 15th, 2009 Dominick Cosgrove No comments

The Content Query Web Part that ships with MOSS and is enabled with the Publishing Feature has an option to include the child content types of that content type in filtering the data. I wanted to replicate this functionality in my own WebPart that utilized the SPSiteDataQuery to query the site. The SPSiteDataQuery accepts a CAML query to filter the results.

image

It is easy enough to query for all documents in a site that are of content type x:

<Where>
  <Eq>
    <FieldRef Name=’ContentType’/>
    <Value Type=’Text’>HR Document</Value>
  </Eq>
</Where>

But what happens if you want to query all children of content type x. In this example if you had CV, Application Form e.t.c. which all inherited from HR Document how do you build your query. You can add each additional Content Type into the WHERE clause of the CAML query, but this is an convoluted approach as any time you add a new child content type you’ll have to modify your CAML query.

The answer lies with how the ContentTypeID is constructed in SharePoint. The ContentTypeID is a concatenation of parent child ContentTypeIDs, this is to say that a ContentTypeID is composed of its parent ContentTypeID post fixed with a  it’s own identifier.

Content Type Parent Content Type Content Type ID
System   0x
Item System 0×01
Document Item 0×0101
HR Document Document 0x0101002C3431777FFD0742A58D02ABC9C5FA62
CV HR Document 0x0101002C3431777FFD0742A58D02ABC9C5FA6201
Application Form HR Document 0x0101002C3431777FFD0742A58D02ABC9C5FA6202

Knowing this you can construct a CAML query that uses the <BeginsWith> select statement.

To return all Documents you can use the following query:

<Where>
   <BeginsWith>
     <FieldRef Name=’ContentTypeId’/>
     <Value Type=’Text’>0×0101</Value>
   </BeginsWith>
</Where>

To return all HR Documents you can use the following query:

<Where>
   <BeginsWith>
     <FieldRef Name=’ContentTypeId’/>
     <Value Type=’Text’>0x0101002C3431777FFD0742A58D02ABC9C5FA62</Value>
   </BeginsWith>
</Where>

You can find the ContentTypeID by going to Site Actions | Site Settings | Site Content Types, and select the parent content type you are interested in. In the URL you will see the ContentTypeID in the page URL. For example:

image