U2U Blog

for developers and other creative minds

Development Tools and Techniques for Working with Code in Windows SharePoint Services 3.0 (Parts 1 and 2)

Yes, the 'beast' (as we called it at the end) is out. The idea for this whitepaper started in January with the preparation of a session Mike Fitzmaurice gave at the European SharePoint Conference in Berlin. M & M's input (Mike Fitzmaurice and Mike Ammerlaan) was invaluable for the paper and they constantly pointed out new paths to explore. That's why the beast ended up as a paper split into two parts.

We all understood that the content was going to be important for a lot of folks out there. Mike nicely formulates in a posting on the product team's blog a feeling that we all had during the process and what to expect:

"I'm not saying that everything just became easy (it hasn't), but I *am* saying that everything just became explicit. The paper has recommended practices, examples, etc. Although you still can't upgrade a list/feature/site definition over an old one, this paper will show you how to deprecate the old one and have the new one take over for any newly-created sites/features/lists."

 

Update of baggage status: Final day here in Sydney. Baggage was on the plane from London to Sydney yesterday. Hopefully I'll get it today since I am leaving tomorrow. Maybe I can just pick it up on my way home again J.

TechEd US Slides and Demos

For some reason, the presentation '.NET Development with Windows SharePoint Services 3.0' I delivered last week at TechEd in Orlando is not present on the TechEd portal for download. No worries. I have uploaded it here on the blog together with the demos you saw during the presentation. Again, thanks for the good score! I really enjoyed my week in Orlando. Off to Australia now!

Content Type without Title

This week I’m writing some labs for the Advanced SharePoint Delopment course we are organizing here at U2U. Seen the things Patrick want to achieve in this course, it is going to be a challenging week! One of the first challenges is developing a content type feature for a Student:

<FieldRefs>

     <FieldRef ID="{6B7EB650-9ABB-4f6d-959A-BC30EF507067}"

               Name="StudentID"/>

     <FieldRef ID="{3EB9CAF3-C9D6-4857-A297-7D2983A0B5C5}"

               Name="FName"/>

     <FieldRef ID="{44D3AA0F-B35F-4c7d-94F4-88824823D284}"

               Name="LastName"/>

     <FieldRef ID="{038D1503-4629-40f6-ADAF-B47D1AB2D4FE}"

               Name="Company"/>

     <FieldRef ID="{963AE87B-4FE3-467f-91C3-7C878CC4BFF7}"

               Name="Email"/>

     <FieldRef ID="{fc2e188e-ba91-48c9-9dd3-16431afddd50}"

               Name="WorkAddress"/>

     <FieldRef ID="{0E6A0F76-DD45-4ea9-926D-D0A90CED5BA4}"

               Name="PostalCode"/>

     <FieldRef ID="{6ca7bd7f-b490-402e-af1b-2813cf087b1e}"

               Name="WorkCity"/>

     <FieldRef ID="{8CD101C6-0667-48cf-97E4-B0DE9E7873E5}"

               Name="Country"/>

     <FieldRef ID="{32045CEE-D805-4031-A9E2-87A227CABD7E}"

               Name="Telephone"/>

     <FieldRef ID="{F6CC5286-FF3F-412e-BA42-0691A560EC67}"

               Name="Remarks"/>

</FieldRefs>

 

After deploying my site columns feature and content type feature, I created a content type enabled list based on my own content type. I also removed the base content type, which is Item.

When I wanted to add an item to my Students list I saw that the Title field was still there, even if I hadn’t defined it in my content type.

Student with Title

The explanation for this is that I derived my content type from the Item content type, which has the Title field included. When I was making my list depending on my content type I could already have seen it in the Settings page:

Settings PageClearly, after removing the Item content type, the Title is still there because it is also part of the Students content type.

If you don’t want certain fields of your base content type (in my case it is Title) to appear in your own content type, you need to add an extra element to your content type definition, namely the <RemoveFieldRef> element.

My content type now looks like this:

<FieldRefs>

     <RemoveFieldRef ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}"

               Name ="Title"/>

     <FieldRef ID="{6B7EB650-9ABB-4f6d-959A-BC30EF507067}"

               Name="StudentID"/>

     <FieldRef ID="{3EB9CAF3-C9D6-4857-A297-7D2983A0B5C5}"

               Name="FName"/>

     <FieldRef ID="{44D3AA0F-B35F-4c7d-94F4-88824823D284}"

               Name="LastName"/>

     <FieldRef ID="{038D1503-4629-40f6-ADAF-B47D1AB2D4FE}"

               Name="Company"/>

     <FieldRef ID="{963AE87B-4FE3-467f-91C3-7C878CC4BFF7}"

               Name="Email"/>

     <FieldRef ID="{fc2e188e-ba91-48c9-9dd3-16431afddd50}"

               Name="WorkAddress"/>

     <FieldRef ID="{0E6A0F76-DD45-4ea9-926D-D0A90CED5BA4}"

               Name="PostalCode"/>

     <FieldRef ID="{6ca7bd7f-b490-402e-af1b-2813cf087b1e}"

               Name="WorkCity"/>

     <FieldRef ID="{8CD101C6-0667-48cf-97E4-B0DE9E7873E5}"

               Name="Country"/>

     <FieldRef ID="{32045CEE-D805-4031-A9E2-87A227CABD7E}"

               Name="Telephone"/>

     <FieldRef ID="{F6CC5286-FF3F-412e-BA42-0691A560EC67}"

               Name="Remarks"/>

</FieldRefs>

 

Clearly, when now making my list depending on my content type, I can already notice that Title is  only part of the Item content type.

Settings page

After removing this content type, this field was gone.

Student without Title

How is Iceland?

A question I get very often now on my MSN Messenger. And folks, I have hundreds of people officially registered as a buddy of Profke (a.k.a me J), and they keep me company during my lonely periods. Don't mind that at all to be honest. I definitely like the diversity in my buddy list. One minute I am chatting with people from Australia, than there are buddies from the States, SharePoint questions from India, friendly greetings from the Middle-East and lots more. Very entertaining! And yes, my wife has priority J

Now back to Iceland. I understand that I am extremely lucky to get a full week of sunshine in Reykjavik (more than 20° C every day). We are actually sweating in our classroom. Something Icelandic people are not really used to. This country does not really know what airco is since they basically have no need for it 99.99% of the time. Sitting here at 10 PM in my room, the sun is still shining with all its power on my laptop screen. And it will continue for at least 4 hours doing so. Very weird but quite an experience! I got this table from Wikipedia and it shows that I am really lucky. Does this have anything to do with global warming? Actually we made jokes about it today in the classroom. Somebody mentioned he was going to start planting palm trees in his garden. Good idea. I have one in my garden in Belgium and it is doing really good J (seriously!).

Mean daily maximum and minimum temperatures (°C) (1961–1990)[5]

Location 

Jan 

Feb 

Mar 

Apr 

May 

Jun 

Jul 

Aug 

Sep 

Oct 

Nov 

Dec 

 

All 

Reykjavík[6]

1.9 

2.8 

3.2 

5.7 

9.4 

11.7 

13.3 

13.0 

10.1 

6.8 

3.4 

2.2 

High 

7.0 

-3.0 

-2.1 

-2.0 

0.4 

3.6 

6.7 

8.3 

7.9 

5.0 

2.2 

-1.3 

-2.8 

Low 

1.9 

 

About 300.000 live on this island. I like Nordic people. They are friendly, reserved and a bit shy but when you connect to them, you really connect J! Tomorrow we'll have a small beer fest in the evening. Beer is the main theme in my courses and I have tasted a couple of the local ones and they are worth mentioning. I actually have added a couple of them to my database. But boy… beer is quite expensive here! Did you know that beer was banned until 1989 here in Iceland? Can't imagine that they would ban beer in Belgium! Maybe that's why you pay for a beer as many as a decent steak in the US. Anyway, that's not going to stop us J

Well, back to work. I have a couple of how-to's to do (keeping Joanna and Erika happy J). I'll let you know how the night-out with the Vikings went tomorrow.

TechEd US Started

This week is going to be a good week for me. First of all, in a couple of hours Ted and I will start the preconference workshop titled 'Development with SharePoint Server 2007 and the 2007 Office System'. We have prepared plenty of stuff to show all based on the two books Inside WSS 3.0 and Inside MOSS 2007. All juiced with some humor and jokes between an American and a European dude. The core message of the workshop is 'SharePoint and the 2007 Office System are platforms for building and delivering business applications'. Exactly what OBA is all about!

Next, I intend to follow plenty of sessions. Browsing through the list, I have the feeling that there are many many high-quality sessions I should attend. Hopefully the beers and the parties in the evening will not keep me from getting up early and keep my promise J

Keep you up-to-date on what's happening here. If you are attending the conference, hopefully we'll meet one of these days!

Giving course in Brussels

As a trainer you have the possibility and the luck to travel across Europe and even to other continents as well.

If you can give, for a change, a course in Brussels, even I take the time to see Brussels and after many years see ‘manneken pis’ again:

DSC00176

Or enjoy the wonderful view on the ‘Grote markt’:

DSC00175

DSC00174

So if you are planning to get a course at U2U, we will tell your where you can find these beautiful places.

Arrived Down Under

Here I am again after more than 12 years back in Australia. Unfortunately, my luggage is still in Heathrow. This airport is definitely the worst airport in the world. I try to avoid it as much as possible but for this trip I had no real choice. The plane actually had a 3 hour delay but still my luggage could not be transferred from the incoming Brussels flight to the new one. It was already marked for the flight tomorrow. Excellent customer services! Big contrast with the customer service from the Qantas crew on the plane! I had a great flight and I am happy to be here! Tomorrow, we'll start without course material but we'll find a temporary solution for it.

Making the Quick Launch appear again on Web Part pages stored in a document library

I got an interesting question today here in the classroom. As you probably know, you can in WSS 3.0 create a document library and opt for the Web Part page template as the one sitting behind the New button.

The end result is that you can now create a bunch of aspx pages having each one based on a layout template and just store them in the document library.

Curiously, these pages follow the same master page as all of the other pages in this site but they do not display the Quick Launch.

 

One of the students asked me whether it is possible to have the Quick Launch displayed on these pages because users complained about it. Hey! When users are complaining, we need to solve their issues!

Looking closer into the problem, I noticed that these pages have an empty placeholder that actually overrides what is there in the default.master.

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

 

Open the page in the SharePoint Designer. If you remove this line, you'll have the Quick Launch again visible on the page.

You'll probably have to tweak the table a bit to set the proper width but the Quick Launch is again there! Happy users!

If I'll find the time, I'll work out a new layout template for the Web Part pages that has this by default so that you do not have to touch each of your pages you create this way.

My Site Owners can't create pages?

My 'Site Owners' can not create pages? That was one of the questions that I got this week.

No problem, just set the right permissions to create pages. Here is a screen of the permissions applied to the Owners of the BlogPosts site:

 

screen1

screen2

 

Now that is strange, the Site Owners have 'Full Control' over the site, so creating pages could not be a problem, right? So something that I thought I could fix in a minute seem to turn out in something else :-).

After searching for a while, I found out that the permissions on the 'Master Page Library' weren't set correctly. If you want to create pages, you need to be sure that you have at least read rights on this library. So these are the steps to put the right permissions on the library:

screen3

screen4

screen5

screen6

screen7

Now, normally this is not something that you need to do, these settings are set correctly, but off course after customizing and plumbing site it could be that these permissions changed and with this post I want to make sure that you are aware of this situation.

So, for those who are facing this problem, hope this post helped you to fix it. For the others, hope you enjoyed reading it :-)