Interface ItemServiceInternal
- All Known Implementing Classes:
ItemServiceInternalImpl
public interface ItemServiceInternal
-
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 sitegetBrowserUrl(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 pathsgetSubtreeForDelete(String siteId, String path) Get subtree for deleteinstantiateItem(String siteName, String path) booleanCheck if item is newbooleanisSystemProcessing(String site, String path) Check if item is in system processingbooleanisUpdatedOrNew(String site, 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 pathvoidrecalculateItemStates(String siteId, List<String> paths) Recalculate the item states for the given paths based on the publish_request and workflow tablesvoidsetSystemProcessing(String siteId, String path, boolean isSystemProcessing) Set system processing for itemvoidsetSystemProcessingBulk(String siteId, List<String> paths, boolean isSystemProcessing) Set system processing for itemsvoidunlockItemByPath(String siteId, String path) Unlock 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 site, String path) Updates a new page's children (in case the folder existed before the page was created) to point to the new page.voidupdateParentId(long siteId, Collection<String> paths) Recalculate the parent id for the given pathsvoidupdateParentId(String siteId) Recalculate the parent id for all the items in the sitevoidupdateStateBits(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
-
Method Details
-
upsertEntry
Insert record for item if it does not exist, otherwise update it- Parameters:
item- item to add or update
-
getItem
Get item by given id- Parameters:
siteId- site identifierid- item id- Returns:
- item
-
getItem
Get item fir given site and path- Parameters:
siteId- site identifierpath- item path- Returns:
- item
-
getItem
Get item fir given site and path- Parameters:
siteId- site identifierpath- item pathpreferContent- if true return content item if available- Returns:
- item
-
getItems
Get items for given site and paths- Parameters:
siteId- site identifierpath- item paths- Returns:
- list of items
-
getItems
Get items for given site and paths- Parameters:
siteId- site identifierpaths- item pathspreferContent- if true return content item if available- Returns:
- list of items
-
updateItem
Update item- Parameters:
item- item to update
-
deleteItem
Delete item- Parameters:
siteId- siteIdentifierpath- path of item to be deleted
-
setSystemProcessing
Set system processing for item- Parameters:
siteId- site identifierpath- path of the itemisSystemProcessing- true if item is being processed by system, otherwise false
-
setSystemProcessingBulk
Set system processing for items- Parameters:
siteId- site identifierpaths- paths of itemsisSystemProcessing- true if item is being processed by system, otherwise false
-
updateStateBits
Update states to flip on list off states and flip off another list of states for item- Parameters:
siteId- site identifierpath- path of itemonStateBitMap- states bitmap to flip onoffStateBitMap- stats bitmap to flip off
-
updateStateBitsBulk
void updateStateBitsBulk(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 items- Parameters:
siteId- site identifierpaths- list of paths of itemsonStateBitMap- states bitmap to flip onoffStateBitMap- stats bitmap to flip off
-
instantiateItem
-
deleteItemsForSite
void deleteItemsForSite(long siteId) Delete all items for site- Parameters:
siteId- site id
-
getBrowserUrl
Get browser url for given repository item- Parameters:
site- site identifierpath- path of the content- Returns:
- browser url
-
persistItemAfterCreate
void persistItemAfterCreate(String siteId, String path, String username, String commitId, boolean unlock, Long parentId) throws ServiceLayerException, UserNotFoundException Persist item metadata after create- 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
void persistItemAfterWrite(String siteId, String path, String username, String commitId, boolean unlock) throws ServiceLayerException, UserNotFoundException Persist item metadata after write- 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
void persistItemAfterCreateFolder(String siteId, String folderPath, String folderName, String username, String commitId, Long parentId) throws ServiceLayerException, UserNotFoundException Persist item metadata after create folder- 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
void persistItemAfterRenameContent(String siteId, String path, String name, String username, String commitId, String contentType) throws ServiceLayerException, UserNotFoundException Persist item metadata after rename folder- 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
Move item- Parameters:
siteId- site identifieroldPath- old pathnewPath- new pathparentId- new parent IDlabel- new label
-
isNew
Check if item is new- Parameters:
siteId- site identifierpath- path of the item- Returns:
- true if NEW flag is set otherwise false
-
countAllContentItems
int countAllContentItems()Count all content items- Returns:
- number of content items in the system
-
clearPreviousPath
Clear previous path of the content- Parameters:
siteId- site identifierpath- path of the content;
-
convertHistoryItemToDashboardItem
Convert Publishing History Item to Publishing Dashboard Item- Parameters:
historyItem- publishing history item- Returns:
- publishing dashboard item
-
getInProgressItems
Get in progress items for given site- Parameters:
siteId- site identifier- Returns:
- list of items
-
isUpdatedOrNew
Check if item is update or new- Parameters:
site- site identifierpath- item path- Returns:
- true if item is new or modified
-
deleteItemForFolder
Delete items for site and paths- Parameters:
siteId- site idfolderPath- folder path to delete
-
isSystemProcessing
Check if item is in system processing- Parameters:
site- site identifierpath- item path- Returns:
- true if item is in system processing
-
previousPathExists
Check if path exists as previous path- Parameters:
siteId- site identifierpath- path to check- Returns:
- true if item exists with previous path as given path
-
getMandatoryParentsForPublishing
Get mandatory parents for publishing for given site and list of paths- Parameters:
siteId- site identifierpaths- list of paths- Returns:
- list of mandatory parents paths
-
getExistingRenamedChildrenOfMandatoryParentsForPublishing
List<String> getExistingRenamedChildrenOfMandatoryParentsForPublishing(String siteId, List<String> parents) Get existing renamed children of mandatory parents for publishing- Parameters:
siteId- site identifierparents- list of parents paths- Returns:
- list of children paths
-
getChangeSetForSubtree
Get change set for subtree- Parameters:
siteId- site identifierpath- root path of the subtree- Returns:
- list of items
-
updateLastPublishedOn
Update last published date for item- Parameters:
siteId- site identifierpath- path of the itemlastPublishedOn- published date
-
lockItemByPath
void lockItemByPath(String siteId, String path, String username) throws UserNotFoundException, ServiceLayerException Lock item for given lock owner- Parameters:
siteId- site identifierpath- item pathusername- user that owns the lock- Throws:
UserNotFoundExceptionServiceLayerException
-
unlockItemByPath
Unlock item- Parameters:
siteId- site identifierpath- item path
-
getItemStatesTotal
Get total number of item states records for given filters by path regex and states mask- Parameters:
siteId- site identifierpath- path regex to filter itemsstates- states mask to filter items by state- Returns:
- number of records
-
getItemStates
List<Item> getItemStates(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 mask- 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
void updateItemStates(String siteId, List<String> paths, boolean clearSystemProcessing, boolean clearUserLocked, Boolean live, Boolean staged, Boolean isNew, Boolean modified) Update item state flags for given items- 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
-
updateItemStatesByQuery
void updateItemStatesByQuery(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 query- 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
Get subtree for delete- Parameters:
siteId- site identifierpath- root path of the subtree- Returns:
- list of items
-
updateStatesForSite
Update states for all content in the given site- Parameters:
siteId- site identifieronStateBitMap- states bitmap to flip onoffStateBitMap- states bitmap to flip off
-
updateNewPageChildren
Updates a new page's children (in case the folder existed before the page was created) to point to the new page.- Parameters:
site- site identifierpath- path of the folder where the new index.xml has been added
-
updateParentId
Recalculate the parent id for all the items in the site- Parameters:
siteId- the site id
-
updateParentId
Recalculate the parent id for the given paths- Parameters:
siteId- the site idpaths- the paths to update
-
recalculateItemStates
Recalculate the item states for the given paths based on the publish_request and workflow tables- Parameters:
siteId- the site idpaths- the item paths to update
-