Posts in Category: Features

mojoPortal and jQueryUI ThemeRoller

I was recently reading the documentation for The jQuery UI CSS Framework, and it got me thinking about making it possible to style mojoPortal content instances using it. Then a user asked in the forums about being able to skin mojoPortal using jQueryUI ThemeRoller, and that got me thinking further, what if I could create a mojoPortal skin where the whole site is a jQuery UI widget and could be styled by jQuery UI themes? That would be kind of cool, wouldn't it? 

It doesn't take much to make a feature instance style as a jQuery Widget, skeleton markup like this will do the trick since the jQuery UI CSS is already included in the page:

<div class="ui-helper-reset ui-widget ">
 <h2 class="ui-widget-header ui-corner-top">Heading goes here</h2>
 <div class="ui-widget-content ui-corner-bottom">
  <p>
   This is styled with jQuery UI!
  </p>
 </div>
</div>

So I just needed a way to make mojoPortal features render that kind of skeleton and it wasn't difficult to achieve given that I had already implemented a solution for rendering the special markup needed for Artisteer designs. I just added some more options to the rendering that can be configured from the theme.skin file in a mojoPortal skin. It took me maybe 10 minutes and I had it working for proof of concept. It was much easier than implementing support for Artisteer because we already had the needed markup structure, all we really needed was an option to render the CSS class names for jQueryUI. So I made a new skin and modified the layout.master to use the same widget skeleton for the site as a whole so that the jQuery UI theme pretty much controls the look of the site. There isn't yet any themeable menu for jQuery UI, so I used the jQuery Superfish menu that we were already using in a few other skins and used neutral colors and color inheritance to make it look reasonably well with all of the jQueryUI themes, though it looks better with some than others. It would be easy for users to copy this skin and change the menu colors to match better with a specific theme. The jQuery UI CSS framework doesn't have style for all purposes and features, though, so additional CSS is needed for some features, and again I tried to make it use neutral colors so it would not clash with any of the jQuery UI themes.

I'm a ThemeRoller baby, bound to roll all over you...

ThemeRoller makes me think of James Taylor singing with a lisp! :-D

Once I had the new skin basically working it begged for a theme switcher so I could see the magic instantly of changing the jQuery UI theme. There are about 25 or so standard jQuery UI themes that can be loaded from the Google CDN (Content Delivery Network) which is where we load jQuery and jQuery UI javascript and CSS from by default. You can also make your own custom jQuery UI themes with ThemeRoller, but if you do that then you need to host the jQuery and jQuery UI files locally as documented here.


You can control the list of available themes in the theme switcher from a config setting, that you can override in user.config, and you can set the default theme in the layout.master file of the skin like this:
<portal:StyleSheetCombiner id="StyleSheetCombiner" runat="server" JQueryUIThemeName="eggplant" UseIconsForAdminLinks="false" />

The theme switcher can be removed from the layout.master or disabled or limited by roles if you don't want a user to be able to change the theme. It is basically setting a cookie based on the dropdown choice, and then setting the jQuery UI theme based on the cookie.

Maybe it is too widgety looking for most sites, but it might be useful for some kinds of sites or web applications built on mojoPortal. You could easily add a div above and/or below the menu to make room for a banner ad or some other additional content.

Anyway, it was easy and fun to implement. It is in the source code repository now but requires a build of the latest source code to work. It will be included in the next release. You can try it now on demo.mojoportal.com by going to Administration > Site Settings and choose the jqueryui-1 skin. 

So basically the new skin jqueryui-1 is like many skins in one since there are many jQueryUI themes available and you can roll your own with ThemeRoller.

Here are a few screenshots showing a few of the jQueryUI themes.

mojoportal with jquery ui eggplant theme

mojoportal with jquery ui excite bike theme

mojoportal with jquery ui dark hive theme

mojoportal with jquery ui humanity theme

So, look for this in the next release or if you are a developer you can get the latest code from the repository. I think this gives us one more useful approach to skinning mojoPortal and hope you find it useful.

 

Follow us on twitter or become a fan on Facebook

follow us on twitter become a fan on facebook

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

mojoPortal SQL CE and WebMatrix

This is just a quick post in follow up to my previous post SQL Server Compact 4.0 and mojoPortal, to provide some updated information. We recently released mojoPortal 2.3.4.8, and I've updated the package for SQL CE recently to contain migration scripts so that it is easy to migrate to SQL Server.

I've also created some new documentation.

Using WebMatrix with mojoPortal

WebMatrix includes IIS Express web server which is much easier to use on your local machine than IIS but has all the features of IIS. Once you install WebMatrix, you can right click a folder in Windows Explorer and choose "Open as a Web Site with Microsoft WebMatrix". So you can just unzip the mojoPortal package and right click the wwwroot folder to launch a mojoPortal site on your local machine. If using SQL CE you don't need to even need to configure a database, it just works, but for other mojoPortal packages you would have to set the connection string for the database. 

One could also use WebMatrix for light mojoPortal feature development, perhaps at some point I will make an article showing how to use the mojoPortal Hello World examples with WebMatrix. While WebMatrix is not designed to scratch the same itch as Visual Studio, it is a useful tool even for folks like me who really live in Visual Studio all day long. I encourage you to check it out, especially if you are interested in working with the SQL CE version of mojoPortal.

 

Follow us on twitter or become a fan on Facebook

follow us on twitter become a fan on facebook

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

SQL CE Support for Form Wizard Pro and Event Calendar Pro

I'm happy to announce the availability of new packages of Form Wizard Pro and Event Calendar Pro, that include support for SQL CE. Existing customers can download the latest package from their order history under the My Account link after signing in to the site.

Event Calendar Pro

Form Wizard Pro

I've also updated the SQL CE package for mojoPortal on Codeplex to fix a couple of bugs reported recently, and I've created documentation about using SQL CE with mojoPortal. In the near future I will also create documentation to explain how to migrate a mojoPortal installation from SQL CE to SQL Server using WebMatrix.

 

Follow us on twitter or become a fan on Facebook

follow us on twitter become a fan on facebook

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

mojoPortal 2.3.4.8 Released

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

Data Layer Consolidation

The primary focus of this release is consolidating our support for SqlAzure into our main MS SQL data layer so that we don't need to maintain a separate data layer for SqlAzure. For new installations that use SqlAzure, you should just use the package for MS SQL. If you have an existing installation using SqlAzure, you should follow these steps:

  1. Upgrade using the mojoportal-2-3-4-8-sqlazure-net35-deploymentfiles.zip or mojoportal-2-3-4-8-sqlazure-net40-deploymentfiles.zip depending on whether you are using .NET 3.5 or 4.0
  2. Copy your connection string from the SqlAzureConnectionString to the MSSQLConnectionString
  3. Download mojoportal-2-3-4-8-mssql-net35-deploymentfiles.zip or mojoportal-2-3-4-8-mssql-net40-deploymentfiles.zip again depending on your .NET version.
  4. Extract the files and copy the mojoPortal.Data.dll, mojoPortal.Features.Data.dll, and WebStore.Data.dll from the MS SQL package and replace them in the /bin folder your installation
  5. Going forward we will no longer have separate packages for SqlAzure, so for future upgrades you will just use the MS SQL package

Important - We no longer support MS SQL 2000. Our MS SQL Data layer is compatible with SQL 2005/2008/SqlAzure

As I mentioned in my previous post, we also now have a package for SQL CE. I encourage you to give it a try. It would be really cool if someone out there could do some load testing of mojoPortal using SQL CE and then using MS SQL to get an idea of how well SQL CE can handle traffic. I would not expect it to do as well as MS SQL but I think it might hold up better than one might expect. My guess is it can handle more traffic than the Sqlite version of mojoPortal because Sqlite only supports 1 connection and SQL CE does have a connection pool and supports more connections.

In the near future I will be looking into using WebMatrix which is the tool that can be used to migrate from SQL CE to SQL Server. WebMatrix could also be used for light mojoPortal feature development for those who find Visual Studio to be a little scary. WebMatrix is also a pretty neat tool for trying applications from the Web App Gallery and it includes IIS Express.

New Date Picker

This release also includes a new jQuery DatePicker. You could still use the old one if you like it better by changing the default DataPickerProvider in mojoDatePicker.config in the root of the site.

jquery date time picker

I also added jQuery UI styling to the buttons in most of the included skins (except Artisteer skins since they already have button style). You can enable it in a custom skin from the theme.skin file by adding this:

<portal:mojoButton runat="server" UsejQueryButton="true" />

A Few Bug Fixes

  • fixed a bug where using Live Writer an error would happen when trying to open existing posts
  • fixed a bug in the blog where the rating was not shown even on the detail page if using excerpts
  • fixed a bug in the blog where the default comment allowed days was being ignored
  • fixed a bug in Feed Manager where the aggregate feed link did not work in child sites
  • fixed a few bugs in the Sqlite data layer where the paging logic was not correct

Updated Italian resources from Diego Mora

Updated Dutch translation from Bouke Bisschop

As always, it is a good idea to backup your site and database before upgrading.

 

Follow us on twitter or become a fan on Facebook

follow us on twitter become a fan on facebook

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

SQL Server Compact 4.0 and mojoPortal

On June 30, 2010, Scott Guthrie blogged New Embedded Database Support with ASP.NET, announcing that SQL CE 4 (SQL Server Compact Edition) would soon be available. It was officially released as a public CTP (Community Technology Preview) on July 7, 2010 with an announcement on the SQL Server Compact Team blog in a post by Ambrish Mishra entitled Introducing SQL Server Compact 4.0, the Next Gen Embedded Database from Microsoft.

This little database is big news for mojoPortal

Today I am happy to announce a preview release of mojoPortal 2.3.4.7 for SQL CE 4 and ASP.NET 4.0. This package has a pre-configured database and can be deployed under Medium Trust with .NET 4 hosting.(*) This means it is easy to deploy and use even on budget shared hosting where Medium Trust security policy is almost always used. You can download the package mojoportal-2-3-4-7-preview-sqlce-net40-deploymentfiles.zip from the bottom of this page on Codeplex. It is an MsDeploy package, so it can be installed by importing it in IIS, or you can just unzip it and install manually.

When installing web applications like mojoPortal, often one of the more challenging installation issues is setting up the database, for non-techies this is the part that people really struggle with, and even people who consider themselves fairly tech savvy can find themselves struggling to get it working unless they have a background in working with databases and understand all the nuances of connection strings and permissions. Using SQL CE 4 eliminates this challenge completely because the database is just a file on disk. There is no database software to install on the server, so it does not depend on the host having it installed, it only requires .NET 4 hosting. Since we ship a database file already populated with initial data, it is basically zero configuration for the database, you don't have to do anything, it just works.

I'm sure some of you are aware that mojoPortal has supported Sqlite for a long time, and it is also a zero configuration, file based database that many people like a lot. However, it has never worked under Medium Trust and if your site traffic starts to grow there is not an easy way to migrate the data to a more robust database.

  SQL CE Sqlite
Zero config deployment yes yes
Backing up the files backs up the database yes yes
Works in Medium Trust yes no
A supported migration path to a more robust database yes to SQL Express/Server/SqlAzure no convenient migration solutions that I know of

 

Now, I'm not yet sure yet how easy the migration of mojoPortal from SQL CE to SQL Server will be. Scott Gu mentioned that they will be shipping migration tools that will make it straight forward to migrate the tables and data from SQL CE to SQL Express, SQL Server or SQL Azure. However, since SQL CE does not support stored procedures and we do use them in the SQL Server data layer for mojoPortal, it means we will also need to make migration scripts available to install the latest stored procedures into the database after migration. So, in theory, the migration process will be to first use the tool that Microsoft will ship to migrate the tables and data, then run the scripts we will make available that contain the stored procedures for a given version of mojoPortal, then you would just deploy the mojoPortal version for SQL Server over your existing mojoPortal for SQL CE installation and set your connection string for the new database. Once the migration tools ship I will verify the process and create documentation with the migration steps.

In summary, I think that the SQL CE package for mojoPortal will make it easy for you to stand up impressive new web sites quickly and easily in budget hosting with the possibility to upscale to a more robust database platform later without too much difficulty. I would say that if you are putting up a site that you are expecting to grow traffic quickly, then you should probably just start out using SQL Express, SQL Server, or SQL Azure. But, how many sites that you put online for your customers really get a lot of traffic? If the answer is not many, then you may find SQL CE is the best choice for many of your projects, reducing costs and time to deployment.

Screen shot of mojoportal system information showing SQL CE

 

Top Secret Early Access! :-D

 
Now you may wonder how I managed to have a version of mojoPortal for SQL CE ready so soon after SQL CE 4 was released. The answer is that I had early access to SQL CE 4.0 and access to a bunch of good folks on the IIS and SQL Server teams to help me with guidance and questions and was also able to give them feedback while they were working on this release.
 
Back in early March I was contacted by Jonathan Hawkins of Microsoft and was invited to an online meeting where they told me what they were planning for SQL CE and why it might be beneficial for mojoPortal to support it, I of course was very excited about it.  At the time the alpha bits of SQL CE 4 were not quite ready but I was provided with good help and work arounds that would enable me to work on support for SQL CE using the 3.5 version so I could get started without waiting. So I went ahead at that time and implemented it for the core mojoPortal features (it took me about a week) and managed to get it working as proof of concept. Once that was done I moved on to work on other things not knowing how long it would be until the alpha bits of SQL CE 4.0 would be ready. Finally on June 2nd I got an email that the alpha bits were available, but I was knee deep in other projects right at the time, so it was around June 27-28 when I finally tried the new bits and verified it worked under Medium Trust. Then when Scott Gu blogged about it on June 30, I realized it was going to be public very soon so I scrambled to complete the SQL CE data layer for the rest of the mojoPortal features (except for WebStore and my Add On Products). It took about 1 week to finish that work and by Friday July 9 I was ready to produce a package but decided to wait until Monday to blog about it.
 
So here we are, it is Monday, and I've uploaded the package on Codeplex, at the bottom of our current release. I've done sanity testing of all the features but not exhaustive testing of every configuration of every feature, so it is possible and perhaps likely there are still a few bugs here and there in the data layer, after all this is our newest data layer and therefore the least tested of all our data layers at this point. That is why I'm calling it a "Preview" release, and I hope you will give it a try and report any problems you may encounter. I will fix them quickly.
 
I'd like to thank all the folks at Microsoft for giving me this opportunity to work closely with them and get early access to the technology, and I especially thank Jonathan Hawkins, Parasuraman Narasimhan, Radhakrishnan Srikanth, Mohammad Imran Siddique, Himadri Sarkar, and Ambrish Mishra for all their help. It has really been a great experience for me getting to work with these guys and do something with mojoPortal that fit well with cutting edge work these guys have done on SQL CE. I really think they have solved one of the long standing problems in ASP.NET web deployment. For low traffic sites or quick prototyping or proof of concept deployment, or just low budget web sites, this is really going to reduce friction and make it easy to put a site up in minutes. 
 

Technical Notes

 
It turned out well that I waited for SQL CE 4 before implementing all the mojoPortal features. When I implemented the core features I only had SQL CE 3.5 to work with so in places where I needed to select a page of data, I was having to use some awkward SQL syntax to make it work, it did work but it was difficult to read and write. One of the coolest new things in SQL CE 4.0 is the new syntax for selecting a page of data like this:
 
SELECT * FROM mp_GeoCountry ORDER BY Name OFFSET 10 ROWS FETCH NEXT 10 ROWS ONLY;
 
It would be great if someday SQL Server supports an easier paging syntax, as it is still awkward to get a page of data efficiently in SQL Server, though it is a little easier than SQL CE 3.5 since SQL Server at least gives us stored procedures which provides a few additional strategies for getting a page of data. Anyway, you can guess I like this new syntax, it is much more convenient. Probably since I've worked with so many open source database platforms in mojoPortal, and have learned the major syntax differences between them, and really most of them have had easier ways to get a page of data than SQL Server for a long time, I'm glad to see something that makes a bit more sense. In a nutshell, MySql, PostgreSql, and Sqlite all support the LIMIT x OFFSET y syntax, Firebird has an interesting twist with SELECT FIRST x SKIP y, and SQL Server has always had the SELECT TOP (x) syntax but no equivalent to OFFSET, and this makes us have to jump through syntax hoops to get any efficient way to grab a page of data. So at the moment, in my view, SQL CE 4 has at least one cool syntax thing better than its big brother SQL Server even if it is not as capable in handling large traffic.
 

The mojoPortal Query Tool can talk to SQL CE

The above screen shot shows that the built in mojoPortal query tool can be used with SQL CE.

No need to install it in the GAC

One of the interesting things to me is that it seems like SQL CE 4 must be all managed code, that is, I think it must be implemented purely in .NET. The reasons I think this is because it seems that the database engine must be completely contained in System.Data.SqlServerCe.dll, and this dll just needs to be in the /bin folder, it doesn't even need to be installed in the GAC (Global Assembly Cache). The main reason why Sqlite doesn't work under Medium Trust is because it does some P/Invoke against a native dll written in C. To be allowed to do that the managed dll for Sqlite would have to be installed in the GAC. Since SQL CE can work without being installed in the GAC, I can guess it does not do any P/Invoke and is all managed code. Someone asked about this in the comments of Scott Gu's post, and while he did not specifically answer it, he did mention in comments that they are looking at enabling use of SQL CE in Silverlight which I think lends more evidence to it being fully managed code. I could be wrong though, possibly there are changes in code access security in .NET 4 that makes it possible to use without installing in the GAC.

The idea of being able to use SQL CE as a client side database in Silverlight is pretty compelling to me, so I'll be keeping my eyes open for future announcements. I had once done a proof of concept where I managed to use Sqlite as a client side database in Silverlight via Google Gears, but it had a few issues because database calls had to be marshalled back and forth from javascript to Silverlight via the Html Bridge. It would be much nicer to be able to use SQL CE directly from Silverlight. That would enable some really interesting client side scenarios.

(*) Actually I think SQL CE 4 could probably be used under 3.5 .NET but not under Medium Trust, it requires .NET 4 to work under Medium Trust, and the mojoPortal package for SQL CE is only going to be available for .NET 4.

Consolidation of Data Layers

At the moment we have a separate data layer for SqlAzure, SQL Server, and SQL CE. Back in March when I first began work on SQL CE support in mojoPortal, I blogged Anyone Still Using SQL 2000?, to guage how many people still use it. Going forward we are dropping support for SQL 2000 and then the MS SQL data layer will be modified to make it compatible with SqlAzure, and then we will eliminate the separate data layer for SqlAzure. I "think" the previous release of mojoPortal 2.3.4.5 was still compatible with SQL 2000, but the latest code in the repository is not compatible because we have changed from ntext to nvarchar(max) which is not supported in SQL 2000. So the next release of mojoPortal for sure will not be compatible with SQL 2000. Going forward we will support SQL 2005/2008/SqlAzure and SQL CE.

Follow us on twitter or become a fan on Facebook

follow us on twitter become a fan on facebook

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