Encouraging two-way communications

Share + Learn + Comment   Encouraging two-way communications

Discover our team’s valuable knowledge, experience, opinions, and advice. And let us know what you think!

Blog

Go Back
  • What makes a good SharePoint Solution Specialist?

    Here is some insight into the role of the SharePoint solution specialist at Habañero.

    What makes a SharePoint Solution Specialist different to a 'traditional' Business Analyst (Solution Specialist)?

    When working with SharePoint there is a fine line between the 'prescriptive' and 'descriptive' approach. Whilst a traditional business analyst will simply ask a client what their needs are, a SharePoint Solution Specialist needs to balance this with the capabilities that the platform offers and how it can be leveraged most effectively.

    But this is where things get confusing... Talk to some people and they will say SharePoint is a platform, others will say it's a product. So what exactly is it? Well it's both, but how you treat SharePoint depends on the three tenets of any software project: time, budget, and scope. The SharePoint Solution Specialist is always trying to find that balance between business needs, platform capabilities, and cost.

    SharePoint is both a Product and a Platform.
    How it is leveraged depends on the business, the analyst, the requirements, and the cost.

    Leveraging the Platform

    A good SharePoint Solution Specialist needs to know how to most effectively leverage the platform to meet the needs of the enterprise. In many cases this involves leveraging out of the box components and then deciding how to make up the difference on what the platform can do with minimal cost, and what the business really needs it to do to be effective.

    From experience it is much more effective to make use of the out of the box components than to redevelop custom functionality that might be 90 percent sufficient - but this is exactly the conversation that we will have with our clients. "This is what the platform can do, this is what it will provide, this is what will provide the most business value, and these are the costs associated," should be the mantra of the SharePoint Solution Specialist!

    To act as an advisor

    The position of the SharePoint Solution Specialist is really one of an advisor. We have the knowledge about the many possibilities that the platform offers and it's up to us to advise the client on how to proceed through the murky waters of SharePoint. That advisor role cannot be emphasized enough when working with the product. The platform offers so many capabilities and options, the question is where to start?

    We try to find the best solution for the client's needs utilizing the platform, but which part? For some clients they think that they need a search solution, when really they need a information architecture solution. Some clients think that they need a document management solution, when they really need a governance solution.

    The advisor role allows us to both understand the business challenges that clients face and be able to link that back to platform capabilities. We are as transparent as possible in this process with our clients, whether this be discussing technical decisions in terms of development or customization, or simply by providing clients with the information that they need to make their own decision. SharePoint is a huge platform, with a myriad of possibilities and our advisor role lets us not only solve immediate problems, but allows us to create an ongoing dialog with our clients to help them on their SharePoint journey.

    Technical and personal skills

    Good SharePoint Solution Specialists need to have an intimate understanding and appreciation about the capabilities of the platform in addition to the personal skills to communicate this with a wide variety of users. Whilst SharePoint is a technical solution, ultimately it is used as a business tool and our Solution Specialists will need to effectively communicate with IT Administrators, decision-makers, power-users, end users, and even those who will absolutely hate what we are doing!

    Believe me, its hard! Ask 10 people what SharePoint is and you will get 10 different answers! But we try to communicate the relevant information to the relevant parties. Do end users want to know that now the indexing role can be split out over multiple servers? No way, but do you think that end users want to know that now their content will appear in search results in 10 minutes instead of 1 hour? Hell yes! :)

    Knowing the 'what', being aware of the 'how'

    The 'what' refers to what the platform can do and what it can't, and where the line is between configuration and customization. The 'how' are the deep technical issues that this might entail.

    As Solution Specialists we are aware of the how, and we have brilliant technical architects and developers within Habañero who have already forgotten more about the deep technical issues of SharePoint than an Solution Specialist will ever know!

    But as a SharePoint Solution Specialist we do have a understanding of SharePoint on many levels: what can be configured versus customized, basic SharePoint infrastructure knowledge, out of the box features, applicability to business requirements, and last but not least, what the platform can't do without a significant investment.

    Adding Business Value

    It all comes down to this! As Solution Specialists we are here to add value to your business with SharePoint. This is sometimes a juggling act, but in the end if there must be tangible benefits to your business.

    What do you need to be a good SharePoint Solution Specialist?

    • Be passionate about what you do: Project Managers are passionate about time, scope, and budget. Developers are passionate about technology. The Solution Specialist needs to be passionate about all of it! But perhaps most importantly we strive for a balance of a passion for technology with helping organizations meet their needs.
    • Need to have compassion for people: We help our clients understand SharePoint, we understand that some users won't be technically savvy, we don't sell SharePoint, we sell a solution.
    • Need to have restraint: We try not to use every possible feature of SharePoint, we try not to show every single feature of SharePoint, we try to show our clients what will make sense to them and ultimately solve their business problem most effectively.
    • A sense of humour: A good sense of humor is always needed when you do a demonstration or make a mistake in something that you say. Anyone who doesn't have a good sense of humor working with SharePoint would be locked in a padded cell by now!
    • Be humble: Fact is we won't know it all, every day there are 1000 things to learn about the product and on many occasions we simply don't know...be we try to be honest and let the client know that we don't know it all. Fortunately I have 70 people within Habañero, some of the most intelligent, brilliant people I know. Trust me, someone will know, and if they don't, guaranteed they'll we find out for you.

    What does a good SharePoint Solution Specialist bring?

    Clients: Clients want someone that will join them on this SharePoint journey, they want someone who is equally comfortable in technical and business conversation. This is our role! We are just as excited as you are about the possibilities and in many ways just as worried, but we are in for the journey with all of our clients.
    Project Managers: Our Project Managers love that there is someone there who will control scope, time, and budget, which could derail even the best intentioned projects.
    Developers: Love the fact that they can concentrate on building amazing custom functionality, while we are leveraging as many out of the box features as we can. Our developers love to be challenged and our Solution Specialists can provide the ideas that can make this happen.

    So I hope I've provided some insight into this unique role. Truth is, we have an amazingly passionate, knowledgeable, and fun group of developers, architects, user experience designers and solution specialists who love working with SharePoint. It's fun, exciting, at times painful, but the most fun job that I have ever had.

  • InfoPath 2010 and SharePoint 2010 overview

    If you integrate external data from sources such as databases, web services, or content of your SharePoint site into a SharePoint list form--take a look at what InfoPath 2010 has to offer before going all the way with customizations.

    There has been some significant improvements to how InfoPath presents browser enabled forms and also to the way InfoPath allows you to interact with external data. In this sample--I integrate site data, as well as my twitter feed and Vimeo list of videos into a SharePoint form pretty much out of the box.

    Enjoy!

     

  • Vanspug Meeting: Taming the Rubics cube that is Sharepoint

    Yesterday we had a great Vanspug Information Worker meeting with Werner Harmse about SharePoint implementations and various approaches. Below is the abstract and the video recording.

    Some of us enjoy complex puzzles. Most people don’t. With a passion for usability engineering and human computer interaction, Werner Harmse explores how to implement SharePoint in a way that keeps the complexity of SharePoint hidden from business users while allowing them to become rapidly productive using the platform.

    Taking a journey through recent implementation scenarios he reviews typical challenges SharePoint implementers face and explore ways of dealing with business and technical issues. Along the way he will propose some creative ways of maximizing business value using SharePoint out of the box features.

  • SharePoint 2010 Document ID Service

    Business Issue

    Many clients complained that MOSS document management suffered from two inexcusable features:

    • Lack of unique identifiers for documents: Important in any Document Management System, particularly in Records Management
    • URL's to documents containing location information: If you have a look at MOSS/WSS document URL's they contained a location, but move a document to any different location, and you lose the link! This is a major shortcoming in an ECM system as it forces you to look for documents based on location, rather than on metadata.

    Many people wanted unique numbering in documents and content within SharePoint 2007, which now comes out of the box in SP 2010! In addition, you can create your own DocumentID by overriding the DocumentIDProvider abstract class so you can have whatever format of Document ID you like. What this means is that now SharePoint offers the following: 

    • Unique numbering for documents, which you can format in any way.
    • You can store documents in any location and they can still be referenced by the original URL that was assigned.
    • From a compliance, Records Management and Document Management perspective this ensures a unique identifier that can trace the document through the entire DM lifecycle.
    • Documents keep their original ID across Sites, Site Collections and even Web Applications.

    Business Value

    Potentially huge! The Document ID service fixes many issues related to ECM, and in terms of business value :

    • Time and cost savings from users not having to look for documents when incorrect URL's are sent.
    • Integration into an existing unique numbering system is now possible, great news for clients who are using existing DM systems.
    • Intelligent numbering offers up some really interesting possibilities for creating unique identifiers that actually have stored  information about the document contained within the ID.

    Limitations

    • ONLY content types that are derived from the Document Content Type will have unique ID's enabled, no list items will get ID's assigned

    Configuration  

     

    First, to enable the Document ID Feature, enable it from Site Collection Features as seen below. When this is done you will see a new option under 'Site Settings -> Site Collection Administration' called Document ID Settings. When you click on this you will see the following options available:  

    Assign Document IDs

    Assign Document ID's: Click this and all existing documents and new documents will get an ID. This relies on a timer service, so it can take a little while (the timer service located in Central Admin is called the ' Document ID Assignment Job'.

    Begin ID's with the following characters: This is the 4-12 document ID that you can configure. All that SharePoint will do is add a "- number" to the end of this like -1,-2 and so forth. If you don't like this, then you will have to write your own provider (see below.)

    Document ID Look Up Search Scope

    Use this search scope for ID Lookup: This is really cool. You can create a scope, and then if a user enters in a Document ID, it will directly open up instead of going to the results page. There are, however, some extra steps with this that I will post!

    Now instead of a location based URL there is a link to /_layouts/DocIDRedir.aspx with tdocument ID at the end!  

     

    Creating your own Provider

    If you don't the way that SharePoint increments the unique ID(which is actually adding 1 to the end) then you can always create your own. To do this, you need to do the following:

    1) Create a class that derives from Microsoft.Office.DocumentManagement.DocumentIdProvider listed below:

    namespace Microsoft.Office.DocumentManagement {

    public abstract class DocumentIdProvider { protected DocumentIdProvider(); public abstract bool DoCustomSearchBeforeDefaultSearch { get; }

    public abstract string GenerateDocumentId(SPListItem listItem);

    public abstract string[] GetDocumentUrlsById(SPSite site, string documentId); public abstract string GetSampleDocumentIdText(SPSite site); }

    2) Register the provider by using any of these methods, since I couldn’t find (and neither could Michel Berneveld who wrote  a great article about this, see below) a stsadm or powershell command.

    public static void SetDefaultProvider(SPSite site); public static void SetProvider(SPSite site, Type providerType);

    Timer Jobs

     

    There are also two timer jobs associated with the Document ID service:  

    Document ID Assignment Job: The Assignment job will assign Document ID to existing content. Remember that even if you don’t have unique ID’s associated to documents within a Site Collection you can always retroactively assign these ID’s, which is great news! Do I hear the chorus of applause, particulary from those users who are migrating from 2007 to 2010? J

    Document ID enable/disable: This timer jobs creates the Document ID column in the Document libraries.    

    Links

  • Tips and Tricks when working with BDC in SharePoint 2010

    Are you planning to bring external data into SharePoint and are unsure what approach you should take? Did you work with BDC in SharePoint 2007 and are planning to work with BCS in SharePoint 2010?

    This video is a great resource to get you started. Enjoy!

     

     

    Tips and Tricks when working with BDC in SharePoint 2010 from Habanero Consulting on Vimeo.

  • VanSPUG event Apr 21: Using SharePoint 2010 to boost productivity

    Yesterday we had an awesome time at the VanSPUG developer gathering where Shereen Qumsieh gave a great talk.

    Here is a brief abstract of the talk:

    We’ll start with material targeted at those new to SharePoint development, covering key foundational topics (like Features and the Solutions Framework) and are vital to understanding how customizations are componentized and packaged. The remainder of the session will be devoted to an examination of the new tools in Visual Studio 2010 that make SharePoint development easier than ever before. We’ll see how the new templates, wizards and designers improve productivity by automatically managing project structure and manifest files for you. We will also explore how you can use visual designers to speed the process of building Web parts and examine how the new client object models and REST services enable you to make the use of SharePoint functionality from client applications across the enterprise. Finally, we’ll see that SharePoint developers now have the same F5 deployment and debugging experience enjoyed by .NET developers for years.

     

    VanSPUG Apr 21: Using SharePoint 2010 to boost productivity from Habanero Consulting

    Enjoy!

  • Interview With Mark Bice: Insights on UI Development & SharePoint 2010

    Quite some time ago I asked Mark to share his ideas around how SharePoint 2010 will impact areas of his work. We never got a chance to sit down and do a recorded interview, ironically, because both of us were busy working on our SharePoint 2010 projects. Mark was nice enough to donate one of his evenings to send me his thoughts on questions I was going to ask:

    Q: Mark, tell us what you do at Habañero?

    A: I find the best way to sum up a UE developer is someone who is responsible for front-end development. We write HTML/CSS/JavaScript, work within the presentation tier of various web applications (C#, PHP, etc), and essentially are the bridge between engineers and designers.

    Q: What's your approach in terms of starting a new user experience project?

    A: It all starts working with IA/BA/Designers to figure out whether what is being discussed has technical implications, barriers, etc. Once we have a design direction and UE development can begin, I always start with the Masterpage and my initial page layouts. Getting this shell in place is important, and I like to have some sort of container to work within. Then I'll start on global chrome/theming (header, footer, global elements) so that the project has that initial look/feel and you can capture the essence of the design throughout the entire development process. After that it's nailing down individual pages/controls/web parts and moving through them piece by piece.

    Q: What tools do you use in your work?

    A: I write most of my code within Visual Studio (C#, JavaScript, CSS). Since I work directly with designers a lot and produce web assets from their mockups I also use Photoshop and Fireworks on a day-to-day basis (Adobe Flash on occasion). I have all modern browsers installed on my machine for testing, an iMac that sits next to me and virtual machines for testing different types of environments or browsers that are OS dependent (e.g. IE6). For script debugging and DOM inspection I prefer Firebug, but there are all sorts of other addons I use from time to time (e.g., code validators, connection throttlers for simulating slower connections, user agent spoofers, etc). I find the IE dev toolbar a bit clunky, but it can be useful for IE specific styling/JavaScript issues that may arise.

    Q: Thinking about SharePoint 2010, does your approach change? What about tools? Anything to be aware of for starting to work with SharePoint 2010 from a UE developer persepective?

    A: One big advantage to SP 2010 is that it no longer officially supports IE6 and has significantly improved the page layouts and masterpage rendering. This makes it easier to style out-of-the-box components and requires less browser-specific hacks. Another thing I really like about 2010 is how much more flexibility there is on the client-side. Having the JavaScript API for the Client Object Model (COM) means I can write pretty cool web parts that interact with the SP back-end all from the client, no custom services required. I can create/update lists, query pretty much anything I want and it's super simple to do. Lastly, the development tools themselves are much improved. SharePoint integration into Visual Studio 2010 makes creating features, web parts, etc, a snap and really empowers the UE dev in this way. The GUI is fairly simple and easy to use so it gives me a lot more freedom, reduces overhead, and makes the overall development process quicker.

    Q: You've been working with SharePoint for quite some time now, and I bet you see where the product is going and maybe some of the improvements that may come in the future. Anything in particular you'd like to share?

    A: Well I think there is still improvement that can be done to the UI rendering. The layouts are greatly improved, but some of the web parts are still using tables and semantically incorrect markup. Also, community developers and knowledge sharing is key for any new product. Right now support is quite poor and it would be nice to see that evolve in a more positive direction in the coming months after SP 2010 goes RTM. I really hope that UE developers within the SharePoint community can take advantage of the COM JavaScript API and leverage an easier web part development experience to create all sorts of cool custom controls and make it a better product offering overall.

    That's it, I hope you too found a few goodies in Mark's interview!

     

     

  • Tips & Tricks: Creating complex SharePoint 2010 ribbon elements

    In case you haven’t noticed – SharePoint 2010 says it loud and clear that ribbon UI is here to stay.

    In this 30 min screencast we’ll learn how to:

    1. Create a custom ribbon element (button) in SharePoint.
    2. Wire a handler to a newly created button.
    3. Create other complex ribbon elements (ex. FlyoutAnchor) that you see in out of the box SharePoint 2010 ribbon.
    4. Create a custom tab for your ribbon and host your custom elemts in it.

     

    Tips & Tricks: Creating complex SharePoint 2010 ribbon elements from Yaroslav Pentsarskyy on Vimeo.

  • Programmatically Change Content on a Wiki Page in SharePoint 2010

    Kam Lau
    March 30, 2010

    SharePoint 2010 comes with some exciting new features, one of which revolves around the Wiki Pages and/or Site Pages and is primarily end-user centric. This feature allows end-users to place different elements on a page, similarly to how they would normally author an HTML page. Common SharePoint functions like Web Parts can also be inserted inline inside the Wiki page without having predefined Web Part zones on the page layout itself. More about this later...

    The default site definition in SharePoint 2010 comes with a Site Page example:

     Default SharePoint 2010 Home Page

    We can programatically change the content of this page using the SharePoint API.  Before we do this, we need to understand a few things:

    1. The Wiki Page is like any other SharePoint page but with a special field called "WikiField"
    2. The content of WikiField is HTML
    3. Any Web Part that you insert into the Wiki Page is managed by a hidden Web Part Zone referenced as "WPZ"
    4. If you want to be able to apply the columns settings provided on the Wiki page editing tool bar, you will need to format the HTML accordingly

    With this in mind, let's look at the code. The following code example is writen as a command-line tool to make it simple to understand. Of course you can do the same inside a feature receiver or an stsadm extension, or even as commandlets to be used in PowerShell.

    First we define the high level logic of what we will be doing:

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Microsoft.SharePoint;
    using Microsoft.SharePoint.Utilities;
    using Microsoft.SharePoint.Publishing.WebControls;
    using Microsoft.SharePoint.WebPartPages;
    using System.Web.UI.WebControls.WebParts;
    using System.Globalization;
    
    namespace ChangeContentOfWikiPage
    {
    	class Program
    	{
    		static void Main(string[] args)
    		{
    			Execute();
    		}
    
    		private static void Execute()
    		{
    			using (SPSite site = new SPSite("http://YourServerUrl/"))
    			{
    				using (SPWeb web = site.OpenWeb())
    				{
    					// use an extension method to return a SPList representating the Site Pages Library
    					SPList sitePagesLibrary = web.GetSitePagesLibrary();
    					
    					// Ensure the site pages library exists and is the right type
    					EnsureSitePagesLibrary(web, sitePagesLibrary);
    
    					// 
    					string homePageFileName = SPUtility.GetLocalizedString("$Resources:core,WikiPageHomePageName;", "core", web.Language);
    					string homePageUrl = string.Concat(new object[] { sitePagesLibrary.RootFolder.ServerRelativeUrl, '/', homePageFileName, ".aspx" });
    					SPFile homePage = web.GetFile(homePageUrl);
    					if (homePage.Exists)
    					{
    						// instantiate a webpart that you like to add to the Wiki page
    						ContentEditorWebPart wp = new ContentEditorWebPart();
    						wp.Title = "Test Web Part";
    
    						// Replace the current wiki page content
    						ChangeWikiContent(homePage, GenerateNewWikiContent());
    
    						// insert the web part to the Wiki page with a specific content.
    						InsertWebPartIntoWikiPage(homePage, wp, "{{1}}");
    					}
    				}
    			}
    		}
    	}
    }

    The extension method for SPList is defined as:

    public static class SharePointExtensions
    {
    
    	public static SPList GetSitePagesLibrary(this SPWeb web)
    	{
    		SPList wikiList;
    
    		try
    		{
    			string serverRelativeUrl = web.ServerRelativeUrl;
    			if (serverRelativeUrl == "/")
    			{
    				serverRelativeUrl = "/SitePages";
    			}
    			else
    			{
    				serverRelativeUrl = serverRelativeUrl + "/SitePages";
    			}
    			wikiList = web.GetList(serverRelativeUrl);
    		}
    		catch
    		{
    			wikiList = null;
    		}
    		if ((wikiList != null) && (wikiList.BaseTemplate != SPListTemplateType.WebPageLibrary))
    		{
    			wikiList = null;
    		}
    
    		return wikiList;
    
    	}
    }

    Let's look at some of the methods being referenced by the Execute() method.

    The EnsureSitePagesLibrary method checks and ensures the SPList is ready and is of the right type.

    private static void EnsureSitePagesLibrary(SPWeb web, SPList sitePagesLibrary)
    {
    	if (sitePagesLibrary == null)
    	{
    		sitePagesLibrary = web.Lists.EnsureSitePagesLibrary();
    	}
    
    	if (sitePagesLibrary == null)
    	{
    		throw new SPException(SPResource.GetString("ListGone", new object[0]));
    	}
    	if (sitePagesLibrary.BaseTemplate != SPListTemplateType.WebPageLibrary)
    	{
    		throw new SPException(SPResource.GetString("OnlyInWikiLibraries", new object[0]));
    	}
    	if (sitePagesLibrary.ParentWeb != web)
    	{
    		throw new SPException(SPResource.GetString("WikiNotInWebException", new object[0]));
    	}
    }

    The GenerateNewWikiContent() method creates a string that has the required HTML elements and also contains a string token {{1}} that we will replace with a Web Part reference later. The HTML elements are essential to ensure end-users can apply columns to the page.

    public static string GenerateNewWikiContent()
    {
                    StringBuilder sb = new StringBuilder("");
                    StringBuilder column1 = new StringBuilder("");
                    StringBuilder column2 = new StringBuilder("");
    
                    sb.Append("<table id='layoutsTable' style='width: 100%'><tbody><tr style='vertical-align:top'>");
    
                    // prepare the content of column 1
                    column1.Append("<td style='width: 66.6%'><div class='ms-rte-layoutszone-outer' style='width:100%'><div class='ms-rte-layoutszone-inner' style='min-height:60px;word-wrap:break-word'>");
                    column1.Append("<p class='ms-rteFontSize-6 ms-rteThemeForeColor-7-0' style='font-size: 32px;'>Welcome to your site!</p>");
                    column1.Append("<p/>");
                    column1.Append("<p>Add a new image, change this welcome text or add new lists to this page by clicking the edit button above. You can click on Shared Documents to add files or on the calendar to create new team events. Use the links in the getting started section to share your site and customize its look.</p>");
                    column1.Append("<p/>");
    
                    // the following is a token that will be replaced by InsertWebPartIntoWikiPage()
                    column1.Append(" {{1}}");
    
                    column1.Append("</div></div></td>");
    
    
                    // prepare the content of column 2
                    column2.Append("<td style='width: 33.3%'><div class='ms-rte-layoutszone-outer' style='width: 100%'><div class='ms-rte-layoutszone-inner' style='min-height: 60px; word-wrap: break-word'>");
                    column2.Append("</div></div></td>");
    
                    sb.Append(column1.ToString());
                    sb.Append(column2.ToString());
                    sb.Append("</tr></tbody></table><span id='layoutsData' style='display: none'>false,false,2</span>");
    
                    return sb.ToString();
    }

    The ChangeWikiContent() method applies the changes to the "WikiField" of the SPItem that represents the page and updates the item.

    public static void ChangeWikiContent(SPFile wikiFile, string content)
    {
    	if (wikiFile == null)
    	{
    		throw new ArgumentNullException("wikiFile");
    	}
    
    	wikiFile.Item["WikiField"] = content;
    	wikiFile.Item.Update();
    }

    The InsertWebPartIntoWikiPage() method inserts a web part instance into the Wiki Page by first inserting the web part into the web part zone "WPZ", and then converts its Storage Key into an ID that is recognizable by SharePoint Wiki Pages. Once we have this ID, we get the "WikiField" content and replace the string token {{1}} already inserted as part of the content with the ID.

    public static void InsertWebPartIntoWikiPage(SPFile wikiFile, System.Web.UI.WebControls.WebParts.WebPart webpart, string replaceToken)
    {
    	if (wikiFile == null)
    	{
    		throw new ArgumentNullException("wikiFile");
    	}
    	if (webpart == null)
    	{
    		throw new ArgumentNullException("webpart");
    	}
    	string str = (string)wikiFile.Item["WikiField"];
    
    	SPLimitedWebPartManager limitedWebPartManager = wikiFile.GetLimitedWebPartManager(PersonalizationScope.Shared);
    	Guid storageKey = Guid.NewGuid();
    	string str2 = StorageKeyToID(storageKey);
    	webpart.ID = str2;
    	limitedWebPartManager.AddWebPart(webpart, "wpz", 0);
    	string str3 = string.Format(CultureInfo.InvariantCulture, "<div class='ms-rtestate-read ms-rte-wpbox' contentEditable='false'><div class='ms-rtestate-read {0}' id='div_{0}'></div><div style='display:none' id='vid_{0}'/></div>", new object[] { storageKey.ToString("D") });
    	if (str == null)
    	{
    		str = str3;
    	}
    	else
    	{
    		if (!str.Contains(replaceToken))
    		{
    			str = str + str3;
    		}
    		else
    		{
    			str = str.Replace(replaceToken, str3);
    		}
    	}
    	wikiFile.Item["WikiField"] = str;
    	wikiFile.Item.Update();
    }

    And lastly, the StorageKeyToID() method helps convert the Storage Key to an ID referenecable inside a "WikiField" content:

    public static string StorageKeyToID(Guid storageKey)
    {
    	if (!(Guid.Empty == storageKey))
    	{
    		return ("g_" + storageKey.ToString().Replace('-', '_'));
    	}
    	return string.Empty;
    }

    In the above code example, I replaced the existing content of the Wiki Page with my own message, as well as inserting an OOTB Content Editor Web Part into part of the Wiki Page content, all through code. Here is what the page looks like after the code executed:

    Modified Wiki Page

    Hope you find this blog post useful!

  • Windows Live Id Integration With SharePoint 2010 (Part 2 of 3)

    Tommy Lum
    March 29, 2010

    Part II - Configuring SharePoint 2010 to use a Custom FBA Provider

    The steps below will describe how you can configure a SharePoint 2010 web application to use the custom authentication provider you created in part I of this series.

    1. Open SharePoint 2010 Central Administration and click on Manage Web Applications

         SharePoint 2010 Central Administration  - Manage Web Applications

     2. Click the New button to create a new web application

         Create a new web application

    3. Fill out the information on the form.

    • Select Claims-Based Authentication
    • Enable Forms Based Authentication(FBA) and specify the name of you custom membership provider and role manager provider
    • Specify  to use the default sign-in page

        Select claims based authentication

    Enable FBA Authentication and specify membership and role provider names

     

    4.  Navigate to the virtual directories of your new web application and central administration. 

          By default, the virtual directories should be in c:\inetpub\wwwroot\wss\VirtualDirectories\

     Web Application Virtual Directories

     

    5.  Open the web.config in the central admin virtual directory and add the following configuration. 

    Note: Remember to replace the name of the assembly (name, version, public key).  This information can be found in by browsing to C:\Windows\Assembly, finding your assembly, and selecting properties.  If the assembly is not there yet, add it by deploying your WSP file or manually adding the assembly to the GAC.

       

    <system.web>
      <roleManager defaultProvider="AspNetWindowsTokenRoleProvider" enabled="false">
        <providers>
          <add applicationName="/" name="CustomRoleProvider" 
               type="CustomFBAAuth.CustomRoleProvider, CustomFBAAuth, 
                     Version=1.0.0.0, Culture=neutral, 
                     PublickKeyToken=e1e8ab661f1bbe8f" />
        </providers>
      </roleManager>
      <membership defaultProvider="CustomMembershipProvider">
        <providers>     
          <add applicationName="/" name="CustomMembershipProvider" 
               type="CustomFBAAuth.CustomMembershipProvider, CustomFBAAuth, 
                     Version=1.0.0.0, Culture=neutral, 
                     PublickKeyToken=e1e8ab661f1bbe8f" />
        </providers> 
      </membership>  
    </system.web>

    6.  Open the web.config in your new web application’s virtual directory and add the following configuration:

    <system.web> 
      <membership defaultProvider="i">
        <providers> 
          <add name="i" type"Microsoft.SharePoint.Administration.Claims. 
                             SPClaimsAuthMembershipProvider, 
                             Microsoft.SharePoint, Version=14.0.0.0,                                
                             Culture=neutral, 
                             PublicKeyToken=71e9bce111e9429c" /> 
          <add applicationName="/" name="CustomMembershipProvider" 
               type="CustomFBAAuth.CustomMembershipProvider, CustomFBAAuth, 
                     Version=1.0.0.0, Culture=neutral, 
                     PublickKeyToken=e1e8ab661f1bbe8f" />
        </providers> 
      </membership>
      <roleManager defaultProvider="c" enabled="true" cacheRolesInCookie="false"> 
        <providers> 
          <add name="c" type="Microsoft.SharePoint.Administration.Claims.
                              SPClaimsAuthRoleProvider, Microsoft.SharePoint,
                              Version=14.0.0.0, Culture=neutral, 
                              PublicKeyToken=71e9bce111e9429c" />
          <add applicationName="/" name="CustomRoleProvider" 
               type="CustomFBAAuth.CustomRoleProvider, CustomFBAAuth,
                     Version=1.0.0.0, Culture=neutral,  
                     PublickKeyToken=e1e8ab661f1bbe8f" />
        </providers> 
      </roleManager>
    </system.web>

    7.  Navigate to the SecurityToken service directory(C:\Program Files\Common Files\Microsoft Shared\ Web Server Extensions\14\WebServices\SecurityToken)

    8.  Open the web.config  file in the SecurityToken service directory and add the following configuration:

    <system.web>
      <membership defaultProvider="CustomMembershipProvider">
        <providers> 
          <add applicationName="/" name="CustomMembershipProvider"
               type="CustomFBAAuth.CustomMembershipProvider, CustomFBAAuth, 
                     Version=1.0.0.0, Culture=neutral, 
                     PublickKeyToken=e1e8ab661f1bbe8f" /> 
          </providers>
        </membership> 
      <roleManager defaultProvider="CustomRoleProvider" enabled="true">
        <providers>
          <add applicationName="/" name="CustomRoleProvider" 
               type="CustomFBAAuth.CustomRoleProvider, CustomFBAAuth, 
                    Version=1.0.0.0, Culture=neutral, 
                    PublickKeyToken=e1e8ab661f1bbe8f" />
        </providers>
      </roleManager>
    </system.web>

    9.  Open SharePoint 2010 Central Administration again and create a new site collection using the new web application you created.

          SharePoint 2010 Central Administration - Create site collecitons

     

    10.  Configure one of the FBA users as the site collection administration

        Create site collection

    11.  Navigate to your new site and you should be prompted with the screen below.  Choose Forms Authentication in the drop down box

    Select forms authentication

    12.  Enter your credentials and you should be logged-in as one of the form-based authentication users using your custom authentication provider.Enter credentials on form

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. Next page »

Please Upgrade Your Browser

This site's design is only visible in a graphical browser that supports web standards, but its content is accessible to any browser or Internet device.