This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.nateyolles.aem; | |
import org.osgi.framework.InvalidSyntaxException; | |
import org.osgi.service.cm.Configuration; | |
import org.apache.felix.scr.annotations.Reference; | |
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Adding include/exclude rules to CQ/AEM package filters through cURL. | |
# Through a simple search, you will find numerous lists of CQ/AEM cURL commands. | |
# However, I haven't seen an example of adding rules to package filters. The | |
# JSON "rules" key takes an array value. You can leave the array empty if you | |
# don't need to include any rules. The array is of JSON objects with a | |
# "modifier" key and value of "include" or "exclude", and a "pattern" key with | |
# your path or regular expression as the value. | |
# create package |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.nateyolles.aem; | |
import org.apache.sling.api.resource.Resource; | |
import org.apache.sling.api.resource.ResourceResolver; | |
import org.apache.sling.commons.json.JSONException; | |
import org.apache.sling.commons.json.JSONObject; | |
import org.apache.sling.commons.json.jcr.JsonItemWriter; | |
import javax.jcr.Node; | |
import javax.jcr.RepositoryException; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<items jcr:primaryType="nt:unstructured"> | |
<widgetAlways | |
jcr:primaryType="nt:unstructured" | |
sling:resourceType="granite/ui/components/foundation/form/textfield" | |
fieldLabel="This always shows" | |
name="./widgetAlways"/> | |
<widgetHeaderChrome | |
jcr:primaryType="nt:unstructured" | |
sling:resourceType="granite/ui/components/foundation/form/textfield" | |
fieldLabel="This only shows when header "User-Agent" contains "chrome"" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.nateyolles.aem; | |
import org.apache.felix.scr.annotations.Reference; | |
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.SlingSafeMethodsServlet; | |
import org.apache.sling.engine.SlingRequestProcessor; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.nateyolles.aem.osgiannotationdemo.core.services.impl; | |
import org.apache.commons.lang3.StringUtils; | |
import org.osgi.service.metatype.annotations.AttributeDefinition; | |
import org.osgi.service.metatype.annotations.AttributeType; | |
import org.osgi.service.metatype.annotations.ObjectClassDefinition; | |
import org.osgi.service.metatype.annotations.Option; | |
@ObjectClassDefinition(name = "Annotation Demo Service - OSGi") | |
public @interface Configuration { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<granite:rendercondition | |
jcr:primaryType="nt:unstructured" | |
sling:resourceType="granite/ui/components/coral/foundation/renderconditions/simple" | |
expression="${param.biz == 'baz'}" | |
expression="${empty param.foo}" | |
expression="${not empty param.foo and not empty param.bar}" | |
expression="${param['foo'] not eq 'bar'}" | |
expression="${cookie.cookiename.value eq 'foo'}" | |
expression="${requestPathInfo.selectorString == 'edit'}" | |
expression="${requestPathInfo.suffix != '/foo/bar')}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.nateyolles.sling.publick.services.impl; | |
import java.io.IOException; | |
import java.util.Dictionary; | |
import java.util.Hashtable; | |
import java.util.Map; | |
import org.apache.commons.lang.StringUtils; | |
import org.apache.felix.scr.annotations.Component; | |
import org.apache.felix.scr.annotations.Reference; |
NewerOlder