Developers new to Community Server may rightly view it as a rather odd duck, with the Chameleon control model falling into that realm of feathered obfuscation. Yet a rather seemingly insignificant control I wrote recently might help explain Chameleon, which when boiled down to the thick duck gravy is really quite swanlike.
The control I’m describing is from my CS-based Job Management app. Certainly not a Community Server control you’ll see every day, as its function is to display all dates that charges are applied to a job for which there is no accompanying job slip printed and signed by the customer.
A CodeSmith-driven development approach generates our complete set of Chameleon classes in seconds.
After which we jump to the essence of our control, the DataSource property in JobChargeDateList.cs
More CodeSmith comes into play here, with a Composite CodeSmith Template generating all of the code we need to retrieve our generic JobChargeDate object via our Action class and SQL Data Provider classes. Our SQL procedure is ready and waiting, which completes the ensemble, at which point the Chameleon HTML sets the play.
<DBVT:JobChargeDateList runat=”server” Tag=”div” CssClass=”SlipChargeDates”>
<DBVT:JobChargeDateData Property=”datecharged” runat=”server” />
(<DBVT:JobChargeDateData Property=”chargetypes” runat=”Server” />)
There’s nothing left but the Quack! Quack!