Giter VIP home page Giter VIP logo

novius_metadata's Introduction

Metadata for Novius OS

Metadata is an application for Novius OS for adding metadata on models.

Requirements

  • The Metadata applications run on Novius OS Chiba 2 and upper.

Installation

Documentation

After you installed this application in your Novius OS, you will be able to define metadata classes and which models use these metadata. CRUD interface of these models will be automatically updated to add metadata selection.

Configuration of metadata classes

Extend the config file metadata_classes and define classes.

return array(
    'metadata_class_name' => array(
        // Use as field label
        'label' => __('Metadata class label'),

        // The model of the metadata class's nature
        'nature' => 'Model_Nature',

        // The field configuration used in the CRUD
        'field' => array(
            // By default, field uses the renderer Novius\Metadata\Renderer_Metadata
            'renderer_options' => array(
                // Specify if you want just one metadata for this class
                'single' => false, // True by default

                // If count of nature items is under this number, the renderer will be just a select
                'select_limit' => 50, // 50 by default

                // Translations for different labels in the renderer
                'i18n' => array(
                    'add' => __('Add items'),
                    'choose' => __('Choose an item'),
                    'remove' => __('Remove item'),
                    'edit' => __('Edit item'),
                ),
            ),
        ),
    ),

    'other_metadata_class_name' => array(
        'label' => __('Other Metadata class label'),

        // Nature can be an array with two keys: model and query
        'nature' => array(
            'model' => 'Model_Nature',

            // Additional query on the nature model
            'query' => array(
                'where' => array(
                //...
                ),
            ),
        ),

        'field' => array(
            // A specific renderer for this metadata class.
            // The field's name will be the concatenation of 'metadata_' and the class name
            'renderer' => 'Renderer_Metadata_Class',
            // The renderer_options array will automatically contain a key 'metadata_class'
            // The value of this key is the metadata class config array
            'renderer_options' => array(),
        ),
    ),
);

Behaviour Novius\Metadata\Behaviour_Hasmetadata

Metadata will be added on all models that implement this behaviour.

protected static $_behaviours = array(
    'Novius\Metadata\Behaviour_Hasmetadata' => array(
        // List of metadata classes that you want to exclude for this model
        //'exclude' => array(),

        // List of specific metadata classes. See above metadata classes' configuration.
        //'classes' => array(),
    ),
),

Relations added automatically:

  • metadata : has_many relation to Novius\Metadata\Model_Metadata.
  • metadata_class_name : many_many relation to the nature model of the metadata class.

License

Licensed under GNU Affero General Public License v3 or (at your option) any later version.

novius_metadata's People

Contributors

felixgilles avatar vrcalbert avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.