Fetching Node Property during replication | Community
Skip to main content
manish_anand
Level 3
July 23, 2018
Question

Fetching Node Property during replication

  • July 23, 2018
  • 20 replies
  • 6252 views

Hi,

I might be bit silly to ask but please let me know if there is any Replication API which can fetch a property of a node during replication.

example:

I am getting path of the content which is getting replicated by replicationAction.getPath().

Is there any way i can fetch few properties from this path as well during replication. i need properties from Author Instance.

I need it for Akamai AEM SYNC.

Regards,

Anand

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

20 replies

arunpatidar
Community Advisor
Community Advisor
July 23, 2018

Hi,

Above methods returns the path which is string. From string you can get the Node and from Node you can get properties.

from workflow session you can get it like below -

Node node = (Node) session.getSession().getItem(path);

Node (Content Repository for Java Technology API Version 2.0)

Arun Patidar
smacdonald2008
Level 10
July 23, 2018

Nice response!

manish_anand
Level 3
July 23, 2018

But isnt it going to give properties from publish instance?

i need properties from author instance which are getting replicated on publish instance.

regards,

manish

joerghoh
Adobe Employee
Adobe Employee
July 23, 2018

That's not possible. You cannot cross these boundaries that easily (for a good reason).

If you want authoring properties to be available on publish as well, you have to replicate them. In your case why don't you attach these properties on author to the node which is going to be replicated?

Jörg

manish_anand
Level 3
July 23, 2018

Hi Jorg,

i have created an akamai agent which reads replication. I am trying to read a property at author and process my request at akamai.

if i attach a property to a node in author instance , and if i want to read it on publish instance than i need to replicate it first.

so basically for akamai,my author needs to replicate twice to read that property on publish.

i know durboimporter reads the properties from author during replication but is there any way to fetch properties during replication itself and make it available in my code?

i am fetching conteny path from replicationAction api. I could find any way to fetch properties also.

Regards,

Manish

arunpatidar
Community Advisor
Community Advisor
July 24, 2018

You may try creating a servlet on publisher which will be called from author with credentials and pass path as parameter and as a response returns page properties from publishers.

Author publisher everything except cq:lastReplicationAction, cq:lastreplicated and cq:lastReplicatedBy

but in 1:M or M:M environments you may ended up of making multiple requests.

Arun Patidar
joerghoh
Adobe Employee
Adobe Employee
July 24, 2018

Ok, you lost me. Can you add a diagram (or just a list) describing at which system you should add which data and where you intend to read it?

Jörg

manish_anand
Level 3
July 24, 2018

i want to add a property in author and i want to fetch that same property during replication in publish.

i cant replicate to have that property in piblish and than again replicate to read that property.

i want that property during first replication.

manish_anand
Level 3
July 24, 2018

Making to many calls will be a problem.

joerghoh
Adobe Employee
Adobe Employee
July 24, 2018

Ok, let me try to rephrase it:

1) On author, you add a property "prop" to node "/home/mysite/en/jcr:content"

2) On author, this page is replicated (either through code, or triggered by an user)

3) On any publish, this replication request is received, and the property "prop" is now available on /home/mysite/en/jcr:content

4) On any publish: Your custom action

Is this the order of steps correct? Or did I miss one? Because right now I cannot match my list to your approach, so I am obviously missing something.

Jörg