Hi Kaushall,
Sorry i was referring to the "fluent" language that was proven to be needed to
communicate over something else than node structures (that was kind of ruining
the point). I'm preparing another even simpler alternative in [1] that will
make those conversations better.
Back to your point, I think you could :
- search for the node directly using sling query, or modifying your xpath query
with something like element(*,nt:base)[@cq:cloudserviceconfigs], and then just
chain with the mv pipe with a "path" property value of 'cloudserviceconfigs',
which will put the current resource to be the property,
- my bad, but chaining directly the write will write on the resource, that is
do nothing, so you should add a path property on the pipe too, with value of
the first one so here "${path.findNodes}"
Then it should work.
For the move one, you can chain the same findNode pipe with a move pipe, that
has as a path input 'tmp' and as an expr 'cq:cloudserviceconfigs'. Don't forget
to add the property overrideTarget=true
Nicolas
[1] https://issues.apache.org/jira/browse/SLING-9556
On 09/07/2020 00:14, "Kaushal Mall" <[email protected]> wrote:
Thanks Nicolas. Unfortunately, I am still confused on this the below
translates to a node structure for my pipe. [0] is what I have right now.
* findNodes pipe finds all nodes of cq:Page nodes that have
jcr:content/cq:cloudserviceconfigs property set
* pageContentNode pipe gets the “jcr:content” node for the cq:Page
* cloudServiceConfig pipe is looking for the cq:cloudserviceconfigs
property
* writeTempProperty pipe will then write all the values returned by
cloudServiceConfig to a temp property named “tmp”
Running this pipe doesn’t actually write the tmp property on my jcr:content
node. Also, I am not sure what the move pipe config should be after the
writeTempProperty pipe to move “tmp” to “cq:cloudserviceconfigs” property.
Thanks in advance.
[0]
cloudServiceConfigsUpdatePipe:
{
*
jcr:primaryType: "sling:Folder",
*
jcr:createdBy: "admin",
*
status: "finished",
*
jcr:created: "Tue Jul 07 2020 14:35:00 GMT-0700",
*
statusModified: "Wed Jul 08 2020 15:02:02 GMT-0700",
*
sling:resourceType: "slingPipes/container",
*
conf:
{
*
jcr:primaryType: "sling:OrderedFolder",
*
jcr:createdBy: "admin",
*
jcr:created: "Tue Jul 07 2020 14:35:00 GMT-0700",
*
findNodes:
{
*
jcr:primaryType: "sling:Folder",
*
jcr:createdBy: "admin",
*
jcr:created: "Tue Jul 07 2020 14:35:00 GMT-0700",
*
expr: "/jcr:root/content/ni/master/home/validation//element(*,
cq:Page)[(jcr:content/@cq:cloudserviceconfigs)]",
*
sling:resourceType: "slingPipes/xpath"
},
*
pageContentNode:
{
*
jcr:primaryType: "nt:unstructured",
*
expr: "#'jcr:content'",
*
sling:resourceType: "slingPipes/children"
},
*
cloudServiceConfig:
{
*
jcr:primaryType: "nt:unstructured",
*
path: "cq:cloudserviceconfigs",
*
sling:resourceType: "slingPipes/multiProperty"
},
*
writeTempProperty:
{
*
jcr:primaryType: "nt:unstructured",
*
sling:resourceType: "slingPipes/write",
*
conf:
{
*
jcr:primaryType: "nt:unstructured",
*
tmp: "+[${cloudServiceConfig}]"
}
}
}
}
Kaushal Mall | Sr. Principal Consultant | 480-512-2260
Have you been impressed by an AEM Consulting resource? Please take a
minute to let us know!
Our new AEM
Appreciate<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fforms.office.com%2FPages%2FResponsePage.aspx%3Fid%3DWht7-jR7h0OUrtLBeN7O4Wt4SlUkSKNJhPA9dqz9FkBUQVZNNDJONzhHTFREMTExQktPUFAwNDVFVC4u&data=02%7C01%7Cnpeltier%40adobe.com%7C7f3b396f5fae43df929c08d8238c5443%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637298432912519228&sdata=Pt0IrED6eZzJ6018hyTK8s%2FER8AJv6sVCxOP3D9uNGY%3D&reserved=0>
program makes it quick and easy to provide your feedback and help us to
recognize our top performers.
On Jul 8, 2020, at 1:45 AM, Nicolas Peltier
<[email protected]<mailto:[email protected]>> wrote:
Hi Kaushall,
Multivalue pipe only role is to fork the flow for each value of the MV
property, adding the value in the bindings.
I think you should write to a temp property before moving it back
So something like plumber.newPipe(resourceResolver)
.echo("/etc/your/configuration/mvProperty")
.mp().name("mvProp")
.write("temp", "+[${mvProp}]")
.run()
And then
.echo("/etc/your/configuration/temp").mv("/etc/your/configuration/mvProperty").with("overwriteTarget",
true).run()
Hope this helps,
Nicolas
On 07/07/2020 21:19, "Kaushal Mall"
<[email protected]<mailto:[email protected]>> wrote:
Hi All,
I have a use case described below to update a particular multi value
property and hoping someone can help me with the appropriate Sling Pipe
configuration.
There are certain nodes of type cq:PageContent with a property
cq:cloudservices (string[]) where the value can be similar to
/etc/cloudservices/mycloudconfig1/cloudconfig,
/etc/cloudservices/mycloudconfig2/cloudconfig
The pipe needs to find the nodes where this property is set and change
the value and replace “/etc/cloudservices” part of the path with
“/conf/global/settings”
I am unsure how to write a multi value property using a pipe. I can get
the appropriate nodes by using the xpath pipe and read the values using a multi
value pipe (I think), but, not sure how to do string manipulation and write the
values back.
Does anyone know how to read and write the values for this use case?
Thanks in advance.
Kaushal Mall | Technical Architect | 480-512-2260 |
https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fblogs.adobe.com%2Fcontentmanagement&data=02%7C01%7Cnpeltier%40adobe.com%7C7f3b396f5fae43df929c08d8238c5443%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637298432912519228&sdata=wspgUs8ZxK90eJaBgr0oCYc6ms3vXr0PtOMszBpBJQ8%3D&reserved=0
Have you been impressed by an AEM Consulting resource? Please take a
minute to let us know!
Our new AEM
Appreciate<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fforms.office.com%2FPages%2FResponsePage.aspx%3Fid%3DWht7-jR7h0OUrtLBeN7O4Wt4SlUkSKNJhPA9dqz9FkBUQVZNNDJONzhHTFREMTExQktPUFAwNDVFVC4u&data=02%7C01%7Cnpeltier%40adobe.com%7C7f3b396f5fae43df929c08d8238c5443%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637298432912519228&sdata=Pt0IrED6eZzJ6018hyTK8s%2FER8AJv6sVCxOP3D9uNGY%3D&reserved=0>
program makes it quick and easy to provide your feedback and help us to
recognize our top performers.