LavaBlast Software Blog

Help your franchise business get to the next level.
AddThis Feed Button

Hybrid Accordion/TreeView Sitemap

clock December 20, 2007 09:14 by author EtienneT

Live Demo | Source Code (VS 2008) (856.65 kb)

The TreeView site map that we use in FranchiseBlast has become too long to fit reasonably the left panel of our application. We wanted something more compact that would be as simple to use and maintain as our current solution.

Matt Berseth gave us the idea of using an AjaxControlToolkit Accordion to achieve a nice look and feel for our sidebar. Our site map is automatically generated from our Web.sitemap file. (We use different *.sitemap files for each client; we needed something dynamic to cut down on maintenance time. We simply change which *.sitemap file the Web.config points to in our configuration generation scripts.) Furthermore, we also trim what is available in the sidebar according to user roles. I've added a reference to the appropriate web.config settings to achieve this behaviour below.

<siteMap defaultProvider="secureProvider">
<add name="secureProvider" type="System.Web.XmlSiteMapProvider" siteMapFile="Web.sitemap" securityTrimmingEnabled="true"/>

Yesterday, I began coding a quick solution to our problem. I was inspired by the code in this post but ultimately I changed it a lot. We wanted all first level nodes in the Web.sitemap to be Accordion panes and all the other levels to be contained in TreeViews inside the parent pane.

We also highlight the current page in bold in the TreeView and display a different pane color to represent the current selection. Altogether, this is pretty simple stuff but hopefully it will help you avoid re-inventing the wheel.

Happy holidays to all!


Live Demo | Source Code (VS 2008) (856.65 kb)

kick it on






A first in the competitive stuff-your-own teddy bear industry

clock December 9, 2007 11:45 by author JKealey

We have just released a new feature on the Teddy Mountain Stuff-Your-Own Teddy Bear Website which we believe is an industry first. Teddy Mountain sees itself as the most innovative teddy bear franchise and they use LavaBlast's technology for both their supporting infrastructure and client facing applications.
We've done a number of industry-specific solutions for this franchisor:

  • Interactive Kiosk with webcam and touch screen to create your own teddy bear adoption certificate.
  • Point of Sale: Integrated with the kiosk, our point of sale is easy to use and reduces training costs.
  • Website: Online sales via an e-commerce engine with a few teddy bear industry-specific features.
  • FranchiseBlast: Our centralized management and collaboration portal which ties everything together, providing a single environment to modify the product line, store pricing, collaborate with others, share documents, view reports, etc.

Today, we augmented the integration between the points of sales distributed across the world and the Teddy Mountain website.  We are now allowing members of the frequent buyer program to view adoption certificates they have created in brick and mortar stores…. online! Simply put, existing PaLS members from a select number of stores are able to see their frequent buyer card balance and birth certificate history on the Teddy Mountain website. We think that no other franchisor in the teddy bear industry has done anything similar and are proud to see Teddy Mountain lead the way. Of course, for privacy concerns, only those who sign-up for the program will have their pictures made available online to distribute to their friends and family.

We feel that, in the long term, this feature will improve gift card sales from out-of-town family members as the donor can receive visual feedback from the recipient, via the Internet.

If the feature attracts some interest, we are open to implementing new features such as integration with FaceBook or using Google's OpenSocial API. We shall also add features such as emailing certificates to friends/family with a greeting.

Debug Visualizer for SubSonic Collections

clock December 7, 2007 20:00 by author EtienneT

Wouldn't it be nice to be able to see a SubSonic collections while you are debugging, just like the DataSet debug visualizer? Because we often need such a tool to debug our SubSonic collections here at LavaBlast, I've created a small Visual Studio Debug Visualizer that you can use to see what your SubSonic collections contain.  How does it work?  While you are debugging, put a breakpoint somewhere and simply hover your mouse over a SubSonic collection variable.  You should see something similar to the screenshot shown above.

Once the tooltip has appeared, you can click on the small magnifier to open the debug visualizer.  You'll see a DataGridView similar to the picture on the right. This will show all your SubSonic objects in a easy to navigate list.  Basically my code takes the SubSonic list and transform it in a DataTable.  I can't use the method ToDataTable() from the SubSonic AbstractList because this requires access to the provider's configuration, and the JIT executing the debug visualizer doesn't have access to it.

To use this simple tool, download this file SubSonicVisualizer.dll (8.00 kb) and put it in your [My Documents]\Visual Studio 2008\Visualizers\ folder, creating the directory if it doesn't already exist. (You might want to double check your file system permissions on this folder, as well.) I compiled this for Visual Studio 2008.  I have also included the source code here (Visual Studio 2008) in case anyone wants to enhance it. (386.36 kb)

If you are using Visual Studio 2005, I think this file will work for you, but I have not tested it: SubSonicVisualizer2005.dll (8.00 kb). I simply changed the reference from Microsoft.VisualStudio.DebuggerVisualizers.dll version 9.0 to 8.0 and, from what I have read, it should work in VS.NET 2005.

kick it on

Webcam surveillance in FranchiseBlast

clock December 6, 2007 23:11 by author JKealey

Point of sale surveillance With the Teddy Mountain teddy bear stuffing franchise, we’re fortunate enough to work with a technically savvy franchisor. Our website describes various elements that we’ve produced for their great franchise system. LavaBlast is proud to help centralize the Teddy Mountain franchise operations and bring the franchise offering to the next level. We’ve been working with them on various solutions since their early beginnings and grown our tailor-made solution with their growing needs.

Today, we launched a simple feature that allows franchisees to remotely monitor their stores, using security webcams that were installed when the stores opened. This is something they could already do, but we’ve integrated it into our solution so that they only have one place to go on the web for their product pricing, reports, etc.

The integration into our solution was a quick job thanks to the infrastructure we already had in place. We do little side-projects like this just for fun, to clear our minds!

PS: The Teddy Mountain store decor is absolutely fabulous. The Imagination Retail Group has found a great balance between visual appeal and supporting infrastructure.


blast it on Franchise NewsBlast

Multitasking while Visual Studio builds

clock December 5, 2007 13:25 by author EtienneT

Are you using Visual Studio and your solutions are taking longer than 10s to build? Why not put those 10s to good use and do something other than stare emptily at your poorly decorated office? Maybe you are worried that your build will finish before you expect it to and you don't want to lose precious time? You don't have to worry about this anymore thanks to what I found today! You can now feel free to peruse a few blog posts while Visual Studio is building!  [insert witty comment about how men have difficulty multi-tasking here]. 

Robert Robins posted this on his blog recently and I didn't even know it existed! You can configure VS.NET build sounds that information you where the build is done!

Go to the Control Panel, Sound and Audio Devices, Sounds Tab, Microsoft Visual Studio, and configure the sounds you'd like to play when the build succeeds/fails. LavaBlast is not responsible for what your coworkers do to you after configuring Pee-wee Herman or a bomb siren as your default sounds.

Happy coding!





kick it on

SubSonic Limitations - Part 2 (aka: Knee deep in … SubSonic. )

clock December 4, 2007 22:02 by author JKealey
Knee deep in snow.

After my recent post  asking for the most elegant way to support multiple databases with the same schema at runtime, I received some good pointers in the SubSonic forums from dbr, a forum user. In the end, I admit should have done my homework before posting.

One elegant solution to change the SubSonic Provider/ConnectionString at runtime makes use of SharedDbConnectionScope. I personally do not like this solution, as I prefer my code to explicitly state what it’s doing via its properties or arguments instead of relying on contextual information.  I was also concerned about how it works with regards to concurrency and I did a little digging. Looking at the code, I discovered it internally uses the ThreadStatic attribute which seems like a godsend at first, but further investigation reveals the implementation may be flawed. I did see people complain that it didn’t work for them, but don’t know if it is related to the ThreadStatic attribute. I do not fully trust this technique, but I may wrong as I'm far from an expert in concurrency.

Returning to Dbr's suggestion, he simply generates different providers at runtime for each connection string. This sounds simple if you can manage to modify the ProviderName property on the collection (ActiveList) or object (ActiveRecord) every time you load/save from the database. Without resorting to SharedDbConnectionScope, you can't use the auto-generated constructors because they fall back to the default provider which is hardcoded in the generated object’s schema.

The elegant implementation to encapsulate loading/saving from the database is to use a controller, as would be suggested by the MVC design pattern. I have not yet played with the new MVC templates provided by SubSonic, but we already use a good generic SubSonicController here at LavaBlast.

I wanted to re-write my object loading/saving code using this new solution to get rid of my inelegant concurrency locks. Although obvious in appearance, I encountered a few little hiccups along the way and I thought I'd post my findings here.

Limitation 1: You can't create an object by specifying its ProviderName in an ActiveRecord constructor using the default generated code.

  • Workaround: You need to load it using a collection, which supports the ProviderName.
  • Workaround 2: Use SharedDbConnectionScope
  • Workaround 3: Change the code templates to add new constructors.

Limitation 2: You can't use a collection's Where parameter to load your data (via its primary key or other filter), because of incomplete framework code. Hopefully this will be resolved soon (see issue 13402).

  • Workaround: Copy-paste the code used by internally by the Collection, but pass in the extra ProviderName parameter to the new Query.

Limitation 3: You can't specify the ProviderName property on an ActiveRecord because the setter is marked as protected.

  • Workaround: Change the code templates and add a public method/property that sets PropertyName from within the class.
  • Use SharedDbConnectionScope.

Limitation 4: When you load an ActiveRecord by running a query or by loading a Collection, the ActiveRecord does not inherit the ProviderName from the Collection/Query. This is probably due to Limitation 3.  

My current prototype no longer uses the c# lock keyword. I create instances of a controller, passing in which connection string name to use. All database loading/saving is done via this controller, for which I have attached sample code extracts. I managed to get object loading code to my liking, but I had to resort to SharedDbConnectionScope for saving. Once the minor limitations in the framework are resolved, I will be more comfortable with the code.

In summary, I did manage to get a working prototype and I have attached the relevant portions of code that works with data from the appropriate database (chosen at runtime). Hope this helps!

Month List


The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2017

Sign in