Open Source Content Management System

MidCOM 2.5 Datamanager Rewrite Example Schema

  1. Simple Example
  2. More complex example
  3. Original Idea (Deprecated)

This is a MidCOM 2.5 Development Technical Note covering the Datamanger Rewrite. Everything written here is subject to change without notice.

This is a quick example, how a datamanager schema can look like. It is neither complete nor documented in this page, it is just intended for a quick view. Also the latest changes and adaptions to the schema are not neccessarily taken into account in this example.

If you want to know details, check the schema definition.

Simple Example

'example' => Array
(
    'description' => 'Schema title',
    'fields' => Array
    (
        'name' => Array
        (
            'title' => 'name',
            'description' => 'This is the articles URL Name',
            'helptext' => 'Some Helptext',

            'storage' => 'name',
            'type' => 'text',
            'widget' => 'text',
        ),
        'title' => Array
        (
            'title' => 'title',
            'description' => 'This is the articles Title',
            'helptext' => 'Some Helptext',

            'storage' => 'title',
            'type' => 'text',
            'widget' => 'text',
        ),
        'abstract' => Array
        (
            'title' => 'abstract',
            'description' => 'This is the articles abstract',
            'helptext' => 'Some Helptext',

            'storage' => 'abstract',
            'type' => 'text',
            'widget' => 'text',
        ),
    ),
),

More complex example

'example' => Array
(
    'description' => 'Schema title',
    'l10n_db' => 'de.linkm.taviewer',
    'fields' => Array
    (
        'name' => Array
        (
            'title' => 'name',
            'description' => 'This is the articles URL Name',
            'helptext' => 'Some Helptext',

            'storage' => 'name',
            'type' => 'text',
            'widget' => 'text',
        ),
        'title' => Array
        (
            'title' => 'title',
            'description' => 'This is the articles Title',
            'helptext' => 'Some Helptext',

            'storage' => 'title',
            'type' => 'text',
            'type_config' => Array
            (
                'maxlength' => 50,
            ),
            'widget' => 'text',
        ),
        'abstract' => Array
        (
            'title' => 'abstract',
            'description' => 'This is the articles abstract',
            'helptext' => 'Some Helptext',

            'storage' => 'abstract',
            'type' => 'select',
            'type_config' => Array
            (
                'options' => Array 
                (
                    'abstract' => 'The Abstract', 
                    'abstract1' => 'The Abstract 1', 
                    'abstract2' => 'The Abstract 2', 
                    'abstract3' => 'The Abstract 3'
                ),
                'allow_multiple' => false,
                'allow_other' => true,
            ),
            'widget' => 'select',
        ),
        'paramtest' => Array
        (
            'title' => 'paramtest',
            'description' => 'This is the articles abstract',
            'helptext' => 'Some Helptext',

            'storage' => 'parameter',
            'type' => 'number',
            'type_config' => Array
            (
                'precision' => 2,
                'minimum' => -10,
                'maximum' => +10,
            ),
            'widget' => 'text',
        ),
        'revised' => Array
        (
            'title' => 'revised',
            'description' => 'This is the articles revised',
            'helptext' => 'Some Helptext',

            'storage' => 'revised',
            'type' => 'date',
            'type_config' => Array
            (
                'storage_type' => 'UNIXTIME',
            ),
            'widget' => 'simpledate',
            'widget_config' => Array
            (
                'format' => 'dmYHis',
                'minyear' => 1900,
                'maxyear' => 2010,
            ),
        ),
        'iso' => Array
        (
            'title' => 'iso',
            'description' => 'This is the articles revised',
            'helptext' => 'Some Helptext',

            'storage' => 'parameter',
            'type' => 'date',
            'type_config' => Array
            (
                'storage_type' => 'ISO',
            ),
            'widget' => 'simpledate',
            'widget_config' => Array
            (
                'format' => 'dmYHis',
                'minyear' => 1900,
                'maxyear' => 2010,
            ),
        ),
        'isots' => Array
        (
            'title' => 'isots',
            'description' => 'This is the articles revised',
            'helptext' => 'Some Helptext',

            'storage' => 'parameter',
            'type' => 'date',
            'type_config' => Array
            (
                'storage_type' => 'ISO_EXTENDED_MICROTIME',
            ),
            'widget' => 'simpledate',
            'widget_config' => Array
            (
                'format' => 'dmYHis',
                'minyear' => 1900,
                'maxyear' => 2010,
            ),
        ),
    ),
),

Original Idea (Deprecated)

"schema name" => Array 
(
// schema metadata
"description" => "Some schema title",

// fields
"fields" => Array 
(
    "title" => Array
    (
        // Field Metadata:

        // Heading
        "title" => "Field title",
        // Text below heading
        "description" => "Field description",
        // Possibly available through some kind of popup
        "helptext" => "Field Helptext",

        // Indication wether this field is required during input 
        // (is this a simple form of validation?)
        "required" => false,
        // validation rules (2BD)
        "validation" => Array (...),

        // Storage config
        "storage" => Array
        (
            // $membername, "parameter" or "config"
            "location" => "title",
            // only for config storage
            "config_domain" => "de.linkm.taviewer",
            // only for config storage
            "config_name" => "title",
        ),

        // type config
        "type" => "text",
        "typeconfig" => Array
        (
            // This is type dependant
            "maxlength" => 60,
        ),

        // widget config
        "widget" => "text",
        "widgetconfig" => Array
        (
            // This is type dependant
            "mode" => "oneline",
        ),
    ),
),
),
Designed by Nemein, hosted by Anykey