mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ACA-4229] [ADW-AGS] Move Governance plugin check script to ADF CLI (#6523)
* [ACA-4229] [ADW-AGS] Move Governance plugin check script to ADF CLI * * Added description
This commit is contained in:
41
lib/cli/scripts/plugins/governance-health.ts
Normal file
41
lib/cli/scripts/plugins/governance-health.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
import { logger } from '../logger';
|
||||
|
||||
export class GovernanceHealth {
|
||||
constructor(private alfrescoJsApi: any) {}
|
||||
|
||||
async isRecordManagementAvailable() {
|
||||
try {
|
||||
const site = await this.alfrescoJsApi.gsCore.gsSitesApi.getRMSite();
|
||||
logger.info(
|
||||
`Record Management site is present: ${site.entry.title}`
|
||||
);
|
||||
return true;
|
||||
} catch (error) {
|
||||
logger.error(
|
||||
`Record Management site get failed: ${
|
||||
JSON.parse(error.message).error.errorKey
|
||||
}`
|
||||
);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
async createRecordManagementSite() {
|
||||
const body = { title: 'Records Management' };
|
||||
const opts = { skipAddToFavorites: false }; // | Flag to indicate whether the RM site should not be added to the user's site favorites.
|
||||
|
||||
try {
|
||||
const site = await this.alfrescoJsApi.gsCore.gsSitesApi.createRMSite(
|
||||
body,
|
||||
opts
|
||||
);
|
||||
logger.info('Record Management site: created' + site);
|
||||
} catch (error) {
|
||||
logger.error(
|
||||
`Record Management site creation failed: ${
|
||||
JSON.parse(error.message).error.errorKey
|
||||
}`
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user