Expand my Community achievements bar.

SOLVED

extract html from jcr node using static agent + replication

Avatar

Level 2

AlI need is the header file and footer file  saved to the server file system when the  user hits the page. I have read a post from this forum and a blog a number of times. The post titled "Extract html content from jcr node" on 2/2/2012 by Shelly Goel.  The blog is "How to use static agent in CQ/ WEM" by Yogesh Upadhhyay.

I would think I would have the static agent configured on publish but there is only the ability to do reverse replication?  What I want is  the header and footer that is created by the user when he makes a locale selection for CQ5 to

save this header and footer on the file system so the server scripts  send this correct footer and header to the partner site and they will display the same footer and header the user was just on so they think they are still on our site.with a different page.

I don't need any form data to be replicated back to author and don't understand why you would want that so I am configuring the static agent on author.  As far as I know the author is for authoring pages so it would seem to me I need to configure the static agent on publish but as I said there is only the ability to do reverse replication which I don't think is what I want.

 

Then in http://host:4502/system/console/configMgr   I'm not really sure what needs to be done here since the default looks like it is already set to be 4502 port? The choices are Save, Delete, Unbind so I just choose Save.  By the way I am testing this locally not on production so maybe on production the port changes?  But if I am supposed to change something here I don't know what it is.    The only reason it should be on author I can think of is you could test it on the 4502 author port possibly.  I haven't figured out how to test localhost publish.

 

Thanks for any advice.

1 Accepted Solution

Avatar

Correct answer by
Level 10

Your requirement is when user access the page to pass header & footer to partner side.  I do not know how replication agent fit here because the event is not triggered at cq5 but at the browser.  Also locale various based on user preference.  With being said you are at wrong place to extract html from jcr node using static agent .

If i understand your requirement correctly there are various options & below is one of them.

  1. In your server script make a direct http call (using curl etc..) to header (Ex:-  [1] ) and similarly footer and save at file system & then pass to partner site.
  2. For server script to know user page request and triggering point of user access request make use of  servlet that respond to the url using auth_checker.  An example of different use case at [2].  In that servlet trigger your server script & pass the required parameters.

Hope it make sense.

[1]    http://localhost:4503/content/geometrixx-outdoors/en/jcr:content/par/header_0.html

[2]    http://helpx.adobe.com/experience-manager/kb/PSCachingDelivery.html

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

Your requirement is when user access the page to pass header & footer to partner side.  I do not know how replication agent fit here because the event is not triggered at cq5 but at the browser.  Also locale various based on user preference.  With being said you are at wrong place to extract html from jcr node using static agent .

If i understand your requirement correctly there are various options & below is one of them.

  1. In your server script make a direct http call (using curl etc..) to header (Ex:-  [1] ) and similarly footer and save at file system & then pass to partner site.
  2. For server script to know user page request and triggering point of user access request make use of  servlet that respond to the url using auth_checker.  An example of different use case at [2].  In that servlet trigger your server script & pass the required parameters.

Hope it make sense.

[1]    http://localhost:4503/content/geometrixx-outdoors/en/jcr:content/par/header_0.html

[2]    http://helpx.adobe.com/experience-manager/kb/PSCachingDelivery.html

Avatar

Level 2

many thanks for getting me on the right road