Exchange Server 2007 SP1, Outlook Web Access Customization: Part 1, registry.xml
I’ve seen a few cases come through where customer’s are trying to implement the customization features that were introduced with Exchange Server 2007 SP1. There’s a few key areas that seem to cause trouble so I figured it would be worth walking through a simple scenario that covered many of the different aspects.
The simple (and contrived) scenario that I’m going to run through is the use of a custom message type to represent a helpdesk request. This example will cover composing, sending and viewing this custom type, and we’re going to redirect the Reply and Forward actions to the viewing form to effectively disable that functionality. We’re also not going to handle the different states such as “DRAFT” but these concepts are extensions of the scenario that I’ll cover here.
The first order of business is to decide on the item class that you want to use for your custom items. For this sample I’ll use IPM.Note.HelpTicket as the item class. We’ll use this class for the forms registry (Registry.XML), the UI Extension definition (UIExtensions.xml), and we’ll have to set it properly when we create and send the new message.
In reality, the only folders that actually support custom form registration are folders that utilize the default Mail Folder view in Outlook Web Access. We’re working on updating the documentation on MSDN to more accurately reflect this limitation. The custom forms registry is an extension of the internal workings of OWA, so there may be some other scenarios that work or partially work, but those scenarios are not tested or supported.
So, let’s get started. The Registry.XML file is split into two sections. The first section identifies the class, actions, and states the mapping applies to, as well as the target form that should be used. The second section is basically a hook that is required so that the first section will be applied by OWA.
The following example Registry.XML file creates a for the IPM.Note.HelpTicket class and maps the New action to the NewHelpTicket.ASPX form, and it maps the Open, Preview, Reply, ReplyAll and Forward actions to the ViewHelpTicket.ASPX form.
<Registry xmlns="http://schemas.microsoft.com/exchange/2004/02/formsregistry.xsd"
Name="PremiumExtensions" InheritsFrom="Premium" IsRichClient="true">
<Experience Name="Premium">
<Client Application="MSIE" MinimumVersion="6" Platform="Windows NT" />
<Client Application="MSIE" MinimumVersion="6" Platform="Windows 2000" />
<Client Application="MSIE" MinimumVersion="6" Platform="Windows 98; Win 9x 4.90" />
<ApplicationElement Name="Item">
<ElementClass Value="IPM.Note.HelpTicket">
<Mapping Action="Open"
Form="ViewHelpTicket.ASPX"/>
<Mapping Action="Preview"
Form="ViewHelpTicket.ASPX"/>
<Mapping Action="Reply"
Form="ViewHelpTicket.ASPX"/>
<Mapping Action="ReplyAll"
Form="ViewHelpTicket.ASPX"/>
<Mapping Action="Forward"
Form="ViewHelpTicket.ASPX"/>
<Mapping Action="New"
Form="NewHelpTicket.ASPX"/>
</ElementClass>
</ApplicationElement>
<ApplicationElement Name="PreFormAction">
<ElementClass Value="IPM.Note.HelpTicket">
<Mapping Action="Open"
Form="Microsoft.Exchange.Clients.Owa.Premium.Controls.CustomFormRedirectPreFormAction,Microsoft.Exchange.Clients.Owa"/>
<Mapping Action="Preview"
Form="Microsoft.Exchange.Clients.Owa.Premium.Controls.CustomFormRedirectPreFormAction,Microsoft.Exchange.Clients.Owa"/>
<Mapping Action="Reply"
Form="Microsoft.Exchange.Clients.Owa.Premium.Controls.CustomFormRedirectPreFormAction,Microsoft.Exchange.Clients.Owa"/>
<Mapping Action="ReplyAll"
Form="Microsoft.Exchange.Clients.Owa.Premium.Controls.CustomFormRedirectPreFormAction,Microsoft.Exchange.Clients.Owa"/>
<Mapping Action="Forward"
Form="Microsoft.Exchange.Clients.Owa.Premium.Controls.CustomFormRedirectPreFormAction,Microsoft.Exchange.Clients.Owa"/>
<Mapping Action="New"
Form="Microsoft.Exchange.Clients.Owa.Premium.Controls.CustomFormRedirectPreFormAction,Microsoft.Exchange.Clients.Owa"/>
</ElementClass>
</ApplicationElement>
</Experience>
</Registry>
|
A few notes on the way that I implemented the above mappings. The documentation states that multiple “actions” can be space-separated in the same mapping element. I have not seen this work, so I set the mapping for each action in a separate tag. I’d also note that the documentation has language that says that if either the Action or State values are omitted from a mapping tag then they will apply “unless a more specific mapping is specified”. You should be aware that the more specific mapping may be in the built-in registry files, so if you have a mapping that doesn’t seem to be working, you should try explicitly mapping actions and states that you’re trying to handle. I’ve taken this approach in the above example.
The Registry.XML file can be placed in C:\Program Files\Microsoft\Exchange Server\ClientAccess\Owa\forms\Customization\ or any folder directly under C:\Program Files\Microsoft\Exchange Server\ClientAccess\Owa\forms\. For this example, I’m placing the Registry.XML, ViewHelpTicket.ASPX, and NewHelpTicket.ASPX all under C:\Program Files\Microsoft\Exchange Server\ClientAccess\Owa\forms\HelpTicket\). Also note that the form paths are relative to where the Registry.xml file is located.
OWA will not read in the new file until is it restarted, and depending on your environment, this may not happen without some action on your part. To force the restart, you can run “iisreset /noforce” from a command line on the Exchange Client Access server where you are creating these files.
If your file is read in successfully, you can find an event in the Windows Application Event Viewer that looks like the following:
(Source = MSExchange OWA, EventId = 73)
If you have an error in your Registry.XML file you’ll instead see an event like this:
(Source = MSExchange OWA, EventId = 9)
Event 9 will include a description of the parsing error, along with line numbers and position. Note also that a bad Registry.XML file can leave OWA in a non-working state, since the mappings are merged into the same structures that handle the normal workings of OWA.
In the next installment of this series, I’ll cover the UIExtenstions.xml file, and how we’ll use that to enable users to create a new item with this custom type.
MSDN Documentation:
Details of forms registry file (registry.xml): http://msdn.microsoft.com/en-us/library/bb891879.aspx