Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block dfparker2002

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
import java.util.Collections;
import javax.servlet.ServletException;
import org.codehaus.jackson.JsonFactory;
import org.codehaus.jackson.JsonGenerationException;
View Nested Paragraph Systems in CQ5
Set up your file structure for the innerParsys component:
-> parsys
-> new
- _cq_editConfig.xml
- .content.xml
- _cq_editConfig.xml
- .content.xml
- parsys.jsp
View gist:5703092
Assuming the base URL to be this (need to edit to fit yours):
Search UI:
View dialog.xml
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="" xmlns:jcr="" jcr:primaryType="cq:Dialog"
<listeners jcr:primaryType="nt:unstructured"
loadcontent="function(dialog) {
// call servlet or perform arbitrary javascript functions
}" />
<items jcr:primaryType="cq:WidgetCollection">
View vlt add remove
# remove from CRX all files deleted from file system
$ vlt st | grep ! | cut -c 2- | xargs -I {} vlt rm {}
# add to CRX all files not yet in vlt control
$ vlt st | grep \? | cut -c 2- | xargs -I {} vlt add {}
# add all missing files into the CRX
vlt st | grep ^A | cut -c 2- | xargs -I {} vlt commit --force {}
# copy all modified files into the CRX
View ga.jsp
<%@ page language="java"
View gist:5703138
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"
View mavenize-cq5-dependencies
#! /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
View alias.txt
# 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
You can’t perform that action at this time.