Windows Vista Explorer Property System
The Windows Vista Explorer property system is being enhanced and extended. Some of the new features are:
You can extend the metadata system by writing custom property handlers, protocol handlers, and even enable the system to use non-file system data stores.
The resulting All Documents window on Windows Vista might look like Figure 1.
Notice the title bar. The bread crumb list shows Brent Rector > Virtual Folders > All Documents. When you select the Documents folder, Windows Vista Explorer queries the system for a list of all files of type "Document."
Look at the preview bar that spans the bottom of the All Documents display. At the left end of the bar, note the graphic display. Windows Vista Explorer obtains the rich thumbnail for this display from the document itself. That graph is a miniature version of what Microsoft Excel will display when the user opens the document. This helps to find the appropriate file more quickly.
Note that the bar also displays the name of the file, and beneath the file name is the friendly description of that particular file type. In the middle and on the right-hand side of the bar, the Explorer displays important properties of the file. These are the first six properties in your Preview Pane Property List. Order is important. You can also make the preview pane larger in size by dragging it up, and you'll see more properties (in order) from that list.
Additionally, a user can update an item's property directly in the Explorer view. For non-read-only properties, a user can click the property value and alter its value directly. For example, a user can click the Keywords value and add new keywords directly from the All Documents window. Alternatively, a user can bring up the property page for a document and see, as well as edit, all properties for that document.
The following example demonstrates the "stack" feature in Windows Vista.
In Figure 2, the blue folders on the left side (in the navigation pane) are called "virtual folders," and the yellow folders are the regular file system folders. When a user clicks the Organize by Authors item in the left column, Windows Vista Explorer queries the system for all items that have an Author keyword value. In the example, there are 24 documents available by the author Horatius.
Now let's look at how you can integrate your own document types into Windows Vista search and organize functionality. For this example, we'll create a new file type using the ".invoice" file extension and register the ".invoice" file extension as files of type Document; then we'll create a sample ".invoice" file and drop it onto the desktop. Figure 3 shows the resulting All Documents window.
In this example, we've selected the sample.invoice file and have implemented a property handler for this new file type. Therefore, Explorer displays the available properties and enables the user to change writable properties. When the user changes one or more properties, these changes are given back to the property handler so it can write them appropriately to the invoice file. A blank document displays in the preview area because the property handler doesn't yet provide a thumbnail view of the document.
All of these features and more are achieved on an architecture that provides abstract access to the properties in an item.
Let's say that you'd like a user to be able to ask Windows Vista Explorer to find all invoices that contain a purchase of a particular product. Clearly, that information is locked up inside the invoice file somewhere, but Explorer needs some way to access it.
There are basically two types of data stores: file system stores and non-file system stores. The invoice example is a simple file system store. Explorer can search information in the invoice if a developer provides an implementation of the IPropertyStore or IFilter interface for this new file type.
If you're working with a non-file system store, you need to write a protocol handler that allows Explorer to navigate through the data store. A protocol handler connects the Explorer with a non-file-system-based proprietary data store. This enables the Windows search system to index data within the store. For example, if you have a mail client that stores its list of received e-mail, you can provide indexing and search capability for each individual e-mail by providing a protocol handler. Often developers who create a new protocol handler for a custom data source will also need to implement an Explorer Namespace Extension to provide UI for the items that are displayed in the Explorer, such as context menu handlers, icons, etc.
To extend Windows Vista Explorer, developers need to do two things:
Windows Vista supports a number of new APIs to use when developing new applications. Applications should never hard code file paths to "well-known" locations. Use Known Folder APIs instead. The Known Folder APIs abstract the file system location from the functionality of the folder. This allows features like folder redirection. You should use existing Known Folders when one is semantically equivalent to what you need, for example, PDF documents stored in Documents. Otherwise, your application can create new known folders, for example, 3D Drawings, Shapes, Code Projects, etc.
You can use new Windows Vista APIs to query items in the Windows Search Engine. Your application can use the OLEDB/ADO from managed or unmanaged code to issue queries using a SQL-like syntax. In return, your application receives an OLEDB Recordset where the columns correspond to properties in the Windows Metadata System, for example, System.Photo.FNumber.
You can also use the unified metadata layer to read/write metadata from/to file formats. Your application can enumerate properties stored in a file, discover property descriptions (schema) as described in the system, and read and write values for properties.
The Common File Dialog has been updated. It has a number of new COM APIs. Some of the new features of the Common File Dialog are:
The Common File Dialog is also extensible. You can add new controls and change the layout of the dialog.
Windows Vista improves the ability of a developer to extend the search infrastructure, enabling users to more easily organize, search, and visualize their data. These are substantial advances that help developers build much richer experiences for their users.
Windows Vista provides a more complete view and access to content of your custom data stores (metadata and full-text) when you provide property handlers. Many are built into the system. Windows Vista can render rich thumbnails of your files when you provide a thumbnail provider, and many common ones are built into the system.
In addition, Windows Vista enables application developers to use and extend the Known Folders of the system, issue queries to Windows Search Engine, access and update file metadata through a unified layer—rather than writing custom code for every file type, and incorporate the new UI in their own applications using the Common File Dialog.