Meetings Calendar Customization

The need of a meetings calendar has pursued me to look deeper into SharePoint’s OOB calendars and the customization possibilities for this type of list. There are several content types available in SharePoint, which can be added to a list, but they do not appear in the UI interface (site content types). For the calendar list, besides the usual event content type, there are several others: Schedule Content Type which enables the calendar as a scheduler for the members of the site, Reservation Content Type, which enables the calendar to reserve from a list of resources, and provide a reservation/availability checkup for it. There is also a Schedule and Reservations Content Type, which provides both of the functionalities of the previously described content types. This was also the one I used in my solution.

Figure1. Grouping Option on Calendar List Creation

Meetings Calendar Customization - Grouping Option On Calendar List Creation

In UI, the choice of creating these two types is provided as an option when you create a calendar. Please note that you can only use a calendar for Resource Reservation (option becomes available) if the “Group Work Lists” feature is enabled. However, these content types can be referenced from a list definition.

Creating the Custom Calendar Definition
The most important drawback when creating a custom calendar with a list definition xml is that when you deploy it , its ribbon will not be like a UI-created calendar’s but it will be just like a custom list ribbon, with an additional Calendar tab displayed. This way, you also lose the Connect to Outlook feature of the Calendar, which is very important for most end-users. So, the most difficult part was to create a Calendar which would be recognized by SharePoint as a “regular” calendar, but which would provide my very one functionality. To do this, you must use a new “feature” introduced in SharePoint 2010, which allows you to create a list instance based on a custom schema xml, without creating a template. This allows you to specify a list template for your list instance, but provide a custom list definition for it. (I have found this, by looking into an imported solution package from a UI-customized calendar). So, in order to do this, you should create a List definition, the normal way, but then delete the elements.xml file which contains the ListTemplate definition, leaving only the Schema.xml file.

Figure 2 . List Instance Definition

<ListInstance Title=”YourTitle”

OnQuickLaunch=”TRUE”

TemplateType=”106″

FeatureId=”00BFEA71-EC85-4903-972D-EBE475780106″

CustomSchema=”MeetListSchema.xml”

Url=”YourUrl”

Description=”YourDescription”>

</ListInstance>

After that, create a new List Instance, and change its attributes in xml. The CustomSchema attribute should be the path to your Schema.xml definition from the previous step, and with the TemplateType attribute you can use any of the OOB template values (I have used 106, the event list template.).Now when you deploy the list, SharePoint will treat it as a calendar list, but you will have it customized the way you want it. Another important thing is to specify the FeatureId attribute, with the id of the feature which contains that list template definition (here is a partial list of the available templates. If you want more, study the 14/Template/Features folder.).

Resources Connection

Figure3. Facilities Field and FreeBusy Field UI

Facilities Fiels And Free Busy Fiels In Ul

The field which is responsible for the resources is the so-called Facilities field. There is no documentation I could find about this field, of how to use it. My only clue was that it inherits from the LookupField, so it should be a Lookup to a Resource list. Then I have found two important content types, which would be the Resource and the Resource Group content types. Here you can choose to create a custom list which would use these two content types, and direct the facilities field from this list to itself (List=”Self”), but the best option is to use the list template 402 called Facilities List, which allows only one such list to be existent on the site (Unique=”TRUE” attribute of the ListTemplate element). You should look into the Features folder from the 14 hive and study the following features: FacilityList and GroupWork. There you will see how the Group Work Lists provides the resources list, and how to use it. Having the Resources list sorted out, what you need to do is to connect the Facilities field from your custom list to it.You must be careful to correctly specify the List attribute, the ColName and the RowOrdinal.

Figure 4. Facilities field connection.

<Field

ID=”{a4e7b3e1-1b0a-4ffa-8426-c94d4cb8cc57}”

Name=”Facilities” DisplayName=”$Resources:core,GBW_SR_Facilities_Field;” Type=”Facilities” Mult=”TRUE” ShowField=”Title” Sortable=”FALSE” CanToggleHidden=”TRUE” Sealed=”FALSE” SourceID=”http://schemas.microsoft.com/sharepoint/v3″ StaticName=”Facilities” ColName=”int6″ List=”$Resources:core,lists_Folder;/$Resources:core,facilities_Folder;” RowOrdinal=”0″>

That’s it, the connection is done. If you have further uncertainties about this subject, you can create a new site collection, activate the Group Work Lists Feature, create a new Group Calendar with resource reservations enabled, save the site as a template, and then open the wsp package in visual studio to see “how it’s made”.

References
Important blog posts you should read to find additional details are:
Blog post about the ListInstance CustomSchema attribute
Blog post about the use of the Resources list in SharePoint

This article was given to us by misoft systems. Why not check out their website by clicking here>>

Stay tuned for more SharePoint content from Christian by joining our community or by following us on twitter or facebook.

Share this on...

Rate this Post:

Share: