The PeopleEditor Class and the Visibility Attribute

When doing custom development for MOSS 2007 or WSS 3.0, the PeopleEditor class can come in handy. However, it seems that it begins misbehaving when the the Visibility attribute is changed from its default value of true. Recently, I had the need to make it disappear and reappear depending on certain conditions in a custom form that was developed and I ran into this problem. The work around simply involves using a display style attribute. To make control invisible, set the display style attribute value to none. To make the control visible again, set the display style attribute value back to block.

Here is a sample C# method that I used to make this happen:

private void SetPeopleEditorVisibility(ref PeopleEditor pe, bool visible)
{
  if (pe.Style.Keys.Count > 0 && pe.Style["display"] != null)
  {
    pe.Style.Remove("display");
  }
  if (visible)
  {
    pe.Style.Add("display", "block");
  }
  else
  {
    pe.Style.Add("display", "none");
  }
}
Fork me on GitHub

Come See Me at the Orange County SharePoint User Group

Tomorrow, September 17th, I will be speaking at the Orange County SharePoint User Group along with Bob Mixon.

Improving SharePoint Search Relevancy through Scopes
6:30pm – 8:00pm – QuickStart, Irvine, CA

Organizations struggle with delivering information within the scope and context of business users needs.  Understanding scope and contextual search needs can be a daunting task.  However, results can be dramatically improved through careful planning, architecture, design, and development techniques.
 
In this session, you will learn the techniques and best practices required to deliver a SharePoint solution that supports scoping of information.  We will cover appropriate architecture, design, and configuration techniques then dive into development.  Development topics will include an introduction to search syntax options and the key query classes offered in MOSS, and search object model with a demonstration of executing queries with scope information.
So if you are in the area, stop by and say hello!

WSS 3.0 and MOSS 2007 Certification

I often get asked how to get “SharePoint certified”. This is actually an easy question to answer since there are four available SharePoint related MCTS certifications from Microsoft. The certifications are:

Usually, the next question I get is… Which one should I take? This question is a bit harder to answer since the answer depends on the individual goal of certification. Nevertheless, I will try to break it down.

Every person who wants to get “SharePoint certified”  should start with exam 70-631 (WSS 3.0 Configuration). This certification shows that you understand how to install and configure a SharePoint farm, use Central Administration, and use and customize out-of-the-box features such as site templates, lists, libraries, and web parts. From a professional perspective, this exam is the corner stone for all things SharePoint since it ensures that the individual with this certification has the essential knowledge to create out-of-the-box solutions using WSS 3.0. To begin preparing for this exam, I suggest strong familiarity with the WSS 3.0 TechNet library.

The next certification to go for depends on your professional goals. If you are a developer and want to build custom solutions, then take the 70-541 exam (WSS 3.0 Development). If you are not a developer and plan on building out-of-the-box solutions with MOSS 2007, then take the 70-630 exam (MOSS 2007 Configuration). My reasons follow below.

Exam 70-541 (WSS 3.0 Development) certifies general knowledge of custom development and advanced customization of WSS features. This includes knowledge of the programming against the WSS object model and using the collaborative application markup language (aka CAML) to create custom applications, templates, features, definitions, and more. It also demonstrates the ability to package and deploy custom solutions using the WSS solution deployment mechanism. To begin preparing for this exam, I suggest strong familiarity with the WSS 3.0 MSDN library. If you are not a developer, then skip this exam.

Exam 70-630 (MOSS 2007 Configuration) certifies the ability to deploy, maintain, monitor, and administrate operations of MOSS 2007. This includes deploying and managing a Shared Service Provided (SSP), search, business intelligence, business forms, user profiles, my sites, business data catalog, and more. Basically, it’s the same as exam 70-631 but with a focus on the premium out-of-the-box features of MOSS 2007 not included in WSS 3.0. If you want to prepare for this exam, then get familiar with the MOSS 2007 TechNet library.

The last exam is 70-542 (MOSS 2007 Development) is another developer focused exam similar to the 70-541 exam. However, the focus shifts from the WSS object model and features to the MOSS object model and features. This exam assumes that you are comfortable with CAML, the .NET framework, and developing applications with WSS. If you want to prepare for this exam, then get familiar with the MOSS 2007 MSDN library.

Sometimes people also end up asking me if using TechNet and MSDN are enough to prepare for the exams. This totally depends on your experience and your level of familiarity with SharePoint and only you can decide if TechNet and MSDN are enough for you. Rest assured there are lots of good learning resources out there to help you prepare for the exams such as books, classes, and more. If you need helping preparing for an exam and finding classes or other learning resources, then go check out the Microsoft Learning.

Caution When Packaging Themes for SharePoint Products and Technologies

Last month, I wrote up a post about how to package themes in a WSS 3.0 Solution Package (WSP file) for deployment on a SharePoint farm. After playing with this package a bit there was on problem that I encountered that was pretty obvious but I failed to take into consideration. The problem was that the SPTHEMES.XML and the OOB_SPTHEMES.XMLfiles that were packaged were deleted when I retracted and deleted the solution. Afterwards, I began to experience strange behavior with themes in my SharePoint environment.

Why did this happen?

A few months ago, I explained how WSS deploys and retracts solution packages. In that explanation, I explored how the WSS run-time checks the solution manifest of the solution package (WSP file) and removes any files, features, and other solution components from the file system and content databases. This includes both the SPTHEMES.XML and OOB_SPTHEMES.XML files that were specified in the solution manifest of the theme package. Take a look at the bold-ed lines in the manifest excerpt below:

<?xml version=1.0encoding=utf-8 ?>
<Solution xmlns=http://schemas.microsoft.com/sharepoint/
         
DeploymentServerType=ApplicationServer
         
ResetWebServer=TRUE
         
SolutionId=D250636F-0A26-4019-8425-A5232D592C10>
 
<TemplateFiles>
 
<TemplateFile Location=LAYOUTS/1033/SPTHEMES.XML/>
 
<TemplateFile Location=LAYOUTS/1033/OOB_SPTHEMES.XML/>
 
<TemplateFile Location=THEMES/MYNEWTHEME/MYNEWTHEME.INF/>
 
<TemplateFile Location=THEMES/MYNEWTHEME/mossExtension.css/>
 
<TemplateFile Location=THEMES/MYNEWTHEME/theme.css/>
 
<!–Additional images and icons (gif, jpg, png files)
      
can be added here using <TemplateFile> elements –>
 
</TemplateFiles>
</Solution>

So when I retracted my theme solution, both the SPTHEMES.XML and OOB_SPTHEMES.XMLfiles were deleted from the file system and the original SPTHEMES.XML was not restored. Luckly, I had a copy of the themes WSP file from which I extracted the OOB_SPTHEMES.XML file and manually copied back to the 12/LAYOUTS/1033 directory. This resolved the odd theme behavior that my environment was experiencing.

Lesson learned?

If you are going to modify files in the SharePoint HIVE in an unsupported manner (such as was the case with the theme package), make sure you have a back up of the original file system files. Like we did with the OOB_SPTHEMES.XML file and make a note on additional steps, aside from solution retraction and deletion, that need to be taken to restore the file system to it’s original state. This means don’t just test the deployment, but also the retraction process before using this type of solution in a production environment.

Introduction to the Enterprise Search Query Object Model

I had the pleasure of delivering a presentation tonight at the monthly Los Angeles SharePoint User Group. The talk provided an introduction to the enterprise search query object model which is used by Microsoft Office SharePoint Server 2007 (MOSS) and Microsoft Search Server 2008 (MSS) to provide search results to search queries. The guts of the 30 minute slide deck [PPTX | PDF] consisted of a quick overview of Microsoft’s enterprise search architecture, followed by quick comparison of the keyword syntax and the SQL-based syntaxused for querying the query engine, and ended with an overview of the KeywordQuery and FullTextSqlQuery classesand their commonly used properties. After the slides, I spun up a virtual machine and demonstrated the classes at work with some sample code [ZIP]. The talk ended with crediting Patrick Tisseghem and his book, Inside Microsoft Office SharePoint Server 2007, where I first started learning about search query object model.

If you missed the presentation, feel free to take a look at the materials:

Oh, and there is one more excellent resource that I forgot to include in the slide deck is the Enterprise Search Team Blog.