akeneo/pim-community-dev — pull request #1911 by nidup (2014-12-18 14:42:49+00:00)
Title: [POC] Feature variant groups

Very first POC on variant groups enhancement

Process Edit from UI,
- postLoad : from DB, [] -> denormalize(json) -> ProductValueInterface[]
- set the ProductValueInterface in the form

Process Save from UI
- ProductValueInterface[] are binded in the Form
- ProductValueInterface are validated
- prePersist, preUpdate : ProductValueInterface[] -> normalize(json) -> []
- Save the VariantGroup

Process Apply values on products,
- from DB, from valuesData, [] is json format, can be applied with ProductUpdater
- from DB, from values objects, ProductValueInterface[] -> normalize(json) -> [] -> ProductUpdater

Process Export variant groups
- introduce a Group Processor, if is_variant, fetch the product template
- from the template get the product values objects
- use the csv normalizer to normalize the values

Process Import variant groups
- introduce a Group Reader, if is_variant, get the values data
- from the values [] uses the csv denormalizer to get values object
- validate the values objects
- set the values in the template (normalized by the prePersist / preUpdate)

Notes,
- prePersist, preUpdate, postLoad can be performance killers
- perhaps use a more explicit way to load the product template values
- or don't load by default the product template of a product, they'll be lazy loaded if getProductTemplate is called

Questions,
- Add a dedicated import / export for the variant group product template ?
- Run the copy in background with a command ? (be able to run with ajax request from the UI)

TODO,
- introduce a GroupInterface in Model and use it everywhere
- introduce a GroupProductTemplateInterface in Model and use it everywhere
- add resolve target for these entities
- implement the product value denormalizer from csv format
- implement the product value denormalizer from json format
- re-work versioning denormalizer (EE)

| Q | A
| -------------------- | ---
| Bug fix? |
| New feature? |
| BC breaks? |
| CI currently passes? |
| Tests pass? |
| Scenarios pass? |
| Checkstyle issues?* |
| PMD issues?** |
| Changelog updated? |
| Fixed tickets |
| DB schema updated? |
| Migration script? |
| Doc PR |