How to describe Sitecore to a SharePoint guy?

I have kicked off a new series of posts this week, on Paragon’s blog. This series explains a competitive web content management platform Sitecore to a SharePoint user.

The first post is called “How to describe Sitecore to a SharePoint Guy” and can be read in its entirety at http://sitecorecleveland.com/resources/blogs-posts/how_to_describe_sitecore_to_a_sharepoint_guy.

Your comments are always encouraged; feel free to leave them here or on the post. The next post will begin the dig into the practical details of Sitecore from the mindset of a SharePoint user.

Quick Refresh on SharePoint Development

A few months back I had a new client who was just testing the water in SharePoint development. They had recently inherited a project based on SharePoint 2007, but were not sure where they needed to start, so as the kind consultant I am, I first made the argument that we should look at an upgrade to 2010, while internally debated this I provided them with the following high level review of developing in a SharePoint environment.

Some of the details are very applicable to both SharePoint 2007 and 2010 development, with major differences called out.

SharePoint Version Naming

The term SharePoint can be used to describe a rather large collection of features, but during installing and development planning it is important to understand the different versions available and their corresponding names.

  • Windows SharePoint Services 3.0
    • Also referenced as WSS 3.0
    • This is the basic functionality for a collaboration site, it is free with all Server 2003/2008 licenses and is what MOSS 2007 was built on.
  • Microsoft Office SharePoint Server 2007
    • Also referenced as MOSS 2007
    • This is the enterprise instance of the SharePoint framework.
  • SharePoint Foundations 2010
    • Also referenced as SharePoint Foundations
    • This is the renamed and upgraded WSS.
    • Some users may call refer to this as WSS 4.0 but that is not found in official documentation.
    • This is free with most Server 2008 /2008 R2 licenses
  • SharePoint Server 2010
    • This is the enterprise installation.
    • The terminology of MOSS 2010 / MOSS has been mostly removed from the jargon, with just MOSS ninety-nine percent of the time always referring to Microsoft Office SharePoint Server 2007.

Throughout the following documentation I have used the term SharePoint 2007 to represent both WSS 3,0 in MOSS 2007 and SharePoint 2010 to refer to both SharePoint Foundations 2010 and SharePoint 2010 for simplicity sake.

The Environments

The following diagram shows the common separation of environments for most SharePoint development. The Team Development is defined in the next section, while your Testing and Production (the second and third boxes below) should be close to perfect clones of each other allowing for perfect testing before live deployment.

clip_image001

Pasted from <http://msdn.microsoft.com/en-us/library/ff650082.aspx>

A properly separated setup allows multiple developers to be working on either the same or different customizations at the same time and an avoidance of naming issues and toe stepping.

Developer’s Box

One of the biggest restraints is that development of custom code for SharePoint must be done in an environment that contains an installation of SharePoint. (For SharePoint 2007 this requires a Server OS installation, while SharePoint 2010 does provide an installation on a Windows 7 Professional OS.) No matter, the targeted version, the recommended approach is to use an all encompassing virtualized machine. This machine would include at the very least:

  • WSP Builder
  • Visual Studio Tools for SharePoint (Required for SharePoint 2007 and Visual Studio 2008 development)
  • Compression Software such as 7 Zip
  • Source Control software

This all encompassing box can then be cloned and redistributed to new developers as needed or allow for fresh environments to be generated as new task or customizations are assigned. Here are instructions to cloning a SharePoint 2007 development environment http://code-journey.com/2009/clone-sharepoint-moss-wss-stand-alone-developer-virtual-machine-rename-sharepoint-server/. Similar commands should work for a SharePoint 2010 virtual machine.

If there is any external data that the developers will need access to for there own development there is no issue with them sharing a centrally located SQL Server.

Deployment

Once your environments have been established, or at the very least planned out, a big worry becomes how difficult is it to move my customizations between the environments. SharePoint natively has a packaging concept that makes deployment of code between environments straight forward, clean, and simple.

The top level package component is called a SharePoint Solution file, these are identified by an extension of ‘wsp.’ At its basic level a solution is the collection of related files, customizations, and code which are packaged together for easy deployment. A solution is a recommended form of deployment for sets of customizations, because the solution has the capability to be deployed, upgraded, and even retracted.

A solution package ideal should be a collection o f SharePoint Features. A SharePoint Feature is the packaging of a single customization or functionality in a way that can be scoped and activated/deactivated as required by the solution.

Feature

The most basic/smallest package is called a feature. A feature contains a usually one piece of functionality that can be toggled on or off depending on the need. The following diagram shows most items which are packaged within a feature.

clip_image002

When developing a feature, it must be determined at what level within the SharePoint hierarchy the contain functionality can be activated, this is commonly referred to as the feature’s scope. Possible options in tree form are:

  • Farm
    • Web Application
      • Site (Site Collection)
        • Web (web site / sub site)

It is common that a feature activated at a higher level of the hierarchy the functionality will be accessible/working at the lower levels.

Installing Solutions and Features

Features are not reliant on a solution file for deployment to the server, but may require additional manual steps or a more detailed script to be deployed. This is one of the benefits of solution deployment files are properly copied and loaded onto the server natively by SharePoint.

Deployment for either SharePoint 2007 or 2010 can be done via script files or performed via the Central Administrator UI. For reproducibility, it is recommended to perform the deployments with a script file. SharePoint 2007 relies on the command line command STSADM (found in the bin directory of the 12 hive., while SharePoint 2010 has been designed to leverage the power of PowerShell (the STSADM is there but no longer the recommended scripting language.)

SharePoint 2007 Deployment Commands
Solution Deployment

  • stsadm –o addsolution
  • stsadm –o deploysolution
  • stsadm –o execadmsvcjobs

Feature Installation and Activation

  • Stsadm -o installfeature
    • This does not need to be ran if the feature was part of a solution. The solution handles feature installation.
  • Stsadm -o activatefeature
    • Depending on the solution this may or may not need to be ran.

SharePoint Object Model Hierarchy

When writing custom code for SharePoint 2007 and SharePoint 2010 there is a specific hierarchy to common objects required to interact with your SharePoint data. The following image is taken from a presentation by Lynn Langit called "SharePoint Development with Microsoft Visual Studio 2010" and can be found at http://blogs.msdn.com/b/socaldevgal/archive/2010/08/09/sharepoint-2010-for-net-developers.aspx. I thought this graphic is the simplest and easiest way to see how the major SharePoint objects are nested within each other.

clip_image003

Help Links for Reference on SharePoint 2007 Development

Helpful Links for Reference on SharePoint 2010 Development

Early to Plan and Early to Test Makes an Upgrade

…Intuitive, Effective, and Calm.

On Wednesday, November 17th I had the opportunity to speak to the Fort Wayne SharePoint User Group. This was the first time I have spoken to a use group, and feel over all it was a successful presentation. The title of the presentation was “Early to Plan and Early to Test, Makes an Upgrade Intuitive, Effective, and Calm.” During the presentation I spoke about the different approaches and steps to upgrading a SharePoint 2007 farm to SharePoint 2010, as a number of those in attendance are looking to begin upgrade projects during the first quarter next year.

I told those attending that I would be posting my notes and slides. I tried to format everything to include in the body of this post, but I couldn’t find a nice way to do it without hand editing a lot of HTML. (Any suggestions for a good blog editor for Word Press, I’m currently using Windows Live Writer.) Here is a link to download everything as a docx file:

image

Creative Commons License
Early to Plan and early to Test makes an Upgrade intuitive, effective, and calm by Scott Gillis is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
Based on a work at thecodeattic.wordpress.com.
Permissions beyond the scope of this license may be available at https://thecodeattic.wordpress.com/about/.

ULS (The Ugly Log Stream) Is No More

Any SharePoint administrator or developer has been faced with ugly task of digging through the ULS (officially known as Unified Logging Service, to me as the Ugly Log Stream) looking for clues as to why "Unexpected Error.." is being thrown. Most often this involves opening the ULS in some sort of text editor, and trying to maneuver around as best you can to pinpoint the cause of the issue.

Because this is such a daunting task, I’ve been on the lookout for a magical solution to turn the ULS from the Ugly Log to the Unbelievable Log. The first place I looked was on CodePlex, where I found a few, but nothing that made me say, "Wow!"

I then stumbled across the ULS Viewer in the MSDN Code Gallery and knew my life had just become infinitely easier. As I said, this gem of an application can be found in the MSDN Code Gallery under ULS Viewer. It hasn’t been updated since October 2009, but I have had no problems using it with Server 2008 R2 and SharePoint 2010, instances of MOSS 2007 on 32-bit hardware, or Windows 7 and XP. The biggest issue people have reported is date formatting issues with non English culture settings. I am going to pull out a few of the features that I have found to be most helpful, but in no way is this going to be a complete list of the different options that are available to you.

To start with, the ULS Viewer is a small executable 500MB in size, that doesn’t require any installation. Just double click and your up and running in ULS heaven. With this size it won’t be hard to added it to your USB stick and have it with you always. (I think we can all spare 500MB on our 8 or 16 GB sticks we all have…or can afford to skip the coffee for a week to get ourselves one.) In addition, to not having to install anything, as long as you have access via the network to the log location of your SharePoint server, there is no need to even log onto the SharePoint Application server. (Another point for this little baby.)
image

To view your logs you have two options. The first is to open a log file via File -> Open From -> File, which allows you to open any defined file in a the given browsed to location. This is excellent if you are wanting to view a PSConfig log file or historical ULS log files. The second option is to open File -> Open From -> ULS is were this really shines. You provide the path to your SharePoint log files and it will automatically refresh the screen as new lines are logged. No longer must you close and reopen, or refresh the screen. In addition, when using viewing via the ULS option, you can pause the live stream and start it back up as you want.
image

The next feature I find great is the ability to view only certain message types. By default all the message types are shown, which are VerboseEx, Verbose, Medium, and High. Sadly, there is not a single button to filter out Warning type messages, but this can be easily achieved via the filtering system provided.
image

Which leads into the next super sweet feature…the ability to filter messages so you only have to look at those that apply to the current issue your investigating. You have the ability to filter all of the columns with standard contains, begins, not equals…and even regex expression matching. To make it even cooler you can save different filter sets off, to use again or to share amongst teammates investigating the same issue.
image

SharePoint provides the Correlation ID for error messages as a way for us to easily identify what message(s) in the log are related to the error, but often it is hard to locate all the related messages as they are rarely all clumped in a group. Well, ULS Viewer makes this easier for us to, by providing the Correlation Tree. This beauty l will list all of the correlation ids currently in the log file or that have already been shown if live streaming the ULS, you then can select the ID you want…poof…all logged messages related are shown, no more hunting with the Find to make sure you have seen all the messages.
image

BUT wait there’s more!!!!!
Also, provided to make finding related or specific messages is the ability to format the display. This includes the basics of which columns to show and the default size of said columns, but it gets better. You can establish filter rules which will then highlight that line in your chosen color, and just like the filter options you can save these off to use later or share. If you don’t want the entire line, you can even designate certain column to be highlights. By default it even highlights any critical level messages for you.
image
If the bells and whistles I’ve pulled out haven’t at least peaked your interest, maybe the simple yet great features will sell you on the ULS Viewer. When ever a line is selected the top frame of the window will display the entire message column in clean wrapped text. Now we don’t have to scroll forever left and right or try to determine what is wrapped text or a new line in the log. Of course, it even goes a step further, and if you double click a line in the ULS, you get a nice dialog box which breaks all of the columns down for you to easily view or even share.
image
Everyone knows you have to view the ULS Log at least once for any given SharePoint project, but it shouldn’t be something to hate. With the ULS Viewer the ULS Log is no longer a last phase in issue resolution, but becomes an excellent first stop in an investigation. The ULS Viewer can be downloaded from the MSDN Code Gallery at http://code.msdn.microsoft.com/ULSViewer.

Big Security Hole for SharePoint Servers

You may have already read this somewhere out there, it is making the rounds across the Twitter-phere, blogs, and news. But I felt it would be important to post, or I should say re-post the issue.

Executive Summary from Vulnerability in ASP.NET Could Allow Information Disclosure (http://www.microsoft.com/technet/security/advisory/2416728.mspx)

Microsoft is investigating a new public report of a vulnerability in ASP.NET. An attacker who exploited this vulnerability could view data, such as the View State, which was encrypted by the target server, or read data from files on the target server, such as web.config. This would allow the attacker to tamper with the contents of the data. By sending back the altered contents to an affected server, the attacker could observe the error codes returned by the server. Microsoft is aware of limited, active attacks at this time. We are actively working with partners in our Microsoft Active Protections Program (MAPP) to provide information that they can use to provide broader protections to customers. Upon completion of this investigation, Microsoft will take the appropriate action to help protect our customers. This may include providing a security update through our monthly release process or providing an out-of-cycle security update, depending on customer needs.

Scott Guthrie has an excellent post up regarding this vulnerability at http://weblogs.asp.net/scottgu/archive/2010/09/18/important-asp-net-security-vulnerability.aspx. As normal, he has gone through with code snippets to explain the issue and what you can due to protect your systems.

Good luck keeping your systems safe!

SharePoint 2010 Index of PowerShell Cmdlets

For those always searching for a fairly complete reference to all the built-in SharePoint cmdlets TechNet has them listed at:

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

Hopefully this will help someone along the way with a quick find.

SharePoint 2010 Comparisons

A quick mid-week post, which is more for my own benefit than others. (I know that is pretty selfish of me, not worried about the reader…but I truly worry everyday about you the reader, not finding the information you need when you need it.)

This link has made its rounds at least once already around the blogosphere as well as the Twitter field, but it never huts to reprint it one more time.

Microsoft has put out an excellent interactive RIA showing the breakdown and differences between SharePoint Foundation Server, SharePoint Server with Standard CALs, and SharePoint with Enterprise CALs.

The site even goes as far as allowing you to filter based on one of the six parts of the SharePoint doughnut.

SharePoint 2010 Comparison (http://sharepoint.microsoft.com/en-us/buy/Pages/Editions-Comparison.aspx)

Here is a screen clip of what it looks like:
SharePoint Comparison Clip