let's say you develop a component to display some images based on a category field. This gets deployed to your 5 cloud environments (dev, test, UAT, stage, prod etc).
On production and UAT the Content Authors add this component to various pages, and set the category values.
You now develop a new version of this component which you remove the category field, and add new fields such as categoryList.
When this new version of the component get deployed to each cloud environment, all pages which use this component get broken, as they expect a categoryList field.
We would want to run a script to add the new field to all existing instances of the component, and set its value to an array with the value of the old category field as the only element. This would only run once, if not already run for that env.
This is very similar to migrating a SQL database change. For this you would use a tool such as liquibase, which has change scripts which get run when the system boots, if that script wasnt previously applied. Liquibase happens to use scripts which contain SQL statements (for simple table structure or data changes), but could also contain code (for more complex changes).
This must be a pretty common problem for AEM?
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @TB3dock,
I would recommend to use AEM Easy Content Upgrade tool
This is tool that will allow you to run groovy script automatically, as part of package installation.
Here are also other pros:
Alternatively you can use Groovy Console as a stand alone tool:
But in that case you will need to run your scripts manually on each instance and each environment.
Hi @TB3dock,
I would recommend to use AEM Easy Content Upgrade tool
This is tool that will allow you to run groovy script automatically, as part of package installation.
Here are also other pros:
Alternatively you can use Groovy Console as a stand alone tool:
But in that case you will need to run your scripts manually on each instance and each environment.
Hi, I tried to install this tool by putting this in the pom.xml for our cloud version (running locally), but it doesn't install it.
<dependency>
<groupId>de.valtech.aecu</groupId>
<artifactId>aecu.complete.cloud</artifactId>
<version>LATEST</version>
<type>zip</type>
</dependency>
After doing
% mvn clean install -PautoInstallSinglePackageAuthor
There is no groovy console at http://localhost:4502/groovyconsole
and no "aem easy content upgrade" menu in author.
There is only this warning in the build output (and no errors):
[^[[1;33mWARNING^[[m] 'dependencyManagement.dependencies.dependency.version' for de.valtech.aecu:aecu.complete.cloud:zip is either LATEST or RELEASE (both of them are being deprecated) @ line 715, column 22
Views
Replies
Total Likes
Adding dependency is not suffice. You need to embed the package to get it deployed on AEM.
Like you do with any other dependency e.g. ACS commons package
https://www.linkedin.com/pulse/how-add-third-party-bundle-you-aem-package-veena-vikraman - check this one for reference
Views
Replies
Total Likes
Thanks! Ive downloaded the zip, but the next missing piece is where to put it. The example link you kindly provided uses \ui.apps\src\main\content\jcr_root\apps\<project> but this is for a different kind of install, its for some sort of embedded plugin, not for a dependency. Also, that link has a completely different mvn entry, specifying specific directories etc. which is not how mvn is specified in this packages install instructions.
I also checked out these install instructions:
https://adobe-consulting-services.github.io/acs-aem-commons/pages/maven.html
But there is no mention of manually downloading packages and where to put them (in addition to that pulled in automatically via mvn).
In a java project which does not use mvn, you would put any libs on the class path. Not sure what the AEM equivalent of this is.
Note: mvn is supposed to download and configure dependencies automatically. If I have to install something locally, it wont work when deployed to cloud envs via CDI pipeline.
Views
Replies
Total Likes
Ive installed the tool and groovy console, but cant figure out how to get a script into the system. The docs mention these two directories:
/apps/aecu-scripts
(AEM Cloud automatic execution with startup hook, since 6.0.0)/conf/groovyconsole/scripts/aecu
(AEM onprem manual and install hook execution, AEM Cloud manual execution)
But of course this directory structure does not exist in AEM. AEM as the following structure:
all
core
dispatcher
ui.apps
etc.
I tried creating a directory /apps/aecu-scripts and added one script:
sample.groovy
aecu.contentUpgradeBuilder()
.forChildResourcesOf("/content/mysite/uk/en/")
.filterByNodeName("jcr:content")
.printPath()
.printProperty("sling:resourceType")
.printJson()
.run()
Then I build the project using "mvn install -PautoInstallPackage".
However, nothing shows up in "AEM Easy Content Upgrade - Execute"
Anyone seen a project with a hello world script so we can see how to get a script into the system?
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Likes
Replies