mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
fix clean script
This commit is contained in:
parent
b806556453
commit
5e9cbe5690
@ -25,23 +25,24 @@ async function main() {
|
|||||||
async function cleanRoot(alfrescoJsApi) {
|
async function cleanRoot(alfrescoJsApi) {
|
||||||
console.log('====== Clean Root ======');
|
console.log('====== Clean Root ======');
|
||||||
|
|
||||||
let rootNodes = await alfrescoJsApi.core.nodesApi.getNodeChildren('-root-');
|
let rootNodes = await alfrescoJsApi.core.nodesApi.getNodeChildren('-root-', {
|
||||||
|
include: ['properties']
|
||||||
|
});
|
||||||
|
|
||||||
for (let i = 0; i < rootNodes.list.entries.length; i++) {
|
for (let i = 0; i < rootNodes.list.entries.length; i++) {
|
||||||
|
|
||||||
sleep(200);
|
sleep(200);
|
||||||
|
|
||||||
console.log(rootNodes.list.entries[i].entry.id);
|
if(rootNodes.list.entries[i].entry.createdByUser.id !== 'System') {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await alfrescoJsApi.core.nodesApi.deleteNode(rootNodes.list.entries[i].entry.id);
|
await alfrescoJsApi.core.nodesApi.deleteNode(rootNodes.list.entries[i].entry.id);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log('error' + JSON.stringify(error));
|
console.log('error' + JSON.stringify(error));
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanRoot(alfrescoJsApi);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function emptyTrashCan(alfrescoJsApi) {
|
async function emptyTrashCan(alfrescoJsApi) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user