FAQ

Can I use DEWD to create tables and edit structures in my database?

No, you should use something like SQL Server Management Studio to do that.

What databases are supported?

Currently DEWD has only been tested with MySQL and Microsoft SQL Server 2000+, however it's definitely the goal to support the same databases as Umbraco does. At some point other data sources will be supported as well, such as objects (similiar to ObjectDataSource in ASP.NET).

Why not just store my data in the content tree using document types etc.?

Yup, in most cases that's the right thing to do, because you'll be able to rely on Umbraco for publishing, caching etc. However some times this isn't practical eg. when you have many thousands of items/rows or you need to aggregate data. In these situations DEWD may be useful for backend editing of the data.

Where are the frontend renderings/controls etc.?

No frontend stuff, sorry. DEWD is used solely for backend stuff, you'll have to do the data retrieval (although the API get help) and presentation yourself. Please note that the DEWD API isn't optimized for frontend usage, so keep an eye on your performance, if you choose to employ it for this purpose. A few examples on how you might retrieve data from the database in a user control:

Example: Direct access using umbraco datalayer
<%@ Control Language="C#" %>
<%@ Import Namespace="umbraco.DataLayer" %>

<script runat="server">
    protected override void OnInit(EventArgs e)
    {
        using (ISqlHelper sqlHelper = DataLayerHelper.CreateSqlHelper(umbraco.GlobalSettings.DbDSN))
        {
            Repeater.DataSource = sqlHelper.ExecuteReader("SELECT * FROM umbracoApp");
            Repeater.DataBind();            
        }
        
        base.OnInit(e);
    }
</script>

<asp:Repeater runat="server" ID="Repeater">
    <ItemTemplate>
        <%# Eval("appName")%><br />    
    </ItemTemplate>
</asp:Repeater>
Example: Using DEWD to get data for presentation
<%@ Control Language="C#" %>

<script runat="server">
    protected override void OnInit(EventArgs e)
    {
        var config = Eksponent.Dewd.Configuration.Current;
        Repeater.DataSource = config.GetRepository("/Umbraco hacking tools/Applications").Views[0].GetData();
        Repeater.DataBind();
        
        base.OnInit(e);
    }
</script>

<asp:Repeater runat="server" ID="Repeater">
    <ItemTemplate>
        <%# Eval("appName")%><br />    
    </ItemTemplate>
</asp:Repeater>

Why is all configuration done in an XML file? Why not a pretty configuration UI inside Umbraco?

Short answer: Laziness. Slightly longer answer: Because most of DEWD is pluggable, it would be quite hard to make a UI that non-developers would understand anyway. However it would be a really nice feature and we might look into it at some time... some time in this century .. probably :)

Why not use SQL Server Management Studio to edit my data?

Because Management Studio's a management tool for developers and db-admins, DEWD is an editing tool for non-tech people.

Can I change the name DEWD to something else in Umbraco?

Sure. The name is displayed in the section icon (bottom left corner) and in the tree on the left inside DEWD.

To change the icon: Make a new png/gif and overwrite the /umbraco/images/tray/dewd.png image.
To change the name displayed in the tree: Open /umbraco/config/lang/en.xml (or any other language file you use) and add the following element:
<key alias="dewd">Data editing</key>
... as a sub-element of language > area (alias="sections"). So something like:
<language alias="en" intName="English (uk)" localName="English" lcid="" culture="en-GB">
  ...
  <area alias="sections">
    ...
    <key alias="dewd">Data editing</key>
  </area>
</language>

Could DEWD be used as part of my own umbraco package?

Certainly. However it would be necessary to install DEWD along with your own package (or at least grab the file set). There are no dependencies as such between the left navigation tree and the view/editing going on in the right frame, so to get some data editing into your own module, simply grab the view url from the right frame and link to that from your own page (or left navigation tree).
To hide your own repositories/containers from the DEWD navigation tree, add the hidden="true" attribute to the repositories/containers in the configuration fille.

How about object editing?

As of v1.1 it's possible to edit objects using DEWD (but it's still an experimental feature and has some way to go before being easy to use). Basically you have to implement your own IEditor (inherit from Editor or ObjectEditor) and override the ExecuteSave, ExecuteDelete and GetRowValues methods to put in your own data get/set logic relevant for the type you want to edit. Please see ObjectEditingExample.zip associated with v1.1 for an example on how to do it.

Last edited Jun 28, 2010 at 10:31 PM by suneboeegh, version 17

Comments

No comments yet.