Class ItemServiceInternalImpl
java.lang.Object
org.craftercms.studio.impl.v2.service.item.internal.ItemServiceInternalImpl
- All Implemented Interfaces:
ItemServiceInternal
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclearPreviousPath(String siteId, String path) Clear previous path of the contentconvertHistoryItemToDashboardItem(PublishingHistoryItem historyItem) Convert Publishing History Item to Publishing Dashboard ItemintCount all content itemsvoiddeleteItem(String siteId, String path) Delete itemvoiddeleteItemForFolder(long siteId, String folderPath) Delete items for site and pathsvoiddeleteItemsForSite(long siteId) Delete all items for siteprotected StringgetBrowserUri(String uri, String replacePattern, boolean isPage) getBrowserUrl(String site, String path) Get browser url for given repository itemgetChangeSetForSubtree(String siteId, String path) Get change set for subtreegetExistingRenamedChildrenOfMandatoryParentsForPublishing(String siteId, List<String> parents) Get existing renamed children of mandatory parents for publishinggetInProgressItems(String siteId) Get in progress items for given siteGet item by given idGet item fir given site and pathGet item fir given site and pathGet items for given site and pathsGet items for given site and pathsgetItemStates(String siteId, String path, Long states, List<String> systemTypes, List<org.craftercms.commons.rest.parameters.SortField> sortFields, int offset, int limit) Get item states for given filters by path regex and states maskintGet total number of item states records for given filters by path regex and states maskgetMandatoryParentsForPublishing(String siteId, List<String> paths) Get mandatory parents for publishing for given site and list of pathsprotected longgetResetStatesMask(boolean clearSystemProcessing, boolean clearUserLocked, Boolean live, Boolean staged, Boolean isNew, Boolean modified) protected longgetSetStatesMask(Boolean live, Boolean staged, Boolean isNew, Boolean modified) getSubtreeForDelete(String siteId, String path) Get subtree for deleteinstantiateItem(String siteName, String path) booleanCheck if item is newbooleanisSystemProcessing(String siteId, String path) Check if item is in system processingbooleanisUpdatedOrNew(String siteId, String path) Check if item is update or newvoidlockItemByPath(String siteId, String path, String username) Lock item for given lock ownervoidMove itemvoidpersistItemAfterCreate(String siteId, String path, String username, String commitId, boolean unlock, Long parentId) Persist item metadata after createvoidpersistItemAfterCreateFolder(String siteId, String folderPath, String folderName, String username, String commitId, Long parentId) Persist item metadata after create foldervoidpersistItemAfterRenameContent(String siteId, String path, String name, String username, String commitId, String contentType) Persist item metadata after rename foldervoidpersistItemAfterWrite(String siteId, String path, String username, String commitId, boolean unlock) Persist item metadata after writebooleanpreviousPathExists(String siteId, String path) Check if path exists as previous pathvoidsetContentService(ContentService contentService) voidsetContentServiceInternal(ContentServiceInternal contentServiceInternal) voidsetGeneralLockService(GeneralLockService generalLockService) voidsetItemDao(ItemDAO itemDao) voidsetRetryingDatabaseOperationFacade(RetryingDatabaseOperationFacade retryingDatabaseOperationFacade) voidsetServicesConfig(ServicesConfig servicesConfig) voidsetSiteFeedMapper(SiteFeedMapper siteFeedMapper) voidsetSystemProcessing(String siteId, String path, boolean isSystemProcessing) Set system processing for itemvoidsetSystemProcessingBulk(String siteId, List<String> paths, boolean isSystemProcessing) Set system processing for itemsvoidsetUserServiceInternal(UserServiceInternal userServiceInternal) voidunlockItemByPath(String siteId, String path) Unlock itemvoidupdateCommitId(String siteId, String path, String commitId) Update commit id for itemvoidupdateItem(Item item) Update itemvoidupdateItemStates(String siteId, List<String> paths, boolean clearSystemProcessing, boolean clearUserLocked, Boolean live, Boolean staged, Boolean isNew, Boolean modified) Update item state flags for given itemsvoidupdateItemStatesByQuery(String siteId, String path, Long states, boolean clearSystemProcessing, boolean clearUserLocked, Boolean live, Boolean staged, Boolean isNew, Boolean modified) Update item state flags for given path queryvoidupdateLastPublishedOn(String siteId, String path, ZonedDateTime lastPublishedOn) Update last published date for itemvoidupdateNewPageChildren(String siteId, String folderPath) Updates a new page's children (in case the folder existed before the page was created) to point to the new page.voidupdateStateBits(String siteId, String path, long onStateBitMap, long offStateBitMap) Update states to flip on list off states and flip off another list of states for itemvoidupdateStateBitsBulk(String siteId, Collection<String> paths, long onStateBitMap, long offStateBitMap) Update states to flip on list off states and flip off another list of states for itemsvoidupdateStatesForSite(String siteId, long onStateBitMap, long offStateBitMap) Update states for all content in the given sitebooleanupsertEntry(Item item) Insert record for item if it does not exist, otherwise update it
-
Field Details
-
INTERNAL_NAME
- See Also:
-
CONTENT_TYPE
- See Also:
-
DISABLED
- See Also:
-
LOCALE_CODE
- See Also:
-
-
Constructor Details
-
ItemServiceInternalImpl
public ItemServiceInternalImpl()
-
-
Method Details
-
upsertEntry
Description copied from interface:ItemServiceInternalInsert record for item if it does not exist, otherwise update it- Specified by:
upsertEntryin interfaceItemServiceInternal- Parameters:
item- item to add or update
-
getItem
Description copied from interface:ItemServiceInternalGet item by given id- Specified by:
getItemin interfaceItemServiceInternal- Parameters:
siteId- site identifierid- item id- Returns:
- item
-
getItem
Description copied from interface:ItemServiceInternalGet item fir given site and path- Specified by:
getItemin interfaceItemServiceInternal- Parameters:
siteId- site identifierpath- item path- Returns:
- item
-
getItem
Description copied from interface:ItemServiceInternalGet item fir given site and path- Specified by:
getItemin interfaceItemServiceInternal- Parameters:
siteId- site identifierpath- item pathpreferContent- if true return content item if available- Returns:
- item
-
getItems
Description copied from interface:ItemServiceInternalGet items for given site and paths- Specified by:
getItemsin interfaceItemServiceInternal- Parameters:
siteId- site identifierpaths- item paths- Returns:
- list of items
-
getItems
Description copied from interface:ItemServiceInternalGet items for given site and paths- Specified by:
getItemsin interfaceItemServiceInternal- Parameters:
siteId- site identifierpaths- item pathspreferContent- if true return content item if available- Returns:
- list of items
-
deleteItem
Description copied from interface:ItemServiceInternalDelete item- Specified by:
deleteItemin interfaceItemServiceInternal- Parameters:
siteId- siteIdentifierpath- path of item to be deleted
-
updateItem
Description copied from interface:ItemServiceInternalUpdate item- Specified by:
updateItemin interfaceItemServiceInternal- Parameters:
item- item to update
-
setSystemProcessing
Description copied from interface:ItemServiceInternalSet system processing for item- Specified by:
setSystemProcessingin interfaceItemServiceInternal- Parameters:
siteId- site identifierpath- path of the itemisSystemProcessing- true if item is being processed by system, otherwise false
-
setSystemProcessingBulk
Description copied from interface:ItemServiceInternalSet system processing for items- Specified by:
setSystemProcessingBulkin interfaceItemServiceInternal- Parameters:
siteId- site identifierpaths- paths of itemsisSystemProcessing- true if item is being processed by system, otherwise false
-
updateStateBits
Description copied from interface:ItemServiceInternalUpdate states to flip on list off states and flip off another list of states for item- Specified by:
updateStateBitsin interfaceItemServiceInternal- Parameters:
siteId- site identifierpath- path of itemonStateBitMap- states bitmap to flip onoffStateBitMap- stats bitmap to flip off
-
updateStateBitsBulk
public void updateStateBitsBulk(String siteId, Collection<String> paths, long onStateBitMap, long offStateBitMap) Description copied from interface:ItemServiceInternalUpdate states to flip on list off states and flip off another list of states for items- Specified by:
updateStateBitsBulkin interfaceItemServiceInternal- Parameters:
siteId- site identifierpaths- list of paths of itemsonStateBitMap- states bitmap to flip onoffStateBitMap- stats bitmap to flip off
-
instantiateItem
- Specified by:
instantiateItemin interfaceItemServiceInternal
-
deleteItemsForSite
public void deleteItemsForSite(long siteId) Description copied from interface:ItemServiceInternalDelete all items for site- Specified by:
deleteItemsForSitein interfaceItemServiceInternal- Parameters:
siteId- site id
-
getBrowserUrl
Description copied from interface:ItemServiceInternalGet browser url for given repository item- Specified by:
getBrowserUrlin interfaceItemServiceInternal- Parameters:
site- site identifierpath- path of the content- Returns:
- browser url
-
getBrowserUri
-
persistItemAfterCreate
public void persistItemAfterCreate(String siteId, String path, String username, String commitId, boolean unlock, Long parentId) throws ServiceLayerException, UserNotFoundException Description copied from interface:ItemServiceInternalPersist item metadata after create- Specified by:
persistItemAfterCreatein interfaceItemServiceInternal- Parameters:
siteId- site identifierpath- path of the contentusername- user that executed write operationcommitId- commit id of the write operationunlock- Indicates if content needs to be unlocked after write (save & close)parentId- id of parent item- Throws:
ServiceLayerExceptionUserNotFoundException
-
persistItemAfterWrite
public void persistItemAfterWrite(String siteId, String path, String username, String commitId, boolean unlock) throws ServiceLayerException, UserNotFoundException Description copied from interface:ItemServiceInternalPersist item metadata after write- Specified by:
persistItemAfterWritein interfaceItemServiceInternal- Parameters:
siteId- site identifierpath- path of the contentusername- user that executed write operationcommitId- commit id of the write operationunlock- Indicates if content needs to be unlocked after write (save & close)- Throws:
ServiceLayerExceptionUserNotFoundException
-
persistItemAfterCreateFolder
public void persistItemAfterCreateFolder(String siteId, String folderPath, String folderName, String username, String commitId, Long parentId) throws ServiceLayerException, UserNotFoundException Description copied from interface:ItemServiceInternalPersist item metadata after create folder- Specified by:
persistItemAfterCreateFolderin interfaceItemServiceInternal- Parameters:
siteId- site identifierfolderPath- folder pathfolderName- folder nameusername- user that executed create folder operationcommitId- commit id of the create folder operationparentId- id of parent item- Throws:
ServiceLayerExceptionUserNotFoundException
-
persistItemAfterRenameContent
public void persistItemAfterRenameContent(String siteId, String path, String name, String username, String commitId, String contentType) throws ServiceLayerException, UserNotFoundException Description copied from interface:ItemServiceInternalPersist item metadata after rename folder- Specified by:
persistItemAfterRenameContentin interfaceItemServiceInternal- Parameters:
siteId- site identifierpath- file pathname- file nameusername- user that executed create folder operationcommitId- commit id of the create folder operationcontentType- content type- Throws:
ServiceLayerExceptionUserNotFoundException
-
moveItem
Description copied from interface:ItemServiceInternalMove item- Specified by:
moveItemin interfaceItemServiceInternal- Parameters:
siteId- site identifieroldPath- old pathnewPath- new pathparentId- new parent IDlabel- new label
-
isNew
Description copied from interface:ItemServiceInternalCheck if item is new- Specified by:
isNewin interfaceItemServiceInternal- Parameters:
siteId- site identifierpath- path of the item- Returns:
- true if NEW flag is set otherwise false
-
countAllContentItems
public int countAllContentItems()Description copied from interface:ItemServiceInternalCount all content items- Specified by:
countAllContentItemsin interfaceItemServiceInternal- Returns:
- number of content items in the system
-
clearPreviousPath
Description copied from interface:ItemServiceInternalClear previous path of the content- Specified by:
clearPreviousPathin interfaceItemServiceInternal- Parameters:
siteId- site identifierpath- path of the content;
-
convertHistoryItemToDashboardItem
Description copied from interface:ItemServiceInternalConvert Publishing History Item to Publishing Dashboard Item- Specified by:
convertHistoryItemToDashboardItemin interfaceItemServiceInternal- Parameters:
historyItem- publishing history item- Returns:
- publishing dashboard item
-
getInProgressItems
Description copied from interface:ItemServiceInternalGet in progress items for given site- Specified by:
getInProgressItemsin interfaceItemServiceInternal- Parameters:
siteId- site identifier- Returns:
- list of items
-
isUpdatedOrNew
Description copied from interface:ItemServiceInternalCheck if item is update or new- Specified by:
isUpdatedOrNewin interfaceItemServiceInternal- Parameters:
siteId- site identifierpath- item path- Returns:
- true if item is new or modified
-
deleteItemForFolder
Description copied from interface:ItemServiceInternalDelete items for site and paths- Specified by:
deleteItemForFolderin interfaceItemServiceInternal- Parameters:
siteId- site idfolderPath- folder path to delete
-
isSystemProcessing
Description copied from interface:ItemServiceInternalCheck if item is in system processing- Specified by:
isSystemProcessingin interfaceItemServiceInternal- Parameters:
siteId- site identifierpath- item path- Returns:
- true if item is in system processing
-
previousPathExists
Description copied from interface:ItemServiceInternalCheck if path exists as previous path- Specified by:
previousPathExistsin interfaceItemServiceInternal- Parameters:
siteId- site identifierpath- path to check- Returns:
- true if item exists with previous path as given path
-
updateCommitId
Description copied from interface:ItemServiceInternalUpdate commit id for item- Specified by:
updateCommitIdin interfaceItemServiceInternal- Parameters:
siteId- site identifierpath- path of the itemcommitId- commit id
-
getMandatoryParentsForPublishing
Description copied from interface:ItemServiceInternalGet mandatory parents for publishing for given site and list of paths- Specified by:
getMandatoryParentsForPublishingin interfaceItemServiceInternal- Parameters:
siteId- site identifierpaths- list of paths- Returns:
- list of mandatory parents paths
-
getExistingRenamedChildrenOfMandatoryParentsForPublishing
public List<String> getExistingRenamedChildrenOfMandatoryParentsForPublishing(String siteId, List<String> parents) Description copied from interface:ItemServiceInternalGet existing renamed children of mandatory parents for publishing- Specified by:
getExistingRenamedChildrenOfMandatoryParentsForPublishingin interfaceItemServiceInternal- Parameters:
siteId- site identifierparents- list of parents paths- Returns:
- list of children paths
-
getChangeSetForSubtree
Description copied from interface:ItemServiceInternalGet change set for subtree- Specified by:
getChangeSetForSubtreein interfaceItemServiceInternal- Parameters:
siteId- site identifierpath- root path of the subtree- Returns:
- list of items
-
updateLastPublishedOn
Description copied from interface:ItemServiceInternalUpdate last published date for item- Specified by:
updateLastPublishedOnin interfaceItemServiceInternal- Parameters:
siteId- site identifierpath- path of the itemlastPublishedOn- published date
-
lockItemByPath
public void lockItemByPath(String siteId, String path, String username) throws UserNotFoundException, ServiceLayerException Description copied from interface:ItemServiceInternalLock item for given lock owner- Specified by:
lockItemByPathin interfaceItemServiceInternal- Parameters:
siteId- site identifierpath- item pathusername- user that owns the lock- Throws:
UserNotFoundExceptionServiceLayerException
-
unlockItemByPath
Description copied from interface:ItemServiceInternalUnlock item- Specified by:
unlockItemByPathin interfaceItemServiceInternal- Parameters:
siteId- site identifierpath- item path
-
getItemStatesTotal
Description copied from interface:ItemServiceInternalGet total number of item states records for given filters by path regex and states mask- Specified by:
getItemStatesTotalin interfaceItemServiceInternal- Parameters:
siteId- site identifierpath- path regex to filter itemsstates- states mask to filter items by state- Returns:
- number of records
-
getItemStates
public List<Item> getItemStates(String siteId, String path, Long states, List<String> systemTypes, List<org.craftercms.commons.rest.parameters.SortField> sortFields, int offset, int limit) Description copied from interface:ItemServiceInternalGet item states for given filters by path regex and states mask- Specified by:
getItemStatesin interfaceItemServiceInternal- Parameters:
siteId- site identifierpath- path regex to filter itemsstates- states mask to filter items by statesystemTypes- system types to filter itemssortFields- sort fieldsoffset- offset for the first record in result setlimit- number of item states records to return- Returns:
- list of sandbox items
-
updateItemStates
public void updateItemStates(String siteId, List<String> paths, boolean clearSystemProcessing, boolean clearUserLocked, Boolean live, Boolean staged, Boolean isNew, Boolean modified) Description copied from interface:ItemServiceInternalUpdate item state flags for given items- Specified by:
updateItemStatesin interfaceItemServiceInternal- Parameters:
siteId- site identifierpaths- item pathsclearSystemProcessing- if true clear system processing flag, otherwise ignoreclearUserLocked- if true clear user locked flag, otherwise ignorelive- if true set live flag, otherwise reset itstaged- if true set staged flag, otherwise reset itisNew- value to set the 'new' flag to, or null if the flag should not changemodified- value to set the 'modified' flag to, or null if the flag should not change
-
getSetStatesMask
-
getResetStatesMask
-
updateItemStatesByQuery
public void updateItemStatesByQuery(String siteId, String path, Long states, boolean clearSystemProcessing, boolean clearUserLocked, Boolean live, Boolean staged, Boolean isNew, Boolean modified) Description copied from interface:ItemServiceInternalUpdate item state flags for given path query- Specified by:
updateItemStatesByQueryin interfaceItemServiceInternal- Parameters:
siteId- site identifierpath- path regex to identify itemsclearSystemProcessing- if true clear system processing flag, otherwise ignoreclearUserLocked- if true clear user locked flag, otherwise ignorelive- if true set live flag, otherwise reset itstaged- if true set staged flag, otherwise reset itisNew- value to set the 'new' flag to, or null if the flag should not changemodified- value to set the 'modified' flag to, or null if the flag should not change
-
getSubtreeForDelete
Description copied from interface:ItemServiceInternalGet subtree for delete- Specified by:
getSubtreeForDeletein interfaceItemServiceInternal- Parameters:
siteId- site identifierpath- root path of the subtree- Returns:
- list of items
-
updateStatesForSite
Description copied from interface:ItemServiceInternalUpdate states for all content in the given site- Specified by:
updateStatesForSitein interfaceItemServiceInternal- Parameters:
siteId- site identifieronStateBitMap- states bitmap to flip onoffStateBitMap- states bitmap to flip off
-
updateNewPageChildren
Description copied from interface:ItemServiceInternalUpdates a new page's children (in case the folder existed before the page was created) to point to the new page.- Specified by:
updateNewPageChildrenin interfaceItemServiceInternal- Parameters:
siteId- site identifierfolderPath- path of the folder where the new index.xml has been added
-
setUserServiceInternal
-
setSiteFeedMapper
-
setItemDao
-
setServicesConfig
-
setContentServiceInternal
-
setContentService
-
setGeneralLockService
-
setRetryingDatabaseOperationFacade
public void setRetryingDatabaseOperationFacade(RetryingDatabaseOperationFacade retryingDatabaseOperationFacade)
-