RSS
Add to Technorati Favorites
Follow me on Twitter

Mon, 29 Jun 2009 04:53:01
Thu, 25 Jun 2009 17:46:03
Wed, 24 Jun 2009 01:47:34
Wed, 24 Jun 2009 01:47:24
Tue, 09 Jun 2009 22:24:21
Thu, 04 Jun 2009 20:18:21
Thu, 04 Jun 2009 20:03:04
Wed, 20 May 2009 16:57:45
Mon, 18 May 2009 17:18:58
Sat, 16 May 2009 23:46:08
Sat, 16 May 2009 15:36:44
Mon, 11 May 2009 01:29:03
Mon, 11 May 2009 01:09:43
Mon, 11 May 2009 01:07:34
Fri, 08 May 2009 16:30:12
Fri, 08 May 2009 16:05:07
Thu, 07 May 2009 22:28:08
Thu, 07 May 2009 21:50:18
Wed, 06 May 2009 19:29:38
Wed, 06 May 2009 03:55:45

Person.aspx Navigation

For those of you who might have noticed, the top navigation disappears when you're viewing someone else's profile using the Person.aspx page. This behavior seems very mysterious, considering the navigation appears on the other pages in the root "My Site" site collection.

I ran across this post on Bob Moore's blog, where he describes how he disassembled the code and discovered that there's code in Person.aspx that explicitly looks for the Content control that contains the top navigation, and then hides it! ("Oh Microsoft, why dost thou vex me so?!") (You'll need to scroll down the page to view his article called "You are not the person.aspx I thought you were!")

Because the code is fairly "stupid" in the sense that it's looking for placeholder controls with specific names (PlaceHolderTopNavBar, PlaceHolderHorizontalNav, and TopNavigationMenu), you can side-step this behavior by creating an alternative ContentPlaceHolder control in your Master Page that you can use in Person.aspx. Then, in Person.aspx, you'll simply override the existing PlaceHolderTopNavBar placeholder from the Master Page, leaving it blank. (Although the custom code in Person.aspx will hide the top nav, it will leave the Site Actions menu, so if you don't explicitly override the content placeholder control with empty content, you'll get the Site Actions menu twice.)

For example, I added this control directly above the PceHolderTopNavBar ContentPlaceHolder control in my Master Page:

<asp:ContentPlaceHolder id="PlaceHolderTopNavBarPerson" runat="server"/>

As you can see, it's an empty control, so it won't display any markup on any of the existing My Site pages.

In the Person.aspx page, I added the following empty placeholder control to the page:

<asp:Content ContentPlaceHolderId="PlaceHolderTopNavBar" runat="server"/>

Then, I added my new control.

<asp:Content ContentPlaceHolderId="PlaceHolderTopNavBarPerson" runat="server"/>

I basically copied and pasted all the markup that's inside the PlaceHolderTopNavBar ContentPlaceHolder control in the Master Page, (making sure to remove the <asp:ContentPlaceHolder id="PlaceHolderHorizontalNav" runat="server"> and </asp:ContentPlaceholder> tags that were embedded in it), and put that markup inside my new "PlaceHolderTopNavBarPerson" Content control.

Modifying actual "My Site" site collections for different users means you're modifying multiple site collections, and it's best to use a Feature Stapler. However, since Person.aspx is a singular page in the root My Site site collection, I don't see any big problem with customizing Person.aspx from the original version, to add in the alternative Content controls.

If you're already using a Feature to apply a custom Master Page to all your My Site site collections, there's no reason why you couldn't just add the additional ContentPlaceHolder control to your custom Master Page, and then activate your Feature in the root My Site site collection. Otherwise, you could easily modify the Master Page using SharePoint Designer in the root My Site site collection.

What is "Web 3.0"?
I saw a blog entry on CNN.com that asked the question "'What is Web 3.0' and Should You Care?" According to one person the blogger talked to, Web 3.0 already happened because we are in the 3rd decade of the Internet. However, I think there probably are some things we can look forward to in the coming era of the Internet. Some ideas that people who commented on the blog post had:
  • Web applications will be more tied to mobile phones.
  • Paid services such as "Office Online" mean we will buy less and less "shrink wrapped" products we install on our own computer. Instead, we'll do our computing "in the cloud".
  • Search engines will be able to infer the results we're looking for in a more advanced way than using "Keyword searches" and the like; instead, they'll be more semantically advanced.
  • Some say the "social networking" (oh, how I hate that over-used and tired buzzword, but I digress...) will be taken to another level in Web 3.0, while others see its popularity as a somewhat passing trend of Web 2.0.

What about you? What do you think will make up Web 3.0? I'd love to hear your thoughts.

Creating a Line of Business Application with SharePoint and Word 2007 - Part 1: Creating the Ribbon and Actions Pane Control
For those of you who attended the most recent St. Louis MOSS Camp, you know I presented a topic on SharePoint and OpenXML. I thought it would be helpful to write out step-by-step for you how I created a LOB application with Word 2007. The end result will be a Word 2007 document with a custom Ribbon and a custom Actions Pane that retrieves information from a SharePoint list, which can then be inserted into the document.
 
The scenario I'll be basing this example on is one where professors at a university submit their upcoming course information using and InfoPath form to a SharePoint library. Once the forms have been approved, the Registrar wants to easily create a Word 2007 course catalog by dynamically pulling the information from directly from SharePoint.
 
VSTO
The Visual Studio Tools for Office used to be an add-in to Visual Studio 2003, but it's now included as a component of Visual Studio 2008. You can view the MSDN Developer center for VSTO here: http://msdn.microsoft.com/en-us/vsto/default.aspx.
 
The first thing you'll do is create a new Word 2007 Document project in Visual Studio. You should see the Word 2007 Project Template under "Office" and "2007". This example will be created using C#. We'll name our project LOBDoc.
 
 
In the next screen, you'll specify what type of document you'll be creating, whether it's a .docx, .docm, or .doc document. In this example, we'll be creating a .docx document, so we can take advantage of the OpenXML features of Word 2007.
 
 
You should now see a base project that looks like this:
 
 
Adding the Ribbon and Actions Pane Controls
The first thing we need to do is add a custom Ribbon. You can do this by adding the "Ribbon (Visual Designer)" item to your project.
 
 
You should now see a new item in your project that gives you a visual interface for designing the Word Ribbon. It already comes with a single group to drop controls into, by default.
 
 
The first thing you'll do is drag and drop the "Button" control from the Toolbox onto the ribbon. The control is in the "Office Ribbon Control" group of controls.
 
 
We'll change the button label to say "Add Course(s)". The idea is going to be that when a user clicks on the "Add Course(s)" button, it will open up the "Document Actions" task pane in Word, which will allow them to browse the courses in the SharePoint list.
 
The Document Actions panel is a built-in control in Word. It's that area that pops open (usually on the right side, next to the Word document) when you perform certain actions. The Actions Pane is the control which allows you to customize what shows up in the Document Actions task pane. We'll be creating a new Actions Pane control and adding it to the Actions Pane.
 
 
Loading the Actions Pane Control
Now it's time to get down to some coding. The first thing we need to do is to add the Actions Pane control we added to the project to our Ribbon control.
 
Right click on the Ribbon control and select "View Code" to view the code-behind.
 
Above the constructor, create a new instance of your Actions Pane control by adding this code:
 
ActionsPaneControl1 actionsPane1 = new ActionsPaneControl1();
 
The next thing we need to do is to add the Actions Pane control to parent Actions Pane control when the ribbon loads. You can do this by adding the following line of code to the RegistrarRibbon_Load method in the code-behind:
 
Globals.ThisDocument.ActionsPane.Controls.Add(actionsPane1);
 
If we just left this code as it was, whenever the Word document loaded and therefore the Ribbon loaded, the Document Actions pane would pop open and our Actions Pane control would show up. We don't really want the pane to open up until someone clicks on the "Add Course(s)" link in our ribbon, so we need to hide our control and close the Document Actions pane right off the bat. So, right after the code you just added to the Load method, add the following two line:
 
actionsPane1.Hide();
Globals.ThisDocument.Application.TaskPanes[Microsoft.Office.Interop.Word.WdTaskPanes.wdTaskPaneDocumentActions].Visible = false;

Opening and Closing the Document Actions Task Pane on Ribbon Button Click
 
The next thing we want to do is to add the Click event handler when a user clicks on the "Add New Course(s)" button. The easiest way to add the event handler method is to browse back to the Ribbon, and double click on your button control.
 
The logic we're going to add is pretty straight-forward; if the pane is open, close it and hide the Actions Pane control. If the pane is closed, open it and show the Actions Pane control. Add the following code to your OpenActionsMenuButton_Click method:
 
if (actionsPane1.Visible)
{
   actionsPane1.Visible = false;
   Globals.ThisDocument.Application.TaskPanes[Microsoft.Office.Interop.Word.WdTaskPanes.wdTaskPaneDocumentActions].Visible = false;
}
else
{
    actionsPane1.Visible = true;
    Globals.ThisDocument.Application.TaskPanes[Microsoft.Office.Interop.Word.WdTaskPanes.wdTaskPaneDocumentActions].Visible = true;
}
 
Try debugging your solution now. You should see a new tab in your Word document, called Add-Ins.
 
 
Click on the Add-Ins tab on you'll see your new Ribbon. Click on the button, and the Document Actions task pane should show up. It's empty as of yet, but it's open! Try clicking on the ribbon link again to close it.
 
 
There you go! In the next blog entry, I'll explain how you can populate your Actions Pane control with information from a SharePoint list, and insert that information into your document.
Last SharePoint MCTS Achieved!
At long last, I took the last of the Microsoft SharePoint exams. I successfully passed exam 70-630, Configuring Microsoft Office SharePoint Server. View my abbreviated study guide I used to pass the exam.
Dynamic Link Conference 2009
On Saturday I attended the Dynamic Link '09 Conference at Calvin College. This was a conference headed up by Calvin IT professor Pat Bailey and facilitated and planned by Calvin IS Majors. The purpose of the conference was to discuss how our Christian faith can have a positive impact on software development and management practices.
 
One of the specific topics covered was the divide that often takes place between software developers and testers, and management, with each person involved in a project coming into that project with their own goals, agenda, etc. As an example, everyone can agree that they want a successful project, but that means different things to different people: to the CEO it could mean creating something that is profitable; to the Project Manager it could mean executing a project on time; to a Developer it could mean creating a solution that is feature-rich; and to a Tester it could mean creating a solution that is defect-free. Yes, they all want a "successful" project, but it's often hard to agree on what that looks like.
 
A key point that was made at the conference was the emphasis on communication and empathy - of truly listening to others and trying to understand where they are coming from. As Christians, we believe that we are all "fallen" creatures, selfish at heart because of sin; we all tend to look at projects from the standpoint of what benefits us the most, often neglecting to think about the project from another's point of view. In addition, we all recognize that we are imperfect humans and are in need of forgiveness. In light of this, it's our responsibility to extend grace and forgiveness to those we work with and for, which can be especially challenging when we feel we have been wronged, disrespected, lied to, etc.
 
Dynamic Link Group
 
After several keynote addresses, we broke out into discussion groups, each led by a number of students. (Above you can see a picture of my group.) Our group was led by Calvin senior Ben Van Drunen. I appreciated learning from the experience of others, (many of whom were managers in my group), and I was especially happy that the students were able to get a taste of "real life" from seasoned professionals in the field before many of them graduate in a few weeks.
 
In conjunction with this conference, a printed magazine was produced, which contains a number of articles by professionals and students discussing how their faith impacts their vocation in the software industry. You can download a PDF version of this document at http://cs.calvin.edu/sestudy/DynamicLink_prf.pdf.
1 - 5 Next