Class FormDmContentProcessor
java.lang.Object
org.craftercms.studio.impl.v1.content.pipeline.BaseContentProcessor
org.craftercms.studio.impl.v1.content.pipeline.PathMatchProcessor
org.craftercms.studio.impl.v1.content.pipeline.FormDmContentProcessor
- All Implemented Interfaces:
ContentProcessor
,DmContentProcessor
- Direct Known Subclasses:
AssetDmContentProcessor
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ContentRepository
protected ContentRepository
protected ContentService
protected ContentService
protected ItemServiceInternal
static final String
protected ServicesConfig
protected WorkflowService
Fields inherited from class org.craftercms.studio.impl.v1.content.pipeline.PathMatchProcessor
_matchPaths, _unmatchPaths
Fields inherited from class org.craftercms.studio.impl.v1.content.pipeline.BaseContentProcessor
_name
-
Constructor Summary
ConstructorsConstructorDescriptiondefault constructorFormDmContentProcessor
(String name) constructor that sets the process name -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
cancelWorkflow
(String site, String path) cancel the pending workflow upon editing the content at the given path?createMissingFoldersInPath
(String site, String path, boolean isPreview) create missing folders in the given pathprotected ContentItemTO
createNewFile
(String site, ContentItemTO parentItem, String fileName, InputStream input, String user, boolean unlock, ResultTO result) create new file to the given path.fileToFolder
(String site, String path) change file to folder content.void
process
(PipelineContent content, ResultTO result) process the content at the given path.void
setContentRepository
(ContentRepository contentRepository) void
setContentRepositoryV1
(ContentRepository contentRepositoryV1) void
setContentService
(ContentService contentService) void
setContentServiceV2
(ContentService contentServiceV2) void
setItemServiceInternal
(ItemServiceInternal itemServiceInternal) void
setServicesConfig
(ServicesConfig servicesConfig) void
setWorkflowService
(WorkflowService workflowService) protected void
protected void
updateFile
(String site, String path, InputStream input, String user, boolean isPreview, boolean unlock, ResultTO result) update the file at the given content nodeprotected boolean
updateWorkFlow
(String site, String path) protected void
writeContent
(PipelineContent content, ResultTO result) Methods inherited from class org.craftercms.studio.impl.v1.content.pipeline.PathMatchProcessor
isProcessable, setMatchPaths, setUnmatchPaths
Methods inherited from class org.craftercms.studio.impl.v1.content.pipeline.BaseContentProcessor
checkForMandatoryParam, getName, setName
-
Field Details
-
NAME
- See Also:
-
contentService
-
workflowService
-
servicesConfig
-
contentRepository
-
itemServiceInternal
-
contentRepositoryV1
-
contentServiceV2
-
-
Constructor Details
-
FormDmContentProcessor
public FormDmContentProcessor()default constructor -
FormDmContentProcessor
constructor that sets the process name- Parameters:
name
-
-
-
Method Details
-
process
Description copied from interface:ContentProcessor
process the content at the given path.- Specified by:
process
in interfaceContentProcessor
- Overrides:
process
in classBaseContentProcessor
- Parameters:
content
- content to processresult
- result to return- Throws:
ContentProcessException
-
writeContent
- Throws:
ServiceLayerException
-
unlock
protected void unlock(String siteId, String path) throws ContentNotFoundException, SiteNotFoundException -
createNewFile
protected ContentItemTO createNewFile(String site, ContentItemTO parentItem, String fileName, InputStream input, String user, boolean unlock, ResultTO result) throws ServiceLayerException create new file to the given path. If the path is a file name, it will create a new folder with the same name as the file name (without the prefix) and move the existing file to the folder created. Then it creates new file to the folder- Parameters:
site
- Site namefileName
- new file nameinput
- file contentuser
- current user- Throws:
ContentNotFoundException
ServiceLayerException
-
updateFile
protected void updateFile(String site, String path, InputStream input, String user, boolean isPreview, boolean unlock, ResultTO result) throws ServiceLayerException, UserNotFoundException update the file at the given content node- Parameters:
input
-user
-isPreview
-unlock
- unlock the content upon update?- Throws:
ServiceLayerException
UserNotFoundException
-
cancelWorkflow
cancel the pending workflow upon editing the content at the given path?- Parameters:
site
-path
-- Returns:
- true if workflow needs to be canceled
-
updateWorkFlow
-
createMissingFoldersInPath
public ContentItemTO createMissingFoldersInPath(String site, String path, boolean isPreview) throws ServiceLayerException, UserNotFoundException Description copied from interface:DmContentProcessor
create missing folders in the given path- Specified by:
createMissingFoldersInPath
in interfaceDmContentProcessor
- Parameters:
site
-path
-isPreview
-- Returns:
- last child folder in the path
- Throws:
ServiceLayerException
UserNotFoundException
-
fileToFolder
public String fileToFolder(String site, String path) throws ServiceLayerException, UserNotFoundException Description copied from interface:DmContentProcessor
change file to folder content. See WcmClipboardServiceImpl when updating this logic. Duplicate exists due to prevent circular dependency- Specified by:
fileToFolder
in interfaceDmContentProcessor
- Parameters:
site
- site idpath
- content path- Returns:
- new content path
- Throws:
ServiceLayerException
UserNotFoundException
-
setContentService
-
setWorkflowService
-
setServicesConfig
-
setContentRepository
-
setItemServiceInternal
-
setContentRepositoryV1
-
setContentServiceV2
-