AEM Tips & Tricks
Repository Maintenance
AEMs TarMK can grow really huge. There’re ways to deal with it - trimming its size by either
- remove everything you don’t need anymore or
- create a new repo with only content you need right now
The first approach is also known as garbage collection or offline tar compaction. The latter one is often more efficient and yields a smaller result size.
$> java -jar ~/crx2oak-1.6.8-all-in-one.jar --src-datastore=/opt/aem/datastore --datastore=$HOME/datastore-new --exclude=/var/audit --copy-versions=false segment-old:repository segment-old:$HOME/repository-new
Activate entire JCR Trees
AEMs publisher has a function called “Activate Tree”:
http://
Templates
When setting up a new site i relied on
- Templates Basics -> The part about ~Template Availability~ was very useful. Very usefull is the diagram on the ~template evaluation~ process.
pretty much
AEM & CLI
I started using Adobe AEM in January 2016.
This is a Collection of my findings and maybe they’re useful to somebody.
Where AEMs data lives
nb-syngeni350:author-cq61 vbe$ tree -L 2 -d
.
└── crx-quickstart
├── app
├── bin
├── conf
├── install
├── launchpad
├── logs
├── monitoring
├── opt
└── repository <-- Data lives here
One of my first learnings was that AEM uses a filebased datastore - called tarmk.
As per default everything you store in AEM stays there forever. Eventually stuff gets flagged as deleted - but still consumes space on your disk.
Move an AEM in filesystem
We had the need to move an installed AEM on the filesystem. I moved the entire AEM installation folder from one folder to another. I considered me done. I was not. AEM still started but the servers error.log contained a lot of (a that time) strange error messages. The reason was it couldn’t find the datastore aka repository.
The FileDataStore location can be changed in a file called
install/org.apache.jackrabbit.oak.plugins.blob.datastore.FileDataStore.cfg
with the content
path=$AEM_SERVERS/author-cq61/crx-quickstart/repository/repository/datastore
minRecordLength=4096
It should work with relative paths, too. But i haven’t tested it yet.
Status of all Bundles
curl --silent http://admin:admin@127.0.0.1:4502/system/console/bundles.json \
|jq '.data[] | .state + ": " + .name + " (" + .version + ")"' -
Useful AEM-Links
- Dump ClientLibs
To View all configured clientlibs (js, css,…) and their respective contents you can use the dumplibs page
Touch-UI
- Sites
Classic UI
- SiteAdmin - ClassicUI
Dump Clientlibs
HTL Template Language
- Getting started
- Introducton by Feike Visser
- Java Use API
- Custom Async Clientlibs
- Sightly Quick Reference
- Calling Clientlibs from HTL
- Using Client-Side Libraries
Configuration
Configure Log-Files
You can manage log files using Web Console Loggers can be added, deleted and modified there
JCR Queries
List of Pages providing examples on how to query the JCR: