Posts Tagged “JCR”

Bulk file transfers with WebDAV

Bulk asset transfers to a JCR are sometimes tedious especially when using AEM's Assets Manager or Site Admin. Adobe has tutorials on how to upload to the DAM and accessing AEM via WebDAV. This tutorial will make accessing AEM's JCR via WebDAV clear for current versions of Windows and OSX,...

Vaulting to AEM

Image Credit: "DK Vault" By Dinoenthusiastguy Licensed under CC BY-SA via Wikia Using the CRX (Content Repository eXtreme) via CRXDE can be cumbersome especially for testing, the following are easier ways to interact with the CRX via common IDEs. The basic concept is similar to git where as to pull...

CQ Haiku: JCR vs. Sling

Adapt to Node like Assembly inside Java Use Sling API Quite often I see code, especially from less experience developers, with something like this: Node node = resource.adaptTo(Node.class); String property = null; try{ property = node.getProperty("myProperty").getString(); } catch (RepositoryException re){ log.error("Exception accessing myProperty", re); } Or even scarier, there may be just a global exception handler for the particular method. Either way, this code is a lot more fragile than it needs to be. If...

9 JCR-SQL2 Queries Every AEM Developer Should Know

JCR-SQL2 queries are useful items in every AEM Developer's toolbag.  They are relatively quick, aren't deprecated and have a familiar SQL like grammer. JCR-SQL2 queries can be invoked from the JCR API: Session session = ...QueryManager queryManager = session.getWorkspace.getQueryManager();Query query = queryManager.createQuery("{QUERY}", Query.JCR_SQL2);QueryResult result = query.execute(); or through the Sling API: ResourceResolver resolver = ...Iterator<Resource> result = resolver.findResources("{QUERY}", Query.JCR_SQL2); Although there is an official specification for JCR-SQL2, there aren't a ton of really good resources out...