Does it matter whether I name the cq:ClientLibraryFolder folder "Clientlib" or "ClientLib(s)" | Community
Skip to main content
au4liferz
Level 4
December 7, 2015
Solved

Does it matter whether I name the cq:ClientLibraryFolder folder "Clientlib" or "ClientLib(s)"

  • December 7, 2015
  • 7 replies
  • 1469 views

or, whether I locate them at the same level as the custom component, or nest them beneath the component etc., what is the "defacto standard" for experienced AEM developers? When I look throughout the JCR at the existing AEM components, (i.e. those that come with AEM out of the box), I see folders sometimes named Clientlib, and at other times, Clientlibs and I want to be consistent and follow the established defacto standards to ensure that my changes get picked up/detected properly. I doubt this is why my changes aren't picked up immediately sometimes, (as it's probably just typical caching and weird CQ/AEM behavior), but thought I'd ask to be certain I don't cause myself problems going forward.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by leeasling

It does not matter what you name the folder, just as long as it's defined as a ClientLibraryFolder, it'll work.

7 replies

leeaslingAccepted solution
Level 8
December 7, 2015

It does not matter what you name the folder, just as long as it's defined as a ClientLibraryFolder, it'll work.

smacdonald2008
Level 10
December 7, 2015

Agree with leeasling - most important thing is you use a node type of cq:ClientLibraryFolder and you define the categories property. 

au4liferz
au4liferzAuthor
Level 4
December 7, 2015

Thanks so much for the prompt reply gentlemen! I'm guessing that it really doesn't matter where I locate it in the component node hierarchy either, correct? Even so, please share what the defacto standard is for both the name, and where it's located so that I can follow the established norm.

smacdonald2008
Level 10
December 7, 2015
Level 8
December 7, 2015

au4liferz wrote...

Thanks so much for the prompt reply gentlemen! I'm guessing that it really doesn't matter where I locate it in the component node hierarchy either, correct? Even so, please share what the defacto standard is for both the name, and where it's located so that I can follow the established norm.

 

For the name, go with whatever you prefer.  There is no right or wrong.

As far as where the client library can live, you can indeed put them under each component but you need to be careful.  Typically on a dispatcher any request to /apps/ is blocked, meaning that any direct reference to a client library living under apps will result in a 404.  If you do decide to put client libraries with their components, make sure in your main client library defined in your design that you embed the component categories.

Your node (in XML format) would look something like this:

<?xml version="1.0" encoding="UTF-8"?> <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" jcr:primaryType="cq:ClientLibraryFolder" categories="[apps.projectName]" embed="[apps.projectName.components]"/>

Assuming your component client libraries were named as such, this would embed the component css/js so that it is not referenced from /apps/.

Lokesh_Shivalingaiah
Level 10
December 8, 2015

Lee has pointed out a right thing. 

defacto is that clientlibs can have any name but the node type should be cq:ClientLibraryFolder and

there is no hierarchy to be maintained, once you have categories defined for your client library folder, it can be included in your component. But cautious of having it under apps and it would be better to have it under /etc/designs.

 

regards,

Lokesh

au4liferz
au4liferzAuthor
Level 4
December 8, 2015

Thanks again. I'll definitely put it under /etc/designs instead of directly off of the component folder hierarchy, (even though that's what most of the http://helpx.adobe.com tutorials tell you to do).