More SharePoint hacks

Here are some more SharePoint hacks (continuing on from my last
post here)



First off some hacks for the SPGridView which is actually a pretty useful control, but
fails to do a few things, like displaying attachment columns
as-per SharePoint's default List views (with a little paper-clip
symbol), and the second (and much more annoying) it doesn't use
the current users regional settings / timezone for formatting
DateTime values.



The hacks:

And finally support for a ListForm replacement web part -
after trying to customize the ListForm to suit a customers
requirements by creating a CustomListForm in SharePoint designer I
gave up in disgust because it's just too limited in what it lets
you achieve, and worst of all, it breaks attachments support! 
So I wrote a small web part to replace it, which allows for
fine-grained control of visibility and editability (if that's even
a word) of each field, and as an added bonus it doesn't break the
attachments functionality.  I also wanted to add additional
links/buttons to the form which triggered a save including
validation etc. - so I did a little hack to implement that as
well.
I might have a few more to post before the end of the project
- but it's almost wrapped up, so these may be the last for a
while.



Hopefully someone out there finds them useful.
Read More

Hacking SharePoint

I've been working with SharePoint lately, it's a technology of highs and lows... the highs are when you've finally got something to work that should've worked in the first place, the lows are well... all the times in between.

Ok, so that sounds cynical - SharePoint is actually quite a cool product - there's a lot of good in there... stuff that would take you a while to write yourself... but it just tends to drive you a bit crazy, things that look easy from a distance become hard to achieve because of poor documentation, lack of extension points and the difficulty in building testable code.

At any rate, while on this project I've been compiling a list of hacks that other people may find useful, which I used to solve a few of the problems I was hitting while developing... here are the first few:


There are some more coming shortly.
Read More

Architecture Chat 19

So another small turnout - Garreth, David, Murray (From Terabyte) and Myself. Peter gave his apologies, being out of town today.

First off we had a talk around the various issues / challenges facing electronic payment, US dollar merchant accounts, PayPal etc. when selling your products on line.

Part of the discussion focused around the fact that there is no existing product/site out there that can help sell your software products (that has the right features), we're thinking:

  • Distributing licenses from a pool.
  • Calling back to a web service for generating licenses on the fly.
  • License activation over the Internet.
  • License expiration (for yearly licenses) and the required logic around that i.e. automatically adding license renewals to a users shopping cart, sending notifcations.
  • The list goes on...


Even more so, building a community around selling add-ons, templates etc. for your product, and providing a model where micro payments can be collected i.e. buying credits and redeeming them on purchases etc. There are plenty of good ideas in this space.

Last of all, the existing software retail sites need to take a smaller cut - a not uncommon amount is 10-20% of the product cost... that's just crazy, especially for high-cost products, thats no different to giving them a 20% share in your business - you don't need to ship many products before you could've just built your own using PayPal.

Following that we had a long conversation around Garreth's ArchAngel product again, and in particular around the challenges of templates, round-tripping code, interesting usage scenarios i.e. (generating a model, the UI to bind to that model and WatiN classes which make it easy to write tests for the UI) - and also around preferences i.e. strengths and weaknesses of using a statically typed language (C#) embedded in the templates vs. something like IronPython or Boo, and how you can flow compilation errors (line numbers etc.) from the compiler back to the template - something I have trouble with when diagnosing Binsor, brail and my own boo based template engines at the moment, mostly because I haven't invested the time to make the experience better.

At that point we had a discussion around the various CMS's - I've been doing some research to pick one for a few sites I want to port from "other" CMS's.... The three I picked on for .Net were:


i.e. some of the open source ones... I would've liked to have included rainbow cms as well, but I just haven't had the time to review it yet.

Everyone knows about DNN (in fact we complain about it quite regularly ;o) - so it was really put up as a base line for comparing the others... mojoPortal is a bit like DNN, however it supports a wider range of databases - can run on mono and has a few unique/interesting features.  It lacks the same level of community involvement as say DNN or Umbraco, but it does give you the opportunity to avoid shelling out for OS licenses... Alas it uses web parts, and though xhtml compliant it lacks the rendering flexibility of Umbraco - Also the data model is pretty scary... a single class for all core data access, using stored procedures.

Umbraco looks good - has a reasonable template engine, and is a little more content-flexible then the other products which are based on web-parts - Sql server only and the business entities have in-line sql (why haven't any of them been built using a bloody ORM!) - this kind of thing scares the hell out of me - round trip per-property?? why!

 public int MasterTemplate { get{ return _mastertemplate; } set { _mastertemplate = value; SqlHelper.ExecuteNonQuery(_ConnString,CommandType.Text,"Update cmsTemplate set master = " + value + " where NodeId = " + this.Id); } } public string Design { get {return _design;} set { _design = value; SqlHelper.ExecuteNonQuery(_ConnString,CommandType.Text,"Update cmsTemplate set design = '" + value.Replace("'","''") + "' where NodeId = " + this.Id); } } 


Or better still, how about this web control's OnInit method:
 protected override void OnInit(EventArgs e) { base.OnInit (e); SqlDataReader dropdownData = SqlHelper.ExecuteReader(umbraco.GlobalSettings.DbDSN, CommandType.Text, "select id, text from umbracoNode where nodeObjectType = '39EB0F98-B348-42A1-8662-E7EB18487560' order by text"); base.DataValueField = "id"; base.DataTextField = "text"; base.DataSource = dropdownData; base.DataBind(); base.Items.Insert(0, new ListItem(ui.Text("choose") + "...","")); // Iterate on the control items and mark fields by match them with the Text property! foreach(ListItem li in base.Items) { if ((","+Text+",").IndexOf(","+li.Value.ToString()+",") > -1) li.Selected = true; } dropdownData.Close(); } 


The biggest down-side to me however is not the glorious SQL sprinkled everywhere - but the XSLT... I just flat out hate working with XSLT... and nobody at the table seemed to have anything good to say about it either.  It's certainly powerful, but it's just no fun to work with (XSLT that is, not Umbraco).

Still none of these are necessarily reasons to throw the baby out with the bathwater, if it gets the job done (which Umbraco certainly seems to, based on community feedback) then why not use it - the only other thing that puzzles me is the complete absence of a test suite for a project, even an empty test project would be a good sign ;o)

So on that note, Murray is embarking on a Umbraco project over the next couple of weeks - I'll check back with him when it's done and get a post-mortem on how it went, and what his thoughts are on the framework.

On the flip-side... why hasn't a monorail/ActiveRecord based CMS been released yet (that's open-source) ... a few have been written (obviously for commercial projects), but the parties and companies involved never seem to have the initiative to allow their code to escape out into the wild... I can't help but wonder how much stronger Monorails position would be if a CMS had been developed and grown along-side the project, if nothing else I suspect we might have a seen a few more interesting view components developed and made available by now.

Hardly new thoughts though - this has been discussed a few times on the Castle-project-users list, but nothing seems to come of it...

We then had a brief talk about F# becoming a "first class" language for the .Net framework, that will be in VS2008... one of the questions was what F# offered, there is a lot, but things that I can recall.

  • Functional programming, in particular foundational features like lists, tuples (allowing multiple arguments /multiple returns), pattern matching etc.
  • Type inference (which we discussed, i.e. is code using inferred types harder to read/understand as things become more complex, a bit like using var in C# 3.0?)
  • All data is immutable by default (makes multi threading etc. easy - mutable data must be declared explicitly).
  • Linq integration, and some metaprogramming functionality.


I'm pretty sure that list does the language a great injustice :)

What is exciting is that unlike C# vs VB... in this case F# provides features which make it compelling for solving certain types of problem - and as a first-class language you don't miss out the debugging etc. experiences (and your guaranteed a language which isn't going to stall or be thrown away any time soon) - I doubt I would use it for an entire project, but I could certainly see writing specific libraries in it for consumption from C#/VB.Net applications.

Last of all we discussed Recruiting (in a fairly light-hearted manor) - in particular graduates and the state of the industry with regards to finding good/brilliant graduate and intermediate developers who you can throw at interesting jobs that require a real passion and depth of understanding i.e. writing language parsers, building development frameworks etc.

The jobs we would've liked to have had when starting out ourselves no doubt!

In short it seems very hard to find really talented junior and intermediate developers to throw at highly technical work at the moment in the Auckland region (or contract resources for that matter)... And that salaries (which we've discussed are already too low in NZ for "distinguished" engineers) offered for many intermediate positions are too low to attract the right candidates, I still see some intermediate positions being offered for between $50 to $65K .. I had an $50K+ intemediate position 5 years ago!

Some thoughts included:

  • Getting more involved with institutes before the students graduate i.e. offering 3rd year projects etc.
  • Giving up and outsourcing overseas using a service like rentacoder... or maybe looking to a company like Castle stronghold.
  • Luring people away from open source technologies like ruby/python/php with more money.


Not great conclusions I'm afraid!

I also had planned some discussion around Java & .Net (as mentioned in this post) which we didn't get too - we'll discuss those next time if anyones interested (sounds like something that might be of interest to Peter).

And that's it for another Architecture Chat, thanks to all those who attended, and I'll see you in a couple of weeks time (Thursday 15th November).

BTW - If you have any suggestions for topics next time, please feel free to pass them on, and maybe next time we can move the focus back to some broader architectural topics and get some debate going on :)

Announcements


Quick couple of announcements / reminders:
  1. The CodeCamp BootCamp 2007 is on this weekend in Christchurch (where you can watch Ivan put IronRuby through it's paces, among other things)
  2. André Meurer from Olympic software has organised another Ellerslie DNUG meeting next thursday, details are below:




Microsoft PerformancePoint 2007


Ellerslie, Auckland , Thursday 8 November 2007
Gather at 5:45, starting at 6:00

Presented by: Adam Cogan (Chief Architect at SSW, MVP)

Microsoft Office PerformancePoint Server 2007 is an integrated performance management application designed to help improve operational and financial performance across all departments and all levels of your organization.

With Office PerformancePoint Server 2007, you can monitor progress, analyse what is driving variances, and plan your business from budgeting to creating management reports. You can have metrics, key performance indicators (KPIs), and reports delivered to every desktop through intuitive scorecards, dashboards, and the easy-to-use 2007 Microsoft Office system environment. A key component of the Microsoft Business Intelligence (BI) offering, Office PerformancePoint Server 2007 can help you understand how performance can align with personal and departmental.

http://www.microsoft.com/business/performancepoint/

Click Here to Register


Catering: Pizza & Drinks
Door Charge: Free!
Parking: Free, just park in Olympic Software’s car park

Venue:

Olympic Software
10 Cawley St
Ellerslie
Auckland

Map of venue

Read More

Architecture chat this thursday.

Hi All!

The next Architecture chat is on thursday this week, 11:30am at the Sylvia Park in Auckland (at Garrisons).

As always, bring along your thoughts and discussions, and in the mean time here are some possible topics for discussion that have caught my eye over the last two weeks.

  • Java & .Net
    • The IKVM project (Java VM implemented in .Net)


  • Accropolis changes
    • No new previews
    • P&P will provide WPF Composite Client guidance (uh oh)


  • Open source CMS's

  • F# - becoming a first class language in VS.Net
  • PLinq, now GridLinq.
  • Recruiting .Net developers how to/approaches.


And if anyone else has suggestions, feel free to throw me a comment/email etc. and hopefully we can get a few more of the regulars back this week.

See you all thursday!

Read More