Yesterday afternoon I rose out of my chair, punched the air and exclaimed "Yes, you f*cker". Had I won the lottery or landed a huge new project that would solve all my money worries for years to come? No. I'd worked out how to get a SharePoint folder to display some metadata on a page!
The Problem
Imagine a basic SharePoint List, like this one:
On the right-hand side is a View of the List of Folders in which I'm keeping my music.
What if I wanted to add some additional information about the folder just above where the View appears, like this:
Surely that would be really simple, no?
No!
It took me two days to work out how to do that. Now, admittedly, I'm a noob to SharePoint, but, still. Unless I've missed something very obvious then I'm sure you'll agree what I'm about to describe is anything but simple.
The Solution
What I ended up doing is creating a custom Content Type, based on the existing Folder type, but with an extra Column to store the "description" of the folder. Then I created a custom Web Part to stick in above the View and show the description of the current folder.
Here are the steps involved:
Step 1. Create a new Content Type
This new Content Type will be our custom folder. To create it, go to Site Settings from the Site Actions menu and choose "Site content types".
Then click the Create button:
You'll see a form like this:
Notice how I've created, in effect, a new type of folder, called MyFolder. As it's based on the existing Folder type it will look and behave just like a normal Folder.
Step 2. Add a Description Field to the New Folder
After creating the new Content Type you should have been taken to a page that described it, which looks like this:
Notice there's a link to add a new Column. Click this and we'll add the Description Field/Column, as below:
Once you've clicked Ok on that page your custom Folder is ready for use.
Step 3. Create a new List to contain your Folder
Now we have a new Content Type we need to create and configure a new List that will use it.
From the main Site Actions menu choose the Create option and then choose "Custom list" from the next page, as below:
Call your new List something like MyFolders or MyMedia, or whatever:
You'll then be taken to your new empty List.
Step 4. Configure The List To Show Your Folders
From this Settings menu on the new List, choose List Settings.
On the next page choose Advanced Settings:
On the Advanced Settings page you then need to enable the management of Content Types:
When you click Ok you'll return to the previous page and see the Content Types section, which wasn't there before:
In that section click on "Add from existing site content types" and in the next page add your MyMedia/MyFolder Content Type, so that the Content Types section then looks like this:
Now return to the List and you'll see that under the List's New menu there's an option to create a new "MyFolder" entry. Click this and you'll see a screen like this:
It's just like the standard "New Folder" page, but, this one lets you add a description to it.
Here's the result of pressing Ok - a new folder in your List.
And breath....
That was the easy bit. Getting this far I found fairly "straight-forward". What I then wanted to do was show the folder's description while navigating the List.
Step 6. Displaying the Folder Description
After a couple of days of trying to find a simple solution to this I finally opted to create my own Web Part. To do this I used the WSPBuilder plugin for Visual Studio, which I am running on the same Virtual Machine on which MOSS 2007 is installed.
First off, from within Visual Studio, I created a new WSPBuilder project:
Once the project was created I added a new item to it based on a Web Part and called it "ShowMyFoldersDescription":
Visual Studio will then create all the files you need to deploy this Web Part and in the required structure, as you can see below:
The file we're interested in is the .CS file. Open that and find the CreateChildControls() method and the bit where it says "Your code here". This is where we'll add the following code (be sure to add a "using Microsoft.SharePoint" statement at the top of the code file first):
SPWeb web = SPContext.Current.Web; //Find the folder item for the current page.string rootFolder = Page.Request.QueryString["RootFolder"]; if (!String.IsNullOrEmpty(rootFolder)){ SPFolder folder = web.GetFolder(rootFolder); if (folder.Exists && folder.Item.ContentType.Name == "MyFolder"){base.CreateChildControls(); this.Style.Add(HtmlTextWriterStyle.Margin, "1em"); this.Controls.Add(new LiteralControl("<h2>"+folder.Name+"</h2>")); SPField field = folder.Item.Fields["Folder Description"] as SPField; this.Controls.Add(new LiteralControl(field.GetFieldValueAsHtml(folder.Item["Folder Description"]))); }else{this.Hidden = true; }}else{this.Hidden = true;
}
With the code in place you can build the project and then, if you right click the project you'll see a WSPBuilder menu. In there you can build the WSP and then Deploy it to the server, like so:
Now it's deployed on the server, we need to enable and add the new Web Part to our page. Switch back to the Site in your browser and from the Site Settings page choose the Site Features link from under Site Administration. Scroll down the list of Features until you see the one we just created and then click to Activate it, so an Active flag appears next to it, as below:
Now return to your List and from the Site Actions menu choose Edit Page:
This will put the page in edit mode and allow you to add the new Web Part to it. Click the Add Web Part button on the page and then choose the "Advanced" option from the window that pops up. You'll see a screen like the one below:
Notice the Web Part we just activated appears in the list. Cool! Click and drag it over to where you want it to appear in the List page. You should see a live preview of what it will look like:
Just below the Site Actions menu there'll be an "Exit Edit Mode" button. Click that and you'll return to your List, but, low and behold, it will have the Folder's description appear as you navigate around. Phew!
Summary
Such is the nature of learning SharePoint that achieving something so apparently simple can bring such relief that I punch the air with joy.
For two or three days (yes, days!) while I struggled to work out how to do this I'd been ending my working day with a feeling of dejection, having wasted a whole day in which I'd achieved nothing. I hate days like that. Hence my exhilaration when arriving at a working solution.
I'm not saying this is the only or - by any means - the best approach to take. Heck, who am I to say that, having only been using SharePoint for about a week. For now though I'll assume it is the only way and that what I've described might one day be of use to somebody and save them the pain I've just been through.
I just posted my first SharePoint "how to", which describes showing metadata inside a folder. It's a lengthy post full of many, many screenshots detailing the laborious process of doing something I had assumed would be fairly simple.
While writing it I was mindful of keeping it focused on SharePoint so it would remain a useful resource that a SharePoint developer might stumble upon one day and find useful. That's why I didn't write it from the perspective of a Domino developer.
If you're purely a Domino developer it won't be of much use to you, obviously. However, you might want to give it a once over. Even if just to feel smug about the fact you're not a SharePoint developer. You might even find it enlightening, as it offers a glimpse of "the dark side".
A Domino Perspective?
The article describes how to arrange Lists in a folder-based hierarchy and then display a description of the current folder as you navigate the structure.
In Domino terms this is like having a View of parent/response Documents. The view would contain two Forms - one called "Folder" and one called "Item". The Folder Form would have a field called Description on it and when you opened a document based on it this description would appear along with any child Documents (Folders and/or Items) that shared the same $REF.
It would be fairly easy to implement in Domino. In SharePoint it was a massive headache. For me anyway. Whether a seasoned pro would find it a breeze I don't know.
What I am finding is that OOTB (out of the box) it's quite impressive. But as soon as you go OOTO (out of the ordinary) and try to extend it, you better hope you know what you're doing.
Daniel Nashed's customer was getting a server hang when shutting down Domino on a Win2008 server. If you've run into this problem, there is a hotfix available. Daniel has posted links to more information.
to spice up the Notes client it would be nice to have your favourite bookmarks available in a dock / fish eye alike toolbar (http://www.webappers.com/img/2009/05/jquery-dock-menu.jpg).
I guess the 3D History Thumbnail Viewer project could be of use here.
Notes 8 gradients & grey-blue it's nice but it might not be your favourite colors.
For end-users it should be easy to 'pimp' their Notes client a bit more by being able to select a colorset for the Notes client from a predefined set of 'themes'.
If I want to have my Notes client 'unique' then I should be able to alter a color set or specify my own one.
Corporate is nice, but also sometimes not so tempting.
For a end-user, it will be an extremely good feature if the Lotus Notes Client is able to select and insert more than one signature when composing, replying or forwarding an email.
As part of the Mobile Controls project we've contributed a new release with a Spinning Wheel Control. This control helps to choose values which you'd typicallly do with a combobox in a classic web application. The control can also be used as date ...
When you double click a VCF attachment, Notes automatically creates a Contact and presents that data in a pop-up dialog box for approval. The Comment tab on the Contact form appears. But, the user is unable to enter anything in that field. To do so, takes a multi-step process, too time consuming for most. We should be able to add in an appropriate memory aide as to how the contact is known or came to be in one's Contact DB.
As Passport Advantage goes offline for regular late night maintenance, IBM should post on the login page, when the service is available. How many times I needed a file late evening, only to find you get this lovely descriptive error message during login.
Yet, we have no idea when it will go on-line again, or when it went off-line.
Either way, kindly show some courtesy and recognize that your customers' time is valuable too. Let them plan and avoid access issues, thus increasing their productivity. Thank you.
As part of the Mobile Controls project we've contributed a new release with a control for simple list items which can have icons, labels on the right side, can link to URLs or other pages, etc. Additionally this release exposes the functionality of Dojo 1.5 ...
This article is focused on IBM branded Lotus applications for nontechnical users. The idea is to list the applications and plugins that can be installed in a specific operating system available for the User. User's Applications This are the User's IBM Lotus applications that can be installed ...
This article explains the tools and technologies available to monitor IBM® WebSphere® Portal V6.1 or later usage, including WebSphere Portal site analytics and various open source and commercial offerings. It compares these tools and technologies, providing usage guidelines in various scenarios with the design patterns and best practices on tracking portal usage.
The Rooms and Resources Manager is designed to prevent overbooking of rooms or resources and is responsible for both the processing of all rooms and resources activities, such as meeting invitations, reschedules or cancellations, and updating the Busytime database accordingly.
In Lotus Domino 8.5.1, when one SMTP outbound message is rejected with a permanent error, such as "user not known", subsequent messages queued for the same destination are also rejected.
You have activated Notes Minder on your workstation. When you receive new messages the Notes Minder icon flashes, but the Mail Summary is empty. This issue seems to affect only users running Notes Minder alongside the Lotus Notes 6.5.4 client.
This document described the problem existed in Lotus Symphony which makes Chinese, Japanese and Korean text characters in Fontwork displaying malformed.
Watch this video to see how to delete a folder in Lotus Notes (provided you have sufficient rights). object width"480" height"385" param name"movie" value"http:www.youtube.comvYaNYboZyidUamp;hlenUSamp;fs1" param param name"allowFullScreen" value"true" param param ...