Just a little something I wish I had when I first started working with AEM. Adobe Experience Manager can feel like a real chicken-and-egg situation—Adobe doesn’t provide an easy way to set up AEM instances for experimentation, so you’re kind of forced to learn on the job. That’s a tough spot to be in when a company is paying you to already know how to do AEM work.
Common URLs 🔗 Purpose Path AEM Author Login http://localhost:4502AEM Publish Instance http://localhost:4503CRXDE Lite /crx/deFelix Console (OSGi configs/bundles) /system/console/configMgrSling Models console /system/console/adaptersDispatcher Flush Agent /etc/replication/agents.author/dispatcherPackage Manager /crx/packmgr/index.jspUseradmin /useradminSites Authoring /sites.html/contentTemplate Editor /libs/wcm/core/content/sites/templates.html/conf
Useful File System Paths (JCR) 🔗 Purpose JCR Path Page Content /content/your-site/...Components /apps/your-project/components/...Templates /conf/your-project/settings/wcm/templates/...Editable Template Policies /conf/your-project/settings/wcm/policies/...Core Components (Do not modify!) /libs/core/components/...Clientlibs /apps/your-project/clientlibs/...Designs (for legacy static templates) /etc/designs/
Maven Commands 🔗 mvn clean install
mvn clean install -PautoInstallPackage
mvn clean install -PautoInstallPackage -pl ui.apps
mvn clean install -PautoInstallBundle -pl core
CRX Package Manager (Curl) 🔗 curl -u admin:admin -F file = @"my-package.zip" -F name = my-package -F force = true -F install = true http://localhost:4502/crx/packmgr/service.jsp
HTL (Sightly) Snippets 🔗 ${myModel.title}
<ul data-sly-list . item = "${myModel.items}" >
<li >${item.name}</li >
</ul >
<div data-sly-resource = "${ 'mycomponent' @ resourceType='myproject/components/foo' }" ></div >
<div data-sly-test = "${myModel.showThing}" >Shown if true</div >
Sling Models (Java) 🔗 @Model (adaptables = Resource.class )
public class ExampleModel {
@Inject private String title;
@ValueMapValue private String subtitle;
@Default (values = "Default text" ) private String footer;
public String getTitle () { return title; }
}
Registering an OSGi Servlet 🔗 @Component (service = Servlet.class ,
property = {
"sling.servlet.methods=GET" ,
"sling.servlet.paths=/bin/myendpoint"
})
public class MyServlet extends SlingSafeMethodsServlet {
@Override
protected void doGet (SlingHttpServletRequest req, SlingHttpServletResponse resp) throws IOException {
resp.getWriter ().write ("Hello from servlet!" );
}
}
Dispatcher Caching Quick Tips 🔗 Flush content via flush agent at /etc/replication/agents.author/dispatcher Debug caching using X-Cache: HIT/MISS headers Deny example: /filter { /0001 { /type "deny" /url "*.json" } } Troubleshooting Tips 🔗 Symptom Tip Component not rendering Check resourceType and Sling resolution Model not working Confirm @Model and Sling exporter Bundle not active Check /system/console/bundles No logs from code Use logger, check error.log Dispatcher not updating Clear cache or flush manually
Log Statements (Java) 🔗 private static final Logger log = LoggerFactory.getLogger (MyModel.class );
log.info ("Something happened" );
log.debug ("Variable value: {}" , value);
log.error ("Something went wrong" , e);
Common Component File Structure 🔗 /apps/your-project/components/card/
├── card.html
├── _cq_dialog/.content.xml
├── _cq_editConfig.xml
└── cq:template
Editable Template Setup 🔗 Template type: /apps/your-project/templates Templates: /conf/your-project/settings/wcm/templates Policies: /conf/your-project/settings/wcm/policies