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

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

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

/* global log*/

let resource = `
                
                  Virtual Layout
                  My Layout Description
                  
false false false false false false false
`; // BEGIN // Update virtual layout. var result = schemaLib.updateComponent({ key: 'myapp:mylayout', type: 'LAYOUT', resource }); log.info('Updated layout: ' + result.key); // END assert.assertJsonEquals({ key: 'myapp:mylayout', displayName: 'Virtual Layout', displayNameI18nKey: 'key.display-name', description: 'My Layout Description', descriptionI18nKey: 'key.description', componentPath: 'myapp:/site/layouts/mylayout', modifiedTime: '2021-09-25T10:00:00Z', resource: '\n' + ' \n' + ' Virtual Layout\n' + ' My Layout Description\n' + '
\n \n' + ' \n' + ' false\n' + ' false\n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' false\n' + ' \n' + ' \n' + ' \n' + ' \n' + ' false\n' + ' false\n' + ' \n' + ' \n' + ' \n' + ' \n' + ' false\n' + ' false\n' + ' \n' + ' \n' + ' \n \n' + ' \n \n' + ' \n' + ' \n' + ' \n' + ' \n' + '
\n' + ' ', type: 'LAYOUT', form: [ { 'formItemType': 'Input', 'name': 'pause', 'label': 'Pause parameter', 'helpText': 'key1.help-text', 'maximize': true, 'inputType': 'Double', 'occurrences': { 'maximum': 1, 'minimum': 0 }, 'config': {} }, { 'formItemType': 'ItemSet', 'name': 'myFormItemSet', 'label': 'My form item set', 'occurrences': { 'maximum': 1, 'minimum': 0 }, 'items': [ { 'formItemType': 'Input', 'name': 'myTextLine', 'label': 'My text line', 'maximize': true, 'inputType': 'TextLine', 'occurrences': { 'maximum': 1, 'minimum': 1 }, 'config': {} }, { 'formItemType': 'Input', 'name': 'myCustomInput', 'label': 'My custom input', 'maximize': true, 'inputType': 'TextLine', 'occurrences': { 'maximum': 1, 'minimum': 0 }, 'config': {} } ] } ], config: {}, regions: [ 'header', 'main', 'footer' ] }, result);




© 2015 - 2024 Weber Informatics LLC | Privacy Policy