SubSonic - All Your Databases Are Belong To Us

mojoPortal no longer supports SubSonic.

In the week prior to my vacation I had started working with SubSonic to see if it could be useful in mojoPortal since it has support for a number of databases, I figured it could reduce the work of supporting all these different dbs.

SubSonic is basically a toolkit for interogating databases for their schema and has the ability to generate db specific sql statements for common tasks. It also has a code generation feature so it can generate .NET classes based on database tables. It can be used as an OR mapper, that is, you could use the generated classes as your business objects, you could either inherit from them or use partial classes to bolt on custom functionality on top of what was generated by SubSonic. But for people like me who just never bought into the whole OR mapper thing, the generated classes can just be thought of as data objects that abstract the database table. It can return standard data in the form of IDataReader which is what the mojoPortal business objects like to consume and allows using SubSonic without having any particular dependency on SubSonic in my business classes.

It comes with providers for MS SQL, Oracle, MySql and SQLite and there were some other partially complete providers that I found in the wild. So my plan was, for proof of concept, to take a simple feature like the links module and try to re-implement it for all the dbs by using SubSonic. The short story is, yes I got it working for all 5 of the currently supported databases in mojoPortal. I re-implemented a new SQLite provider using Mono.Data.Sqlite which I already knew works both on Windows and on Linux/Mono. I found a postgresql provider here (thanks to Justin Greene and Maurício Machado) that was usable with a little bit of work. I also found a starter implementation for Firebird Sql (thanks to  Ricardo García) that I was able to complete and get working.

I've since gone on to implement the data layer for the WebStore feature for MySql, mostly using SubSonic. And the things that did use SubSonic are completely re-usable for the other data layers so the bulk of the work is already done for implementing the web store for postgre sql and Firebird.

SubSonic also comes with a thing called the scaffold page which is basically a web page that allows managing data in all of the tables in your database. Just drop it in and it works. I've modified the one in mojoPortal a little for various little issues I encountered and also to add security checks to control access to the page.

Since the code templates used by SubSonic are basically .aspx pages, I got the idea of making a browser based gui for code generation. I implemented that today and got the initial proof of concept done in about 4 hours of playing around. So at the moment its kind of like a poor man's Codesmith in the browser.

At any rate, I made a quick tutorial video about use of SubSonic in mojoPortal, sort of a developers introduction to it. Its pretty cool stuff so I hope you'll have a look.

 

Gravatar Joe Audette is the founder of the mojoPortal project and was the primary developer until February 2017.

New Image Gallery Landed in svn

Before I went on vacation I implemented a new image gallery based on this PhotoHandler project on Codeplex that was pointed out to me by Todd Lewis. We already had a photo gallery feature but its a fairly low frills thing, you have to upload images one at a time. My thinking has been that eventually I'll implement one that integrates with Flickr and some day I may yet do that.

The new one was pretty easy to intgrate into mojoPortal, it allows you to just point it at a folder containing images and it does the rest, creating thumbnails, web size images etc. So the idea with the new one is you organize the photos into folders on your local machine then upload the whole parent folder using an ftp client like FileZilla or whatever you use. The folder(s) need to be uploaded to Data/Sites/[SiteID]/foldergalleries folder, but from there you can nest them any way you want.

I did implement a feature for uploading files but the ftp approach is the sweet spot.

You can see my vacation photos using the new gallery here: http://www.joeaudette.com/photography.aspx

Notice how it makes a thumbnail for the sub folders by amalgamating the images contained in it into a thumbnail

So there are 3 top level folders, ChichenItza, resort, and skyline

Its available now in svn trunk for developers and will be in the next release which will probably be in the next few weeks.

Gravatar Joe Audette is the founder of the mojoPortal project and was the primary developer until February 2017.

More Exciting News about The MySQL Conference

Just got confirmation that I will be co-presenting with Joseph Hill at the MySQL Conference and Expo. The session is titled Cross Platform .NET Development with Mono and MySQL.

"This session provides an introduction to application development with Mono and MySQL, and will discuss the current state of Mono, including its support for databases through ADO.NET and LINQ. We will also take a look at several tools that can be leveraged to ease migration of applications to Mono and MySQL, and explore how one open source ASP.NET application provides support for Mono and MySQL."

MySQL Conference and Expo 2008

I'm very excited about this conference and the opportunity to talk about mojoPortal, Mono, and MySQL. I've known Joseph through correspondence and his involvement with the Mono community since 2003 so I'm looking forward to finally meeting him in person. He's recently joined Novell as the Product Manager for Mono which I think bodes very well for the Mono Project.

In addition to co-presenting this session I'll be manning the mojoPortal booth. I've still got a few available entrance passes for anyone interested in attending and willing to help man the booth. We have one session pass to share between the 4 entrance passes so we'll have to take turns covering the booth and going to sessions. Let me know if you're interested and are able to arrange your own travel to the event.

mojoPortal 2.2.4.6-b Released

I've just released mojoPortal 2.2.4.6-b, its available now on the download page.

Nothing changed in the core schema thats why the version only changed to -b. However there are some changes that make it worth the effort to upgrade.

The Poll Feature by Christian Fredh and the Survey Feature by Rob Henry have been revamped to make them a little more user friendly and more consistent with other features. These are 2 very cool features which up till now I haven't used much myself because this site is running on MySql and they were only implemented for MS SQL. Rob actually implemented most of the MySql layer for the Survey recently so I picked up where he left off and finished it then went on and implemented MySql for the Poll as well. You can try them out on this site, the Poll is here and the Survey is here. Go ahead and try them, I'd be interested in your answers to some of the questions I created.

Another new feature is the link browser in the FCKeditor is now implemented so you can browse and link to pages in the site or files in the file system more easily.

As always back up your site and db before upgrading. You'll want to be sure and get the new Web.config file, don't try to keep the old one, just restore any customizations from the old one to the new one.

Although the core schema didn't change you still need to visit the /Setup/Default.aspx page after uploading the new files so it can upgrade the Poll and Survey.

Other than these new features there are only a couple of minor bug fixes. The SQLite blog bug is fixed and it was the worst one reported since the previous release.

Also wanted to mention as noted in Miguel's blog, mojoPortal is also available in rpm format for a few flavors of Linux. The root folder is here, you can drill down through the different distros to find the correct package. This is all thanks to the magic of the OpenSuse Build service and Joseph Hill who initially set it up for mojoPortal. The rpms don't have the very latest release but they are easier to install. I plan to get involved in keeping them up to date after I learn how.

mojoPortal 2.2.4.6 Released

I'm happy to announce the release of mojoPortal 2.2.4.6.

Its been over 3 months since the last packaged release which is a bit longer than usual, my general motto is release early and release often but I had set a goal for this release to include the Newsletter which took a little longer than anticiapted. I was also side tracked on some other projects and of course we had several major holidays and family events to sidetrack me too. As a result this is a significant new release with a lot of new goodness.

Whats New?

Newsletter is a feature that a lot of users have been asking for. Now I hope you will all login to this site and opt in to our new mojoPortal News. I plan to send newsletters about once a month but I suppose it will depend on how much news we have each month. Thanks to those of you who signed up for the testing list and provided feedback!

Google Maps is one of the things I got sidetracked on as a need for it came up in a customer project. After meeting the customer needs I dressed it up a little more and made a new mojoPortal feature that makes it easy to put google maps in your site with various options for showing satelite, hybrid, and driving directions.

A feature to allow banning ip addresses is now included. I periodically review my logs and see evidence of malicious traffic and decided it was time to block some of those. A new feature has also been added to capture users ip addresses so that if a site has any troublesome users they can be banned.  Of course they may come back using a different ip address but every little bit of defense helps. Another benefit of capturing ip addresses is that there are ways of determining approximate logitude and latitude based on ip addresses and this presents a possibility to create cool features to plot community members on a map. So this will lead to some other cool features in the future.

We have a new Simplified Chinese translation as well as updates to the Russian, German, and Swedish translations contributed by the community. Thanks to all!

In the Blog, as soon as you create a post with a future date a new "Edit Drafts" link appears to make it easier to keep track of posts you are working on but aren;t ready to publish.

This release contains updated version of FCKeditor (v2.5.1) and ExtJs (2.0) toolkit.

The Site Settings, Page Settings, My Account (User Profile), Manage Users pages have all been updated to use Tab Panel layout provided by ExtJs. I'm also using the ExtJs grid in several places. I've been writing .NET wrapper controls to make it easy to use these things.

Rob Henry and I both did a bunch of work trying to fix FxCop violations to bring the code into FxCop rule compliance. Very few projects pass all the FxCop rules. Not passing them doesn't mean the code is bad but following the Framework guidelines developed by MS is a good practice. We used CodeIt Right to help identify and fix a lot of them but there is still a good ways to go. I spent 2 solid weeks on it. Some of the changes were breaking changes so those of you with custom features that haven't been working with the code from svn may need to revisit your code and compile against the new version. The breaking changes were just due to renaming some things and can be fixed easily by careful find and replace of .SiteID with .SiteId, .PageID with .PageId, and .ModuleID with .ModuleId. Does the code work any different or better due to these changes? No but it makes FxCop happier and I think adherance to the framework guidelines is one metric of code quality that is easy to measure. I would not overwieght this as the most important thing though.

I also noticed Rob recently implemented a MySQL data layer for his Survey feature. I haven't had time to test it yet but plan to soon.

I spent a chunk of time working on performance improvements using RedGate Antz Profiler and MS ACT load tester. ANTS is a great tool for finding slow places in the code. So I was finding such methods to optimize then load test to verify performance improvement by the optimization. I was able to make some significant gains in requests per second on my test machine using this process.

I'm including the e-commerce feature in the MS SQL release this time. It still needs a lot of work on the customer facing side but it can sell download products processing credit cards through Authorize.NET. I'll be doing more work on this in the near future and plan to implement Paypal and Google Checkout providers soon. For now consider it experimental but if you want to experiment with it feel free.

It is now possible to make skins with up to 5 content sections as illustrated in the 5contentpanes skin.

Things are working a bit better on Mono as of late. We still have to compile a special build without WebParts but the MS AJAX Update panel works so we're back to one code base again whereas at the time of the 2.2.3.9 mojoportal release we had to keep the 2.2.3.6 version for Mono due to lack of MS AJAX. The biggest problem we currently have is the lack of support for CSS Control Adapters, but the good news is my friend Dean Brettle has taken on the task of implementing the needed support in Mono. Dean is an awesome developer and the author of NeatUpload and NeatHtml both of which are used in mojoPortal. I think its just a matter of time now and all the mojoPortal skins will look as they should on Mono. I know a number of mojoPortal users who are eager for this so its very exciting.

As always, be sure and back up your site and database before upgrading. Report any problems in the forums and we will try to help.

If you like mojoPortal please help spread the word. We've got a lot of exciting plans for 2008 that I'll blog about soon.