DEWD for Umbraco v2.0 preview

Rating: No reviews yet
Downloads: 55
Updated: Mar 13, 2013 by suneboeegh
Dev status: Planning Help Icon

Recommended Download

Application Eksponent.Dewd-2.0-preview-20130313.umb.zip
application, 90K, uploaded Mar 13, 2013 - 12 downloads

Other Available Downloads

Example XML for fluid configuration
example, 1K, uploaded Mar 11, 2013 - 11 downloads
Example More fluid example code
example, 8K, uploaded Mar 11, 2013 - 17 downloads
Example Example: File system editor in DEWD
example, 21K, uploaded Mar 13, 2013 - 15 downloads

Release Notes

Will contain fluid configuration support and ability to do dynamic containers and repositories + pile of new features (pile size has yet to be determined).

// Fluid configuration example
using System;
using Eksponent.Dewd.Configuration;
using Eksponent.Dewd.Configuration.Xml;
using Eksponent.Dewd.Controls.EditorControls;
using Eksponent.Dewd.Controls.View;
using Eksponent.Dewd.Controls.View.Columns;
using Eksponent.Dewd.Editors;
using Eksponent.Dewd.Extensions;
using Eksponent.Dewd.Fields;
using Eksponent.Dewd.Repositories.Table;

namespace Eksponent.Dewd.Test
{
    /// <summary>
    /// Test configuration. To use, the xml configuration must point to this type:
    /// <dewd xmlns="http://eksponent.com/dewd/1.2" type="Eksponent.Dewd.Test.FluidTestConfiguration,Eksponent.Dewd.Test" />
    /// </summary>
    public class FluidTestConfiguration : FluidConfiguration
    {
        public override void BuildContainerTree(IContainer root)
        {
            // Container type that allows editing entire sql database without configuration.
            root.Add(() => (new TableContainer() { Name = "SQL exploration" })
                .SetTableFilter(tableName => tableName.StartsWith("umb")));

            // Container with custom url and icon
            root.Add(() => new Container("Dashboard") { Url = "/umbraco/dashboard.aspx?app=content", Icon = "repository.gif" });

            // Editing Umbraco language table, similiar to example in xml configuration
            root.Add(() =>
                     (new TableRepository { Name = "Languages", PrimaryKeyName = "id" })
                         .SetEditor((new TableEditor { TableName = "umbracoLanguage" })
                            .AddField(new Field("Iso Code", "languageISOCode"))
                            .AddField(new Field("Culture Name", "languageCultureName"))
                            .AddBeforeSave((o, args) =>
                                {
                                    args.Result = new SaveResult {ErrorMessage = "No!"};
                                    args.Cancel = false; 
                                })
                         )
                         .AddView((new TableView { Name = "Default" })
                            .SetSql("SELECT id, [languageISOCode], [languageCultureName] FROM [umbracoLanguage]"))
                         .AddView((new TableView { Name = "Annoying view" })
                            .SetSql("SELECT id, [languageISOCode], [languageCultureName] FROM [umbracoLanguage] ORDER BY id DESC")
                            .InjectHtml("<script>alert('Most annoying view ever.');</script>")
                            )                            
                );
        }
    }
}           
Having repositories created dynamically like this, allows DEWD to connect to say a SQL database and edit data in the tables without any configuration before-hand, because fields etc. can be roughly extrapolated from the db schema on the fly. For the example above you need the following config in /config/Eksponent.Dewd.config:
<?xml version="1.0"?>
<dewd xmlns="http://eksponent.com/dewd/1.2" type="Eksponent.Dewd.Test.FluidTestConfiguration,Eksponent.Dewd.Test">
</dewd>
Change the type attribute to point to your own type/assembly.

It's gonna be pretty darn good, I think. And it will be done for CodeGarden 2013 (unless HQ plan to make major changes I'm not aware of) :)