Monday, October 20, 2003

Caught formating and parsing stuff once again ...

   Some time ago, I swore never to format or parse anything anymore ... Well, usually one really doesn't have to, since there are often higher layers for most protocols. However, I have made an even stronger oath never to copy somebody else's code without either going through every detail of it, making it maintainable (comments and structure), and testing it to a fair level of confidence, before using it in a project (off course I'm talking about non copyrighted code).

   Well, I have not had to integrate email in my applications beyond the functionality of System.Web.Mail classes. Until today, when I had to do some authentified smtp mail sending, and some pop3/imap mail retrieval. I must confess I started by looking at some user samples and source code in the regular sites (http://www.gotdotnet.com , codeproject ...etc), and did find some intersting classes, except that they just did not satisfy my maintainability criteria, and would have taken me more time to arrange than just plain rewriting the code.

   Here I am thus, about a half day later, with a functional smtp client class (that replaces somewhat the smtpMail class of System.Web.Mail, and is able to do authentication using Base64 Encoded username and password, and send a System.Web.Mail.MailMessage object. I have not finished doing the necessary parsing for the pop3 retireved messages (I will have to postpone that until wednesday because of the many engagements I have tomorrow...)

   Attached is the code to my smtpManager Class.

SmtpManager.cs (7.81 KB)
C# | main
10/20/2003 8:34:13 PM UTC  #   
I'm blogging this T-Shirt

   Jeff Sandquist  has sent me a bdc bloggers T-Shirt. It has "I'm blogging this" on the front, and a nice "Microsoft PDC03 I was there" logo on the back. Thanks Jeff.

   I guess this will give some visibility to bloggers among attendees ... too bad the pdcbloggers Url is not on the shirt ...

   One of my collaborators at the office just made me realize I have been receiving so many     T-Shirts that I just don't buy clothing anymore ... Thanks a lot everyone ...


main | PDC
10/20/2003 10:53:55 AM UTC  #   

  Wednesday, October 15, 2003

RDs at PDC

If you see this logo on someone at PDC, he is one of the many RDs attending (I would guess there should be around 70 or 80 of us), speaking, participating in a panel, hosting BOF sessions, monitoring the labs, doing Ask the Experts booth duties... outside the conference center, more probably than not around sunset or holywood boulevard at night, you can find many of us (without the badges this time) ...

Who are we ? you can look us up at our web site at http://www.microsoftregionaldirectors.com/Public/ .

We are about 120 independent developers, architects, trainers, consultants and other professionals from all around the world, very informed about Microsoft technologies (usually also about other thecnologies as well). We usually can give you informed opinions, based on real world experience and balaced views about Microsoft technologies away from hype or dog food.

See you there ...


main | PDC
10/15/2003 1:43:37 PM UTC  #   
PDC Birds of a feather sessions

This year, not only PDC is great in including three huge new technologies, but also in its special sessions. One of the new formats is the Birds Of a Feather sessions. These are attendee hosted (any attendee can propose a session, and the sessions are aproved based on a vote by attendees).

The format of these sessions is really interesting, because it is a one hour, almost unstructured (close to chalk talk format) discussions between attendees. My guess is that we will see lots of humor take place, and much less dog food than we would in any other sessions.

Looking at the aproved topics, it is interesting to see that they globally three kinds :

  1. Real Life experience and concerns with .Net (present and future). These really are concerned by the topics that are not technology topics, and that one would never expect or trust Microsofties to cover.
  2. Alternate or deeper looks at technologies than one would not expect in regular sessions. These cover things like Rotor (CLI) development, using .Net with Oracle, Alternate programming languages, business intelligence with .Net, Palldium ...etc.
  3. Totally non technical, usally very different approche to developer concerns, like Women who code (I don't hide I will not miss that one, since most women attendees will be there ...), Reader to Author to Publisher for .NET (books on .Net), Weblogging: The Future of Conversational Software ...etc.

I will be hosting a BOF on Office system and integrating with business process (I just noticed my topic was aproved!). See you there ...


main | PDC
10/15/2003 12:56:57 PM UTC  #   
Covering PDC Panels ...

The PDC Panels are great in that is has no prepared marketing dog food (no PPTs allowed). It is about Microsofties answering your technical questions. PDC bloggers will cover the various panels, and gives you even an opportunity to ask your questions before hand (even if you are not a PDC attendee).

I will be covering two panels :

  1. Put The Power Inside: Hosting the CLR in Your Application - 10:30:00 AM - Room501ABC

  2. Computing on the Beach: Visions of Mobility - 1:45 PM - Room 411-Theater

All panels are on the PDC's last day (Thursday Oct 30).


main | PDC
10/15/2003 11:48:56 AM UTC  #   

  Saturday, October 11, 2003

PDC in two weeks ... Be There!

   Last PDC was in LA. If it was not one of the greatest, and if there was no PDC in 2002, it is because a PDC is and should be about technology, and there were no totally new one at the time ... This year, not only there is a new technology, there are many of them (Indigo, Longhorn, Yukon, ...).

   The number of attendees also seems to be one of the greatest (already overbooked, and registration closing on Monday, hurry up if you haven't registered yet!). I go to many conferences regularly (at least 3-4 per year in the US, many events in my region - i.e. North Africa), and I always come bqack with the opinion that what makes a conference great is both its content and the general atmosphere, parties and fun going on in it. This PDC will be a blast ... See you there.

  


main | PDC
10/11/2003 4:22:17 PM UTC  #   

  Monday, October 06, 2003

Web Parts as Custom Web Controls (or almost...)

I will continue on the Office System series with this very simple exemple of how one can write Web Parts just as one would write any ASP.Net Custom WebControl. The only difference is that you don't override the Render Method, but the RenderWebPart method instead (this allows for the Web Part predefined functionnality like dragging and dropping the Web Part within the Web Part Page in Windows SharePoint Services sites or SharePoint Portal Server sites, as well as the integration within the Web Part Framework and use of the WebPart Tool panes ...etc.). example in C# (A reference to Microsoft.SharePoint.dll and to System.Data.dll are needed):

using System;
using
System.ComponentModel
using
System.Web.UI; using System.Web.UI.WebControls;
using
System.Xml.Serialization;
using
Microsoft.SharePoint;
using
Microsoft.SharePoint.Utilities;
using
Microsoft.SharePoint.WebPartPages;
namespace
MyWebPartsLibrary
{

[ToolboxData("<{0}:WebPart1 runat=server></{0}:WebPart1>"),
XmlRoot(Namespace="MyWebPartsLibrary")]
public class WebPart1 : Microsoft.SharePoint.WebPartPages.WebPart
{

private DataGrid myAuthorsGrid=new DataGrid();
protected override void RenderWebPart(HtmlTextWriter output)
{

myAuthorsGrid.DataSource=getAuthors().Table[0];
myAuthorsGrid.DataBind();
myAuthorsGrid.RenderControl(output);

}
private DataSet getAuthors()
{

System.Data.SqlClient.SqlConnection cnn = new System.Data.SqlClient.SqlConnection("data source=localhost; initial catalog=pubs; integrated security=SSPI");
System.Data.SqlClient.SqlDataAdapter adapt =
new System.Data.SqlClient.SqlDataAdapter("select * from authors", cnn);
System.Data.DataSet result =
new System.Data.DataSet();
adapt.Fill(result);
return result;

}

}

}

As for all Office System Solutions, there must be a manifest that is signed with a digital certificate (that's the basis of all security configurations and policies for Office System solutions) that references the dll as follows :

<?xml version="1.0"?>

<!-- You need only one manifest per CAB project for Web Part Deployment.-->

<!-- This manifest file can have multiple assembly nodes.-->

<WebPartManifest xmlns="http://schemas.microsoft.com/WebPart/v2/Manifest">

<Assemblies>

<Assembly FileName="MyWebPartsLibrary.dll">

<SafeControls>

<SafeControl Namespace="MyWebPartsLibrary" TypeName="*" />

</SafeControls>

</Assembly>

</Assemblies>

<DwpFiles>

<DwpFile FileName="WebPart1.dwp"/>

</DwpFiles>

</WebPartManifest>

 

To install the Web Part in SharePoint, a CAB file has to be created (Setup Project) and the utility stsadmn.exe is used for installation as follows :

stsadm –o addwppack –MyWebPartLibrary.dll

 

 


main | Office System
10/6/2003 5:15:33 PM UTC  #   

  Tuesday, September 30, 2003

Very simple way to do smart tags

Too tired to go into any object model, I will just give a very simple example of XML List Smart tags in the new Office System, taking advantage of the MOSTL engine. Just put the following XML into an xml file in C:\Program Files\Common Files\Microsoft Shared\Smart Tag\LISTS\1033\ et d'exécuter l'utilitaire C:\Program Files\Common Files\Microsoft Shared\Smart Tag\SmartTagInstall.exe and my name will be recognized on your documents, allowing you to access my blog from any office document  ...

<?xml version="1.0" encoding="utf-8" ?>
<!-- _lcid="1033" _version="11.0.4617" -->
<!-- _LocalBinding -->
<FL:smarttaglist xmlns:FL="http://schemas.microsoft.com/office/smarttags/2003/mostl">
    <FL:name>
        <!-- _locID_text="name" _locComment="{StringCategory=TXT}" -->Malek test lists</FL:name>
    <FL:lcid>
        <!-- _locID_text="lcid" _locComment="{StringCategory=TXT}" -->1033,0</FL:lcid>
    <FL:description>
        <!-- _locID_text="description" _locComment="{StringCategory=TXT}" -->Ensemble de listes de test</FL:description>
    <FL:moreinfourl>
        <!-- _locID_text="url" _locComment="{StringCategory=TXT}" --></FL:moreinfourl>
    <FL:updateable>false</FL:updateable>
    <FL:autoupdate>false</FL:autoupdate>
    <FL:lastcheckpoint>100</FL:lastcheckpoint>
    <FL:lastupdate>5123942</FL:lastupdate>
    <FL:updateurl>
        <!-- _locID_text="updateurl" _locComment="{StringCategory=TXT}" --></FL:updateurl>
    <FL:updatefrequency>20160</FL:updatefrequency>
    <FL:smarttag type="urn:schemas-microsoft-com:office:smarttags#malektest">
        <FL:caption>
            <!-- _locID_text="recognizercaption" _locComment="{StringCategory=TXT}" -->Mot de test</FL:caption>
        <FL:terms>
            <FL:termlistwithprops> 
                <FL:prop RecognizedByMOSTLList="True" />
                <FL:t>Malek</FL:t>
                <FL:t>Abdelmalek</FL:t>
                <FL:t>Kemmou</FL:t>
                <FL:t>A.Kemmou</FL:t>
                <FL:t>A.K</FL:t>
               </FL:termlistwithprops>
        </FL:terms>
        <FL:actions>
            <FL:action id="My Blog">
                <FL:caption>
                    <!-- _locID_text="My WebLog" _locComment="{StringCategory=TXT}" -->Navigate to my WebLog</FL:caption>
                <FL:url><!-- _locID_text="actionurl1" _locComment="{StringCategory=TXT}" -->http://www.malekkemmou.ma</FL:url>
            </FL:action>
        </FL:actions>
    </FL:smarttag>
</FL:smarttaglist>


main | Office System
9/30/2003 9:03:53 PM UTC  #   

  Sunday, September 28, 2003

Disconnected for a week

I just got back from Tunis, Tunisia. For one week, I had no connectivity, my AC adapter for my laptop broke down, and Tunis went through some innondations ...

I was doing a training on Office System for a mixed audience of developpers and ITPro, which I will do 3 more times non-stop, in Casablanca, Morocco and Algiers, Algeria. The course covering XML features, SharePoint integration, smart Tags and smart Docs, research, ...etc.

I will have some rest today, and tomorrow I will post some insight into the new Office development techniques (as well as the code I promised last week).

 


main | Travel
9/28/2003 5:44:21 PM UTC  #