SharePoint 2010 list configurations that used to require custom development

by Lloyd 4/13/2010

At least once on each my SharePoint projects over the past year my clients have asked me if SharePoint 2010 would help with any of the things we were trying to accomplish with lists.  The answer in every single case was “yes”, though I couldn’t always say much since we were under Microsoft NDA until SharePoint 2010 Beta was released.  It’s a little painful looking back on the custom development I had to do in MOSS/WSS 3.0 (even SharePoint 2003) projects to achieve what SharePoint 2010 lists provide out of the box.  Well, only painful because it was time that I could have spent on my clients’ other high priority tasks.

 

This post is dedicated to those clients. :)

 

Note: All screenshots and descriptions are based on SharePoint 2010 Beta.

 

List Relationships

SharePoint enables relationships between lists via Lookup columns.  I didn’t pick up SharePoint until the 2003 version, so I know lookup columns have been included at least since then (I *think* 2001 had them).  In SharePoint 2007, creating applications and views based on those relationships is still custom development.  For example, master/detail views are somewhat possible with some of the fancier UI configurations such as web part connections.  The most common method I’ve seen and used is by creating a custom list display form (DispForm.aspx) for the “master” list item and adding a data view web part (DVWP) for the related “detail” items.  This would be done in SharePoint Designer and requires knowledge of XSLT and XPath to render the detail items correctly (the DVWP GUI interface never gets it exactly right for me) and a little CAML to configure the detail section’s filter.

 

Enter SharePoint 2010 list relationships.  When a column is created as a Lookup field, you have the option to enforce a relationship behavior with the parent list.  Part of that behavior is the ability to restrict deletes in the parent list if there are related items or to cascade deletes down to the child lists.  Note that creating a relationship also requires that the column be indexed.

 

image

 

Once the list relationship is established, it is possible to created advanced views on the built-in list forms.  For example, if I have a Contacts list with a Lookup column to an Offices list, I would like to show any related contacts when viewing a particular office.  To do this, I browse to the Offices list and access the Default Display Form from the Form Web Parts option under List Tools in the ribbon.  That directs me to the display form (DispForm.aspx) for Offices.  The ribbon UI on that page contains an Insert section under Page Tools where I can add any related lists; in this case, Contacts.

 

image image

 

Adding the related list adds a list view web part on the display form page with a built-in filter to only show contacts related to the displayed office.  When users click on a specific office any related contacts will automatically be shown.

 

image image

 

 

Projected Fields

Over the past year I have done a lot of work with custom list forms and views of related lists in SharePoint 2007.  One of the common requests I get is to show additional fields from a Lookup column’s parent list on a view of the child list item.  For example, if a Contacts list has a Lookup field referencing an Offices list’s Title field, a requirement may be to also display the office’s location and phone number when viewing a list of contacts.  This usually requires a custom view, such as by joining data sources in a data view web part with SharePoint Designer or .NET development. 

 

Projected fields in SharePoint 2010 allow additional columns from related Lookup lists to be “projected” onto the view of the child item.  Using the same example where a Contacts list references an Offices list, the Lookup column has built-in options to project additional fields from Offices to Contacts.  The additional fields will be prefixed with “Office:” to indicate they are coming from the Offices list.

 

image image

 

Validations

Previous versions of SharePoint allow list fields to be marked as Required.  In addition, different column types had specific validations, such as maximum characters for text fields and min and max values for number fields.  However, more advanced validations with formulas or business logic require custom development.  SharePoint 2007 has several options: list event handlers; custom list forms; JavaScript.  

 

SharePoint 2010 introduces both list and column-level validations using formulas that are configurable through the UI.  These formulas are similar to those used in Excel and calculated fields.  Each formula can also have a custom message displayed to the user if the validation fails.   

 

image

image

 

According to this post on SharePointDevWiki.com, regular expressions are not supported in the out-of-box validation formulas.

 

Additional information:

 

Unique Column Value Constraints

In SharePoint 2007, to ensure a particular column contains unique values for every row requires custom development, usually with list event handlersor custom script on the New and Edit forms that call a web service to validate unique values.  However, using a script in this manner would not be used in the datasheet view, whereas list event handlers would still work. 

 

In SharePoint 2010, this is a setting on the field configurable through the UI.  Note that enforcing unique values requires that the column be indexed.

 

image

image

SharePoint 2010 Training Roadmap for IT Teams

by Lloyd 3/18/2010

SharePoint 2010 has motivated me to start blogging again.  I just finished a presentation on a SharePoint 2010 Skills Roadmap for IT and thought the material would make for a good return-to-blogging post. 

It actually started as a mind dump email to a couple of my coworkers.  We were trying to figure out what it would take to learn SharePoint 2010 for some internal projects.  So here it is, mostly in the original format I sent them with some infrastructure and administration stuff added.  Excuse the hyperlink vomit.

Passed 70-630 and 631; Why every SharePoint developer should take 631

by Lloyd 5/12/2009

I finally got around to taking the MOSS (70-630) and WSS (70-631) configuration MCTS exams, passing both.  I suppose this means I'll have to knock out the SharePoint dev exams (541 and 542) soon also :).  I feel a little late to the party since SharePoint Server 2010 is right around the corner, but I figured better late than never (also see my previous post with thoughts on the value of Microsoft certifications).  Plus, I’m still working on SharePoint projects and contributing to the communities, so every bit of knowledge helps.  The last time I took a cert exam was 2004 when I got my MCSD, mostly because my employer at the time was paying for it :). 

I’ve spoken with a lot of people saying they passed both exams with no studying.  While you could probably do this with 630, I don’t think the average developer can on 631. 

70-630 (TS: Microsoft Office SharePoint Server 2007, Configuring)

The Transcender was my primary study aid for this exam, although I probably could have passed without studying it from project experience.  The relevant topics to focus on are listed on the Microsoft 70-630 preparation guide.  If you already have MOSS experience and don’t want to pay for the Transcender or other practice exams, just go through that list and search the internet for 101-level postings and publications to brush up on the topics.  If you’re new to MOSS, I recommend reading one or both of the books listed at the same link.  In either case, firing up a MOSS instance and getting your hands dirty won’t hurt.

70-631 (TS: Windows SharePoint Services 3.0, Configuring)

I used the Transcender again on this one, but spent a lot more time online researching the various infrastructure topics.  I found a good summary of topics to study from the Microsoft 70-631 preparation guide and blog posts here and here.  I also jotted down the other links I read as I was going through the Transcender questions, which I’ve pasted below.  I had a decent high-level understanding (or more) on all of these, but it helped to understand the terminology and dig a level deeper.

I actually think less than half the questions were about straight WSS topics, but maybe I’m exaggerating in my head since I marked essentially every infrastructure-related question for review.  The WSS questions are straightforward if you experience with it.  If not, spend a few days with the books listed in the preparation guide and put together a WSS instance (such as a virtual machine image) to give yourself hands-on experience.

All SharePoint developers should take 70-631

I have consulted or worked for a lot of companies running SharePoint that don’t have dedicated administrators.  They split/share support and configuration for SharePoint between the developers and infrastructure admins.  They complement each other because developers usually don’t know enough about servers and networking, and the infrastructure folks usually don’t know enough about SharePoint.  However, this creates a gap because it is difficult to fully understand and predict the technical challenges experienced on either side.  I believe each should learn what they can of the other’s world, but from my experience, it’s a bigger stretch for developers.  Finding developers with server or networking chops is not as common as you’d think.  SharePoint presents a unique scenario which justifies these skills.  I firmly believe that any developer looking to work on a SharePoint project should beef up their infrastructure chops, if only to get familiar with the basics of IIS, ISA, NLB, DNS, SSL, and other key networking 3-letter acronyms :)  I’m not talking about getting a MCSE or being able to architect an infrastructure, but they should be able to have an intelligible (if not intelligent) conversation. 

Thoughts on the value of Microsoft certifications

by Lloyd 5/12/2009

I recently took a couple of the SharePoint MCTS exams and, as I usually do with other Microsoft certifications, debated with myself over their value.  I don’t foresee ever being considered the strongest candidate for having a certification on my resume, as verified by several conversations with clients and peers who give them little to zero stock.  The prevailing theories are the Microsoft certs do not present plausible real world scenarios, the questions often reward memorization over learning concepts, and the availability of certain training material has made it all too easy to pass by fudging actual knowledge.  Then there’s the matter of the controversial Correct vs. Microsoft answers, which plagued me once again on the SharePoint exams.

Nevertheless, I do find value in Microsoft certifications and will continue taking the ones relevant to my career path and interests.  I freely admit they are not valuable for all people in all situations, but here are my thoughts as to where they provide the most benefit:

Exposure to technologies and concepts

By studying for and taking the certification exams, you get early exposure to a wide range of technical concepts and components that you may or may not ever encounter.  Being armed with this knowledge beforehand is advantageous for several reasons, but in my experience the most prevalent is in saving time (remember - time is money!).  You’ll have a better idea of where to focus research, which can save hours and even days in many instances.  For example, several years ago my team ran into an issue in which the .NET framework was ripping out the local time zone offset from a date/time value while deserializing an ADO.NET dataset passed by a web service.  This was a critical and high impact component, and we were getting pressure to fix it yesterday since dirty data was getting into the database.  A team member who had just taken the MCSD web services exam brought up soap extensions and custom HTTP modules as potential fixes.  He focused his research on those topics and had a solid and rather elegant fix by the next day.  We went from having 3-4 high cost resources potentially spending a day or more researching to one resource handling the situation in less than two days.

Help to unify development teams

Having served as Development Team Lead on several projects, I can attest that sometimes it’s difficult to lay out measurable goals and get all team members on the same page.  I’ve found certification exams provide a decent metric for reviews and a common goal for developers to work toward, especially on teams with several junior resources.  In most cases, the biggest impact I’ve seen is team members establishing closer working relationships as they studied together for the exams.  In addition, at most places I’ve worked, employers have been willing to cover the costs of transcenders, exams, books, etc., once they understood the potential positive ROI.

Marketing tool

Especially for larger consulting firms, it can be a boon to be able to quantify your technical proficiency, whether it be the number of Rangers, MVPs, MCPD certified, PMP, or something else.  While no client that I’ve ever encountered is going to sign a contract just because 75% of your developers have a MCPD-EA, it can still establish a baseline technical competency across all resources that gets your foot in the door.

Stepping stone to fame and glory :)

You won’t even be considered for the SharePoint Master Certification program until you’ve passed the 4 relevant exams (541, 542, 630, 631).  Most of the Architect and other Master certification tracks also have the relevant MCTS exams as prerequisites.  The Master and Architect certifications are definitely NOT insignificant (sorry for the confusing double negative, but I feel it emphasizes my point more :)) relative to many opinions about MCTS, MCPD, etc.  There is a consistent view from clients and peers I’ve spoken with that it takes a talented and special person to achieve that status and they deserve any and all recognition.

Review of Netgear XAVB101 Powerline AV Ethernet Adapter Kit

by Lloyd 4/18/2009

While researching ways to get a network connection to my Xbox 360, I ran across the Netgear XAVB101 Powerline AV Ethernet Adapter Kit.  It provides a wired network connection through your home or office's existing electrical wiring.  After using it for a few weeks, I’m VERY happy with this product.  I’ll share my thought processes and experiences here, but you can also read more in-depth technical reviews here and here.

Wired or Wireless?

We currently have a cable connection hooked up to a Linksys WRT54G wireless router.  The cable modem and router are in the office on the second floor and the Xbox is on the first floor on the opposite end of the house.  I considered using this as an excuse to install some 8P8C (RJ45) jacks and build a wired home network, but as a new homeowner my project plate is already pretty full.  Also, I wasn’t quite sure how to explain to my wife why I needed to cut holes and run cables through a bunch of rooms so I could play Halo online. 

Wireless seemed to be the apparent route since I wasn’t keen on running a cable the 50 feet or so from the router to the Xbox (probably quadruple that since it would have to run inconspicuously along walls and around doors).  We get a strong connection downstairs and are set up for 802.11b/g, so up to 54 mbps would suffice for our needs.  However, I ran into a major roadblock when I found out the Xbox 360 wireless adapter doesn’t support WPA2 encryption.  Despite reading about this in various forums, I couldn’t find anything the product specs that explicitly said this, but I didn’t feel like spending money to find out.  In addition, I’ve had a heck of a time getting guests connected to our wireless network.  Besides WPA2-Personal (not supported by all wireless NICS yet nor Windows XP without a patch) with AES+TKIP, we don’t broadcast the SSID and use MAC filtering.  After going through the motions to get a laptop connected and then only having it work half the time, it gets aggravating after a while.  I wanted a wired connection downstairs so I didn’t have to send guests up to the office to plug directly into the router.

The Solution

For our situation, the XAVB101 provides an elegant solution for these issues.  The most important requirement was maintaining an optimal connection speed for streaming Netflix movies and playing Xbox Live.  I ran some tests with http://www.speedtest.net/ and found the upload and download speeds are equivalent to our desktop, which is connected directly to the router.  The setup couldn’t be easier; out of the box, plug the adapters into electrical wall outlets (NOT surge protectors! Read this review for why).  Then, connect one to the router and the other to whatever device needs a network connection.  It worked great for me the first time, although I did read a couple of reviews on Amazon where other folks had issues.  It also comes packaged with a couple of 5’ Ethernet cables, which was nice since I was out of cables, was anxious to everything hooked up, and having to drive to Best Buy would have, ironically, hampered my geek buzz.

As far as I know, the adapters are only packaged in pairs and I picked up mine for $109 on Amazon.  I’ve seen them cheaper on eBay.  For now I have guests unplug the Xbox and use that connection, but eventually I’d like to get another adapter for the kitchen or family room.  My daughter will especially appreciate that since a few times now we’ve almost had to interrupt streaming Elmo in Grouchland from Netflix.  As you can imagine, that would have been tragic.

The only thing I was unsure of was whether, for optimal performance, the plugs needed to be on the same circuit or just the same breaker box.  I read reviews where people had related issues.  As I said, the adapters for the router and Xbox are on opposite sides of the house and I have no idea how the circuits are configured.  However, I haven’t had any issues and the connection speeds are exactly what I’d hope. 

I’d definitely recommend the XAVB101 adapters if you have a similar predicament.  Do a little comparison shopping, though, as I’m sure you can pick them up for less than I did. 

[Update, 4/20/09]: Apparently you CAN order single adapters.

Control SharePoint navigation with a custom site map provider

by Lloyd 12/7/2008

For a typical MOSS site, in many situations configuring navigation with the out-of-box settings will suffice without requiring custom development.  At a previous project, I encountered a situation in which the built-in settings met about 95% of the functional requirements.  I tried every conceivable combination of navigation settings to avoid writing code, but in the end realized it was either get the requirement changed (unlikely) or customize. 

Consistent with its ASP.NET 2.0 foundation, SharePoint 2007 relies on the Provider model to feed navigation data to a control.  This is usually a Microsoft.SharePoint.WebControls.AspMenu instance, which mostly is the same as it’s parent System.Web.UI.WebControls.Menu but tweaked to play nice with SharePoint.  Most navigation providers are in the namespaces Microsoft.SharePoint.Navigation and Microsoft.SharePoint.Publishing.Navigation.  Others such as those used by SSPs and My Sites are defined in assemblies primarily used by those respective components.  Shantha Kumar has a great summary of the various SharePoint navigation providers and assemblies in this post.

Overriding the PortalSiteMapProvider was the most logical route in my scenario because I wanted to change what data was being fed to the control and not necessarily the control itself.  In addition, PortalSiteMapProvider contains members to optimize performance in a publishing site, so developing my own site map provider from scratch would not have been efficient.

The code itself is fairly simple; inherit from PortalSiteMapProvider and override the appropriate method.  In my case, the requirement related to what child nodes to show based on the current page.  All that was needed was some logic in GetChildNodes() changing when to call base.GetChildNodes().  In this example, that logic is defined in CanShowChildNodes(), which had various IF statements testing the current node, parent node, and other factors.

public class CustomCurrentNavSiteMapProvider : PortalSiteMapProvider
{
    public override SiteMapNodeCollection GetChildNodes(SiteMapNode node)
    {
        SiteMapNodeCollection nodeCollection = new SiteMapNodeCollection();
 
        if (CanShowChildNodes(node))
        {

SiteMapNodeCollection childNodes = base.GetChildNodes((PortalSiteMapNode)node);

            foreach (SiteMapNode childNode in childNodes)
            {
                nodeCollection.Add(childNode);
            }
        }
 
        return nodeCollection;
    }
 
    private bool CanShowChildNodes(SiteMapNode node)
    {
        //Implementation...
    }
}

Like any other ASP.NET application, the remaining steps are to add a node to the web.config in <siteMap><providers> and modify the datasource control markup to point to the new provider class.  Remember that deploying web.config changes in a feature is fairly straightforward with the Microsoft.SharePoint.Administration.SPWebConfigModification class.

<SharePoint:AspMenu DataSourceID="SiteMapDS" .../>
<PublishingNavigation:PortalSiteMapDataSource ID="SiteMapDS"
    SiteMapProvider="CustomCurrentNavSiteMapProvider" .../>

Additional resources:

Getting started

by Lloyd 11/28/2008

It has been a fairly productive Thanksgiving 2008 for me.  It's tough to beat some good quality family time.  Add to that night golf with glow-in-the-dark balls, the new 007 movie, winning in a husbands/brothers vs. wives/sisters round of Cranium, and starting this blog, and the result is a very fulfilling holiday break. 

I'm a SharePoint buff, so that's where the majority of my focus will be.  Despite the virtually unlimited topics that SharePoint provides, I keep things interesting for myself by dabbling in the worlds of the Information Worker and Next Generation Workplace.  Between those and a sprinkling of thoughts about general .NET concepts (the fundamentals!), that should keep things rolling until I get distracted by the next new shiny object.  So here we go...

Tags:

Powered by BlogEngine.NET 1.6.0.0
Theme by Extensive SEO

About Lloyd

 

Lloyd is a Principal Consultant with Cardinal Solutions in Charlotte, NC, specializing in SharePoint. 

 

Follow lloydfaulkner on Twitter

 

View Lloyd Faulkner's profile on LinkedIn