Wednesday, May 29, 2013

Some of the COMMON CURL commands to work with AEM

  • Build a AEM/CRX package: curl -u admin:admin -X POST http://localhost:5502/crx/packmgr/service/.json/etc/packages/my_packages/release-1.0.zip?cmd=build
  • Download a package: curl -C - -O -u admin:admin http://localhost:5502/etc/packages/my_packages/release-1.0.zip
  • Delete all packages after a certain date: See [this]
  • How to change all AEM passwords: See [this]
  • How to run online backup / Datastore GC / Tar Optimization using curl in AEM 5.5: See [this]
  • How to use CURL command to find pending and blocking job in the replication Queue in AEM 5.4 / WEM: See [this]
  • How to flush Cache using Curl Command: See [this]
  • How to create encoded password that you can use for curl in CQ/WEM: see [this]
  • How to do user management using POST API / CURL in AEM 5.5: see [this]
  • How to change Admin password in AEM5.5: see [this]
  • How to reduce downtime for consistency check and fix AEM5.4 / WEM: See [this]
  • How to transfer file from one CRX to other modified after certain date using CURL in AEM / WEM / CRX: see [this]

Since Apache Sling makes sure that all “activated” (published) CQ DAM assets have URIs, you can programmatically download DAM content with a command line HTTP utility such as cURL.  cURL also lets you include these commands in a Windows batch or PowerShell script.

c:\Programs\cURL>curlhttp://jayan.kandathil.org:4503/content/dam/guides/manual.pdf > C:\TEMP\manual.pdf

Many administrative and maintenance operations can also be remotely executed on both the “author” and “publish” CQ instances if you had Administrator (“admin”) credentials.

1) Create a folder in /apps called myFolder:

c:\Programs\cURL>curl -u admin:admin -Fjcr:primaryType=sling:Folder http://localhost:4502/content/dam/myFolder

2) Copy the folder /content/dam/geometrixx/icons/ (and its contents) to /content/dam/myFolder

c:\Programs\cURL>curl -u admin:admin -F:operation=copy -F:dest=/content/dam/myFolder/ http://localhost:4502/content/dam/geometrixx/icons/

3) Backup the CQ instance to the server filesystem (/content/BACKUP/Mar20-2012.zip).  For example, if the CQ author instance is at C:\Programs\Adobe\CQ_5.5\author, then the backup will be made to C:\Programs\Adobe\CQ_5.5\BACKUP\

curl -u admin:admin -X POST http://localhost:4502/system/console/jmx/com.adobe.granite:type=Repository/op/startBackup/java.lang.String?target=/BACKUP/Mar20-2012.zip

CURL client for Windows

Download CURL for win32 [here] Note: Search for Win32 - Generic for 32 bit and Win64 - No SSL for 64 bit operating system

Curl plug-in for Eclipse: It can be downloaded from [here]

How Thumbnail images are generated by AEM and configuration files to modify the OOTB behavior?


The thumbnail renditions are generated by DAM update workflow when an image is uploaded to DAM. Out of the box, the image(s) shown in content finder has two views.
    1. Mosaic View:  Uses the rendition 100 *140
    2. List View:        Uses the rendition 48*48

The renditions are configured in ContentFinderTab.js which is located at /libs/cq/ui/widgets/source/widgets/wcm/ContentFinderTab.js.

Example screen shot for changing Mosaic view for particular rendition.



To customize Mosaic view for particular rendition, you can do it by overlying ContentFinderTab.js. i.e. Create the ContentFinderTab.js under /apps/cq/ui/widgets/source/widgets/wcm/ and modify it as required.

Friday, May 24, 2013

How to find out if AEM or CQ instance is secure or not?

1.  Download the below package from package share and install it in CQ instance.

2.  URL to get to the secure screen: http://localhost:4502/etc/securecq.html

image

rsync for AEM

Recap is a package built by Mark Adamcin. This is one of the award winning pacakges in the contest. It can be downloaded from Adobe package share or from here.

image

Steps to find out implementation of a CQ Node

(i) Looking for the implementation of a Node

To know the implementation or how to implement certain nodes For Example: cq:actionConfigs, Go to CRX -> Search -> type the following red text in the query (CRXDE lite).

/jcr:root/libs//element(cq:actionConfigs, nt:base)

When u want to see the implementation for a different node, just change the node name in the query

/jcr:root/libs//element(NODE NAME, nt:base)

How can CURL be used to perform GET and POST operations in CQ?

1. To create a property of a new node or modify the existing node, use the below,

curl -u admin:admin -F"text=modified Hello World" http://localhost:4502/content/sample

2. To read a property of a node, use the below. Here /content/sample is the node and text is the property.

curl -u admin:admin -G http://localhost:4502/content/sample/text