Details
-
Improvement
-
Status: Closed
-
Normal
-
Resolution: Done
-
None
-
None
-
0.5
-
Quasar
-
Puma Sprint 238, Puma Sprint 239
Description
Personalization
Creating variants for components of an x-page works ootb. These variants will also be rendered if a visitor matches with the characteristics or segment of the variant. Of course you need to publish the x-page for the variants to become available for the live site. So personalization already works without any modification.
Experiments
For experiments the story is different. There are two parts, the Experiments Resource and the experiment specific channel event listeners.
ChannelPublicationEventListener
Manages the experiment state and can delete experiments.
On a publish event:
If current state is CREATED -> change state to RUNNING.
If current state is COMPLETED -> Delete the experiment and remove experimentId reference from component parameters
On a discard event:
If current state is CREATED -> Delete the experiment and remove experimentId reference from component parameters.
If current state COMPLETED -> change state to RUNNING.
For x-pages we therefore need a similar listener. We'll have to refactor the channel publication listener so that we can re-use parts of the logic.
ChannelPreviewCreationEventListener
Makes sure that when a new preview is created from a live configuration, that in case the live configuration contains a running experiment on one or more containers, that on the preview containers the container gets locked by the RELEVANCE_USER
For x-pages this means that we need to do this when a published variant is copied to the unpublished variant.
BeforeChannelDeleteEventListener
Cleans up experiments and goals before deleting a channel
Goals: because channel's mounts has been checked to not have any child, all {@link PageGoal} binding to mo.unts are removed
Experiments: all experiments using deleted goals above will be removed
For x-pages we need to make sure that references to these experiments are removed from the hst parameters before the experiments are removed.
PageCopyEventExperimentsListener
Removes possible present experiments on the target copied page (which were copied over from the source page)
For x-pages we need a similar listener.
ExperimentResource
POST /experiments/saveExperiment?versionStamp(long)
BODY: { componentId: string, variantId: string, goal: Goal, goalId: string }
Creates a new experiment and saves the experiment id in the hst parameters.
For x-pages we do not have to make any changes. The experiment id will be saved in the hst parameters of the component.
POST /experiments/complete?keepOnlyVariantId(string)
BODY: string (this is the componentId)
Sets the experiment state to COMPLETED and puts a channel-manager event "write-changes" on the Hippo event bus so that the channel manager will show the yellow triangle to indicate there are changes. If keepOlyVariantId is present then all other variants are deleted from the component. The user can then decide to publish or discard those changes. Depending on the choice the ChannelPublicationEventListener will handle it further.
For x-pages calling this method will not cause any changes in the hst configuration. It also does not change anything in the component stored
in the unpublished variant of the x-page. So the user cannot publish the document to let the publication listener remove the experiment and
remove the experimentId from the component parameters.
High level estimate to let experiments work with x-pages: 5SP
Attachments
Issue Links
- relates to
-
CMS-13650 Make xpages work with Relevance & Experiments
- Closed