lib.xp.examples.schema.updateSite.js Maven / Gradle / Ivy
var schemaLib = require('/lib/xp/schema');
var assert = require('/lib/xp/testing');
/* global log*/
let resource = `
/person/*
_path:'/*/fisk'
/.*
type:'portal:fragment'
`;
// BEGIN
// Update virtual styles.
var result = schemaLib.updateSite({
application: 'myapp',
resource
});
log.info('Updated site: ' + result.application);
// END
assert.assertJsonEquals({
application: 'myapp',
resource: `\n \n \n \n \n \n \n \n \n \n \n /person/* \n \n \n _path:'/*/fisk' \n \n \n /.* \n type:'portal:fragment' \n \n \n `,
modifiedTime: '2021-09-25T10:00:00Z',
form: [
{
'formItemType': 'Input',
'name': 'some-name',
'label': 'Textline',
'customText': '',
'maximize': true,
'inputType': 'TextLine',
'occurrences': {
'maximum': 1,
'minimum': 0
},
'config': {}
}
],
xDataMappings: [
{
'name': 'myapp1:menu-item',
'optional': false,
'allowContentTypes': ''
},
{
'name': 'myapp2:my-meta-mixin',
'optional': false,
'allowContentTypes': ''
}
]
}, result);