Welcome!

Microsoft Cloud Authors: Janakiram MSV, Yeshim Deniz, David H Deans, Andreas Grabner, Stackify Blog

Related Topics: Microsoft Cloud, Silverlight

Microsoft Cloud: Blog Feed Post

How to: Deploy Metadata Navigation Without Using Code

A list administrator can configure Metadata navigation on the document library settings page

As someone who focuses mostly on ECM and Search, I am a huge fan of the new Metadata Navigation feature on document libraries in SharePoint 2010.  It provides a great alternative to folders when it comes to navigating your document libraries.  A list administrator can configure Metadata navigation on the document library settings page.  However, I prefer to make changes using CAML or code so that I can deploy them easily to other environments.  Usually, my first choice is with CAML, so I did some digging today and I discovered the trick to deploying your Metadata navigation settings using a SharePoint feature.

When I first started investigating this, I assumed it might be some new element or attribute inside the schema.xml file of the list.  It turns out my assumption was incorrect.  We actually set this by assigning some XML to the client_MOSS_MetadataNavigationSettings property on the root folder of the list.  We can assign this value using code, but you know I prefer to use CAML.   We can use the PropertyBag element to make this happen.  Before we look at the PropertyBag element itself though, let’s look at the underlying XML.  Let’s take my list here with three items selected for Metadata Navigation: a site column named DocumentType, the Content Type of the documents in the library, and the Folders in the library itself.  Here is what the XML will look like.

<MetadataNavigationSettings SchemaVersion="1" IsEnabled="True" AutoIndex="True">

<NavigationHierarchies>

<FolderHierarchy HideFoldersNode="False" />

<MetadataField FieldID="3c6f8f63-0616-437c-80eb-cf7cba0d88cc" FieldType="Choice" CachedName="DocumentType" CachedDisplayName="DocumentType" />

<MetadataField FieldID="03e45e84-1992-4d42-9116-26f756012634" FieldType="ContentTypeId" CachedName="ContentTypeId" CachedDisplayName="Content Type" />

</NavigationHierarchies>

<ManagedIndices>

<ManagedIndex IndexID="3c6f8f63-0616-437c-80eb-cf7cba0d88cc" IndexFieldName="DocumentType" IndexFieldID="3c6f8f63-0616-437c-80eb-cf7cba0d88cc" />

</ManagedIndices>

</MetadataNavigationSettings>

The first line seems to always be the same.  It enables the Metadata Navigation and it will take care of automatically adding new index columns when AutoIndex is set to true.  The NavigationHierarchies section actually defines which fields will be used for Metadata navigation.  If you want to navigate by folders, add a FolderHierarchy element and set HideFoldersNode to false.  If you set it to true, folder navigation will not be present.  The MetadataField element defines which fields to use for navigation.  You need the GUID for each site column to include.  You can get this from your list’s schema.xml file.  You then need to specify the FieldType.  Remember that it only supports Single-value Choice (Choice),  Managed Metadata (TaxonomyFieldType) , and Content Type (ContentTypeId) field types.  You then need to specify the field name in the CachedName field and then you can customize the display name as you see fit with CachedDisplayName.  The last thing to note here is that you have to create a Managed Index for any choice fields you add.  This is why you see a ManagedIndex element with the DocumentType field.  Set the IndexId and IndexFieldId attributes equal to the Id of the field.

At this point, we are ready to assign this XML to the the client_MOSS_MetadataNavigationSettings property.  We need to encode the above XML, because it is being stored inside an attribute of another XML document.  Here is what your elements.xml file would look like.

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

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">

<PropertyBag Url="Shared Documents" ParentType="Folder" RootWebOnly="FALSE" xmlns="http://schemas.microsoft.com/sharepoint/">

<Property Name="client_MOSS_MetadataNavigationSettings" Value="&lt;MetadataNavigationSettings SchemaVersion=&quot;1&quot; IsEnabled=&quot;True&quot; AutoIndex=&quot;True&quot;&gt;&lt;NavigationHierarchies&gt;&lt;FolderHierarchy HideFoldersNode=&quot;True&quot; /&gt;&lt;MetadataField FieldID=&quot;3c6f8f63-0616-437c-80eb-cf7cba0d88cc&quot; FieldType=&quot;Choice&quot; CachedName=&quot;DocumentType&quot; CachedDisplayName=&quot;DocumentType&quot; /&gt; &lt;MetadataField FieldID=&quot;03e45e84-1992-4d42-9116-26f756012634&quot; FieldType=&quot;ContentTypeId&quot; CachedName=&quot;ContentTypeId&quot; CachedDisplayName=&quot;Content Type&quot; /&gt; &lt;/NavigationHierarchies&gt;&lt;ManagedIndices&gt;&lt;ManagedIndex IndexID=&quot;3c6f8f63-0616-437c-80eb-cf7cba0d88cc&quot; IndexFieldName=&quot;DocumentType&quot; IndexFieldID=&quot;3c6f8f63-0616-437c-80eb-cf7cba0d88cc&quot; /&gt;&lt;ManagedIndex IndexID=&quot;d31655d1-1d5b-4511-95a1-7a09e9b75bf2&quot; IndexFieldName=&quot;Editor&quot; IndexFieldID=&quot;d31655d1-1d5b-4511-95a1-7a09e9b75bf2&quot; /&gt;&lt;/ManagedIndices&gt;&lt;/MetadataNavigationSettings&gt;" Type="string" />

</PropertyBag>

</Elements>

It’s kind of hard to read the contents of the Property element, but it is just the encoded version of the XML above.  As for the PropertyBag element, you just specify the relative Url to the document library on your site.  In this case, it’s Shared Documents.  Always set ParentType to Folder and RootWebOnly to false.  At this point, you can activate this feature after you have deployed your document library and it will enable the Metadata navigation.  Here is what the Metadata Navigation settings page looks like.

MetadataNavigationSettings

Here is what my document library looks like with the navigation enabled.

MetadataNavigationExpanded

It’s pretty easy to set this up as you can see.  Keep in mind that if you set this value, it will overwrite any values previously stored.  This includes any Key Filters or Indexes that might already be present on the list.

Speaking of Key Filters, we can add them to the document library using the client_MOSS_MetadataNavigationSettings as well.  Let’s look at some more XML.  In this case, I am adding key filters for DocumentType, All Tags, and Modified By (editor).

<MetadataNavigationSettings SchemaVersion="1" IsEnabled="True" AutoIndex="True">

<KeyFilters>

<MetadataField FieldID="3c6f8f63-0616-437c-80eb-cf7cba0d88cc" FieldType="Choice" CachedName="DocumentType" CachedDisplayName="DocumentType" />

<MetadataField FieldID="23f27201-bee3-471e-b2e7-b64fd8b7ca38" FieldType="TaxonomyFieldTypeMulti" CachedName="TaxKeyword" CachedDisplayName="All Tags" />

<MetadataField FieldID="d31655d1-1d5b-4511-95a1-7a09e9b75bf2" FieldType="User" CachedName="Editor" CachedDisplayName="Modified By" />

</KeyFilters>

<ManagedIndices>

<ManagedIndex IndexID="d31655d1-1d5b-4511-95a1-7a09e9b75bf2" IndexFieldName="Editor" IndexFieldID="d31655d1-1d5b-4511-95a1-7a09e9b75bf2" />

</ManagedIndices>

</MetadataNavigationSettings>

The elements are pretty similar to that of the NavigationHierarchies element.  You add one MetadataField element for each field you want with the same attributes as before.  However, a few more fields types are supported such as Person or Group (User).  It also recognizes Enterprise Keywords through the use of the All Tags (TaxonomyFieldMulti) filter.  You can also do Date and Time fields as well as Number fields too.  I also added the ManagedIndex field for Editor (the Modified By filter).  You can probably leave the indexes out since AutoIndex is true, but if you run into issues, you can add them manually as you see above.  You can deploy KeyFilters and NavigationHierarchies elements at the same time.  You’ll need to encode the XML again just as you did before.  When you activate the feature, you’ll have Key Filters enabled on your document library.

MetadataKeyFilters

Using the PropertyBag element, you can easily add metadata navigation to your document libraries.  This is a great alternative to defining these settings using code.

Read the original blog entry...

More Stories By Corey Roth

Corey Roth, a SharePoint Server MVP, is a consultant at Hitachi Consulting specializing in SharePoint and Office 365 for clients in the energy sector. He has more than ten years of experience delivering solutions in the energy, travel, advertising and consumer electronics verticals.

Corey specializes in delivering ECM and search solutions to clients using SharePoint. Corey has always focused on rapid adoption of new Microsoft technologies including Visual Studio 2013, Office 365, and SharePoint.

He is a member of the .NET Mafia (www.dotnetmafia.com) where he blogs about the latest technology and SharePoint. He is dedicated to the community and speaks regularly at user groups and SharePoint Saturdays.

@ThingsExpo Stories
SYS-CON Events announced today that CAST Software will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 - Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. CAST was founded more than 25 years ago to make the invisible visible. Built around the idea that even the best analytics on the market still leave blind spots for technical teams looking to deliver better software and prevent outages, CAST provides the software intelligence that matter ...
SYS-CON Events announced today that Daiya Industry will exhibit at the Japanese Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Ruby Development Inc. builds new services in short period of time and provides a continuous support of those services based on Ruby on Rails. For more information, please visit https://github.com/RubyDevInc.
As businesses evolve, they need technology that is simple to help them succeed today and flexible enough to help them build for tomorrow. Chrome is fit for the workplace of the future — providing a secure, consistent user experience across a range of devices that can be used anywhere. In her session at 21st Cloud Expo, Vidya Nagarajan, a Senior Product Manager at Google, will take a look at various options as to how ChromeOS can be leveraged to interact with people on the devices, and formats th...
SYS-CON Events announced today that Yuasa System will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Yuasa System is introducing a multi-purpose endurance testing system for flexible displays, OLED devices, flexible substrates, flat cables, and films in smartphones, wearables, automobiles, and healthcare.
SYS-CON Events announced today that Taica will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Taica manufacturers Alpha-GEL brand silicone components and materials, which maintain outstanding performance over a wide temperature range -40C to +200C. For more information, visit http://www.taica.co.jp/english/.
Enterprises have taken advantage of IoT to achieve important revenue and cost advantages. What is less apparent is how incumbent enterprises operating at scale have, following success with IoT, built analytic, operations management and software development capabilities – ranging from autonomous vehicles to manageable robotics installations. They have embraced these capabilities as if they were Silicon Valley startups. As a result, many firms employ new business models that place enormous impor...
SYS-CON Events announced today that SourceForge has been named “Media Sponsor” of SYS-CON's 21st International Cloud Expo, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. SourceForge is the largest, most trusted destination for Open Source Software development, collaboration, discovery and download on the web serving over 32 million viewers, 150 million downloads and over 460,000 active development projects each and every month.
SYS-CON Events announced today that Dasher Technologies will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 - Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Dasher Technologies, Inc. ® is a premier IT solution provider that delivers expert technical resources along with trusted account executives to architect and deliver complete IT solutions and services to help our clients execute their goals, plans and objectives. Since 1999, we'v...
As popularity of the smart home is growing and continues to go mainstream, technological factors play a greater role. The IoT protocol houses the interoperability battery consumption, security, and configuration of a smart home device, and it can be difficult for companies to choose the right kind for their product. For both DIY and professionally installed smart homes, developers need to consider each of these elements for their product to be successful in the market and current smart homes.
SYS-CON Events announced today that MIRAI Inc. will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. MIRAI Inc. are IT consultants from the public sector whose mission is to solve social issues by technology and innovation and to create a meaningful future for people.
SYS-CON Events announced today that Massive Networks, that helps your business operate seamlessly with fast, reliable, and secure internet and network solutions, has been named "Exhibitor" of SYS-CON's 21st International Cloud Expo ®, which will take place on Oct 31 - Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. As a premier telecommunications provider, Massive Networks is headquartered out of Louisville, Colorado. With years of experience under their belt, their team of...
SYS-CON Events announced today that TidalScale, a leading provider of systems and services, will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 - Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. TidalScale has been involved in shaping the computing landscape. They've designed, developed and deployed some of the most important and successful systems and services in the history of the computing industry - internet, Ethernet, operating s...
Widespread fragmentation is stalling the growth of the IIoT and making it difficult for partners to work together. The number of software platforms, apps, hardware and connectivity standards is creating paralysis among businesses that are afraid of being locked into a solution. EdgeX Foundry is unifying the community around a common IoT edge framework and an ecosystem of interoperable components.
Coca-Cola’s Google powered digital signage system lays the groundwork for a more valuable connection between Coke and its customers. Digital signs pair software with high-resolution displays so that a message can be changed instantly based on what the operator wants to communicate or sell. In their Day 3 Keynote at 21st Cloud Expo, Greg Chambers, Global Group Director, Digital Innovation, Coca-Cola, and Vidya Nagarajan, a Senior Product Manager at Google, will discuss how from store operations...
In a recent survey, Sumo Logic surveyed 1,500 customers who employ cloud services such as Amazon Web Services (AWS), Microsoft Azure, and Google Cloud Platform (GCP). According to the survey, a quarter of the respondents have already deployed Docker containers and nearly as many (23 percent) are employing the AWS Lambda serverless computing framework. It’s clear: serverless is here to stay. The adoption does come with some needed changes, within both application development and operations. Tha...
SYS-CON Events announced today that IBM has been named “Diamond Sponsor” of SYS-CON's 21st Cloud Expo, which will take place on October 31 through November 2nd 2017 at the Santa Clara Convention Center in Santa Clara, California.
In his Opening Keynote at 21st Cloud Expo, John Considine, General Manager of IBM Cloud Infrastructure, will lead you through the exciting evolution of the cloud. He'll look at this major disruption from the perspective of technology, business models, and what this means for enterprises of all sizes. John Considine is General Manager of Cloud Infrastructure Services at IBM. In that role he is responsible for leading IBM’s public cloud infrastructure including strategy, development, and offering ...
Infoblox delivers Actionable Network Intelligence to enterprise, government, and service provider customers around the world. They are the industry leader in DNS, DHCP, and IP address management, the category known as DDI. We empower thousands of organizations to control and secure their networks from the core-enabling them to increase efficiency and visibility, improve customer service, and meet compliance requirements.
Join IBM November 1 at 21st Cloud Expo at the Santa Clara Convention Center in Santa Clara, CA, and learn how IBM Watson can bring cognitive services and AI to intelligent, unmanned systems. Cognitive analysis impacts today’s systems with unparalleled ability that were previously available only to manned, back-end operations. Thanks to cloud processing, IBM Watson can bring cognitive services and AI to intelligent, unmanned systems. Imagine a robot vacuum that becomes your personal assistant tha...
With major technology companies and startups seriously embracing Cloud strategies, now is the perfect time to attend 21st Cloud Expo October 31 - November 2, 2017, at the Santa Clara Convention Center, CA, and June 12-14, 2018, at the Javits Center in New York City, NY, and learn what is going on, contribute to the discussions, and ensure that your enterprise is on the right path to Digital Transformation.