Class ABTestUtil
- java.lang.Object
-
- lumis.service.analytics.abtest.util.ABTestUtil
-
public final class ABTestUtil extends java.lang.Object
AB Test related utilities.- Since:
- 16.0.0
- Version:
- $Revision: 25809 $ $Date: 2023-07-04 15:23:22 -0300 (Tue, 04 Jul 2023) $
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
clearExperimentCache(java.lang.String experimentId)
Clears experiment cache.static void
clearOrphanContentExperiments()
Clears orphan content experiments.static void
deleteRelatedExperiments(ContentLocale contentLocale)
Deletes the experiments related to the given content locale.static java.lang.String
getApplyVariantCommand(java.lang.String variantId)
Returns the apply variant command to be executed in parent CKEditor.static org.json.JSONObject
getVariantResponseJSON(ABTestExperimentVariant variant, java.lang.String referrer, HttpServletRequest request)
Returns the variant JSON object to be applied by track.js.static java.lang.Boolean
isExperimentEnabled(java.lang.String experimentId)
Returns whether the experiment with the given id is enabled.static void
onPostAddHtmlField(java.lang.String html, ISourceField field, SourcePostAddDataEvent event)
Callback to be called after an HTML field is added.static void
onPostUpdateHtmlField(java.lang.String html, ISourceField field, SourcePostUpdateDataEvent event)
Callback to be called after an HTML field is updated.
-
-
-
Method Detail
-
deleteRelatedExperiments
public static void deleteRelatedExperiments(ContentLocale contentLocale) throws PortalException
Deletes the experiments related to the given content locale.- Parameters:
contentLocale
- the content locale- Throws:
PortalException
- Since:
- 16.0.0
-
isExperimentEnabled
public static java.lang.Boolean isExperimentEnabled(java.lang.String experimentId) throws PortalException
Returns whether the experiment with the given id is enabled.- Parameters:
experimentId
-- Returns:
- whether the experiment with the given id is enabled.
- Throws:
PortalException
- Since:
- 16.0.0
-
clearExperimentCache
public static void clearExperimentCache(java.lang.String experimentId) throws PortalException
Clears experiment cache.- Parameters:
experimentId
- the experiment id- Throws:
PortalException
- Since:
- 16.0.0
-
onPostAddHtmlField
public static void onPostAddHtmlField(java.lang.String html, ISourceField field, SourcePostAddDataEvent event) throws PortalException
Callback to be called after an HTML field is added.- Parameters:
html
- the HTML valuefield
- the field idevent
- the event- Throws:
PortalException
- Since:
- 16.0.0
-
onPostUpdateHtmlField
public static void onPostUpdateHtmlField(java.lang.String html, ISourceField field, SourcePostUpdateDataEvent event) throws PortalException
Callback to be called after an HTML field is updated.- Parameters:
html
- the HTML valuefield
- the fieldevent
- the event- Throws:
PortalException
- Since:
- 16.0.0
-
getVariantResponseJSON
public static org.json.JSONObject getVariantResponseJSON(ABTestExperimentVariant variant, java.lang.String referrer, HttpServletRequest request) throws PortalException
Returns the variant JSON object to be applied by track.js.- Parameters:
variant
- the variantreferrer
- the referrer pagerequest
- the request- Returns:
- the JSON object
- Throws:
PortalException
- Since:
- 16.0.0
-
clearOrphanContentExperiments
public static void clearOrphanContentExperiments() throws PortalException
Clears orphan content experiments.- Throws:
PortalException
- Since:
- 16.0.0
-
getApplyVariantCommand
public static java.lang.String getApplyVariantCommand(java.lang.String variantId) throws PortalException
Returns the apply variant command to be executed in parent CKEditor.- Parameters:
variantId
- the variant id- Returns:
- the apply variant command to be executed in parent CKEditor.
- Throws:
PortalException
- Since:
- 16.0.0
-
-