This file contains hidden or 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
<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> |
This file contains hidden or 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
<?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 |
This file contains hidden or 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
(function() { | |
$(window).adaptTo("foundation-registry").register("foundation.collection.action.action", { | |
name: "cq.wcm.copyAssetLink", | |
handler: function() { | |
console.log('Copy link button clicked'); | |
} | |
}); | |
})(); |
This file contains hidden or 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
(function(window, document, Granite, $) { | |
console.log('copyAssetLink.js loaded'); | |
$(window).adaptTo("foundation-registry").register("foundation.collection.action.action", { | |
name: "cq.wcm.copyAssetLink", | |
handler: function(name, el, config, collection, selections) { | |
if (selections.length != 1) { | |
return; | |
} |
This file contains hidden or 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
/* 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; | |
} |
This file contains hidden or 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
(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 |
This file contains hidden or 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
import javax.annotation.PostConstruct; | |
public interface StaticDataSourceModel { | |
@PostConstruct | |
void init(); | |
} |
This file contains hidden or 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
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; |
This file contains hidden or 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
import lombok.NonNull; | |
import org.apache.sling.api.SlingHttpServletRequest; | |
public interface DataSourceService { | |
SlingHttpServletRequest getDataFromSource(@NonNull SlingHttpServletRequest request); | |
} |
This file contains hidden or 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
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; |