Sunday, August 23, 2009

Tech Support Cheat Sheet

I actually did something similar when I was head of Microsoft Office Support in Israel in 2002 - regardless, if you are like me - the "computer expert" of the family, just email this to all your relatives and relax.

Tech Support Cheat Sheet

Wednesday, August 19, 2009

Web Parts – a developer and architect’s guide

Below are the slides from the presentation that I did in the SharePoint Saturday events in Sydney and Adelaide in the last two weeks. A lot of people asked me for it, but I am not sure how much help it can be to you if you haven't been there- since my presentations are more me talking and running demos, and less information from slides (I do love the sound of my own voice...).

If you still want to, here are the slides:

















Oh - and credit to Fernando Felman for the wonderful list of links at the end. Here they are if you want to copy them:
http://en.wikipedia.org/wiki/ACID
http://www.codeplex.com/AppArchGuide
http://www.codeplex.com/AppArch
http://www.martinfowler.com/

Tuesday, August 18, 2009

Windows 2008 R2 goodness - adding sharepoint folders to a library

Just a heads up to what you can expect when you upgrade to Windows Server 2008 R2 (aside from all the technical things like virtualization improvements):

Win2008R2 is also known as “Windows 7 Server”, since the UI is windows 7 (unlike windows 2008 which was vista).

This means we can create “libraries” – which are virtual folders which replace the vista “search folder” with much more options.

An example is shown below – I created a virtual folder called “sharepoint files” and added the 12 hive and the office servers folders as well as the “logs” folder – and now I have an easy way to get to all three of them in windows explorer:
Bliss. Oh - can you see how I named my 2008 R2 machine?

Sunday, August 02, 2009

Creating Thesaurus files

I had a look at the excel file that Mauro Cardarelli wrote as a tool to generate thesaurus plans. While the tool is nice, I was dissapointed it did not include a facility to load an existing XML file and analyze it to see if it contains faults such as duplicates.

So what I did was write my own macro that loads a thesaurus file into Mauro's excel spreadsheet. The macro only loads expansions (as his spreadsheet does not deal with replacements) - but you can easily change it to load replacements if you want.

To use this macro, open Mauro's file, and open the visual basic window (alt-f11) and paste the procedure at the bottom of the "sheet1" module. To run it, either click the "run macro" button in excel, or from the VBA environment, hit F5 when the cursor is in the procedure. The macro will ask you for the path of the file, and will load it and populate the excel file.

Sub LoadThesaurusFile()
    Dim total As Integer
    total = 0
    Dim thesaurusFile As New DOMDocument
    Dim path As String
    path = InputBox("Path to the Thesaurus xml file", , ActiveWorkbook.path + "\thesaurus.xml")
    If (path = "") Then Exit Sub
    
    thesaurusFile.async = False
    thesaurusFile.validateOnParse = False
    'to avoid errors because of a thesaurus schema file, we will load the file as a text file, and then remove the schema reference
    Dim fs As TextStream
    Dim fso As New FileSystemObject
    Set fs = fso.OpenTextFile(path, ForReading, False, TristateUseDefault)
    s = fs.ReadAll
    s = Replace(s, "xmlns=""x-schema:tsSchema.xml""", "")

    Dim sht As Worksheet
    Set sht = ActiveSheet
    If (thesaurusFile.LoadXML(s)) Then
        Dim expansions As IXMLDOMNodeList
        Dim expansion As IXMLDOMNode
        Set expansions = thesaurusFile.FirstChild.SelectNodes("//expansion")
        'start from row 4
        Dim iCurrentRow As Integer
        iCurrentRow = 4
        'loop over the expansion tags, and populate the spreadsheet
        For i = 0 To expansions.Length - 1
            Dim iCurrentColumn As Integer
            Dim subs As IXMLDOMNodeList
            'load current exapnsion
            Set expansion = expansions.Item(i)
            'load the expansion subs
            Set subs = expansion.SelectNodes("sub")
            For iCurrentColumn = 0 To subs.Length - 1
                sht.Cells(iCurrentRow, iCurrentColumn + 1) = subs.Item(iCurrentColumn).Text
                total = total + 1
            Next iCurrentColumn
            iCurrentRow = iCurrentRow + 1
        Next i
        MsgBox ("Total entries: " & total)
   Else
    MsgBox ("Error loading the XML file: " + x.parseError.reason + vbCrLf + "Source:" + x.parseError.srcText + vbCrLf + "Link:" & x.parseError.Line)
   End If
   Set thesaurusFile = Nothing
   
End Sub