AEM as a Cloud Service Index Converter tool
npm install @adobe/aem-cs-source-migration-index-converter

aem-cs-source-migration-index-converter provides the capability to transform on-premise
Custom OAK Index Definitions to AEM as a Cloud Service compatible OAK Index Definitions.
Index Converter allows Adobe Experience Manager (AEM) developers to migrate existing
Custom Oak Index Definitions to AEM as a Cloud Service compatible Custom Oak Index Definitions.
Custom Oak Index Definitions are categorized as:
* Custom OOTB (Product) Oak Index Definitions: Modification into existing OOTB Oak Index Definitions
* Newly created Oak Index Definitions
There are two ways to create Custom Oak Index Definitions:
* either under /apps (through any custom content package)
* directly under /oak:index path
This utility transforms only lucene type Custom Oak Index Definitions which are present under
/apps or /oak:index. It will not transform those lucene type indexes which are created for
nt:base.
true, ignore or skip the Ensure Definitionjcr:primaryType to oak:QueryIndexDefinition/facets/jcr:content from Ensure Definition#### 2. Handle Custom OOTB (Product) Oak Index Definition
* It will parse the Custom OOTB (Product) Oak Index Definition and fetch the associated OOTB
Index Definition corresponding to the aemVersion specified.
* 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 Conventions for Custom OOTB (Product) Oak Index Definition
```
"Name of the corresponding OAK Index Definition on AEM as a Cloud Service"-
"latest version of this index on AEM as a Cloud Service "-"custom"-1damAssetLucene-6-custom-1
For example,
#### 3. Handle Newly created Custom Oak Index Definition
* It will parse and validate the Custom Oak Index Definition as per AEM as Cloud Service compatible
OAK Index Definitions guidelines.
* It will rename the Custom Oak Index Definition.
###### Naming Conventions for Newly created Custom Oak Index Definition :
`"Name of the Custom Oak Index Definition"-"custom"-1`testindex-custom-1
For example,
#### 4. Update the filter path
This tool will update the filter path in filter.xml as well based on the new name of Custom OAK
Index Definitions.
For example, from to
While it is recommended to use this tool via AIO CLI plugin for source migration, it can also be executed standalone.
This project uses node and npm. Check the resources for installation.
It can be installed like any other Node.js module.
`shell script`
$ npm install @adobe/aem-cs-source-migration-index-converter
To add the module to your Node.js project:
1. Install the module in your project.
2. Add the require function in the module in the javascript file where it will be consumed.
`javascript`
const IndexConverter = require('@adobe/aem-cs-source-migration-index-converter');
To execute the index-converter tool locally :
1. Run git clone git@github.com:adobe/aem-cloud-service-source-migration.git to clone theindex-converter
repository locally
2. Navigate to the foldernpm install
3. Run to install all the required dependenciesexecutors
4. Inside the folder:config.yaml
* add the required configurations to . Refer to Configurationsnode index-converter.js
sections below to learn more.
* run to execute the tool./target/index/
* will contain the resulting restructured projects
The following configurations are required for the Index Converter utility:
* ensureIndexDefinitionContentPackageJcrRootPath: Absolute path to the jcr_root directory of the packageensureIndexDefinitionConfigPackageJcrRootPath
containing the Ensure Index Definitions (please ignore if there are no Ensure Index Definitions).
* : Absolute path to the jcr_root directory of the packageaemVersion
containing the Ensure Index OSGi Configuration (please ignore if there are no Ensure Index Definitions).
* : Version of AEM customer is on, used to determine the baseline index definitions.customOakIndexDirectoryPath
* : Path to the customer OAK Index Definition directory.filterXMLPath
* : Path to the existing package filter.xml file.
`@yamlfilter.xml
indexConverter:
# Absolute path to the jcr_root directory of the package containing the Ensure Index Definitions
# (please ignore if there are no Ensure Index Definitions)
# eg. /Users/xyz/sampleCode/content/src/main/content/jcr_root
ensureIndexDefinitionContentPackageJcrRootPath: "/Users/xyz/sampleCode/content/src/main/content/jcr_root"
# Absolute path to the jcr_root directory of the package containing the Ensure Oak Index OSGI Configuration
# (please ignore if there are no Ensure Index Definitions)
# eg. /Users/xyz/sampleCode/CONFIG/src/main/content/jcr_root
ensureIndexDefinitionConfigPackageJcrRootPath: "/Users/xyz/sampleCode/CONFIG/src/main/content/jcr_root"
# Version of AEM customer is on, used to determine the baseline index definitions
aemVersion: 64
# Path to the customer OAK Index Definition directory
# (please ignore if there are no Custom Oak Index Definitions under /oak:index)
# eg /Users/xyz/sampleCode/ui.apps/src/main/content/jcr_root/_oak_index
customOakIndexDirectoryPath:"/Users/xyz/sampleCode/ui.apps/src/main/content/jcr_root/_oak_index"
# Path to the existing package file`
# eg /Users/xyz/sampleCode/ui.apps/src/main/content/META-INF/vault/filter.xml
filterXMLPath:"/Users/xyz/sampleCode/ui.apps/src/main/content/META-INF/vault/filter.xml"
6.3 onwards.
2. This utility transforms only lucene type Custom Oak Index Definitions which are present under
/apps or /oak:index.
3. It will not transform those lucene type indexes which are created for nt:base.#### Things that would need to be handled manually :
* copy the converted index definitions to the
/oak:index folder inside ui.apps package.
* copy the index definition filter paths from the generated filter.xml to the ui.apps
package's filter.xml` file.Contributions are welcomed! Refer to Contributing Guide for more information.
This project is licensed under the Apache V2 License. Refer to LICENSE for more information.