Angus Logan

MCMS/SPS/.NET/SQL/Microsoft Australia

November 2005 - Posts

Son of SmartPart Releasted!

Via Patrick

  • Download the latest release from the GotDotNet site here
  • Watch the screencast demonstrating the deployment
  • What is Google trying to tell me?
    I've got to wipe out all my email subscriptions but I've forgotten my password :(
    Goodbye MVP, Goodbye Data#3... Hello Microsoft Australia!

    The time has come for me move on from the very cool and successful Data#3.

    No - I'm not retiring (yet) - I've accepted a job as a Technology Specialist with...
    Microsoft Australia

    Data#3 has a great team in the Microsoft Applications Solutions business I worked in and they will continue to be a leader in their market (not forgetting the other killer businesses like: licensing, security, infrastructure, recruitment etc.).

    On a side note - I've resigned my MVP-ship as you can't work for MS and be an MVP too - its a tough call because the MVP Program Rocks! but I think I'm making the right decision.

    I will definately continue blogging about MCMS, SharePoint Products and Technologies, the Office System, and Office 12 (of course!) and will post a few secrets from the inside ;) (Shhh! - don't tell anyone)

    Shortly, my blog may move to another server so if you aren't already subscribed to my FEEDBURNER feed - http://feeds.feedburner.com/anguslogan/ - Do it now so you don't miss a beat!

    Validating Sharepoint filenames on upload
    This is Crazy! I was just talking with Joseph Mortimer @ Data#3 about building an application to clean file names before uploading to SharePoint. Funny!
    Via Mads

    Some characters are legal for FAT or NTFS files but illegal for files in Sharepoint documentlibraries. Using the regular upload UI for Sharepoint you'll encounter a rather unpleasant validation error when uploading a file with funky characters. Using the object model will give you a good ole' exception.

    I've seen a lot of approaches to solving this problem, and implemented a couple myself. Last night I noticed a method on the SPEncode static class that enabled a clean approach to the problem:

    private string CleanFileName(string dirtyFileName)

    {

        char[] dirtyChars = dirtyFileName.ToCharArray();

        foreach (char c in dirtyChars)

        {

            if (!SPEncode.IsLegalCharInUrl(c))

            {

                dirtyFileName = dirtyFileName.Replace(c.ToString(), "");

            }

        }

       

        return dirtyFileName; // now clean:-)

    }

     

    Free chapter of our book - Searching MCMS with SharePoint
    Via Patrick Tisseghem

    Last week I mentioned the new book 'Advanced Microsoft Content Management Server Development' from Andrew Connell, Angus Logan, Lim Mei Ying and Stefan Gossner. If you want a taste of it, go here and download chapter 5 for free - 'Searching MCMS with SharePoint'. Even if you do not work with MCMS, the techniques explained to write the code to execute SharePoint queries are usable in a lot of places (e.g. your own web applications).



    If you like it - check out the rest of our book.
    Brisbane SharePoint User Group (BSPUG) rocked, it rocked Hard!

    I walked a whole 5m from the lab at Microsoft Brisbane to the theatre door and ate lots of pizza.

    It was good fun! - we went over the topics everyone would like to see and got an intro to the rest of the SharePointers in Brisbane.

    Hopefully I will be speaking on a few topics coming up - MCMS integration, vNext, etc.

    Check out Christopher Walker's post about it over here.

    Did I mention there was free Pizza? Because its a lunch time usergroup (next one planned 14th December 12noon-1.30pm there is a per head limit of 4 beers).

    MCMS 2002 SP2 - download it now
    Via Andrew Connell

    [via Stefan Goßner]

    Service Pack 2 for MCMS 2002 is now available.  Don't look for this to be a feature pack, but instead you can now use ASP.NET 2.0 and SQL Server 2005 in your MCMS 2002 projects.  Can someone say master pages, provider models for navigation, site maps, and more?

    » Microsoft Content Management Server 2002 SP2

    More Telerik goodness
    telerik newsletter
    Dear Angus,

    On our way towards Q4 release, we are pleased to present you our betas for five new products:
    • r.a.d.toolbar
    • r.a.d.input
    • r.a.d.window
    • r.a.d.calendar
    • r.a.d.upload
    This is the first beta release of our new products so now is the best time to share your ideas and suggestions. We are eagerly looking forward to your feedback.
    R.a.d.toolbar

    PRODUCT HIGHLIGHTS:
    • High performance and cross-browser support
    • XHTML and Accessibility compliance
    • Rich collection of toolbar items (Regular Buttons, Toggle Buttons, Template Buttons, Separators)
    • Button groups
    • Different orientation (Horizontal and Vertical)
    • Flexible binding (Data Binding, Programmatic Binding, XML Binding)
    • Rich client-side API
    • Client- and server-side events
    • Advanced skinning mechanism
    • Transition effects for Internet Explorer

    Beta Installation
    Online Demos
    Beta Forum


    R.a.d.input
    PRODUCT HIGHLIGHTS:
    • Masked Text Box and Date Time Picker
    • Easy and flexible validation
    • High performance and cross-browser support
    • Support for ASP.NET 2.0 and Visual Studio 2005
    • XHTML and Accessibility compliance
    • Keyboard support
    • Full design-time support for VS.NET
    • Copy-and-paste support
    • Easy customization of appearance
    • Rich client- and server-side API

    Beta Installation
    Online Demos
    Beta Forum


    R.a.d.window
    PRODUCT HIGHLIGHTS:
    • Replace the browser-provided dialogs and alert/prompt/confirm boxes
    • Cross-browser modal and non-modal dialogs and windows
    • Very flexible minimization modes
    • Full customization of the look and feel
    • Circumvents the Windows XP SP2 popup blocker mechanism
    • Rich client event model
    • Keyboard support
    • Associating commands with shortcuts
    • Optimized caching mechanism
    • Fully localizable

    Beta Installation
    Online Demos
    Beta Forum


    R.a.d.calendar
    PRODUCT HIGHLIGHTS:
    • Localization – full integration with the System.Globalization classes
    • Month view and Multi view (multiple months)
    • Template support
    • Flexible date selection
    • Customizable presentation direction
    • Rich client- and server-side API
    • Native AJAX Support

    Beta Installation
    Online Demos
    Beta Forum


    R.a.d.upload
    PRODUCT HIGHLIGHTS:
    • Single and multiple file upload
    • Customizable progress window
    • Customizable memory usage
    • Configurable look and feel
    • Validation for File Size, Extension and Mime Type
    • Rich server- and client-side API
    • Seamless co-existence with standard file inputs
    • Automatic storage
    • Flexible skinning mechanism
    • Full localization

    Beta Installation
    Online Demos
    Beta Forum

    If trial keys are needed to test the new products on a URL other than http://localhost, the telerik support team can supply you with such upon request to betasupport@telerik.com. Please, mention the URL and the domain/intranet name where the product will be tested.

    Thank you for your involvement.
    the telerik team

    telerik betas | November 02, 2005
    Using Central Templates in SharePoint Part 1
    Via Kit Kai

    In this article, we examined how to change the default document template used by document library to create new document. However, each document library will have its own document template as SharePoint can only use documents stored in the forms folder as templates.

     

    This poses a potential problem, especially when there are many document libraries using the same document template, and a new template was available requiring updating.

     

    Linden Daniel, a MCS consultant currently based in Singapore were discussing how solve this problem for a client. After brainstorming, we came out with this elegant solution, which MCS later requested me to document this as the best practice for centrally manage templates. So Part 1 of the solution can be found here.

    CMS Rapid v1.2 Released
    Via Mark Harrision
    CMS.RAPID v1.2 is available to download.

    More

    Refresh page after edit in InfoPath
    Via Mads

    When using InfoPath for editing data in you webapplications you run into a couple of tricky situations when beeing used to plain webdevelopment. One of these scenarios is when you want your webpage to refresh after having edited a record in some datasource with InfoPath. Typically you've implemented a view webpage and edit with InfoPath.

    This sounds pretty uncomplicated, and I guess it is, but still it took me quite a while to figure out.

    My first attempt was to use standard web techniques like opening a browser window pointing to the infopath form modally with showModalDialog and refreshing the hostpage on return. No luck. I was thinking about creating a custom hostpage utilizing iframes to open the document much like a lot of people do to handle pdfs, but I really don't like adhoc host'ish pages in my solution.

    I also considered going all the way and serve my Infopath documents dynamically, but that would have been to big of a change to my current solution.

    I went back and studied how the Sharepoint SDK suggests to solve this problem. Sharepoint makes use of a clientside component (INLAUNCH.DLL) to open InfoPath documents. The control is called OpenXMLDocuments. From the documentation I adopted the RefreshOnFocus approach from the Create sample and tried to modify the Edit sample with it to get the refresh. Problem was that InfoPath slightly lost focus during load of the XML document which forced a too early refresh of the hostpage when using the EditDocument2 method directly.

    Then I read Westins blog and got the idea to se exactly what Sharepoint does on the "Edit in Microsoft Office Infopath" button. Westin also describes how to launch an InfoPath form from a Sharepoint page but this only includes create which seems to work slightly different from edit.

    Adopting the call from the "Edit in Microsoft Office Infopath" button and combining it with the RefreshOnFocus approach lead me to the following working solution for refreshing a webpage after editing in InfoPath.

    <script language="javascript">

    function RefreshOnFocus()

    {

       window.location.href = window.location;

    }

     

    function showInfopathAndRefreshWhenFinished(url)

    {

          window.onfocus = RefreshOnFocus;

          editDocumentWithProgID2(url,'InfoPath.Document','SharePoint.OpenXMLDocuments');

    }

    </script>

    Be aware that the clientside control must be present for this to work, but I assume it is installed with InfoPath (anyone care to assert this assumption regarding INLAUNCH.DLL?). The editDocumentWithProgID2 method is defined in the standard Sharepoint script includes.

    Great cache of articles on Intranets from Australian company Step Two
    I stumbled across Step Two's cache of papers on Intranets via a CMS Watch post - James Robertson (MD of Step Two) is a guru.

    Great stuff, he has also written about card sorting - the funnest way to come up with an information design :)
    Mobile Phone Bill Reconciliation the Geek Way
    This is a bit scary but I built an app about a year ago the exact same way!!!
    Via Joseph Cooney

    Rather than reconcile my mobile phone bill the way a normal person would do it (by say marking off items in the bill with a pen and then totalling up the hilighted items) I reconcile my mobile phone bill the following way:

    1. Download CSV phone bill from provider.
    2. BCP file into SQL Server (DTS - yeuch).
    3. Query a view to see “work related or possibly work related” calls.
    4. Update “phone number” table with new work & non-work numbers.
    5. Iterate over steps 3 & 4 until the number of “unknown“ numbers approaches zero.
    6. Execute query to calculate total.

    For uber-geekiness I have already considered:

    • Using biztalk instead of BCP to populate the database (I'm pretty sure this is the approach bill would take)
    • Querying my contacts list in exchange to suck out all those phone numbers (expediting steps 4 & 5)

    Can anybody think of any other obvious optimizations I could be doing here?