Monday, March 31, 2008

Adventures with WSS3.0 Room and Equipment Reservation Application Template

UPDATE 4/7/2008 - 11:06PM:
I spent a few more hours digging through the template and doing some testing. In the end, I simply cannot recommend the RER template for critical production use. Specifically, the email Alerts just don't work consistently. *I also could never figure out how to keep the Status field from being displayed in the email Alert body text (without making more changes than it was worth anyway).

But the use of Alerts was a core requirement for my needs - and without that... well, it's pretty much useless to me.

I probably created 50 sites during testing, and I simply never got the same results with Alerts. Sometimes email Alerts would only trigger on the real "Requested" status'es - while other times they'd be triggered by the "Available" status'es... and *sigh* - sometimes they simply wouldn't be triggered at all.

I do know there are a lot of people complaining about Alerts in general. Specifically, how reliable they are and to what extent they should be counted on. But I've never had much of a problem with them on the servers in question. They're anything but 100% - but still - they've always been pretty consistent for me. Sadly, such was simply not the case with my adventures with the RER template.


ORIGINAL POST:

After I installed Sharepoint’s RER app template, I quickly realized just how limited its use was.
Upon installation, I quickly realized that by default – you can NOT SEE other people’s reservations?!? What the heck is up with that?

For working with the actual reservations, you get 2 pages: “Reserve a Resource” and “My Reservations”. Reserve a Resource allows you to see (ONE-DAY-AT-A-TIME) other people’s reservations – but you can NOT tell anything about the reservation itself (i.e. who made it). And of course on the My Reservations page – you guessed it – you only get your own reservations listed. They actually give you a third page that they don’t bother including a link to – you just kind of have to stumble upon it – “Reservations Calendar” – by changing the view on the “My Reservations” page. But guess what? IT ONLY SHOWS YOUR OWN RESERVATIONS TOO – just in a calendar view. Why so secretive Microsoft?!? Well, actually there is one view that shows everything – “Allitems” view – but it’s a LIST view… come on Microsoft…

So it’s about this time that you start going – well surely I can just change those view filters and do what I want. HAH! So so wrong.. You see, to make this Reservation process work in a way that doesn’t allow overlapping reservations – Microsoft devised a method consisting of a hidden Status field called “RERStatus”. It is a choice field with values of Available and Requested (there’s also Approved I believe, but I’ve never seen it used). Now like I said, this field is completely hidden by definition and you cannot get your hands on it. Which is actually a good thing by default because you can totally hose the reservations by screwing around with it (and make your resources appear booked forever).

The methodology is nothing magic.. they simply use the status to indicate when you can make the reservation. For a day with let’s say a 9:00AM-11:00AM reservation, the list table will have entries like the following:

Conf Room 1 12:00AM 9:00AM Available
Conf Room 1 9:00AM 11:00AM Requested
Conf Room 1 11:00AM Available

If you pop open the RoomEquipmentReservations.wsp (aka .cab file) – you can open the ReservationEventHandler.dll with Reflector and see the code used to check the Status and Date Range and either make the reservation or error out with the appropriate message.

Now moving on… If you do get all brave and decide you want the ability to create/manipulate your own views and do whatever you want with this magic “Status” field – you’ll want to modify the List Field attributes in the schema file.

If you’ve already installed the template – you’ll find the schema.xml file here:
C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\ReservationsList\Reservation\schema.xml

If you haven’t installed it – you can crack open the ApplicationTemplateCore.wsp (aka .cab file) – and edit this guy:
ReservationsList\Reservation\schema.xml (just make a backup first)

The part you’re looking for is:
<Field ID="{6f99f38c-e91f-46be-a4f8-255f793967c9}" Name="RERStatus" Group="RER Columns" Type="Choice" DisplayName="$Resources:rer,RERStatus_DispName;" Hidden="TRUE">

CHANGE TO:
<Field ID="{6f99f38c-e91f-46be-a4f8-255f793967c9}" Name="RERStatus" Group="RER Columns" Type="Choice" DisplayName="$Resources:rer,RERStatus_DispName;" ShowInNewForm="FALSE" ShowInEditForm="FALSE" ShowInDisplayForm="FALSE" Hidden="FALSE">

Notice I added the attributes ShowInNew/Edit/ViewForm because if you don’t – after you set that Hidden=TRUE property - the field will be visible and changeable everywhere (which would be really, really bad).

*Note1: I couldn’t figure out how to keep the Status field from displaying in email Alert body’s.
**Note2: If you edited the installed schema.xml – you’ll have to restart IIS to pickup your change.

Anyway, you now have a site with the magic Status field visible in the right places so you can use it however you like.

You should now be able to edit any of the existing Views and see the real Filter parameters and how they’re using “NOT EQ Status=Available” everywhere to keep out the placeholder records... So you can now create your own views or modify the existing ones to your liking.

BUT BE WARNED, if your permissions allow your members to CREATE VIEWS (which they do by default) – I HIGHLY SUGGEST you remove those permissions, else users could possibly create their own views and NOT take into account the Status field (thereby pulling records they shouldn’t). Because once those placeholder (Status=Available) records are visible – people will see them and get confused/delete them and trash the site/etc.

You can set these permissions here:
People and Groups - Site Permissions - Settings/Permission Levels.
You'll normally modify Contribute access (because that's what Members have by default - and Members are probably the ones you have designated as having the ability to make reservations).
* Note: You will have to disable inheriting permissions from parent site to make this change:

So after clicking Contribute - scroll down to Personal Permissions and MAKE SURE "Manage Personal Views - Create, change, and delete personal views of lists." is UNCHECKED.

*Another tip – if you’ll notice, the “Reservations Calendar” view doesn’t have the toolbar on by default. If you try and edit the Web Part to put it back – you’ll get some screwy results (mine would often disappear entirely). The alternative is to set it at the source (back in the same schema.xml file as the List Field definitions):

To set it, find this:
<View BaseViewID="3" Type="CALENDAR" WebPartZoneID="Main" DisplayName="$Resources:rer,ReservationsCalendar_ViewName;" SetupPath="pages\viewpage.aspx" ImageUrl="/_layouts/images/announce.png" Url="ReservationCalendar.aspx" Scope="Recursive">
<Toolbar Type="None"/>

And change it to “Standard” for the full normal toolbar:
<View BaseViewID="3" Type="CALENDAR" WebPartZoneID="Main" DisplayName="$Resources:rer,ReservationsCalendar_ViewName;" SetupPath="pages\viewpage.aspx" ImageUrl="/_layouts/images/announce.png" Url="ReservationCalendar.aspx" Scope="Recursive">
<Toolbar Type="Standard"/>

*** Notes about RER and Email Alerts:

My new custom views consist basically of clones of the originals – only filtered to show a single resource. For example, I created individual Calendar Views for each individual Resource. This just makes it a little nicer for users wanting a calendar view to only have to look through entries for the particular resource they’re interested in. I also took the opportunity on these custom Calendar views to change it so that the Reserved By field is displayed on the calendar date instead of the Resource name.

Everything was rolling along fine until I realized you can’t create alerts from Calendar views. So I thought – OK – I’ll just create List views for each calendar.. basically the same filter and everything – just a List instead of a Calendar. You can then select THOSE List views in the Alert setup.. but for some reason I cannot get these to work. The existing default views (MyReservations and Allitems) trigger Alerts perfectly – but I cannot seem to get my custom List views to trigger them. I see them setup in the ImmedSchedule table in the WSS_Content database – but they don’t seem to be triggered for some reason.

I hope to have a resolution soon and I will update my findings.

If you have any ideas, I’d love to hear them.

13 comments:

datamon2x said...

it would be great if the page that shows the bar graph of the hours would differentiate between Open, Reserved, and Approved.

Chitchai said...

When create a new resource, the new resource is always booked. I've tried your code but it doesn't fix. And the template I use is .WSP not .STP as you mentioned. Please guide how to fix.

Kenneth Scott said...

chitchai:
You are correct, it is RoomEquipmentReservations.wsp (not .stp).
I have corrected the entry - Thanks for letting me know.

Rakki said...

Kenneth,
Thank you for such a nice description of this template.
I have a question, I have a requirement to reserver for video conference . To do that the user has to reserve 2 resources one at his office and the other would be at a different place. I am really not sure how to get this working . I am not sure where they are checking the resource reserved for that time . pls help.

Thanks
KJ

Jonathan said...

Do you know where I can get the code for expanding the availablity.aspx screen to display more than one day, for example a week or month? Thanks

Priya said...

Hi, I have started using equipment reservation template. Now I have to customize it in such a way, that the resources in the reservation page are seen region wise. For that I created a custome list called Region. Now on the availability page I want another region dropdown along with resource and resource type. But am not able to connect the datasource. These dropdowns are connected to dsQueryResponse which is an aggregateDataSource. How do I include one more field. Can anybody help me on this.
Thanks in advance

kevin said...

When adding a standards "Approval" workflow within SharePoint, not through SharePoint designer, to the template we are getting 3 approval tasks, and 3 e-mails per reservation request. One for the "Available" time prior to the reservation, the second for the "Requested" time of the reservation, and the third for the "Available" time at the end time of the reservation.

kevin said...

Sorry, that got away prior to adding my question.
Is there a location that I can find the workflow that was created in the SharePoint List while using SharePoint Designer? Because I can't seem to find it.
Or should I create a custom "Approval" workflow using SharePoint Designer that somehow uses the status field to only send out the approval request e-mail and add to the task list for "Requested" items?
Thanks

chris said...

hi,
First of all great post! Made some of the changes you recommended and it looks great.
However, I am havign problems with the workflow not strating when I create a resource. I have full control but still, the workflow "Setup" seems not to activate....

Any ideas?
Thanks alot
Chris

Midnight Manz said...

Let's anyone create resources more than twenty items?. I've got problem when pass to new reservation screen by the resource dropdown list was not focus at currently resource. Now, I use only twenty resources. BTW, I need adding 25 meeting rooms. My user does not appreciate by selected meeting room again.

Matt said...

The last comment, more than 20 items or so - does naybody else have a fix for this as it is a n issue i am experiencing.

Dave said...

I THINK I FIGURED THIS OUT!! If you have modified the default value of the End Date to anything other than "None", then when the workflow runs it puts that end date on the initial "Available" record, thus rendering the availability as ended as soon as the resource is created.

Jeremy said...

Hello!

I am curious if anybody can help me out with something that I am trying to do.

I am currently using the "room and equipment reservation" template.
Instead of reserving rooms and equipment, I am reserving people.

So in the "resources" list I added two columns, one for "region" and one for "location".
Now each resource can be tied to a region and location.

Now, when go to reserve a resource in the "reservations" list everything works great!
I am missing one ability though. I need to be able to filter by region and location.
Those columns are in the "resources" list.

I am trying to find a way to filter my reservations by the regions and location columns that I created for the resources that are linked to the "reservations" list via the resource I have chosen.

Any help would be greatly appreciatted.

Thanks

Post a Comment