Skip to content

Instantly share code, notes, and snippets.

<sly data-sly-test.hasType="${properties.productType}">
<pre>This product is a: ${properties.productType}</pre>
<pre>Specs</pre>
<pre data-sly-test="${properties.productType == 'phone' && properties.os}">Operating system: ${properties.os}</pre>
<pre data-sly-test="${properties.productType == 'phone' && properties.camera}">Camera: ${properties.camera}</pre>
<pre data-sly-test="${properties.productType == 'laptop' && properties.screenSize}">Screen size: ${properties.screenSize}</pre>
<pre data-sly-test="${properties.productType == 'laptop' && properties.keyboardLayout}">Keyboard layout: ${properties.keyboardLayout}</pre>
<pre data-sly-test="${properties.productType == 'tv' && properties.hdr}">Supports HDR: ${properties.hdr}</pre>
<pre data-sly-test="${properties.productType == 'tv' && !properties.hdr}">Supports HDR: false</pre>
<pre data-sly-test="${properties.productType == 'tv' && properties.resolution}">Resolution: ${properties.resolution}</pre>
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:granite="http://www.adobe.com/jcr/granite/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:primaryType="nt:unstructured"
jcr:title="Properties"
sling:resourceType="cq/gui/components/authoring/dialog">
<content
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/fixedcolumns">
<items jcr:primaryType="nt:unstructured">
<column
/* Hides the Image component file upload button */
.fdImageUploadGroup coral-fileupload.fdImageFileUpload {
display: none;
}
/* Makes the Image component Browse Assets button border properly rounded */
.fdpathfield .coral-InputGroup .coral-InputGroup-button > button.coral3-Button.coral3-Button--secondary {
border-radius: 0.25rem;
}
(function($) {
$(window).adaptTo("foundation-registry").register("foundation.validation.validator", {
selector: '[name="./jcr:content/metadata/dc:title"]',
validate: function(element) {
const wrapper = $(element).parents().eq(1);
// Apply only if schema is wknd-default
if(!wrapper
import javax.annotation.PostConstruct;
public interface StaticDataSourceModel {
@PostConstruct
void init();
}
import com.tipi.core.models.StaticDataSourceModel;
import com.tipi.core.services.DataSourceService;
import lombok.extern.slf4j.Slf4j;
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.models.annotations.Model;
import org.apache.sling.models.annotations.injectorspecific.OSGiService;
import org.apache.sling.models.annotations.injectorspecific.Self;
import org.osgi.service.component.annotations.Component;
import javax.annotation.PostConstruct;
import lombok.NonNull;
import org.apache.sling.api.SlingHttpServletRequest;
public interface DataSourceService {
SlingHttpServletRequest getDataFromSource(@NonNull SlingHttpServletRequest request);
}
import com.adobe.granite.ui.components.ds.DataSource;
import com.adobe.granite.ui.components.ds.SimpleDataSource;
import com.adobe.granite.ui.components.ds.ValueMapResource;
import com.day.crx.JcrConstants;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.tipi.core.services.DataSourceService;
import lombok.Getter;
import lombok.NonNull;
import lombok.Setter;