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
@Component( | |
immediate = true, | |
service = Servlet.class, | |
property = { | |
"sling.servlet.resourceTypes=project/components/component" | |
} | |
) | |
@Designate(ocd = SampleOsgiServlet.Configuration.class) | |
public class SampleOsgiServlet extends SlingSafeMethodsServlet { |
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
@Component( | |
service = Servlet.class, | |
property = { | |
"sling.servlet.extensions=html", | |
"sling.servlet.selectors=foo", | |
"sling.servlet.paths=/bin/foo", | |
"sling.servlet.paths=/bin/bar", | |
"sling.servlet.methods=get", | |
"sling.servlet.resourceTypes=nt:file", | |
"sling.servlet.resourceTypes=project/components/component" |
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
@SlingServlet( | |
metatype = true, | |
paths = { | |
"/bin/foo", | |
"/bin/bar" | |
}, | |
extensions = {"html"}, | |
selectors = {"foo"}, | |
resourceTypes = {"nt:file", "project/components/component"} | |
methods = "GET", |
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
$.ajax({ | |
url: 'https://scheduler.bookedin.com/api/v1/companies/nurtured-by-nature/dayAvailability?from=2017-01-01&to=2018-01-31', | |
dataType: 'jsonp', | |
success: function(data) { | |
for (var x = 0; x < data.months.length; x++) { | |
if (data.months[x].availability.length > 0) { | |
alert('opening found'); | |
} | |
} | |
}, |
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
<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
<widgetCustomRenderConditionHasProperty | |
jcr:primaryType="nt:unstructured" | |
sling:resourceType="granite/ui/components/foundation/form/textfield" | |
fieldLabel="This only shows if "/content/renderconditiondemo/en/jcr:content/par/text" has property "text"" | |
name="./widgetCustomRenderConditionHasProperty"> | |
<granite:rendercondition | |
jcr:primaryType="nt:unstructured" | |
sling:resourceType="renderconditiondemo/components/renderconditions/hasProperty" | |
resourcePath="${requestPathInfo.suffix}" | |
propertyName="text"/> |
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
<%-- | |
============================================================================== | |
has property render condition | |
A condition that takes a resource path and property name and makes the | |
rendering decision based on whether that resource has the property. | |
/** | |
* The resource path of the resource to evaluate. | |
*/ | |
- resourcePath (String) | |
/** |
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
<cancel | |
jcr:primaryType="nt:unstructured" | |
sling:resourceType="granite/ui/components/foundation/hyperlink" | |
text="Cancel" | |
href="/content/geo${granite:encodeURIPath(requestPathInfo.suffix)}"/> |
NewerOlder