Friday, 19 August 2011

Custom sitemap in SharePoint

In the story today will show you how a sitemap can be used with a SharePoint site to create a custom navigation control for SharePoint.

Scenario

I am having a website, that has few application pages. Those pages have to be linked via custom breadcrumb control. Let's say that this is project management site, and the pages are: Projects.aspx (the list with all available projects), ProjectDetails.aspx (details for a single project), ProjectExpenses.aspx (the expenses details for a selected project) and ProjectResources.aspx (list with employees that are assigned to the selected project). My breadcrumb should have 3 links only: Home -> Projects -> Project Details, but when user opens expenses or resources links, he/she should be able to navigate back to the current Project Info page by clicking on the breadcrumb link.

Saturday, 13 August 2011

Save InfoPath Attachment via K2 SmartObject

If you have met K2 during your work, you will know how important is to keep K2 DB clean and less-busy in order to improve performance in workflow execution, reporting etc. One of the ways to improve the performance is removing all attachments from InfoPath forms before they reach to K2 DB, because InfoPath data will be extracted, saved and passed back to the customer by K2. Here is how this can be done (note that I am talking for K2 [blackpoint], but more or less the same procedure can be used for K2 [blackpearl] as well).

Saturday, 6 August 2011

Deploying reusable SharePoint 2010 workflow

In this post I will try to cover the procedure of deploying reusable workflow in SharePoint 2010 as a VisualStudio project. What I found most challenging is how to do this when the workflow has collect data task. For 2 days I've been fighting different problems, and finally got to some solution. This solution is described below, and hopefully will save you at least 2 days in struggle.

Scenario

I have a dev server, where a reusable workflow is designed. This workflow has a task to collect data from some user, and based on the input to perform some other actions. The workflow has to be imported to a project, that will provision a web site, custom lists, content types, application pages etc. Shortly - this workflow is a piece of a bigger picture and as such needs to be part of the deployment procedure.
So far, so good ... According to all posts and articles I've read, this should not be a problem - all I have to do is export the reusable workflow as WSP solution, import it in VisualStudio project (there is a nice project type called "Import Reusable Workflow" for SharePoint) and that is all. Well, not at all ...

Problems

Here are just few of problems I hit, at least the biggest I remember now. There were other problems as well, but most of them were a matter of proper configuration.

  • Forms are not found (note that these are InfoPath forms) - first of all, they are not deployed properly, actually they were not deployed at all. Then, they were not attached to the workflow definition.

  • Then collect data task could not complete, nor update its fields. Here I used the well-known try-fail development process till proper solution was found.


Enough talking, let's get started ...