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
| create group dam-reports with path /home/groups/dam-reports | |
| set ACL for dam-reports | |
| allow jcr:read on /libs/dam/gui/content/reports | |
| allow jcr:read on /libs/dam/gui/content/nav/tools/assets/assetreports | |
| allow jcr:read on /var/dam | |
| allow jcr:read,rep:write,jcr:removeChildNodes on /var/dam/reports | |
| allow jcr:read on /libs/dam/gui/content/reports/generatereport | |
| allow jcr:read on /libs/cq/core/content/nav/tools/assets | |
| end |
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
| def path ="/content/cq:tags/parent" | |
| Resource resource = resourceResolver.getResource(path); | |
| if (resource != null) { | |
| def children = resource.getChildren(); | |
| children.each { child -> | |
| resourceResolver.delete(child); | |
| println "removed:"+child | |
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
| //Using string replace | |
| const x = 'hello {0}, my name is {1}'; | |
| const y = ['world','guy']; | |
| const z = x.replace(/\{\d+\}/g, (match) => (y[match.replace(/\{|\}/g,'')])); | |
| console.log(z); | |
| // Using for each | |
| let s = 'hello {0}, my name is {1}'; | |
| y.forEach((value,index) => { s = s.replace('{'+index+'}',value)}) | |
| console.log(s); |
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
| <outer | |
| jcr:primaryType="nt:unstructured" | |
| sling:resourceType="granite/ui/components/coral/foundation/form/multifield" | |
| composite="{Boolean}true" | |
| fieldLabel="outer"> | |
| <field | |
| jcr:primaryType="nt:unstructured" | |
| sling:resourceType="granite/ui/components/coral/foundation/container" | |
| name="./outerName"> | |
| <items jcr:primaryType="nt:unstructured"> |
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
| package datasources.staticstyles.v1; | |
| 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.cq.commons.jcr.JcrConstants; | |
| import com.day.cq.wcm.api.designer.Designer; | |
| import org.apache.commons.collections.iterators.TransformIterator; | |
| import org.apache.sling.api.SlingHttpServletRequest; | |
| import org.apache.sling.api.resource.Resource; |
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
| Example servlet datasource tied to resourceType located originaly in wcm core components at https://github.com/adobe/aem-core-wcm-components/blob/c15f3a23025322f4b2783da6c257c4e79abb22c9/bundles/core/src/main/java/com/adobe/cq/wcm/core/components/internal/servlets/AllowedHeadingElementsDataSourceServlet.java | |
| /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
| ~ Copyright 2019 Adobe Systems Incorporated | |
| ~ | |
| ~ Licensed under the Apache License, Version 2.0 (the "License"); | |
| ~ you may not use this file except in compliance with the License. | |
| ~ You may obtain a copy of the License at | |
| ~ | |
| ~ http://www.apache.org/licenses/LICENSE-2.0 | |
| ~ |
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
| <attrMap | |
| jcr:primaryType="nt:unstructured" | |
| sling:resourceType="granite/ui/components/coral/foundation/form/multifield" | |
| composite="{Boolean}true" | |
| fieldDescription="x" | |
| fieldLabel="Attribute Map"> | |
| <field | |
| jcr:primaryType="nt:unstructured" | |
| sling:resourceType="granite/ui/components/coral/foundation/container" | |
| name="./attrMap"> |
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' |
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
| /jcr:root/content//element(*,cq:PageContent)[*/*/@sling:resourceType="the/resource/type"] |
NewerOlder