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

lib.xp.examples.schema.getPart.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:mypart',
    type: 'PART'
});

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

// END


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





© 2015 - 2024 Weber Informatics LLC | Privacy Policy