public class DefaultBTGCockpitService extends AbstractServiceImpl implements BTGCockpitService
modelService, typeService| Constructor and Description |
|---|
DefaultBTGCockpitService() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
adjustContentSlotPositions(AbstractCMSComponentModel clonedComponent,
AbstractCMSComponentModel sourceComponent)
Moves the cloned component after the source component on all content slots
|
protected AbstractCMSComponentModel |
cloneCompoenentFirstLevel(AbstractCMSComponentModel component) |
TypedObject |
createBtgSegment(java.lang.String segmentName,
TypedObject catalogVersion)
Creates a btgSegment with the given name in the given catalogVersion.
|
protected BtgSegmentRestrictionModel |
createBtgSegmentRestriction(CatalogVersionModel catalogVersionModel)
Creates base instance of
BtgSegmentRestrictionModel. |
TypedObject |
createCmsRestrictionAction(TypedObject segment,
TypedObject restrictedCMSItem,
boolean inverted)
Creates a CMS Restriction Action with a according CMS Restriction and connects it with the segment and the CMS
Item.
|
protected CMSInverseRestrictionModel |
createInvertSegmentRestriction(AbstractRestrictionModel sourceRestriction,
CatalogVersionModel catalogVersionModel)
Creates an inverse restriction for given source restriction.
|
protected TypedObject |
createPresonalizedPage(AbstractPageModel sourcePage,
boolean cloneRestrictions,
BTGSegmentModel segmentModel)
Create personalized version of given page.
|
TypedObject |
createShowItemOutputAction(RestrictionActionCreateContext context)
Creates show item output action accordingly to given context.
|
protected BTGConfigurationService |
getBtgConfigurationService() |
TypedObject |
getCatalogVersion(TypedObject segment)
Get the catalog version for the specific BTGSegment
|
CmsCockpitService |
getCmsCockpitService() |
protected CMSSiteService |
getCmsSiteService() |
TypedObject |
getDefaultBtgCatalogVersion()
Gets the default catalog version for btg segments or null, if none configured.
|
GenericRandomNameProducer |
getGenericRandomNameProducer() |
java.util.List<TypedObject> |
getOutputActions(TypedObject segment)
Get the output actions for a specific BTGSegment
|
java.util.List<TypedObject> |
getRules(TypedObject segment)
Get the rules for a specific BTGSegment
|
protected AbstractRestrictionModel |
invertRestriction(AbstractRestrictionModel sourceRestriction)
Invert given restriction.
|
protected void |
prepareComponentOutputActionDependencies(RestrictionActionCreateContext context,
BtgSegmentRestrictionModel segmentRestriction)
Creates all necessary dependencies in order to create a
CmsRestrictionActionDefinitionModel instance. |
protected void |
prepareDefaultPageOutputActionDependencies(RestrictionActionCreateContext context,
BtgSegmentRestrictionModel segmentRestriction,
AbstractPageModel pageReference)
Creates all necessary dependencies in order to create a
CmsRestrictionActionDefinitionModel instance. |
protected void |
prepareNonDefaultPageOutputActionDependencies(RestrictionActionCreateContext context,
BtgSegmentRestrictionModel segmentRestriction,
AbstractPageModel pageReference)
Creates all necessary dependencies in order to create a
CmsRestrictionActionDefinitionModel instance. |
protected AbstractRestrictionModel |
prepareOutputActionDependencies(RestrictionActionCreateContext context,
CmsRestrictionActionDefinitionModel outputAction,
CatalogVersionModel catalogVersionModel)
Creates all necessary dependencies in order to create a
CmsRestrictionActionDefinitionModel instance. |
protected void |
preparePageOutputActionDependencies(RestrictionActionCreateContext context,
BtgSegmentRestrictionModel segmentRestriction)
Creates all necessary dependencies in order to create a
CmsRestrictionActionDefinitionModel instance. |
void |
removeBTGOutputAction(TypedObject btgoutputAction)
Removes the specific BTGOutputAction
|
void |
removeBTGRule(TypedObject btgrule)
Removes the specific BTGRule
|
void |
removeBTGSegment(TypedObject btgsegment)
Removes the specific BTGSegment
|
void |
setBtgConfigurationService(BTGConfigurationService btgConfigurationService) |
void |
setCmsCockpitService(CmsCockpitService cmsCockpitService) |
void |
setCmsSiteService(CMSSiteService cmsSiteService) |
void |
setGenericRandomNameProducer(GenericRandomNameProducer genericRandomNameProducer) |
void |
setL10nService(L10NService l10nService) |
void |
setOutputActions(TypedObject segment,
java.util.List<TypedObject> outputActions)
Set the output actions for a specific BTGSegment
|
void |
setRules(TypedObject segment,
java.util.List<TypedObject> rules)
Set the rules for a specific BTGSegment
|
void |
setSegmentNameAccordingToFirstRule(TypedObject btgSegment)
Sets the name of the segment according to the first rule.
|
void |
setSystemService(SystemService systemService) |
getEnum, getEnums, getLocalizedLabel, getLocalizedLabel, getModelService, getTypeService, setCockpitTypeService, setLabelResolver, setModelServicepublic void removeBTGSegment(TypedObject btgsegment) throws ValueHandlerPermissionException
BTGCockpitServiceremoveBTGSegment in interface BTGCockpitServicebtgsegment - the BTGSegment to be removedValueHandlerPermissionExceptionpublic void removeBTGRule(TypedObject btgrule) throws ValueHandlerPermissionException
BTGCockpitServiceremoveBTGRule in interface BTGCockpitServicebtgrule - the BTGRule to be removedValueHandlerPermissionExceptionpublic void removeBTGOutputAction(TypedObject btgoutputAction) throws ValueHandlerPermissionException
BTGCockpitServiceremoveBTGOutputAction in interface BTGCockpitServicebtgoutputAction - the BTGOutputAction to be removedValueHandlerPermissionExceptionpublic java.util.List<TypedObject> getOutputActions(TypedObject segment)
BTGCockpitServicegetOutputActions in interface BTGCockpitServicesegment - the BTGSegmentpublic java.util.List<TypedObject> getRules(TypedObject segment)
BTGCockpitServicegetRules in interface BTGCockpitServicesegment - the BTGSegmentpublic TypedObject getCatalogVersion(TypedObject segment)
BTGCockpitServicegetCatalogVersion in interface BTGCockpitServicesegment - the BTGSegmentpublic void setOutputActions(TypedObject segment, java.util.List<TypedObject> outputActions)
BTGCockpitServicesetOutputActions in interface BTGCockpitServicesegment - the BTGSegmentoutputActions - the output actions, wrapped into TypedObjectspublic void setRules(TypedObject segment, java.util.List<TypedObject> rules)
BTGCockpitServicesetRules in interface BTGCockpitServicesegment - the BTGSegmentrules - the rules, wrapped into TypedObjectspublic TypedObject createShowItemOutputAction(RestrictionActionCreateContext context)
BTGCockpitServiceCmsRestrictionActionDefinition for a given segment
RestrictionActionCreateContext.getCurrentSegment(), also creates a proper restriction base on context
information.createShowItemOutputAction in interface BTGCockpitServicecontext - given context informationCmsRestrictionActionDefinitionprotected void prepareComponentOutputActionDependencies(RestrictionActionCreateContext context, BtgSegmentRestrictionModel segmentRestriction)
CmsRestrictionActionDefinitionModel instance. This
is invoked for ANY components.context - given context informationsegmentRestriction - output segment restrictionprotected void preparePageOutputActionDependencies(RestrictionActionCreateContext context, BtgSegmentRestrictionModel segmentRestriction)
CmsRestrictionActionDefinitionModel instance. This
is invoked for ANY pages.context - given context informationsegmentRestriction - instance that will be createdprotected void prepareNonDefaultPageOutputActionDependencies(RestrictionActionCreateContext context, BtgSegmentRestrictionModel segmentRestriction, AbstractPageModel pageReference)
CmsRestrictionActionDefinitionModel instance. This
is invoked for non default pages.context - given context informationsegmentRestriction - instance that will be createdpageReference - current page referenceprotected void prepareDefaultPageOutputActionDependencies(RestrictionActionCreateContext context, BtgSegmentRestrictionModel segmentRestriction, AbstractPageModel pageReference)
CmsRestrictionActionDefinitionModel instance. This
is invoked for default pages.context - given context informationsegmentRestriction - instance that will be createdpageReference - current page referenceprotected AbstractRestrictionModel prepareOutputActionDependencies(RestrictionActionCreateContext context, CmsRestrictionActionDefinitionModel outputAction, CatalogVersionModel catalogVersionModel)
CmsRestrictionActionDefinitionModel instance.context - given context informationoutputAction - instance that will be createdcatalogVersionModel - current catalog versionprotected AbstractRestrictionModel invertRestriction(AbstractRestrictionModel sourceRestriction)
CMSInverseRestrictionModel then should return the
CMSInverseRestrictionModel.getOriginalRestriction() otherwise creates a CMSInverseRestrictionModel.sourceRestriction - given source restrictionprotected BtgSegmentRestrictionModel createBtgSegmentRestriction(CatalogVersionModel catalogVersionModel)
BtgSegmentRestrictionModel.catalogVersionModel - given catalog versionprotected CMSInverseRestrictionModel createInvertSegmentRestriction(AbstractRestrictionModel sourceRestriction, CatalogVersionModel catalogVersionModel)
sourceRestriction - given source restrictioncatalogVersionModel - given catalog versionprotected TypedObject createPresonalizedPage(AbstractPageModel sourcePage, boolean cloneRestrictions, BTGSegmentModel segmentModel)
cloneRestrictions is true the copy all
properties of first level including restrictions, otherwise skip restrictions.protected AbstractCMSComponentModel cloneCompoenentFirstLevel(AbstractCMSComponentModel component)
protected void adjustContentSlotPositions(AbstractCMSComponentModel clonedComponent, AbstractCMSComponentModel sourceComponent)
public GenericRandomNameProducer getGenericRandomNameProducer()
public void setGenericRandomNameProducer(GenericRandomNameProducer genericRandomNameProducer)
public CmsCockpitService getCmsCockpitService()
public void setCmsCockpitService(CmsCockpitService cmsCockpitService)
public TypedObject createBtgSegment(java.lang.String segmentName, TypedObject catalogVersion)
BTGCockpitServicecreateBtgSegment in interface BTGCockpitServicepublic TypedObject createCmsRestrictionAction(TypedObject segment, TypedObject restrictedCMSItem, boolean inverted)
BTGCockpitServicecreateCmsRestrictionAction in interface BTGCockpitServicesegment - the segment to which the Restriction Action will be added.restrictedCMSItem - the CMS Item (Page or Component) to which the restriction will be added.inverted - if set to true, users from the segment will not see the CMS Item. Otherwise only users from the segment
can see it.CmsRestrictionActionDefinitionModel, wrapped into a TypedObjectpublic void setSegmentNameAccordingToFirstRule(TypedObject btgSegment)
BTGCockpitServicesetSegmentNameAccordingToFirstRule in interface BTGCockpitServicepublic void setCmsSiteService(CMSSiteService cmsSiteService)
protected CMSSiteService getCmsSiteService()
public void setBtgConfigurationService(BTGConfigurationService btgConfigurationService)
protected BTGConfigurationService getBtgConfigurationService()
public TypedObject getDefaultBtgCatalogVersion()
BTGCockpitServicegetDefaultBtgCatalogVersion in interface BTGCockpitServicepublic void setSystemService(SystemService systemService)
public void setL10nService(L10NService l10nService)
Copyright © 2018 SAP SE. All Rights Reserved.