So what is a “Library” ?

Posted Mon, Jan 12 2009 0:13 by bill

Earlier I posted what I hope wetted your appetite for some more info about Libraries in Windows 7.  So  what are libraries you ask//I ask ;) Well I hope the following provides some insight. 

caveat emptor: this is still just my first impressions !

A Library is really a view of different “folders”.  Each library is a file, which internally is an xml file.  The default library files are stored in the user’s roaming profile, eg:

C:\Users\Bill\AppData\Roaming\Microsoft\Windows\Libraries

This is an example of

<?xml version="1.0" encoding="UTF-8"?>

<libraryDescription>

   <ownerSID>S-1-5-21-168223323-3520011370-4180941423-1000</ownerSID>

   <version>3</version>

   <isLibraryPinned>-1</isLibraryPinned>

   <templateInfo>

      <folderType>{5C4F28B5-F869-4E84-8E60-F11DB97C5CC7}</folderType>

   </templateInfo>

   <propertyStore>

      <property name="HasModifiedLocations" type="boolean"><![CDATA[-1]]></property>

   </propertyStore>

   <searchConnectorDescriptionList>

      <searchConnectorDescription>

         <isDefaultSaveLocation>-1</isDefaultSaveLocation>

         <simpleLocation>

            <url>C:\Users\Bill\Documents\Visual Studio 2008\Projects</url>

         <serialized></serialized>

         </simpleLocation>

      </searchConnectorDescription>

   </searchConnectorDescriptionList>

</libraryDescription>

 

I omitted the contents of the serialized element for brevity.

You can programmatically access libraries via the IShellLibrary interface and some shell helper functions. 

You can add multiple “folders” to these library files.  I say “folders” in quotes, because according to the IShellLibrary::AddFolder documentation, the object in psiLocation can be a folder or a Search Connector (*.searchconnector-ms) file.

What’s this mean.  Well I don’t know for sure yet, but it looks to me like Libraries can be a way to aggregate search providers. At the simplest level they provide a view of directories, but they have the potential to provide a view over data from various sources, not just file based.  This of course leads us towards the topic of “Federated Search” (more on that in next episode <g>). 

So is it WinFS ? Not really. It is not reliant on managed frameworks like the entity framework… it is instead heavily reliant on XML. From the Library file, saved searches, right through to Federated Search which itself is based around RSS style of XML.  

Thankfully VB9 rocks when it comes to working with XML !

Filed under: , , , ,

Comments

# re: So what is a “Library” ?

Thursday, January 15, 2009 3:02 AM by Ian Thomas

Yes, that's interesting (and the WinFS link has been raised before). I have downloaded W7 beta and must explore.

(one criticism: 'whetted', I think)