-
Notifications
You must be signed in to change notification settings - Fork 12
/
index-converter.js
59 lines (51 loc) · 3.12 KB
/
index-converter.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
Copyright 2020 Adobe. All rights reserved.
This file is licensed to you under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. You may obtain a copy
of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
OF ANY KIND, either express or implied. See the License for the specific language
governing permissions and limitations under the License.
*/
const { Command } = require("@oclif/command");
const Commons = require("@adobe/aem-cs-source-migration-commons");
const IndexConverter = require("@adobe/aem-cs-source-migration-index-converter");
const helper = require("../../helper");
class IndexConverterCommand extends Command {
async run() {
this.log("\n********** Executing Index Converter **********");
try {
helper.clearOutputFolder(Commons.constants.TARGET_INDEX_FOLDER);
let config = helper.readConfigFile(this.config.configDir);
IndexConverter.performIndexConversion(
config.indexConverter,
helper.baseIndexDefResourcePath
);
} catch (e) {
this.error(e);
}
}
}
IndexConverterCommand.description = `migrate existing Custom Oak Index Defintions into AEMaaCS compatible Custom Oak Index Defintions
Configuring existing Custom Oak Index Definitions to AEMaaCS compatible Custom Oak Index Defintions.
Custom Oak Index Definitions can be categorized as :
* Custom OOTB (Product) Oak Index Definitions : Modification into existing OOTB Oak Index Definitions
* Newly created Oak Index Definitions
Operation for custom OOTB (Product) Oak Index Definition :
* This tool will parse the Custom OOTB (Product) Oak Index Definition and fetch the associated OOTB Index Definition.
* It will compare the Custom OOTB Oak Index Definition to the associated OOTB Index Definition and retrieve the
difference between Custom OOTB Index Definition. and associated OOTB Index Definition. That difference or delta is
basically customization done by the user in OOTB Oak Index Definition.
* It will validate the retrieved customization as per AEM as Cloud Service compatible OAK Index Definitions guidelines.
* It will merge validated customization of Custom OOTB Oak Index Definition to corresponding OAK Index Definition
present on AEM as a Cloud Service.
Naming convention for Custom OOTB (Product) Oak Index Definition :
"Name of the corresponding OAK Index Definition on AEMaaCS"-"latest version of this index on AEMaaCS "-"custom"-1
Operation for newly created custom Oak Index Definition :
* It will parse and validate the Custom Oak Index Definition according to AEM as a Cloud Service OAK Index Definitions guidelines.
* It will rename the Custom Oak Index Definition.
Naming convention for newly created Custom Oak Index Definition :
"Name of the Custom Oak Index Defintion"-"custom"-1`;
IndexConverterCommand.examples = ["$ aio aem-migration:index-converter"];
module.exports = IndexConverterCommand;