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

  • Working With Advanced List Options in SharePoint 2010

    In my last article you read how to set item-level permissions on list items for both read and write access. In this article I wanted to dive into a few more functions that you see on the advanced settings page of the list: disabling list item attachments, specify whether the “New Folder” command is available, and specify whether this list should be visible in search results.

    The last option that allows you to exclude the list from search results is particularly great. This option will not overwrite permissions to the list (i.e., users that have no access to the list won’t see it anyway). It’s still nice to be able to exclude the list from crawl even if users have read-only access to improve the cleniness of the search results.

    As last time, I will present the list using the explicit specification, so that you can run it in a console application project:

    SPSite site = new SPSite(”http://localhost”);
    SPList userList = site.OpenWeb().Lists["MyList"];

    // Specify whether this list should be visible in search results
    userList.NoCrawl = true;

    // disabling list item attachments
    userList.EnableAttachments = false;

    // Specify whether the “New Folder” command is available
    userList.EnableFolderCreation = false;
    site.Dispose();

    In reality, you will probably end up running this in a feature receiver or in some sort of a portal configuration script or application.

    Enjoy!

  • Creating Site-level Ribbon Tabs in SharePoint 2010 and Hiding Ribbon on Demand

    In this article I will assume you have already read and understand how to provision ribbon on the page. If not, refer to this article.

    Here we’ll focus on what you need to do to create a new ribbon tab on the site level, which seems to be a hot topic these days. You need to perform two things:

    1. In your SharePoint 2010 project, add a new empty element item and define the following XML:

     <[default] ”http://schemas.microsoft.com/sharepoint/”:Elements xmlns="”http://schemas.microsoft.com/sharepoint/”"> <[default] ”http://schemas.microsoft.com/sharepoint/”:CustomAction id="”MyProject.RibbonButton”" Location="”CommandUI.Ribbon”"> <[default] ”http://schemas.microsoft.com/sharepoint/”:CommandUIExtension> <[default] ”http://schemas.microsoft.com/sharepoint/”:CommandUIDefinitions> <[default] ”http://schemas.microsoft.com/sharepoint/”:CommandUIDefinition Location="”Ribbon.Tabs._children”"> <[default] ”http://schemas.microsoft.com/sharepoint/”:Tab id="”MyProject.Ribbon.HelloTab”" title="”Custom"> <[default] ”http://schemas.microsoft.com/sharepoint/”:Scaling id="”Ribbon.Read.Scaling”">  <[default] ”http://schemas.microsoft.com/sharepoint/”:Groups id="”Ribbon.Read.Groups”">        

    Feel free to add any controls to your group as needed.

    2. Enable this tab on each page of your site. This step is something very specific to site-wide ribbon tabs. To achieve the goal you can either create a user control that will sit in your masterpage (header or footer) or delegate control and it will be called on each page. The code that you will run in this user control will be something like this:

    Microsoft.SharePoint.WebControls.SPRibbon.GetCurrent(this.Page).MakeTabAvailable(”MyProject.Ribbon.HelloTab”);
    

    You can use this to verify that the tab was already enabled:

    Microsoft.SharePoint.WebControls.SPRibbon.GetCurrent(this.Page).MakeTabAvailable(”MyProject.Ribbon.HelloTab”);
    

    Keep in mind that this needs to run each time the page is loaded and the tab will show up along with all of the rest of the contextual tabs.

    In some cases you would want to disable the whole ribbon in your page. How do you do that?

    You need to follow Step 2 and create user control or a delegate control, but this time it will call the following code:

    Microsoft.SharePoint.WebControls.SPRibbon.GetCurrent(this.Page).CommandUIVisible = false;
    

    Good luck!

  • Create a Stand-alone/non-AD SharePoint 2010 Environment With SQL Enterprise

    Often there are times when you might need to create a SharePoint environment for either demonstration or to do some development, and you do not wish to add your environment to a domain, making it domain dependent.

    At the same time, you either want the added functionality of a full SQL installation, or you just want to avoid the size constraint issues caused using the express edition of SQL.

    With MOSS 2007 this was not a difficult proposition. All you had to do was run the SharePoint configuration utilitly and configure a complete install using a local account and point to the local SQL server.

    This is no longer the case with SharePoint 2010.

    If you try to run the configuration utility after installation completes, you are now greeted with an unfriendly error message stating you can only configure this installation on a domain.

    To work around this issue install SQL 2K8 Enterprise SP1 and all the prerequisites, run all updates, and then run the SharePoint 2010 installation.

    When the installation completes, close the SharePoint configuration utility when it pops up and instead launch the SharePoint 2010 management power shell.

    From the management shell, type in "New-SPConfigurationDatabase" and press enter.

    Enter the desired credentials when prompted and wait a minute or two for the process to complete.

    Once complete, you can close the shell and launch the SharePoint configuration utility again.

    This time, select "join an existing domain", and you are on your way, just as before.

  • User Experience of Four Seasons

    Jasvir Shukla
    January 29, 2010

    A couple of weeks ago, I was lucky enough to join a field trip to the Four Seasons Hotel Vancouver with the Vancouver User Experience Group (VanUE).  Not only were the lobster rolls are amazing (we got a live demo below!), but we had an inside look at how Four Seasons designs the guest experience.

    Food demo at Four Seasons Yew Restaurant

    Thanks to Jennifer for the photo. She has shared more on Flickr too!

    Some of my other highlights from the tour:

    Standards are dynamic

    Four Seasons has very precise standards for all hotel operations, everything from how long a guest waits for coffee to what gets captured in the guest database. All staff are aware of the standards and trained rigorously on them. Managers monitor standards every day by being in the lobby, watching the restaurant, and looking at how efficiently the work is being executed.

    Everyone is aware of standards, but staff have the flexibility to treat a guest like a person and 'tweak' standards when they don't make sense in a certain situation. During daily briefings, staff talk about standards and share stories of how they may have adjusted them.

    I think it's amazing that all levels of standards have been thought through and are monitored daily. Staff always know where the bar is set and have a solid foundation to base all their actions on. Standards are not sitting collecting dust though; they are assessed, adjusted, and alive during the daily operation of the hotel. It would be amazing if design standards on a project were so integrated into the life of a project and beyond...

    Anticipate and personalize

    Four Seasons does many things throughout the hotel to anticipate the needs of people. For example:

    • At the bar, staff put down a napkin and coaster to indicate they are paying attention and ready to take an order (as well as signalling to other staff that the guests are taken care of)
    • At the restaurant if someone in a group orders water, the server brings water for everyone. (I hate it when servers just bring the one water, and everyone has to then order separately!)
    • During the 'turn-down' service to prepare a room for bedtime, staff move the alarm clock to a 45-degree angle, remove excess pillows from the bed, move shoes from the middle of the floor, put remotes in easily accessible areas from the bed/sofa, etc.   

    Anticipating the needs of users is what we do sub-consciously all the time, but real personalization takes time, thought, and care. When done well though, it can create a smooth seamless experience for a user.

    Surprise and the wow-factor

    In some situations it may be possible to surprise a guest, and Four Seasons gives its staff the discretion to go the extra mile. For example, a guest may have forgotten a coat in a parked car, and the valet may offer to get it. At the car, the valet notices the guest left a cell phone in the car too, and picks it up just in case the guest wants it. When they see the guest, the valet may ask "did you also need your cell phone?", and if the guest responds positively, the valet will give them the cell phone too. It's common sense really, but if and when it happened, I know I would be very pleasantly surprised.

    Four Seasons has many anecdotes like this, and I love to think about the wow-factor in our designs that inspire this kind of delight.

    Four Seasons staff provide the ultimate hotel guest service and, true to their impeccable standards, they planned this event perfectly. Thank you to VanUE and Four Seasons Vancouver for this wonderful event!

  • Using the “Processing” Page in Your SharePoint 2010 Custom Modules

    If you have ever worked with MOSS or SharePoint 2010 you remember this page:
    long operation

    It appears when you create new sites or run any other long-running operations.

    Now, did you know that it’s very easy to have this page displayed during your own long-running operations? Not only that, it will redirect back to your code when it’s done with the execution.

    Let’s say I have a UserControlWebpart in my SharePoint solution, and in my OnLoad method I call a couple of long-running operations and want the “Processing” page to show up. When completed, I want to come back to my page where the UserControlWebpart is. Here is all I need to wrap my custom long-running code with:

    string comeBackUrl = this.ViewState["__REFERER__"].ToString();
    using (SPLongOperation operation = new SPLongOperation(this.Page))
    {
     operation.Begin();
     //….. your code here ….
     operation.End(comeBackUrl, Microsoft.SharePoint.Utilities.SPRedirectFlags.DoNotEncodeUrl, HttpContext.Current, null);
     }
    That`s all that you need to do; SharePoint takes care of the rest. 
  • Importing BCS Model using Powershell

    Larry Lau
    January 28, 2010

    After creating your External Content Type in SharePoint Designer 2010, you have an option to export your external content type as XML which you can twist it further. Now you need to deploy these external content types to the production environment. SharePoint Designer is not an option since there is no "Import from XML" feature within Designer. Besides, Designer isn’t installed on the production environment anyway. The other way to do is via Central Administration. The UI is not terriblely easy to use. The import button is buried in different UI elements that can be hard to spy. Here is how you can do it in couple of lines of PowerShell script:

    param(
    [string]$SiteUrl=$("http://localhost")
    )
    
    Write-Host "Getting Service Context at $SiteUrl..."
    
    $svcContet = Get-SPSiteAdministration -Identity $SiteUrl
    
    Write-Host "Getting Business Data Catalog Metadata Object..."
    
    $catalog = Get-SPBusinessDataCatalogMetadataObject -BdcObjectType Catalog -ServiceContext $svcContet 
    
    Write-Host "Importing BCS Modal..."
    
    Import-SPBusinessDataCatalogModel -Identity $catalog -Path ".\RinkNetModel.xml" -force -ModelsIncluded -PropertiesIncluded -PermissionsIncluded -Verbose -ErrorAction Stop -ErrorVariable $err
    
    
  • Creating an External List Programmatically

    Larry Lau
    January 27, 2010

    An external list is one of the most-asked for features in SharePoint 2010 from developers. It allows users to expose data as a SharePoint list from common data sources such as a relational database or web services. Once the external list is created, developers can access the data via the list API that they are familiar with. 

    I wanted to create the external list from an external content type programmatically in a feature receiver on activate. Nothing is out there from Google nor Bing about how to do this. I found that there is a new overloaded method to create the list on the SPListCollection class that takes an instance of SPListDataSource. SPListDataSource contains the information about how to get data from BCS. If you have created a BCS  model or external content type using SharePoint Designer, then you will know all the values required to create an instance of SPListDataSource that works with your BCS model.

    Here is what I used to create mine (you need to know the values for the LobSystemInstance, EntityNamespace, Entity and SpecificFinder):

    SPListDataSource ds = new SPListDataSource();
    ds.SetProperty(SPListDataSource.BDCProperties.LobSystemInstance, "RinkNet");
    ds.SetProperty(SPListDataSource.BDCProperties.EntityNamespace, "RinkNet.CurrentPlayers");
    ds.SetProperty(SPListDataSource.BDCProperties.Entity, "CurrentPlayers");
    ds.SetProperty(SPListDataSource.BDCProperties.SpecificFinder, "CurrentPlayersRead Item");
    
    using (SPSite site = new SPSite("http://localhost"))
    {
      using (SPWeb web = site.RootWeb)
      {                   
        web.Lists.Add("CurrentPlayers", "", "Lists/CurrentPlayers", ds);
      }            
    }
    
    
  • SharePoint 2010 "Error on Page" when browsing with IE 8

    Avery Davidow
    January 27, 2010

    There are certain pages in SharePoint 2010 Central Administration that will throw an "Error on Page" error when you are browsing with Internet Explorer 8 and you try to perform an action.

    For example, when trying to edit a user profile synchronization connection:

     edit 

    You get:

     ErrorOnPage

    To get around this you can either use a different browser, or from the page that's causing the error you can do the following:

    • Launch Internet Explorer 8 and browse to the page that's throwing the error
    • Press F12 to open the Developer Tools
    • Set the Browser Mode: to IE7
    • Close the Developer Tools and try again

     Browser Mode

  • Calling the Rating Service using JQuery in SharePoint 2010 Part 2

    Adam Crandall
    January 27, 2010
    In Part 1 of this post, we looked at how to create a JQuery plugin to communicate with the Rating web service in SharePoint 2010.  Here we'll look at how to register the scripts in our SharePoint site.

    Registering the Script
    In order for our custom JQuery plugin to work we need to get the script registered on our pages, to do this we use a delegate control in a SharePoint Module that is included in a SharePoint feature and activated when deployed.  These delegate controls are fired as part of the page life cycle.

    To do this, follow these steps:
    1. Add a new user control to your solution under the ControlTemplates mapped folder called RatingControlDelegate.ascx
    2. On the pre-render method of the control, register the client script as shown below
    3. Ensure that you hvae the RatingControl.js, JQuery and JQuery JSon script files in a folder in the Templates mapped folder (we put ours in Templates/Layouts/Common/Scripts for the JQuery and JQuery JSon scripts and Templates/Layouts/RatingControl for the RatingControl.js file)
    4. Ensure that the Template folder is included in your Package so that it is deployed when deploying your SharePoint Solution
    5. Create a New Module called RatingControlDelegate in your solution, and make sure the Elements file looks as follows:
       

    Your RatingContol should look like this:
    using System;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Text;
    using Microsoft.SharePoint;
    using Microsoft.SharePoint.WebControls;
    using System.Web;
    
    namespace CustomRating.SharePoint.Controls
    {
        public partial class RatingControlDelegate : UserControl
        {
            const string scriptKey = "RatingControl";
            const string scriptFile = "/_layouts/RatingControl/RatingControl.js";
            const string JQueryScriptFile = "/_layouts/Common/scripts/jquery-1.3.2.min.js";
            const string JQueryJSONScriptFile =  "/_layouts/Common/scripts/jquery.json-2.2.min.js";
    
            private string relativeUrl = (SPContext.Current.Site.RootWeb.ServerRelativeUrl == @"/" ? "" : SPContext.Current.Site.RootWeb.ServerRelativeUrl);
    
            protected void Page_Load(object sender, EventArgs e)
            {
            }
    
            protected override void OnPreRender(EventArgs e)
            {
                base.OnPreRender(e);
    
                RegisterClientScriptInclude(this, "JQueryScript", JQueryScriptFile);
                RegisterClientScriptInclude(this, "JQueryJSONScript", JQueryJSONScriptFile);
                RegisterClientScriptInclude(this, scriptKey, string.Format("{0}{1}", relativeUrl, scriptFile));
    
            
                StringBuilder initScript = new StringBuilder("$(document).ready(function() {{");
                initScript.AppendLine("$('.ms-blogpostdatecol').RatingControl({{");
                initScript.AppendLine("CurrentUser:'{0}'");
                initScript.AppendLine("}});");
                initScript.AppendLine("}});");
    
                // register inline script block
                RegisterStartupScript(
                    this, scriptKey, string.Format(initScript.ToString(), HttpContext.Current.User.Identity.Name.Replace("\\", "\\\\"))
                    );
    
            }
            
             /// 
    	/// Checks if the specified JavaScript library is already registered and registers the script library
    	/// 
    	/// The web part instance invoking this method.
    	/// The key of the client script to register.
    	/// The URL of client-side script include to register.
    	private void RegisterClientScriptInclude(Control control, string scriptKey, string scriptUrl)
    	{
    	    ClientScriptManager csMgr = control.Page.ClientScript;
    
    	    // register library if not already registered
    	    if (!csMgr.IsClientScriptIncludeRegistered(scriptKey))
    	    {
    		csMgr.RegisterClientScriptInclude(scriptKey, scriptUrl);
    	    }
    
    	}
    
    
    	/// 
    	/// Registers an unique instance of an inline script block
    	/// 
    	/// The web part instance invoking this method.
    	/// The key of the startup script to register.
    	/// The startup script literal to register.
    	private void RegisterStartupScript(Control control, string key, string script)
    	{
    	    RegisterStartupScript(control, key, script, true);
            }
            
            /// 
    	/// Registers an unique instance of an inline script block
    	/// 
    	/// The web part instance invoking this method.
    	/// The key of the startup script to register.
    	/// The startup script literal to register.
    	/// A Boolean value indicating whether to add script tags.
    	private void RegisterStartupScript(Control control, string key, string script, Boolean addScriptTags)
    	{
    	    ClientScriptManager csMgr = control.Page.ClientScript;
    
    	    // create unique key for inline script block
    	    string initScriptKey = string.Format("{0}{1}", key, control.ClientID);
    
    	    // register inline script block
    	    if (!csMgr.IsClientScriptIncludeRegistered(control.GetType(), initScriptKey))
    	    {
    		csMgr.RegisterStartupScript(control.GetType(), initScriptKey, script, addScriptTags);
    	    }
            }
        }
    }
    
    
    The above registers the scripts we need, and passes in the current user's username (CurrentUser) in the opts object to our JQuery plugin.

    If you now deploy this solution and activate your feature, any page that contains the target HTML will be setup to allow an Up/Down voting.  You will need to supply the icons and CSS to style your buttons.
  • Mental Models & Sharpening Pencils

    When I graduated from university, I was fortunate to spend time overseas looking for inspiration and direction. The experiences were amazing and I did find an inspiration ... to learn as much as I could about anything that interested me. When I returned to Calgary I decided I should spend some time with my family so I hopped a bus to head home. In my travels I met a fascinating person that recommended a book to me and I figured a 7 hour bus ride was the best venue possible to start learning.

    The book I picked up and read on that bus ride was "The Fifth Discipline" by Peter Senge.

    Ladder of Inference

    Without dating myself I'll just say that this book has been around for quite some time and it was the formative text for the concept of learning organizations. For me this book contains some extremely compelling messages, none more fascinating than the discussion around the "Ladder of Inference" concept. At that time in my life I had not spent time sitting around thinking about how I think. And quite frankly what normal person does? But this section help me develop insights into crazy group interactions I had experienced during those late night university group project sessions.

    [ I would really like to give credit to the site lending me the above Ladder of Inference image but I've had it for so long that I don't remember the site and now I can't find the image online again! ]

    The Ladder of Inference is a model that helps us understand how people can have the exact same data and situational experience and yet come to completely different conclusions about what they have just witnessed or experienced. The model is relatively simple, showing how we as individuals take real data and situation experience, filter out data that doesn’t suit our beliefs, add meaning to the data based on our cultural and personal experiences, make assumptions on that meaning we have applied, draw our own conclusions, adapt our beliefs and take action.

    Winds and bears

    I have a simple example that illustrates how this model works. Imagine 2 people sitting inside a coffee shop looking out a window. In the distance they can both see the top half of a lone tree. Over the course of their conversation, they both notice that the tree periodically appears to bend and sway. A pretty normal and possible scenario. Person #1 looking at this situation is from Winnipeg and is used to windy days and periodic gusts of wind (sorry for leveraging a stereotype about windy days in Winnipeg!). In looking at the scenario in front of her (without being able to see all of the data – like the bottom half of the tree); she comes to the conclusion that there must be some gusty winds outside. Person #2 is from Banff and is used to witnessing the behavior of bears. In viewing this same scenario he is wondering if there may be a bear pushing on the tree. Both plausible conclusions.

    Without all of the data and looking through their 'situational experience', it is feasible that both of them are correct in this situation. Until more data is exposed that challenges or supports their underlying assumptions (based on their backgrounds and individual experiences) it isn’t possible to determine who is more or less accurate in their conclusion.

    This model has direct applicability to Habañero and what we do . While the ladder of inference applies in numerous ways, I’ve picked a couple of interdependent scenarios to showcase its potential influence on us and our customers.

    Requirements gathering and definition

    How often does this happen? Two people read or hear the same set of requirements and yet come to completely different conclusions about what was asked for and the solution to solve the problem. Individually, we are limited by the depth of our knowledge and experience and therefore having numerous perspectives on a set of requirements actually helps us get closer to an ideal conclusion and solution. This is why it is important to gather requirements that are reasonably complete and objective to help minimize the interpretation variance for all audiences. That is our role as consultants as well … help reduce the variability for our customers.

    Healthy debate to sharpen our pencils

    Understanding how we think and come to our conclusions as consultants further reinforces the importance of healthy debate in an organization like Habañero. Exploring for more meaning behind other people’s opinions and presenting an alternate set of perspectives shouldn’t be construed as a threat to our own thinking and conclusions. Rather it really is an opportunity to broaden our data and experience set to make more informed conclusions and decisions in the future. And it also implies that as we consider more data points, our conclusions become more informed. This is why vibrant collaboration and debate is so healthy for Habañero … it constantly pushes all of us to higher levels of informed thinking in our work and on behalf of our customers.

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 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.