I heard about WinFS a while back when “Longhorn” news was making it’s way to the public. “What is WinFS?” you might ask.
Essentially WinFS is a storage subsystem that will sit on top of NTFS and allow developers and applications to index, search, and store more meta-data associated to content, placing more meaning on what’s on your drive.
For example: eventually, you’ll be able to drop a Word document into a WinFS store and be able to associate Outlook Contacts to allow you to search for documents by keyword AND/OR who it came from. Imagine opening up a query box on your desktop and typing ”SharePoint integration from Raymond” and have it pull up an email and document where he tells me how to bring back a SharePoint list.
…
So Neil took the plunge with me and installed the latest WinFS Beta 1 Refresh (Compatible with RTM .Net 2.0). We had previously talked about Vista would integrate RSS and the possibility of using WinFS to do so. Then today, we were chatting about social bookmarking, bookmarking, tagging, etc and how his requirements would be to have something that would index pages by tags/categories/keywords AND the content within the page.
…
So here’s the pitch. I might bite on this and create it… but let’s create a Windows Presentation Foundation Application that you can grab URLs from browsers/del.icio.us/furl/etc, allow you to tag/cateogrize/keyword the URL, and then have it store content in a WinFS Document. Within the Application we’d then have the ability to query against those documents.
Looking through the SDK, it wouldn’t be that hard at all. The WinFS Document class has a XmlContent property that is of type string, specifically to store XML data (ie: (X)HTML). Querying within WinFS stores is quite easy as well. Create a StorageSearcher
WinFSData wfsDat = new WinFSData(@"\localhostBookmarkStore");
using (wfsDat)
{
// Find all urls in WinFS storage.
StorageSearcher urlSearcher = wfsDat.Items.FilterByType();
// If there are no urls in storage, prompt user to add urls.
if (0 == urlSearcher .GetCount())
MessageBox.Show(@"Add some bookmarks to \localhostBookmarkStore", "Bookmarks Not in Storage");
// If the user has entered text to search for in textbox, test for items match text.
if (keywordSearchText.Text.Length > 0)
{
// This filter string is used in next step with input.
filterString = "Exists(Extensions.FilterByType(@0).Filter(Exists(Keywords.Filter(Value == @1))))";
// Filter urlSearcher by filterString on input of ItemKeywords type and actual text from user.
// Eventually you'll want to add ability to search the content, it's not that hard either.
urlSearcher= urlSearcher.Filter(filterString, typeof(System.Storage.Core.ItemKeywords), keywordSearchText.Text);
}
// Add urls in urlSearcher to bookmarks list
foreach (Document url in urlSearcher)
{
bookmarks.Add(url);
}
// Display bookmarks in searchResults listbox.
searchResults.DataSource = bookmarks;
}
Catch the drift?
Ride the waves… Welcome to WinFS