Tuesday, June 18, 2013

Highs, lows & random rants on SharePoint 2013

Here’s the presentation Harald Fianbakken and I gave at the Norwegian SharePoint Community meeting June 17th, 2013.

Basically a talk where we ranted on our experiences with 2013, highlighting the issues we ran into, and what we really love.

Here’s a small narrative per slide to give it all some more context.

Slide 6-8: The quality management system is an external system which stores it’s data as static HTML files. Along these files are corresponding image files when the artifact is a process diagram. The files are imported with a custom application which parses the <meta> tags of the HTML files, and stores the parsed data as publishing pages with custom columns to hold the metadata inside of SharePoint. The page library have several content types, and the right one is chosen on import depending on the parsed data. The images are stored in an image library.

The HTML files also contains image maps, which we parse and store the coordinates in order to re-create the navigation experience later inside of SharePoint.

Some of the metadata are stored as Managed Metadata, and a taxonomy is built upon import.

Slide 9: We auto-generate Content Types and lists based on reflection on annotated Poco’s. The poco’s are annotated using http://nuget.org/packages/Fianbakken.SharePointations/. Puzzlepart also has a framework which allows the use of Linq queries on the CT’s/Lists, instead of using CAML. Sort of like SP Metal, but you start with the poco, not the other way around.

Slide 11-13: The solution has a part which is an “Improvement Potential” log. When someone reports an improvement a workflow is started. We encountered multiple issues when developing this, mainly on the test server. The root cause was most of the time missing user profiles and missing e-mail addresses.

Slide 14: There is a bug in Workflows as of now which comes into play if you add custom task outcomes to the task form. Meaning, you want more than just Approve/Reject. If you add more, then the outcome is always “Approve”. You can however retrieve the real value in your workflow, and then act on it as a workaround. This took us one week to figure out (see the blogs referenced at the end slide for more info).

Slide 15: If you don’t click “Publish” before exporting a workflow you will get an error upon feature activation. Also, you have to retract/redploy your workflow if you re-export as the WSP’s get new id’s. This is an issue if you develop the workflow on one server and want to move it to another.

Slide 18-19: Excel rest is a good way to get graphs/named entities from within Excel files without having an Enterprise license.

Slide 20-21: See http://techmikael.blogspot.se/2013/04/how-to-enable-page-previews-in.html for more information.

Slide 23-24: By using the SP2013 social api, we can follow or bookmark publishing pages in SharePoint, allowing users to have favorites.

Slide 26-34: We use custom display templates, result sources, query rules and display blocks in order to create a sort of 360-view for processes. Searching for a process will show related improvements and related documents to a specific process.

The issues we encountered where related to pulling back managed properties for certain content types, and getting the display templates to trigger correctly. It’s all a bit buggy at the moment, but I’ve been told there are fixes coming in later CU’s.

What seems to work the best is to create managed properties on the SSA, stay away from the auto-generated ones, and have one result block per query rule, even though the rules are the same.

Slide 36-40: By using custom properties on terms, we created a configuration option for display forms. The taxonomy states which fields should be shown in our dynamic form based on values you choose, and which fields should show in new/edit mode. Basically we used the terms store as a way to configure an input form. The other choice would have been to create multiple forms to cover all scenarios. But the requirements kept changing, and this gave us flexibility and ease of configuration.

Slide 42-45: Be sure to keep people who know HTML and know SharePoint HTML at hand when implementing a custom design. It saves time!

Thursday, June 6, 2013

Add a “Clear Filters” link to your search page in SharePoint 2013

Using refiners or filters on a search page is an easy way to narrow down on the content you are looking for. If you need to start from scratch you can just click the search button again, but this may not be the best UI.

I’ve worked on many projects where they also want a “Clear filters” link.

As all calls on the 2013 search page is done using AJAX, the real query is added to the hash part of the url, the part coming after the # character. If you want to clear all filters and the search terms, then you can add what designers call a dummy link with a # to the page, and that will reset your query.

<a href=”#”>Clear filters</a>

A simple solution it so add a Content Editor Web Part above the refiner panel with the above markup.
image

Tuesday, June 4, 2013

Meticulous workaround for getting Cisco AnyConnect to work with Windows 8

At times I need to use Cisco AnyConnect VPN to get into remote systems, but unfortunately AnyConnect does not work very will with Windows 8. My first solution was to install Windows XP as a virtual machine to get a lightweight solution.

Windows XP with AnyConnect works just fine and I can browse from within my VM.

My next issue was that I wanted to use SharePoint Designer 2013. This cannot be installed on Windows XP. You need Windows 7 or newer. Bummer :(

Instead of installing a Win7 VM I went for this solution.

  1. VMWare machine running Windows XP with freeSSHd installed
  2. Connect to remote system from XP using AnyConnect
  3. On native client (Windows 8) use putty to ssh into the VM with a socks proxy on port 8080
  4. Configure IE to use 127.0.0.1:8080 as a socks proxy
  5. Use SharePoint designer in my native Windows 8 which will use IE proxy settings

Communication goes like this:

SharePoint Designer (native) –> ssh proxy to XP (native) –> Cisco Any Connect (in VM) –>Virtual network adapter back via host machine –> Remote system

Cumbersome but it works.. and maybe, just maybe AnyConnect will work perfect on Windows 8 one day.

Monday, June 3, 2013

Enabling PDF previews in your libraries

[Edit: I totally missed http://www.wictorwilen.se/sharepoint-2013-enabling-pdf-previews-in-document-libraries-with-office-web-apps-2013, so this post is almost a dupe - sorry about that]

You installed the March CU for Office Web Apps 2013 (WAC) which supports rendering PDF files, and followed Wictor WilĂ©n’s post on how to enable PDF previews for your search results (and perhaps his post on installing the CU as well).

Then you read the comments and saw that others like yourself want to get these PDF previews for document libraries and not only on the search result page.
Want to know how? Read on!
Enabling PDF preview in a SharePoint Library

Sunday, June 2, 2013

How to: Change the default sort of a Search Result Web Part

When using the Content Search web part you can modify the query in the query builder. By default it lists recently changed items but often you want to change the query using advanced mode.

image

When clicking advanced mode, the default sorting is set to Rank, and you can click the sorting tab, choose LastModifiedTime in descending order, and you end up with the latest items with the filter you decide to add.

So far so good. Say you have either developed display templates for your search page, or want to do content by search in Office 365, and you want to use the Search Results web part instead which features more or less the same capabilities as the Content Search web part.

The procedure is almost similar. Drop a Content Search web part on the page and enter the query builder. In my case I want to limit the results based on one document library in particular and will use the query. I remove the {searchboxquery} token and enter:

(contentclass:STS_ListItem OR IsDocument:True) path:http://intranet.contoso.com/Documents

Further clicking “Test query” lists all results sorted by rank. I click the sorting tab, choose LastModifiedTime and the test results show as expected, sorted by the newest items on top.

image

Next I click ok, and save the web part settings, save the page, and…… the results are still sorted by rank!!

There is however a workaround. Instead of changing the sorting using the query builder, you have to change the UI sorting options for the web part.

When editing the web part, expand the Settings section. Check the “Show sort dropdown” option and replace the content with only one value, the one sorting my newest items on top. After you have modified the JSON value, click “Apply” to save the web part changes. Next uncheck the option again, and save the web part changes. The sorting now sticks, but you’re not showing the sort dropdown.

imageimage

Don’t know if this is a bug or by intention, but is sure bugged me for a couple of hours.

Sunday, May 5, 2013

My slides from SharePoint Saturday Belgium

Here's my slides from my session "Enrich People Search with OData in SharePoint 2013 and search as a governance tool" held at SharePoint Saturday in Brussels, April 27th, 2013.

The session is sort of dev oriented, but not really :)



Thursday, May 2, 2013

Viewing Excel files larger than 10mb using Office Web Apps in SharePoint 2013

I’m currently working on some code using the Excel REST API against in SharePoint 2013. If you’re not familiar with it the endpoint can be found at http://server/_vti_bin/ExcelRest.aspx.

If you try to browse the model of a spread sheet you will hit the same limits as file preview does. You cannot preview a spread sheet larger than 10mb. The question is, how do you change this?

Both http://office.microsoft.com/en-us/excel-help/data-model-specification-and-limits-HA102837464.aspx and http://office.microsoft.com/en-us/excel-help/redir/XT103458353.aspx talk about setting this via the Excel Services in Central Admin. But this is not how to do it. You can perfectly well use the REST API and preview files using OWA without Excel Services installed. You do it on the OWA server using PowerShell. If you want to increase from 10mb to 50mb issue the command below followed by iisreset and you’re good to go!

Set-OfficeWebAppsFarm -ExcelWorkbookSizeMax 50

Monday, April 29, 2013

Taxonomy Filter Web Part for SharePoint

I just published my codeplex project for a taxonomy filter web part. The web part works on XsltListView’s and provide a hierarchical term picker to filter against taxonomy columns.

It’s currently a farm solution for SharePoint 2010, but a version for 2013 (with 365 support) is in the plans. The project can be found at: https://sptax.codeplex.com/

Hope it’s useful!

Monday, April 22, 2013

Limiting search results in SharePoint 2013 (aka scopes in 2010)

A typical scenario in SharePoint is to limit the results on a search page to specific content. In SharePoint 2010 this was achieved by creating Search Scopes, and then adding include and exclude rules to the scope. Then you could configure the Core Results Web Part to display results from that scope only.

SharePoint 2013 however introduces the concept of Result Sources instead of scopes. As a sample I will limit results to show items from one particular site.

You can create Result Sources on three different levels: Search Service Application, Site collection and Site. This means you can define Result Sources in a very granular way, depending on where you want to use them. But bear in mind that having configurations spread all across your sites increases complexity of maintenance. In this sample I will create my Result Source at the SSA level.

Thursday, April 18, 2013

Rank models in 2013–Main differences from 2010

Disclaimer: I’m by no means a math expert and my statements below might not be 100% accurate, but I try my best. Also, be careful when tuning the rank profile as changing numbers can have a big effect on your ranking.

With the new FAST search core, ranking has changed quite a lot from 2010. Newly published content on MSDN explains a bit more how rank is calculated and how you can change it.
As the O14 rank model is available in SharePoint 2013 (O15), I will try to outline some of the major differences you can expect to see regarding how results are ranked/sorted by default.
You can pull out the rank model xml yourself from both models using PowerShell.

$ssa = Get-SPEnterpriseSearchServiceApplication
$owner = Get-SPenterpriseSearchOwner -Level ssa

$o15 = Get-SPEnterpriseSearchRankingModel -SearchApplication $ssa -Owner $owner -Identity 8f6fd0bc-06f9-43cf-bbab-08c377e083f4
$o15.RankingModelXML > o15.xml

$o14 = Get-SPEnterpriseSearchRankingModel -SearchApplication $ssa -Owner $owner -Identity 9399df62-f089-4033-bdc5-a7ea22936e8e
$o14.RankingModelXML > o14.xml

Then it’s all a matter of comparing the models.