Class ContentServiceImpl
java.lang.Object
org.craftercms.studio.impl.v1.service.content.ContentServiceImpl
- All Implemented Interfaces:
ContentService,org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware
public class ContentServiceImpl
extends Object
implements ContentService, org.springframework.context.ApplicationContextAware
Content Services that other services may use
- Author:
- russdanner
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classSimple Object to hold result of calculating target paths for copy/cut and paste operation. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ActivityStreamServiceInternalprotected org.springframework.context.ApplicationContextprotected AuditServiceInternalprotected ContentItemIdGeneratorprotected ProcessContentExecutorprotected ContentServiceprotected ContentTypeServicestatic final Stringstatic final Patternstatic final Patternfile and folder name patterns for copied files and foldersstatic final Patternprotected DependencyDiffServiceprotected DependencyServiceprotected DmContentLifeCycleServiceprotected DmPageNavigationOrderServiceprotected org.craftercms.commons.entitlements.validator.EntitlementValidatorstatic final Stringstatic final Stringprotected ItemServiceInternalprotected SecurityServiceprotected ServicesConfigprotected SiteServiceprotected StudioConfigurationprotected UserServiceInternalprotected WorkflowServiceInternal -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddDependenciesToDelete(String site, String sourceContentPath, GoLiveDeleteCandidates candidates) protected voidaddOrderValue(List<DmOrderTO> orders, String orderName, String orderStr) add order value to the list of ordersprotected voidaddRemovedDependenciesToDelete(String site, String relativePath, GoLiveDeleteCandidates candidates) voidcheckContentExists(String site, String path) Checks if a content exists at a given path and throw an exception if it does not.voidcheckWriteAssetPath(String path) Check if path is a correct location to write asset contentprotected voidchildDeleteItems(String site, ContentItemTO contentItem, GoLiveDeleteCandidates items) Iterate over all paths inside the folderprotected doublecomputeReorder(String site, String relativePath, DmOrderTO beforeOrderTO, DmOrderTO afterOrderTO, String orderName) Will need to include the floating pages as well for orderValue computation Since the beforeOrder and afterOrder in the UI does not include floating pages will need to do special processingprotected ContentServiceImpl.PastedPathMapconstructNewPathForCutCopy(String site, String fromPath, String toPath, boolean adjustOnCollide) @javax.validation.Valid booleancontentExists(String site, String path) Check if content exists@Valid StringcopyContent(String site, String fromPath, String toPath) copy content fromPath to toPathprotected Stringinternal method copy that handles Get dependencies is already recursive@Valid ContentItemTOcreateDummyDmContentItemForDeletedNode(String site, String relativePath) @javax.validation.Valid booleancreateFolder(String site, String path, String name) create a folderprotected ContentItemTOcreateNewContentItemTO(String site, String contentPath) @javax.validation.Valid booleandeleteContent(String site, String path, boolean generateActivity, String approver) @javax.validation.Valid booleandeleteContent(String site, String path, String approver) delete content at the pathfilterDependenciesMatchingDeletePattern(String site, String sourcePath, List<String> dependencies) protected voidgenerateDeleteActivity(String site, String path, String approver) protected static StringgetBrowserUri(String uri, String replacePattern, boolean isPage) protected StringgetBrowserUri(ContentItemTO item) @Valid InputStreamgetContent(String site, String path) get document from wcm content@Valid org.dom4j.DocumentgetContentAsDocument(String site, String path) get document from wcm content@Valid org.springframework.core.io.ResourcegetContentAsResource(String site, String path) Returns content wrapped as aResourceinstance@Valid StringgetContentAsString(String site, String path, String encoding) get content as string from repository@Valid StringgetContentAsString(String site, String path) get content as string from repositorygetContentIds(org.dom4j.Document document) Return the values for PageID and GroupID provided a Document@Valid ContentItemTOgetContentItem(String site, String path) get the content item (metadata) at a specific path@Valid ContentItemTOgetContentItem(String site, String path, int depth) get the content item (metadata) at a specific path@Valid ContentItemTOgetContentItemTree(String site, String path, int depth) get the tree of content items (metadata) beginning at a root@Valid VersionTO[]getContentItemVersionHistory(String site, String path) get the version history for an item@javax.validation.Valid longgetContentSize(String site, String path) get file size@Valid StringgetContentTypeClass(String site, String uri) @Valid Optional<org.springframework.core.io.Resource> getContentVersion(String site, String path, String commitId) return the content for a given version@Valid StringgetContentVersionAsString(String site, String path, String version) return the content for a given version@Valid GoLiveDeleteCandidatesgetDeleteCandidates(String site, String relativePath) protected List<DeleteDependencyConfigTO> getDeletePatternConfig(String site, String relativePath) getItemContentType(String site, String path) Retrieves the content type for a given pathgetItemOrders(String site, String path) getItemOrders(List<org.dom4j.Node> nodes) get WCM content item order metadatagetItemSpecificDependencies(String site, String path, org.dom4j.Document document, Map<String, String> copyDependencies) @Valid StringgetNextAvailableName(String site, String path) get the next available of the given content name at the given path (used for paste/duplicate)getRemovedDependencies(DependencyDiffService.DiffRequest diffRequest, boolean matchDeletePattern) protected ContentItemTOloadContentItem(String site, String path) protected voidloadContentTypeProperties(String site, ContentItemTO item, String contentType) voidlockContent(String site, String path) protected booleanmatchesPatterns(String uri, List<String> patterns) @Valid StringmoveContent(String site, String fromPath, String toPath) move content fromPath to toPathvoidnotifyContentEvent(String site, String path) Notify when there is a content updateprotected ContentItemTOpopulateContentDrivenProperties(String site, ContentItemTO item) protected ContentItemTOpopulateItemChildren(ContentItemTO item, int depth) protected voidpopulateMetadata(String site, ContentItemTO item) protected voidpopulateWorkflowProperties(String site, ContentItemTO item) @Valid ResultTOprocessContent(String id, InputStream input, boolean isXml, Map<String, String> params, String contentChainForm) booleanpullFromRemote(String siteId, String remoteName, String remoteBranch) Pull from remote repositorybooleanpushToRemote(String siteId, String remoteName, String remoteBranch) Push content to remote repository@javax.validation.Valid booleanrenameContent(String site, String path, String name) rename a content item@javax.validation.Valid doubleprotected org.dom4j.DocumentreplaceCopyDependency(org.dom4j.Document document, String depPath, String copyDepPath) @javax.validation.Valid booleanrevertContentItem(String site, String path, String version, boolean major, String comment) revert a version (create a new version based on an old version)voidsetActivityStreamServiceInternal(ActivityStreamServiceInternal activityStreamServiceInternal) voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) voidsetAuditServiceInternal(AuditServiceInternal auditServiceInternal) voidsetContentItemIdGenerator(ContentItemIdGenerator contentItemIdGenerator) voidsetContentProcessor(ProcessContentExecutor contentProcessor) voidsetContentRepository(ContentRepository contentRepository) voidsetContentRepositoryV2(ContentRepository contentRepository) voidsetContentServiceV2(ContentService contentServiceV2) voidsetContentTypeService(ContentTypeService contentTypeService) voidsetDependencyDiffService(DependencyDiffService dependencyDiffService) voidsetDependencyService(DependencyService dependencyService) voidsetDmContentLifeCycleService(DmContentLifeCycleService dmContentLifeCycleService) voidsetDmPageNavigationOrderService(DmPageNavigationOrderService dmPageNavigationOrderService) voidsetEntitlementValidator(org.craftercms.commons.entitlements.validator.EntitlementValidator entitlementValidator) voidsetItemServiceInternal(ItemServiceInternal itemServiceInternal) voidsetSecurityService(SecurityService securityService) voidsetServicesConfig(ServicesConfig servicesConfig) voidsetSiteService(SiteService siteService) voidsetStudioConfiguration(StudioConfiguration studioConfiguration) voidsetUserServiceInternal(UserServiceInternal userServiceInternal) voidsetWorkflowServiceInternal(WorkflowServiceInternal workflowServiceInternal) @javax.validation.Valid booleanshallowContentExists(String site, String path) This is a faster, but less accurate, version of contentExists.shallowGetContentAsString(String siteId, String path) Get content from the repository.protected voidupdateChildrenOnMove(String site, String fromPath, String movePath) protected org.dom4j.DocumentupdateContentOnCopy(org.dom4j.Document document, String filename, String folder, Map<String, String> params, String modifier) protected voidupdateContentOnMove(org.dom4j.Element root, String filename, String folder, String modifier) Updates the XML after a move operation.protected voidupdateDatabaseOnMove(String site, String fromPath, String movePath) protected voidupdateDatabaseOnMove(String site, String fromPath, String movePath, Long parentId, String label, String folderLabel) protected voidupdateDependenciesOnMove(String site, String fromPath, String movePath) booleanvalidateAndCreateFolder(String site, String path, String name) Validate the input and create a folder@Valid StringwriteContent(String site, String path, InputStream content) write contentvoidwriteContent(String site, String path, String fileName, String contentType, InputStream input, String createFolders, String edit, String unlock) write contentvoidwriteContent(String site, String path, String fileName, String contentType, InputStream input, String createFolders, String edit, String unlock, boolean skipAuditLogInsert) write content@javax.validation.Valid booleanwriteContentAndNotify(String site, String path, InputStream content) write content from an input stream and notify the subscribers.voidwriteContentAndRename(String site, String path, String targetPath, String fileName, String contentType, InputStream input, String createFolders, String edit, String unlock, boolean createFolder) writeContentAsset(String site, String path, String assetName, InputStream in, String isImage, String allowedWidth, String allowedHeight, String allowLessSize, String draft, String unlock, String systemAsset) write content asset
-
Field Details
-
servicesConfig
-
dependencyService
-
contentProcessor
-
securityService
-
dmContentLifeCycleService
-
siteService
-
contentItemIdGenerator
-
studioConfiguration
-
dependencyDiffService
-
contentTypeService
-
entitlementValidator
protected org.craftercms.commons.entitlements.validator.EntitlementValidator entitlementValidator -
auditServiceInternal
-
itemServiceInternal
-
workflowServiceInternal
-
userServiceInternal
-
applicationContext
protected org.springframework.context.ApplicationContext applicationContext -
activityStreamServiceInternal
-
contentServiceV2
-
COPY_FILE_PATTERN
file and folder name patterns for copied files and folders -
COPY_FOLDER_PATTERN
-
COPY_FILE_MODIFIER_PATTERN
-
COPY_FILE_MODIFIER_FORMAT
- See Also:
-
INTERNAL_NAME_MODIFIER_PATTERN
- See Also:
-
INTERNAL_NAME_MODIFIER_FORMAT
- See Also:
-
-
Constructor Details
-
ContentServiceImpl
public ContentServiceImpl()
-
-
Method Details
-
contentExists
Description copied from interface:ContentServiceCheck if content exists- Specified by:
contentExistsin interfaceContentService- Parameters:
site- site identifierpath- path of the content- Returns:
- true if site has content object at path
-
checkContentExists
Description copied from interface:ContentServiceChecks if a content exists at a given path and throw an exception if it does not.- Specified by:
checkContentExistsin interfaceContentService- Parameters:
site- id of the sitepath- the content path- Throws:
ServiceLayerException- if no content is found at the given path
-
shallowContentExists
Description copied from interface:ContentServiceThis is a faster, but less accurate, version of contentExists. This prioritizes performance over checking the actual underlying repository if the content is actually in the store or we simply hold a reference to the object in the actual store.- Specified by:
shallowContentExistsin interfaceContentService- Returns:
- true if site has content object at path
-
getContent
@Valid public @Valid InputStream getContent(String site, String path) throws ContentNotFoundException Description copied from interface:ContentServiceget document from wcm content- Specified by:
getContentin interfaceContentService- Parameters:
site- site identifierpath- path of the content- Returns:
- document
- Throws:
ContentNotFoundException
-
getContentSize
Description copied from interface:ContentServiceget file size- Specified by:
getContentSizein interfaceContentService- Parameters:
site- site id where the operation will be executedpath- path to content- Returns:
- Size in bytes
-
getContentAsString
Description copied from interface:ContentServiceget content as string from repository- Specified by:
getContentAsStringin interfaceContentService- Parameters:
site- site identifierpath- path of the content- Returns:
- document
-
checkWriteAssetPath
Description copied from interface:ContentServiceCheck if path is a correct location to write asset content- Specified by:
checkWriteAssetPathin interfaceContentService- Parameters:
path- to write asset- Throws:
ServiceLayerException- if path is not permitted
-
shallowGetContentAsString
Description copied from interface:ContentServiceGet content from the repository. This "shallow" version of the method will retrieve the content from disk instead of the git repository.- Specified by:
shallowGetContentAsStringin interfaceContentService- Parameters:
siteId- the site idpath- the path of the content- Returns:
- the content as a string
-
getContentAsString
Description copied from interface:ContentServiceget content as string from repository- Specified by:
getContentAsStringin interfaceContentService- Parameters:
site- site identifierpath- path of the contentencoding- file encoding- Returns:
- document
-
getContentAsDocument
@Valid public @Valid org.dom4j.Document getContentAsDocument(String site, String path) throws org.dom4j.DocumentException Description copied from interface:ContentServiceget document from wcm content- Specified by:
getContentAsDocumentin interfaceContentService- Parameters:
site- site identifierpath- content path- Returns:
- document
- Throws:
org.dom4j.DocumentException- XML document error
-
getContentAsResource
@Valid public @Valid org.springframework.core.io.Resource getContentAsResource(String site, String path) throws ContentNotFoundException Description copied from interface:ContentServiceReturns content wrapped as aResourceinstance- Specified by:
getContentAsResourcein interfaceContentService- Parameters:
site- the site idpath- the path of the content- Returns:
- the resource object
- Throws:
ContentNotFoundException- if there is no content at the given path
-
writeContent
@Valid public void writeContent(String site, String path, String fileName, String contentType, InputStream input, String createFolders, String edit, String unlock) throws ServiceLayerException, UserNotFoundException, org.craftercms.commons.validation.ValidationException Description copied from interface:ContentServicewrite content- Specified by:
writeContentin interfaceContentService- Parameters:
site- site identifierpath- pathfileName- file namecontentType- content typeinput- contentcreateFolders- create missing folders in path?edit- editunlock- unlock the content upon edit?- Throws:
ServiceLayerException- general service errorUserNotFoundExceptionorg.craftercms.commons.validation.ValidationException
-
writeContent
@Valid public void writeContent(String site, String path, String fileName, String contentType, InputStream input, String createFolders, String edit, String unlock, boolean skipAuditLogInsert) throws ServiceLayerException, UserNotFoundException Description copied from interface:ContentServicewrite content- Specified by:
writeContentin interfaceContentService- Parameters:
site- site identifierpath- pathfileName- file namecontentType- content typeinput- contentcreateFolders- create missing folders in path?edit- editunlock- unlock the content upon edit?skipAuditLogInsert- if true do not insert audit log row, otherwise false- Throws:
ServiceLayerException- general service errorUserNotFoundException
-
writeContentAndRename
@Valid public void writeContentAndRename(String site, String path, String targetPath, String fileName, String contentType, InputStream input, String createFolders, String edit, String unlock, boolean createFolder) throws ServiceLayerException, org.craftercms.commons.validation.ValidationException - Specified by:
writeContentAndRenamein interfaceContentService- Throws:
ServiceLayerExceptionorg.craftercms.commons.validation.ValidationException
-
writeContentAsset
@Valid public @Valid Map<String,Object> writeContentAsset(String site, String path, String assetName, InputStream in, String isImage, String allowedWidth, String allowedHeight, String allowLessSize, String draft, String unlock, String systemAsset) throws ServiceLayerException write content asset- Specified by:
writeContentAssetin interfaceContentService- Parameters:
site-path-assetName-in-isImage- is this asset an image?allowedWidth- specifies the allowed image width in pixel if the asset is an imageallowedHeight- specifies the allowed image height in pixel if the asset is an imageunlock- unlock the content upon edit?- Returns:
- content asset info
- Throws:
ServiceLayerException
-
writeContent
@Valid public @Valid String writeContent(String site, String path, InputStream content) throws ServiceLayerException Description copied from interface:ContentServicewrite content- Specified by:
writeContentin interfaceContentService- Parameters:
site- - the project IDpath- path to contentcontent- stream of content to write- Returns:
- return new commit id
- Throws:
ServiceLayerException- general service error
-
writeContentAndNotify
@Valid public @javax.validation.Valid boolean writeContentAndNotify(String site, String path, InputStream content) throws ServiceLayerException Description copied from interface:ContentServicewrite content from an input stream and notify the subscribers.- Specified by:
writeContentAndNotifyin interfaceContentService- Parameters:
site- - the project IDpath- path to contentcontent- stream of content to write- Returns:
- return true if successful
- Throws:
ServiceLayerException- general service error
-
notifyContentEvent
Notify when there is a content update- Specified by:
notifyContentEventin interfaceContentService- Parameters:
site- site namepath- path name
-
validateAndCreateFolder
public boolean validateAndCreateFolder(String site, String path, String name) throws ServiceLayerException, UserNotFoundException, org.craftercms.commons.validation.ValidationException Description copied from interface:ContentServiceValidate the input and create a folder- Specified by:
validateAndCreateFolderin interfaceContentService- Parameters:
site- - the project IDpath- path to create a folder inname- a folder name to create- Returns:
- return the reference to the folder created
- Throws:
ServiceLayerExceptionUserNotFoundExceptionorg.craftercms.commons.validation.ValidationException
-
createFolder
@Valid public @javax.validation.Valid boolean createFolder(String site, String path, String name) throws ServiceLayerException, UserNotFoundException Description copied from interface:ContentServicecreate a folder- Specified by:
createFolderin interfaceContentService- Parameters:
site- - the project IDpath- path to create a folder inname- a folder name to create- Returns:
- return the reference to the folder created
- Throws:
ServiceLayerExceptionUserNotFoundException
-
deleteContent
@Valid public @javax.validation.Valid boolean deleteContent(String site, String path, String approver) throws ServiceLayerException, UserNotFoundException Description copied from interface:ContentServicedelete content at the path- Specified by:
deleteContentin interfaceContentService- Parameters:
site- - the project IDpath- path to content- Returns:
- return true if successful
- Throws:
ServiceLayerExceptionUserNotFoundException
-
deleteContent
@Valid public @javax.validation.Valid boolean deleteContent(String site, String path, boolean generateActivity, String approver) throws ServiceLayerException, UserNotFoundException - Specified by:
deleteContentin interfaceContentService- Throws:
ServiceLayerExceptionUserNotFoundException
-
generateDeleteActivity
protected void generateDeleteActivity(String site, String path, String approver) throws ServiceLayerException, UserNotFoundException -
copyContent
@Valid public @Valid String copyContent(String site, String fromPath, String toPath) throws ServiceLayerException, UserNotFoundException Description copied from interface:ContentServicecopy content fromPath to toPath- Specified by:
copyContentin interfaceContentService- Parameters:
site- - the project IDfromPath- the source pathtoPath- the target path to copy content to- Returns:
- final path if successful, null otherwise
- Throws:
ServiceLayerExceptionUserNotFoundException
-
copyContent
protected String copyContent(String site, String fromPath, String toPath, Set<String> processedPaths) throws ServiceLayerException, UserNotFoundException internal method copy that handles Get dependencies is already recursive -
replaceCopyDependency
-
moveContent
Description copied from interface:ContentServicemove content fromPath to toPath- Specified by:
moveContentin interfaceContentService- Parameters:
site- - the project IDfromPath- the source pathtoPath- the target path to copy content to- Returns:
- final path if successful, null otherwise
-
updateDatabaseOnMove
protected void updateDatabaseOnMove(String site, String fromPath, String movePath) throws ServiceLayerException, UserNotFoundException -
updateDatabaseOnMove
protected void updateDatabaseOnMove(String site, String fromPath, String movePath, Long parentId, String label, String folderLabel) throws ServiceLayerException, UserNotFoundException -
updateDependenciesOnMove
-
updateChildrenOnMove
protected void updateChildrenOnMove(String site, String fromPath, String movePath) throws ServiceLayerException, UserNotFoundException -
constructNewPathForCutCopy
protected ContentServiceImpl.PastedPathMap constructNewPathForCutCopy(String site, String fromPath, String toPath, boolean adjustOnCollide) throws ServiceLayerException - Throws:
ServiceLayerException
-
getItemSpecificDependencies
protected Map<String,String> getItemSpecificDependencies(String site, String path, org.dom4j.Document document, Map<String, String> copyDependencies) throws ServiceLayerException- Throws:
ServiceLayerException
-
getContentIds
Return the values for PageID and GroupID provided a Document- Parameters:
document- DOM to search- Returns:
- Map of IDs
-
updateContentOnMove
protected void updateContentOnMove(org.dom4j.Element root, String filename, String folder, String modifier) Updates the XML after a move operation.- Parameters:
root- root elementfilename- new filenamefolder- new foldermodifier- numeric modifier used to update the internal-name. e.g.: for modifier 3, the internal-name will set to something like "Initial Name (Copy 3)"
-
updateContentOnCopy
-
createNewContentItemTO
-
populateContentDrivenProperties
protected ContentItemTO populateContentDrivenProperties(String site, ContentItemTO item) throws Exception - Throws:
Exception
-
addOrderValue
add order value to the list of orders- Parameters:
orders-orderName-orderStr-
-
getItemOrders
get WCM content item order metadata- Parameters:
nodes-- Returns:
- item orders metadata
-
populateItemChildren
-
getContentItem
Description copied from interface:ContentServiceget the content item (metadata) at a specific path- Specified by:
getContentItemin interfaceContentService- Parameters:
site- - the project IDpath- - the path of the content item- Returns:
- content item representation
-
getContentItem
Description copied from interface:ContentServiceget the content item (metadata) at a specific path- Specified by:
getContentItemin interfaceContentService- Parameters:
site- - the project IDpath- - the path of the content itemdepth- - depth to get desendents- Returns:
- content item representation
-
getItemContentType
public String getItemContentType(String site, String path) throws org.dom4j.DocumentException, SiteNotFoundException Description copied from interface:ContentServiceRetrieves the content type for a given path- Specified by:
getItemContentTypein interfaceContentService- Parameters:
site- the site idpath- the content path- Returns:
- content type
- Throws:
org.dom4j.DocumentException- on failure to retrieve the content type from xml (when applicable)SiteNotFoundException
-
loadContentItem
-
loadContentTypeProperties
-
populateWorkflowProperties
-
populateMetadata
protected void populateMetadata(String site, ContentItemTO item) throws ServiceLayerException, UserNotFoundException -
getContentItemTree
Description copied from interface:ContentServiceget the tree of content items (metadata) beginning at a root- Specified by:
getContentItemTreein interfaceContentService- Parameters:
site- - the project IDpath- - the path to root at- Returns:
- content item with children tree
-
getContentItemVersionHistory
Description copied from interface:ContentServiceget the version history for an item- Specified by:
getContentItemVersionHistoryin interfaceContentService- Parameters:
site- - the project IDpath- - the path of the item- Returns:
- version history
-
revertContentItem
@Valid public @javax.validation.Valid boolean revertContentItem(String site, String path, String version, boolean major, String comment) throws ServiceLayerException, UserNotFoundException Description copied from interface:ContentServicerevert a version (create a new version based on an old version)- Specified by:
revertContentItemin interfaceContentService- Parameters:
site- - the project IDpath- - the path of the item to "revert"version- - old version ID to base to version onmajor- major versioncomment- comment for revert action- Returns:
- true if success otherwise false
- Throws:
ServiceLayerExceptionUserNotFoundException
-
getContentVersion
@Valid public @Valid Optional<org.springframework.core.io.Resource> getContentVersion(String site, String path, String commitId) throws ContentNotFoundException Description copied from interface:ContentServicereturn the content for a given version- Specified by:
getContentVersionin interfaceContentService- Parameters:
site- - the project IDpath- - the path itemcommitId- - version- Returns:
- content
- Throws:
ContentNotFoundException- content not found
-
getContentVersionAsString
Description copied from interface:ContentServicereturn the content for a given version- Specified by:
getContentVersionAsStringin interfaceContentService- Parameters:
site- - the project IDpath- - the path itemversion- - version- Returns:
- version number
-
createDummyDmContentItemForDeletedNode
@Valid public @Valid ContentItemTO createDummyDmContentItemForDeletedNode(String site, String relativePath) - Specified by:
createDummyDmContentItemForDeletedNodein interfaceContentService
-
getBrowserUri
-
getBrowserUri
-
getContentTypeClass
- Specified by:
getContentTypeClassin interfaceContentService
-
matchesPatterns
-
processContent
@Valid public @Valid ResultTO processContent(String id, InputStream input, boolean isXml, Map<String, String> params, String contentChainForm) throws ServiceLayerException, UserNotFoundException- Specified by:
processContentin interfaceContentService- Throws:
ServiceLayerExceptionUserNotFoundException
-
getNextAvailableName
Description copied from interface:ContentServiceget the next available of the given content name at the given path (used for paste/duplicate)- Specified by:
getNextAvailableNamein interfaceContentService- Parameters:
site- site identifierpath- path of the item- Returns:
- next available name that avoids a name conflict
-
getDeleteCandidates
@Valid public @Valid GoLiveDeleteCandidates getDeleteCandidates(String site, String relativePath) throws ServiceLayerException - Specified by:
getDeleteCandidatesin interfaceContentService- Throws:
ServiceLayerException
-
childDeleteItems
protected void childDeleteItems(String site, ContentItemTO contentItem, GoLiveDeleteCandidates items) throws ServiceLayerException Iterate over all paths inside the folder- Throws:
ServiceLayerException
-
addDependenciesToDelete
protected void addDependenciesToDelete(String site, String sourceContentPath, GoLiveDeleteCandidates candidates) throws ServiceLayerException - Throws:
ServiceLayerException
-
addRemovedDependenciesToDelete
protected void addRemovedDependenciesToDelete(String site, String relativePath, GoLiveDeleteCandidates candidates) throws ServiceLayerException - Throws:
ServiceLayerException
-
getRemovedDependencies
protected List<String> getRemovedDependencies(DependencyDiffService.DiffRequest diffRequest, boolean matchDeletePattern) throws ServiceLayerException - Throws:
ServiceLayerException
-
filterDependenciesMatchingDeletePattern
-
getDeletePatternConfig
-
lockContent
@Valid public void lockContent(String site, String path) throws UserNotFoundException, ServiceLayerException - Specified by:
lockContentin interfaceContentService- Throws:
UserNotFoundExceptionServiceLayerException
-
getItemOrders
- Specified by:
getItemOrdersin interfaceContentService
-
reorderItems
@Valid public @javax.validation.Valid double reorderItems(String site, String relativePath, String before, String after, String orderName) - Specified by:
reorderItemsin interfaceContentService
-
computeReorder
protected double computeReorder(String site, String relativePath, DmOrderTO beforeOrderTO, DmOrderTO afterOrderTO, String orderName) Will need to include the floating pages as well for orderValue computation Since the beforeOrder and afterOrder in the UI does not include floating pages will need to do special processing -
renameContent
@Valid public @javax.validation.Valid boolean renameContent(String site, String path, String name) throws ServiceLayerException, UserNotFoundException, org.craftercms.commons.validation.ValidationException Description copied from interface:ContentServicerename a content item- Specified by:
renameContentin interfaceContentService- Parameters:
site- - the project IDpath- path to a folder to renamename- a new folder name- Returns:
- return the reference to the folder renamed
- Throws:
ServiceLayerException- general service errorUserNotFoundExceptionorg.craftercms.commons.validation.ValidationException
-
pushToRemote
public boolean pushToRemote(String siteId, String remoteName, String remoteBranch) throws ServiceLayerException, InvalidRemoteUrlException, AuthenticationException, org.craftercms.commons.crypto.CryptoException Description copied from interface:ContentServicePush content to remote repository- Specified by:
pushToRemotein interfaceContentService- Parameters:
siteId- site identifierremoteName- remote nameremoteBranch- remote branch- Returns:
- true if operation was successful
- Throws:
ServiceLayerException- general service errorInvalidRemoteUrlException- invalid remote urlAuthenticationException- authentication errororg.craftercms.commons.crypto.CryptoException- git repository helper error
-
pullFromRemote
public boolean pullFromRemote(String siteId, String remoteName, String remoteBranch) throws ServiceLayerException, InvalidRemoteUrlException, AuthenticationException, org.craftercms.commons.crypto.CryptoException Description copied from interface:ContentServicePull from remote repository- Specified by:
pullFromRemotein interfaceContentService- Parameters:
siteId- site identifierremoteName- remote nameremoteBranch- remote branch- Returns:
- true if operation was successful
- Throws:
ServiceLayerException- general service errorInvalidRemoteUrlException- invalid remote urlAuthenticationException- authentication errororg.craftercms.commons.crypto.CryptoException- git repository helper error
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) - Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware
-
setContentRepository
-
setServicesConfig
-
setDependencyService
-
setContentProcessor
-
setSecurityService
-
setDmContentLifeCycleService
-
setSiteService
-
setContentItemIdGenerator
-
setStudioConfiguration
-
setDependencyDiffService
-
setContentTypeService
-
setEntitlementValidator
public void setEntitlementValidator(org.craftercms.commons.entitlements.validator.EntitlementValidator entitlementValidator) -
setAuditServiceInternal
-
setContentRepositoryV2
-
setItemServiceInternal
-
setWorkflowServiceInternal
-
setUserServiceInternal
-
setActivityStreamServiceInternal
public void setActivityStreamServiceInternal(ActivityStreamServiceInternal activityStreamServiceInternal) -
setContentServiceV2
-