SharePoint 2010 Theme Test

by fkollmann 6/25/2010 12:06:42 PM

As I tried to understand which colors match in SharePoint 2010 I created a test theme (using the Theme Builder, see theme download below):

image

This results in the following screens…

System

image

image

image

image

Views

image

image

image

image

Menus

image

image

Ribbon

image

image

Popups

 image

image

image

image

WebParts

image

image

image 

Special

image 

image 

DOWNLOAD Theme

Theming in SharePoint 2010

by fkollmann 6/24/2010 6:04:15 PM

As many might have already noticed the theming support of SharePoint 2010 was completely changed. It took me some time and a lot of research to get a good understand on how it works now. I would like to give a small summary and leave the rest to some articles which explain it quite well:

  1. Themes come from Office Design files
    They are either created using the SharePoint web interface (but cannot be saved then) or by using Office 2007+.

    Read more on which colors are applied where.
    Read more on how to create theme files using PowerPoint.
    Read more on how to create theme files using OpenXML.
    Try out the Microsoft Theme Builder.

  2. CSS files and images can be themed
    This means that when you create web parts for SharePoint, make sure they match the SharePoint 2010 default coloring.

    Read more on how the themes are being applied and themed versions of CSS files and images are being created.
    Read more on how to make your own CSS file and images to be themable.

  3. CSS files and images cannot be customized
    There is no reliable and acceptable way to modify themed CSS files or images. Give up on trying to do so since your changes can be easily overwritten!

I hope this provides some hint on this important topic.

UPDATE: Added link to my extended theme test.

Remove SharePoint 2010 Quick Launch Menu

by fkollmann 6/21/2010 2:35:30 PM

We tried to remove the quick launch menu since we did not want to have it in our design. Unfortunately the Ribbon bar was no longer working correctly:

Chrome:

Uncaught TypeError: Cannot set property 'control' of undefined

Internet Explorer:

Message: 'undefined' is Null or no/invalid Object
Line: 5
Char: 94383
Code: 0
URI: http ://*********/ScriptResource.axd?d=Wsxg_ZzMhZWYMpVRDIuk-hGcVKhqljKiPvDNcfDYa2N6qCWpS4qNnlSsYlRua2ETufmyST1szAgs4HAQsNYsbhwIb6mePyRWKe8O6MP3oKw1&t=ffffffffec2d9970

Firefox:

Error: a is undefined
Source: http ://**********/ScriptResource.axd?d=Wsxg_ZzMhZWYMpVRDIuk-hGcVKhqljKiPvDNcfDYa2N6qCWpS4qNnlSsYlRua2ETufmyST1szAgs4HAQsNYsbhwIb6mePyRWKe8O6MP3oKw1&t=ffffffffec2d9970
Line: 5

This is because the quick launch menu is required…

function init_zz17_V4QuickLaunchMenu() {$create(SP.UI.AspMenu, null, null, null, $get('zz17_V4QuickLaunchMenu'));}

and cannot be removed that easily :-/ . The correct way to remove it is to remove the data source reference:

Change for “native” SharePoint 2010 layout from…

<SharePoint:AspMenu id="V4QuickLaunchMenu" runat="server" EnableViewState="false" DataSourceId="QuickLaunchSiteMap" …>

to…

<SharePoint:AspMenu id="V4QuickLaunchMenu" runat="server" EnableViewState="false" DataSourceId="" …>

Visual Studio 2010 SharePoint Power Tools allow sandboxed Visual Web Parts

by fkollmann 6/18/2010 9:07:41 PM

Visual Web Parts are now possible even with sandboxed solutions as Microsoft released the Visual Studio 2010 SharePoint Power Tools.

HOMEPAGE

My favorite Visual Studio 2010 Tips

by fkollmann 6/18/2010 8:35:56 PM

My favorite tips from Sara Ford's 101 Visual Studio Tips which were all new to me and I tested all of them:

Tip 2: Cycle trough the clipboard stack when pasting text by pressing Ctrl + Shift + V . This allows to past more than just the latest copied text.

Tip 8: Ctrl + , (comma) allows to get a simple type search view (like in Eclipse).

Tip 19+20: Ctrl + Alt + <arrow key> to do block select (like in the command prompt). When starting to type it allows to edit multiple lines.

Tip 37: Ctrl + F3 to search for the currently selected word.

Tip 88: Ctrl + . (dot) opens the small menu e.g. when renamed a method or variable name. No longer trying to catch that one with the mouse cursor :) .

Tip 96: Visualizer for event sender parameter in WPF.

More tips: http://blogs.msdn.com/b/saraford/archive/2010/03/30/speaking-at-devdays-2010-in-the-netherlands-visual-studio-tips.aspx

SharePoint 2010 resource files have to be complete

by fkollmann 6/17/2010 12:29:00 PM

After trying a lot of stuff on how to translate/localize XML declarations and code in SharePoint 2010, I came across a bad topic: translated resource files have to be complete!

Assuming that the following structure exists:

  • Foo.resx
    • HelloWorld –> “Hello World!”
    • ExampleTitle –> “Example”
  • Foo.de-DE.resx
    • HelloWorld –> “Hallo Welt!”

Requesting ‘ExampleTitle’ in a German web will not return the expected “Example” (as it would using compiled resources) but “$Resources:Example”.

There are two ways how resources are being requested by SharePoint:

Requesting localized string by XML declaration

These are the resource references: $Resources:<resx file base name>,<resx key>;

This results in the following error in the SharePoint log:

06/15/2010 16:57:20.06     vssphost4.exe (0x0F98)                      0x06C8    SharePoint Foundation             General                           8e25    Medium      Failed to look up string with key "<resx key>", keyfile <resx file>.    
06/15/2010 16:57:20.06     vssphost4.exe (0x0F98)                      0x06C8    SharePoint Foundation             General                           8l3c    Medium      Localized resource for token '<resx key>' could not be found for file with path: "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\Template\Features\<feature name>\feature.xml".    

Requesting localized string using code

I use the following method to query translations from code:

UPDATE: Due to the fact that the SPContext is not set in feature receivers when the feature is being activated using the commandline, I extended the function to be able to pass ((SPSite)properties.Feature.Parent).RootWeb:

public static class LocalizationHelpers
{
    public const string DefaultResourceFile = "<default resource name, without extension>";

    public static string GetLocalizedString(string str)
    {
        if (string.IsNullOrEmpty(str))
            throw new ArgumentException("null or empty", "str");

        return GetLocalizedStringInternal(str, DefaultResourceFile, null);
    }

    public static string GetLocalizedString(string str, SPWeb web)
    {
        if (string.IsNullOrEmpty(str))
            throw new ArgumentException("null or empty", "str");

        if (web == null)
            throw new ArgumentNullException("web");

        return GetLocalizedStringInternal(str, DefaultResourceFile, web);
    }

    public static string GetLocalizedString(string str, string file)
    {
        if (string.IsNullOrEmpty(str))
            throw new ArgumentException("null or empty", "str");

        if (string.IsNullOrEmpty(file))
            throw new ArgumentException("null or empty", "file");

        return GetLocalizedStringInternal(str, file, null);
    }

    public static string GetLocalizedString(string str, string file, SPWeb web)
    {
        if (string.IsNullOrEmpty(str))
            throw new ArgumentException("null or empty", "str");

        if (string.IsNullOrEmpty(file))
            throw new ArgumentException("null or empty", "file");

        if (web == null)
            throw new ArgumentNullException("web");

        return GetLocalizedStringInternal(str, file, web);
    }

    private static string GetLocalizedStringInternal(string str, string file, SPWeb web)
    {
        // determine language
        var lang = 1033u; // english

        if (web != null)
            lang = web.Language;

        else if ((SPContext.Current != null) && (SPContext.Current.Web != null))
            lang = SPContext.Current.Web.Language;

        // request string
        var r = SPUtility.GetLocalizedString("$Resources:" + str, file, lang);
        // enrich error string
        if (r.StartsWith("$Resources:"))
            r = string.Format("$Resources:{0},{1},{2};", file, str, lang);

        return r;
    }
}

More details: http://blogs.msdn.com/b/johnwpowell/archive/2009/11/29/sharepoint-2010-localization-with-visual-studio-2010.aspx

SharePoint 2010 ListTemplate.Name cannot be translated

by fkollmann 6/16/2010 5:35:50 PM

The whole day I was hunting an error where SharePoint 2010 refused to create a list instance (both by XML declaration and by code). All I got was either “filename invalid … 0x81020030” (XMl declaration) or NullReferenceException (by code, having the other error as inner exception when debugging).

After digging around a little bit I came across the following log message:

06/16/2010 17:24:12.65     vssphost4.exe (0x1290)                      0x17D4    SharePoint Foundation             General                           72k9    High        Failed to retrieve the list schema for feature fb18e164-124b-4da0-96d0-a6404af4996c, list template 17346; expected to find it at: "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\Template\Features\Common_ListNavigation\$Resources:common,ListNavigationListName;".   

Since I try to define constants in resource files, too. I simply stored the ListTemplate.Name attribute in a resource to ensure the name does not have to be changed in different places:

<ListTemplate
    Name="$Resources:common,ListNavigationListName;"
    Type="17346"
    BaseType="0"
    OnQuickLaunch="TRUE"
    SecurityBits="11"
    Sequence="410"
    DisplayName="ListNavigationListDefinition"
    Description="My List Definition"
    Image="/_layouts/images/itgen.png"/>

Unfortunately this is not supported :-/ .

Apache Thrift 0.3.0 RC4 released

by fkollmann 6/16/2010 4:37:04 PM

The new Thrift v0.3.0 RC4 is available (for a week now). Since the team seems to take some more time to get the version ready which will most likely by the RTM, I would like to provide the Windows binaries for that build:

Thrift is a multi-platform communication framework: http://incubator.apache.org/thrift/ . The framework is also used by Apache Cassandra.

DOWNLOAD (Win32 compiler, .NET 3.5 library, .NET 2.0 library)

All WHS projects stopped

by fkollmann 5/7/2010 12:52:21 PM

As a consequence of changing my private project focus all currently active and already inactive WHS v1 projects have been stopped. This includes the following projects:

  • Codename “Umbrella”
  • Router Control
  • Windows Home Server on Facebook
  • Volunteer

Currently no WHS v2 versions are planned and as along as Microsoft does not include an open add-in store there won’t be any future releases.

Sorry to all who are disappointed by this and those who have been long-time companions on my WHS adventures esp. to Christopher (HSB), Alexander (HSB) and Alex (HSL). Special thanks to those who are dedicated to the WHS community and made this adventure possible: Terry (WGS) and Martin (HSB). Finally I want to thank Microsoft for providing an existing product and all the sponsors of the Windows Home Server Add-on Challenge 09.

PS: If someone is interested in continuing one of the projects, please drop me a mail.

SharePoint version table

by fkollmann 4/26/2010 3:28:00 PM

SharePoint 2010

This table shows the version and build numbers for SPF 2010.

Build Number Version String
4514 Beta 2
4730 RC1
4755 RTM / official release

Latest Version: RTM (English)

SharePoint 2007

This table shows the version and build numbers for WSS 3.0 and MOSS 2007.

The version of the current installation can easily be looked up in the Central Administration: Operations > Topology and Services > Servers in farm.

Build Number Version String
4518 RTM / first release
6219 Service Pack 1
6318 Infrastructure Update
6327 Cumulative Update October 2008
6335 Cumulative Update December 2008
6341 Cumulative Update February 2009
6421 Service Pack 2
6504 Cumulative Update April 2009
6510 Cumulative Update June 2009
6520 Cumulative Update October 2009
6524 Cumulative Update December 2009
6529 Cumulative Update February 2010

Latest Version: Service Pack 2 (English, German); CU February 2010 (WSS, MOSS)