Document Parser

​I had a colleague of mine come to me and ask me about a problem he had creating a new list based on a custom list template he created. He found some articles explaining what seemed the be a bug with SharePoint at first, which is preventing you from using custom list templates on Record Center sites. Basically, the custom list template was getting created properly, but the template never appeared in the create new list interface. On top of this, the Feature Id and Product Version fields were never being populated for the custom list templates created. See figure 1.

parserscreen1.jpg

Figure 1 – List Template catalog missing Product Version and Feature ID values

Another colleague of mine, stumbled upon an article that suggested a possible fix for this issue. The fix consisted in setting the ParserEnabled property to true on the actual web. Guess what? This works! But why is this property turned off by default on record center sites? For several reasons actually.

First let us take a look at what this parserenabled ​really does. SharePoint has an internal mechanism called the Document Parser that is responsible for keeping the metadata of actual documents in sync with the values associated with it in SharePoint. When you create a physical document on disk, there are some metadata properties associated with it. When you upload that same document to SharePoint, the application triggers a process that automatically synchronizes the fields of the SharePoint list item associated with your document with the ones from the document. When you disable this trigger by setting the ParserEnabled​ property to false on the site, your breaking any synchronization that exists between SharePoint and the local document. Why would anyone want to disable this feature you ask? Because in some scenarios, like in the case of a Record Center, you want to store a large amount of documents. Imagine what the performance impact would be on the farm if you were transferring ten million documents in SharePoint at once. Di​sabling the trigger improves performance in cases where you have large amount of documents. This is something to consider when designing your environments. One excellent option would be to create a custom event receiver and associated it only with the few libraries on your site that requires the parser to be enabled.

SharePoint 2013 Search Capacity Planner

So you want to build a SharePoint 2013 Search environment and you’re having a hard time figuring out what servers you’ll need to build you farm? Well I’ve got just the thing you need. Based off Microsoft’s Technet article about capacity planning for SharePoint 2013 Search comes the Search Capacity Planner app! This is a custom SharePoint-Hosted app I built, and that lets you figure out details about what is the recommended architecture for your search farm based on the number of items you are trying to index. Not only does it automatically tells you how many servers you need, but it tells you what there role should be, what their specifications are, and it estimates the time taken for a Full crawl to complete. I will be submitting the app for free in the coming week, so that you can all deploy it in your organizations. All I have to say is enjoy!

 

 

SCPA.png

Adding a Custom List Template Large Icon in SharePoint 2010

In SharePoint 2010, the default interface to create a new artefact (custom list, document library, web, etc.) is built in Silverlight. If you ever build a custom solution that requires you to include a custom list template, you’ll probably want to associate a custom icon to it so that users can quickly identify your new artefact. However simply adding a reference to your image in the Image property of the Elements.xml file associated with your custom list template is not going to be enough for it to work, in most cases 🙂

Assume we’re building a new SharePoint 2010 solution that contains a custom list template. The image we want to see appear to represent this list template in the Silverlight interface is contained within the solution and will be deployed at /_layouts/images/NikBlogDemo/Icon.gif. The figure below shows the image contained within our solution in Visual Studio 2013.

Screen1.gif

Figure 1 – Icon files in our SharePoint Solution in Visual Studio 2013

Now, let’s create our new list template element, and name it NikDemoTemplate. Once the template has been created, we’ll go and delete the list instance object that got created automatically, so that all we have left is the Elements.xml and Schema.xml files associated with our list template.

Screen2.gif

Figure 2- List template files in Visual Studio 2013

The Elements.xml file is where the money is. If you open up the file, you should see that the last attribute of the ListTemplate node is called Image, and that it points to/_layouts/images/itgen.png by default.

Screen3.gif

Ffigure 3 – Default list template’s Element.Xml file’s content

​Let us replace this value by the location of our custom icon file (/_layouts/images/NikBlogDemo/Icon.gif). Deploy the solution and go take a look at the Silverlight interface to see if our icon got applied. Here’s what our Icon.gif files looks like.

Icon.gif

Figure 4 – Icon we’re trying to add

​Here’s what the Silverlight interface shows after deploying our solution:

Screen4.gif

Figure 5 – Silverlight interface not showing our custom icon

Not quite the same icon right? So what’s wrong? Two things are wrong. The first one being that the Silverlight interface only understands .png icons, but that’s not the only thing. It also expects your file’s name to respect a specific naming convention. If you look at figure 3 above, you can see that the default image was named starting with “it“. In the SharePoint world, there are two types of icon, small 16×16 icons prefixed it, and large 64×64 icons prefixed lt. In our case, the latter is what we want. For you icon to work, simply rename your file to lticon, and change its extension to .png​.

Screen6.gif

Figure 6 – New LTIcon.png file in our Sharepoint solution in Visual Studio 2013
Go ahead, modify your Elements.xml file to point to our new icon file, and deploy the solution. If you now launch the Silverlight interface, you’ll see that your custom icon is now shown to represent your custom list template!

Screen7.gif

Figure 7 – Custom list template icon shown in the SharePoint 2010 Silverlight interface
To summarize, in order for a custom icon to appear in the large tile Silverlight interface that allows you to create new lists in SharePoint 2010, you need to specify an icon that has a .png extension, and that has a name that starts with “lt”. Simply having one or the other is not going to work, you need a combination of both.

File Name ​Display Correctly
Icon.gif​ Cross.png
​LTIcon.gif Cross.png
​Icon.png Cross.png
​LTIcon.png Ok-icon.png
​Icon.jpg Cross.png
​LTIcon.jpg ​​Ok-icon.png

Find App Info using PowerShell

I’ve been playing a lot with PowerShell and SharePoint 2013 lately, and by a lot, I mean A LOT! One of the new additions with SharePoint 2013, is the set of new cmdlets that allow Sharepoint administrators to manage how apps are deployed in their environment. ​the new App model in Sharepoint 2013 is great, but it can easily create chaos if apps are not properly managed. One of the big problem I foresee for any organization that gets in the business of heavy customization using apps is the fact that there are no ways for them to easily identify what sites have a specific app installed on, and to determine what version of the app is installed on them. Remember that with SharePoint 2013, you can have various versions of the same apps running in different sites.

For all of you out there that are desperate to find a solution to the scenario describe above, fear not! I have written a nice litle PowerShell script that will allow you to quickly identify on what site an app is installed, and what version of it is installed.

Add-PsSnapin Microsoft.SharePoint.PowerShell

$appTitle = Read-Host “What is your App’s title?”

$rootUrl = Read-Host “What is your Web Application’s Root Url?”

$webApp = Get-SPWebApplication $rootUrl

foreach($site in $webApp.Sites)

{

    foreach($web in $site.AllWebs)

{

        $appInstance = Get-SPAppInstance -Web $web.Url | Where{$_.Title -eq $appTitle}

 

        if($appInstance -ne $null)

{

            Write-Host $web.Url -BackgroundColor Green

            Write-Host $appInstance.App.VersionString -BackgroundColor Cyan

        }

    }

}

 

Here’s the resultof running this script in my test environment, on a custom app named NikBlogDemo for which I have different versions deployed throughout my demo site.

GetAppInfo.png

Government of Canada Master Page for SharePoint 2013

As part of my day to day job, I am responsible for maintaining my organization’s Internet SharePoint 2010 publishing environment.​ The Government of Canada has a standard template that each departments need to follow and implement on their sites, so that each site will look the same. There is a central group in the government, called the Web Experience Toolkit Team (a.k.a. WET team) that is responsible for providing prebuilt modules that have been tested against the accessibility standards of the Government of Canada. As a SharePoint Developer, my job in the past has been to convert the HTML template provided by that team into a flexible SharePoint 2010 master page. In an effort to update my master page to the 2013 version of the WET template, I have created a new section in our existing GitHub project and added the alpha version of the 2013 Master Page.

My solution consists of two files, a SharePoint 2013 HTML master page, and a wsp sandboxed solution. The sandbox solution, once activated, deploys all the resources provided by the WET team (css, js, images) into the style library. I strongly encourage you to try it out and to provide me with your comments. Afterall, it’s a community effort!

https://github.com/wet-boew/wet-boew-sharepoint/tree/master/Themes/GCWU%20-%20SharePoint%202013

wet.png