Class DefaultVendorCMSService
- java.lang.Object
-
- de.hybris.platform.marketplaceservices.vendor.impl.DefaultVendorCMSService
-
- All Implemented Interfaces:
VendorCMSService
public class DefaultVendorCMSService extends java.lang.Object implements VendorCMSService
Provide CMS related services
-
-
Constructor Summary
Constructors Constructor Description DefaultVendorCMSService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected CatalogSynchronizationService
getCatalogSynchronizationService()
protected CatalogTypeService
getCatalogTypeService()
protected CatalogVersionService
getCatalogVersionService()
java.util.Optional<AbstractCMSComponentModel>
getCMSComponentByIdAndCatalogVersion(java.lang.String id, CatalogVersionModel catalogVersion)
get component by its uid and catalog versionprotected MarketplaceCMSComponentDao
getCmsComponentDao()
java.util.List<AbstractCMSComponentModel>
getCMSComponentsByContentSlotAndCatalogVersions(java.lang.String contentSlotId, java.util.List<CatalogVersionModel> catalogVersions)
get component by content slot and catalog versionprotected CMSContentSlotDao
getCmsContentSlotDao()
protected CMSPageDao
getCmsPageDao()
protected CMSPageTemplateDao
getCmsPageTemplateDao()
protected CMSRestrictionDao
getCmsRestrictionDao()
java.util.Optional<ContentSlotModel>
getContentSlotByIdAndCatalogVersion(java.lang.String id, CatalogVersionModel catalogVersion)
get content slot by its uid and catalog versionjava.util.Optional<ContentSlotModel>
getContentSlotByPageAndPosition(java.lang.String position, AbstractPageModel page, CatalogVersionModel catalogVersion)
get content slot by its position, page and catalog versionjava.util.Optional<ContentSlotForPageModel>
getContentSlotRelationByIdAndPositionInPage(java.lang.String id, AbstractPageModel page, java.lang.String position)
get ContentSlotForPage according to its position in a pageprotected java.util.List<ItemModel>
getItemList(ItemModel item)
protected ModelService
getModelService()
java.util.Optional<AbstractPageModel>
getPageByIdAndCatalogVersion(java.lang.String id, CatalogVersionModel catalogVersion)
get page by it and catalog versionjava.util.Optional<PageTemplateModel>
getPageTemplateByIdAndCatalogVersion(java.lang.String id, CatalogVersionModel catalogVersion)
get page template by given id in given catalog versionprotected SynchronizationStatusService
getPlatformSynchronizationStatusService()
SyncItemStatus
getProductCarouselSynchronizationStatus(ProductCarouselComponentModel carousel)
Gets the synchronization item status for a givenProductCarouselComponentModel
protected SyncItemJobModel
getRelevantSyncItemJob(SyncRequestData syncRequestData, ItemModel item)
java.util.Optional<AbstractRestrictionModel>
getRestrictionByIdAndCatalogVersion(java.lang.String id, CatalogVersionModel catalogVersion)
get restriction by id and catalog versionprotected SearchRestrictionService
getSearchRestrictionService()
protected SessionService
getSessionService()
protected SyncConfig
getSyncConfig()
protected SyncRequestData
getSyncRequestData(ProductCarouselComponentModel model)
protected boolean
isExecutableInLocalView(SyncRequestData syncRequestData, ItemModel item)
protected boolean
isOutboundSynchronization(SyncRequestData syncRequestData, ItemModel item)
void
performProductCarouselSynchronization(ProductCarouselComponentModel carousel, boolean synchronous)
Performs the synchronization of a model ofProductCarouselComponentModel
taking in consideration the source and target catalog versions.ContentSlotModel
saveOrUpdateCMSContentSlot(CatalogVersionModel catalogVersion, java.lang.String uid, java.lang.String name, boolean active)
create content slotvoid
saveOrUpdateCMSContentSlotForPage(CatalogVersionModel catalogVersion, java.lang.String uid, java.lang.String position, AbstractPageModel page, ContentSlotModel contentSlot)
create the content slot for a CMS pageVendorPageModel
saveOrUpdateCMSVendorPage(java.lang.String pageUid, java.lang.String pageName, CatalogVersionModel catalogVersion, PageTemplateModel pageTemplate, boolean isDefaultPage, CmsApprovalStatus approvalStatus)
create an instance of CMS VendorPageModelvoid
saveOrUpdateCMSVendorRestriction(VendorModel vendor, CatalogVersionModel catalogVersion, java.lang.String uid, java.lang.String name, AbstractPageModel... pages)
create an instance of page restriction for a vendorJspIncludeComponentModel
saveOrUpdateJspIncludeComponent(CatalogVersionModel catalogVersion, java.lang.String uid, java.lang.String name, java.lang.String page)
create JSP include componentProductCarouselComponentModel
saveOrUpdateProductCarouselComponent(CatalogVersionModel catalogVersion, java.lang.String uid, java.lang.String name, CarouselScroll scroll, boolean popup)
create product carousel componentvoid
setCatalogSynchronizationService(CatalogSynchronizationService catalogSynchronizationService)
void
setCatalogTypeService(CatalogTypeService catalogTypeService)
void
setCatalogVersionService(CatalogVersionService catalogVersionService)
void
setCmsComponentDao(MarketplaceCMSComponentDao cmsComponentDao)
void
setCmsContentSlotDao(CMSContentSlotDao cmsContentSlotDao)
void
setCmsPageDao(CMSPageDao cmsPageDao)
void
setCmsPageTemplateDao(CMSPageTemplateDao cmsPageTemplateDao)
void
setCmsRestrictionDao(CMSRestrictionDao cmsRestrictionDao)
void
setModelService(ModelService modelService)
void
setPlatformSynchronizationStatusService(SynchronizationStatusService platformSynchronizationStatusService)
void
setSearchRestrictionService(SearchRestrictionService searchRestrictionService)
void
setSessionService(SessionService sessionService)
void
setSyncConfig(SyncConfig syncConfig)
-
-
-
Method Detail
-
getPageTemplateByIdAndCatalogVersion
public java.util.Optional<PageTemplateModel> getPageTemplateByIdAndCatalogVersion(java.lang.String id, CatalogVersionModel catalogVersion)
Description copied from interface:VendorCMSService
get page template by given id in given catalog version- Specified by:
getPageTemplateByIdAndCatalogVersion
in interfaceVendorCMSService
- Parameters:
id
- the given template idcatalogVersion
- the given catalog version- Returns:
- Optional of the instance of the page template if found and empty optional otherwise
-
getPageByIdAndCatalogVersion
public java.util.Optional<AbstractPageModel> getPageByIdAndCatalogVersion(java.lang.String id, CatalogVersionModel catalogVersion)
Description copied from interface:VendorCMSService
get page by it and catalog version- Specified by:
getPageByIdAndCatalogVersion
in interfaceVendorCMSService
- Parameters:
id
- the uid of the pagecatalogVersion
- the catalog version- Returns:
- Optional of the instance of the page if found and empty optional otherwise
-
getRestrictionByIdAndCatalogVersion
public java.util.Optional<AbstractRestrictionModel> getRestrictionByIdAndCatalogVersion(java.lang.String id, CatalogVersionModel catalogVersion)
Description copied from interface:VendorCMSService
get restriction by id and catalog version- Specified by:
getRestrictionByIdAndCatalogVersion
in interfaceVendorCMSService
- Parameters:
id
- the uid of the restrictioncatalogVersion
- the catalog version- Returns:
- Optional of the instance of the restriction if found and empty optional otherwise
-
getContentSlotRelationByIdAndPositionInPage
public java.util.Optional<ContentSlotForPageModel> getContentSlotRelationByIdAndPositionInPage(java.lang.String id, AbstractPageModel page, java.lang.String position)
Description copied from interface:VendorCMSService
get ContentSlotForPage according to its position in a page- Specified by:
getContentSlotRelationByIdAndPositionInPage
in interfaceVendorCMSService
- Parameters:
id
- ContentSlotForPage's Idpage
- the instance of pageposition
- the specific position- Returns:
- tOptional of the instance of the content slot relation if found and empty optional otherwise
-
getContentSlotByIdAndCatalogVersion
public java.util.Optional<ContentSlotModel> getContentSlotByIdAndCatalogVersion(java.lang.String id, CatalogVersionModel catalogVersion)
Description copied from interface:VendorCMSService
get content slot by its uid and catalog version- Specified by:
getContentSlotByIdAndCatalogVersion
in interfaceVendorCMSService
- Parameters:
id
- the uid of the content slotcatalogVersion
- the catalog version- Returns:
- Optional of the instance of the content slot if found and empty optional otherwise
-
getContentSlotByPageAndPosition
public java.util.Optional<ContentSlotModel> getContentSlotByPageAndPosition(java.lang.String position, AbstractPageModel page, CatalogVersionModel catalogVersion)
Description copied from interface:VendorCMSService
get content slot by its position, page and catalog version- Specified by:
getContentSlotByPageAndPosition
in interfaceVendorCMSService
- Parameters:
position
- position of the content slotpage
- page of the content slotcatalogVersion
- the catalog version- Returns:
- the expected content slot otherwise empty option
-
getCMSComponentByIdAndCatalogVersion
public java.util.Optional<AbstractCMSComponentModel> getCMSComponentByIdAndCatalogVersion(java.lang.String id, CatalogVersionModel catalogVersion)
Description copied from interface:VendorCMSService
get component by its uid and catalog version- Specified by:
getCMSComponentByIdAndCatalogVersion
in interfaceVendorCMSService
- Parameters:
id
- the uid of the componentcatalogVersion
- the catalog version- Returns:
- Optional of the instance of the component if found and empty optional otherwise
-
getCMSComponentsByContentSlotAndCatalogVersions
public java.util.List<AbstractCMSComponentModel> getCMSComponentsByContentSlotAndCatalogVersions(java.lang.String contentSlotId, java.util.List<CatalogVersionModel> catalogVersions)
Description copied from interface:VendorCMSService
get component by content slot and catalog version- Specified by:
getCMSComponentsByContentSlotAndCatalogVersions
in interfaceVendorCMSService
- Parameters:
contentSlotId
- Id of content slotcatalogVersions
- list of catalog versions- Returns:
- List of component in given content slot and catalog version
-
saveOrUpdateCMSVendorPage
public VendorPageModel saveOrUpdateCMSVendorPage(java.lang.String pageUid, java.lang.String pageName, CatalogVersionModel catalogVersion, PageTemplateModel pageTemplate, boolean isDefaultPage, CmsApprovalStatus approvalStatus)
Description copied from interface:VendorCMSService
create an instance of CMS VendorPageModel- Specified by:
saveOrUpdateCMSVendorPage
in interfaceVendorCMSService
- Parameters:
pageUid
- the page's uidpageName
- the page's namecatalogVersion
- the catalogversion of this pagepageTemplate
- the template of page usedisDefaultPage
- using this page as a default?approvalStatus
- is approved or checked?- Returns:
- The instance of the page
-
saveOrUpdateCMSVendorRestriction
public void saveOrUpdateCMSVendorRestriction(VendorModel vendor, CatalogVersionModel catalogVersion, java.lang.String uid, java.lang.String name, AbstractPageModel... pages)
Description copied from interface:VendorCMSService
create an instance of page restriction for a vendor- Specified by:
saveOrUpdateCMSVendorRestriction
in interfaceVendorCMSService
- Parameters:
vendor
- the specific pagecatalogVersion
- the catalog versionuid
- the restrication's IDname
- the restrication's namepages
- pages of restriction
-
saveOrUpdateCMSContentSlot
public ContentSlotModel saveOrUpdateCMSContentSlot(CatalogVersionModel catalogVersion, java.lang.String uid, java.lang.String name, boolean active)
Description copied from interface:VendorCMSService
create content slot- Specified by:
saveOrUpdateCMSContentSlot
in interfaceVendorCMSService
- Parameters:
catalogVersion
- the catalogversion of this page usinguid
- content slot idname
- content slot nameactive
- is active?- Returns:
- the content slot instance
-
saveOrUpdateCMSContentSlotForPage
public void saveOrUpdateCMSContentSlotForPage(CatalogVersionModel catalogVersion, java.lang.String uid, java.lang.String position, AbstractPageModel page, ContentSlotModel contentSlot)
Description copied from interface:VendorCMSService
create the content slot for a CMS page- Specified by:
saveOrUpdateCMSContentSlotForPage
in interfaceVendorCMSService
- Parameters:
catalogVersion
- the catalogversion of this page usinguid
- the id of this content slotposition
- where is the content slotpage
- the page of this content slotcontentSlot
- detailed content slot reference
-
saveOrUpdateJspIncludeComponent
public JspIncludeComponentModel saveOrUpdateJspIncludeComponent(CatalogVersionModel catalogVersion, java.lang.String uid, java.lang.String name, java.lang.String page)
Description copied from interface:VendorCMSService
create JSP include component- Specified by:
saveOrUpdateJspIncludeComponent
in interfaceVendorCMSService
- Parameters:
catalogVersion
- the catalogversion of this page usinguid
- the id of this componentname
- name of the componentpage
- detailed jsp location of this component- Returns:
- the instance of this jspincludecomponent
-
saveOrUpdateProductCarouselComponent
public ProductCarouselComponentModel saveOrUpdateProductCarouselComponent(CatalogVersionModel catalogVersion, java.lang.String uid, java.lang.String name, CarouselScroll scroll, boolean popup)
Description copied from interface:VendorCMSService
create product carousel component- Specified by:
saveOrUpdateProductCarouselComponent
in interfaceVendorCMSService
- Parameters:
catalogVersion
- the catalog of this componentuid
- the id of this componentname
- the id of this componentscroll
- how to scroll the carouselpopup
- is pop-up?- Returns:
- the instance of this component
-
getProductCarouselSynchronizationStatus
public SyncItemStatus getProductCarouselSynchronizationStatus(ProductCarouselComponentModel carousel)
Description copied from interface:VendorCMSService
Gets the synchronization item status for a givenProductCarouselComponentModel
- Specified by:
getProductCarouselSynchronizationStatus
in interfaceVendorCMSService
- Parameters:
carousel
- carousel model we are interested in getting the synchronization status- Returns:
- the given carousel
SyncItemStatus
-
performProductCarouselSynchronization
public void performProductCarouselSynchronization(ProductCarouselComponentModel carousel, boolean synchronous)
Description copied from interface:VendorCMSService
Performs the synchronization of a model ofProductCarouselComponentModel
taking in consideration the source and target catalog versions.- Specified by:
performProductCarouselSynchronization
in interfaceVendorCMSService
- Parameters:
carousel
- the carousel model that we want to synchronizesynchronous
- run with synchronous or asynchronous
-
getSyncRequestData
protected SyncRequestData getSyncRequestData(ProductCarouselComponentModel model)
-
getRelevantSyncItemJob
protected SyncItemJobModel getRelevantSyncItemJob(SyncRequestData syncRequestData, ItemModel item)
-
isOutboundSynchronization
protected boolean isOutboundSynchronization(SyncRequestData syncRequestData, ItemModel item)
-
isExecutableInLocalView
protected boolean isExecutableInLocalView(SyncRequestData syncRequestData, ItemModel item)
-
getCmsPageTemplateDao
protected CMSPageTemplateDao getCmsPageTemplateDao()
-
setCmsPageTemplateDao
public void setCmsPageTemplateDao(CMSPageTemplateDao cmsPageTemplateDao)
-
getCmsPageDao
protected CMSPageDao getCmsPageDao()
-
setCmsPageDao
public void setCmsPageDao(CMSPageDao cmsPageDao)
-
getCmsRestrictionDao
protected CMSRestrictionDao getCmsRestrictionDao()
-
setCmsRestrictionDao
public void setCmsRestrictionDao(CMSRestrictionDao cmsRestrictionDao)
-
getCmsContentSlotDao
protected CMSContentSlotDao getCmsContentSlotDao()
-
setCmsContentSlotDao
public void setCmsContentSlotDao(CMSContentSlotDao cmsContentSlotDao)
-
getCmsComponentDao
protected MarketplaceCMSComponentDao getCmsComponentDao()
-
setCmsComponentDao
public void setCmsComponentDao(MarketplaceCMSComponentDao cmsComponentDao)
-
getModelService
protected ModelService getModelService()
-
setModelService
public void setModelService(ModelService modelService)
-
getSyncConfig
protected SyncConfig getSyncConfig()
-
setSyncConfig
public void setSyncConfig(SyncConfig syncConfig)
-
getSearchRestrictionService
protected SearchRestrictionService getSearchRestrictionService()
-
setSearchRestrictionService
public void setSearchRestrictionService(SearchRestrictionService searchRestrictionService)
-
getSessionService
protected SessionService getSessionService()
-
setSessionService
public void setSessionService(SessionService sessionService)
-
getCatalogTypeService
protected CatalogTypeService getCatalogTypeService()
-
setCatalogTypeService
public void setCatalogTypeService(CatalogTypeService catalogTypeService)
-
getCatalogVersionService
protected CatalogVersionService getCatalogVersionService()
-
setCatalogVersionService
public void setCatalogVersionService(CatalogVersionService catalogVersionService)
-
getPlatformSynchronizationStatusService
protected SynchronizationStatusService getPlatformSynchronizationStatusService()
-
setPlatformSynchronizationStatusService
public void setPlatformSynchronizationStatusService(SynchronizationStatusService platformSynchronizationStatusService)
-
getCatalogSynchronizationService
protected CatalogSynchronizationService getCatalogSynchronizationService()
-
setCatalogSynchronizationService
public void setCatalogSynchronizationService(CatalogSynchronizationService catalogSynchronizationService)
-
-