page property updating for a field

Avatar

Avatar
Level 1
Gowtham2109
Level 1

Likes

0 likes

Total Posts

5 posts

Correct reply

0 solutions
View profile

Avatar
Level 1
Gowtham2109
Level 1

Likes

0 likes

Total Posts

5 posts

Correct reply

0 solutions
View profile
Gowtham2109
Level 1

23-02-2021

How to update a page property field with the value of path to the asset which has been publish in author.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Establish
MVP
BrianKasingli
MVP

Likes

645 likes

Total Posts

606 posts

Correct reply

239 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile

Avatar
Establish
MVP
BrianKasingli
MVP

Likes

645 likes

Total Posts

606 posts

Correct reply

239 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile
BrianKasingli
MVP

24-02-2021

I don't think you can upload and publish an asset, which will automagically update page properties for a set of given pages; only because the possibilities and combinations are endless, and there are cases when content authors tend to not follow uploading procedures in the DAM.

Typically in an authoring flow, these things will need to be done manually. 

Author Flow:

1. Upload new image to DAM.

2. Publish the new image.

3. Edit page properties to reference to the new image within the DAM.

4. Publish the page.

Answers (2)

Answers (2)

Avatar

Avatar
Ignite 3
Level 5
davidjgonzalezzzz
Level 5

Likes

70 likes

Total Posts

77 posts

Correct reply

31 solutions
Top badges earned
Ignite 3
Affirm 25
Ignite 1
Give Back 5
Give Back 3
View profile

Avatar
Ignite 3
Level 5
davidjgonzalezzzz
Level 5

Likes

70 likes

Total Posts

77 posts

Correct reply

31 solutions
Top badges earned
Ignite 3
Affirm 25
Ignite 1
Give Back 5
Give Back 3
View profile
davidjgonzalezzzz
Level 5

24-02-2021

I think @BrianKasingli hit this one on the head.

If youre dead set on automating this through custom code, two approaches to look at are:

 

First approach, Update Activate WF Model

 

1. Remove replication ACLs on the content so the Activate Workflow Model is invoked when a user tries to Publish

2. Augment this Workflow Model to include a new Custom WF Process Step

3. This Custom WF Process Step would have available to it the path of the Asset being activated, at which point you'd have to be able to write some logic that knows how to locate the pages whose page property needs to be updated w/ the asset's path. (This assumes this logic is code-able).

 

Second approach, (I like the WF approach better, though this is a little more low-level and will get involved no matter how an asset is replicated, whereas the former requires a click on the Publish button) and involves listening for Replication events and responding to them.

 

1. Create a custom Event Handler that listens for the Replication Event Topic (example here [1])

2. This spawns a Job to update the page properties based on the event's path. You'd want to do the search for the pages and updating of the properties in the Job itself since that might take a "long time" (few 100s of milliseconds vs 1-10s)

 

Again, you'd need to be able to write logic in the Job to find the pages to update (just like in the WF). The guts of both approaches is nearly identical, it's just which AEM-hook invokes it.

 

[1] https://github.com/Adobe-Consulting-Services/acs-aem-commons/blob/master/bundle/src/main/java/com/ad...

 

 

Avatar

Avatar
Ignite 1
MVP
Ankur_Khare
MVP

Likes

159 likes

Total Posts

370 posts

Correct reply

58 solutions
Top badges earned
Ignite 1
Validate 10
Validate 1
Give Back 50
Give Back 5
View profile

Avatar
Ignite 1
MVP
Ankur_Khare
MVP

Likes

159 likes

Total Posts

370 posts

Correct reply

58 solutions
Top badges earned
Ignite 1
Validate 10
Validate 1
Give Back 50
Give Back 5
View profile
Ankur_Khare
MVP

24-02-2021

Could you please explain bit more what exactly you are trying to achieve?