public class PublicationServiceImpl extends AbstractServiceImpl implements PublicationService
| Modifier and Type | Field and Description |
|---|---|
static String |
PRINTCOCKPIT_RECENTLY_OPENED_PROPERTY |
MAX_RECENTLY| Constructor and Description |
|---|
PublicationServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
addRecentlyOpened(PublicationModel pub)
add a publication to the list of recently opened publications
|
void |
autoAssignPlacements(PageModel page) |
String |
autoCreateCodeString(Class itemclass,
String localized_code,
PublicationModel publication)
Automatically creates a string for the code of the element according to the number of already created items
|
boolean |
checkAccessPermission(ItemModel item,
String userright,
boolean recursive)
Check if the current user has the specified access right for an item
|
protected void |
checkAndReplaceIDs(PublicationComponentModel element,
PublicationModel publication,
Set<String> ids) |
ChapterModel |
cloneChapter(PublicationModel _publication,
ChapterModel superChapter,
ChapterModel originalChapter)
Creates a copy of a chapter
|
PageModel |
clonePage(PublicationModel _publication,
ChapterModel _chapter,
PageModel originalPage)
Clones given page, if publication and/or chapter are provided then new (cloned) page will have them assigned.
|
PlacementModel |
clonePlacement(PublicationModel _publication,
PageModel _page,
PlacementModel originalPlacement)
Clones given placement, if publication and/or page are provided then new (cloned) placement will have them assigned.
|
ListSearchResult |
convertSearchResult(ListSearchResult result,
PublicationModel pub)
Convert a search result that contains PK-Strings into one with PublicationElementsModel
|
ChapterModel |
createChapter(PublicationModel publication)
Creates a new chapter
|
PageModel |
createPage(PublicationModel publication,
ChapterModel chapter)
Creates a new page
|
ItemPlacementModel |
createPlacement(PageModel page,
ItemModel item)
Creates a new placement
|
PublicationModel |
createPublication()
Creates a new publication
|
PublicationModel |
createPublication(int initialRootChapters,
int pagesPerRootChapter,
Map<String,Object> ctx)
Creates a new publication with an initial chapter/pages structure
|
PublicationModel |
createPublication(PublicationModel templatePublication)
Creates a new publication as a copy of an existing one
|
void |
deleteElements(List<Object> elements)
Called to delete a specified set of loaded elements e.g.
|
void |
deletePublication(PublicationModel publication)
Completely deletes a publication from database
|
Collection<PageModel> |
getAllPages(Collection<ChapterModel> chapters) |
Collection<PlacementModel> |
getAllPlacements(Collection<PageModel> pages) |
List<Object> |
getAllRegisteredElements(PublicationModel publicationModel) |
List<HybrisEnumValue> |
getAvailableChapterStates() |
List<HybrisEnumValue> |
getAvailableFileHandlingModes()
Returns all enums to be used as filehandling modes.
|
List<HybrisEnumValue> |
getAvailablePageStates() |
List<String> |
getAvailablePlaceholderTemplates()
get all available placeholder templates
|
List<HybrisEnumValue> |
getAvailablePlacementStates() |
List<HybrisEnumValue> |
getAvailablePublicationStates()
Returns all enums to be used as publication element status.
|
Collection<ItemModel> |
getChildren(Object object) |
CometConfigurationModel |
getDefaultCometConfiguration()
get the default comet configuration
|
void |
getDefaultPageAttributeValuesMap(Map<String,Object> attr) |
List<PublicationModel> |
getExistingPublications(boolean onlyActive)
Returns a list of existing publications.
|
protected int |
getItemsToLoad(Publication p) |
LayoutService |
getLayoutService() |
ModelHelper |
getModelHelper() |
ModelService |
getModelService() |
ItemModel |
getParent(Object object) |
PrintcockpitService |
getPrintcockpitService() |
<T extends ItemModel,C extends Collection<T>> |
getReadableElements(C publications)
Returns filtered publication elements
|
<T extends ItemModel,C extends Collection<T>> |
getReadableElements(C publications,
UserModel user)
Returns filtered publication elements
|
protected Predicate |
getReadablePredicator(UserModel user)
Returns predicator for filtering the list
|
List<PublicationModel> |
getRecentlyOpened()
get a list of recently opened publications
|
TypeService |
getTypeService() |
PrintcockpitUIAccessRightService |
getUiAccessRightService() |
boolean |
isCodeInUse(PublicationModel publication,
String code) |
boolean |
isReadable(ItemModel item,
Principal principal)
Deprecated.
|
boolean |
isSubelement(TypedObject parent,
TypedObject elementToCheck)
Checks if the given element is placed somewhere in the node as subelement of the given parent
|
boolean |
isWritable(ItemModel item)
Deprecated, use:
PrintcockpitUIAccessRightService.canWrite(de.hybris.platform.core.model.user.UserModel, ItemModel)
instead. |
boolean |
isWritable(ItemModel item,
boolean recursive)
Checks if current user has permission to write/change/delete specified publication node
|
PublicationModel |
loadPublication(PublicationModel selected)
Called to load a selected publication into print cockpit.
|
PublicationModel |
loadPublicationForChooser(PK selected)
Called to load a selected publication into print cockpit.
|
PlaceholderTemplateModel |
loadTemplate(String code)
get the placeholder template with the given code
|
boolean |
mustFixPlacements(PageModel page,
GridModel grid,
HybrisEnumValue gridMode)
check if all placements have valid gridelement ids for specified grid and gridmode
|
protected List<PK> |
readRecentlyOpened() |
protected String |
renameIfNecessary(String val,
PublicationModel publication) |
protected void |
replaceID(PublicationComponentModel p) |
void |
setLayoutService(LayoutService layoutService) |
void |
setModelHelper(ModelHelper modelHelper) |
void |
setModelService(ModelService modelService) |
void |
setPrintcockpitService(PrintcockpitService printcockpitService) |
void |
setTypeService(TypeService typeService) |
void |
setUiAccessRightService(PrintcockpitUIAccessRightService uiAccessRightService) |
protected void |
storePositions(ItemModel parent,
List<ItemModel> oldList,
List<ItemModel> newList,
String parentAttr,
String posAttr) |
protected void |
storePositionsComplete(ItemModel parent,
List<ItemModel> oldList,
List<ItemModel> newList,
String parentAttr,
String posAttr) |
protected void |
storePositionsDiff(ItemModel parent,
List<ItemModel> oldList,
List<ItemModel> newList,
String parentAttr,
String posAttr) |
protected void |
writeRecentlyOpened(List<PK> pks) |
getEnum, getEnumspublic static final String PRINTCOCKPIT_RECENTLY_OPENED_PROPERTY
public void addRecentlyOpened(PublicationModel pub)
PublicationServiceaddRecentlyOpened in interface PublicationServicepub - the publication to addpublic void autoAssignPlacements(PageModel page)
autoAssignPlacements in interface PublicationServicepublic String autoCreateCodeString(Class itemclass, String localized_code, PublicationModel publication)
PublicationServiceautoCreateCodeString in interface PublicationServiceitemclass - the elementpublication - the selected publicationpublic boolean checkAccessPermission(ItemModel item, String userright, boolean recursive)
PublicationServicecheckAccessPermission in interface PublicationServiceitem - the itemuserright - the userrightprotected void checkAndReplaceIDs(PublicationComponentModel element, PublicationModel publication, Set<String> ids)
public ChapterModel cloneChapter(PublicationModel _publication, ChapterModel superChapter, ChapterModel originalChapter)
PublicationServicecloneChapter in interface PublicationService_publication - the publication the new chapter belongs tooriginalChapter - the chapter to clonepublic PageModel clonePage(PublicationModel _publication, ChapterModel _chapter, PageModel originalPage)
PublicationServiceclonePage in interface PublicationServicepublic PlacementModel clonePlacement(PublicationModel _publication, PageModel _page, PlacementModel originalPlacement)
PublicationServiceclonePlacement in interface PublicationServicepublic ListSearchResult convertSearchResult(ListSearchResult result, PublicationModel pub)
PublicationServiceconvertSearchResult in interface PublicationServiceresult - the original search resultpublic ChapterModel createChapter(PublicationModel publication)
PublicationServicecreateChapter in interface PublicationServicepublication - the publication the new chapter belongs topublic PageModel createPage(PublicationModel publication, ChapterModel chapter)
PublicationServicecreatePage in interface PublicationServicepublication - the publication the new page belongs topublic ItemPlacementModel createPlacement(PageModel page, ItemModel item)
PublicationServicecreatePlacement in interface PublicationServicepage - the page in which the placement shall resideitem - item to be set inside created placementpublic PublicationModel createPublication()
PublicationServicecreatePublication in interface PublicationServicepublic PublicationModel createPublication(int initialRootChapters, int pagesPerRootChapter, Map<String,Object> ctx)
PublicationServicecreatePublication in interface PublicationServiceinitialRootChapters - the number of initial rootchapterspagesPerRootChapter - the number of pages per rootchapterctx - additional parameterspublic PublicationModel createPublication(PublicationModel templatePublication)
PublicationServicecreatePublication in interface PublicationServicetemplatePublication - the existing publication to be clonedpublic void deleteElements(List<Object> elements)
PublicationServicedeleteElements in interface PublicationServicepublic void deletePublication(PublicationModel publication)
PublicationServicedeletePublication in interface PublicationServicepublication - the publication to deletepublic Collection<PageModel> getAllPages(Collection<ChapterModel> chapters)
getAllPages in interface PublicationServicepublic Collection<PlacementModel> getAllPlacements(Collection<PageModel> pages)
getAllPlacements in interface PublicationServicepublic List<Object> getAllRegisteredElements(PublicationModel publicationModel)
getAllRegisteredElements in interface PublicationServicepublic List<HybrisEnumValue> getAvailableChapterStates()
getAvailableChapterStates in interface PublicationServicepublic List<HybrisEnumValue> getAvailableFileHandlingModes()
PublicationServicegetAvailableFileHandlingModes in interface PublicationServicepublic List<HybrisEnumValue> getAvailablePageStates()
getAvailablePageStates in interface PublicationServicepublic List<String> getAvailablePlaceholderTemplates()
PublicationServicegetAvailablePlaceholderTemplates in interface PublicationServicepublic List<HybrisEnumValue> getAvailablePlacementStates()
getAvailablePlacementStates in interface PublicationServicepublic List<HybrisEnumValue> getAvailablePublicationStates()
PublicationServicegetAvailablePublicationStates in interface PublicationServicepublic Collection<ItemModel> getChildren(Object object)
getChildren in interface PublicationServiceobject - ItemModel or TypedObject of the kind: Publication, Chapter, Pagepublic CometConfigurationModel getDefaultCometConfiguration()
PublicationServicegetDefaultCometConfiguration in interface PublicationServicepublic void getDefaultPageAttributeValuesMap(Map<String,Object> attr)
getDefaultPageAttributeValuesMap in interface PublicationServicepublic List<PublicationModel> getExistingPublications(boolean onlyActive)
PublicationServiceThese objects are not fully loaded publications but stripped down versions of them to be used for selection e.g. for loading or cloning them.
getExistingPublications in interface PublicationServiceonlyActive - set to true if only active publications should be returned, set to false if all publication should be
returnedprotected int getItemsToLoad(Publication p)
public LayoutService getLayoutService()
public ModelService getModelService()
getModelService in class AbstractServiceImplpublic ItemModel getParent(Object object)
getParent in interface PublicationServiceobject - ItemModel or TypedObject of kind: Publication, Chapter, Page, Placement etc.public PrintcockpitService getPrintcockpitService()
public <T extends ItemModel,C extends Collection<T>> C getReadableElements(C publications)
getReadableElements in interface PublicationServicepublications - public <T extends ItemModel,C extends Collection<T>> C getReadableElements(C publications, UserModel user)
publications - user - protected Predicate getReadablePredicator(UserModel user)
user - public List<PublicationModel> getRecentlyOpened()
PublicationServicegetRecentlyOpened in interface PublicationServicepublic TypeService getTypeService()
public boolean isCodeInUse(PublicationModel publication, String code)
isCodeInUse in interface PublicationService@Deprecated public boolean isReadable(ItemModel item, Principal principal)
PublicationServicePrintcockpitUIAccessRightService.canRead(de.hybris.platform.core.model.user.UserModel, ItemModel)
Checks if current user has permission to read specified publication nodeisReadable in interface PublicationServicepublic boolean isSubelement(TypedObject parent, TypedObject elementToCheck)
PublicationServiceisSubelement in interface PublicationServicepublic boolean isWritable(ItemModel item)
PublicationServicePrintcockpitUIAccessRightService.canWrite(de.hybris.platform.core.model.user.UserModel, ItemModel)
instead. isWritable in interface PublicationServicepublic boolean isWritable(ItemModel item, boolean recursive)
PublicationServiceisWritable in interface PublicationServicerecursive - - if true all subelements will be checked as wellpublic PublicationModel loadPublication(PublicationModel selected)
PublicationServiceloadPublication in interface PublicationServiceselected - the publication to loadpublic PublicationModel loadPublicationForChooser(PK selected)
PublicationServiceloadPublicationForChooser in interface PublicationServiceselected - PK of the publication to loadpublic PlaceholderTemplateModel loadTemplate(String code)
PublicationServiceloadTemplate in interface PublicationServicecode - the codepublic boolean mustFixPlacements(PageModel page, GridModel grid, HybrisEnumValue gridMode)
PublicationServicemustFixPlacements in interface PublicationServicegrid - the gridgridMode - the gridmodeprotected String renameIfNecessary(String val, PublicationModel publication)
protected void replaceID(PublicationComponentModel p)
public void setLayoutService(LayoutService layoutService)
public void setModelService(ModelService modelService)
setModelService in class AbstractServiceImplpublic void setPrintcockpitService(PrintcockpitService printcockpitService)
public void setTypeService(TypeService typeService)
protected void storePositions(ItemModel parent, List<ItemModel> oldList, List<ItemModel> newList, String parentAttr, String posAttr)
protected void storePositionsComplete(ItemModel parent, List<ItemModel> oldList, List<ItemModel> newList, String parentAttr, String posAttr)
protected void storePositionsDiff(ItemModel parent, List<ItemModel> oldList, List<ItemModel> newList, String parentAttr, String posAttr)
public PrintcockpitUIAccessRightService getUiAccessRightService()
public void setUiAccessRightService(PrintcockpitUIAccessRightService uiAccessRightService)
uiAccessRightService - the uiAccessRightService to setpublic void setModelHelper(ModelHelper modelHelper)
public ModelHelper getModelHelper()
Copyright © 2017 SAP SE. All Rights Reserved.