@@ -286,6 +286,16 @@ var getTaxonomyStatus = function () {
286
286
return names;
287
287
};
288
288
289
+ var getTaxonomyCategoryStatus = function () {
290
+ var names = ['promoted', 'draft'];
291
+ return names;
292
+ };
293
+
294
+ var getCategoryPropertyNames = function () {
295
+ var names = ['keywords', 'synonyms', 'relatedCategories', 'customProperties'];
296
+ return names;
297
+ };
298
+
289
299
var getTaxonomyActions = function () {
290
300
const actions = ['promote', 'publish', 'unpublish'];
291
301
return actions;
@@ -628,6 +638,7 @@ const createTemplate = {
628
638
['cec create-template Temp1 -s Site1 -p', 'Create template Temp1 based on site Site1 on OCM server and include only the published assets'],
629
639
['cec create-template Temp1 -s Site1 -n', 'Create template Temp1 based on site Site1 on OCM server and include only the assets added to the site\'s pages'],
630
640
['cec create-template Temp1 -s Site1 -x', 'Create template Temp1 based on site Site1 on OCM server and exclude the content in the site'],
641
+ ['cec create-template Temp1 -s Site1 -x -t', 'Create template Temp1 based on site Site1 on OCM server and exclude both content and content types in the site'],
631
642
['cec create-template Temp1 -s Site1 -c', 'Create template Temp1 based on site Site1 on OCM server and exclude the components used in the site'],
632
643
['cec create-template Temp1 -s Site1 -d site:content', 'Create template Temp1 based on site Site1 on OCM server and exclude the content folder of the site'],
633
644
['cec create-template Temp1 -s Site1 -r SampleServer1', 'Create template Temp1 based on site Site1 on the registered server SampleServer1'],
@@ -1351,6 +1362,25 @@ const uploadTaxonomy = {
1351
1362
]
1352
1363
};
1353
1364
1365
+ const transferCategoryProperty = {
1366
+ command: 'transfer-category-property <name>',
1367
+ alias: 'tcp',
1368
+ name: 'transfer-category-property',
1369
+ usage: {
1370
+ 'short': 'Transfers category properties from one OCM server to another.',
1371
+ 'long': (function () {
1372
+ let desc = 'Transfers category properties of a taxonomy from one OCM server to another. Optionally specify the taxonomy id with -i <id> if another taxonomy has the same name. ';
1373
+ desc += os.EOL + 'The taxonomy on the two servers should be in sync before use this command. And only the following properties will be updated on the destination server' + os.EOL + os.EOL;
1374
+ desc = getCategoryPropertyNames().reduce((acc, item) => acc + ' ' + item + '\n', desc);
1375
+ return desc;
1376
+ })()
1377
+ },
1378
+ example: [
1379
+ ['cec transfer-category-property Taxonomy1 -s SampleServer -d SampleServer1', 'The promoted taxonomy categories will be transferred'],
1380
+ ['cec transfer-category-property Taxonomy1 -i 6A6DC736572C468B90F2A1C17B7CE5E4 -s SampleServer -d SampleServer']
1381
+ ]
1382
+ };
1383
+
1354
1384
const updateTaxonomy = {
1355
1385
command: 'update-taxonomy <name>',
1356
1386
alias: 'utx',
@@ -1717,7 +1747,7 @@ const controlSite = {
1717
1747
['cec control-site publish -s Site1 -i seo,rssFeeds ', 'Only publish Sitemap, Robots and RSS Feed files of site Site1'],
1718
1748
['cec control-site publish -s Site1 -a 100,200 ', 'Only publish page 100 and 200 of site Site1'],
1719
1749
['cec control-site publish -s Site1 -a 100 -b ', 'Only publish page 100 and its sub pages of site Site1'],
1720
- // ['cec control-site publish -s Site1 -l 150:GUID1,GUID2 ', 'Only publish assets GUID1 and GUID2 on detail page 150 of site Site1'],
1750
+ ['cec control-site publish -s Site1 -l 150:GUID1,GUID2 ', 'Only publish assets GUID1 and GUID2 on detail page 150 of site Site1'],
1721
1751
['cec control-site publish -s Site1 -r SampleServer1', 'Publish site Site1 on the registered server SampleServer1'],
1722
1752
['cec control-site unpublish -s Site1 -r SampleServer1', 'Unpublish site Site1 on the registered server SampleServer1'],
1723
1753
['cec control-site bring-online -s Site1 -r SampleServer1', 'Bring site Site1 online on the registered server SampleServer1'],
@@ -4492,6 +4522,7 @@ _usage = _usage + os.EOL + 'Recommendations' + os.EOL +
4492
4522
4493
4523
_usage = _usage + os.EOL + 'Taxonomies' + os.EOL +
4494
4524
_getCmdHelp(downloadTaxonomy) + os.EOL +
4525
+ _getCmdHelp(transferCategoryProperty) + os.EOL +
4495
4526
_getCmdHelp(uploadTaxonomy) + os.EOL +
4496
4527
_getCmdHelp(controlTaxonomy) + os.EOL +
4497
4528
_getCmdHelp(updateTaxonomy) + os.EOL +
@@ -4838,6 +4869,10 @@ const argv = yargs.usage(_usage)
4838
4869
alias: 'x',
4839
4870
description: 'Exclude content'
4840
4871
})
4872
+ .option('excludetype', {
4873
+ alias: 't',
4874
+ description: 'Exclude content types'
4875
+ })
4841
4876
.option('excludecomponents', {
4842
4877
alias: 'c',
4843
4878
description: 'Exclude components'
@@ -4854,6 +4889,11 @@ const argv = yargs.usage(_usage)
4854
4889
alias: 'r',
4855
4890
description: 'The registered OCM server'
4856
4891
})
4892
+ .option('sourcefiles', {
4893
+ alias: 'l',
4894
+ description: 'Attempt to download files from this source file location',
4895
+ hidden: true
4896
+ })
4857
4897
.check((argv) => {
4858
4898
if (argv.from && !getTemplateSources().includes(argv.from)) {
4859
4899
throw new Error(`${argv.from} is not a valid value for <source>`);
@@ -4874,6 +4914,7 @@ const argv = yargs.usage(_usage)
4874
4914
.example(...createTemplate.example[8])
4875
4915
.example(...createTemplate.example[9])
4876
4916
.example(...createTemplate.example[10])
4917
+ .example(...createTemplate.example[11])
4877
4918
.help(false)
4878
4919
.version(false)
4879
4920
.usage(`Usage: cec ${createTemplate.command}\n\n${createTemplate.usage.long}`);
@@ -6024,6 +6065,31 @@ const argv = yargs.usage(_usage)
6024
6065
.version(false)
6025
6066
.usage(`Usage: cec ${uploadTaxonomy.command}\n\n${uploadTaxonomy.usage.long}`);
6026
6067
})
6068
+ .command([transferCategoryProperty.command, transferCategoryProperty.alias], false,
6069
+ (yargs) => {
6070
+ yargs.option('server', {
6071
+ alias: 's',
6072
+ description: 'The registered OCM server the category properties are from',
6073
+ demandOption: true
6074
+ })
6075
+ .option('destination', {
6076
+ alias: 'd',
6077
+ description: 'The registered OCM server to transfer the category properties',
6078
+ demandOption: true
6079
+ })
6080
+ .option('id', {
6081
+ alias: 'i',
6082
+ description: 'Taxonomy Id'
6083
+ })
6084
+ .check((argv) => {
6085
+ return true;
6086
+ })
6087
+ .example(...transferCategoryProperty.example[0])
6088
+ .example(...transferCategoryProperty.example[1])
6089
+ .help(false)
6090
+ .version(false)
6091
+ .usage(`Usage: cec ${transferCategoryProperty.command}\n\n${transferCategoryProperty.usage.long}`);
6092
+ })
6027
6093
.command([controlTaxonomy.command, controlTaxonomy.alias], false,
6028
6094
(yargs) => {
6029
6095
yargs
@@ -6760,6 +6826,18 @@ const argv = yargs.usage(_usage)
6760
6826
if (argv.settingsfiles && typeof argv.settingsfiles === 'boolean') {
6761
6827
throw new Error(os.EOL + 'Please specify valid site settings files');
6762
6828
}
6829
+ if (argv.pages && typeof argv.pages === 'boolean') {
6830
+ throw new Error(os.EOL + 'Please specify valid site pages');
6831
+ }
6832
+ if (argv.detailpageassets && typeof argv.detailpageassets === 'boolean') {
6833
+ throw new Error(os.EOL + 'Please specify valid detail page and assets');
6834
+ }
6835
+ if (argv.detailpageassets) {
6836
+ let parts = argv.detailpageassets.toString().split(':');
6837
+ if (parts.length !== 2) {
6838
+ throw new Error(os.EOL + 'Please specify valid detail page and assets in format of <pageid>:<GUID1>,<GUID2>');
6839
+ }
6840
+ }
6763
6841
if (argv.settingsfiles && argv.action !== 'publish' && argv.action !== 'publish-internal') {
6764
6842
throw new Error(os.EOL + '<settingsfiles> is only for action publish');
6765
6843
}
@@ -6769,6 +6847,9 @@ const argv = yargs.usage(_usage)
6769
6847
if (argv.detailpageassets && argv.action !== 'publish' && argv.action !== 'publish-internal') {
6770
6848
throw new Error(os.EOL + '<detailpageassets> is only for action publish');
6771
6849
}
6850
+ if (argv.staticincremental && !argv.staticonly) {
6851
+ throw new Error(os.EOL + '<staticincremental> is only available if <staticonly> also specified');
6852
+ }
6772
6853
if (argv.settingsfiles) {
6773
6854
let files = argv.settingsfiles.split(',');
6774
6855
for (let i = 0; i < files.length; i++) {
@@ -6797,6 +6878,10 @@ const argv = yargs.usage(_usage)
6797
6878
alias: 't',
6798
6879
description: 'Only publish site static files'
6799
6880
})
6881
+ .option('staticincremental', {
6882
+ alias: 'm',
6883
+ description: 'Add to the already published static files'
6884
+ })
6800
6885
.option('compileonly', {
6801
6886
alias: 'p',
6802
6887
description: 'Only compile and publish the static files without publishing the site'
@@ -6823,8 +6908,7 @@ const argv = yargs.usage(_usage)
6823
6908
})
6824
6909
.option('detailpageassets', {
6825
6910
alias: 'l',
6826
- description: 'The detail page ID and their asset IDs',
6827
- hidden: true
6911
+ description: 'The detail page ID and their asset IDs'
6828
6912
})
6829
6913
.option('theme', {
6830
6914
alias: 'e',
@@ -6844,7 +6928,7 @@ const argv = yargs.usage(_usage)
6844
6928
})
6845
6929
.option('server', {
6846
6930
alias: 'r',
6847
- description: '<server> The registered OCM server'
6931
+ description: 'The registered OCM server'
6848
6932
})
6849
6933
.example(...controlSite.example[0])
6850
6934
.example(...controlSite.example[1])
@@ -6863,6 +6947,7 @@ const argv = yargs.usage(_usage)
6863
6947
.example(...controlSite.example[14])
6864
6948
.example(...controlSite.example[15])
6865
6949
.example(...controlSite.example[16])
6950
+ .example(...controlSite.example[17])
6866
6951
.help(false)
6867
6952
.version(false)
6868
6953
.usage(`Usage: cec ${controlSite.command}\n\n${controlSite.usage.long}`);
@@ -10449,11 +10534,12 @@ if (fs.existsSync(path.join(appRoot, 'package.json'))) {
10449
10534
10450
10535
// Display command and its params
10451
10536
// console.log(argv);
10452
- var _displayCommand = function (cmdName) {
10537
+ var _displayCommand = function (cmdName, obscureParams ) {
10453
10538
var cmdStr = 'cec ' + (cmdName || argv._[0]);
10454
10539
var paramStr = '';
10455
10540
var requiredParamStr = '';
10456
10541
var found0 = false;
10542
+ var toObscure = obscureParams || [];
10457
10543
Object.keys(argv).forEach(function (name) {
10458
10544
if (name === '$0') {
10459
10545
found0 = true;
@@ -10470,6 +10556,9 @@ var _displayCommand = function (cmdName) {
10470
10556
// ignore
10471
10557
}
10472
10558
}
10559
+ if (toObscure.includes(name)) {
10560
+ value = 'xxxxxx';
10561
+ }
10473
10562
if (!found0) {
10474
10563
paramStr = paramStr + ' ' + '--' + name + ' ' + value;
10475
10564
} else {
@@ -10781,6 +10870,9 @@ if (argv._[0] === createComponent.name || argv._[0] == createComponent.alias) {
10781
10870
if (argv.excludecontent) {
10782
10871
createTemplateArgs.push(...['--excludecontent', argv.excludecontent]);
10783
10872
}
10873
+ if (argv.excludetype) {
10874
+ createTemplateArgs.push(...['--excludetype', argv.excludetype]);
10875
+ }
10784
10876
if (argv.excludecomponents) {
10785
10877
createTemplateArgs.push(...['--excludecomponents', argv.excludecomponents]);
10786
10878
}
@@ -10793,6 +10885,9 @@ if (argv._[0] === createComponent.name || argv._[0] == createComponent.alias) {
10793
10885
if (argv.server && typeof argv.server !== 'boolean') {
10794
10886
createTemplateArgs.push(...['--server', argv.server]);
10795
10887
}
10888
+ if (argv.sourcefiles) {
10889
+ createTemplateArgs.push(...['--sourcefiles', argv.sourcefiles]);
10890
+ }
10796
10891
createTemplateArgs.push(...['--name', argv.name]);
10797
10892
spawnCmd = childProcess.spawnSync(npmCmd, createTemplateArgs, {
10798
10893
cwd,
@@ -11634,6 +11729,23 @@ if (argv._[0] === createComponent.name || argv._[0] == createComponent.alias) {
11634
11729
stdio: 'inherit'
11635
11730
});
11636
11731
11732
+ } else if (argv._[0] === transferCategoryProperty.name || argv._[0] === transferCategoryProperty.alias) {
11733
+ _displayCommand(transferCategoryProperty.name);
11734
+ let transferCategoryPropertiesArgs = ['run', '-s', transferCategoryProperty.name, '--prefix', appRoot,
11735
+ '--',
11736
+ '--projectDir', cwd,
11737
+ '--name', argv.name,
11738
+ '--server', argv.server,
11739
+ '--destination', argv.destination
11740
+ ];
11741
+ if (argv.id) {
11742
+ transferCategoryPropertiesArgs.push(...['--id', argv.id]);
11743
+ }
11744
+ spawnCmd = childProcess.spawnSync(npmCmd, transferCategoryPropertiesArgs, {
11745
+ cwd,
11746
+ stdio: 'inherit'
11747
+ });
11748
+
11637
11749
} else if (argv._[0] === controlTaxonomy.name || argv._[0] === controlTaxonomy.alias) {
11638
11750
_displayCommand(controlTaxonomy.name);
11639
11751
let controlTaxonomyArgs = ['run', '-s', controlTaxonomy.name, '--prefix', appRoot,
@@ -12329,6 +12441,9 @@ if (argv._[0] === createComponent.name || argv._[0] == createComponent.alias) {
12329
12441
if (argv.staticonly) {
12330
12442
controlSiteArgs.push(...['--staticonly', argv.staticonly]);
12331
12443
}
12444
+ if (argv.staticincremental) {
12445
+ controlSiteArgs.push(...['--staticincremental', argv.staticincremental]);
12446
+ }
12332
12447
if (argv.compileonly) {
12333
12448
controlSiteArgs.push(...['--compileonly', argv.compileonly]);
12334
12449
}
@@ -14534,7 +14649,7 @@ else if (argv._[0] === uploadType.name || argv._[0] === uploadType.alias) {
14534
14649
});
14535
14650
14536
14651
} else if (argv._[0] === registerServer.name || argv._[0] === registerServer.alias) {
14537
- _displayCommand(registerServer.name);
14652
+ _displayCommand(registerServer.name, ['password'] );
14538
14653
let registerServerArgs = ['run', '-s', registerServer.name, '--prefix', appRoot,
14539
14654
'--',
14540
14655
'--projectDir', cwd,
@@ -14935,8 +15050,10 @@ if (!process.shim) {
14935
15050
console.log('Elapsed time: ' + seconds + 's');
14936
15051
14937
15052
// see if need to show deprecation warning
14938
- _checkVersion();
14939
-
15053
+ let runCheckVersion = process.env.CEC_LCM_DOCKER === undefined || process.env.CEC_LCM_DOCKER !== 'true';
15054
+ if (runCheckVersion) {
15055
+ _checkVersion();
15056
+ }
14940
15057
14941
15058
// console.log(spawnCmd);
14942
15059
process.exit(spawnCmd ? spawnCmd.status : 0);
0 commit comments