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
<cancel | |
jcr:primaryType="nt:unstructured" | |
sling:resourceType="granite/ui/components/foundation/hyperlink" | |
text="Cancel" | |
href="/content/geo${granite:encodeURIPath(requestPathInfo.suffix)}"/> |
<!-- Checked checkbox will result in a String property of "true" --> | |
<myCheckbox | |
jcr:primaryType="nt:unstructured" | |
sling:resourceType="granite/ui/components/foundation/form/checkbox" | |
text="My Checkbox" | |
name="./myCheckbox" | |
value="true"/> | |
<!-- Checked checkbox will result in a Boolean property of true--> | |
<myBooleanCheckbox |
java -jar cq-quickstart-6.0.0.jar -debug 10123 |
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
<!-- Checked checkbox will result in a String property of "true" --> | |
<myCheckbox | |
jcr:primaryType="cq:Widget" | |
fieldLabel="My Checkbox" | |
name="./myCheckbox" | |
type="checkbox" | |
xtype="selection"/> | |
<!-- Checked checkbox will result in a Boolean property of true--> | |
<myBooleanCheckbox |
Find pages with CUG on it: | |
path=/content | |
type=cq:PageContent | |
property=cq:cugEnabled | |
property.value=true |
// Get our current resolver. | |
ResourceResolver resolver = request.getResourceResolver(); | |
// Adapt to an anonymous session and get the repo as anonymous. | |
JackrabbitSession session = (JackrabbitSession) resolver.adaptTo(Session.class); | |
Repository repository = session.getRepository(); | |
// Create a new session by logging into using the default admin username and password. | |
Session adminSession = repository.login(new SimpleCredentials("admin", "admin".toCharArray())); |
Adobe's docs aren't quite updated to reflect the changes in the archetype. You can get the new hotness by using this 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 \
-Dversion=1.0-SNAPSHOT \
package org.millr.core.servlets; | |
import java.io.IOException; | |
import java.rmi.ServerException; | |
import org.apache.felix.scr.annotations.sling.SlingServlet; | |
import org.apache.sling.api.SlingHttpServletRequest; | |
import org.apache.sling.api.SlingHttpServletResponse; | |
import org.apache.sling.api.servlets.SlingAllMethodsServlet; | |
import org.apache.sling.commons.json.JSONObject; |