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

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

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

/* global log*/

let resource = `
                
                  Virtual Part
                  My Part Description
                  
false false falsefalse
`; // BEGIN // Create virtual part. var result = schemaLib.createComponent({ key: 'myapp:mypart', type: 'PART', resource }); log.info('Created part: ' + result.key); // END assert.assertJsonEquals({ key: 'myapp:mypart', displayName: 'Virtual Part', displayNameI18nKey: 'key.display-name', description: 'My Part Description', descriptionI18nKey: 'key.description', componentPath: 'myapp:/site/parts/mypart', modifiedTime: '2021-09-25T10:00:00Z', resource: '\n \n Virtual Part\n My Part Description\n
\n \n \n false\n false\n \n \n \n \n \n \n \n \n falsefalse\n \n
\n ', type: 'PART', form: [ { 'formItemType': 'Input', 'name': 'width', 'label': 'Column width', 'helpText': 'key.help-text', 'maximize': true, 'inputType': 'Double', 'occurrences': { 'maximum': 1, 'minimum': 0 }, 'config': {} }, { 'formItemType': 'InlineMixin', 'name': 'myapplication:link-urls' } ], config: { 'input': [{ 'value': '', '@name': 'width', '@type': 'Double' }] } }, result);




© 2015 - 2024 Weber Informatics LLC | Privacy Policy