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 ContentRepositoryprotected ContentRepositoryprotected ContentServiceprotected ContentServiceprotected ItemServiceInternalstatic final Stringprotected ServicesConfigprotected WorkflowServiceFields inherited from class org.craftercms.studio.impl.v1.content.pipeline.PathMatchProcessor
_matchPaths, _unmatchPathsFields 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 booleancancelWorkflow(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 ContentItemTOcreateNewFile(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.voidprocess(PipelineContent content, ResultTO result) process the content at the given path.voidsetContentRepository(ContentRepository contentRepository) voidsetContentRepositoryV1(ContentRepository contentRepositoryV1) voidsetContentService(ContentService contentService) voidsetContentServiceV2(ContentService contentServiceV2) voidsetItemServiceInternal(ItemServiceInternal itemServiceInternal) voidsetServicesConfig(ServicesConfig servicesConfig) voidsetWorkflowService(WorkflowService workflowService) protected voidprotected voidupdateFile(String site, String path, InputStream input, String user, boolean isPreview, boolean unlock, ResultTO result) update the file at the given content nodeprotected booleanupdateWorkFlow(String site, String path) protected voidwriteContent(PipelineContent content, ResultTO result) Methods inherited from class org.craftercms.studio.impl.v1.content.pipeline.PathMatchProcessor
isProcessable, setMatchPaths, setUnmatchPathsMethods 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:ContentProcessorprocess the content at the given path.- Specified by:
processin interfaceContentProcessor- Overrides:
processin 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:
ContentNotFoundExceptionServiceLayerException
-
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:
ServiceLayerExceptionUserNotFoundException
-
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:DmContentProcessorcreate missing folders in the given path- Specified by:
createMissingFoldersInPathin interfaceDmContentProcessor- Parameters:
site-path-isPreview-- Returns:
- last child folder in the path
- Throws:
ServiceLayerExceptionUserNotFoundException
-
fileToFolder
public String fileToFolder(String site, String path) throws ServiceLayerException, UserNotFoundException Description copied from interface:DmContentProcessorchange file to folder content. See WcmClipboardServiceImpl when updating this logic. Duplicate exists due to prevent circular dependency- Specified by:
fileToFolderin interfaceDmContentProcessor- Parameters:
site- site idpath- content path- Returns:
- new content path
- Throws:
ServiceLayerExceptionUserNotFoundException
-
setContentService
-
setWorkflowService
-
setServicesConfig
-
setContentRepository
-
setItemServiceInternal
-
setContentRepositoryV1
-
setContentServiceV2
-