Class ContentTargeterServiceImpl
java.lang.Object
com.broadleafcommerce.advancedcms.service.ContentTargeterServiceImpl
- All Implemented Interfaces:
ContentTargeterService
@Service("blContentTargeterService")
public class ContentTargeterServiceImpl
extends Object
implements ContentTargeterService
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static Stringprotected ContentTargeterDaoprotected ContentTargeterResolverExtensionManagerprotected final org.apache.commons.logging.Logprotected org.broadleafcommerce.common.sandbox.SandBoxHelper -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Stringprotected StringbuildRuleExpression(ContentTargeter targeter) protected ContentItemfindContentItemForTargeter(ContentTargeter targeter, ContentZone zone) Returns the ContentTargetingActionXref associated with the passed in id.findFieldActionsForPage(org.broadleafcommerce.cms.page.domain.Page page) Returns contentTargetingActions associated with the passedin page.protected List<ContentTargetingAction>findPageActionsForTargeter(ContentTargeter targeter) protected EmailTemplateprotected org.broadleafcommerce.cms.page.domain.Pageprotected SMSTemplateprotected com.broadleafcommerce.theme.domain.ThemeConfigurationprotected com.broadleafcommerce.theme.domain.ThemeFileReturns the contentItem if any found for the passed in zone.findTargetedReplacementEmailTemplate(EmailTemplate emailTemplate) If a targeter has been setup for the passed in email template with an action type ofContentTargetingActionType.CHANGE_EMAIL_TEMPLATE, then the new email template will be returned.com.broadleafcommerce.theme.domain.ThemeFileIf a targeter has been setup for the passed in page with an action type ofContentTargetingActionType.CHANGE_TEMPLATE, then the new template will be returned.org.broadleafcommerce.cms.page.domain.PagefindTargetedReplacementPage(org.broadleafcommerce.cms.page.domain.Page page) If a targeter has been setup for the passed in page with an action type ofContentTargetingActionType.CHANGE_PAGE, then the new page will be returned.findTargetedReplacementSmsTemplate(SMSTemplate smsTemplate) com.broadleafcommerce.theme.domain.ThemeConfigurationIf a targeter has been setup for the passed in page with an action type ofContentTargetingActionType.CHANGE_THEME, then the newThemeConfigurationwill be returned.protected booleanhasChangeEmailTemplateAction(ContentTargetingAction targetingAction) protected booleanhasChangePageAction(ContentTargetingAction targetingAction) protected booleanhasChangeSmsTemplateAction(ContentTargetingAction targetingAction) protected booleanhasChangeThemeAction(ContentTargetingAction targetingAction) protected booleanhasChangeThemeFileAction(ContentTargetingAction targetingAction) protected booleanhasContentItem(ContentTargetingAction targetingAction, ContentZone zone) protected booleanhasPageFieldAction(ContentTargetingAction targetingAction) protected booleanhasValidSegments(ContentTargeter targeter) protected booleanWhen using enterprise, ThemeConfig will implement status.booleantargeterPassesRules(ContentTargeter targeter, Map<String, Object> ruleDTOs) Check if a ContentTargeter passes the given rules
-
Field Details
-
LOG
protected final org.apache.commons.logging.Log LOG -
contentTargeterDao
-
extensionManager
-
sandBoxHelper
protected org.broadleafcommerce.common.sandbox.SandBoxHelper sandBoxHelper -
AND
-
-
Constructor Details
-
ContentTargeterServiceImpl
public ContentTargeterServiceImpl()
-
-
Method Details
-
findTargetedContentItemForZone
Description copied from interface:ContentTargeterServiceReturns the contentItem if any found for the passed in zone.- Specified by:
findTargetedContentItemForZonein interfaceContentTargeterService- Returns:
-
hasValidSegments
-
findFieldActionsForPage
public List<ContentTargetingAction> findFieldActionsForPage(org.broadleafcommerce.cms.page.domain.Page page) Description copied from interface:ContentTargeterServiceReturns contentTargetingActions associated with the passedin page.- Specified by:
findFieldActionsForPagein interfaceContentTargeterService- Returns:
-
findTargetedReplacementPage
public org.broadleafcommerce.cms.page.domain.Page findTargetedReplacementPage(org.broadleafcommerce.cms.page.domain.Page page) Description copied from interface:ContentTargeterServiceIf a targeter has been setup for the passed in page with an action type ofContentTargetingActionType.CHANGE_PAGE, then the new page will be returned.Otherwise, returns null.
- Specified by:
findTargetedReplacementPagein interfaceContentTargeterService- Returns:
-
findTargetedReplacementForTemplatePath
public com.broadleafcommerce.theme.domain.ThemeFile findTargetedReplacementForTemplatePath(String path) Description copied from interface:ContentTargeterServiceIf a targeter has been setup for the passed in page with an action type ofContentTargetingActionType.CHANGE_TEMPLATE, then the new template will be returned.Otherwise, returns null.
- Specified by:
findTargetedReplacementForTemplatePathin interfaceContentTargeterService- Returns:
-
findTargetedReplacementThemeConfiguration
public com.broadleafcommerce.theme.domain.ThemeConfiguration findTargetedReplacementThemeConfiguration()Description copied from interface:ContentTargeterServiceIf a targeter has been setup for the passed in page with an action type ofContentTargetingActionType.CHANGE_THEME, then the newThemeConfigurationwill be returned.Otherwise, returns null.
- Specified by:
findTargetedReplacementThemeConfigurationin interfaceContentTargeterService- Returns:
-
findTargetedReplacementEmailTemplate
Description copied from interface:ContentTargeterServiceIf a targeter has been setup for the passed in email template with an action type ofContentTargetingActionType.CHANGE_EMAIL_TEMPLATE, then the new email template will be returned.Otherwise, returns null.
- Specified by:
findTargetedReplacementEmailTemplatein interfaceContentTargeterService- Returns:
-
findTargetedReplacementSmsTemplate
- Specified by:
findTargetedReplacementSmsTemplatein interfaceContentTargeterService
-
isActive
When using enterprise, ThemeConfig will implement status.- Parameters:
statusObject-- Returns:
-
targeterPassesRules
Description copied from interface:ContentTargeterServiceCheck if a ContentTargeter passes the given rules- Specified by:
targeterPassesRulesin interfaceContentTargeterService- Returns:
- boolean
-
findContentTargetingActionXrefById
Description copied from interface:ContentTargeterServiceReturns the ContentTargetingActionXref associated with the passed in id.- Specified by:
findContentTargetingActionXrefByIdin interfaceContentTargeterService- Parameters:
id- - The id of the content targeting action xref.- Returns:
- The associated content targeting action xref.
-
buildQualifyingItemCriteriaExpression
-
buildRuleExpression
-
findContentItemForTargeter
-
hasContentItem
-
findPageActionsForTargeter
-
hasPageFieldAction
-
findReplacementPageForTargeter
protected org.broadleafcommerce.cms.page.domain.Page findReplacementPageForTargeter(ContentTargeter targeter) -
findReplacementThemeConfigurationForTargeter
protected com.broadleafcommerce.theme.domain.ThemeConfiguration findReplacementThemeConfigurationForTargeter(ContentTargeter targeter) -
findReplacementThemeFileForTargeter
protected com.broadleafcommerce.theme.domain.ThemeFile findReplacementThemeFileForTargeter(ContentTargeter targeter) -
findReplacementEmailTemplateForTargeter
-
findReplacementSmsTemplateForTargeter
-
hasChangePageAction
-
hasChangeThemeAction
-
hasChangeThemeFileAction
-
hasChangeEmailTemplateAction
-
hasChangeSmsTemplateAction
-