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

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

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

/* global log*/

// BEGIN
// Fetch virtual part.
var result = schemaLib.getComponent({
    key: 'myapp:mylayout',
    type: 'LAYOUT'
});

log.info('Fetched layout: ' + result.key);

// END


assert.assertJsonEquals({
    key: 'myapp:mylayout',
    displayName: 'News layout',
    description: 'My news layout',
    descriptionI18nKey: 'key.description',
    componentPath: 'myapp:/site/layouts/mylayout',
    modifiedTime: '2021-02-25T10:44:33.170079900Z',
    resource: '',
    type: 'LAYOUT',
    form: [
        {
            'formItemType': 'Input',
            'name': 'width',
            'label': 'width',
            'maximize': true,
            'inputType': 'Double',
            'occurrences': {
                'maximum': 1,
                'minimum': 0
            },
            'config': {}
        }
    ],
    config: {},
    regions: [
        'region-one'
    ]
}, result);





© 2015 - 2024 Weber Informatics LLC | Privacy Policy