Skip to content

Instantly share code, notes, and snippets.

View daehwann's full-sized avatar

daehwan daehwann

  • Seoul, Korea
  • 13:55 (UTC +09:00)
View GitHub Profile
@daehwann
daehwann / JcrQueryLibrary.md
Created February 26, 2017 14:45 — forked from floriankraft/JcrQueryLibrary.md
Some useful JCR queries (XPATH, SQL2) for AEM/CQ development.

SQL2

All nodes with a specific name

SELECT * FROM [nt:unstructured] AS node
WHERE ISDESCENDANTNODE(node, "/search/in/path")
AND NAME() = "nodeName"

All pages below content path

@daehwann
daehwann / gist:b6c87c41b5eed1e1881903497278e99a
Created June 1, 2016 03:16 — forked from engagency-jclifton/gist:8462444
Authenticating with Apache Sling
<form method="post" action="/j_security_check">
<p>
You're not logged in. Wouldn't you like to do so?
</p>
<p>
<label for="j_username">Username</label><br />
<input id="j_username" name="j_username" type="text" />
</p>
<p>
<label for="j_password">Password</label><br />
@daehwann
daehwann / SampleEventHandler.java
Created April 12, 2016 04:07 — forked from cqtips/SampleEventHandler.java
Listening for Sling events using OSGi service.
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Properties;
import org.apache.felix.scr.annotations.Property;
import org.apache.felix.scr.annotations.Service;
import org.apache.sling.api.SlingConstants;
import org.apache.sling.event.EventUtil;
import org.apache.sling.event.jobs.JobProcessor;
import org.apache.sling.event.jobs.JobUtil;
import org.osgi.service.event.Event;
import org.osgi.service.event.EventConstants;