All Downloads are FREE. Search and download functionalities are using the official Maven repository.

lib.xp.examples.schema.getMixin.js Maven / Gradle / Ivy

var schemaLib = require('/lib/xp/schema');
var assert = require('/lib/xp/testing');

/* global log*/

// BEGIN
// Fetch virtual mixin type.
var result = schemaLib.getSchema({
    name: 'myapp:mymixin',
    type: 'MIXIN'
});

log.info('Fetched mixin: ' + result.name);

// END


assert.assertJsonEquals({
    name: 'myapp:mymixin',
    displayName: 'My mixin display name',
    description: 'My mixin description',
    createdTime: '2009-01-01T10:00:00Z',
    creator: 'user:system:anonymous',
    modifiedTime: '2010-01-01T10:00:00Z',
    resource: '',
    type: 'MIXIN',
    form: [
        {
            'formItemType': 'Input',
            'name': 'inputToBeMixedIn',
            'label': 'Mixed in',
            'maximize': true,
            'inputType': 'TextLine',
            'occurrences': {
                'maximum': 1,
                'minimum': 0
            },
            'config': {}
        }
    ]
}, result);





© 2015 - 2024 Weber Informatics LLC | Privacy Policy