This year due to pandemic many things has changed including the way people invest in money. There are a lot of ways of investment. From a YouTube channel, I just heard different stocks that gain big…
Recently one AEM implementation query came to my notice and it really excited me to explore following JCR property named: predicate and AbstractNodePredicate class and of course it helped me to learn their usages also.
Let’s get started with query and implementation steps.
The query was how can we filter/restrict digital assets based on certain types during selection via touch ui pathbrowser.
Inside DAM under a specific folder we can have different types assets like .pdf, .jpg, .jpeg, .png, .mp4 but the ask is only .jpg, .jpeg, .png, .mp4 will be available for content authors while content authoring via pathbrowser field.
Now we have two choice in terms of implementation -
Choice 1. Client side validation
Choice 2. Server side validation
Yes, you are correct I will talk about Server side validation here.
The business logic i.e. filtering logic has been defined in below implementation class -
if you take a closer look in above class I have defined property = { “predicate.name=my-imagevideopredicate” } and we need to use this value later -
Now the component dialog part has been given below -
Steps to validate -
Below we could see that I have kept different types of assets under /content/dam/demo -
But as per the logic only .jpg, .jpeg, .png, .mp4 are available for content authors as shown below -
Before writing this sample logic I did some analysis to understand the property: predicate and AbstractNodePredicate class.
I am sharing that details also here -
If we execute below SQL2 query, it will give us list of nodes with predicate property and coral3 pathbrowser -
SELECT * FROM [nt:base] AS s WHERE ISDESCENDANTNODE([/libs]) and predicate is not null and [sling:resourceType] = ‘granite/ui/components/coral/foundation/form/pathbrowser’
one of the result is /libs/screens/core/components/content/app/cq:dialog/content/items/column/items/app-path and it is also using predicate property(allowing only AEM pages).
OSGi component and bundle details associated with OOTB Application component has been given below -
I am really thankful to AEM experience league community that gave me opportunity to explore this feature.
Please refer the below useful link -
Please review and share your valuable thoughts.
Every year we see technology developments grow to enormous lengths as the rate of innovation increases YoY. A couple of years ago, I started to keep track of the major tech trends that have developed…
Acho que essa minha mania de contar meus “causos” vem do meu bisavô. Uma das histórias dele que eu adorava era de como ele conheceu minha bisavó — ele tocando com sua banda, ela na platéia. Na…
Mirror has strategically partnered with cross-chain data oracle Band Protocol, successfully integrating price feeds for an initial set of assets, covering blue chip stocks, commodities and ETFs. To…