Posts in Category: Development

Support For Css Control Adapters Has Landed in Mono svn

Those of you who have been using mojoPortal on Mono will be excited to hear of an important milestone reached in the Mono project. Recently in Mono's svn repository (r100264 or newer) has landed support for ASP.NET CSS Control Adapters.

Thanks to the great work of Dean Brettle for implementing this in Mono! Dean has been involved with mojoPortal from the beginning and is also the author of 2 great projects, NeatUpload and NeatHtml, both of which are used in mojoPortal.

The need for Css Control Adapters arises from the fact that the original ASP.NET implementation of some important .NET controls like Menu and Treeview was less than ideal when first released by Microsoft. The problem was that these controls rendered as nested html tables instead of the more semantically correct nesting of ul and li elements. To solve this problem, Microsoft subesquently released the CSS Control Adapters. Since the Mono implementation of Menu and Treeview mirrored the original Microsoft implementation it also rendered as nested tables. Some plumbing was needed in Mono to support the control adapters and Dean stepped up and took on the task.

Because the mojoPortal css was designed to style nested ul and li elements and not html tables, up until now the menu in mojoPortal did not render or style correctly when running on Mono as shown in this screen shot of mojoPortal running on the current Mono 1.9 release:

menu style without css adapters

and now with the latest Mono built from svn:

menu with css control adapters

So I think the next release of Mono will be very exciting for anyone using mojoPortal on Mono.

Again, huge thanks to Dean Brettle, Marek Habersack, and anyone else who may have had a hand in getting this done!

Update 2008-04-10 1:46PM EST - Dean mentioned that: "Owen Brady (aka Ocean) deserves a lot of the credit.  I used his code to parse and process the *.browser files."

 

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

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 Google Map Feature Landing in svn Tonight

I am about finished implementing a quick google maps feature. I went ahead and updated this site with the code so I could show it off. You can see it in action here: http://www.mojoportal.com/googlemaps.aspx

It allows you to specify a location, map size, optional to show the map type control (Satellite,hybrid,map), option to show the zoom control, option to open a balloon with info about the location, option to show a local area google search, and a few other options.

I haven't finished implementing the get driving directions, will finish that tomorrow but its exciting enough I couldn't wait to blog about it. Its in my svn sandbox now and will be in svn trunk by later tonight.

It was really very easy, but visual stuff is always exciting and fun to work on.

Those working from the source code using svn trunk, it will be available in the next few hours. After you do svn update, rebuild the solution then visit yoursiteroot/Setup/Default.aspx to install it. Then it will show up like other features that you can put on any page.

Update: 2007-12-09

I got the driving directions working as you can see by clicking the link above. One thing to be aware of is that driving directions won't work on a local network or on localhost using the free google maps API key. As I understand it, if you buy an enterprise license it can work on local networks but the free one only works on public sites. The map seems to work just fine on localhost, its only the driving directions feature that doesn't work on localhost.

Visual Studio 2008 How Long Should We Wait?

Since Microsoft has released Visual Studio 2008 and the .NET framework 3.5, I like most passionate geek developers could not wait to try it out. I was under the impression that projects and solutions from VS 2005 would be compatible so I figured great I can benefit from the new javascript debugging features and over time tiptoe into using Silverlight and some other new things in the 3.5 framework.

However, when I tried to open the mojoPortal solution in VS 2008 the first thing that happens is the project conversion wizard starts, so apparently the projects and solutions are not backward compatible. I of course immediately cancelled the operation because it said the projects and solution would no longer work with VS 2005 so if I do this that means that no-one can work with the solution unless they have VS 2008.

So we face a hurdle for the project that I'm sure other open source .NET projects will also face. Obviously at some point we must move forward but the question is how long should we wait?

I invite your feedback if you are actively using mojoPortal in your development, how soon will you be getting VS 2008? How long do you think we should wait before making the change and leaving behind VS 2005?

UPDATE: I stand happily corrected!

Thanks to the readers who pointed out that only the solution files changed. This is great news! I'm in the process now of making bakup solution files for VS 2005 and upgrading the solutions for VS 2008. Should have this in svn trunk in the next few hours.

Note for those who don't have VS 2008 you will need to use the alternte solution files which have been renamed like mojoportal-complete-vs2005.sln
mojoportal-core-vs2005.sln
... etc

This means that those of us with VS 2008 can move forward without leaving behind the VS 2005 developers. Though at some point we will need to make the decision to target the 3.5 framework instead of the 2.0 framework I think we can potentially add projects to the solution that do target 3.5, we just can't change the target on projects that are shared in he VS 2005 solution files.

Happy Day! Go get your free 90 day trial of VS 2008 or if you are an msdn subscriber you can get it there.

Heads Up to svn users who may have custom projects that use the DatePicker control

Just a quick heads up to users of mojoPortal who may have custom features that use the mojoPortal.Controls.DatePicker

In order to make it possible to use different date pickers in mojoPortal I have now implemented a provider model and now the control is just a wrapper around a provider specific control.

I had to rename the control becuase of a namespace clash when I built the provider model under the namespace mojoPortal.Controls.DatePicker I got an error because you can't have a class named DatePicker and namespace named DatePicker.

Renaming the control is a breaking change but is easy to fix. The new control class name is DatePickerControl instead of DatePicker so anywhere you have used DatePicker you will need to change it to DatePickerControl.

For example <mp:DatePicker... becomes <mp:DatePickerControl...

I have fixed these in all the projects included in mojoportal-complete.sln and will be committing this change to trunk tonight.

Those of you who have custom projects using this control will need to change your code after you get this update. If you have any trouble post in the Developer Forum and I'll try to help.

We've used a .NET control that wraps the jsCalendar javscript date picker for a long time but there are other nice ones available now. Specifically I plan to implement one using the ExtJs toolkit but needed to get this provider model in place first.