Welcome to MSDN Blogs Sign in | Join | Help

New and updated site for Microsoft Services

Microsoft Services has launched a new and updated site where you can find information about services and offerings from Microsoft Services and a new career section. A partner section will soon be available

For information worker capabilities you will find the offerings in the Business Productivity Infrastructure Optimization (BPIO) section. Here you will find fact sheets for the capabilities Business Intelligence (BI), Collaboration, Enterprise Content Management (ECM), Mobile Messaging, Search and Unified Communications (UC).

Here’s an overview of the MOSS 2007 deployment offerings (The offering Document & Records management decision accelerator, that’s part of ECM, is marked with orange here)

image

http://www.microsoft.com/microsoftservices/

A good under-the-hood SharePoint book?

My former colleague Kjell-Sverre has written a review on the book Building the SharePoint User Experience, where he absolutely recommends reading the book. This is a hardcore book for SharePoint developers. I haven’t read it yet, but it’s on its way.

Kjell-Sverre’s review is worth reading, including his follow up post on List Content Type Forms

 

Building the SharePoint User Experience (Expert's Voice in Sharepoint)

SharePoint book for non-technical project managers

Many companies have deployed SharePoint and made it available for their users. SharePoint is a great tool, but if your not familiar with it you may ask: Where do I start?. The book “SharePoint for Project Managers” is a good introduction to how you can use SharePoint for your project. It is written for people with little or no knowledge to SharePoint and for the scenario Project management. It takes you through, step-by-step, how you build up your site and how you should use it. Among the topics is supporting team collaboration, Project tracking and project reporting.

I think this book is good because it cover a business-specific scenario and is written for non-technical people.

SharePoint for Project Management: How to Create a Project Management Information System (PMIS) with SharePoint
Posted by Jon Løken | 1 Comments
Filed under: , ,

Social Computing using SharePoint

Do you have an interest in the enterprise social computing as many other? Microsoft has launched a new site at http://sharepoint.microsoft.com/social

Here you will find feature content especially for and about enterprise social computing—why customers should plan for it, what Microsoft offers, and why they should consider Microsoft as their social platform of choice. And in the blog section you will find a new whitepaper worth reading

Go check it out today.  

 

image

Posted by Jon Løken | 1 Comments

Paper on using Nintex workflow

Bjørn Furuknap (his blog here) has written an extensive paper about using Nintex workflow. It’s worth a look if you consider Nintex workflows.

In Bjørn’s own words:

Finally, the Nintex Workflow issue of Understanding SharePoint Journal is complete. And, as you also know, the issue if free, courtecy of Nintex themselves.

Now, a few things about this issue. The reason why this issue is free is that Nintex has agreed to pay for the issue, a cost that would normally have come from regular sales. However, Nintex have had no editorial control, so this is just a plain, normal USP Journal issue, written by me, edited by me, and completely controlled by me.

This is also the longest journal issue yet, with about 125 pages of workflow training. Throughout those pages, I will show you how to install and configure NW, how the Nintex Workflow Designer works, and I will also guide you through a series of exercises, resulting in you learning all you need to create enterprise class workflows.

Oh, and I think the main solution this time is especially cool: A "get well card" workflow, where co-workers are asked to provide greetings to a sick employee, before those greetings are combined into an email sent to the sick employee.

I won't hold you any longer, feel free to grab the issue here:

http://learnnintex.com/freedl/nintex

Posted by Jon Løken | 1 Comments
Filed under: ,

A SharePoint feature’s ActivateOnDefault attribute

Lately, I’ve been struggling with a WebApplication scoped feature that was being activated automatically in all web applications I created after the feature was installed in the farm.

I’ve been checking the solution- and feature definitions and code, thinking there were some hidden error, but the solution to the problem is very obvious now that I’ve found it:

The feature element has an ActivateOnDefault attribute, and for WebApplication scoped features, the default value of this is True. Setting this to False is all that it takes, and I’ve regained control of the deployment.

The complete feature element schema can be found at http://msdn.microsoft.com/en-us/library/ms436075.aspx

Thanks to my colleague Joe McPeak for helping out!

Copy listitems from one custom list to another, then move them into subfolders.

One problem I stumbled over the other day, was how to copy item from one custom SPlist to another. The two lists are identical and I thought moving the items should be quite easy through use of the object model. It turned out be not so straight forward.

Normally, SPListItem.CopyFrom() and SPListItem.CopyTo() should do the trick:


SPListItem listItem = web.GetListItem(listItemUrl);
listItem.CopyTo(destinationUrl); // Copies the item to the specified destinations

or

listItem.CopyFrom(sourceUrl); // Overwrites the current item with the specified version of the item.

Sadly, this does not work with custom lists or custom properties. A small search on live.com showed that I was not the only one struggling with this. Several solutions are available like:
http://www.communardo.de/techblog/2008/01/08/sharepoint-listenelement-splistitem-in-eine-andere-liste-kopieren/ (you can read the code… )
http://www.informationworker.co.za/blogs/mirror/Lists/Posts/Post.aspx?ID=312

http://www.k2distillery.com/2007/10/copy-version-history-with_5.html

So, there is not really need for another posting of this code. Except for the fact that I wanted to move the copied item into subfolders. Trying to do so resulted in the error:
”Source item cannot be found. Verify that the item exists and that you have permission to read it.”
It doesn’t tell you much now does it?

But, if I combined the logic from the posts above with a SPFile.MoveTo(…) it was finally working OK.

SPListItem item = Web.Lists["Announcement"].GetItemById(5);
SPFile file = Web.GetFile(item.Url);
file.MoveTo("New location...with the ID_.000");

http://blogs.inetium.com/blogs/khofer/archive/2008/03/16/fix-can-t-move-copy-an-splistitem.aspx

Summarized:

1. Copy the item by iterating through all fields, and optionally for all versions of the item

2. Copy the attachments.

3. Delete the original item, if applicable.

4. Move the new item into appropriate subfolder.

 

Hope this can save you time if you need to do the same sort of thing.

Case study: Aker Solutions published

Enterprise Speeds up Intranet Development by 50 Per Cent with Communications Solution

Information sharing is crucial to Aker Solutions. With thousands of employees in more than 30 countries, the company’s intranet is an important business tool. Previously, its intranet—called eNet—was based on Microsoft® Content Management Server 2002 and Microsoft Office SharePoint® Portal Server 2003. In 2007, the company’s IT team worked with Microsoft Services and Microsoft Gold Certified Partner Tieto to update eNet, with Microsoft Office SharePoint Server 2007 as its foundation. Now, employees use powerful search functionality to find documents and people quickly, and collaborative working features to connect with colleagues. Most importantly, the intranet is highly flexible and the company’s IT team can implement features faster.

Read on at:

http://www.microsoft.com/casestudies/casestudy.aspx?casestudyid=4000003882

Create Datasheet view missing

The other the I got asked why the “Datasheet view” option was laking from “Create a new view”. It turned out to be a more troublesome way to find the solution than first expected.

First I checked the users rights on the site collection, but that really did not give any answers.

Secondly, I checked this on a virtual dev machine, with (more or less) the same configuration and features: No repro. Create datasheet view was available as it should be. So what could be the difference between these machines?

Thirdly, I compared site features and site collection features, but this neither give any findings.

OK, let’s see what happens in the ViewType.aspx which display this page:

fHideGridViewOption = ListViewWebPart.RestrictedTemplateType(spList) || !spList.DoesUserHavePermissions(SPBasePermissions.UseClientIntegration);

… and some more… but nothing really telling me why it might be hidden.

So I asked and looked for suggestions elsewhere: A lot of search hits and problem related to the DataSheet view is client integration, that was a dead end here. From one client I could reproduce the problem on one server and not on another. And the problem is not viewing the view.

Finally, I tried to open an existing datasheet view on the server with the problem. This gave the following error:

"The standard view of your list is being displayed because your site configuration does not support the Datasheet"

“Site configuration” – it should have said web application. Central Admin - application management - authentication providers - <your provider> – scroll to the bottom:

image 

“Enable client Integration” was set to “NO”. 

This was a setting long forgotten, since it is set to “YES” when you create a new web application in the GUI. However, one server had been set up using STSADM commands with the SharePoint PowerShell Deploy from Codeplex using EXTENDVS, so somehow I needed to compensate for this.

The easiest way is to call another stsadm command after the extendvs,

stsadm -o authentication

   -url <URL name>

   -type <type>

   [-usebasic]

   [-usewindowsintegrated]

   [-exclusivelyusentlm]

   [-membershipprovider] <membership provider name>

   [-rolemanager] <role manager name>

   [-enableclientintegration]

   [-allowanonymous]

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

and set the –enableclientintegration flag.

Just another small annoying thing that take a little too long to figure out…

Norway: MSDN and TechNet Live – Are you coming?

Have you signed up for MSDN and/or TechNet live in Norway yet? 

  • Stavanger: 5.mars 2009
  • Bergen: 10.mars 2009
  • Trondheim: 12.mars 2009
  • Oslo: 19. mars 2009

http://www.microsoft.com/norge/msdn_technet_live/msdnLive.aspx

 

I’m attending in Oslo myself – hope to see you there!

SharePoint Pod Show

SharePoint Pod Show has been around for a little more than half a year. They podcasts on various SharePoint development tools and techniques, and a bit on architecture.

Great to have something meaningful to listen to while one commute. Check them out at http://www.sharepointpodshow.com/

Posted by Stian Kirkeberg | 2 Comments
Filed under:

Disposing of SharePoint objects

Correctly disposing of SharePoint objects like SPWeb and SPSite have been discussed and documented several times, but I think developers constantly needs to be reminded of the importance of proper use of dispose(). Yesterday Stefan wrote an interesting article you should check out if you don’t catch the error in this code:

public void enumSiteCollection(SPSiteCollection spSites, int min, int max)

{

for (int i = min; i<max; i++)

{

    if (spSites[i] != null)

   {
            DoSomething(spSites[i]);

           spSites[i].Dispose();

    }

}

}

It really looks OK doesn’t it? Sorry to say it isn’t. Go to Stefan’s blog and read why.

 

If you haven’t yet downloaded the newly released tool SharePoint Dispose Checker – you really should do it right away. I have used it for quite some time and it is really a time saver for finding potential dispose errors, especially if you are doing code reviews.

New Version of SharePoint SiteConfigurator Feature Released!

We have just released a new version of the SharePoint SiteConfigurator feature on codeplex.com

In this release we have focused on some new features and making sure the build is stable. This involved some refactoring as well as splitting the project in three parts, one for the code and logic, one part for the feature and one test project. This new structure will make it much easier and faster to reuse the project from farm to farm.

As the release notes states, we also focused on:

  • split VS project in two for easier maintenance and upgrades
  • added Type Mock project (simply remove that project from the solution if you don't use it)
  • rewrote log functionality
  • added verbose logging option
  • fixed disabling of web part toolbar (still some minor issues here)
  • made the complete solution independent of it's features names.
  • Added provisioning of files and make it possible to choose welcome page based on xml parameter
  • Added support for links with parameters in AddQuickLaunchLinks
  • Created support for QuickLaunchHeading and
  • DeleteQuickLaunchHeading elements.
  • Rearranged and refactored the main project
  • Fixed some bugs

Enjoy the new release and please give us feedback so we can improve it further!

SPNavigationNode issue

While working on some enhancements for the Site Configurator Feature we just released to CodePlex, I was struggling with an unexpected behavior when trying to add create SPNavigationNodes programmatically for quick launch and top navigation links. There are two constructors to select from:

public SPNavigationNode(string title, string url)
public SPNavigationNode(string title, string url, bool isExternal)

Since I needed to support both internal and external links, I chose the second one. Adding external links and links to subsites works fine, but adding links that point to the same site seems to fail. In the following example I am trying to create a duplicate of the out-of-the-box "Lists" quick launch heading.

SPNavigationNode node = new SPNavigationNode("MyInternalLink", "/_layouts/viewlsts.aspx?BaseType=0", false);
web.Navigation.QuickLaunch.AddAsLast(node);

The link will be added like this: http://_layouts/viewlsts.aspx?BaseType=0. Which obviously is invalid. So how did I come around this? Using .NET Reflector I checked the OnSubmit method of the NavNodeCreatePage class (NavNodeCreatePage is the codebehind for newnav.aspx). This is the page used when adding navigation nodes in the user interface. Interestingly I found that the "isExternal" parameter was "hardcoded" to "true". So I changed my code to:

SPNavigationNode node = new SPNavigationNode("MyInternalLink", "/_layouts/viewlsts.aspx?BaseType=0", true); web.Navigation.QuickLaunch.AddAsLast(node);

It does not make sense to me, but at least it solved the problem. If anyone can explain it, please leave a comment.

Unit testing MOSS part 2 (of 2)

In the 1. article on Unit testing MOSS I described some of the findings and experience on unit
testing SharePoint applications using the TypeMock Isolator framework. In this 2. article I will
provide some examples of unit tests.
 
Code under test
You should of course use TDD principles, but we are in a state where we have to add unit tests to already
existing code.
The code under test is a fairly simple method, already existing, which main purpose is to set the
MasterUrl-property on a site:

    public class CodeUnderTest
    {
        public void SetMasterUrlProperty(SPWeb web, string masterUrl)
        {
            try
            {
                if (masterUrl != null)
                {
                    if (!masterUrl.ToLower().EndsWith(".master"))
                    {
                        throw new ApplicationException("Invalid MasterUrl");
                    }
                    web.MasterUrl = masterUrl;
                    web.Update();
                }
            }
            catch (ApplicationException ex)
            {
                LogError("Unable to set master url property", ex);
            }
        }
    }
 
The tests
After creating a test project using right-click on the method, a test project, class and method 
is provided for modification. The tests will by default fail with a "test inconclusive" error
until it has been modified.

 
Success scenario
First we create the successful test where all is working as it should:
public void SetMasterUrlTest_Success()
{
    //Arrange
    CodeUnderTest codeUnderTest = new CodeUnderTest();
    web = Isolate.Fake.Instance<SPWeb>(Members.ReturnRecursiveFakes);
    string masterUrl = "test.master";
    Isolate.WhenCalled(() => web.MasterUrl).WillReturn("test.master");
    
    //Act
    codeUnderTest .SetMasterUrlProperty(web, masterUrl);
    
    //Assert
    Isolate.Verify.WasCalledWithAnyArguments(() => web.Update);
}
 
Here we are using the Arrange-Act-Assert pattern where we:
1.create an instance of the class under test
2.set up a fake SPWeb object
3.setting behavior on the .MasterUrl property
4.calling the method under test
5.verification that the Update method is called
 
Parameter testing
The next test we do is checking how the method under test is behaving if we provide a null-value as MasterUrl parameter.
       
        public void SetMasterUrlTest_MasterUrlIsNull()
        {
            //Arrange
            CodeUnderTest codeUnderTest  = new CodeUnderTest ();
            string masterUrl = null;
            Isolate.WhenCalled(() => web.MasterUrl).WillThrow(new System.Exception("MasterUrl should be set to NULL"));
            try
            {
                //Act
                codeUnderTest.SetMasterUrlProperty(web, masterUrl);
            }
            catch
            {
                 //Assert
                 Assert.Fail();
            }
        }

Here we are telling the method under test to throw an exception if MasterUrl is called with a null-value in the MasterUrl property. In other words, it should be allowed to provide a null-value as a parameter and the call should be done. We are expecting the test to fail if the property is called with the Assert.Fail in the catch-block.
       
Exception flow testing
The last test is a test to see how the method under test is behaiving when provided an invalid MasterUrl value:
       
        public void SetMasterUrlTest_InvalidUrl()
        {
            //Arrange
            CodeUnderTest codeUnderTest = new CodeUnderTest();
           
            string masterUrl = "ASDFASDF";
            Isolate.WhenCalled(() => web.MasterUrl).WillThrow(new System.Exception("Invalid MasterUrl"));
            try
            {
                //Act
                codeUnderTest.SetMasterUrlProperty(web, masterUrl);
                //Assert
                Assert.Fail();
            }
            catch
            {
            }
        }

Here we are expecting the method under test to throw an exception if an invalid MasterUrl-value is provided.
 
 
Happy testing!
More Posts Next page »
 
Page view tracker