[SP20xx] Migrating HTM, HTML, MHT files to SharePoint

It seems this issue arises in almost every migration project: “Hey, we have a bunch of HTML based files which we’ve uploaded to SharePoint, but now they don’t work any more!”. With “don’t work”, usually it means the user is prompted to download the file instead of being able to just view it in the browser. So it’s working, but the end result is not what the end-user expects. Also, “a bunch” is usually a couple of hundred files which were exported from some legacy application a few years back and have been sitting on a file share or in SharePoint 2007 ever since. (more…)

[SP2013] Modifying app package appmanifest.xml on deployment

When you’re writing provider hosted app, you probably know the procedure for publishing those. That procedure includes packaging the app package, which is an action Visual Studio will do for you. You enter your website URL, a client ID and you’re off. But what if you host your app on multiple locations having different URL’s? (more…)

[SP201x] Terminating runnning workflows with Powershell

After importing / restoring a site collection from a different environment, you might have the need to terminate all of the running workflows. For instance, to stop them from e-mailing people or firing off other events which should not be fired from within your local dev environment. Whatever reason you might have, here is a little Powershell script which can help you do so:

[SP201x] Atos SharePoint Services

I rarely discuss the things we do at Atos here. This time I’m going to make an exception, to tell you about a pretty neat hosting service we offer to our customers. So yes, you might regard this post as an advertorial and yes; you may contact me for more information. If that’s not your cup of tea, feel free to close this tab. But when you’re interested in hosting your SharePoint farms elsewhere, without losing the possilbity to use custom solutions, timer jobs and all other kinds of customizations, you should keep on reading.

 

(more…)

[#SP2013] Host named site collections, ADFS claims and AAM

In my previous blog post I wrote about host named site collections in SharePoint 2013. As this is the recommended way to go according to Microsoft, you should definitely consider it for new SharePoint deployments. But with these URL’s bound to your site collections, you can get into trouble quickly. It’s important to get a good grasp of the matter before implementing it in a production environment. Today I’ll discuss setting up host named site collections, claims based authentication and alternate access mappings.

(more…)

[SP2013] Host named site collections

With SharePoint 2013, Microsoft claims we need to rethink our architecture. Host named site collections are the way to go, and preferably all within the same web application. But what are host named site collections and what do we need to take into account when setting this up?

Update. Check out part 2, detailing how to set up host named site collections in combination with AD FS and SSL: http://blog.repsaj.nl/index.php/2014/07/sp2013-host-named-site-collections-adfs-claims-and-aam/
(more…)

[SP2013] SharePoint, ADFS and 404 on /_trust/default.aspx

Those of you who know SharePoint, probably also know those annoying problems you just cannot get your head around. Well today I had one of those problems.

(more…)

[SP201x] Adding a ADFS trusted identity token issuer to a webapp using Powershell

There is a lot of information on how to link SharePoint 2010 or 2013 to an AD FS instance. But for some reason, most of those blogs include a manual step to enable the newly created authentication provider in Central Admin. I don’t like manual steps, so here is a little script which does the same, but in Powershell instead:

 

[SP2013] Loading scripts using RequireJS

In my previous blogpost I wrote about loading JavaScript files in a SharePoint app. I noted that the order of loading is important and that you can use jQuery to dynamically load the scripts. I also stated that my solution probably was not the prettiest one out there, which was a true fact.

Well, here I am again, with a better solution! A colleague of mine pointed out that there is a Javascript library called “RequireJS”. This library is built to support loading scripts, it also enables you to execute code after the required libraries were loaded. Sounds great, no? Well let’s get to it!

(more…)

[SP2013] Provider hosted app: loading scripts in order and waiting

I have finally come around to messing around with apps in SharePoint 2013 again. Way too late, I know, but better now than never right? So when I was building this provider hosted app, I wanted to make use of the JSOM libraries. When you check out some of the solutions, you will find code snippets like this:

Okay, cool. So we’re using jQuery’s getScript method to dynamically load scripts from the SharePoint _layouts folder. But I needed much more scripts then just SP.UI.Controls. So I started adding lines like this:

This seemed to be working at first, but soon started causing errors upon load time. These errors were in the “object undefined” category, so I figured out the sequence in which the scripts were loaded must have been wrong. That is because the wonderfull world of asynchronicity in which we cannot rely that the above calls will fire or finish in the same order you typed them. Okay, so how to fix that one? Luckily jQuery’s  getScript call also featues a callback which you can use to fire a method as soon as the getScript call is done. And that method would be the next getScript call, etc. etc. Example:

Disclaimer: no, this is not the prettiest piece of Javascript I have ever written. There appear to be cleaner ways to acheive the same (search for promises and deferred), but the above is to illustrate the idea. Still, I was not out of the woods yet. Now the script libraries were loading in the correct order, but the code that was using them was firing too soon, before the last script was loaded. There’s that same async issue again. Final step: I first tried using $(‘document’).ready to wait for the ready method to fire. But the ready method fires when the DOM is loaded, it doesn’t care about any getScript calls that might still be busy. Fortunately, jQuery has a solution for that too: you actually can hold off the ready call untill your processing is done. For that, use $.holdReady(true); and $.holdReady(false); Example:

The good news: this works and is reliable. The bad news: I don’t like the solution.

So I’m still going to look for a better solution. Maybe I need some scaffolding in which I can register calls which need to be fired after the scripts are loaded. Using the jquery ready method for this seems a bit off to me. So if you’re a Javascript ninja and know  a much better way: use the comments please!

Update! I have found a better solution by using RequireJS, check out this blog post: http://blog.repsaj.nl/index.php/2014/07/sp2013-loading-scripts-using-requirejs/