Navigatie

Contact

Send mail to the author(s) E-mail

View Richard Soeteman's profile on LinkedIn

RSS 2.0 | Atom 1.0 | CDF

Archief

Categorieën

Blogroll

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

Sign In

Zoeken

# Tuesday, 06 September 2011
Tuesday, 06 September 2011 15:26:33 (GMT Daylight Time, UTC+01:00) ( mediaprotect | Package | Umbraco )

This Blog is not active anymore, further posts will be available on my company website. Read new posts here

Lots of people want to run MediaProtect on a Mysql database. Currently that is not supported but this is only because of a failing installer script for the MySql database. Benjamin Howarth wrote a MySql script for generating the log table in the MySql database. Once this table exists all functionality will work just fine on a MySql database. The next version of MediaProtect will support this out of the box, for now the installation procedure will be installing MediaProtect first and then run the following script to create the tables.

CREATE TABLE mediaprotectlog ( 
LogId BIGINT(20) NOT NULL AUTO_INCREMENT, 
MediaId INT(11) NOT NULL, 
Path VARCHAR(500) NOT NULL COLLATE 'utf8_general_ci', 
Protected BIT(1) NOT NULL, 
UserName VARCHAR(150) NOT NULL COLLATE 'utf8_general_ci', 
UserIP VARCHAR(50) NOT NULL COLLATE 'utf8_general_ci', 
LogDateTime DATETIME NOT NULL, PRIMARY KEY (LogId) )

Happy Installing!

Comments [0] | | # 
# Friday, 24 June 2011
Friday, 24 June 2011 11:08:03 (GMT Daylight Time, UTC+01:00) ( )

This Blog is not active anymore, further posts will be available on my company website. Read new posts here

Today I’ve officially released CMSImport 2.0, for those of you who don’t know what CMSImport is. In short CMSImport helps you import content or members from any datasource into Umbraco on a very friendly way. Just point to a datasource and add a mapping between fields in your datasource and the Umbraco  Content or Member properties. Currently CMSImport supports the following data sources by default (you can always create your own if you like):

  • Access Database
  • BlogML
  • CSV
  • Excel File
  • RSS Feed
  • SQL Server
  • WordPress Export file
  • XML

Access database and the Excel file Data source requires you to install the Microsoft Data Connectivity Components 

What’s new

This release is all about structured import of content. For example If you want to import a Product Catalog, you want to import Product Categories and Products. CmsImport 2.0 will help you with that by defining a Parent and child definition. Simply save the parent import definition and select “Create Child definition” from the context menu as displayed in the image below.  And you need to specify a Foreign key, that’s all!  This is very flexible, you can even mix data sources if you want to

childdefinition

Because CmsImport can import whole product catalogs it’s fully optimized to import ProductCatalogs for the Teacommerce and Uwebshop Ecommerce solutions. When you import BlogML or Wordpress data and you have Blog4Umbraco or the Blog starter kit installed You’ll see the Optimize for Blog4Umbraco/ Blog starter kit option. When you select this option, comments from BlogML or Wordpress will be imported automatically. Of course you can also skip this and Import Blogs and Comments separately.

blogml

Another major improvement is the Advanced Mapping feature. For each field you can add Advanced mapping options. CmsImport will determine the type of property and will give you some advanced options based on that type. For every property it’s possible to specify a default value, for some types it’s possible to specify more options. If you want to import Media it’s possible to put the media in the root of your Umbraco install and use the Advanced mapping options for a Media picker, or Rich Text editor to specify where to store the media in the Media Library. For a Media picker it’s even possible to select a default value from the Media Library instead of using a textbox.

advancerichtextmapping

I’ve also fixed the scheduled task functionality. In the previous version it ran 95% of the time. The other 5% it didn’t run because the Umbraco scheduler wasn’t active at the time it needed to execute the task, then one minute later the scheduler is running again but the scheduled task expired. This is solved now, the handler responsible for executing a scheduled tasks will also check for scheduled tasks that didn’t run at the requested date/time. if it finds an expired task it will run the task. To give you more insight when a scheduled task did execute I’ve introduced the scheduled task dialog. This reports when the task was scheduled and when it actually did execute. This dialog is  also reporting the next execute time.

scheduledtasklog

Umbraco Deli

Umbraco recently released the Deli. The Umbraco Deli allows you to download or buy products from a single source. CmsImport can be downloaded and bought through the Deli. CmsImport Pro comes in three editions:

  • Single domain license
  • Server license
  • Unlimited license

For customers that already bought a CmsImport Pro license from my site. First of all sorry for the manual order process Winking smile Very soon you will receive an email with a new license file that you can use for CmsImport Pro 2.0.

Free edition

Of course the free edition still exists and it had some small improvements. It’s now possible to use Advanced settings when you create a mapping so you can add default values for each field. Checkout the feature comparison sheet for all differences.

Demo

Enough text, time for some video Smile

If you want to discuss if CMSImport can handle your requirements, I can always demo or discuss features via Skype.Contact me via email (richard[at]soetemansoftware[dot]nl) if you want a remote demo. Or if you just want to use it download CMSImport from the Umbraco Deli.

Comments [2] | | # 
# Friday, 29 April 2011
Friday, 29 April 2011 13:06:57 (GMT Daylight Time, UTC+01:00) ( CMSImport | Umbraco )

This Blog is not active anymore, further posts will be available on my company website. Read new posts here

A question I get asked a lot is if it is possible to assign a template based on a datasource value. The answer is yes, normally the default assigned template will be assigned when importing your data and this is what 99% of the users want and expect. But using the RecordImported Event we can get the datasource value from the database and use that alias to map the template against the imported document.

Example

In this example we have some data coming from a database that we want to a standard Runway text page. Some items such as Integer and Donec are really important and we want to display these items in Pink. In Umbraco we added a new template called PinkTemplate and as you can see in the image below we added that Template alias in our Datasource that we are going to import.

Example data

As I mentioned earlier we can use the event system to manipulate the document during import . You can use the event system for CMSImport in the same way you use the normal Umbraco event system. In the example below you see that we derive from ApplicationBase and wire up the RecordImported event in the constructor. Since we only want to set the template during the initial import, we first check if the Importaction is  ImportAsNew. Then we need to check if the template column from the datasource is not null. You can access all  items from the datasource  using the e.Items collection. When the template column is not null, we get the template id from the database and assign that value to the document.

   1:  using CMSImport.Extensions.Import;
   2:  using umbraco.BusinessLogic;
   3:  using umbraco.cms.businesslogic.template;
   4:  using umbraco.cms.businesslogic.web;
   5:   
   6:  namespace AssignTemplate
   7:  {
   8:      /// <summary>
   9:      /// This class wil automatically assign a template to the document when being imported for the first time using the RecordImporting Event
  10:      /// If you want to use this class in your own project simply rename e.Items["Template"] to the template column you use
  11:      /// in your datasource
  12:      /// 
  13:      /// This code will work in both the Free and PRO edition of CMSImport and is written for version 1.2. 
  14:      /// If you have any questions please use the forum or email support@soetemansoftware.nl 
  15:      /// </summary>
  16:      public class AssignTemplateUsingDatasource : ApplicationBase
  17:      {
  18:          /// <summary>
  19:          /// Initializes a new instance of the <see cref="AssignTemplateUsingDatasource"/> class.
  20:          /// </summary>
  21:          public AssignTemplateUsingDatasource()
  22:          {
  23:              //Whenever a records gets imported 
  24:              ContentImport.RecordImported += new ContentImport.RecordImportedEventHandler(ContentImport_RecordImported);
  25:          }
  26:   
  27:          /// <summary>
  28:          /// When a record got imported this event is raised.
  29:          /// </summary>
  30:          /// <param name="sender">The imported document.</param>
  31:          /// <param name="e">The <see cref="CMSImport.Extensions.Import.RecordImportedEventArgs"/> instance containing the event data.</param>
  32:          private void ContentImport_RecordImported(object sender, RecordImportedEventArgs e)
  33:          {
  34:              //Only assign the value when its imported for the first time
  35:              if (e.ImportAction == ImportActions.ImportAsNew)
  36:              {
  37:                  Document doc = sender as Document;
  38:                  
  39:                  //Get the template value from the datasource. Datasource values are stored in the Items event arguments
  40:                  //Replace templateName with your column name in the datasource!!!
  41:                  string templateAlias = e.Items["templateName"].ToString();
  42:   
  43:                  if (doc != null && !string.IsNullOrEmpty(templateAlias))
  44:                  {
  45:                      //An alias is specified, try to get the template based on the specified alias  
  46:                      Template template = Template.GetByAlias(templateAlias);
  47:                      if (template.Id != null)
  48:                      {
  49:                          //Template is found assign it to the document
  50:                          doc.Template = template.Id;
  51:                      }
  52:                  }
  53:              }
  54:          }
  55:      }
  56:  }

When the import is finished you see that all items are imported and when you we take a look at the Integer document you’ll see that the assigned template is PinkTemplate instead of the default Runway Textpage template.

Pink template assigned

Why isn’t this supported in the UI?

As I mentioned before most people expect to assign the default value. When I include the assign template via datasource functionality in the UI it’s an option that you need to think about before setting or ignoring the option. My idea with CMSImport is that I want it to be a no brainer to use and introducing this option will make it a little bit harder to use. So if you want this I think it’s better to write 10 lines of code instead.

Downloads

Below you can download the complete source code. Change e.Items[“templateName”] to the column name you want to use in your project, build the project and add the DLL to the bin folder of your Umbraco install. That’s all!

Download the source code here

Comments [0] | | # 
# Wednesday, 27 April 2011
Wednesday, 27 April 2011 15:54:21 (GMT Daylight Time, UTC+01:00) ( mediaprotect | Package | security | Umbraco )

This Blog is not active anymore, further posts will be available on my company website. Read new posts here

Last month  I’ve released Media protect 1.0. Mediaprotect is an Umbraco  package that helps you protect media in the same simple way as you protect documents in Umbraco. Once the package is installed and you protect certain media, or content nodes, the files will be password protected. Only authenticated members can open the files, otherwise members will be redirected to the login screen.

The problem protecting media

No solution without a problem Winking smile. When you use Umbraco, by default all media items can be accessed directly. If you have a media item that you don’t want to be accessed and someone knows the url (maybe got a link via email from a friend), or you have a link in your content  to a media item that is crawled by Google and the user uses that url the media item will be shown/downloaded, if you like it or not.

This is also the case with upload fields on a protected content node. The page is protected but the uploaded file is not protected.

How Media protect solves this problem

Once you’ve installed media protect files on protected content nodes are protected by default and you’ll get the public access menu item on the context menu of your media section.

Best of all you don’t need to modify any existing media or document type, it just works!

The public access menu item  is the same menu item you get when you want to protect a node in the content section.

Public access

When you select Public access you’ll get the same dialog as you get when protecting content. You can specify if you want to use single user or role based protection. You can also specify the login and not authorized page.

Dialog

When you are finished protecting the media item, the media item gets a No Access sign. This indicates that the media is protected and can’t be accessed directly. When you open the media item and click on the document link you will be redirected to the login page since you are not logged in. Once you are logged in as a member and the member role is assigned as allowed roles to view the media item you can download the file.

protectedmedia

Compatible with Media Pickers and default asp.net Membership provider

It’s nice that we can easily protect media items but we also want to make sure that the editor doesn’t accidently pick protected files using a Media Picker, or in the Rich Text Editor. Media Protect will also display the same No Access sign when you want to pick a media item using a media picker or via the Rich text editor. Not only the default Umbraco pickers but media protect is also compatible with some 3th party pickers, such as Multi Node Tree Picker (The awesome picker from UComponents) and the DIgibiz Advanced Media Picker. Best of all if you have a custom media picker you can add the alias of that media picker to the mediaprotect.config file and it will be picked up automatically.

DIgibiz Advanced Media Picker

Speaking about compatibility. Mediaprotect is based on the default ASP.Net Membership provider, so you can use the default asp.net controls for logging in etc. and you can also use your own  custom membership provider.  Media Protect comes with a small API you can use in a .Net usercontrol/XSLT or Razor script to determine if an item is protected, or to determine if the current logged in user has rights to access the media node.

Free alternatives

Media protect is a commercial package, it protects your media out of the box(no need to change any document or media type , it just works).It will cost you 99 euro per domain though. If you want to protect media without spending money you might want to check out these free alternatives

More info and Download

If you want more info about Media protect I suggest you check out the product site. Here you find a video demonstrating the package and documentation. You can also download a fully functional free trial from our.umbraco.org. This will work on your local machine (localhost), only thing you get for free is a nice yellow sign that says you are running in Trial mode. The trial never expires and when you want to deploy your site you can buy a license for that domain or buy an enterprise license for your whole company.

Feedback

Please tell me what you think about this package. Like it, hate it? I would love to know.
Comments [2] | | # 
# Tuesday, 11 January 2011
Tuesday, 11 January 2011 13:31:15 (GMT Standard Time, UTC+00:00) ( CMSImport | Umbraco )

This Blog is not active anymore, further posts will be available on my company website. Read new posts here

Last week I’ve released CMSImport 1.2 (Pro). This was a minor release mainly to fix a few bugs

Change log:

  • Fixed string delimiter for csv files
  • Field adaptors on default properties didn’t get hit
  • Throw error when login is null for member import, otherwise you can’t create new members and Umbraco will throw errors on you.
  • Introduced a new FieldAdapter that can map user logins against a Member picker data type. CMSImport will auto convert this to the corresponding member id.
  • Tested against Umbraco 4.6 (beta)

Again this was a very small release. Mainly to fix some errors.

CMSImport 2.0

The most requested feature is structured import. I’m very happy to announce  that this will be included in CMSImport Pro 2.0. The video below demonstrates how this will work. I've tried to keep this as simple and flexible as possible and hope I have succeeded, if not I hope to hear from you.

CMSImport 2.0 Structured import demo from Richard Soeteman on Vimeo.

Other new functionality for 2.0

Of course structured import will not be the only new feature. Below you find a list of all other functionality that will be included

Support for more Data sources

CMSImport 2.0 will support new data sources to import from such as:

  • Rss
  • BlogMl
  • Wordpress export
  • Excel
  • MS Acces

If you have a specific product, or data format you want to import from please let me know through the comment form.

Configurable field adapters

In version 1.1 I’ve introduced field adapters. These field adapters are great to convert data from a data source to the format that is accepted by the Umbraco data type, but sometimes you need to specify some additional information. For example when you import data and want to map url’s against the Ucomponents Url picker you want to specify if the link needs to be opened in a new window or not. Currently that is only possible with a config file, not very friendly. In 2.0 it will be possible to specify some additional options like you have to do now when you import related media.

Support for third party packages

CMSImport 2.0 will come with support for third party packages such as UComponents, SuperSimpleWebshop,Teacommerce and Blog4Umbraco.

I’m sure there will be extra functionality added along the way.For now I hope you like what you’ve seen in the video and read in this post.
Comments [2] | | # 
# Wednesday, 24 November 2010
Wednesday, 24 November 2010 10:37:54 (GMT Standard Time, UTC+00:00) ( CMSImport | Umbraco )

This Blog is not active anymore, further posts will be available on my company website. Read new posts here

Ok official it was  released in the beginning of October, but the manual wasn’t finished and I couldn’t upgrade existing clients to 1.1. From a customer satisfaction point of it was very important for me to have these things ready before blogging about all the cool new features. So what’s new?

Media Import

The main feature that is added to CMSImport PRO is the ability to import media related to content or member data. This isn’t a separate import process but integrated in content or media import. When CMSImport finds a reference to a relative path it will try to get the item and convert it to a media item, or store it in the media folder in case of an upload field. The only required thing is that the original media folder is copied to the root of your Umbraco folder.

In the example below the img folder of the original site containing two images is stored in the Umbraco root.

filesystem

In the Import wizard you can specify that you want to import media items also. Check the option “Import content related media”. If you want to map media against media pickers and/or the TinyMCE editor, you need to specify a media folder also. CMSImport will keep the imported folder structure.

mediaimportoptions

Then in the next step you can create the mapping like you would normally do.

mediamapping

  1. When a reference to an image is found in the content, CMSImport will create a media Item and update the image source to the new Media item(Currently only images are supported in Rich Text. Version 1.2 will have support for files also. Media Pickers and Upload fields will work with files also.)
  2. When an image (could also be a file) reference is mapped against an upload field. CMSImport will store the image in the Umbraco Media folder and update the reference in the Upload field
  3. When an image (could also be a file) reference is mapped against a media picker. CMSImport will create a media item and store the Id of the media item .

When the import process is finished you’ll see that the media items are imported

mediaimported

And when you open an imported item in the content section you’ll see that all the references are updated to the imported media items

contentupdated\

Again you don’t need to do anything extra apart from downloading the original media folder to you Umbraco Install.

Currently this import process will work for the following datatypes:

  • Upload Field
  • Media Picker
  • TinyMCE (Rich text editor)

In future releases CMSImport will support custom datatypes and File import for the TinyMCE datatype also.

FieldAdapters

FieldAdapters are used to convert original values from the datasource to a value the DataType expects. In previous versions when you wanted to import boolean data from a CSV file and map that against a true/false dataType, it would have failed because the True/False datatype could only handle the integer values 1/0 or a real boolean.

FieldAdapters fix those issues. During import of a field CMSImport will check based on the underlying datatype if a value can/must  be converted.

The following snippet contains the implementation of the BooleanFieldAdapter( just to show how little coding is needed for a better import experience).  It will add a relation to the True/False dataType based on the DataTypeID property . This must be the same GUID as the True/False datatype. Then in the Parse method  it will inspect if the value is either 0 or 1, if not it will convert the value to a real boolean.

  1: public class BooleanFieldAdapter : IFieldAdapter
  2: {
  3:     /// <summary>
  4:     /// Contains the GUID of the true/false datatype we want to parse using this FieldAdapter
  5:     /// </summary>
  6:     /// <value></value>
  7:     public Guid DataTypeId
  8:     {
  9:         get { return new Guid("38b352c1-e9f8-4fd8-9324-9a2eab06d97a"); }
 10:     }
 11: 
 12:     /// <summary>
 13:     /// Parse the data
 14:     /// </summary>
 15:     /// <param name="value">The value to parse</param>
 16:     /// <param name="fieldAdapterService">The field adapter service.</param>
 17:     /// <returns></returns>
 18:     public object Parse(object value, Property property, FieldAdapterOptions fieldAdapterService)
 19:     {
 20:         if (!(value.Equals("0") || value.Equals("1")))
 21:         {
 22:             // Parse boolean value and return result
 23:             bool boolValue = false;
 24:             bool.TryParse(value.ToString(), out boolValue);
 25:             
 26:             return boolValue;
 27:             
 28:         }
 29:         return value;
 30:     }
 31: }

This mechanism is very powerful. In fact the whole media import is based on this. Currently it only support a few default Umbraco Datatypes. For later versions I will make sure that FieldAdapters will fix import issues for all popular third party datatypes, like Ucomponents also. If you don’t want to wait for that use the API to create your own FieldAdapter and include it in your package.

Improved API

In 1.0 you could extend CMSImport. but extension points existed in different assemblies. With version 1.1 all extension points exist in the CMSImport.Extensions.DLL. Using this assembly you can create your own DataAdapters and FieldAdapters and you can use the event system. In chapter 8 of the manual you can read all about this. I’ve also created a sample project that you can use as a start. This contains samples from how to create a DataType to how to support Structured Import using the Event System. This was written for CMSImport PRO but you can use it for CMSIMport also, although not all samples will work. The sample code uses the AdventureWorks database a  DataSource. You can download this database from  CodePlex and you can download the Samples from the CMSImport site.

Small other changes

This following other small changes are included in this release.

New version of the CSV Parser

In the 1.0 release I was using an older version of the this Csv Parser. This one is upgraded  to the newest release an didn’t have any issues with it.

Better Error Handling for Saved Imports

When you deleted the root folder in CMSImport PRO 1.0. The only message that you would get was “Object reference not set to an instance of an object” and you could start all over again. In the current version CMSImport will report what is wrong and allows you to fix those issues.

InvalidImportOptions

Now with documentation

The whole import process and API is documented now. You can download the manual from the CMSImport site.

Delete failed import documents that were created during import

When a new document is created during the import process and the import process fails the document will be deleted instead of left in the tree.

Improved performance by not setting null values

When a value contains null it will not be mapped against the Document property. This will save a few database calls according to this blogpost. This is only for new imported  documents. When a document is being updated the null value could be the new value and therefore will be assigned to the property.

What’s next

The coming 1.2 version will include more FieldAdapters and support for third party Datatypes. This will be included in both the Free and Pro edition of CMSImport.. I hope to have this ready by the end of this year. I’m also working on version 2.0 that will support structured import out of the box. This will be released early next year. Structured Import will only be included in the PRO edition.

Get it while its hot

Download the free version from our.umbraco.org. Please vote up the package if you like it. Or buy a Pro license from the CMSImport website.

Comments [0] | | # 
# Friday, 02 July 2010
Friday, 02 July 2010 09:13:38 (GMT Daylight Time, UTC+01:00) ( Umbraco )

This Blog is not active anymore, further posts will be available on my company website. Read new posts here

Now that version 4.5 of Umbraco is out you want to make sure that your packages work in both 4.0.x and 4.5. Or is that just me? So far I’ve had two compatibility issues

~ prefix in UmbracoPath setting

I’m  using the Umbraco property GlobalSettings.Path (which correspondents with the umbracoPath setting in the web.config file) to determine the Umbraco folder. This used to be /Umbraco, Umbraco 4.5 supports virtual folder so it’s changed to ~/umbraco. To solve this for both 4.0.x and 4.5 you can use the ToAbsolute method of the  VirtualPathUtility class.  The example below will convert the virtual path ~/umbraco to absolute.

VirtualPathUtility.ToAbsolute(umbraco.GlobalSettings.Path);

Using inline javascript in Action class breaks the complete tree

In Umbraco you can create classed that implement the IAction interface which gives you the possibility to add menu options to the context menu of a tree. In previous versions of Umbraco you could use inline JavaScript in the JSFunctionName property to have client side functionality. In Umbraco 4.5 the clientside model is changed and if you include direct JavaScript into the JSFunction  name the complete tree will break. Good thing is that Shannon AKA @Shazwazza fixed a bug in 4.5 so the JSSource property of your action class now actually gets rendered and you can include the function here, downside is that this isn’t the case in 4.0 and we now need to think of a way to determine if we are in 4.0 or 4.5. For CMSImport and MemberExport I’m using a CompatibilityHelper Class that I’ve created. On this class I have a property SupportsJQueryTree that returns true if the CurrentVersion setting is not 4.0.

    /// <summary>
    /// This class is introduced because 4.5 is a little bit different from 4.0.x 
    /// One single place to have nasty checks if the Umbraco environment supports a feature or not
    /// </summary>
    public static class CompatibilityHelper
    {
        public static bool SupportsJQueryTree
        {
            get
            {
                return !GlobalSettings.CurrentVersion.StartsWith("4.0");
            }
        }
    }

Now I can determine in my action if the JQueryTree is supported and render JavaScript for that, otherwise I will render JavaScript for the old Tree. In the snippet below you see the Implementation that I’m using in CMSImport to start an import from a node tree

        public string JsFunctionName
        {
            get
            {
                if (CompatibiltyHelper.SupportsJQueryTree)
                {
                    //Environment supports the new tree call Javascript via a function
                    //doing this with inline script this will cause the tree to crash
                    return "StartWizard()";
                }
                else
                {
                    //The old tree could not have a function in JsSource, use inline script instead.
                    return " parent.right.document.location.href = '" + umbraco.GlobalSettings.Path + "/plugins/CMSImport/Pages/wizard.aspx?id=' + nodeID; ";
                }
            }
        }

        public string JsSource
        {
            get
            {
                if (CompatibiltyHelper.SupportsJQueryTree)
                {
                    //Assign a function.
                    return "function StartWizard(){ parent.right.document.location.href = '" + VirtualPathUtility.ToAbsolute("/plugins/CMSImport/Pages/wizard.aspx") + "?id=' + 
UmbClientMgr.mainTree().getActionNode().nodeId ; }";
                }
                else
                {
                    //Doesn't work in 4.0.x
                    return string.Empty;
                }
            }
        }

This might sound like a hack and it really is a hack. But for me this works. Within a few months just a small percentage of the Umbraco users is using 4.0, the rest is on 4.5 and I might drop support for 4.0 then and only need to delete this CompatibilityHelper class and delete the old 4.0.x code 

So far these are the only compatibility issues I’ve found (I don’t use the new schema in my packages). If I find more I will create a separate blogpost for it. Hope this post helps you with your compatibility issues in your packages

Comments [1] | | # 
# Monday, 07 June 2010
Monday, 07 June 2010 12:42:40 (GMT Daylight Time, UTC+01:00) ( MemberExport | Package | Umbraco )

This Blog is not active anymore, further posts will be available on my company website. Read new posts here

A few weeks back I’ve blogged about the new MemberExport package I was working on. Today I can tell you it’s released, both the free and the Pro (commercial) version. For those who missed the last blogpost…. MemberExport (Pro) helps you export members from your Umbraco installation to a csv file. The Free edition is limited to export only 200 records. With the PRO version it’s  possible to save the export options  steps for later use .

screenshot 

Free Edition

The free edition of MemberExport can be found on our.umbraco.org. Please vote the project up if you used and liked it.

Pricing

You can buy a single domain license of MemberExport PRO. With a single domain license you are allowed to use  MemberExport PRO  for a single domain and all subdomains, such as www.example.com, accept.example.com, and local.example.com. We also have a Enterprise license available. With an Enterprise license you are allowed to install the MemberExport PRO package on unlimited production web servers, and use it for unlimited Umbraco instances within the Enterprise. A single domain license will be available for  39 Euro, an enterprise license for 149 euro.  When you buy a license you’ll get free updates within 90 days of purchase and  free updates for all minor releases within a major release.  For example, if you purchased a  1.0 version of MemberExport PRO, you get free updates of all 1.x versions through our client area.

Special 1.0 offer. When you buy the 1.0 release you’ll get a free update to 2.x. This is a 1.0 offer only!

More Info

For more info, download, or purchase you can check out the MemberExport website

Comments [0] | | # 
# Friday, 28 May 2010
Friday, 28 May 2010 15:51:58 (GMT Daylight Time, UTC+01:00) ( MemberExport | Package | Umbraco )

This Blog is not active anymore, further posts will be available on my company website. Read new posts here

For those who follow me on twitter probably know that I’m working on a new package for Umbraco that can export Members to a csv file. Below you see the first screenshot of the package. Basically you select the groups and fields you want to export, you specify the export options and when you click the export button a csv file is generated on the fly which you can download.

 MemberExport

Two days ago I started tweeting about this because I was very happy that exporting a few hundred members only took 2 seconds. Immediately people warned me about the fact that I used Member.GetAll to get a list of all the members which is very slow when you want to export more than 500 records. Thanks again for this warning guys (also for the brain breaking sql I had to write to improve the performance ;-)).  So I changed the Member.GetAll functionality to a custom SQL query, imported 5000 extra records  and did a performance test to see if  the modification was a success. Guess what, the export of 5000+ records only took 2142 milliseconds. I think that’s a great result to end the week with.

When will this package be available?

Next Monday I will send the package to a few people that  want to beta test MemberExport. When it’s stable enough I’ll release the package. There will be two versions of the package, a free (limited to export 200) records version and a PRO version that can also save the export options for later use. The price for the pro version will be 39 euro (ex 19% Dutch VAT, only for Dutch customers) .

I hope you find the package interesting!

Comments [1] | | # 
# Friday, 16 April 2010
Friday, 16 April 2010 14:09:04 (GMT Daylight Time, UTC+01:00) ( CMSImport | Umbraco )

This Blog is not active anymore, further posts will be available on my company website. Read new posts here

When I released CMSImport 1.0 two months ago, I briefly described the FieldAdapters feature that  I was going to build for version 1.1. Today I want to go more into detail about the FieldAdapters feature for CMSImport.

The problem

The reason I started to think about fieldadapters was because I wanted to solve a very common problem. As you might know Umbraco only accepts three kinds of  data; string, integer and datetime. What happens when you try to map a boolean value to  a yes/no Umbraco datatype? An exception is thrown.  The following screenshot contains several products that we want to import into Umbraco.

products

When we’ve mapped the InStore column to a yes/no datatype the import will fail because it can’t map the boolean value to a 0 or 1 and we will see the following ugly screen

errors 

And a FieldAdapter can fix that?

Yes a fieldadapter inspects the value and tries to parse it, in this case it will try to pares a true/false value to 1/0, best to explain by exploring the source code. The whole feature is based on the new IFieldAdapter interface.

using System;

namespace CMSImportLibrary.Interfaces
{
    /// <summary>
    /// Implement the IFieldAdapter interface to convert an mallformed field to a correct type.
    /// </summary>
    public interface IFieldAdapter
    {
        /// <summary>
        /// Contains the GUID of the datatype we want to parse using this FieldAdapter
        /// </summary>
        Guid DataTypeId { get; }

        /// <summary>
        /// Parse the data 
        /// </summary>
        /// <param name="value">The value to parse</param>
        /// <returns></returns>
        object Parse(object value);
    }
}

As you can see in the code snippet the interface contains the property DataTypeId. The value needs to correspondent to the Id (GUID) of the datatype you are creating the fieldadapter for. During the import a factory inspects the underlying datatype of the document property, if a fieldadapter is found it will execute  the Parse method. This will work on all Umbraco datatypes (also custom datatypes or datatypes from third party packages) as long as you know the Id of the datatype. You can find the id by opening the datatype in Umbraco, there you see the RenderControl .

truefalsedatatype

When opening the source code of the rendercontrol you’ll see the Id of the datatype (a GUID). Don’t worry if you can’t open the source code of the datatype i’ll add the Id’s of all known datatypes to the documentation of CMSImport and I’ll make a free tool that shows the Id of any datatype.

Implementation of the BooleanFieldAdapter

Now enough with all the boring stuff, let’s see the fieldadapter in action. Below you’ll see the implementation of the BooleanFieldAdapter. I’ve mapped the id of the True/false datatype to the DataTypeId property so CMSImport knows that it needs to call the Parse method during the mapping of a yes/no document property. In the Parse method I simply check if the value is already in the correct format , if not it will try to convert the value to 1 or 0 and return that , otherwise it will just return the original value.

using System;
using CMSImportLibrary.Interfaces;

namespace CMSImportLibrary.FieldAdapters.DefaultFieldAdapters
{
    public class BooleanFieldAdapter : IFieldAdapter
    {
        #region IFieldAdapter Members

        public Guid DataTypeId
        {
            get { return new Guid("38b352c1-e9f8-4fd8-9324-9a2eab06d97a"); }
        }

        public object Parse(object value)
        {
            if (!(value.Equals("0") || value.Equals("1")))
            {
                bool boolValue = false;
                if (bool.TryParse(value.ToString(), out boolValue))
                {
                    return boolValue ? 1 : 0;
                }
            }
            return value;
        }

        #endregion
    }
}

Now when we run the import  again it will just import the data without any errors, just by adding a few lines of code, isn’t that powerful?

Beyond fixing problems

Now that we have this mechanism we can also use it to modify data during the import. Let’s say we import a piece of content from an old site that contains an image tag. This will just run fine but when you have a reference to an image on your old site and  you delete that old site all the references to the images are dead. FieldAdapters can help solve this issue by inspecting the text, extract the image tags, import these images into the media library and update the image tag with a reference to the media item. This will really help keep your site consistent. The same applies for Upload fields.

Will all of this be included in the free version of CMSImport also?

All FieldAdapters that fix errors (Like the BooleanFieldAdapter) will be included into the free version of CMSImport. FieldAdapters that helps you updating the content will only be included in the PRO version of CMSImport. And again you can also create your own FieldAdapters, free for both versions.

This will be the major feature of the V1.1 release of CMSImport. Please let me know what you think about this feature.

Comments [0] | | #