Path

ez projects / ezcontentstaging / forum / general / targets with same node


Targets with same node

You need to be logged in to post messages in the forums. New users may register here.

Nicolas Gommenginger

Member since:
10 November 2009

Posts: 17

Monday 11 February 2013 10:28:13 am

Hi,

I have a sync between 2 ezpublish instances for all the contents:



[Target_AllContents]


Subtrees[]=2


Subtrees[]=43


Subtrees[]=5


RemoteSubtrees[]=2


RemoteSubtrees[]=43


RemoteSubtrees[]=5



A cronjob executed every 5 minutes is used to sync this target.

Some contents published in a specific node need to be sync more quickly.
So I thought to add a new target with this specific node and to sync this one with another cronjob exectuted every minutes:



[Target_SpecificContent]


Subtrees[]=SpecificNodeID


RemoteSubtrees[]=SpecificNodeID



My question is ; should I have to exclude this specific node from the target "AllContents"?
Or is it OK to have the same node included in both targets?
Or maybe there's even an other way to do what I need?
Thanks,

Nicolas
Up

Gaetano Giunta

Member since:
30 November 1999

Posts: 269

Monday 11 February 2013 12:25:58 pm

Hello.

I do not think that creating 2 overlapping feed definitions from the same target to the same server is going to work. At least for all cases.

Imagine that the node in question is edited: an event will be added to both feeds, and the change will be synchronized twice. Depening on exact scheduling, maybe feed 1 will sync the change first, maybe feed 2 will.
As long as you only publish new versions of that node, nothing should break, but if you try f.e. to move it or delete it, then only one of the two events will work, the other one will stay pending forever.

The first workaround which comes to my mind is: use the "filter" feature (EventCreationFilters[] in contentstagingsource.ini) so that any event which relates only to the node in question is not added to the queue of the "slow" feed

Principal Consultant International Business
Member of the Community Project Board

Up

Nicolas Gommenginger

Member since:
10 November 2009

Posts: 17

Monday 11 February 2013 5:47:34 pm

Hi Gaetano,
Thanks for the answer.
I tried to add a new filter but I have an issue.
I created the class "eZContentStagingEventCreationCPFilter" in the "classes" folder of the ezcontentstaging extension.
I just copied the "eZContentStagingEventCreationLoggingFilter" to create my class.
I added then the param "EventCreationFilters[]=eZContentStagingEventCreationCPFilter" at the "low" target.
Than I clear the cache, regenerate the autoloads, ...
But when a staging event is created, I have the following error:



[ Feb 11 2013 17:22:58 ] [10.33.76.79] eZContentStagingEvent::addEvent:


Class eZContentStagingEventCreationCPFilter not found or not exposing correct interface, can not use as event creation filter



I checked the code and it is actually the "!is_subclass_of( $filterClass, 'eZContentStagingEventCreationFilter' )" test that fails, and I don't understand why...
Have you an idea where it could come from?
Thanks,

Nicolas
Up

Gaetano Giunta

Member since:
30 November 1999

Posts: 269

Tuesday 12 February 2013 11:08:33 am

I checked on my machine, and the interface check works.

Then I read better the online docs for php, and found out that the support for doing this was added in php 5.3.7.

So you should replace



!is_subclass_of( $filterClass, 'eZContentStagingEventCreationFilter' )



with



!in_array( 'eZContentStagingEventCreationFilter', class_implements( $filterClass ) )




I will create a bug in the public tracker and file a pull request for this

Principal Consultant International Business
Member of the Community Project Board

Up

Nicolas Gommenginger

Member since:
10 November 2009

Posts: 17

Tuesday 12 February 2013 11:29:35 am

It works fine now.
Thanks a lot !

Nicolas
Up

You need to be logged in to post messages in the forums. New users may register here.