Skip to content

Instantly share code, notes, and snippets.

View saulovenancio's full-sized avatar

Saulo Venancio saulovenancio

View GitHub Profile
@saulovenancio
saulovenancio / .content.xml
Created February 16, 2018 17:46 — forked from nateyolles/.content.xml
AEM Expression Language
<cancel
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/hyperlink"
text="Cancel"
href="/content/geo${granite:encodeURIPath(requestPathInfo.suffix)}"/>
@saulovenancio
saulovenancio / aemTouchCheckboxDialog.xml
Created February 16, 2018 17:45 — forked from nateyolles/aemTouchCheckboxDialog.xml
AEM Touch UI component dialog checkboxes
<!-- 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
@saulovenancio
saulovenancio / aem-debug
Created February 6, 2018 11:58 — forked from gabrielwalt/aem-debug
Run AEM in debug mode
java -jar cq-quickstart-6.0.0.jar -debug 10123
@saulovenancio
saulovenancio / JcrQueryLibrary.md
Created October 27, 2017 15: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

@saulovenancio
saulovenancio / aemClassicSelectionCheckboxDialog.xml
Created November 22, 2016 16:16 — forked from nateyolles/aemClassicSelectionCheckboxDialog.xml
AEM Classic UI component dialog checkboxes using the selection xtype
<!-- 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
@saulovenancio
saulovenancio / aem_querybuilder_snippets
Created October 6, 2016 01:50 — forked from paulrohrbeck/aem_querybuilder_snippets
AEM/CQ Querybuilder snippet
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()));
@saulovenancio
saulovenancio / gist:5c2bf55ba8579c799dd9
Created March 23, 2016 15:30 — forked from auniverseaway/gist:21800b9a7848b2bf880c
Maven AEM Archetype 10 install command

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;
@saulovenancio
saulovenancio / css_resources.md
Created January 20, 2014 16:41 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides