Skip to content

Instantly share code, notes, and snippets.

Note 1: The following CQ curl commands assumes a admin:admin username and password.
Note 2: For Windows/Powershell users: use two "" when doing a -F cURL command.
Example: -F"":operation=delete""
Note 3: Quotes around name of package (or name of zip file, or jar) should be included.
Uninstall a bundle (use http://localhost:4505/system/console/bundles to access the Apache Felix web console)
curl -u admin:admin -daction=uninstall http://localhost:4505/system/console/bundles/"name of bundle"
Upload a package AND install
curl -u admin:admin -F file=@"name of zip file" -F name="name of package"
Assuming the base URL to be this (need to edit to fit yours):
http://cqauthor1.company.com:4502
SEARCH
Search UI:
/crx/explorer/ui/search.jsp?Path=&Query=
<%@ page language="java"
import="java.io.ByteArrayOutputStream,
java.io.IOException,
java.io.OutputStream,
java.io.UnsupportedEncodingException,
java.math.BigInteger,
java.net.HttpURLConnection,
java.net.URLConnection,
java.net.URL,
java.net.URLEncoder,
import java.io.IOException;
import java.util.Collections;
import javax.servlet.ServletException;
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.SlingHttpServletResponse;
import org.apache.sling.api.servlets.SlingSafeMethodsServlet;
import org.codehaus.jackson.JsonFactory;
import org.codehaus.jackson.JsonGenerationException;
Set up your file structure for the innerParsys component:
innerParsys
-> parsys
-> new
- _cq_editConfig.xml
- .content.xml
- _cq_editConfig.xml
- .content.xml
- parsys.jsp
#! /bin/bash
set -e
trap "exit 1;" INT TERM EXIT
# exec > >(tee $0.log)
# exec 2>&1
[ -z "$CRX_URL" ] && CRX_URL=http://localhost:4502
[ -z "$CRX_CREDENTIALS" ] && CRX_CREDENTIALS=admin:admin
# The purpose of the aliases was to make it easier to map to the correct jcr file in my local Git repo
# and hit the correct server (in my case on port 4503). The only value I could not add as an alias was
# vlt add <directory> since that is a manual process, but the "vhelp" is designed to alert you to that.
# Feel free to modify any alias to suit your needs (especially the vhelp)
alias jcr='cd ~/Documents/Git/CQ5/ui/src/main/content/jcr_root/'
alias vco='vlt --credentials admin:admin co --force http://localhost:4503/crx'
alias vstatus='vlt st'
alias vcommit='vlt commit --force'
alias vhelp='echo "Type jcr to cd to Git directory then vco to checkout"; echo "After checkout run vstatus to view files to be added"; echo "vlt add then the files listed and then run vcommit"; echo "Finally run the git commands to move the code to github"'
import java.util.concurrent.CountDownLatch;
import org.junit.rules.TestRule;
import org.junit.runner.Description;
import org.junit.runners.model.Statement;
/**
* A rule runs each test case many times in parallel. Can be used for load tests. If more than one
* of the parallel executions fails, only the first fail is reported. Example: To run each test
* method in the class 5 times, add <code> @Rule
// ------------------------------------
// Toggle 'wcmmode=disabled'
(function(){
var WCMMODE_DISABLED = 'wcmmode=disabled';
// Creates the path by combining the path and query string parameters
var createURL = function(path, query_string, hash) {
var url = path;
var qs = [];
for (var i=0;i<query_string.length;i++) {
@dfparker2002
dfparker2002 / gist:264e14b0febcb98b9078
Last active December 20, 2015 22:57 — forked from auniverseaway/gist:21800b9a7848b2bf880c
Maven AEM Archetype 10 install command
mvn archetype:generate \
-DarchetypeRepository=https://repo.adobe.com/nexus/content/groups/public/ \
-DarchetypeGroupId=com.adobe.granite.archetypes \
-DarchetypeArtifactId=aem-project-archetype \
-DarchetypeVersion=10 \
-DgroupId=my-group-id \
-DartifactId=myproject \
-DappsFolderName=myproject \
-DartifactName="My Project" \

-DcomponentGroupName: aemslice \