Skip to main content

How to change the repository home directory

Per default, CRX will be installed in a folder named crx-quickstart located in the JVM's root folder. In order to change the default crx-quickstart installation folder, follow these steps. In this example the default installation folder will be prefixed with my_custom_path:

  • extract the default crx-xxx-quickstart.jar with 'java -jar crx-xxx-quickstart.jar' in a temporary location
  • navigate to crx-quickstart/server/webapps
  • unzip crx-explorer_crx.war to crx-explorer_crx
  • edit crx-explorer_crx/WEB-INF/web.xml
    • locate servlet with name Repository and adjust the value of the repository-home parameter to my_custom_path/crx-quickstart/repository
    • locate servlet JCRExplorer and adjust value of parameter explorer-home to my_custom_path/crx-quickstart/repository
    • locate servlet JCRWebdavServer and change value of parameter home to my_custom_path/crx-quickstart
  • edit crx-explorer_crx/WEB-INF/log4j.xml
    • adapt the path of the error.log and translation.log files and prefix them with my_custom_path
  • unzip crx-launchpad.war to crx-launchpad
  • edit crx-launchpad/WEB-INF/web.xml
    • adjust parameter sling.home to my_custom_path/crx-quickstart/launchpad

After having reconfigured the paths, simply repackage the previously unzipped webapps and deploy these in the application server of your choice, first crx-explorer_crx.war, then crx-launchpad.war. Once deployed, the repository home directory will be located at <app_server_home>/my_custom_path.

Note:- You might encounter an io file permission error like [1] make sure the app runas user have write privileges to the parent of sling.home.

[1]  java.io.FileNotFoundException: my_custom_path/../system.id (Permission denied)

 

Comments

Popular posts from this blog

AEM 6.3 - How to extend Granite UI

Here in this article, I am going to explain how to extent Granite UI that is basically used to create AEM 6.x consoles. There can be various use cases where in you may need that. In our case, author wants to take all the page creation requests through AEM instead of email communication. Authors are basically looking for a form in AEM authoring console so that requestor can login and submit page creation/Asset upload request. Overall requirement is - Need a link in Navigation so that author can click on it and go to a Intake form. Author must be able to fill and save the intake requests. Author must be able to see the history of submitted intake requests Able to see the details of submitted intake requests. Solution - 1. Create a following structure - /apps/cq/core/content/nav/form and add the details given in below screenshot - You basically need to add - href, title and icon. Href is the path of page where user will land on clicking it.  Af...

CQ Page Properties from Javascript

To get CQ page properties inside javascript you can use core CQ JS API. It can be convenient if you need to get this information inside your custom JS widgets.              var pageData = CQ.HTTP.get(CQ.HTTP.externalize(CQ.utils.WCM.getPagePath() + "/jcr:content.json")); After that you can retrieve any property you need (assuming it's present in JCR):              var resourceType = pageData ? CQ.Util.formatData(CQ.HTTP.eval(pageData))['sling:resourceType'] : null; Please do not overuse it because it invokes additional ajax call to server. It's OK to use it in edit mode on author instance. Copied from -  http://adobecms.blogspot.com/2014/04/cq-page-properties-in-javascript.html

AEM 6.3 - Check if page is published or not

If you want to know if the page is published or not you can use the below utility method to know if the page is published or not. Steps - Take Resource Object. Adapt it to Page Adapt page to ReplicationStatus, you will get the status Here is the code - public static Boolean isPublished(Resource resource) { Boolean activated; ReplicationStatus status = null; activated = false; if (resource != null) { try { Page page = resource.adaptTo( Page.class ); status = page.adaptTo( ReplicationStatus.class ); } catch (Exception e) { LOG.debug(e.getMessage (), e); } if (status != null) { activated = status.isActivated(); } } return activated; }