Blog Home  Home Feed your aggregator (RSS 2.0)  
.Net Jonesie - Thursday, April 03, 2008
A simple programmers blog
 
 Thursday, April 03, 2008

A few people have been doing some great things in the community and it's fantastic to see them get recognition.

Congradulations to :

  • JD Trask (ASP.Net)
  • Ivan Towlson (Windows Client - WPF) (having an MVP award will soon be a pre-req to getting a job at Mindscape! :)
  • Zachary Smith (Sharepoint)
  •  

    Somehow I also managed to scrape in for another year.

    Thursday, April 03, 2008 1:21:30 PM (New Zealand Standard Time, UTC+12:00)  #    Comments [0]    | 
     Tuesday, April 01, 2008

    Keep these dates free if you can afford it:

      May 20 in Sydney
      May 22 in Melbourne

    Booking open from 7 April ish.

    More details soon.

    Tuesday, April 01, 2008 2:33:31 PM (New Zealand Standard Time, UTC+12:00)  #    Comments [0]    | 
     Monday, March 31, 2008

    Thanks to Chris Johnson I now know how to create a feature staple with VSeWSS.

    If you don't know what a staple is then Chris has a good description on his blog.  You should read this first for more background but my simple explanation of a feature staple follows.

    Feature staples are a way of attaching customisations to existing features and hence site definitions.  This is acheived by creating a feature that associates itself with another feature.  You can also add Feature Receiver code (which is like an event handler for feature activation) that lets you do all sorts of goodness that you can't do with CAML.

    Feature stapling is the reccommened way of customising SharePoint.  Site definitions may appear to be a good way to go, but dont.  Andrew Connell explains why.

    To create a staple you actually need to create two features:  the feature that you want activated and a feature to do the stapling. 

    Update:  I just found a much better description of the process here.

    VSeWSS 1.1 does not yet support feature stapling via an item template, but you can still do this via a neat trick that the VSeWSS team provided.  Here's the steps.

    1. Create an Empty VSeWSS project:


    2. Add a module for the feature you want stapled.  This this case I just used the default module that copies sample.txt.
    3. Switch to WSP View and refresh.
    4. Open the module feature.xml and change the scope to Site.
    5. Open the Module.xml for the new module and change the Url to "MyModule" and add RootWebOnly="FALSE":


    6. Deploy the solution and make sure that you get sample.txt in a new folder MyModule.
    7. Now for the stapler.  In the solution explorer, create a new folder called Stapler.  Add a new XML filed to this called element.xml.  This will contain the feature associations:

      This element.xml contains 3 associations for the new Module.  The Id GUID is from Module1.  Get this value from the WSP View of Module1 feature.xml.  The TemplateName is found in 12\TEMPLATE\1033\XML\WEBTEMP.XML - STS is the name of the templte and #0, #1, #2 is the configuration.  So, this staple associates Module1 with Blank Site, Team Site and Document Workspace.

      Make sure the element Id is a new unique GUID.  WSP uses this.

      Note: there are issues with the blank site.  I can't find the reference to the explaination of this.. will update when I do.
    8. Switch to WSP View and refresh.  You should see a new Feature appear for the staple called Untitiled1.  Rename the folders to the name of your stapler thus:


      You should also change the Title in the feature.xml.
    9. Edit the feature.xml for the Stapler and set the Scope to Farm:  
       
    10. Deploy and pray.
    11. Test & checking.  The stapler feature will be deployed to the farm.  Check the Farm Features to make sure it's there. VSeWSS will also deploy the module to the default site so you need to create a new site to test that the staple works. 
    12. Create a new Team site.  Use SharePoint designer to see if the MyModule folder is created.
    13. Now that you have the stapler working you can create a feature receiver to perform any code based actions.  I haven't done this part yet.  I'll post again when I do.

    Normally you will use this method to deploy a master page, aspx page, css etc.  If this is the case then you probably don't need to copy these files to every sub-site, just to the root site.  Set RootWebOnly to TRUE if you want.  Remember that if Module1 is copying files to a library then you need Type=GhostableInLibrary for each file that is copied.

     

    Monday, March 31, 2008 12:31:43 PM (New Zealand Standard Time, UTC+12:00)  #    Comments [0]    | 
     Wednesday, March 26, 2008

    I'm not very good at managing my daily tasks.  The only way I am half reasonable is to create todo lists.  This works for a day or until I lose the peice of paper I scribble the tasks on.

    Luckily, there is a better way:  ActionThis!

    Use ActionThis to help you and your team work together more effectively, using the power of the web combined with Microsoft Office.

    Thousands of people worldwide use www.actionthis.com to manage the tasks small businesses, teams and their partners need to complete to succeed. Delegate tasks from Microsoft Outlook, connect with your team on the ActionThis task management website, track progress and take action with live reports delivered to your email inbox.  ActionThis is free to try, and simple to use. Less time following up, more tasks completed, your business is more productive. ActionThis was designed and developed by Intergen in New Zealand and will help you and your team get things done.

     

    How ActionThis helps you get stuff done

    ·         Use Microsoft Outlook to create and assign tasks to yourself, your team, your partners

    ·         Organize and access these tasks from anywhere using Microsoft Outlook or the www.actionthis.com website

    ·         Keep track of progress, projects, and workload with reports emailed to your email inbox

    ·         Keep on top of overdue tasks with live alerts designed to help you take action quickly

    ·         Export and analyze your progress with Microsoft Excel

    ·         Telephone and email support is free

     

    Try it for free. Sign up for a one month free trial at http://www.actionthis.com/product/trial.aspx and use this referral code: INT531.

    Thursday, March 27, 2008 12:56:18 AM (New Zealand Standard Time, UTC+12:00)  #    Comments [0]    | 
     Thursday, March 20, 2008

    I'm often asked 'How do I get to be a great programmer like you Pete?'.  Well not quite, I added the last bit, but Tokes provides a better answer than I ever could. 

    I completely agree with Tokes, being a (Microsoft) developer is getter way harder. But it's not Microsoft's fault.  It's those pesky users.  I always said that being a developer would be a piece of cake if it wasn't for users!  They seem to want more and more every year and are less impressed by coded coolness.   In fact, I think there is a formula to calculate coolness:

      

    (C is Coolness, loc is lines of code, si is systems integrated, To is time overrun)

    Time seems to be suffering too.  As systems and requirements grow in complexity there seems to be some sort of temporal distortion reducing the amount of time available to a developer. I think Stephen Hawking discovered this when he ran out of budget for his black hole simulator (SimHole).

    Developers must also share the blame for increasing complexity. We are always chasing the next best thing without much regard for using what we already have.  Microsoft's job is to create temptation - it's us developers that can't keep our hands out of the cookie jar.  Visual Basic 6 is still a great tool.  Visual Studio 2008 just looks prettier!

    It's no wonder that fewer and fewer kids are taking up IT as a career. Although, with both parents in the industry my 3 kids seem to be heading in the right direction.  Maybe we as developers should procreate more?

    Thursday, March 20, 2008 7:51:38 AM (New Zealand Standard Time, UTC+12:00)  #    Comments [2]    | 
     Monday, March 17, 2008

    I had a custom field type in my MOSS solution that was a simple CODE type.  This was based on a Text type but all it did was to uppercase any value.

    However, when I referenced a list that used this field type from InfoPath the column would not display in InfoPath.

    I haven't figured out how to do this yet so I reverted back to a Text field for now.  I'm guessing there is an attribute I need to add the the module.xml or maybe in code? If you have a solution, I'd love to know :)

    Monday, March 17, 2008 12:49:17 PM (New Zealand Standard Time, UTC+12:00)  #    Comments [0]    | 
     Friday, March 14, 2008
    Friday, March 14, 2008 7:16:30 PM (New Zealand Daylight Time, UTC+13:00)  #    Comments [0]    | 

    I truly wish you haven't been wasting as much time as I have this week with SharePoint anonymous access and a custom master page.

    I have a site that uses a custom membership provider, forms authentication, anonymous access and a custom master page.  My problems were many but in the end the main one was getting anonymous access to the home page.  This would always give me an ugly 401 error.

    After a good nights sleep and with a clear head, I finally realised that the problem was not with Pages/default.aspx but with it's masterpage which as not deployed correctly.  I had missed putting type="GhostableInLibrary" into the file node of the module:

      <Module Name="MasterPages" Url="_catalogs/masterpage" Path="" RootWebOnly="TRUE" >
        <
    File Path="mine.master" Url="mine.master" Type="GhostableInLibrary" IgnoreIfAlreadyExists="FALSE" />
     
    </Module>

    It's the little things that can really screw you!

    TGIF.

    Friday, March 14, 2008 1:28:49 PM (New Zealand Daylight Time, UTC+13:00)  #    Comments [1]    | 
     Thursday, March 13, 2008

    If you are having problems creating a State Machine workflow for SharePoint in VB (and I really dont know why you would want to use VB but... :) then you may see an error about missing files, Workflow1.layout and Workflow1.resx.  If this is the case then you need to copy these files from the C# Project Tempalte zip to the VB version.  Full details are in the following blog post comments- it's a long one so search for workflow1.layout to find it.

    http://blogs.msdn.com/sharepoint/archive/2006/06/07/introduction-to-sharepoint-workflow.aspx

    Thursday, March 13, 2008 2:40:25 PM (New Zealand Daylight Time, UTC+13:00)  #    Comments [0]    | 
     Monday, March 10, 2008

    A blog-less colleage of mine, Bryce, just discovered redirects in IIS 6, which is something new for me also.  Bloody useful if you are moving site content around, moving servers or just want to make URL's more friendly.

    http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/41c238b2-1188-488f-bf2d-464383b1bb08.mspx?mfr=true

    This is particularly relevant for sites with really long and complex URL's, e.g.: SharePoint, in which case you should also read:  http://www.toddklindt.com/blog/Lists/Posts/Post.aspx?ID=48

    Monday, March 10, 2008 1:34:16 PM (New Zealand Daylight Time, UTC+13:00)  #    Comments [0]    | 
     Thursday, March 06, 2008

    To create a forms library definition with VSeWSS 1.1 is very easy.  You can similarly create a list definition based on a content type.  However, you cant automatically create a forms library with an attached content type.

    This is how I did it.

    1. Create your content type
    2. Create a temporary list based on the content type
    3. Create a form library list
    4. Edit the forms lib schema.xml
      1. Copy the content type fields from the temporary list schema to the <Fields> node.
      2. Update the <List> node, adding:

      3. BaseType="1"
        Direction="0"
        EnableContentTypes="TRUE"

      4. In <ContentTypes> optionally remove the base Form content type reference if you only want to allow the specific content type:

        <ContentTypeRef ID="0x010101"> ... </ContentTypeRef>

      5. Add a new <ContentTypeRef> that has the ID that matches the content type you created in step 1.

    5. Delete the temporary list definition
    6. Deploy and cheer!

     

    Thursday, March 06, 2008 4:45:50 PM (New Zealand Daylight Time, UTC+13:00)  #    Comments [0]    | 
     Monday, March 03, 2008

    Here's a small trick that confused me for a while this morning.  VSeWSS creates a setup.bat & .wsp file that will deploy a site definition into a specified server.  Running setup.bat from the command prompt appears to be the obvious way to do that.  You can also override the default web and site urls, e.g:

    setup /weburl http://myserver /siteurl http://myserver

    The default being localhost (or whatever you developed against).

    However, this was failing for me becuase the specified web did not yet have a root site collection and some part of the site definition (web parts) were scoped to the site.

    The solution is to create a blank site using stsadm thus:

    stsadm -o createsite -url http://myserver -ownerlogin administrator -owneremail me@myemail.com

    Then you can deploy the site defintion using setup.bat. When you browse to the new site you will be prompted with a list of possible site definitions.

    Like all things SharePoint this is easy and obvious when you know...

     

    Monday, March 03, 2008 5:42:09 PM (New Zealand Daylight Time, UTC+13:00)  #    Comments [0]    | 
     Tuesday, February 26, 2008
    No, not mine, but this one.  http://nickgrattan.wordpress.com.  There is lots of useful material here on many SharePoint topics.

    Does anyone have a list of quality SharePoint blogs?  Maybe I'll start one here...

    Tuesday, February 26, 2008 1:38:38 PM (New Zealand Daylight Time, UTC+13:00)  #    Comments [0]    | 
    When deploying a solution to a site you can sometimes get errors that are not picked up during compilation.  For example, we created a Content Type that contained a field with an inccorrect BaseType of "Person" rather than "User".  This compiled just fine but fails on the first deploy.  It then failed to compile after deploying.

    To fix this is easy enough - remember to update the content type xml as well as the generated schema.xml - but Visual Studio can get it's nickers in a knot and will not be able to deploy the corrected solution.

    You need to manually remove the solution using the setup.bat that is created during deployment. Run setup.bat from the bin\debug or bin\release folder thus: 

        setup /u

    Then IISReset.

    If you try to redeploy with Visual Studio you may now get an error that talks about an "invariant language"  - sorry, I didn't save this error message when it happened.  You will need to restart Visual Studio to clear this error.



    Tuesday, February 26, 2008 1:27:10 PM (New Zealand Daylight Time, UTC+13:00)  #    Comments [0]    | 
    I'm in lovely sunny Wellington this week working on some WSS samples using the Visual Studio Extensions for Windows SharePoint Services 1.1 (or more easily pronounced VissyWiss).  One of the samples requires the use of a Module Project Item.  There is surprisingly little documentation - official or otherwise - on what a module does and how to use it - at least, not that we can find.  So, here's my contribution - hopefully correct.

    A Module Project Item is used to deploy files to any(?) part of your WSS installation.  You specify the source of the item to copy as a file path relative to the module, and the destination as a url path relative to the site root.  This all sounds very simple, but the problem is that there are 2 urls and 2 paths so there are several permitations possible and not all of them work!

    When you add a Module Project Item to your project (Site def, Empty def etc) you will get an XML file called Module.xml in a folder.  Our one looks like this:

    <?xml version="1.0" encoding="utf-8"?>
    <Elements Id="b43cb805-eebf-421a-83d3-c2a6cb8afa10" xmlns="http://schemas.microsoft.com/sharepoint/">
      <Module Name="module_training" Url="images">
        <File Url="WORD_icon.jpg" Path="module_training\WORD_icon.jpg"
    Type="Ghostable" />
      </Module>
    </Elements>



    Module Url: This is where the files will be copied to.  The url is relative to the site root.
    File Path: Path to the file relative to the project in Visual Studio.
    File Type: This can only be Ghostable or GhostableInLibrary.  You can only use GhostableInLibrary if the module Url is for a List, such as Shared Documents.

    <Module> also has a Path attribute but we dont need it for this operation.

    The module will create folders if they dont exist so in the above example we are copying an image to the root images folder, but this could easily be "customimages" and the folder will be created.

    There's more to Modules but that is all I have for now.  I'll update when I know how to do Wildcards :)

    Tuesday, February 26, 2008 1:11:15 PM (New Zealand Daylight Time, UTC+13:00)  #    Comments [3]    | 
     Wednesday, February 20, 2008

    Rod is a frequent poster on the subject of broadcast TV. I agree totally with his latest comments and suggestions, but I'd just like to add my little bit.

    I dont have an AppleTV or an iPod or iTunes stuff but I do have a Media capable PC connected to a 42" LCD TV.  I dont use Media Center as a) I dont have TV tuners in the PC and b) there are no guides for TV programmes (yes you can hack it but Ive tried and got too frustrated) and c) Media Center just gets in the way when your downloading stuff - you still have to revert to Windows Explorer and a browser.

    I also dont like the idea of paying for TV so I dont have Sky (plus all the repeat screenings and self promotion drive me nuts). 

    However, I do pay for RapidShare which is were I get all my downloads from. Yes, this a moral disgrace and while I can't legally justify it, in my defence I would like to say that I mostly download TV shows that are (or one day might be :) free to air in New Zealand.  I also don't give away stuff I've downloaded - at least not too often, maybe 10%.

    So, it occurs to me that if TV NZ, or whoever has the balls, wants to charge a reasonable amount for access to full legal ondemand TV then I'd probably sign up.  I might even consider tollerating a few advertisements - like 1 per half hour.  And they should also have a great selection of program - not the usual crap that passes as quality TV (CSI, Boston Legal, Lost etv (OMG dont get me started)).

    Of course 'reasonable amount' is a very subjective term. For me this would have to be a lot less than Sky but could be more than RapidShare - say $15 or $20 a month.  I think this is very unlikely in over priced New Zealand so I'll continue to infringe copyright until broadcast TV dies and/or I run out of disk space or bandwidth.

    Wednesday, February 20, 2008 1:55:44 PM (New Zealand Daylight Time, UTC+13:00)  #    Comments [0]    | 
     Sunday, February 17, 2008

    Today I received a correction to a post I did on SharePoint last year.  My erroneous statement was causing a few queries to be sent to Microsoft.  For this I am truly sorry, but in my defense I did check my facts first - like all good reporters I blame my sources!

    Anyway, that got me thinking about correcting blog posts.  I've seen debate about this in the past and my philosophy has always been:

    • correct only factual errors but leave the original text intact
    • never delete a blog post unless under court order
    • be careful what you say BEFORE you post

    My temper and inpatients often get me into trouble so there are a few blog posts here that I could remove or edit, yet, I wont.  Better to see me warts and all I think. 

    What do you thnk?

    Sunday, February 17, 2008 7:45:31 PM (New Zealand Daylight Time, UTC+13:00)  #    Comments [1]    | 
     Thursday, February 14, 2008

    Microsoft have just release v 1.1 of the Visual Studio Extensions for WSS - VSEWSS.  These work with Visual Studio 2005 and offer a few enhancements of the 1.0 release.  There will be another release mid year that will add support for VS08.

    WSS dev is a huge hairy beast and it can be hard to get started - or even figuring out where to start. The best part about new release is the user guide that is provided with VSEWSS.  This is something that some clever chaps at Intergen have been working on.  I provided some very minimal input reviewing their work which is basically providing me with some free training in exchange for fixing a few typos!  The user guide will improve over the next few months as we add more sections so keep checking for updates.

    Get it here:

    VSeWSS 1.1

    http://www.microsoft.com/downloads/details.aspx?FamilyId=3E1DCCCD-1CCA-433A-BB4D-97B96BF7AB63&displaylang=en

     

    User Guide

    http://www.microsoft.com/downloads/details.aspx?FamilyID=a8a4e775-074d-4451-be39-459921f79787&DisplayLang=en

    Thursday, February 14, 2008 3:13:13 PM (New Zealand Daylight Time, UTC+13:00)  #    Comments [0]    |   | 
     Wednesday, February 06, 2008

    Lately, I often find myself repeating a little mantra:

       Keep it simple
       Keep it simple
       Keep it simple

       Ohhhhmmmmmmmmm.

    This usually happens when it's too late, when I'm bogged down 5 layers deep in SQL or CAML, when Ive spent 3 hours googling for a solution to a problem and only found half answers in Polish.

    Some observations:

    • Complexity is often the result of too much simplicity.
    • Too much abstraction moves you away from a solution.
    • Everyone is busy.
    • You can't polish a turd.

    I'm working towards a point here so stick with me. I'll be more specific.  SharePoint.

    SharePoint is big.  Really big.  "So big that you can't even imagine it" big.  It's not bad, just big.  Big things tend to be more complex.  Complex is harder.  Harder takes longer and therefore costs more.

    At the other end of the scale is NotePad. Anyone who can use a computer should be able to use NotePad.  It's functional, uncomplicated, stable(?) and I think elegant.

    Here's some more observations:

    • The world is a complex place. It's full of complex human beings.
    • Business often needs solutions for humans.  These tend to be complex too. SharePoint is designed to solve complex solutions.  I'm not going to use NotePad for anything other than to edit a occasional text file.
    • Clarity can only be acheived when all solutions are explored.
    • Complexity and Simplicity are relative and not mutually exclusive.

    My point is this.  We should not be scared of complexity.  Simlicity is an admirable goal but not when its at the cost of solving a problem.  We need a way of managing and dealing with complexity.  I'm sure there are many people much smarter than I devoting themselves to exactly this problem, but here is my small contribution.

    1. Avoid complexity but don't be afraid of it.
    2. Compartmentalise complex solutions into managable chuncks.
    3. Focus what is infront of you. 
    4. Be patient but follow the 20 minute rule (see below).
    5. The next version will always be better but the previous version is often good enough.

    My 20 Minute Rule

    You can adjust the time up or down to suit, but my 20 minute rule is this:  If I can't figure out how to use/do something in 20 minutes - without a manual  - then it's too hard or complex.

    This doesn't mean I give up, it just means I need to learn more before attempting it again.

    Wednesday, February 06, 2008 1:20:10 PM (New Zealand Daylight Time, UTC+13:00)  #    Comments [2]    | 

    If you are a regular reader of my blog - and I think there is still one person - Hi Mum! - then you will have noticed that my blogging frequency and quality has been very low for quite a while.  The truth is I have lost some enthusiasm to blog.  I've often started to write blogs and think "what a load of twaddle" and hit cancel.

    My choices are to continue on drip feeding or pull finger and start writing about something useful.  My ego still enjoys seeing my face and words on the Internet so there is not way I'd pull this site :)  The only sensible thing left to do is commit to doing some regular posting.

    So, to that end, I hearby declare my intention to post at least twice a week.  Topics will include anything I'm working on - Sharepoint, EPiServer, general .Net, SQL etc - community activity - user groups etc - and an occassional option or rant about something that gets me wound up - which is pretty easy to do.

    If you are a regular reader (Hi Mum!!) and you noitce me slipping again, please feel free to remind me of my pledge or publically humiliate me in some non-photoshop way.

    Now... off to do my first one.

    Wednesday, February 06, 2008 12:26:49 PM (New Zealand Daylight Time, UTC+13:00)  #    Comments [2]    | 
     Wednesday, January 23, 2008

    It's been a while since I've blogged about EPiServer (or anything) but today I heard that Service Pack 1 for EPiServer 5 CMS has been released.  It contains quite a few bug fixes and a few minor changes.  The one new significant thing for me is the improved support for ASP.Net profiles. 

    You can get the full details here.

    Thursday, January 24, 2008 2:37:24 AM (New Zealand Daylight Time, UTC+13:00)  #    Comments [1]    | 
    I guess it's going to be a while yet before we need to memorise al these new tags, but there are some major changes and a lot of nice new things coming along in HTML 5. Definately worth a read.  I particularly like the things they have left out - especially framesets!

    Thursday, January 24, 2008 2:23:18 AM (New Zealand Daylight Time, UTC+13:00)  #    Comments [0]    | 
     Tuesday, January 22, 2008

    My Christmas project was to create a new house for our chickens that was easier to clean than the last one - which was realy just an oversized dog kennel - which you can see behind sticking out from behind the new version in this phone photo:

    I used some plans from buildeazy.com which made things a lot simpler, but I did make a few changes.  The coop has a window at the rear which I got from a local demolition yard for $65.  There's a lot of timber in this design, probably more than the chickens appreciate, but at least it will never blow away in the strong winds we get.

    All up, I think it cost about $NZ1000.  A local business sells ready made units for about $NZ800-$NZ900 but they are quite a bit smaller and nowhere as sturdy as this one.

    Tuesday, January 22, 2008 10:07:22 PM (New Zealand Daylight Time, UTC+13:00)  #    Comments [1]    | 
     Monday, November 19, 2007

    I recently found an excellent series of posts that describe how to customise the UI in Scarepoint.

    http://www.cleverworkarounds.com/category/sharepoint/

    There's a LOT of other useful stuff in this blog - regular reading I think.

     

    del.icio.us tags:
    Monday, November 19, 2007 3:05:14 PM (New Zealand Daylight Time, UTC+13:00)  #    Comments [0]    | 
    Copyright © 2008 Peter G Jones. All rights reserved.
    DasBlog 'Portal' theme by Johnny Hughes.