Skip to content

Instantly share code, notes, and snippets.

import javax.inject.Inject;
import javax.inject.Named;
import javax.jcr.Session;
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.api.resource.ResourceResolver;
import org.apache.sling.models.annotations.Default;
import org.apache.sling.models.annotations.DefaultInjectionStrategy;
import org.apache.sling.models.annotations.Model;
@Property(label="Select One Value",name="label", options={
@PropertyOption(name="title1",value="value1"),
@PropertyOption(name="title2",value="value2")
},value="defaultvalue", description="Some Description")
private static final String PROPERTY_SCHEDULER_DATASOURCE = "label";
private String label;
//And then
@Activate
protected void activate(final Map<String, Object> config) {
this.lebel = PropertiesUtil.toString(config.get("label"), "some_default_value");
#!/bin/bash
# a script to make it easier for developers to start multiple CQ instances
# Default Settings
version=5.6.1
root=~/dev/cq
publish=
debug="true"
gui=-gui
@dfparker2002
dfparker2002 / aem6_deps.txt
Last active April 3, 2016 10:32
AEM6 Dependencies
To include dependencies for Adobe Experience Manager 6 (AEM6) one can use one of the following
approaches.
a) Use a single dependency that will include other dependencies through transitive dependencies.
Please note that unlike the 2nd approach this approach will not include all dependencies.
<dependency>
<groupId>com.adobe.aem</groupId>
<artifactId>aem-api</artifactId>
<version>6.0.0.1</version>
@markdaugherty
markdaugherty / AbstractValidatorServlet.java
Created April 15, 2012 15:56
Complex validation of CQ5 dialog fields using a custom Sling servlet.
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
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=