The best way to learn to customizing Sharepoint for an ASP.NET guy - use Reflector

This is probably the best best tip I'm going to share so far with regards to Sharepoint.

Think of Sharepoint as a pre-built framework on top of ASP.NET, if you are working within the confines of the multitude of options Sharepoint gives you, then you need a big thick book on Sharepoint.

If you are thinking about customizing Sharepoint, then you're beginning to face a problem I had.

How does it all work, and perhaps more importantly, why does it just not work?

You can resort to Google.  In which case, I hope you find this blog.

Or you can grab Reflector and peek inside the secrets of Microsoft.Sharepoint (WSS) and Microsoft.Sharepoint.Publishing (MOSS) assemblies.

I'll share with some findings real soon.

Tough to love Sharepoint

Recently started doing some work on Sharepoint, it's really tough to love Sharepoint.

At a glance, it seems that this is just a technology that's build on top of ASP.NET, so surely it's got all the goodness of ASP.NET + more build-in goodness.

Actually, I'd almost say it's the opposite.

It's got all the goodness of ASP.NET locked away where you can't easily use to customize your solution.

So if you are after something out of the box with light modifications, Sharepoint is really your friend.

As soon as you want heavy modifications, it feels like a complete road block.

Still, it has some really great publishing features, which distinctively makes it very compelling for an enterprise to use and set up.

I'll have more to say very soon.

Where is the DataRepeater for Silverlight?

I came across a really puzzling thing while playing with Silverlight tonight, try as I might, I couldn't find a DataRepeater style of control.

Basically, this is what I wanted to do:

<StackPanel x:Name="actions" Margin="10,0,10,5" Orientation="Horizontal" >
<HyperLinkButton Content="{Binding ActionName}" Click="Action_Click" />
</StackPanel>

And then bind these to an array of actions in the datacontext.


Sadly, StackPanel doesn't support ItemTemplates, and looking around, it seems that the only controls that supports binding collections properly are ListBox and TabControl.


The Grid control is purely for positioning.


The ItemsControl (and the child class ListBox) supports ItemTemplate, but refuses to tile my hyperlinks one after another horizontally, until the width is full and it wraps around.


Bummer.


I've settled temporarily with adding the HyperLinkButtons in the codebehind inside a foreach loop.  But not using databinding for this task makes me sad.


I will get to the bottom of this.



 


Starting another journey, again

I've finished one leg of my journey at Oakton www.oakton.com.au and have decided to return to my old company www.ssw.com.au to continue my consultant dream.

The reasons are long and numerous, but I'd just say that the biggest factor is there was a really good situation for me and I grabbed it before the window of opportunity disappeared.

In a sense I feel I've learned a lot in the three years I've spent wandering around in the wilderness, I've experienced:

  • Product development - where I'm not doing consultant work
  • Contract work - where there's excellent money but difficult career progression, or choice of technology
  • Working with teams on different time zones
  • Big team development - working in a 20-man team is fun too, but with lots of draw backs.
  • I've worked with proper BA now.  Finally!  Big thank you to the Vero BA's, you know who you are, wherever you are now.
  • Big complex organisations
  • Enterprise level projects
  • I nearly jumped in with a startup and would have definitely done some fun stuff, but I just don't know if I'm ready to settle down on one project

But some things remains the same

  • Agile rocks
  • Waterfall flops
  • Unit-testing is great
  • But hard to do in a web app
  • Windows application is sweet
  • Until you gotta deploy

(Thanks to Dinesh for fixing the rhyme on "flops" for me - second line)

I leave my old colleagues with what I've always firmly believed consultants do

  • We work hard, we write good code, and at the end of the day, the clients are happy and we are happy.

So with a happy fondness for all the great memories, I bid my old colleagues farewell for now.

Your windows service started and stopped

The name-of-your services on Local Computer started and stopped. Some services stop automatically if they have no work to do, for example, the Performance Logs and Alerts service.

I had fun with this one for a bit.  Developing Windows Service is one of those "I rarely do this" activities.  So when I got one of these errors when I start my service, immediately I switch into "Ah I must have forgotten something" mode.

  • May be the process started and didn't do anything and finished
  • May be the timer didn't go off
  • Perhaps I need to spawn a thread to listen / sleep

I couldn't attach a debugger to the service given that it doesn't stay running.  So that limited my options a bit.

Turns out, the "informational message" was pretty misleading, I had the following in my event log.

Service cannot be started. System.NullReferenceException: Object reference not set to an instance of an object.
   at MyService.MyService.OnStart(String[] args)
   at System.ServiceProcess.ServiceBase.ServiceQueuedMainCallback(Object state)

Oops.

Fixed that error, and the service starts successfully.