Class ClipboardServiceInternalImpl
java.lang.Object
org.craftercms.studio.impl.v2.service.clipboard.internal.ClipboardServiceInternalImpl
- All Implemented Interfaces:
ClipboardServiceInternal
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
public class ClipboardServiceInternalImpl
extends Object
implements ClipboardServiceInternal, org.springframework.context.ApplicationContextAware
Default implementation of
ClipboardServiceInternal
Note: This class could be removed in the future if the logic is moved to the new content service
- Since:
- 3.2
- Author:
- joseross
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.springframework.context.ApplicationContext
protected ContentService
protected WorkflowService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionduplicateItem
(String siteId, String path) Duplicates the given itemprotected String
getParentUrl
(String path) Get the parent url: for folders & components it's just parent, for pages it's the parent of the parent.pasteItems
(String siteId, Operation operation, String targetPath, PasteItem item) Performs the given clipboard operationprotected void
pasteItemsInternal
(String siteId, Operation operation, String targetPath, List<PasteItem> items, List<String> pastedItems) void
setApplicationContext
(org.springframework.context.ApplicationContext applicationContext) void
setContentService
(ContentService contentService) void
setWorkflowService
(WorkflowService workflowService) protected void
validatePasteItemsAction
(String siteId, Operation operation, String sourcePath, String targetPath)
-
Field Details
-
contentService
-
workflowService
-
applicationContext
protected org.springframework.context.ApplicationContext applicationContext
-
-
Constructor Details
-
ClipboardServiceInternalImpl
public ClipboardServiceInternalImpl()
-
-
Method Details
-
validatePasteItemsAction
protected void validatePasteItemsAction(String siteId, Operation operation, String sourcePath, String targetPath) throws ServiceLayerException - Throws:
ServiceLayerException
-
pasteItems
public List<String> pasteItems(String siteId, Operation operation, String targetPath, PasteItem item) throws ServiceLayerException, UserNotFoundException Description copied from interface:ClipboardServiceInternal
Performs the given clipboard operation- Specified by:
pasteItems
in interfaceClipboardServiceInternal
- Parameters:
siteId
- the id of the siteoperation
- the clipboard operationtargetPath
- the target pathitem
- the item to paste- Returns:
- the list of pasted items
- Throws:
ServiceLayerException
- if there is any error during the operationUserNotFoundException
- if the user is not found
-
pasteItemsInternal
protected void pasteItemsInternal(String siteId, Operation operation, String targetPath, List<PasteItem> items, List<String> pastedItems) throws ServiceLayerException, UserNotFoundException -
duplicateItem
public String duplicateItem(String siteId, String path) throws ServiceLayerException, UserNotFoundException Description copied from interface:ClipboardServiceInternal
Duplicates the given item- Specified by:
duplicateItem
in interfaceClipboardServiceInternal
- Parameters:
siteId
- the id of the sitepath
- the path of the item- Returns:
- the path of the new item
- Throws:
ServiceLayerException
- if there is any error copying the itemUserNotFoundException
- if the user is not found
-
getParentUrl
Get the parent url: for folders & components it's just parent, for pages it's the parent of the parent. e.g.: /site/website/articles/page1/index.xml -> /site/website/articles /site/components/posts/january/clickbait.xml -> /site/components/posts/january /site/components/articles/health/ -> /site/components/articles- Parameters:
path
- path of the content item- Returns:
- path of the parent item
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) - Specified by:
setApplicationContext
in interfaceorg.springframework.context.ApplicationContextAware
-
setContentService
-
setWorkflowService
-