Skip to content

Commit 7fc7bb5

Browse files
committed
Updated to 23.7.2.
1 parent a4feb94 commit 7fc7bb5

14 files changed

+837
-206
lines changed

README.md

+14
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,20 @@ Templates and resources for development platforms.
1515
[react-starter-sites](react-starter-sites/) – A quick way to get started with React site development.
1616

1717

18+
# New in Release 23.7.2
19+
20+
**Added**
21+
- `cec describe-category` - Lists the properties of a taxonomy's category on OCM server
22+
23+
**Updated**
24+
- `cec set-site-security` - Now supports groups when setting access to a site
25+
- `cec describe-taxonomy` - Now includes custom property types
26+
- `cec describe-site` - Now includes the number of items from other repositories
27+
28+
**Fixed**
29+
- `cec transfer-category-property` - Now handles custom property type display name changed after creation on the source server
30+
31+
1832
# New in Release 23.7.1
1933

2034
**Added**

sites/bin/cec/cec.js

+85-4
Original file line numberDiff line numberDiff line change
@@ -1427,7 +1427,7 @@ const describeTaxonomy = {
14271427
usage: {
14281428
'short': 'Lists the properties of a taxonomy on OCM server.',
14291429
'long': (function () {
1430-
let desc = 'Lists the properties of a taxonomy on OCM server. Optionally specify the taxonomy id with -i <id> if another taxonomy has the same name. Optionally specify -f <file> to save the properties to a JSON file. Specify the server with -s <server> or use the one specified in cec.properties file. ';
1430+
let desc = 'Lists the properties of a taxonomy on OCM server. Specify the taxonomy with -t <taxonomy>. Optionally specify the taxonomy id with -i <id> if another taxonomy has the same name. Optionally specify -f <file> to save the properties to a JSON file. Specify the server with -s <server> or use the one specified in cec.properties file. ';
14311431
return desc;
14321432
})()
14331433
},
@@ -1438,6 +1438,24 @@ const describeTaxonomy = {
14381438
]
14391439
};
14401440

1441+
const describeCategory = {
1442+
command: 'describe-category <apiname>',
1443+
alias: 'dsct',
1444+
name: 'describe-category',
1445+
usage: {
1446+
'short': 'Lists the properties of a taxonomy\'s category on OCM server.',
1447+
'long': (function () {
1448+
let desc = 'Lists the properties of a taxonomy\'s category on OCM server. Optionally specify -f <file> to save the properties to a JSON file. Specify the server with -s <server> or use the one specified in cec.properties file. ';
1449+
return desc;
1450+
})()
1451+
},
1452+
example: [
1453+
['cec describe-category ta1-c -t Taxonomy1 -s SampleServer1'],
1454+
['cec describe-category ta1-c -t Taxonomy1 -i 6A6DC736572C468B90F2A1C17B7CE5E4 -s SampleServer1'],
1455+
['cec describe-category ta1-c -t Taxonomy1 -f ~/Docs/Taxonomy1.json -s SampleServer1']
1456+
]
1457+
};
1458+
14411459
const shareTaxonomy = {
14421460
command: 'share-taxonomy <name>',
14431461
alias: 'stx',
@@ -1955,8 +1973,8 @@ const setSiteSecurity = {
19551973
['cec set-site-security Site1 -s no -r SampleServer1', 'make the site publicly available to anyone on server SampleServer1'],
19561974
['cec set-site-security Site1 -s yes', 'Require everyone to sign in to access this site and any authenticated user can access'],
19571975
['cec set-site-security Site1 -s yes -a "Visitors,Service users"', 'Require everyone to sign in to access this site and all service visitors and users can access'],
1958-
['cec set-site-security Site1 -s yes -a "Specific users" -u user1,user2', 'Require everyone to sign in to access this site and only user1 and user2 can access'],
1959-
['cec set-site-security Site1 -s yes -d user1', 'Remove user1\'s access from the site']
1976+
['cec set-site-security Site1 -s yes -a "Specific users" -u user1,user2, -g group1,group2', 'Require everyone to sign in to access this site and only user1, user2, group1 and group2 can access'],
1977+
['cec set-site-security Site1 -s yes -d user1 -o group1', 'Remove the access of user1 and group1 from the site']
19601978
]
19611979
};
19621980

@@ -4527,6 +4545,7 @@ _usage = _usage + os.EOL + 'Taxonomies' + os.EOL +
45274545
_getCmdHelp(controlTaxonomy) + os.EOL +
45284546
_getCmdHelp(updateTaxonomy) + os.EOL +
45294547
_getCmdHelp(describeTaxonomy) + os.EOL +
4548+
_getCmdHelp(describeCategory) + os.EOL +
45304549
_getCmdHelp(shareTaxonomy) + os.EOL +
45314550
_getCmdHelp(unshareTaxonomy) + os.EOL;
45324551

@@ -6185,6 +6204,32 @@ const argv = yargs.usage(_usage)
61856204
.version(false)
61866205
.usage(`Usage: cec ${describeTaxonomy.command}\n\n${describeTaxonomy.usage.long}`);
61876206
})
6207+
.command([describeCategory.command, describeCategory.alias], false,
6208+
(yargs) => {
6209+
yargs.option('taxonomy', {
6210+
alias: 't',
6211+
description: 'Taxonomy name',
6212+
demandOption: true
6213+
})
6214+
.option('id', {
6215+
alias: 'i',
6216+
description: 'Taxonomy Id'
6217+
})
6218+
.option('file', {
6219+
alias: 'f',
6220+
description: 'The JSON file to save the properties'
6221+
})
6222+
.option('server', {
6223+
alias: 's',
6224+
description: 'The registered OCM server'
6225+
})
6226+
.example(...describeCategory.example[0])
6227+
.example(...describeCategory.example[1])
6228+
.example(...describeCategory.example[2])
6229+
.help(false)
6230+
.version(false)
6231+
.usage(`Usage: cec ${describeCategory.command}\n\n${describeCategory.usage.long}`);
6232+
})
61886233
.command([shareTaxonomy.command, shareTaxonomy.alias], false,
61896234
(yargs) => {
61906235
yargs.option('users', {
@@ -7101,13 +7146,21 @@ const argv = yargs.usage(_usage)
71017146
alias: 'u',
71027147
description: 'The comma separated list of users to access the site'
71037148
})
7149+
.option('addgroups', {
7150+
alias: 'g',
7151+
description: 'The comma separated list of groups to access the site'
7152+
})
71047153
.option('deleteusers', {
71057154
alias: 'd',
71067155
description: 'The comma separated list of users to remove access from the site'
71077156
})
7157+
.option('deletegroups', {
7158+
alias: 'o',
7159+
description: 'The comma separated list of groups to remove access from the site'
7160+
})
71087161
.option('server', {
71097162
alias: 'r',
7110-
description: '<server> The registered OCM server'
7163+
description: 'The registered OCM server'
71117164
})
71127165
.check((argv) => {
71137166
if (argv.signin && !getSiteSignIn().includes(argv.signin)) {
@@ -11815,6 +11868,28 @@ if (argv._[0] === createComponent.name || argv._[0] == createComponent.alias) {
1181511868
stdio: 'inherit'
1181611869
});
1181711870

11871+
} else if (argv._[0] === describeCategory.name || argv._[0] === describeCategory.alias) {
11872+
_displayCommand(describeCategory.name);
11873+
let describeCategoryArgs = ['run', '-s', describeCategory.name, '--prefix', appRoot,
11874+
'--',
11875+
'--projectDir', cwd,
11876+
'--apiname', argv.apiname,
11877+
'--taxonomy', argv.taxonomy
11878+
];
11879+
if (argv.id) {
11880+
describeCategoryArgs.push(...['--id', argv.id]);
11881+
}
11882+
if (argv.file) {
11883+
describeCategoryArgs.push(...['--file', argv.file]);
11884+
}
11885+
if (argv.server && typeof argv.server !== 'boolean') {
11886+
describeCategoryArgs.push(...['--server', argv.server]);
11887+
}
11888+
spawnCmd = childProcess.spawnSync(npmCmd, describeCategoryArgs, {
11889+
cwd,
11890+
stdio: 'inherit'
11891+
});
11892+
1181811893
} else if (argv._[0] === shareTaxonomy.name || argv._[0] === shareTaxonomy.alias) {
1181911894
_displayCommand(shareTaxonomy.name);
1182011895
let shareTaxonomyArgs = ['run', '-s', shareTaxonomy.name, '--prefix', appRoot,
@@ -12618,9 +12693,15 @@ if (argv._[0] === createComponent.name || argv._[0] == createComponent.alias) {
1261812693
if (argv.addusers) {
1261912694
setSiteSecurityArgs.push(...['--addusers', argv.addusers]);
1262012695
}
12696+
if (argv.addgroups) {
12697+
setSiteSecurityArgs.push(...['--addgroups', argv.addgroups]);
12698+
}
1262112699
if (argv.deleteusers) {
1262212700
setSiteSecurityArgs.push(...['--deleteusers', argv.deleteusers]);
1262312701
}
12702+
if (argv.deletegroups) {
12703+
setSiteSecurityArgs.push(...['--deletegroups', argv.deletegroups]);
12704+
}
1262412705
if (argv.server && typeof argv.server !== 'boolean') {
1262512706
setSiteSecurityArgs.push(...['--server', argv.server]);
1262612707
}

sites/bin/cec/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cec",
3-
"version": "23.7.1",
3+
"version": "23.7.2",
44
"description": "CLI for cec",
55
"license": "UPL-1.0",
66
"main": "cec.js",

sites/bin/compiler/compilesite.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1503,7 +1503,7 @@ var compiler = {
15031503
var serverURL,
15041504
authorization = '';
15051505

1506-
if (server && server.username && server.password) {
1506+
if (server && ((server.username && server.password) || server.oauthtoken)) {
15071507
// use the configured server
15081508
serverURL = server.url;
15091509

sites/bin/compiler/components/component-registration.js

+8
Original file line numberDiff line numberDiff line change
@@ -1390,6 +1390,10 @@
13901390
'properties': [
13911391
'visible',
13921392
'visibleOnMobile',
1393+
'contentId',
1394+
'contentIds',
1395+
'contentViewing',
1396+
'contentViewings',
13931397
'backgroundAttachment',
13941398
'backgroundColor',
13951399
'backgroundImage',
@@ -1440,6 +1444,10 @@
14401444
'visible': true
14411445
},
14421446
'properties': [
1447+
'contentId',
1448+
'contentIds',
1449+
'contentViewing',
1450+
'contentViewings',
14431451
'backgroundAttachment',
14441452
'backgroundColor',
14451453
'backgroundImage',

sites/bin/content.js

+20-5
Original file line numberDiff line numberDiff line change
@@ -1968,6 +1968,8 @@ module.exports.controlContent = function (argv, done, sucessCallback, errorCallb
19681968
var hasPublishedItems = false;
19691969
var toReviewItemIds = [];
19701970
var toProcessReviewItemIds = [];
1971+
var q = '';
1972+
var queryTotal;
19711973

19721974
var repositoryPromises = [];
19731975
if (repositoryName) {
@@ -2057,7 +2059,6 @@ module.exports.controlContent = function (argv, done, sucessCallback, errorCallb
20572059
// get items in the channel or collection
20582060
//
20592061
// query items
2060-
var q = '';
20612062
if (action === 'add') {
20622063
if (repository) {
20632064
q = '(repositoryId eq "' + repository.id + '")';
@@ -2098,12 +2099,26 @@ module.exports.controlContent = function (argv, done, sucessCallback, errorCallb
20982099
console.info(' - q: ' + q);
20992100
}
21002101

2101-
var queryPromise = assetGUIDS.length > 0 ?
2102+
return serverRest.queryItems({
2103+
server: server,
2104+
q: q,
2105+
fields: 'name,status,isPublished,publishedChannels,languageIsMaster,translatable',
2106+
limit: 1,
2107+
showTotal: false
2108+
});
2109+
2110+
})
2111+
.then(function (result) {
2112+
queryTotal = result.limit;
2113+
console.info(' - total items from query: ' + queryTotal);
2114+
2115+
var queryPromise = queryTotal > 500 && assetGUIDS.length > 0 ?
21022116
_queryItemsWithIds(server, q, assetGUIDS, 'name,status,isPublished,publishedChannels,languageIsMaster,translatable') :
21032117
serverRest.queryItems({
21042118
server: server,
21052119
q: q,
2106-
fields: 'name,status,isPublished,publishedChannels,languageIsMaster,translatable'
2120+
fields: 'name,status,isPublished,publishedChannels,languageIsMaster,translatable',
2121+
showTotal: false
21072122
});
21082123

21092124

@@ -2114,7 +2129,7 @@ module.exports.controlContent = function (argv, done, sucessCallback, errorCallb
21142129
return Promise.reject();
21152130
}
21162131

2117-
var items = assetGUIDS.length > 0 ? (result || []) : (result.data || []);
2132+
var items = queryTotal > 500 && assetGUIDS.length > 0 ? (result || []) : (result.data || []);
21182133
if (items.length === 0) {
21192134
if (showDetail) {
21202135
if (action === 'set-translated') {
@@ -2365,7 +2380,7 @@ module.exports.controlContent = function (argv, done, sucessCallback, errorCallb
23652380
if (repositoryName) {
23662381
cmd += ' -r "' + repositoryName + '"';
23672382
}
2368-
cmd += ' -c ' + channelName;
2383+
cmd += ' -c "' + channelName + '"';
23692384
if (serverName) {
23702385
cmd += ' -s ' + serverName;
23712386
}

0 commit comments

Comments
 (0)