There are very few SharePoint 2007 books on the market yet. It looks like a whole lot more are slated to be published this spring. As they come out I'll try to publish my reviews of them.
Microsoft® Office SharePoint® Server 2007 Administrator's Companion
Microsoft Press
This is a solid book for those who are familiar with what SharePoint can offer, and want to learn how to actually configure the server to do what they want. Because the book is geared toward IT folks, it covers out-of-the-box functionality in good deatil. I wouldn't recommend this book for developers or folks already very familiar with SharePoint; the information is too basic to be considered reference material for experienced users. However, for first time users, it's an excellent buy.
If you're looking for a way to get hands on experience with SharePoint 2007 or Windows SharePoint Service 3.0, Microsoft has posted a number of Virtual Labs and e-Learning Courses. Some of them are free and some cost a fee.
You can also check out the Live and On-Demand Web Casts on Microsoft's site.
I've had several requests for resources to help folks get started with SharePoint 2007. Here are my suggestions for resources to help you get started, if you are starting from scratch and want to know what this whole SharePoint thing is about.
When looking for information online, it's important to know the distinction between Windows SharePoint Service 3.0 (WSS 3.0) and Microsoft Office SharePoint Server 2007 (MOSS 2007). WSS comes free with Internet Information Services (IIS), which is part of the XP, Windows Server, and Vista operating systems. SharePoint Server is a server product which must be purchased seperately. It layers on top of WSS, using WSS as a base, but greatly extending its functionality.
The key is that when you are looking for resources online, that you know to look up both WSS and SharePoint Server. Typing in "SharePoint" will likely get you results about both products. Furthermore, WSS 3.0 is very different from WSS 2.0, and SharePoint Server 2007 is very different from the older product called SharePoint Portal Server. Make sure that you are reading information pertaining to the latest product and not older versions.
That being said, here are the most helpful links on Microsoft's site to help you get started.
Microsoft.com provides high level information for end users and decision makers.
MSDN stands for Microsoft Developer Network and provides documentation for software developers who want to develop SharePoint applications.
TechNet is Microsoft's online resource for IT professionals. TechNet focuses on product installation, backup, etc.
Finally, if you'd like to stay up-to-date on the latest releases from the SharePoint product team, check out their blog at http://blogs.msdn.com/sharepoint.
OK, so, at my current client, I ran into a problem: I wanted to be able to switch up themes based on a user's profile, but the user's profile is based on a proprietary security system. When a new Theme for the site was set, it needed to change the logo at the top of the page, some text in the footer, and the items that appear in the top nav. Here's how I went about doing it:
Project Setup
In the App_Themes directory, I created several theme directories, and each theme directory contained three files: a .css file, a .skin file, and .sitemap file.
- App_Themes
- 0
- Default.css
- Default.skin
- Default.sitemap
- 1
- Theme1.css
- Theme1.skin
- Theme1.sitemap
My project contained a BasePage.cs file that served as a base class for my Page objects, a Master.master page that served as the master page, and various content pages that inherited from the BasePage class, and were connected to the master. My project also contained the necessary global.asax and web.config files, as well as a default Web.sitemap.
Setting the Theme
First, I had to retrieve the theme from the user's profile. I did this by retrieving the user's information from the header/server variables, that had been put there when the user logged on. I figured out which theme I should use, and put it in a session variable. I did this in the global.asax's Session_Start event handler. So, my code looked like this:
void Session_Start(object sender, EventArgs e)
{
string myTheme = HttpContext.Current.Request.ServerVariables["USERINFO"];
HttpContext.Current.Session.Add("Theme", myTheme);
}
Although it might seem intuitive that you could set a site's theme in the Master page, it's actually not possible. You have to set the theme of the page in the Page class itself. So I didn't have to put the same logic in every page on my site, I created a base class that all the pages in my site inherit from. Because the Theme of the site needs to get set before the PageLoad event fires, you have to set the page theme in the Page_PreInit event handler. My base class looked like this:
public class BasePage : Page
{
protected void Page_PreInit(object sender, EventArgs e)
{
this.Theme = Session["Theme"].ToString();
}
}
You have to make sure that theme you're setting really exists as a Theme on your site. (For instance, my site only has Theme's called "0" and "1". If I tried to set my Theme to "Becky", it would throw an error.)
When I created new content pages based on the page master, I had to make sure their class inherited from my base class, not the default Page class, in the page behind:
public partial class _Default : BasePage
Skinning the Site
Now that I have my code set up to apply the appropriate theme to the site when the user logs in, what exactly was going to change in the site?
My first step was to create the master page, and to create web controls on that page that were "skinnable". For instance, at the top of the page, I created a logo control that looked like this:
<asp:image id="LogoImage" skinid="Logo" runat="server">
And at the bottom of the page I created a footer control that looked like this:
<asp:label id="FooterText" skinid="Footer" runat="server" />
Inside my .skin file in my Theme, I decided what those controls should look like for that particular theme:
<asp:image skinid="Logo" runat="server" imageurl="~/Images/Logo1.gif">
<asp:label runat="server" cssclass="label">(c)2006 Becky VanBruggen</asp:label>
I also applied my site colors to the classes in my .css file for that theme.
Changing the SiteMap
Not only did I need to change the theme for the site based on the user's credentials, but which pages were to appear in the nav also needed to change based on the site's theme. (Page B shoud be available for Theme 1 but not Theme 0.) This was slightly more difficult to execute since .sitemaps don't automatically change with themes.
First, I added a node to the siteMap providers section of the application's web.config file, one for each theme:
<sitemap defaultprovider="0">
<providers>
<add sitemapfile="~/App_Themes/0/Default.sitemap" type="System.Web.XmlSiteMapProvider" name="0">
<add sitemapfile="~/App_Themes/1/Theme1.sitemap" type="System.Web.XmlSiteMapProvider" name="1">
</providers>
</sitemap>
Then, inside my BasePage class, I added code to the Page_Load event handler:
if (WebConfigurationManager.GetSection("system.web/siteMap") != null)
{
SiteMapSection siteMap = (SiteMapSection)WebConfigurationManager.GetSection("system.web/siteMap");
if (siteMap.Providers[Session["Theme"].ToString()] != null)
{
SiteMapDataSource smds = (SiteMapDataSource)master.FindControl("SiteMapDataSource1");
smds.SiteMapProvider = Session["Theme"].ToString();
}
}
FYI... in the pages that inherit from the base page, you need to make sure you explicitly call base.Page_Load(sender, e) and base.Page_PreInit(sender, e) inside the respective event handlers if you want to add your own Page_Load or Page_PreInit event handlers to them.
And... voila! Now, when a user logs in and has been assigned Theme 1, they will see Theme 1's logo, Theme 1's CSS styling, and Theme 1's site map.
The World is Flat, by Thomas Friedman.
The subtitle of the book is "A Brief History of the Twenty-First Century", and it lives up to its title. Although the book centers on economics, as a programmer, I found the first chapters very enlightening. Friedman goes into great detail explaining how various technological inventions coincided with economical and political events to create the global economy we live in now.
For instance, Friedman talks about how India opened up its economy to the Western world in the last several decades. However, had it not been for the dot com boom, the Pacific would not be laid with the thousands of miles of fiber optic cable that enable the high speed phone and data connections that have allowed India to become such a hub for outsourcing. So, although the dot com bust seemed like a major step backwards for the U.S., it actually had world-changing tangential effects.
Friedman also goes into great detail talking about things like the advent of the Apache server and XML and the Open Source movement. As a programmer who lived through the growth and development of many of these technologies, it was on the one hand nostalgic to hear about how these things came about, but also slightly tedious to hear detailed explanations of things I take for granted on a daily basis. However, if you have friends or family members who wonder about the significance of what you do, Friedman gives a great layman's introduction to these concepts and why they're important.
I have heard that this book is now required reading for the Business program at my alma mater, Calvin College, and after reading it I can see why. For a helpful history of technology and economics in this century, and an optimistic (and often over-optimistic) view of the future, I highly recommend reading this book for what's left of your summer reading.