Created
April 11, 2019 23:59
-
-
Save ahmed-musallam/c4cbf8fed470a519af057a4982aeda93 to your computer and use it in GitHub Desktop.
The hackiest way to export/import namespaces between AEM instances without any external dependencies
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* EXPORT NAMESPACES | |
* 1. Open http://localhost:4502/crx/explorer/ui/namespace_editor.jsp | |
* 2. Open Chrome console, run script below | |
* 3. Copy result. | |
*/ | |
/** | |
* IMPORT NAMESPACES | |
* 1. Open http://localhost:4502/crx/explorer/nodetypes/index.jsp | |
* 2. Click "Import Node Types" | |
* 3. Paste CND from above | |
* 4. Check the checkbox titled "Automatically register defined namespaces." | |
* 5. Submit | |
*/ | |
(function(){ | |
var namespacesCnd = ""; | |
document.querySelectorAll("#mainTable > tbody table > tbody > tr") | |
.forEach(tr => { | |
var url = tr.children[0].innerHTML.replace(" ", "").trim(); | |
var prefix = tr.children[1].innerHTML.replace(" ", "").trim(); | |
namespacesCnd += "<'" + prefix +"'='" + url +"'>\n" | |
}); | |
console.log(namespacesCnd) | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment