cancel
Showing results for 
Search instead for 
Did you mean: 

how to copy clone CanonicalItem into a different pool in a composition or publication handler?

former_member473180
Participant
0 Kudos
151

I want to clone the CanonicalItem into a different pool in a composition or publication handler?

Same raw feed should populate a separate pool with the identically cloned CanonicalItem.

Please advise?

View Entire Topic
Slava
Product and Topic Expert
Product and Topic Expert
0 Kudos

Here is a high level concept:

  1. implement GroupingHandler

  2. In the implementation of List<CompositionGroup<T>> group(final CompositionGroup<T> original). Create a copy of the original composition group, i.e. new CompositionGroup(items, attributes, pool)
    items an attributes can be taken from the original group, pool is the one you need to copy the items to.

  3. The raw items retrieved from original.getItems() need to be copied as well before passing them into the new composition group. For each item call RawItem.instantiate(type) and then populate the new item from the original item except setting a different pool.

  4. Return two groups: the original and the new one from the GroupingHandler implementation.

You may still hit some problems while working on this but at least this is an outline of a way to do what you need. Hope it helps.