- What is Sling Pipes ?
- Different Types of Pipes
- Executing Pipes
What is sling pipes ?
- Toolset for performing extract, load & transform operations on content within JCR repository using reusable code blocks called pipes.
Why sling pipes ?
- Let’s say business requests us to enable override title & description on all game pages
- OR due to a component update we had to remove/modify a property in all occurrences of that component’s node
- OR create a CSV of pages which are using image components
- Sling pipes is not included with vanilla AEM installation, following bundles have be to installed:
- Create the node hierarchy: /system/sling/permissions/pipes/exec
- Note: For updating which groups can run sling pipes on a AEM instance, update Apache Sling Pipes : Plumber configuration
What is sling Query ?
- Note: Sling query is not a replacement of JCR query, its just a tool for making traversal of resources easier, more details can be found here: sling query
Types of pipes
- Reader Pipes – only used for reading resources, usually used with writer & logical pipes
- Writer Pipes – used for performing write, update, move or remove operations in JCR repository, can even create packages
- Logical Pipes - can be used for referring to other pipes, chaining them or using their results in a general way
- A Pipe can persist in JCR
- Groovy console
- Java class
- HTTP call to JCR persisted pipe
- PipeModel Sling Model
- Base Pipe: echo(path)
- Xpath pipe: xpath(expr)
- Sling Query Pipes
- Find pipe: $(expr)
- Children Pipe: children(expr)
- Siblings Pipe: siblings(expr)
- Parent Pipe: parent()
- Closest Pipe: closest(expr)
- Write Pipe: write(conf)
- Path Pipe: mkdir(expr)
- Move pipe: mv(expr)
- Remove Pipe: rm()
- Package Pipe: pkg(expr)