Archives

Archives / 2004 / December
  • Last post of 2004: My New Year's Resolutions

    Pfeww, 2004 went by like a blast! A lot of cool things happened during this year, it's hard to pick out the most important one, but changing jobs was certainly  had the biggest impact! Let's hope the new year may be as exciting as 2004; but I'm pretty sure of that: 2005 will rock!

    Read more...

  • Microsoft Grid Computing: "BigTop"

    Some time ago I was involved in a proof-of-concept project that had grid computing capabilities as a "nice-to-have feature". At that time we were playing around with web services that were called by the distributor of the grid. Today Microsoft Watch has a nice article about Microsoft Research project around grid computing, code named "BigTop":

    Read more...

  • Differencing Disks in Virtual PC 2004

    Last week I was wondering (together with Peter) how Microsoft distributes their VPC images. For example for a course which uses two VPC images, you get one "base" image, and two "delta" images which rely on the same "base" image. Suppose you could pull of the same trick for your own VPC images using your magic-super-tuned base image! This would give you at least two advantages:

    Read more...

  • My Favorite Font for Writing Code

    Probably like every developer I want to have as much information as possible on my screen, especially when writing code. The chosen font is of course quite important; more text on your screen is better (as long as it’s readable). If you want to replace the default font, I recommend following website: http://www.proggyfonts.com/. Over there you can download a lot of programming fonts, for free! My favorite programming font is currently Opti Small:
    opti small

    Read more...

  • Request for Feedback: Draft Agenda for the "Hardcore SharePoint Development" Session @ DevDays

    Patrick has posted our draft agenda for the two-part "Hardcore Development with SharePoint" session we will be presenting on the Dev & IT-Pro Days. We have a lot of ideas in our head which we would like to show you, but we would like to hear your feedback! So if you have a question/problem/topic which you think would be interesting for the SharePoint community, please let us know.

    Read more...

  • How to Add a Webpart to a Site Definition Page

    Suppose you’ve created a webpart, which is so cool that you want to have it on every page of your SharePoint site. A nice way to accomplish this is to create your own site definition, which contains your webpart on every page. Does this sound like rocket science? Trust me, it isn’t and I’ll prove it to you. :-) In fact I was a little bit scared of site definitions at first, but once you get used to them they can become very handy! First of all, if you need to learn the basics of creating site definitions, take a look at following article: Creating a Site Definition from an Existing Site Definition.  In this example I’ll modify the site template for a SharePoint Portal site, but you can do the same thing for a Windows SharePoint Services site definition as well. A best-practice is to leave the default site definitions untouched, but on your development box you could choose to alter them anyway to get you started quickly. Just make sure you’ve got a copy, just in case…

     

    You can find the Portal site definition in C:\Program Files\Common Files\Microsoft Shared\web server extensions\60\TEMPLATE\1033\SPS. The 1033 number corresponds with the language of your Portal site definition (1033 is English), SPS corresponds with what kind of page you want to modify (SPS is the Portal stuff, STS is WSS stuff). So let’s open the default.aspx page, but do not open the page by using http://localhost/default.aspx for example, instead open it directly from the SPS folder (otherwise you’d end up with an un-ghosted page). The first thing you need to do is adding the following line to the top of the page:

    <%@ Register TagPrefix="WpNs0" Namespace="SuperWebParts" Assembly="SuperWebParts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" %>

    Next you need to find the place in the page where you want to insert your webpart. Once you’ve found you’re spot, insert following lines:

    <WpNs0:MySuperWebPart runat="server" >

    <WebPart xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/WebPart/v2">

      <Title>My Super WebPart</Title>

    </WebPart>

    </WpNs0:MySuperWebPart>

    Notice that the WpNs0 schema reference corresponds with the one you’ve chosen in the Register TagPrefix line at the top of the default.aspx page. Finally save your page and check out the result in a browser.

     

    In the <WebPart> node you can specify additional properties for your webpart, for example following lines will display your webpart without title bar.

    <WebPart xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/WebPart/v2">

      <Title>My Super WebPart2</Title>

      <FrameType>None</FrameType>

    </WebPart>

     

    To find out which values you can use inside the <WebPart> element, is to drag-and-drop your webpart on a site the normal way (inside your webrowser); apply all the desired modifications by using the tool pane (click the down arrow and choose “Modify Shared Web Part”). When you’re done click the Apply button so your changes get applied, then click the down arrow in your web part toolbar and choose “Export…”.  This file contains the <WebPart> xml node which you can copy/paste in your default.aspx page. Quite handy isn’t it?

     

    One final tip to find the place in the default.aspx page where you want to insert your webpart: open the portal/site page in FrontPage (warning: do not save the page because you’ll end up with an un-ghosted page!!). Then choose the Split view (bottom left) and click the area in which you want to display your webpart. The corresponding lines will be highlighted in the code view! Once again: do not change the page in FrontPage!

    If you want to get into site definitions, I highly recommend following articles:

    Read more...

  • Building Workflow Solutions Article … Where’s the Code?

    In the current issue of .NET Magazine an article written by Patrick and me has been published, titled “Bouwen van Workflow-toepassingen” (Building Workflow Solutions). At this point the article is only available in Dutch, but I’m working on an English translation. Anyway, I was showing off the article to my wife as it appeared to me that in the article wasn’t a single line of code! No big deal you might think, but the article goes through all the steps needed to build a workflow solution based on the following products:

    Read more...

  • Adding Metadata in SharePoint

    Sometimes you want to store extra metadata in SharePoint for lets say a SharePoint web instance. Serge has a post about this topic; for a SharePoint web you can easily use the Properties property (so obvious, but I wasn't aware of this property!). But I have some doubts for the SharePoint List, Serge recommends to add an extra field. But this field would exist for each item in the list, a little bit overkill I think... :-)

    Read more...

  • Bruno Segers: "Information Highway in Belgium is empty"

    Interesting article for the ICT people in Belgium (sorry only available in Dutch): MS: “Elektronische snelweg in België staat leeg”. Bruno Segers, CEO of Microsoft Belux, motivates his concerns about the lack of software investments in Belgium. It seems that other countries like Denmark, The Netherlands, Norway, … invest up to 30% more in software. So he demands that the Belgian government should simulate local research and development. Bruno also warns that intellectual property is essential in the knowledge society, but he thinks there is a place for open source. I support this view; companies, governments, developers should be able to protect their investments in software development. But I think open source software and communities are also quite important for a company such as Microsoft. For example the .NET community is important for Microsoft, just think about the newsgroups, the blogs, the people that write articles, … They all help Microsoft evangelizing the .NET platform. Open source projects are a vital part of this community, they share knowledge and help other people develop great applications fast.

    Read more...

  • MSN Toolbar Suite Beta First Impressions

    The last hour I’ve been playing with the new MSN Toolbar Suite Beta and I’m very impressed! I’m using Scoble’s Desktop Search Reviewer’s Guide to write down my first impressions. I've learned a lot by watching the videos over at Channel 9: highly recommended!

    • Index time: I cheated a little bit on this one, I choose the “Index Now” option and after a couple of minutes more than 12.000 files were indexed. Now I’m noticing that 5.000 files are left to index, so the Toolbar Suite has found some more files to index after an hour or so.
    • What can it do, and what can’t it do? Maybe this one is a little bit early to judge, but so far it finds everything as expected.
    • Performance degradation: The full index raised my processor usage to around 20%, and the Toolbar Suite process took about 14 MB of memory. Once the initial full index was done, the memory usage has dropped to around 2 MB which is very acceptable. I can’t notice any performance degradation while working, when the computer is idle and there’s some stuff that needs to be indexed, the indexing process starts again. But when you continue working, the indexing stops immediately. It seems that when you’re on battery power indexing is disabled as well, nice!
    • User interface: People who know probably know that I’m a smart client type-a-guy, so I’m very happy that MSN Toolbar Suite comes with a very nice GUI. The UI resembles the web interface of search.msn.com, but you get all the rich client features like: drag-and-drop, right click, context menus, responsive UI, …  This is great!
    • Security/privacy: I haven’t looked into this one yet, but my guess is that the team did notmake the same mistakes as the Google Desktop Search team did in the beginning. IE history is not indexed, and the indexing is performed with a normal account (non-admin).
    • Does it play well with others? No idea, I didn’t like the Google approach (web interface) so I didn’t install it.
    • Does it work on other machines? I’ve tried it on my laptop and desktop, and on a couple of VPC’s, so far so good: no problems to report.
    • Advertising? Nope!
    • Integration: I think this one is (as always) one of the strong points of the Microsoft branded product. You get a nice integration with IE, Outlook and Windows. The only remark: when you search from within Outlook, a new window is opened. In my opinion showing the results inside Outlook would be more appropriate.
    • Price: the price is right, thank you Microsoft.
    • Download size: this one isn’t an issue for me, the download is around 5 MB.
    • File types: Of course all the office documents are indexed perfectly. I haven’t tried more exotic file types.
    • Search results: as I mentioned it finds everything as expected!
    • Customizable: the MSN Desktop Search comes with a fair amount of properties. I think “normal” users won’t get lost in them, and “power” users will be able to tweak the system.
    • Advanced features: so far I’m impressed but more on these one later on.
    • Space for the logo: you can’t seem to hide the MSN logo, but I don’t think that’s a problem. At least it doesn’t bother me.

    So what are the cool things? The most important one for me is that the MSN Desktop Search has a rich user interface, drag-and-drop, right click everything works as it should do. A nice-to-have feature is the quick launch function: you can type for example “=calc” in the MSN Deskbar (which sits in the task bar) and the calculator will start. A more important feature is the shortcut functionality; to try it type “@” in your MSN Deskbar and read the quick help. Next type for example “@c,=calc”. The result is that you’ve created a shortcut “c” to the command “=calc”. So when you enter “c” in the Deskbar and hit enter, the calculator starts. This is already quite interesting, but it gets even better. You can also create shortcuts for URLs, even those who contain parameters! So if you type “@msdn, http://search.microsoft.com/search/results.aspx?qu=$w” in the Deskbar, you’ve created a shortcut to the MSDN search page which contains a parameter ($w). Now if you type “msdn smartpart” for example, MSDN will be searched for the term “smartpart”. Pretty cool isn’t it? Another nice one is when you type in the Deskbar for each keypress a new search will be fired, because the searching is so lightening fast you get a pretty smooth experience.

     

    Are there any bad things about the MSN Desktop Search, is there room for improvements? So far I’m pretty pleased, but here are some personal remarks:

    • When you press the ctrl+alt+m keys, you will open the Deskbar, but the focus isn’t on the textbox, so you can’t start typing right away.
    • The space is my taskbar is very precious, the Deskbar isn’t big but it would be nice if for example the Deskbar was collapsed by default. When you’d click the Deskbar (or press that shortcut) the Deskbar should expand to its normal size. The next days/weeks will leave the Deskbar in my taskbar, but it has to deserve its spot over there! :-)
    • Another important player in the Microsoft search field is SharePoint Portal Server search. I'd love to see some integration here, for example adding a SharePoint Portal Server as a content source for MSN Desktop Search. This shouldn't be hard to accomplish, SPS has some web services which can be used to search through it's indexed content.

    Scoble, can you make sure these features will be available in the next release?? Just kidding :-) although passing them to the search team would be cool! And if you do so, please also pass my congratulations to them: nice job and keep up the good work!

    Read more...

  • Magic Microsoft Monday Tomorrow? MOOL & MS Desktop Search

    Tomorrow will be a very exciting day! First of all, MOOL (Microsoft Office Outlook Live) will be launched, which will synchronize data between MSN Hotmail and Outlook. It happens to be that today somebody asked me if this was possible, well tomorrow it is! Check out the posts of Patrick and Mark, and view the demo here. Scoble said that tomorrow a beta will be shipped of another product. According to his post, it will be totally "wicked". My guess is that it’s the desktop search application of Microsoft, can’t wait to see it!

    Read more...

  • Debugging SmartPart Webparts Without Deploying to SharePoint

    A quick intro for those of you who haven’t heard of the SmartPart for SharePoint: the SmartPart is a SharePoint Webpart that can host any ASP.NET user control. Create your webparts by using the VS.NET designer instead of coding everything by hand!

     

    One of the advantages is that when you use ASP.NET user controls to create Webparts, you can easily test your user control inside an ASP.NET web application instead of deploying it each time to SharePoint. When you create the user control, just drag-and-drop it onto a blank ASP.NET form for example and hit F5. Of course you miss the SharePoint layout, but to solve that you could quite easily include the CSS in you ASP.NET project.

    Those of you who already used the SmartPart probably know that you can notify your user control of the SharePoint context in which it’s displayed. You need to implement the SmartPart.IUserControl interface which is used to pass around an instance of the current SPWeb. A very basic user control that displays a dropdown navigation for all your subsites could look like this (don’t forget to add references to the Microsoft.SharePoint dll and the SmartPart dll):

     

    using System;

    using System.Data;

    using System.Drawing;

    using System.Web;

    using System.Web.UI.WebControls;

    using System.Web.UI.HtmlControls;

    using Microsoft.SharePoint.WebControls;

    using Microsoft.SharePoint;

     

    public class DropDownNavigation : System.Web.UI.UserControl, SmartPart.IUserControl

    {

                protected System.Web.UI.WebControls.DropDownList DropDownList1;

               

                private SPWeb _web;

     

                private void Page_Load(object sender, System.EventArgs e)

                {

                            DropDownList1.Items.Clear();

                            DropDownList1.Items.Add("Select a subweb ...");

     

                            foreach(SPWeb subWeb in this.SPWeb.GetSubwebsForCurrentUser())

                            {

                                       DropDownList1.Items.Add(new ListItem(subWeb.Title, subWeb.Url));

                            }

                }

     

                #region Web Form Designer generated code

                // left out …

                #endregion

     

                private void DropDownList1_SelectedIndexChanged(object sender, System.EventArgs e)

                {

                            this.Response.Redirect(DropDownList1.SelectedValue);

                }

     

                public SPWeb SPWeb

                {

                            get

                            {

                                       return _web;

                            }

                            set

                            {

                                       _web = value;

                            }

                }

    }

     

    But if you drop this user control on an ASP.NET web form, you’ll get an null reference exception because the SPWeb property isn’t set. So would you have to deploy this user control to SharePoint in order to be able to test it? Luckily the answer is no! You can drag-and-drop the user control on an empty web form, and set the SPWeb property. You can get a hold of an SPWeb instance by using the SPGlobalAdmin class like this:

     

    public class WebForm1 : System.Web.UI.Page

    {

                protected DropDownNavigation DropDownNavigation1;

     

                private void Page_Load(object sender, System.EventArgs e)

                {

                            SPGlobalAdmin adm = new SPGlobalAdmin();

                            SPVirtualServer vs = adm.OpenVirtualServer(new Uri("http://w2003base:8000"));

                            SPWeb web = vs.Sites["sites/webpartday"].RootWeb;

                            DropDownNavigation1.SPWeb = web;

                }

     

                #region Web Form Designer generated code

                // left out

                #endregion

    }

     

    Additionally, to make this work:

    • Enable impersonation in the web.config of your web application by adding the Identity tag:
      <configuration>   
        <system.web>
          <identity impersonate="true"/>
          ...
    • Make sure the identity of the application pool that is running your web application has read access to the following registry key:
      SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\Secure\ConfigDb
      If you select Local System for example, as identity of the application pool, you should be fine.
      J

    Read more...

  • Correlation in BizTalk Server 2004

    My colleague Peter has written a nice article about correlation in BizTalk, it’s published on the local MSDN Belux site. Read it here.

    I really like the metaphor he uses to explain correlation: Imagine it is your birthday and you send an invitation letter to a friend. You kindly ask him to respond to your letter so you know if he will be there. When you receive this letter you know it came from your friend and you can start planning the party. Now imagine you getting married and instead of one friend you invite everyone you know plus everyone from your future spouse’s family and friends. When you receive hundreds of letters you will have to match up these responses to the letters you sent. This is known as correlation.

    Read more...

  • SharePoint-ing in Delft (The Netherlands)

    This week I’m delivering a SharePoint training in Delft, The Netherlands. I’ve got a cool group of developers who get to know all the development opportunities in SharePoint Products and Technologies; including webparts, the object model, web services, document library event handlers, … (check here for the complete list!). Well the week is almost over, so today is my last day to enjoy the nice city of Scheveningen in which I’m staying.

     

    It’s really rewarding to see everyone getting excited about all the cool stuff you can do in SharePoint. And each time I learn something new also, for example you don’t want to use the UrlBefore property of your listEvent object in a document library event handler, if you’re handling an insert event… (sorry guys for messing up the demo ;-).

    Read more...