Welcome!

Microsoft Cloud Authors: David H Deans, Yeshim Deniz, Janakiram MSV, 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 DXWorldExpo has been named “Global 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. Digital Transformation is the key issue driving the global enterprise IT business. Digital Transformation is most prominent among Global 2000 enterprises and government institutions.
21st International Cloud Expo, taking place October 31 - November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA, will feature technical sessions from a rock star conference faculty and the leading industry players in the world. Cloud computing is now being embraced by a majority of enterprises of all sizes. Yesterday's debate about public vs. private has transformed into the reality of hybrid cloud: a recent survey shows that 74% of enterprises have a hybrid cloud strategy. Me...
SYS-CON Events announced today that Secure Channels, a cybersecurity firm, 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. Secure Channels, Inc. offers several products and solutions to its many clients, helping them protect critical data from being compromised and access to computer networks from the unauthorized. The company develops comprehensive data encryption security strategie...
In his session at @ThingsExpo, Sudarshan Krishnamurthi, a Senior Manager, Business Strategy, at Cisco Systems, discussed how IT and operational technology (OT) work together, as opposed to being in separate siloes as once was traditional. Attendees learned how to fully leverage the power of IoT in their organization by bringing the two sides together and bridging the communication gap. He also looked at what good leadership must entail in order to accomplish this, and how IT managers can be the ...
Recently, WebRTC has a lot of eyes from market. The use cases of WebRTC are expanding - video chat, online education, online health care etc. Not only for human-to-human communication, but also IoT use cases such as machine to human use cases can be seen recently. One of the typical use-case is remote camera monitoring. With WebRTC, people can have interoperability and flexibility for deploying monitoring service. However, the benefit of WebRTC for IoT is not only its convenience and interopera...
There is only one world-class Cloud event on earth, and that is Cloud Expo – which returns to Silicon Valley for the 21st Cloud Expo at the Santa Clara Convention Center, October 31 - November 2, 2017. Every Global 2000 enterprise in the world is now integrating cloud computing in some form into its IT development and operations. Midsize and small businesses are also migrating to the cloud in increasing numbers. Companies are each developing their unique mix of cloud technologies and service...
When shopping for a new data processing platform for IoT solutions, many development teams want to be able to test-drive options before making a choice. Yet when evaluating an IoT solution, it’s simply not feasible to do so at scale with physical devices. Building a sensor simulator is the next best choice; however, generating a realistic simulation at very high TPS with ease of configurability is a formidable challenge. When dealing with multiple application or transport protocols, you would be...
SYS-CON Events announced today that App2Cloud 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. App2Cloud is an online Platform, specializing in migrating legacy applications to any Cloud Providers (AWS, Azure, Google Cloud).
IoT is at the core or many Digital Transformation initiatives with the goal of re-inventing a company's business model. We all agree that collecting relevant IoT data will result in massive amounts of data needing to be stored. However, with the rapid development of IoT devices and ongoing business model transformation, we are not able to predict the volume and growth of IoT data. And with the lack of IoT history, traditional methods of IT and infrastructure planning based on the past do not app...
To get the most out of their data, successful companies are not focusing on queries and data lakes, they are actively integrating analytics into their operations with a data-first application development approach. Real-time adjustments to improve revenues, reduce costs, or mitigate risk rely on applications that minimize latency on a variety of data sources. Jack Norris reviews best practices to show how companies develop, deploy, and dynamically update these applications and how this data-first...
Intelligent Automation is now one of the key business imperatives for CIOs and CISOs impacting all areas of business today. In his session at 21st Cloud Expo, Brian Boeggeman, VP Alliances & Partnerships at Ayehu, will talk about how business value is created and delivered through intelligent automation to today’s enterprises. The open ecosystem platform approach toward Intelligent Automation that Ayehu delivers to the market is core to enabling the creation of the self-driving enterprise.
Internet-of-Things discussions can end up either going down the consumer gadget rabbit hole or focused on the sort of data logging that industrial manufacturers have been doing forever. However, in fact, companies today are already using IoT data both to optimize their operational technology and to improve the experience of customer interactions in novel ways. In his session at @ThingsExpo, Gordon Haff, Red Hat Technology Evangelist, shared examples from a wide range of industries – including en...
Consumers increasingly expect their electronic "things" to be connected to smart phones, tablets and the Internet. When that thing happens to be a medical device, the risks and benefits of connectivity must be carefully weighed. Once the decision is made that connecting the device is beneficial, medical device manufacturers must design their products to maintain patient safety and prevent compromised personal health information in the face of cybersecurity threats. In his session at @ThingsExpo...
"We're a cybersecurity firm that specializes in engineering security solutions both at the software and hardware level. Security cannot be an after-the-fact afterthought, which is what it's become," stated Richard Blech, Chief Executive Officer at Secure Channels, in this SYS-CON.tv interview at @ThingsExpo, held November 1-3, 2016, at the Santa Clara Convention Center in Santa Clara, CA.
SYS-CON Events announced today that Massive Networks 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. Massive Networks mission is simple. To help your business operate seamlessly with fast, reliable, and secure internet and network solutions. Improve your customer's experience with outstanding connections to your cloud.
SYS-CON Events announced today that Grape Up 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. Grape Up is a software company specializing in cloud native application development and professional services related to Cloud Foundry PaaS. With five expert teams that operate in various sectors of the market across the U.S. and Europe, Grape Up works with a variety of customers from emergi...
Detecting internal user threats in the Big Data eco-system is challenging and cumbersome. Many organizations monitor internal usage of the Big Data eco-system using a set of alerts. This is not a scalable process given the increase in the number of alerts with the accelerating growth in data volume and user base. Organizations are increasingly leveraging machine learning to monitor only those data elements that are sensitive and critical, autonomously establish monitoring policies, and to detect...
Everything run by electricity will eventually be connected to the Internet. Get ahead of the Internet of Things revolution and join Akvelon expert and IoT industry leader, Sergey Grebnov, in his session at @ThingsExpo, for an educational dive into the world of managing your home, workplace and all the devices they contain with the power of machine-based AI and intelligent Bot services for a completely streamlined experience.
Because IoT devices are deployed in mission-critical environments more than ever before, it’s increasingly imperative they be truly smart. IoT sensors simply stockpiling data isn’t useful. IoT must be artificially and naturally intelligent in order to provide more value In his session at @ThingsExpo, John Crupi, Vice President and Engineering System Architect at Greenwave Systems, will discuss how IoT artificial intelligence (AI) can be carried out via edge analytics and machine learning techn...
When shopping for a new data processing platform for IoT solutions, many development teams want to be able to test-drive options before making a choice. Yet when evaluating an IoT solution, it’s simply not feasible to do so at scale with physical devices. Building a sensor simulator is the next best choice; however, generating a realistic simulation at very high TPS with ease of configurability is a formidable challenge. When dealing with multiple application or transport protocols, you would be...