Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

How to get page's content info before replication(DELETE)?

Avatar

Avatar
Validate 1
Level 2
yaraslaud208334
Level 2

Likes

2 likes

Total Posts

28 posts

Correct Reply

3 solutions
Top badges earned
Validate 1
Boost 1
Applaud 5
Affirm 3
Affirm 1
View profile

Avatar
Validate 1
Level 2
yaraslaud208334
Level 2

Likes

2 likes

Total Posts

28 posts

Correct Reply

3 solutions
Top badges earned
Validate 1
Boost 1
Applaud 5
Affirm 3
Affirm 1
View profile
yaraslaud208334
Level 2

18-02-2016

I need to collect some info from page properties and child nodes properties befor replication(delete) occurs

If i implement EventHandler 

@Component(immediate = true) @Service @Property(name = EventConstants.EVENT_TOPIC, value = ReplicationAction.EVENT_TOPIC) public class RedisVideoUpdaterService implements EventHandler { .................. public void handleEvent(Event event) { ReplicationAction action = ReplicationAction.fromEvent(event); ReplicationActionType actionType = action.getType(); if (actionType.equals(ReplicationActionType.DELETE)) { //process data collecting } ...............

After `handelEvent` triggered there page is already deleted.

If i implement Preprocessor:    

@Component(immediate = true) @Service public class RedisVideoUpdaterService implements Preprocessor{ .................. public void preprocess(ReplicationAction action, ReplicationOptions replicationOptions) throws ReplicationException { ReplicationActionType actionType = action.getType(); if (actionType.equals(ReplicationActionType.DELETE)) { //process data collecting } ...............

`preprocess` method is not triggered at all on delete action.

Both cases are OK for actiovation/deactivation.

How can I process page before it have been deleted?

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
Level 2
yaraslaud208334
Level 2

Likes

2 likes

Total Posts

28 posts

Correct Reply

3 solutions
Top badges earned
Validate 1
Boost 1
Applaud 5
Affirm 3
Affirm 1
View profile

Avatar
Validate 1
Level 2
yaraslaud208334
Level 2

Likes

2 likes

Total Posts

28 posts

Correct Reply

3 solutions
Top badges earned
Validate 1
Boost 1
Applaud 5
Affirm 3
Affirm 1
View profile
yaraslaud208334
Level 2

19-02-2016

As I noticed. Preppocessor triggered on delete only for activated pages. This behaviour is ok for me.

Answers (2)

Answers (2)

Avatar

Avatar
Validate 1
Level 2
yaraslaud208334
Level 2

Likes

2 likes

Total Posts

28 posts

Correct Reply

3 solutions
Top badges earned
Validate 1
Boost 1
Applaud 5
Affirm 3
Affirm 1
View profile

Avatar
Validate 1
Level 2
yaraslaud208334
Level 2

Likes

2 likes

Total Posts

28 posts

Correct Reply

3 solutions
Top badges earned
Validate 1
Boost 1
Applaud 5
Affirm 3
Affirm 1
View profile
yaraslaud208334
Level 2

19-02-2016

I configured Custom Workflow via Workflow Launcher Configuration on 'removed' Event type. Result the same as for first case.

Workflow executed after page has been deleted.

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,406 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,406 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

18-02-2016

I would explore the workflow route. Write a workflow that perform the action you want. THen write a custom step to get the workflow item (page) and then read the props before performing the replicate or delete action,