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
| <file | |
| jcr:primaryType="nt:unstructured" | |
| sling:resourceType="granite/ui/components/foundation/form/fileupload" | |
| autoStart="{Boolean}false" | |
| class="cq-droptarget" | |
| fieldLabel="Image asset" | |
| fileNameParameter="./image/fileName" | |
| fileReferenceParameter="./image/fileReference" | |
| mimeTypes="[image]" | |
| multiple="{Boolean}false" |
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
| public String[] getValuesAsStringArray(final Resource resource, final String propertyToExtract){ | |
| try { | |
| final Node node = resource.adaptTo(Node.class); | |
| final Property property = node.getProperty(propertyToExtract); | |
| final Resource childProperty = resource.getChild(propertyToExtract); | |
| if(property.isMultiple() && childProperty != null){ | |
| return childProperty.adaptTo(String[].class); | |
| }else{ | |
| return new String[]{ childProperty.adaptTo(String.class) }; | |
| } |
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
| Granite.UI.Foundation.Registry.get('foundation.validation.validator'); |
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
| #!/usr/bin/env bash | |
| #setup | |
| # in bash profile set an alias for goto alias='goto=. ./goto.sh' | |
| # in bash profile set an alias for goback alias goback=$goback | |
| # Usage: | |
| # goto commonpath | |
| #goto script for lazy people who dont want to have a lot of aliases or keep sourcing the bash profile | |
| #Argument handling |
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
| See http://proliferay.com/create-json-by-jackson-api/ | |
| ObjectMapper om = new ObjectMapper(); | |
| ObjectNode objectNode = om.createObjectNode(); | |
| ArrayNode arrayNode = om.createArrayNode(); |
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
| var tags =$('[data-fieldname="./cq:tags"]’); | |
| var tagList = CUI.Widget.fromElement(CUI.TagList,tags); | |
| tagList.options.values = ['hello','world'] | |
| tagList._setValues() |
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
| var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver; | |
| var container = document.querySelector('paper-dialog.ytd-popup-container'); | |
| var observer = new MutationObserver(function(mutations) { | |
| mutations.forEach(function(mutation) { | |
| console.log(mutation); | |
| if(mutation.attributeName === 'style'){ | |
| if(!(container.style.display === 'none')){ | |
| console.log('triggering click'); | |
| var y = document.querySelector('.yt-confirm-dialog-renderer yt-formatted-string[id="text"]'); |
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
| /jcr:root/content//element(*,cq:PageContent)[*/*/@sling:resourceType="the/resource/type"] |
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
| SELECT * FROM [dam:Asset] AS s WHERE ISDESCENDANTNODE([/content/dam/abc]) and s.[jcr:content/metadata/thing/textfield1] is not null |
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
| select page.* from [cq:Page] as page | |
| inner join [cq:PageContent] as pageContent | |
| on isChildNode(pageContent, page) | |
| inner join [nt:base] as carousel | |
| on isDescendantNode(carousel, pageContent) | |
| inner join [nt:base] as list | |
| on isDescendantNode(list, pageContent) | |
| where isDescendantNode(pageContent, '/content') | |
| and name(pageContent) = 'jcr:content' | |
| and carousel.[sling:resourceType] = 'COMPONENT_ONE' |