Mar 22

HTML5 Presentation at Mavention

One of the exams regarding to SharePoint 2013 development is 70-480 Programming in HTML5 with JavaScript and CSS3. Awhile ago I passed this exam. Since SharePoint is our core business at Mavention we have started a series of presentations about HTML5 to prepare our employees for this exam.

These presentations are split up in the following topics:

  • HTML5 Semantics
  • CSS3
  • JavaScript and jQuery

Last night it was up to me to start with HTML5 Semantics. My colleague Paul Boelens did a session about CSS. Next time it’s all about JavaScript and jQuery.

Kennisavond (taken by Bert Verzijl)

 

Download HTML5 Semantics slidedeck

Jan 11

SQL Server memory settings explained

SQL Server is the heart of SharePoint. When it stops, SharePoint dies. Therefore, it is important for you as a SharePoint (Technical) Consultant to know how to install and configure SQL Server for SharePoint. Recently I have experienced a moment of Oops at a customer where they have SharePoint and too little knowledge how to set up and maintain a good environment.

That morning I was busy testing a migration. I was using a backup file to restore it in another farm. This backup file was 100Gb and I copied the file first over to the other SQL Server. Well, half way during the copy process I heard people making lots of noise in there offices and the phone started to ring often. “SharePoint isn’t working anymore!” they said. I started my own investigation. And yes, no response. Logging on to the SQL Server took ages and the ULS showed me lots of “Could not connect to SQL”. When the copy process was completed, SharePoint came back online. Oops…

Cause

I logged on the SQL Server and checked its settings. The server is that SQL Server is running on has 16Gb of memory and I noticed the memory settings for SQL Server:

SQL Server Memory Settings

I found the cause. Let me explain.

We have 16 Gb. We don’t want SQL Server to consume all of it, because Windows needs to breath as well. Therefore we set the maximum server memory to a few Gb less. In our case the SQL Server was set to 14000 Mb (approximately 14Gb). This leaves about 2Gb for Windows to continue operating. But what about the Minimum server memory? Many people believe that the minimum server memory setting tells SQL Server how much memory it should use when SQL first starts up, however this is not the case. If Windows needs to reclaim memory from SQL Server, it will request that SQL Server release memory from its control. SQL Server will return the memory back to the Operating System until the amount of memory in use reaches the minimum server setting!

My copy action apparently required Windows to claim memory from SQL Server and SQL Server released it all because the Minimum server memory was set to 0 (which is the default value, by the way). SQL Server could not breath anymore and SharePoint died.

I have checked the other SQL Server as well and sadly enough it had the same settings. I have notified Support that they should change the Minimum server memory setting.

More info:

http://technet.microsoft.com/en-us/library/ms180797(v=sql.105).aspx

http://technet.microsoft.com/en-us/library/hh292622(v=office.14).aspx

Nov 23

SharePoint 2013 Search – Continuous Crawling

One gorgeous gem of SharePoint 2013 is Continuous Crawling. Together with the Content by Search web part you can build awesome search-driven solutions. How does Continuous Crawling work? First, let’s take a moment and walk  down memory lane…

SharePoint 2010

In SharePoint 2010 we have Full Crawls and Incremental Crawls. Both crawls you can schedule and especially the Incremental Crawl is scheduled often. With Incremental Crawl all content changed since last crawl is retrieved and indexed. But the results may not be what you might expect: the index is not as accurate as you hoped to be. Imagine this situation:

You have scheduled to perform an Incremental Crawl every 15 minutes.

Incremental Crawl Schedule

In the first schedule (A) the crawler retrieves a content set and can handle that set within 15 minutes. No problem here. The next schedule (B) is executed and this time the crawler retrieves a bigger content set, but now it cannot be handled within 15 minutes, but it takes 20 minutes. Now a problem arises. Because only one crawler at a time can be executed, the third schedule will be killed immediately. We have to wait for the next window that the schedule takes place. This will be (C) at 45 minutes. So, in this case we had 30 minutes between 2 Incremental Crawls instead of the scheduled 15 minutes. So, the bigger the content set to handle by the crawler to more risk there is to miss scheduled crawling windows. This results in a lesser up to date search index.

SharePoint 2013

Now Continuous Crawling comes to the rescue. With Continuous crawling you don’t have to schedule anymore. Crawlers are running in parallel and the crawler gets changes from the SharePoint sites every 15 minutes. This is the default setting and it can be changed using PowerShell. So, when a crawl is executed and finished, it continues to crawl immediately in spite of the length. In our previous situation when a crawl is taking more then 15 minutes to handle the content set, another crawler is started.

Continuous Crawl timeline

It is even possible that a second crawl is started only a few minutes after the first crawl. This way your newly added or changed data is almost immediately available through search. How cool is that!

Now, a few things to bear in mind. Continuous crawls can only be enabled for content sources based on SharePoint sites.

Enable Continuous Crawl

Also, it can be resource intensive for your server running all the crawlers. Be prepared for that.

Summary

With continuous crawling data is almost immediately for search. No more issues with incremental schedules and big data which can cause missing schedule windows. Using continuous crawls and the Content by Search web part, for example, gives you lots of opportunities to build awesome search-driven solutions.

Some useful references to TechNet articles:

SharePoint 2010:

http://technet.microsoft.com/en-us/library/cc280343(v=office.14).aspx#section1
http://technet.microsoft.com/en-US/library/ee792876(v=office.14).aspx

SharePoint 2013:

http://technet.microsoft.com/en-us/library/jj219802.aspx

Sep 17

Content Type Hub : Inconvenient updates

Recently I had to develop some kind of tool for a customer that would manage their content types from the content type hub. This tool included content migration as well. Think of renaming a content type or change the parent of a content type. During development I noticed that updating a content type and republish it from the content type hub, it did not update the content type all the way to sub-sites and lists. In spite of what the option says in the Managed Metadata Service Connection properties dialog:

CTHub1

The Test

Let’s take a test drive. In my example I have the following content type set to a document library and I will rename the content type and let’s see what the results are.

Before:

image

The My Content Type in the library is inherited from the site content type My Content Type. The latter one has been published from the content type hub. And by design, all published content types are readonly.

After:

I renamed the content type My Content Type to My Renamed Content Type in the hub, republished it, started all necessary timer jobs and went back to my document library.

image

So, the site content type is updated, but not the library one.

For us developers, this seems like a SPContentType.Update() and not a SPContentType.Update(true).

The quest

But let’s take a deep dive into the code. I use ILSpy, but Reflector will do too. The update is performed by the Content Type Subscriber timer job. After some searching and digging it all starts with the assembly Microsoft.SharePoint.Taxonomy and the namespace Microsoft.SharePoint.Taxonomy.ContentTypeSync.Internal. Starting from SubscriberTimerJobDefinition jumping to SubscriberImport and you will see the SynchronizeSite method. Some interesting lines of code are:

subscriberImport.Import(current);

subscriberImport.ImportContentType(current);

In both methods you will see at some point the following lines of code:

sPContentType.ReadOnly = contentTypeInfo.IsReadOnly;
sPContentType.Update();

No Update(true) at all.

This leaves us writing our own update mechanism to sub-sites and lists. But that’s for another blog post.

Sep 14

Error “The content type is in use” explained

Recently I have developed a tool to manage content types from a content type hub. Think about renaming content types or changing the parent. Something that doesn’t work out of the box. At least not completely. (I will blog about this later, hold on)

While developing and testing I encountered the error The content type is in use.

image

There are several occasions that will cause this error.

  1. Content exists in the Recycle Bin
    Marc D Anderson has a blog post written about this recently. You’ll have to delete the content from the Recycle Bin somehow.
  2. Documents not checked in yet
    Try this: you have a Document Library with your content type as default and check-out/check-in is required. Then you upload multiple documents. After the upload the items are still checked out and you are the only one that can see them. As of this moment your content type cannot be deleted. Everything needs to be checked in and modify the content type for each item.
  3. Previous minor version exists
    Try this: you have a Document Library with Minor/Major versioning enabled. Upload a document and give it your content type. Publish your document to version 1.0. Then edit the properties and give it another content type. This will be 1.1. As of this moment your content type cannot be deleted. You’ll need to publish it first to the next major version.

So you have checked everything? No content using the content type, Recycle Bins are empty etc..? Sure? Well, I can tell you that you still might not be able to delete the content type. Trying so can show you this error message:

image

Some lovely SharePoint solution (WSP) with a feature deployed the content type. And to protect the solution and it’s functionality the content type cannot be deleted.

Now you have it. When deleting a content type fails you now know why.

Older posts «