Matt Denman's Blog

Since June, 2009
Getting this blog up and running on our own Syrinx CS system has been a long time coming. I've been working on the SWAF product since 1996 when I first got introducted to Design Patterns. I've been lucky to be able to work on a consistant set of patterns and the framework over the years to keep the work moving forward from one development environment to another.
I cannot claim to have done all the architecture work or development work in the framework. Because the architecture has been used at a variety of companies and environments, I've been fortunate to be able to work with some great guys that really helped my thinking on software architecture and development. I specifically want to recognize and thank the following people that have particularly stood out over the years as helpful colegues and mentors:
Marshal Cline - Marshal and I first worked together at CSX Transportation in Jacksonville Florida back in 1995. He was the guy that introduced me to design patterns. He has a company called Paradigm Shift and I can honestly say he shifted my paradigm! The work we did at CSX helped me to get a concrete understanding of how to properly use design patterns and Marshall was a big help during that time. He is a naturally gifted speaker and he sure knows his OO. He's the only guy I know who can write hundreds on lines of C++ code on a pad of paper and only have a few typos. Everyone else waits for the compiler output to do what he does in his head. Thanks Marshall for all your Mentoring and friendship over the years.
Leo Scott - Leo and I worked at PCSI (which was factory automation company) back in 1992. I went from C to C++ and OO programming under the guidance of Leo. Leo has a very unique mind and he has been one of the most influential men in my development career because of it. While I only worked with Leo for a few years, his impact on my thinking and work can still be felt to this day. While working with Leo our team got to explore OOA/D concepts from Grady Booche and in a way, working with Leo was like being in school 50% of the time. Leo, you'll never really know how much your mentoring has meant to me over the years.
Jim Watson - Jim and I first worked together on an IBM call center project back in 1997. Marshall Cline was also on that project and I met Jim through Marshall. Jim was the guy that got me thinking about business processes, business rules, and proper n-tier architecture. It was on this project that the the rule manager concept came into focus and that work is still somewhat present in the current framework today.
Tom Glover - Tom and I first worked together at Ceridan (a payroll/human resources company) 2003, where we were able to take my open source Java SWAF framework and port it over to C# and move the framework forward in many ways. Tom and I got to explore lots of options on how a framework like SWAF could be used in a corporate environment, and through our work we were able to make SWAF the Ceridian standard corporate framework.
Search Blog:
Blog Index:
|
Pages:
I recently wrote some code to automate the updating of the supported domain name bindings of an existing IIS website. I wanted to use WMI for this because WMI is the standard interface for controlling the various servers from Microsoft and many other companies. You can do many powerful things with just a few WMI calls. We are using this feature in Syrinx Community Server to allow an admin to set the domain names the web site should support, which would then update the IIS web site. Here is the fun we went through to get this working.
Issue 1: There are two levels of WMI support for IIS. IIS6 and below have a different set of WMI classes than IIS7 and above. If you use the IIS6 WMI classes, you would have to install "legacy IIS6 support" in IIS7 to make it work. IIS6 WMI is also buggy, so given that we are on Windows Server 2008 for this, we choose to use the IIS7 WMI. Syrinx Community Server will run on IIS6, but the feature to automatically update the IIS website with the new domain names supported wont work with it. I guess I could have used the ADSI library, but I really want to stick with WMI for this.
Issue 2: There is very little documentation online about how to truly manage IIS with WMI. Sure there are examples that show how to list the domain name bindings of a site, or to list the sites in IIS, but that is of little value for how to actually manipulate settings in IIS. You really need to understand how the general WMI libraries work in order to go at a fresh start with controlling a server with WMI. This is one reason why I am writing this thread.
Issue 3: I developed the code on windows 7, which actually uses IIS 7.5. The following code snippet works great on Windows 7:
The variable name dns is a List<string> type. Each string in the list is a domain name that is expected to be supported. The code assumes that the list of domain names is the only domain names the site should be supporting. This code also does not support https right now.
So, assuming that the code was solid and ready to go on a Windows 2008 server, I deployed to a server for more testing. Here is where I found the BIG BUG in IIS7 WMI support.
With Windows 7 using IIS 7.5, if the site was support the domain names a.com, b.com and c.com and the code above was changing that list to just a.com and x.com, the iis site would show bindings of only a.com and x.com as expected. HOWEVER, With windows server 2008, the site would show a.com, b.com, c.com and x.com. In other words, server 2008 with IIS 7 was not removing the entries that were no longer in my list like Windows 7 with IIS 7.5. This was going to be a big problem.
I searched the web and found one other guy mentioning the same bug. A developer from the IIS team said he saw the bug and went and fixed it. the IIS team developer said he wasnt sure how the bug fix would be released. I went and updated my server 2008 with SP2, and the bug was still there. I search the web for fixes to IIS to resolve it - no fix was found.
My dedicated server hosting provide was able to provide a new server with Windows Server 2008 R2, which is running IIS 7.5. I put the site on the new server and sure enough the code above was doing the work as expected, exactly like II 7.5 on Windows 7.
Issue 4: In order for the above code to actually work, it needs elevated privileges. It wont work with the standard app pool identity created for ASP.NET web sites. The last thing I wanted to do was to require the Syrinx Community Server web sites to run with elevated privileges. So, I created a new "Syrinx Community Server Site Management" windows service that runs the above code. The code in the ASP.NET web site uses binary .NET remoting to talk to the windows service which does that actual work of updating IIS.
The windows service is a new base for other such functionality, such as doing backups and restores of sql server databases, updating DNS entries in the DNS server, and creating new web sites in IIS. We use SVN for our source control for our client's web sites, and are working on a new feature that will automatically get latest from SVN, create a new web site, create a new sql server db and hook up everything to work properly. That way we can deploy a web site by checking in our work in SVN and then let the windows service do all the work.
So, all is well that ended well so to speak. It was a long and windy road, but we now have a nice new level of functionality that also builds for the future. The down side is that this new code support requires no less than IIS 7.5, but the core Syrinx Community Server will still work on older IIS servers.
Add Comment
I've seen other developers with the MVP status (such as Rick Strahl, a great MVP) and always thought that it would go nicely with my MCSD.NET and MCT certifications, but never knew anything about it. I do go around helping developers with .NET development issues and other things along that line, but had no idea that it was a part of being an MVP. Earlier this year I was invited to do a lecture at the Microsoft Web RampUp (kind of like the MS DevDays event), which gave me a great opportunity to meet other local developers in the Cebu City area. Since then I've done some free MSDN training here in Cebu and it was nice to keep meeting more Cebu City area software developers. I look forward to doing several more free training session to help build up a stronger software development community here. After doing an MSDN training at the Microsoft Cebu office, Angie Radan (an MS employee in Manila) invited me to apply for the MVP. She asked a lot of questions about me and the various work I do "to help out the community of software developers", and a couple of months later I get an email from Microsoft telling me I am one of 164 MVPs in the South East Asia region. I have to admit it made me feel good to get that email.
Today, my MVP award arrived via FedEx and I was shocked to see a real glass award and certificate in the box, which was another pleasant surprise. So now, I'm an MVP in C# and now I feel a desire to help the local development community as much as I can to keep up the status.
Add Comment
Its been a busy two months, working on a variety of new features for Syrinx Community Server. The product has really made some big gains during this time, including some great support for Google maps, a new Calendaring feature, beefed up e-commerce and more. We've had some good client projects that have helped us push things along. We wanted to add Google map support after seeing another site running it for their AirSoft tournaments (http://www.airbana.co.uk/airsoft/Skirmish). It was a nice usage of Google maps and I wasnt aware of all that could be done with the API that Google exposes for it. The AirSoft site was showing contact and calendar event information as push pins that when clicked would show a tabbed popup with detailed information. After spending some time looking over the map API fro Google, I knew we could add support for it in Syrinx CS and set it up to use Ajax. Syrinx CS has support Google maps via the FCK editor plug by Martinez Delizarrondo, which allowed a map to be dropped into an article, but that was it. This latest round of work added map support on three new ways. I wanted the Map support to run deep within the Syrinx CS product. While I didnt want to make Syrinx CS totally dependent on the map system I wanted maps to be used beyond simple eye candy; I wanted it to provided meaningful and useful insights into the data contained within a SCS based application. Maps in Contact ManagementWe had recently added a nice contact management feature in Syrinx CS, and we added a map view tab directly in the contact management page. This allows you to see the set of contacts shown in the grid. Its a good way to get a spatial understanding of the contacts. When the contacts are from sales order out of the ecommerce system you can get a clearer picture of where your sales are coming from. My intent is to extend this so that the warehouse locations would be shown in relationship to sales order shipping locations with the Google map polyline function drawing lines from the location an order was shipped from to the location products were shipped to. That is work slated for the next round of development, with the ultimate goal to be able to the supply chain on the map and interact with the data shown on it. Maps in Calendar ManagementAnother feature we added recently was calendar management, and we wanted to add support for viewing calendar events in the map. When a calendar event has an address, you can set the exact latitude and longitude with our popup address pinpoint window. Later, when viewing the calendar event as an article, users can see the map of the event location and even get directions to the event from their address. We plan on using this in sites that sell access to events at specific locations, such as training events at a conference center, diving trips at specific dive spots and so forth. For basic events with locations, the calendar is good for getting directions and understand the location of the event. However, for businesses that sell access to events, the Map can provide detailed information needed to make the decision to buy into the event. The best example for this is a dive group offering ocean diving at various dive spots. That type of event can indicate the locations at a diving trip will go to, along with rich information about the location. Google map's overlay features allow the application to add addition information about the area, which can really give the customer all the information they need to make the decision to buy. In the next round of work in this area, we intend to allow an SCS site to add overlays onto a specific type of map that would allow for more detailed information. The general maps dont have much information about diving spots, so this would be an important addition to support that type of usage and a dive shop that offered that type of web site would stand out amongst its competition. Integrated Map ViewWe built a new standard MapView page that combines contacts and calendar events into one interactive display. Standard users can filter the items shown, with a small filter display at the top of the screen. This view was taken after the AirSoft site that sparked the idea of adding Google map support. One of the things I added into this view was the ability to edit contacts and calendar events directly within the view. If you are logged in and have security privilege to edit contact or calendar events, you will be able to turn on edit mode and the map pin popups will show editors within them, including the FCK editor for editing the body of content that is shown for the contact or event. Custom Map PinsCalendar event types, contact types and address types can have a custom map pin assigned to them. When editing the types in the grid, you can use the map pin toolbar button to pick an image to use for the push pin. Any image can be used, and SCS will create a map pin size version of it to use on the map. This is a great way to distinguish between the various types of things being shown on the map. My Experience with the Google Map APIOverall I can say I am very impressed with the map API. The power of it is amazing. One area I still need to work on is the ability to consolidate multiple map pins into one pin at various levels of zoom. The map API does have the ability to consolidate multiple map pins with its MarkerManager class, but it doesnt really assist with the ability to only download the information needed for the amount of map pins showing on the screen at any given time. I designed the map integration of SCS to be able to download map point information in ajax calls, and in the next rev of my work I'm going to only download the pins that are needed at the moment and do the consolidation on the server. For example, if you have 500 pins in a small area and then zoom out, rather than having to download 500 pins of information to allow the MarkerManager class to consolidate them for you, I'll do that work on the server and only download the consolidated information into the browser. This way, when zoomed out, the 500 pins in one area may be represented as one pin and the popup window shown when clicked on would show consolidated information about the contacts or calendar events. This will allow for a much larger number of data points to be used within the map without slowing down the user experience. In reality, to do map pin consolidation well takes some serious though in how the data should be represented at different zoom levels. Its also a big programming task to get it done and working well within an Ajax environment. Over the coming months we really want to take the Google map experience to a new level not seen in other web sites. However, we intend to do this is a way that follows our general design philosophy in SWAF; abstract the map interface and implement support for Google map as just another implementation of the map abstraction such that another "map provider" could be brought in and used over Google maps.
Add Comment
We've been getting more and more web sites being built on Syrinx Community Server lately and an issue we've seen come up is getting content from their old site into the new site built with SCS. Some are forums that have had tens of thousands of posts. Rather than trying to write code to use some other products db directly, such as moving a forum from phpbb to SCS, we wrote a configurable utility feature that can browse to their current site and grab the content from the web pages and populate the new site's normalized database. With this we can read all of a client's blog posts directly from their blog site and create articles from them in their new SCS site. We can create contacts, articles, products, forum posts, blogs and photo albums from content contained in other sites. It will even download all the images found in content being converted and fix the image tags in the new site to use the images from the local site. After 3 iterations of development on the design and code for this feature, it has really come a long way in its flexibility in finding content in an existing web site and getting it in place within the new site. It can be configured with a user id and password to log into a site and keep track of the cookies as it goes to various pages on the site. The feature is designed to look for lists of objects on a page, and then follow links to get details about the object before it inserts the object into the SCS database. For example, it can find a list of blog entries on the page and follow the links to the full post for each blog entry and then create an article in the SCS database for each of those articles. If the blog entries had images, those would get downloaded and placed into the SCS media library. Each site that is going to be processed like this needs its own XML configuration that defines the site url, what user id/password to use, regular expressions to match against html to find the elements of data desired, and a few other options. You have to have a good grasp of how to use regular expressions if you want to write a configuration. When the code is grabbing pages from a site, it can either work with one page at a time with a single site session or the parallel processing option can be turned on to allow it to grab as many web pages from the site at the same time as it can. This can make a big difference in the time it takes to grab all the desired content. As an example, a news site with 97 different news stories and images in a small percentage of them took 27 seconds to completely grab all the content when run in parallel, but too a minute and 30 seconds when run sequentially. If you'd like to get the code for this, it comes with Syrinx Community Server. You can also read the developing documentation on the topic at: syrinx.ph/Developer.aspx#gArt1_311FE53F-8587-4637-B6BA-15BE177FF2A6
Add Comment
Pages:
|