<?xml version="1.0" encoding="utf-8"?>
<feed xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xml:lang="en-us" xmlns="http://www.w3.org/2005/Atom">
  <title>RichardSoeteman.net</title>
  <link rel="alternate" type="text/html" href="http://www.richardsoeteman.net/" />
  <link rel="self" href="http://www.richardsoeteman.net/SyndicationService.asmx/GetAtom" />
  <icon>favicon.ico</icon>
  <updated>2011-12-20T16:04:14.1427586+01:00</updated>
  <author>
    <name>Richard Soeteman</name>
  </author>
  <subtitle />
  <id>http://www.richardsoeteman.net/</id>
  <generator uri="http://dasblog.info/" version="2.3.9074.18820">DasBlog</generator>
  <entry>
    <title>Released MemberExport 2.0</title>
    <link rel="alternate" type="text/html" href="http://www.richardsoeteman.net/2011/12/20/ReleasedMemberExport20.aspx" />
    <id>http://www.richardsoeteman.net/PermaLink,guid,8a19799d-4fc8-4e67-bcb4-37907201cf57.aspx</id>
    <published>2011-12-20T14:57:00+01:00</published>
    <updated>2011-12-20T16:04:14.1427586+01:00</updated>
    <category term="MemberExport" label="MemberExport" scheme="http://www.richardsoeteman.net/CategoryView,category,MemberExport.aspx" />
    <category term="Package" label="Package" scheme="http://www.richardsoeteman.net/CategoryView,category,Package.aspx" />
    <category term="Umbraco" label="Umbraco" scheme="http://www.richardsoeteman.net/CategoryView,category,Umbraco.aspx" />
    <author>
      <name>Richard Soeteman</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
I’ve just released MemberExport 2.0. Apart from another awesome logo by <a href="https://twitter.com/#!/aim24" target="_blank">Arnold
Visser</a>.I’ve added some functionality as well.
</p>
        <p>
          <a href="http://www.richardsoeteman.net/content/binary/Windows-Live-Writer/Released-MemberExport-2.0_CC61/memberexport100x100_2.png">
            <img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="memberexport100x100" border="0" alt="memberexport100x100" src="http://www.richardsoeteman.net/content/binary/Windows-Live-Writer/Released-MemberExport-2.0_CC61/memberexport100x100_thumb.png" width="104" height="104" />
          </a>
        </p>
        <h2>Native Excel export
</h2>
        <p>
MemberExport 1.x could only export to a csv file. This is great for most of us but
when you select a wrong separator and want to open the csv file in Excel directly
it will probably looks a bit messy like the example below. 
</p>
        <p>
          <a href="http://www.richardsoeteman.net/content/binary/Windows-Live-Writer/Released-MemberExport-2.0_CC61/wrongformat_4.png">
            <img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="wrongformat" border="0" alt="wrongformat" src="http://www.richardsoeteman.net/content/binary/Windows-Live-Writer/Released-MemberExport-2.0_CC61/wrongformat_thumb_1.png" width="1099" height="239" />
          </a>
        </p>
        <p>
          <strong>MemberExport 2.0 Pro</strong> let’s you select the export option csv or Excel
file. When you select Excel file it will export the data to an Excel file instead
of csv and all the data is formatted correctly.
</p>
        <p>
          <a href="http://www.richardsoeteman.net/content/binary/Windows-Live-Writer/Released-MemberExport-2.0_CC61/image_6.png">
            <img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.richardsoeteman.net/content/binary/Windows-Live-Writer/Released-MemberExport-2.0_CC61/image_thumb_2.png" width="499" height="475" />
          </a>
        </p>
        <h2>Export provider
</h2>
        <p>
I don’t like closed systems, all of my packages are open for extension. When creating
the Excel export option I wanted the export option to be a provider model. Not only
to make this task easier for myself but also so you can use MemberExport to connect
to your custom ERP system. Implementing an export provider is pretty straight forward.
The example below is the implementation of the CSV Provider. 
</p>
        <h2>CSVProviderUI
</h2>
        <p>
The <strong>CSVProviderUI</strong> class is the class which is responsible for the
UI part of the provider. Add a reference to the <strong>MemberExport.Library dll</strong> and
derive from <strong>ExportProviderUIBase</strong> class. Implement to following methods:
</p>
        <ul>
          <li>
OnInit, create the UI controls 
</li>
          <li>
Initialize, initialize the UI options based on the stored export provider settings.
In this case exportProvider will hold the text delimiter and text indicator options. 
</li>
          <li>
GetOptions will return the export provider settings so we use those settings when
exporting records 
</li>
          <li>
The name property will return the name of the provider stored in the Export as dropdownlist
when selecting an export provider. 
</li>
        </ul>
        <pre class="csharpcode">
          <span class="kwrd">using</span> System; <span class="kwrd">using</span> System.Web.UI; <span class="kwrd">using</span> System.Web.UI.WebControls; <span class="kwrd">using</span> MemberExport.Resources.Helpers; <span class="kwrd">using</span> umbraco.uicontrols; <span class="kwrd">namespace</span> MemberExport.Library.ExportProviders.CSV
{ <span class="rem">/// &lt;summary&gt;</span><span class="rem">/// Renders the Layout
for the CSV Provider</span><span class="rem">/// &lt;/summary&gt;</span><span class="kwrd">public</span><span class="kwrd">class</span> CSVProviderUI
: ExportProviderUIBase, INamingContainer { <span class="kwrd">protected</span> DropDownList
_csvTextIndicatorDropDownList = <span class="kwrd">new</span> DropDownList(); <span class="kwrd">protected</span> DropDownList
_csvSVSeperatorDropDownList = <span class="kwrd">new</span> DropDownList(); <span class="kwrd">protected</span><span class="kwrd">override</span><span class="kwrd">void</span> OnInit(EventArgs
e) { <span class="kwrd">base</span>.OnInit(e); _csvSVSeperatorDropDownList.Items.Add(<span class="kwrd">new</span> ListItem(<span class="str">";"</span>, <span class="str">";"</span>));
_csvSVSeperatorDropDownList.Items.Add(<span class="kwrd">new</span> ListItem(<span class="str">","</span>, <span class="str">","</span>));
_csvTextIndicatorDropDownList.Items.Add(<span class="kwrd">new</span> ListItem(ResourceHelper.Current.GetStringResource(<span class="str">"CSVNoTextIndicator"</span>), <span class="str">""</span>));
_csvTextIndicatorDropDownList.Items.Add(<span class="kwrd">new</span> ListItem(<span class="str">"\""</span>, <span class="str">"\""</span>));
_csvTextIndicatorDropDownList.Items.Add(<span class="kwrd">new</span> ListItem(<span class="str">"\'"</span>, <span class="str">"\'"</span>));
PropertyPanel delimiterPropery = <span class="kwrd">new</span> PropertyPanel(); delimiterPropery.Text
= ResourceHelper.Current.GetStringResource(<span class="str">"CSVSeperatorProperty"</span>);
delimiterPropery.Controls.Add(_csvSVSeperatorDropDownList); PropertyPanel stringIndicatorPropery
= <span class="kwrd">new</span> PropertyPanel(); stringIndicatorPropery.Text = ResourceHelper.Current.GetStringResource(<span class="str">"CSVTextIndicatorProperty"</span>);
stringIndicatorPropery.Controls.Add(_csvTextIndicatorDropDownList); Controls.Add(delimiterPropery);
Controls.Add(stringIndicatorPropery); } <span class="rem">/// &lt;summary&gt;</span><span class="rem">///
Sets the export options (delimiter and string indicator).</span><span class="rem">///
&lt;/summary&gt;</span><span class="rem">/// &lt;param name="exportProvider"&gt;The
export provider.&lt;/param&gt;</span><span class="kwrd">public</span><span class="kwrd">override</span><span class="kwrd">void</span> Initialize(ExportProviderBase
exportProvider) { CSVProvider csvProvider = exportProvider <span class="kwrd">as</span> CSVProvider; <span class="kwrd">if</span> (csvProvider
!= <span class="kwrd">null</span>) { _csvSVSeperatorDropDownList.SelectedValue = csvProvider.Delimiter;
_csvTextIndicatorDropDownList.SelectedValue = csvProvider.StringIndicator; } } <span class="rem">///
&lt;summary&gt;</span><span class="rem">/// Returns the selected export options (delimiter
and string indicator).</span><span class="rem">/// &lt;/summary&gt;</span><span class="rem">///
&lt;returns&gt;&lt;/returns&gt;</span><span class="kwrd">public</span><span class="kwrd">override</span> ExportProviderBase
GetOptions() { CSVProvider csvProvider = <span class="kwrd">new</span> CSVProvider();
csvProvider.Delimiter = _csvSVSeperatorDropDownList.SelectedValue; csvProvider.StringIndicator
= _csvTextIndicatorDropDownList.SelectedValue; <span class="kwrd">return</span> csvProvider;
} <span class="rem">/// &lt;summary&gt;</span><span class="rem">/// Return the name
of the provider. this will be displayed in the selectbox</span><span class="rem">///
&lt;/summary&gt;</span><span class="rem">/// &lt;value&gt;The selected name.&lt;/value&gt;</span><span class="kwrd">public</span><span class="kwrd">override</span><span class="kwrd">string</span> Name
{ get { <span class="kwrd">return</span><span class="str">"CSV file"</span>;
} } } }</pre>
        <style type="text/css">





.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
        <h2>CsvProvider
</h2>
        <p>
The second part we need implement is the provider itself which handles the actual
export process. Create a new class and derive from <strong>ExportProviderBase</strong>. 
This will give the following methods/properties:
</p>
        <ul>
          <li>
Export, responsible for the export process 
</li>
          <li>
Icon, will be displayed when opening the saved exports tree 
</li>
        </ul>
        <p>
In this implementation we’ve added the StringIndicator and Delimiter options, which
gets set from the UI. The export method will give a list of columns to export and
all records using an <strong>IRecordReader</strong>.  The rest of the code is
implementation specific. Two important things to know when exporting records. 
When assigning a value always use the <strong>ValueParser factory</strong><br /></p>
        <pre class="csharpcode">ValueParser.Parse(reader.GetObject(column.Alias), column));</pre>
        <style type="text/css">




.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
        <p>
To write the file to the browser either use the <strong>WriteResponseString</strong> (for
stringvalues ) or <strong>WriteResponseBytes</strong> (for a byte array) methods.
Both methods need the Contenttype (Mimetype) and fileExtension, in this case csv.
</p>
        <pre class="csharpcode">
          <span class="kwrd">using</span> System; <span class="kwrd">using</span> System.Collections.Generic; <span class="kwrd">using</span> MemberExport.Library.Csv; <span class="kwrd">using</span> MemberExport.Library.Members; <span class="kwrd">using</span> MemberExport.Library.Types; <span class="kwrd">namespace</span> MemberExport.Library.ExportProviders.CSV
{ <span class="rem">/// &lt;summary&gt;</span><span class="rem">/// CSV (Default)
implementation of MemberExport</span><span class="rem">/// &lt;/summary&gt;</span> [Serializable()] <span class="kwrd">public</span><span class="kwrd">class</span> CSVProvider
: ExportProviderBase { <span class="rem">/// &lt;summary&gt;</span><span class="rem">///
Exports the data to a csv file</span><span class="rem">/// &lt;/summary&gt;</span><span class="rem">///
&lt;param name="columns"&gt;Collection of column info&lt;/param&gt;</span><span class="rem">///
&lt;param name="reader"&gt;The actual data to export&lt;/param&gt;</span><span class="kwrd">public</span><span class="kwrd">override</span><span class="kwrd">void</span> Export(List&lt;Types.MemberField&gt;
columns, umbraco.DataLayer.IRecordsReader reader) { <span class="rem">//Use a csv
writer object</span> CsvWriter writer = <span class="kwrd">new</span> CsvWriter(Delimiter,
StringIndicator); <span class="rem">//Add columns to export</span><span class="kwrd">foreach</span> (MemberField
field <span class="kwrd">in</span> columns) { writer.Columns.Add(field.Text); } <span class="rem">//Add
data to export</span><span class="kwrd">while</span> (reader.Read()) { <span class="rem">//Get
values for the current row</span> List&lt;<span class="kwrd">object</span>&gt; values
= <span class="kwrd">new</span> List&lt;<span class="kwrd">object</span>&gt;(); <span class="kwrd">foreach</span> (MemberField
column <span class="kwrd">in</span> columns) { values.Add(ValueParser.Parse(reader.GetObject(column.Alias),
column)); } <span class="rem">//write values to csvwriter;</span> writer.Add(values.ToArray());
} <span class="rem">//Write response to the browser</span> WriteResponseString(writer.Parse(), <span class="str">"application/excel"</span>, <span class="str">"csv"</span>);
} <span class="rem">/// &lt;summary&gt;</span><span class="rem">/// Gets or sets
the string indicator.</span><span class="rem">/// &lt;/summary&gt;</span><span class="rem">///
&lt;value&gt;The string indicator.&lt;/value&gt;</span><span class="kwrd">public</span><span class="kwrd">string</span> StringIndicator
{ get; set; } <span class="rem">/// &lt;summary&gt;</span><span class="rem">/// Gets
or sets the delimiter.</span><span class="rem">/// &lt;/summary&gt;</span><span class="rem">///
&lt;value&gt;The delimiter.&lt;/value&gt;</span><span class="kwrd">public</span><span class="kwrd">string</span> Delimiter
{ get; set; } <span class="rem">/// &lt;summary&gt;</span><span class="rem">/// Returns
the icon that will be displayed in the saved tree</span><span class="rem">/// &lt;/summary&gt;</span><span class="rem">///
&lt;value&gt;The icon.&lt;/value&gt;</span><span class="kwrd">public</span><span class="kwrd">override</span><span class="kwrd">string</span> Icon
{ get { <span class="kwrd">return</span><span class="str">"csvexport.gif"</span>;
} } } }</pre>
        <style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
        <p>
          <strong>That’s all, compile and add to the bin folder of your Umbraco install and
you can use the provider!</strong>
        </p>
        <h2>ValueParsers
</h2>
        <p>
By default MemberExport exports the stored value from  the database. When this
value is an Id value you might want to export the text value instead. This can be
achieved using a value parser. By default MemberExport comes with value parsers for
the following datatypes :
</p>
        <ul>
          <li>
Checkbox 
</li>
          <li>
Dropdownlist 
</li>
          <li>
MNTP 
</li>
          <li>
MuiltipleDropdownlist 
</li>
          <li>
Radiobox 
</li>
          <li>
Ultimatepicker 
</li>
        </ul>
        <p>
In the example below we will write a value parser for the True/false datatype. By
default values will be exported as 1/0. We want the values to be exported as yes/no
for this example. 
</p>
        <p>
          <strong>
            <em>
              <font size="3">Before you ask, this isn’t in the core because some people
want 0/1, some true/false, some yes/no etc.</font>
            </em>
          </strong>
        </p>
        <p>
First we need to add a reference to the <strong>MemberExport.Library dll</strong>.
Then we can create a class that implements the <strong>IValueParser</strong> interface
</p>
        <pre class="csharpcode">
          <span class="kwrd">public</span>
          <span class="kwrd">class</span> TrueFalseParser
: IValueParser { <span class="rem">/// &lt;summary&gt;</span><span class="rem">///
Returns the Datatype GUID of the true/false Render Control.</span><span class="rem">///
&lt;/summary&gt;</span><span class="kwrd">public</span> Guid DataTypeId { get { <span class="kwrd">return</span><span class="kwrd">new</span> Guid(<span class="str">"38b352c1-e9f8-4fd8-9324-9a2eab06d97a"</span>);
} } <span class="rem">/// &lt;summary&gt;</span><span class="rem">/// Converts the
0/1 to a normal yes/no string.</span><span class="rem">/// &lt;/summary&gt;</span><span class="rem">///
&lt;param name="memberfieldInfo"&gt;The memberfield info.&lt;/param&gt;</span><span class="rem">///
&lt;param name="value"&gt;The value.&lt;/param&gt;</span><span class="rem">///
&lt;returns&gt;The yes/no string&lt;/returns&gt;</span><span class="kwrd">public</span><span class="kwrd">object</span> Parse(Library.Types.MemberField
memberfieldInfo, <span class="kwrd">object</span><span class="kwrd">value</span>)
{ <span class="kwrd">return</span><span class="kwrd">string</span>.Format(<span class="str">"{0}"</span>, <span class="kwrd">value</span>)
== <span class="str">"1"</span> ? <span class="str">"yes"</span> : <span class="str">"no"</span>;
} }</pre>
        <p>
The DataTypeId property needs to return the GUID which is displayed on the datatype
edit screen. 
<br /></p>
        <a href="http://www.richardsoeteman.net/content/binary/Windows-Live-Writer/Released-MemberExport-2.0_CC61/image_2.png">
          <img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.richardsoeteman.net/content/binary/Windows-Live-Writer/Released-MemberExport-2.0_CC61/image_thumb.png" width="581" height="226" />
        </a>
        <style type="text/css">



.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
        <p>
The Parse method will be called when a true/false property value is exported. In the
above example we transform the value to yes/no. 
<br />
The following information about the exported field is available in the <strong>memberFieldInfo</strong> variable:
</p>
        <ul>
          <li>
DataTypeId. The GUID which is displayed on the datatype edit screen 
</li>
          <li>
DatatypeNodeId. The node id  of the Datatype. 
</li>
          <li>
Alias. The Property alias. 
</li>
          <li>
Text. The Property text. 
</li>
        </ul>
        <p>
To use the Value Parser all we need to compile the project and add the dll to the
bin folder of the Umbraco install. Then it will be picked up automatically and values
will be exported as yes/no. In the example below the Active column is exported as
true/false value using the Value Parser.
</p>
        <p>
          <a href="http://www.richardsoeteman.net/content/binary/Windows-Live-Writer/Released-MemberExport-2.0_CC61/image_4.png">
            <img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.richardsoeteman.net/content/binary/Windows-Live-Writer/Released-MemberExport-2.0_CC61/image_thumb_1.png" width="426" height="68" />
          </a>
        </p>
        <h4>
        </h4>
        <h2>Download and install
</h2>
        <p>
You can download the <a href="http://our.umbraco.org/projects/website-utilities/memberexport" target="_blank">MemberExport
package from the Umbraco Deli</a>. Just install the package, also when you want to
update your current version. When you are a Pro user make sure the license file is
still in your bin folder to unlock the Pro features. 
</p>
        <p>
Happy exporting! 
</p>
        <img width="0" height="0" src="http://www.richardsoeteman.net/aggbug.ashx?id=8a19799d-4fc8-4e67-bcb4-37907201cf57" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Quick tip solve date errors in CMSImport</title>
    <link rel="alternate" type="text/html" href="http://www.richardsoeteman.net/2011/11/15/QuickTipSolveDateErrorsInCMSImport.aspx" />
    <id>http://www.richardsoeteman.net/PermaLink,guid,ffa08bcd-209b-4611-8d6b-cf8fc2542853.aspx</id>
    <published>2011-11-15T17:05:32.2948723+01:00</published>
    <updated>2011-11-15T17:05:56.6229973+01:00</updated>
    <category term="CMSImport" label="CMSImport" scheme="http://www.richardsoeteman.net/CategoryView,category,CMSImport.aspx" />
    <category term="Umbraco" label="Umbraco" scheme="http://www.richardsoeteman.net/CategoryView,category,Umbraco.aspx" />
    <author>
      <name>Richard Soeteman</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
A question I get a lot is how to solve date formatting issues in CMSImport. Unless
you are using SQL Server all imported values are of type string. So when you try to
import date values the data layer will try to convert the value to a DateTime object,
if it can’t parse the string you will see an error. These errors can be solved. Let’s
take the following example from a Wordpress export file that can fail.
</p>
        <pre>
          <pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px">
            <span style="color: #0000ff">&lt;</span>
            <span style="color: #c71585">wp</span>:<span style="color: #800000">post</span><span style="color: #ff0000">_date</span><span style="color: #0000ff">&gt;</span>2011-11-03
17:29:18<span style="color: #0000ff">&lt;/</span><span style="color: #c71585">wp</span>:<span style="color: #800000">post</span>_date<span style="color: #0000ff">&gt;</span></pre>
        </pre>
        <p>
When mapping the value in CMSImport you can select the advanced mapping option, this
will show the following mapping options if you map against a DateTime Property. As
you can see you can specify a date format. Check the <a href="http://idunno.org/archive/2004/07/14/122.aspx" target="_blank">custom
date formatting section</a> for the exact formatting syntax. When you specify a format
that exactly matches the string from your datasource(TIP use the refresh option to
update the preview) CMSImport will use that format to convert the string to the DateTime
object and all will import fine.
</p>
        <p>
          <a href="http://www.richardsoeteman.net/content/binary/Windows-Live-Writer/Solve-date-formatting-issues-during_EA1E/clip_image002_2.jpg">
            <img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image002" border="0" alt="clip_image002" src="http://www.richardsoeteman.net/content/binary/Windows-Live-Writer/Solve-date-formatting-issues-during_EA1E/clip_image002_thumb.jpg" width="594" height="206" />
          </a>
        </p>
        <p>
Hope this helps you!
</p>
        <img width="0" height="0" src="http://www.richardsoeteman.net/aggbug.ashx?id=ffa08bcd-209b-4611-8d6b-cf8fc2542853" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Integrate your own packages into uGoLive</title>
    <link rel="alternate" type="text/html" href="http://www.richardsoeteman.net/2011/11/08/IntegrateYourOwnPackagesIntoUGoLive.aspx" />
    <id>http://www.richardsoeteman.net/PermaLink,guid,6ac09de5-3047-477e-8252-73708b97fe36.aspx</id>
    <published>2011-11-08T11:16:29.9936393+01:00</published>
    <updated>2011-11-08T12:20:10.5089993+01:00</updated>
    <category term="Package" label="Package" scheme="http://www.richardsoeteman.net/CategoryView,category,Package.aspx" />
    <category term="Umbraco" label="Umbraco" scheme="http://www.richardsoeteman.net/CategoryView,category,Umbraco.aspx" />
    <author>
      <name>Richard Soeteman</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
Last week <a href="http://twitter.com/#!/mattbrailsford" target="_blank">Matt Brailsford</a> released
uGoLive. <a href="http://our.umbraco.org/projects/backoffice-extensions/ugolive" target="_blank">uGoLive</a> is
a package with essential checks you need to do before your website goes live.Test
includes checking for debug and trace mode, removing install directory etc. The great
thing about uGoLive is that you can easily integrate checks into uGoLive. In fact
you can already use or extend the <a href="https://bitbucket.org/mattbrailsford/ugolivecontrib" target="_blank">uGoLive
contrib project</a>. But you can also integrate uGoLive into your own package. Extending
uGoLive is <a href="http://our.umbraco.org/FileDownload?id=3275" target="_blank">very
well documented</a>,  I’ve just integrated uGoLive into the SEO Analyzer package
I am working on.
</p>
        <p>
          <a href="http://www.richardsoeteman.net/content/binary/Windows-Live-Writer/Integrate-uGolive-checks-in-your-own-pac_90B0/SeoAnalyzer%20uGoLive_4.png">
            <img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="SeoAnalyzer uGoLive" border="0" alt="SeoAnalyzer uGoLive" src="http://www.richardsoeteman.net/content/binary/Windows-Live-Writer/Integrate-uGolive-checks-in-your-own-pac_90B0/SeoAnalyzer%20uGoLive_thumb_1.png" width="959" height="495" />
          </a>
        </p>
        <h4>
        </h4>
        <h4>It’s all about plugin architecture
</h4>
        <p>
The thing I like most about Umbraco and most of the available packages is that is
uses a plugin architecture. Plugin architecture means that Umbraco or a package defines
an interface, or attribute and when you implement that interface, or decorate your
class with the attribute in your own code it will be picked up automatically by Umbraco
or the package. This also prevents you have a tight coupling with the functionality
you want to implement. In other words when you add a class implementing a certain
interface this will be automatically picked up when the responsible functionality
in this case uGoLive exists in the Umbraco environment. If uGoLive isn’t installed
it’s just a class that does nothing.
</p>
        <p>
To integrate the custom checks as displayed in the above example I only added a reference
to the Our.Umbraco.uGoLive.dll, decorate my class with the Check attribute and implement
a class deriving from AbstractCheck for each check. 
</p>
        <pre class="csharpcode">
          <span class="rem">/// &lt;summary&gt;</span>
          <span class="rem">///
Check the SEO Analyzer table for template issues</span>
          <span class="rem">/// &lt;/summary&gt;</span> [Check(<span class="str">"C4B4D282-12CB-44AC-8263-389D70415895"</span>, <span class="str">"Template
issues"</span>, <span class="str">"Leaving SEO Issues in templates unsolved
can be bad for your ranking"</span>, <span class="str">"SEO Analyzer"</span>)] <span class="kwrd">public</span><span class="kwrd">class</span> SeoAnalyzerTemplateErrorsCheck
: AbstractCheck { <span class="rem">/// &lt;summary&gt;</span><span class="rem">///
Checks the SEO Analyzer error log table</span><span class="rem">/// &lt;/summary&gt;</span><span class="kwrd">public</span><span class="kwrd">override</span> CheckResult
Check() { <span class="kwrd">return</span> TemplateIssues.GetAll().Count == 0 ? PassedResult()
: FailedResult(); } <span class="rem">/// &lt;summary&gt;</span><span class="rem">///Returns
the result object when the check passed</span><span class="rem">/// &lt;/summary&gt;</span><span class="kwrd">private</span> CheckResult
PassedResult() { var result = <span class="kwrd">new</span> CheckResult(); result.Status
= CheckResultStatus.Passed; result.Message = <span class="str">"No template issues
found"</span>; <span class="kwrd">return</span> result; } <span class="rem">///
&lt;summary&gt;</span><span class="rem">///Returns the result object when the check
failed</span><span class="rem">/// &lt;/summary&gt;</span><span class="kwrd">private</span> CheckResult
FailedResult() { var result = <span class="kwrd">new</span> CheckResult(); result.Status
= CheckResultStatus.Failed; result.Message = <span class="str">"Template issues
found, resolve them in the SEO Analyzer section"</span>; <span class="kwrd">return</span> result;
} }</pre>
        <style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
        <p>
This was very straight forward to implement, a big <a href="http://h5yr.com" target="_blank">#h5yr</a> to
the team who build uGoLive and now I better hurry up finishing SEO Analyzer to prevent
you from having SEO issues in your site.
</p>
        <img width="0" height="0" src="http://www.richardsoeteman.net/aggbug.ashx?id=6ac09de5-3047-477e-8252-73708b97fe36" />
      </div>
    </content>
  </entry>
  <entry>
    <title>CMSImport 2.1</title>
    <link rel="alternate" type="text/html" href="http://www.richardsoeteman.net/2011/10/25/CMSImport21.aspx" />
    <id>http://www.richardsoeteman.net/PermaLink,guid,4d5b3cfd-4fb4-4466-bc60-9f3cf4c1f3e1.aspx</id>
    <published>2011-10-25T14:25:49.9052409+02:00</published>
    <updated>2011-10-25T15:21:04.2289959+02:00</updated>
    <category term="CMSImport" label="CMSImport" scheme="http://www.richardsoeteman.net/CategoryView,category,CMSImport.aspx" />
    <category term="Umbraco" label="Umbraco" scheme="http://www.richardsoeteman.net/CategoryView,category,Umbraco.aspx" />
    <author>
      <name>Richard Soeteman</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
 
</p>
        <p>
 <a href="http://www.richardsoeteman.net/content/binary/Windows-Live-Writer/CMSImport-2.1_E885/cmsimport_2.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="cmsimport" border="0" alt="cmsimport" src="http://www.richardsoeteman.net/content/binary/Windows-Live-Writer/CMSImport-2.1_E885/cmsimport_thumb.png" width="240" height="180" /></a></p>
        <p>
A few weeks back  I’ve released CMSImport 2.1. Apart from the awesome Logo made
by <a href="http://twitter.com/#!/aim24" target="_blank">Arnold Visser</a> I’ve added
some functionality as well. 
<br /></p>
        <h2>
        </h2>
        <h3>Import dashboard for Content Editors
</h3>
        <p>
CMSImport is great for developers. They can create import definitions and execute,
or schedule  them. When you want to allow your content editors uploading new
data and import that data you need to allow them access to the developer section,
or let them upload a file to a specific location and schedule a task that imports
that file very hour or so. Well not anymore. Now  you can use a dashboard control
and allow users to import their data using that dashboard control. The user can select
an import definition, upload a file containing the data to import and optional upload
a zip file containing the media files. Before importing the data will be verified
to ensure all columns still exists in the new uploaded data file. This feature is
a direct request from customers who use CMSImport to update their <a href="http://www.teacommerce.dk/" target="_blank">TeaCommerce</a> or <a href="http://www.uwebshop.com/" target="_blank">uWebshop</a> catalog,
but can also be used for any other import requirement of course.
</p>
        <p>
          <a href="http://www.richardsoeteman.net/content/binary/Windows-Live-Writer/CMSImport-2.1_E885/importdashboardcontrol_2.png">
            <img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="importdashboardcontrol" border="0" alt="importdashboardcontrol" src="http://www.richardsoeteman.net/content/binary/Windows-Live-Writer/CMSImport-2.1_E885/importdashboardcontrol_thumb.png" width="817" height="510" />
          </a>
        </p>
        <p>
As a developer you still have full control what you want your users to import. Using
the ImportDashboard settings page you can enable/disable Import definitions you want
your end users to use. You can only select import definitions that allow upload of
a file such as Excel, Csv, Xml etc. You will also see an xml Snippet you can customize
to your needs and paste into the dashboard.config file. Using the access element you
can also restrict which User types can access the Dashboard control.<a href="http://our.umbraco.org/wiki/reference/files-and-folders/dashboardconfig" target="_blank">Check
out this wiki</a> for more information about configuring Dashboard controls.
</p>
        <p>
          <a href="http://www.richardsoeteman.net/content/binary/Windows-Live-Writer/CMSImport-2.1_E885/UserImportSettingsDashboard_2.png">
            <img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="UserImportSettingsDashboard" border="0" alt="UserImportSettingsDashboard" src="http://www.richardsoeteman.net/content/binary/Windows-Live-Writer/CMSImport-2.1_E885/UserImportSettingsDashboard_thumb.png" width="822" height="553" />
          </a>
        </p>
        <h3>Finally support for Media using MNTP
</h3>
        <p>
With the 2.1 release it’s finally possible to upload media using the <a href="http://ucomponents.codeplex.com/wikipage?title=MultiNodeTreePicker" target="_blank">Ucomponents
Multi Node Tree Picker</a>. When you select advanced mapping options when mapping
against a property based on the MNTP datatype you will see the following options screen.
Set the media location where to store the media and files will be imported automatically.
The benefit MNTP has over normal Media pickers is that you can use a comma separated
string of media files you want to import instead of just one file. When mapping against
a MNTP datatype you can only set media settings if the datatype is configured as a
media picker, otherwise you will get a message that it is not possible to set the
advanced options.
</p>
        <p>
          <a href="http://www.richardsoeteman.net/content/binary/Windows-Live-Writer/CMSImport-2.1_E885/image_2.png">
            <img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.richardsoeteman.net/content/binary/Windows-Live-Writer/CMSImport-2.1_E885/image_thumb.png" width="609" height="246" />
          </a>
        </p>
        <img width="0" height="0" src="http://www.richardsoeteman.net/aggbug.ashx?id=4d5b3cfd-4fb4-4466-bc60-9f3cf4c1f3e1" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Fix user permissions error in Digibiz Dictionary Section</title>
    <link rel="alternate" type="text/html" href="http://www.richardsoeteman.net/2011/10/17/FixUserPermissionsErrorInDigibizDictionarySection.aspx" />
    <id>http://www.richardsoeteman.net/PermaLink,guid,88a69433-9288-4b19-a85d-42cd8faaca6a.aspx</id>
    <published>2011-10-17T13:00:49.5710636+02:00</published>
    <updated>2011-10-17T13:44:25.1363146+02:00</updated>
    <category term="Umbraco" label="Umbraco" scheme="http://www.richardsoeteman.net/CategoryView,category,Umbraco.aspx" />
    <author>
      <name>Richard Soeteman</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
 
</p>
        <p>
Last week I was triggered by a tweet from <a href="http://twitter.com/cultiv" target="_blank">Sebastiaan
Janssen</a> mentioning the Dictionary Section Package was broken in 4.7.1 
</p>
        <p>
          <a href="http://www.richardsoeteman.net/content/binary/Windows-Live-Writer/5ed3cf28222b_A187/dictionarytweet_2.png">
            <img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="dictionarytweet" border="0" alt="dictionarytweet" src="http://www.richardsoeteman.net/content/binary/Windows-Live-Writer/5ed3cf28222b_A187/dictionarytweet_thumb.png" width="531" height="86" />
          </a>
        </p>
        <p>
Moving the Dictionary to a separate section  is a technique that I use myself
a lot when building solutions for clients, I don’t want to give content editor access
to the settings section and I really don’t want to edit Dictionary items myself .I
just finished a custom section where I used this, so I immediately logged in as an
Editor and indeed I got a nice Exception. This hasn’t happened before so I assume
this security check is introduced in 4.7.x.
</p>
        <p>
          <a href="http://www.richardsoeteman.net/content/binary/Windows-Live-Writer/5ed3cf28222b_A187/userException_4.png">
            <img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="userException" border="0" alt="userException" src="http://www.richardsoeteman.net/content/binary/Windows-Live-Writer/5ed3cf28222b_A187/userException_thumb_1.png" width="686" height="375" />
          </a> 
</p>
        <p>
It seemed that the page was throwing this error and indeed the constructor of EditDictionary
sets the CurrentApp which will be used  in a later stage to validate User permissions.
</p>
        <pre class="csharpcode">
          <span class="kwrd">public</span> EditDictionaryItem() { CurrentApp
= BusinessLogic.DefaultApps.settings.ToString(); }</pre>
        <style type="text/css">

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
        <p>
So to fix this error we only need to set the CurrentApp property to either language
or empty string (no validation at all). The easiest way is to modify the source and
recompile, but <strong>I never modify the original Umbraco source to work around the
Umbraco core</strong>. This is because you need to update the source code for every
version update of Umbraco. So I needed a way to update the CurrentApp property using
my own code. Lucky for us asp.net is an object oriented language and  so we can
add our own page and only override the constructor to modify the CurrentApp property.
This can be done by creating a custom aspx page where the codebehind class derives
from the <strong>EditDictionaryItem</strong> class.
</p>
        <pre class="csharpcode">
          <span class="rem">/// &lt;summary&gt;</span>
          <span class="rem">///
Derive from EditDictionaryItem to use the existing Dictionary functionality</span>
          <span class="rem">///
&lt;/summary&gt;</span>
          <span class="kwrd">public</span>
          <span class="kwrd">partial</span>
          <span class="kwrd">class</span> LanguageDictionary
: EditDictionaryItem { <span class="rem">/// &lt;summary&gt;</span><span class="rem">///
Use the constructor to set the current app</span><span class="rem">/// &lt;/summary&gt;</span><span class="kwrd">public</span> LanguageDictionary()
{ CurrentApp = <span class="str">"language"</span>; } }</pre>
        <style type="text/css">

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
        <p>
Unfortunately we still some page directives and markup in our aspx page. Lucky for
us the original aspx file only contains some basic markup (a placeholder), controls
are rendered from codebehind so it’s not a crime to copy and paste that markup and
update the Page Directives to use our new codebehind and inherit from LanguageDictionary
class. Below you see all markup.
</p>
        <pre class="csharpcode">
          <span class="asp">&lt;%@ Register Namespace="umbraco"
TagPrefix="umb" Assembly="umbraco" %&gt;</span>
          <span class="asp">&lt;%@
Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls"
%&gt;</span>
          <span class="asp">&lt;%@ Page Language="c#" MasterPageFile="~/umbraco/masterpages/umbracoPage.Master"
ValidateRequest="false" CodeBehind="LanguageDictionary.aspx.cs"
AutoEventWireup="True" Inherits="DictionaryFix.LanguageDictionary"
%&gt;</span>
          <span class="kwrd">&lt;</span>
          <span class="html">asp:Content</span>
          <span class="attr">ContentPlaceHolderID</span>
          <span class="kwrd">="body"</span>
          <span class="attr">runat</span>
          <span class="kwrd">="server"</span>
          <span class="kwrd">&gt;</span>
          <span class="kwrd">&lt;</span>
          <span class="html">cc1:UmbracoPanel</span>
          <span class="attr">ID</span>
          <span class="kwrd">="Panel1"</span>
          <span class="attr">runat</span>
          <span class="kwrd">="server"</span>
          <span class="attr">Width</span>
          <span class="kwrd">="408px"</span>
          <span class="attr">Height</span>
          <span class="kwrd">="264px"</span>
          <span class="kwrd">&gt;</span>
          <span class="kwrd">&lt;/</span>
          <span class="html">cc1:UmbracoPanel</span>
          <span class="kwrd">&gt;</span>
          <span class="kwrd">&lt;</span>
          <span class="html">script</span>
          <span class="attr">type</span>
          <span class="kwrd">="text/javascript"</span>
          <span class="kwrd">&gt;</span> jQuery(document).ready(<span class="kwrd">function</span> ()
{ UmbClientMgr.appActions().bindSaveShortCut(); }); <span class="kwrd">&lt;/</span><span class="html">script</span><span class="kwrd">&gt;</span><span class="kwrd">&lt;/</span><span class="html">asp:Content</span><span class="kwrd">&gt;</span></pre>
        <p>
So now we have a complete work around. Only thing is that this page will never be
called from the tree. So we need to have a custom tree.The class responsible for rendering
of Dictionary items tree  is the <strong>loadDictionary</strong> class. This
class contains the Method RenderJS that renders the Javascript function to open the
page. So we only need to override that method and point it to our new LanguageDictionary.aspx
file, I store the aspx file in the already existing DigibizDictionarySection folder
.
</p>
        <pre class="csharpcode">
          <span class="kwrd">public</span>
          <span class="kwrd">class</span> LanguageDictionaryTree
: loadDictionary { <span class="kwrd">public</span> LanguageDictionaryTree(<span class="kwrd">string</span> application)
: <span class="kwrd">base</span>(application) { } <span class="kwrd">public</span><span class="kwrd">override</span><span class="kwrd">void</span> RenderJS(<span class="kwrd">ref</span> StringBuilder
Javascript) { Javascript.Append( <span class="str">@" function openDictionaryItem(id)
{ UmbClientMgr.contentFrame('plugins/digibizdictionarysection/languagedictionary.aspx?id='
+ id); }"</span>); } }</pre>
        <style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
        <style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
        <p>
The last thing we need to update is the database table to use our new LanguageDictionaryTree 
instead of the loadDictionary class. The database table to update is UmbracoAppTree
, search for the row containing language as appAlias and update the treeHandlerAssembly
and treeHandlerType values.
</p>
        <p>
          <a href="http://www.richardsoeteman.net/content/binary/Windows-Live-Writer/5ed3cf28222b_A187/dbupdate_2.png">
            <img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="dbupdate" border="0" alt="dbupdate" src="http://www.richardsoeteman.net/content/binary/Windows-Live-Writer/5ed3cf28222b_A187/dbupdate_thumb.png" width="796" height="82" />
          </a>
        </p>
        <p>
Copy the aspx page to the /umbraco/plugins/DigibizDictionarySection  folder and
store the dll in the bin folder of your install. Then login as the editor again and
see that you can access Dictionary items outside of the settings section again.
</p>
        <p>
          <a href="http://www.richardsoeteman.net/content/binary/Windows-Live-Writer/5ed3cf28222b_A187/dictionaryfixed_2.png">
            <img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="dictionaryfixed" border="0" alt="dictionaryfixed" src="http://www.richardsoeteman.net/content/binary/Windows-Live-Writer/5ed3cf28222b_A187/dictionaryfixed_thumb.png" width="899" height="435" />
          </a>
        </p>
        <p>
Below you can find the links to the original package and the fix I’ve created. <a href="http://twitter.com/#!/j_breuer" target="_blank">Jeroen
Breuer</a> mentioned he will implement this fix later in his package.
</p>
        <ul>
          <li>
            <a href="http://our.umbraco.org/projects/backoffice-extensions/digibiz-dictionary-section" target="_blank">Digibiz
Dictionary Section</a>
          </li>
          <li>
            <a href="http://www.richardsoeteman.net/downloads/DictionaryFix.rar" target="_blank">Dictionary
section fix source code</a>
          </li>
        </ul>
        <img width="0" height="0" src="http://www.richardsoeteman.net/aggbug.ashx?id=88a69433-9288-4b19-a85d-42cd8faaca6a" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Run MediaProtect on MySql</title>
    <link rel="alternate" type="text/html" href="http://www.richardsoeteman.net/2011/09/06/RunMediaProtectOnMySql.aspx" />
    <id>http://www.richardsoeteman.net/PermaLink,guid,314dc9c3-44d2-4b36-919e-b95387116871.aspx</id>
    <published>2011-09-06T16:26:33.0690779+02:00</published>
    <updated>2011-09-06T16:26:33.0690779+02:00</updated>
    <category term="mediaprotect" label="mediaprotect" scheme="http://www.richardsoeteman.net/CategoryView,category,mediaprotect.aspx" />
    <category term="Package" label="Package" scheme="http://www.richardsoeteman.net/CategoryView,category,Package.aspx" />
    <category term="Umbraco" label="Umbraco" scheme="http://www.richardsoeteman.net/CategoryView,category,Umbraco.aspx" />
    <author>
      <name>Richard Soeteman</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
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. <a href="http://twitter.com/benjaminhowarth" target="_blank">Benjamin
Howarth</a> 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.
</p>
        <pre>
          <pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px">
            <a style="color: #0000ff" href="http://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=CREATE&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">CREATE</a>
            <a style="color: #0000ff" href="http://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=TABLE&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">TABLE</a> mediaprotectlog
( </pre>
          <pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px">LogId <a style="color: #0000ff" href="http://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=BIGINT&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">BIGINT</a>(20) <a style="color: #0000ff" href="http://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=NOT&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">NOT</a><a style="color: #0000ff" href="http://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=NULL&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">NULL</a> AUTO_INCREMENT, </pre>
          <pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px">MediaId <a style="color: #0000ff" href="http://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=INT&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">INT</a>(11) <a style="color: #0000ff" href="http://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=NOT&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">NOT</a><a style="color: #0000ff" href="http://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=NULL&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">NULL</a>, </pre>
          <pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px">Path <a style="color: #0000ff" href="http://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=VARCHAR&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">VARCHAR</a>(500) <a style="color: #0000ff" href="http://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=NOT&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">NOT</a><a style="color: #0000ff" href="http://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=NULL&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">NULL</a><a style="color: #0000ff" href="http://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=COLLATE&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">COLLATE</a> '<span style="color: #8b0000">utf8_general_ci</span>', </pre>
          <pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px">Protected <a style="color: #0000ff" href="http://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=BIT&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">BIT</a>(1) <a style="color: #0000ff" href="http://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=NOT&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">NOT</a><a style="color: #0000ff" href="http://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=NULL&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">NULL</a>, </pre>
          <pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px">UserName <a style="color: #0000ff" href="http://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=VARCHAR&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">VARCHAR</a>(150) <a style="color: #0000ff" href="http://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=NOT&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">NOT</a><a style="color: #0000ff" href="http://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=NULL&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">NULL</a><a style="color: #0000ff" href="http://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=COLLATE&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">COLLATE</a> '<span style="color: #8b0000">utf8_general_ci</span>', </pre>
          <pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px">UserIP <a style="color: #0000ff" href="http://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=VARCHAR&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">VARCHAR</a>(50) <a style="color: #0000ff" href="http://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=NOT&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">NOT</a><a style="color: #0000ff" href="http://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=NULL&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">NULL</a><a style="color: #0000ff" href="http://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=COLLATE&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">COLLATE</a> '<span style="color: #8b0000">utf8_general_ci</span>', </pre>
          <pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px">LogDateTime <a style="color: #0000ff" href="http://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=DATETIME&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">DATETIME</a><a style="color: #0000ff" href="http://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=NOT&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">NOT</a><a style="color: #0000ff" href="http://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=NULL&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">NULL</a>, <a style="color: #0000ff" href="http://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=PRIMARY&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">PRIMARY</a><a style="color: #0000ff" href="http://search.microsoft.com/default.asp?so=RECCNT&amp;siteid=us%2Fdev&amp;p=1&amp;nq=NEW&amp;qu=KEY&amp;IntlSearch=&amp;boolean=PHRASE&amp;ig=01&amp;i=09&amp;i=99">KEY</a> (LogId)
)</pre>
        </pre>
        <p>
Happy Installing!
</p>
        <img width="0" height="0" src="http://www.richardsoeteman.net/aggbug.ashx?id=314dc9c3-44d2-4b36-919e-b95387116871" />
      </div>
    </content>
  </entry>
  <entry>
    <title>CMSImport 2.0 released</title>
    <link rel="alternate" type="text/html" href="http://www.richardsoeteman.net/2011/06/24/CMSImport20Released.aspx" />
    <id>http://www.richardsoeteman.net/PermaLink,guid,2170849d-a961-49ed-8679-edcce7aa0919.aspx</id>
    <published>2011-06-24T12:08:03.835866+02:00</published>
    <updated>2011-06-24T12:12:10.960866+02:00</updated>
    <author>
      <name>Richard Soeteman</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
Today I’ve officially released <a href="http://www.cmsimport.com/" target="_blank">CMSImport
2.0</a>, 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):
</p>
        <ul>
          <li>
Access Database 
</li>
          <li>
BlogML 
</li>
          <li>
CSV 
</li>
          <li>
Excel File 
</li>
          <li>
RSS Feed 
</li>
          <li>
SQL Server 
</li>
          <li>
WordPress Export file 
</li>
          <li>
XML 
</li>
        </ul>
        <p>
Access database and the Excel file Data source requires you to install the <a href="http://www.microsoft.com/downloads/en/confirmation.aspx?familyId=7554f536-8c28-4598-9b72-ef94e038c891&amp;displayLang=en" target="_blank">Microsoft
Data Connectivity Components</a> 
</p>
        <h3>What’s new
</h3>
        <p>
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
</p>
        <p>
          <a href="http://www.richardsoeteman.net/content/binary/Windows-Live-Writer/CMSImport-2.0-released_B3DC/childdefinition_2.png">
            <img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="childdefinition" border="0" alt="childdefinition" src="http://www.richardsoeteman.net/content/binary/Windows-Live-Writer/CMSImport-2.0-released_B3DC/childdefinition_thumb.png" width="644" height="389" />
          </a>
        </p>
        <p>
Because CmsImport can import whole product catalogs it’s fully optimized to import
ProductCatalogs for the <a href="http://our.umbraco.org/projects/website-utilities/tea-commerce" target="_blank">Teacommerce</a> and <a href="http://our.umbraco.org/projects/website-utilities/uwebshop" target="_blank">Uwebshop</a> 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. 
</p>
        <p>
          <a href="http://www.richardsoeteman.net/content/binary/Windows-Live-Writer/CMSImport-2.0-released_B3DC/blogml_2.png">
            <img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="blogml" border="0" alt="blogml" src="http://www.richardsoeteman.net/content/binary/Windows-Live-Writer/CMSImport-2.0-released_B3DC/blogml_thumb.png" width="644" height="396" />
          </a>
        </p>
        <p>
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.
</p>
        <p>
          <a href="http://www.richardsoeteman.net/content/binary/Windows-Live-Writer/CMSImport-2.0-released_B3DC/advancerichtextmapping_2.png">
            <img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="advancerichtextmapping" border="0" alt="advancerichtextmapping" src="http://www.richardsoeteman.net/content/binary/Windows-Live-Writer/CMSImport-2.0-released_B3DC/advancerichtextmapping_thumb.png" width="459" height="484" />
          </a>
        </p>
        <p>
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.
</p>
        <p>
          <a href="http://www.richardsoeteman.net/content/binary/Windows-Live-Writer/CMSImport-2.0-released_B3DC/scheduledtasklog_2.png">
            <img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="scheduledtasklog" border="0" alt="scheduledtasklog" src="http://www.richardsoeteman.net/content/binary/Windows-Live-Writer/CMSImport-2.0-released_B3DC/scheduledtasklog_thumb.png" width="471" height="421" />
          </a>
        </p>
        <h3>Umbraco Deli
</h3>
        <p>
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:
</p>
        <ul>
          <li>
Single domain license 
</li>
          <li>
Server license 
</li>
          <li>
Unlimited license 
</li>
        </ul>
        <p>
For customers that already bought a CmsImport Pro license from my site. First of all
sorry for the manual order process <img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-winkingsmile" alt="Winking smile" src="http://www.richardsoeteman.net/content/binary/Windows-Live-Writer/CMSImport-2.0-released_B3DC/wlEmoticon-winkingsmile_2.png" /> Very
soon you will receive an email with a new license file that you can use for CmsImport
Pro 2.0. 
</p>
        <h3>Free edition
</h3>
        <p>
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 <a href="http://www.cmsimport.com/features.aspx" target="_blank">feature
comparison sheet</a> for all differences.
</p>
        <h3>Demo
</h3>
        <p>
Enough text, time for some video <img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://www.richardsoeteman.net/content/binary/Windows-Live-Writer/CMSImport-2.0-released_B3DC/wlEmoticon-smile_2.png" /></p>
        <iframe height="300" src="http://player.vimeo.com/video/25509629" frameborder="0" width="400">
        </iframe>
        <p>
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 <a href="http://our.umbraco.org/projects/developer-tools/cmsimport/" target="_blank">download
CMSImport from the Umbraco Deli</a>.
</p>
        <img width="0" height="0" src="http://www.richardsoeteman.net/aggbug.ashx?id=2170849d-a961-49ed-8679-edcce7aa0919" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Assign a template based on datasource value in CMSImport</title>
    <link rel="alternate" type="text/html" href="http://www.richardsoeteman.net/2011/04/29/AssignATemplateBasedOnDatasourceValueInCMSImport.aspx" />
    <id>http://www.richardsoeteman.net/PermaLink,guid,1a5e0de4-62b4-451f-ab84-7ba768395164.aspx</id>
    <published>2011-04-29T14:06:57.7097752+02:00</published>
    <updated>2011-04-29T14:09:59.3972752+02:00</updated>
    <category term="CMSImport" label="CMSImport" scheme="http://www.richardsoeteman.net/CategoryView,category,CMSImport.aspx" />
    <category term="Umbraco" label="Umbraco" scheme="http://www.richardsoeteman.net/CategoryView,category,Umbraco.aspx" />
    <author>
      <name>Richard Soeteman</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
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.
</p>
        <h3>Example
</h3>
        <p>
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.
</p>
        <p>
          <a href="http://www.richardsoeteman.net/content/binary/Windows-Live-Writer/Assign-a--template-using-the-event-syste_72FA/Data_2.png">
            <img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Example data" border="0" alt="Example data" src="http://www.richardsoeteman.net/content/binary/Windows-Live-Writer/Assign-a--template-using-the-event-syste_72FA/Data_thumb.png" width="585" height="314" />
          </a>
        </p>
        <p>
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 <a href="http://our.umbraco.org/wiki/reference/api-cheatsheet/using-applicationbase-to-register-events" target="_blank">ApplicationBase</a> 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 <strong>e.Items collection</strong>.
When the template column is not null, we get the template id from the database and
assign that value to the document.
</p>
        <div class="csharpcode">
          <pre>
            <span class="lnum"> 1: </span>
            <span class="kwrd">using</span> CMSImport.Extensions.Import;</pre>
          <pre>
            <span class="lnum"> 2: </span>
            <span class="kwrd">using</span> umbraco.BusinessLogic;</pre>
          <pre>
            <span class="lnum"> 3: </span>
            <span class="kwrd">using</span> umbraco.cms.businesslogic.template;</pre>
          <pre>
            <span class="lnum"> 4: </span>
            <span class="kwrd">using</span> umbraco.cms.businesslogic.web;</pre>
          <pre>
            <span class="lnum"> 5: </span> </pre>
          <pre>
            <span class="lnum"> 6: </span>
            <span class="kwrd">namespace</span> AssignTemplate</pre>
          <pre>
            <span class="lnum"> 7: </span>{</pre>
          <pre>
            <span class="lnum"> 8: </span>
            <span class="rem">/// &lt;summary&gt;</span>
          </pre>
          <pre>
            <span class="lnum"> 9: </span>
            <span class="rem">/// This class wil automatically
assign a template to the document when being imported for the first time using the
RecordImporting Event</span>
          </pre>
          <pre>
            <span class="lnum"> 10: </span>
            <span class="rem">/// If you want to use this
class in your own project simply rename e.Items["Template"] to the template
column you use</span>
          </pre>
          <pre>
            <span class="lnum"> 11: </span>
            <span class="rem">/// in your datasource</span>
          </pre>
          <pre>
            <span class="lnum"> 12: </span>
            <span class="rem">/// </span>
          </pre>
          <pre>
            <span class="lnum"> 13: </span>
            <span class="rem">/// This code will work in
both the Free and PRO edition of CMSImport and is written for version 1.2. </span>
          </pre>
          <pre>
            <span class="lnum"> 14: </span>
            <span class="rem">/// If you have any questions
please use the forum or email support@soetemansoftware.nl </span>
          </pre>
          <pre>
            <span class="lnum"> 15: </span>
            <span class="rem">/// &lt;/summary&gt;</span>
          </pre>
          <pre>
            <span class="lnum"> 16: </span>
            <span class="kwrd">public</span>
            <span class="kwrd">class</span> AssignTemplateUsingDatasource
: ApplicationBase</pre>
          <pre>
            <span class="lnum"> 17: </span> {</pre>
          <pre>
            <span class="lnum"> 18: </span>
            <span class="rem">/// &lt;summary&gt;</span>
          </pre>
          <pre>
            <span class="lnum"> 19: </span>
            <span class="rem">/// Initializes a new instance
of the &lt;see cref="AssignTemplateUsingDatasource"/&gt; class.</span>
          </pre>
          <pre>
            <span class="lnum"> 20: </span>
            <span class="rem">/// &lt;/summary&gt;</span>
          </pre>
          <pre>
            <span class="lnum"> 21: </span>
            <span class="kwrd">public</span> AssignTemplateUsingDatasource()</pre>
          <pre>
            <span class="lnum"> 22: </span> {</pre>
          <pre>
            <span class="lnum"> 23: </span>
            <span class="rem">//Whenever a records gets imported </span>
          </pre>
          <pre>
            <span class="lnum"> 24: </span> ContentImport.RecordImported += <span class="kwrd">new</span> ContentImport.RecordImportedEventHandler(ContentImport_RecordImported);</pre>
          <pre>
            <span class="lnum"> 25: </span> }</pre>
          <pre>
            <span class="lnum"> 26: </span> </pre>
          <pre>
            <span class="lnum"> 27: </span>
            <span class="rem">/// &lt;summary&gt;</span>
          </pre>
          <pre>
            <span class="lnum"> 28: </span>
            <span class="rem">/// When a record got imported
this event is raised.</span>
          </pre>
          <pre>
            <span class="lnum"> 29: </span>
            <span class="rem">/// &lt;/summary&gt;</span>
          </pre>
          <pre>
            <span class="lnum"> 30: </span>
            <span class="rem">/// &lt;param name="sender"&gt;The
imported document.&lt;/param&gt;</span>
          </pre>
          <pre>
            <span class="lnum"> 31: </span>
            <span class="rem">/// &lt;param name="e"&gt;The
&lt;see cref="CMSImport.Extensions.Import.RecordImportedEventArgs"/&gt;
instance containing the event data.&lt;/param&gt;</span>
          </pre>
          <pre>
            <span class="lnum"> 32: </span>
            <span class="kwrd">private</span>
            <span class="kwrd">void</span> ContentImport_RecordImported(<span class="kwrd">object</span> sender,
RecordImportedEventArgs e)</pre>
          <pre>
            <span class="lnum"> 33: </span> {</pre>
          <pre>
            <span class="lnum"> 34: </span>
            <span class="rem">//Only assign the value when
its imported for the first time</span>
          </pre>
          <pre>
            <span class="lnum"> 35: </span>
            <span class="kwrd">if</span> (e.ImportAction
== ImportActions.ImportAsNew)</pre>
          <pre>
            <span class="lnum"> 36: </span> {</pre>
          <pre>
            <span class="lnum"> 37: </span> Document doc = sender <span class="kwrd">as</span> Document;</pre>
          <pre>
            <span class="lnum"> 38: </span>
          </pre>
          <pre>
            <span class="lnum"> 39: </span>
            <span class="rem">//Get the template value from
the datasource. Datasource values are stored in the Items event arguments</span>
          </pre>
          <pre>
            <span class="lnum"> 40: </span>
            <span class="rem">//Replace templateName with
your column name in the datasource!!!</span>
          </pre>
          <pre>
            <span class="lnum"> 41: </span>
            <span class="kwrd">string</span> templateAlias
= e.Items[<span class="str">"templateName"</span>].ToString();</pre>
          <pre>
            <span class="lnum"> 42: </span> </pre>
          <pre>
            <span class="lnum"> 43: </span>
            <span class="kwrd">if</span> (doc != <span class="kwrd">null</span> &amp;&amp;
!<span class="kwrd">string</span>.IsNullOrEmpty(templateAlias))</pre>
          <pre>
            <span class="lnum"> 44: </span> {</pre>
          <pre>
            <span class="lnum"> 45: </span>
            <span class="rem">//An alias is specified, try
to get the template based on the specified alias </span>
          </pre>
          <pre>
            <span class="lnum"> 46: </span> Template template = Template.GetByAlias(templateAlias);</pre>
          <pre>
            <span class="lnum"> 47: </span>
            <span class="kwrd">if</span> (template.Id != <span class="kwrd">null</span>)</pre>
          <pre>
            <span class="lnum"> 48: </span> {</pre>
          <pre>
            <span class="lnum"> 49: </span>
            <span class="rem">//Template is found assign
it to the document</span>
          </pre>
          <pre>
            <span class="lnum"> 50: </span> doc.Template = template.Id;</pre>
          <pre>
            <span class="lnum"> 51: </span> }</pre>
          <pre>
            <span class="lnum"> 52: </span> }</pre>
          <pre>
            <span class="lnum"> 53: </span> }</pre>
          <pre>
            <span class="lnum"> 54: </span> }</pre>
          <pre>
            <span class="lnum"> 55: </span> }</pre>
          <pre>
            <span class="lnum"> 56: </span>}</pre>
        </div>
        <style type="text/css">


.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
        <p>
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.
</p>
        <p>
          <a href="http://www.richardsoeteman.net/content/binary/Windows-Live-Writer/Assign-a--template-using-the-event-syste_72FA/Pink%20template%20assigned_2.png">
            <img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Pink template assigned" border="0" alt="Pink template assigned" src="http://www.richardsoeteman.net/content/binary/Windows-Live-Writer/Assign-a--template-using-the-event-syste_72FA/Pink%20template%20assigned_thumb.png" width="569" height="461" />
          </a>
        </p>
        <h3>Why isn’t this supported in the UI?
</h3>
        <p>
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.
</p>
        <h3>Downloads
</h3>
        <p>
Below you can download the complete source code. Change <strong>e.Items[“templateName”]</strong> 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!
</p>
        <p>
          <a href="http://www.richardsoeteman.net/downloads/Assign_Template.zip" target="_blank">Download
the source code here</a>
        </p>
        <img width="0" height="0" src="http://www.richardsoeteman.net/aggbug.ashx?id=1a5e0de4-62b4-451f-ab84-7ba768395164" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Media protect 1.0</title>
    <link rel="alternate" type="text/html" href="http://www.richardsoeteman.net/2011/04/27/MediaProtect10.aspx" />
    <id>http://www.richardsoeteman.net/PermaLink,guid,a534faf2-60f8-4d72-af76-7c5088c67985.aspx</id>
    <published>2011-04-27T16:54:21.4562902+02:00</published>
    <updated>2011-04-27T16:58:03.5358365+02:00</updated>
    <category term="mediaprotect" label="mediaprotect" scheme="http://www.richardsoeteman.net/CategoryView,category,mediaprotect.aspx" />
    <category term="Package" label="Package" scheme="http://www.richardsoeteman.net/CategoryView,category,Package.aspx" />
    <category term="security" label="security" scheme="http://www.richardsoeteman.net/CategoryView,category,security.aspx" />
    <category term="Umbraco" label="Umbraco" scheme="http://www.richardsoeteman.net/CategoryView,category,Umbraco.aspx" />
    <author>
      <name>Richard Soeteman</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
Last month  I’ve released <a href="http://our.umbraco.org/projects/website-utilities/media-protect" target="_blank">Media
protect 1.0</a>. 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.
</p>
        <h4>
        </h4>
        <h3>
        </h3>
        <h3>The problem protecting media
</h3>
        <p>
No solution without a problem <img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-winkingsmile" alt="Winking smile" src="http://www.richardsoeteman.net/content/binary/Windows-Live-Writer/Released-Media-protect_5F0B/wlEmoticon-winkingsmile_2.png" />.
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. 
</p>
        <p>
This is also the case with upload fields on a protected content node. The page is
protected but the uploaded file is not protected.
</p>
        <h3>How Media protect solves this problem
</h3>
        <p>
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. 
</p>
        <p>
          <strong>Best of all you don’t need to modify any existing media or document type,
it just works!</strong>
        </p>
        <p>
The public access menu item  is the same menu item you get when you want to protect
a node in the content section.
</p>
        <p>
          <a href="http://www.richardsoeteman.net/content/binary/Windows-Live-Writer/Released-Media-protect_5F0B/publicaccess_2.png">
            <img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Public access" border="0" alt="Public access" src="http://www.richardsoeteman.net/content/binary/Windows-Live-Writer/Released-Media-protect_5F0B/publicaccess_thumb.png" width="335" height="285" />
          </a>
        </p>
        <p>
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. 
</p>
        <p>
          <a href="http://www.richardsoeteman.net/content/binary/Windows-Live-Writer/Released-Media-protect_5F0B/Dialog_2.png">
            <img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Dialog" border="0" alt="Dialog" src="http://www.richardsoeteman.net/content/binary/Windows-Live-Writer/Released-Media-protect_5F0B/Dialog_thumb.png" width="337" height="305" />
          </a>
        </p>
        <p>
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.
</p>
        <p>
          <a href="http://www.richardsoeteman.net/content/binary/Windows-Live-Writer/Released-Media-protect_5F0B/protectedmedia_2.png">
            <img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="protectedmedia" border="0" alt="protectedmedia" src="http://www.richardsoeteman.net/content/binary/Windows-Live-Writer/Released-Media-protect_5F0B/protectedmedia_thumb.png" width="637" height="377" />
          </a>
        </p>
        <h3>Compatible with Media Pickers and default asp.net Membership provider
</h3>
        <p>
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 <a href="http://ucomponents.codeplex.com/wikipage?title=MultiNodeTreePicker&amp;referringTitle=Documentation" target="_blank">Multi
Node Tree Picker</a> (The awesome picker from <a href="http://our.umbraco.org/projects/backoffice-extensions/ucomponents" target="_blank">UComponents</a>)
and the <a href="http://our.umbraco.org/projects/backoffice-extensions/digibiz-advanced-media-picker" target="_blank">DIgibiz
Advanced Media Picker</a>. 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.
</p>
        <p>
          <a href="http://www.richardsoeteman.net/content/binary/Windows-Live-Writer/Released-Media-protect_5F0B/DAMP_picker_2.png">
            <img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="DIgibiz Advanced Media Picker" border="0" alt="DIgibiz Advanced Media Picker" src="http://www.richardsoeteman.net/content/binary/Windows-Live-Writer/Released-Media-protect_5F0B/DAMP_picker_thumb.png" width="644" height="474" />
          </a>
        </p>
        <p>
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.
</p>
        <h3>Free alternatives
</h3>
        <p>
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
</p>
        <ul>
          <li>
 <a href="http://our.umbraco.org/projects/backoffice-extensions/usecurefiles" target="_blank">uSecureFiles</a></li>
          <li>
            <a href="http://our.umbraco.org/projects/developer-tools/protected-media" target="_blank">Protected
Media</a>
          </li>
        </ul>
        <h3>
        </h3>
        <h3>More info and Download
</h3>
        <p>
If you want more info about Media protect I suggest you check out the <a href="http://mediaprotect.soetemansoftware.nl/" target="_blank">product
site</a>. Here you find a video demonstrating the package and <a href="http://mediaprotect.soetemansoftware.nl/documentation.aspx" target="_blank">documentation</a>.
You can also download a <a href="http://our.umbraco.org/projects/website-utilities/media-protect" target="_blank">fully
functional free trial</a> from <a href="http://our.umbraco.org/" target="_blank">our.umbraco.org</a>.
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 <a href="http://mediaprotect.soetemansoftware.nl/purchase.aspx" target="_blank">buy
a license</a> for that domain or buy an enterprise license for your whole company. 
</p>
        <h3>
        </h3>
        <h3>Feedback
</h3>
Please tell me what you think about this package. Like it, hate it? I would love to
know. <img width="0" height="0" src="http://www.richardsoeteman.net/aggbug.ashx?id=a534faf2-60f8-4d72-af76-7c5088c67985" /></div>
    </content>
  </entry>
  <entry>
    <title>CMSImport 1.2 released and progress on 2.0</title>
    <link rel="alternate" type="text/html" href="http://www.richardsoeteman.net/2011/01/11/CMSImport12ReleasedAndProgressOn20.aspx" />
    <id>http://www.richardsoeteman.net/PermaLink,guid,ab9d8131-f1e1-4986-a814-edad0cab701a.aspx</id>
    <published>2011-01-11T14:31:15.5577082+01:00</published>
    <updated>2011-01-11T14:35:51.9639582+01:00</updated>
    <category term="CMSImport" label="CMSImport" scheme="http://www.richardsoeteman.net/CategoryView,category,CMSImport.aspx" />
    <category term="Umbraco" label="Umbraco" scheme="http://www.richardsoeteman.net/CategoryView,category,Umbraco.aspx" />
    <author>
      <name>Richard Soeteman</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
Last week I’ve released CMSImport 1.2 (Pro). This was a minor release mainly to fix
a few bugs 
</p>
        <p>
          <strong>Change log:</strong>
        </p>
        <ul>
          <li>
Fixed string delimiter for csv files 
</li>
          <li>
Field adaptors on default properties didn’t get hit 
</li>
          <li>
Throw error when login is null for member import, otherwise you can’t create new members
and Umbraco will throw errors on you. 
</li>
          <li>
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.</li>
          <li>
Tested against Umbraco 4.6 (beta)</li>
        </ul>
        <p>
Again this was a very small release. Mainly to fix some errors.
</p>
        <h3>CMSImport 2.0
</h3>
        <p>
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.
</p>
        <iframe height="300" src="http://player.vimeo.com/video/18661012" frameborder="0" width="400">
        </iframe>
        <p>
          <a href="http://vimeo.com/18661012">CMSImport 2.0 Structured import demo</a> from <a href="http://vimeo.com/user1486818">Richard
Soeteman</a> on <a href="http://vimeo.com">Vimeo</a>.
</p>
        <h4>Other new functionality for 2.0
</h4>
        <p>
Of course structured import will not be the only new feature. Below you find a list
of all other functionality that will be included
</p>
        <h4>
        </h4>
        <h5>Support for more Data sources
</h5>
        <p>
CMSImport 2.0 will support new data sources to import from such as:
</p>
        <ul>
          <li>
Rss</li>
          <li>
BlogMl</li>
          <li>
Wordpress export</li>
          <li>
Excel 
</li>
          <li>
MS Acces</li>
        </ul>
        <p>
If you have a specific product, or data format you want to import from please let
me know through the comment form.
</p>
        <h5>Configurable field adapters
</h5>
        <h3>
        </h3>
        <p>
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 <a href="http://ucomponents.codeplex.com/wikipage?title=UrlPicker" target="_blank">Ucomponents
Url picker</a> 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.
</p>
        <h5>Support for third party packages
</h5>
        <p>
CMSImport 2.0 will come with support for third party packages such as <a href="http://our.umbraco.org/projects/backoffice-extensions/ucomponents" target="_blank">UComponents</a>, <a href="http://our.umbraco.org/projects/website-utilities/supersimplewebshop" target="_blank">SuperSimpleWebshop</a>,<a href="http://our.umbraco.org/projects/website-utilities/tea-commerce" target="_blank">Teacommerce</a> and <a href="http://our.umbraco.org/projects/collaboration/blog-4-umbraco" target="_blank">Blog4Umbraco</a>.
</p>
        <h5>
          <font style="font-weight: normal">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.</font>
        </h5>
        <img width="0" height="0" src="http://www.richardsoeteman.net/aggbug.ashx?id=ab9d8131-f1e1-4986-a814-edad0cab701a" />
      </div>
    </content>
  </entry>
</feed>
