Skip to content

Author: John White

How to Replace the Built in SharePoint Approval Workflow

We use Nintex Workflow all of the time. It compresses project times, and reduces, if not eliminates the need to develop custom code. One of the problems that we run into though is that the Approval workflow that comes out of the box appears to be hard wired for the SharePoint approval process.

As it turns out, it doesn’t need to be. Christian from iLoveSharePoint has a great solution that lets us replace the built in workflow with a Nintex workflow. It would also work for workflows built with SharePoint Designer. As opposed to rewriting it, I’ll just say that you can link to it here:

http://cglessner.blogspot.com/2009/01/publish-major-version-declarative.html

I will add two things to it. Christian has some sample code that if you just copy and paste won’t work due to wrapping, etc. Here’s what the code should look like:

#workflow must be associated with the target list
$workflowFileName = "Nintex Test.xoml"
$targetListTitle = "MyListName"

function ItemUpdated()
{
    if($item.DisplayName -eq "$($workflowFileName).wfconfig")
    {
        $binFile = $item.File.OpenBinary()
        $wfConfig = [xml][System.Text.Encoding]::UTF8.GetString($binFile)
        $baseId = [Guid]$wfConfig.WorkflowConfig.Template.BaseID

        $library = $web.Lists[$targetListTitle]
        $assoc = $library.WorkflowAssociations.GetAssociationByBaseId($baseId)
        $library.DefaultApprovalWorkflowId = $assoc.Id
        $library.Update()
    }
}

He also mentions one way to get the GUID of the Workflows list. You can also get it by navigating to it with SharePoint Designer, drilling down into your declarative workflow, and opening the workflowname.xoml.wfconfig.xml file, and looking for the DocLibID tag.

1 Comment

Performance Point Dashboard Designer Won’t Launch for a New Installation

We’ve been observing a problem in a few PerformancePoint installations that we’ve done recently. You create a new Business Intelligence Center, and then you want to create a new dashboard. You navigate to the PerformancePoint content library and select the Add new item link. You get the “Loading Dashboard Designer” Ajax prompt, but then nothing happens. If you open up the ribbon, and try to create any of the PerformancePoint items, you see the same behaviour.

If there’s existing PerformancePoint content, there is no problem, but new stuff won’t work. As far as I can tell, the problem appears to be that the SharePoint URL is not yet set. You can access the Server setting by clicking the pearl in the upper left of the designer surface, then clicking the Designer Options button, and then the Server Tab

image

The trouble is, how can you get Dashboard Designer to launch? We’ve found that although it won’t launch from the PerformancePoint Content library, it will from the Data Connections library if you create a new PerformancePoint data connection. You will however need to use the ribbon to launch it.

First,navigate to the Data Connections library and click on the Documents tab in the ribbon. The ribbon should open up,and then you want to click the New Document dropdown (not the button) and select PerformancePoint data source.

image

At this point, Dashboard Designer should launch. You should then be able to set the SharePoint URL setting.

We have seen issues with setting up the URL however. Occasionally the following error will be displayed:

image

You can’t then save the value. Our solution to this problem thus far has been to close designer, repeat the process above, and the value gets set automatically.

Once this is done, you can create new PerformancePoint items from the PerformancePoint content library.

If anyone has any additional insight to this, I’m all ears – I consider this to be a workaround.

13 Comments

Second Foundation Intelligence named as a finalist for the Business Intelligence Solution of the Year in the 2010 Microsoft IMPACT Awards

Time for a little self promotion here I think! I’m pretty proud to announce that my company, Second Foundation Intelligence, (in case you haven’t noticed the logo on the upper right of this page…) has been named a finalist for Business Intelligence Solution of the year at the upcoming Microsoft Canada Impact Awards ceremony.

We’re pretty excited and pretty proud of it. For the solution in question, we’ve built out an end to end budgeting system using SharePoint Server 2010, SQL Server 2008 R2, and Excel 2010 for a local municipality. Here is a link to the press release.

Wish us luck!

Leave a Comment

BPOS is now Office 365

Microsoft announced the branding for the next version of BPOS today – the new name is Office 365.

We’ll see it early next year, but we already have a pretty good idea of what will be there. All of the constituent products (SharePoint, Exchange, LiveMeeting and Office Communication Server, now Lync) will be brought up to their most recent versions, and the Office Web Applications will be added in. In light of the changes, and the expected change in focus to the Office Web Apps, the new name makes a lot of sense. I’m just glad that I don’t have to call it BPOS anymore…

Leave a Comment

How to Build a Site Collection Template from A Web Template in SharePoint 2010

First off, I should state that there’s really no such thing as a site collection template. What happens when a new site collection is created is that the collection gets created, and then a web template is applied to the root site. This whole process is actually decoupled in SharePoint 2010, and you no longer need to select a template when the site collection is created (as documented previously by Todd Klindt). Todd has a very clever solution to getting your web template to be used at the root site, but I recently had a requirement to have it fully automated, and to be visible to the templates available when creating a site collection in Central admin.

This was relatively straightforward in SharePoint 2007, you would save a particular site as a template, then go to the template gallery, download it to the file system on a front end server, and then run an STSADM command to have it added to the Site definitions list. However, in SharePoint 2010, site templates are no longer .STP files,they use .WSP solutions in the user solution gallery. That should be easy,right? Just save off the  WSP file, add the solution to the farm with either PowerShell or STSADM. The solution will actually install, but your site template won’t show up. The main reason is that the actual web template is scoped to “web” and for it to show up for site collections, it needs to be scoped for the farm.

The good news is that you can import a WSP file directly into Visual Studio 2010, edit it, and create a new solution that does work. I will now attempt to describe the relevant steps, and a few gotchas to do this.

1. Save The Site as a Template

Once you have your site looking and behaving the way that you want, it’s time to save it off.  Select Site Settings, and click Save Site As Template – It’s under the Site Actions section. Give the template a file name, name, and if desired, a description. Once you select OK, the solution will be created and saved to the solution gallery, which is at the root of the site collection. You’ll want to go there next, and you can do so by clicking on the “solution gallery” link in the successful save confirmation page, or by navigating to the root of the site collection, then selecting Site Actions – Site Settings and clicking on the Solutions Gallery link. There is no more Site Template Gallery!!!

image

2. Save the WSP File Locally

From the solutions gallery, Click the name of your solution, and you will be prompted to save the wsp file. Go ahead and do that, and then you need to delete the template from the gallery. Why? You’ll be ultimately registering it in the farm, and you don’t need any confusion as to which template to choose. As well, if you’ll be using the same name, this will lead to conflicts, so it’s best to eliminate it altogether.

3. Create a Project in Visual Studio

Open Visual Studio and create a new project. Make sure that you have the SharePoint 2010 Templates showing, and then select the “Import SharePoint Solution Package” template.

image

From the next screen select “Deploy As a Farm Solution”, and click Next.

image

Next, click Browse and navigate to the WSP file downloaded in 2.

image

Finally, ensure that all of the included items are selected, and select Finish.

image

Visual Studio will then import all of the items into the project. Now we’re ready to modify the project.

4. Modify The Feature Definitions

There will typically be 4 Features created for a site template, aptly named Feature1 through Feature 4. Personally, I like my feature names to be a little more descriptive than that. Feature 1 is for List Instances, Feature 2 is for Modules, Feature 3 is for the template itself, and Feature 4 is for the PropertyBag.

The purpose of our solution is to make the site template available, and the other features are effectively there in a supporting role. Currently, all 4 features are scoped to web, and all 4 are visible. In addition to renaming them, we want to hide features 1,2, and 4 from display, and we want to scope feature 3 to the farm. 

First, we’ll modify the Feature name. Simply Single Click (or right click and rename) on the Feature in the Visual Studio Solution Explorer, and enter a new name. You’ll notice that all of the supporting elements below are automatically renamed as well.

image

Next, We’ll want to modify the Title of the features. The title is what is used when the feature is displayed in the feature list. Although we’ll be hiding 3 of them, it’s still a good idea to use a descriptive title. Double click on the feature, and the Feature Definition box will open in the main window. Modify the Title, and if desired the Description field to something meaningful to your users.

Go ahead and repeat this step for all of the 4 features

With the feature definition in the main window, the feature properties should be loaded in the properties toolbox (if you don’t have it open, open it). We want to set the Is Hidden property to true for all of the features except for the Web Template feature itself (Feature 3).

image

The web template feature itself requires an additional modification, we need to change the scope from site to farm. We can do this in either the properties window or the feature definition window, but the feature definition window is a little more obvious.

image

5. Modify the Template Definition Itself.

This step may not be required if the template name and title will be identical to that which was saved initially. However, in this case, we have called the solution Sample 1, and when the template was saved, it was MyCustomSite. We need to modify the template itself to be called Sample 1, and we may have some additional tweaks.

From the Solution Explorer, open the Web Templates Folder and change the name of the Template by single, or right clicking on it. The feature definitions will be updated automatically.

image

Next, we need to open the Elements.xml file, and change the Name and the Title tag to the new name. Search and replace is a good idea here. Next, open the ONet.xml and change the Title attribute in the Project tag to an appropriate value, in this case, Sample 1.  This file can also be used to remove any feature dependencies that may not exist in the destination farm, but be careful – other elements of your template may be reliant on them.

6. Test the Project

Click on the Debug start button in Visual Studio and your template will be deployed to the server, and you’ll be prompted to create a new subsite. If you see your template in the custom tab, all is well. Go ahead and create a test site to make sure that everything is working. Visual studio may prompt you with deployment conflicts, just let it go ahead and resolve them automatically.

7. Deploy the Solution

We are now ready to deploy the solution to the farm. First, set Visual Studio to Release mode from the toolbar:

image

Then, Right Click on the project, and select Package

image

Then, you’ll need to navigate to your Visual Studio project folder, and then into the BINRelease folder. There you will find a .WSP file with the name of your project. You can either work with the file in place, or copy it to a folder, but next we will add the project to the Farm solution gallery. To do this, we will either use STSADM (old school) or PowerShell (the cool new way). I’m old, so I still use STSADM for solutions, but I’ll show both.

To add the solution using stsadm.exe, open up a command prompt (in administrator mode if UAC is turned on), and navigate to the folder containing the solution file. The syntax is:

C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions14BINstsadm.exe –o addsolution –filename sample1.wsp

Where sample1.wsp is the name of your solution file.

To use PowerShell, open the SharePoint 2010 Management Shell, and enter:

add-SPsolution –LiteralPath c:solutionssample1.wsp

The argument for LiteralPath is the complete path to the solution file. If there are and spaces in the path name, it needs to be encased in quotes.

8. Deploy the Solution

Now that the solution has been added, it needs to be deployed. To do so, start central admin, Go to System Settings, and select Manage farm solutions in the Farm Management Section:

image

Click on your solution name, and then click the Deploy Solution button. Click the OK button on the following screen, and your solution will be deployed.

You can control whether or not the template is available by turning off the farm feature. You can do that from central admin by navigating to System Settings – Manage Farm Features. From here, you can turn your template on and off.

image

9. Create New Site Collection

At this point, we should be good to go. From Central Administration, navigate to Application Management, and click Create Site Collections. On the create screen, give the new collection a title, and a URL. Then, in the Template Selection, click the Custom tab, and your template should appear there.

image
 

Give it a site collection administrator, and click OK. After a few moments, the site will be created, and you can navigate to it.

image

Simple, right?

Well, Microsoft giveth and Microsoft taketh away. Adding the template to the farm is considerably more involved with 2010 than with 2007. However this approach is also a great deal more flexible – you can tweak that template to your heart’s content, and if you have ever tried to create a site template with 2007 using Visual Studio, you can really appreciate how Visual Studio 2010 makes it significantly easier.

31 Comments