SharePoint Workflow Designer 2013 not displaying workflows

Today I encountered a strange anomaly in SharePoint Designer 2013.

I pushed a fresh Windows 8.1 image and installed Visual studio 2013 Premium Update 2 (couldnt go for update 4 due to informix driver). I installed sharePoint Designer 2013 and wanted to use it to resume on a workflow. When I loaded it, to my dismay SharePoint Designer displayed an empty workflow ready to start designing … I thought I lost my work. I started looking for a solution and I encountered this post http://community.office365.com/en-us/f/154/t/264867.aspx

To cut story short they ask the user to install this SharePoint Designer update http://www.microsoft.com/en-us/download/details.aspx?id=41467

I did so and it worked. So why things worked before the refresh of the image? My conclusion is because before i had Visual studio 2013 Premium Update 4, So I think something required by SharePoint Designer 2013 is missing in Update 2 but available in Update 4

SharePoint Link to a document in Library

Setting the Library for Links

Open the library

Library ToolBar
Library ToolBar

Click the Library Tab (1) then click Library Settings (2)

Library Settings Page
Library Settings Page

click Advanced Settings

Enable Content Types
Enable Content Types

Tick Yes

Add from existing site content types
Add from existing site content types

click Add from existing site content types

Link to a document Content Type Selection
Link to a document Content Type Selection

Select Document content types from (1) and Link to a document from (2)

 

Adding Link to a Document Content Type
Adding Link to a Document Content Type

Click Add

 

Populate the Library

Library Content Types
Library Content Types
Adding a Document
Adding a Document

Click New (1) followed by Link to a document (2)

Providing Name, document Link and Verify Link Validity
Providing Name, document Link and Verify Link Validity

Enter a document Name and a Link (please click “Click here to test” checks if your URL is valid)

 

Link in Library
Link in Library

Done!

 

Note that if you do this to Documents Library of a site/subsite and after you create a child subsite, this will not effect the default Documents Library of that child subsite

SharePoint enable List (Form Web Parts)

By default SharePoint’s Form Web Parts are disabled.

List Form web Parts disabled
List Form Web Parts Disabled

 

How to resolve this issue?

Go to your SharePoint admin center

Click settings.

Scroll down to locate the section of Custom Script

Select Allow users to run custom script on self-service created sites

Custom Script
Custom Script

Click OK.
Note: It takes up to 24 hours for the change to take effect.

List Form Web Parts enabled
List Form Web Parts enabled

Turn scripting capabilities on and off
 

.NET HTTPRequest

HTTP Handlers
They are used to process individual endpoints.
Only one handler per request is used
Can be both asynchronous or synchronous
Earliest possible point where you have access to requests

 

HTTPHandlers are extension based. This means that for every extension .aspx .html etc there is a handler (some share handler).

The example used here is very simple and does nothing special except for displaying some static text. The reason is that ideally before attempting to do something elaborate one should check if it works by doing something simple especially while learning.

The examples here were created in ASP.MVC5 applications. The extension that is used is .kk

Synchronous HTTP Handler

The Solution name is HTTP_Handler

Step 1:

Ignore routing for .kk extension in App_Start/RouteConfig.cs (The reason is that we do not want MVC to try to interpret this file)

routes.IgnoreRoute("{file}.kk");

Step 2:

We create the class that will be our handler at the top level  since this is an example and name it CustomHandler.cs

This can be achieved by inheriting IHttpHandler or by using IHttpHandlerFactory (The example uses IHttpHandler)

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace HTTP_Handler
{
public class CustomHandler : IHttpHandler
{

public void ProcessRequest(HttpContext context)
{
HttpRequest Request = context.Request;
HttpResponse Response = context.Response;
Response.Write("test");
}

public bool IsReusable
{
get { return true; }
}
}
}

Step 3:

We configure the application to use the handler (Integrated mode).

In web.config

<system.webServer>

<handlers>

<add verb="*" path="*.kk" name="CustomHandler" type="HTTP_Handler.CustomHandler"/>

</handlers>

Step 4:

Build and Run

add hello.kk to the link and load it should print test on screen.

 Asynchronous HTTP Handler

 

The Solution name is HTTP_Async_Handler

Step 1:

Ignore routing for .kk extension in App_Start/RouteConfig.cs (The reason is that we do not want MVC to try to interpret this file)

routes.IgnoreRoute("{file}.kk");

Step 2:

We create the class that will be our handler at the top level  since this is an example and name it CustomHandler.cs

This can be achieved by inheriting IHttpAsyncHandler

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace HTTP_Async_Handler
{
public class CustomHandler:IHttpAsyncHandler
{
// Long Process
private static void generateNumbers(HttpContext context)
{
string s = "";
for (int i = 0; i < 1000; i++)
{
s = s + ' ' + i.ToString();
}
context.Response.Write(s);
}

public static Action<HttpContext> _Handle = generateNumbers;

public IAsyncResult BeginProcessRequest(HttpContext context, AsyncCallback cb, object extraData)
{
context.Response.Write("BeginProcessRequest Executed");
return _Handle.BeginInvoke(context,cb,extraData);
}

public void EndProcessRequest(IAsyncResult result)
{
// Clean up code here
}

public bool IsReusable
{
get { return true; }
}

public void ProcessRequest(HttpContext context)
{
context.Response.Write("ProcessRequest Executed Will not execute");
}
}
}

Step 3:

We configure the application to use the handler (Integrated mode).

In web.config

<system.webServer>

<handlers>

<add verb="*" path="*.kk" name="CustomHandler" type="HTTP_Handler.CustomHandler"/>

</handlers>

</system.webServer>

Step 4:

Build and Run

add hello.kk to the link and load it should print test on screen.

 

Want to know more?

Investigate IHttpHandlerFactory

Classic mode & Integrated mode (IIS)