public interface ContentService
| Modifier and Type | Method and Description |
|---|---|
boolean |
contentExists(String site,
String path) |
String |
copyContent(String site,
String fromPath,
String toPath)
copy content fromPath to toPath
|
ContentItemTO |
createDummyDmContentItemForDeletedNode(String site,
String relativePath) |
boolean |
createFolder(String site,
String path,
String name)
create a folder
|
boolean |
deleteContent(String site,
String path,
boolean generateActivity,
String approver) |
boolean |
deleteContent(String site,
String path,
String approver)
delete content at the path
|
InputStream |
getContent(String site,
String path)
get document from wcm content
|
org.dom4j.Document |
getContentAsDocument(String site,
String path)
get document from wcm content
|
org.springframework.core.io.Resource |
getContentAsResource(String site,
String path)
Returns content wrapped as a
Resource instance |
String |
getContentAsString(String site,
String path)
get content as string from repository
|
String |
getContentAsString(String site,
String path,
String encoding)
get content as string from repository
|
ContentItemTO |
getContentItem(String site,
String path)
get the content item (metadata) at a specific path
|
ContentItemTO |
getContentItem(String site,
String path,
int depth)
get the content item (metadata) at a specific path
|
ContentItemTO |
getContentItemTree(String site,
String path,
int depth)
get the tree of content items (metadata) beginning at a root
|
VersionTO[] |
getContentItemVersionHistory(String site,
String path)
get the version history for an item
|
long |
getContentSize(String site,
String path)
get file size
|
String |
getContentTypeClass(String site,
String uri) |
InputStream |
getContentVersion(String site,
String path,
String version)
return the content for a given version
|
String |
getContentVersionAsString(String site,
String path,
String version)
return the content for a given version
|
GoLiveDeleteCandidates |
getDeleteCandidates(String site,
String uri) |
List<DmOrderTO> |
getItemOrders(String site,
String path) |
String |
getNextAvailableName(String site,
String path)
get the next available of the given content name at the given path (used for paste/duplicate)
|
void |
lockContent(String site,
String path) |
String |
moveContent(String site,
String fromPath,
String toPath)
move content fromPath to toPath
|
ResultTO |
processContent(String id,
InputStream input,
boolean isXml,
Map<String,String> params,
String contentChainForm) |
boolean |
pullFromRemote(String siteId,
String remoteName,
String remoteBranch)
Pull from remote repository
|
boolean |
pushToRemote(String siteId,
String remoteName,
String remoteBranch)
Push content to remote repository
|
boolean |
renameFolder(String site,
String path,
String name)
rename a folder
|
double |
reorderItems(String site,
String relativePath,
String before,
String after,
String orderName) |
boolean |
revertContentItem(String site,
String path,
String version,
boolean major,
String comment)
revert a version (create a new version based on an old version)
|
void |
unLockContent(String site,
String path) |
boolean |
writeContent(String site,
String path,
InputStream content)
write content
|
void |
writeContent(String site,
String path,
String fileName,
String contentType,
InputStream input,
String createFolders,
String edit,
String unlock)
write content
|
void |
writeContentAndRename(String site,
String path,
String targetPath,
String fileName,
String contentType,
InputStream input,
String createFolders,
String edit,
String unlock,
boolean createFolder) |
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) |
boolean contentExists(String site, String path)
InputStream getContent(String site, String path) throws ContentNotFoundException, org.craftercms.commons.crypto.CryptoException
site - path - ContentNotFoundExceptionorg.craftercms.commons.crypto.CryptoExceptionlong getContentSize(String site, String path)
site - site id where the operation will be executedpath - path to contentString getContentAsString(String site, String path)
site - site identifierpath - path of the contentString getContentAsString(String site, String path, String encoding)
site - site identifierpath - path of the contentencoding - file encodingorg.dom4j.Document getContentAsDocument(String site, String path) throws org.dom4j.DocumentException
path - org.dom4j.DocumentExceptionorg.springframework.core.io.Resource getContentAsResource(String site, String path) throws ContentNotFoundException
Resource instancesite - the site idpath - the path of the contentContentNotFoundException - if there is no content at the given pathboolean writeContent(String site, String path, InputStream content) throws ServiceLayerException
site - - the project IDpath - path to contentcontent - stream of content to writeServiceLayerExceptionboolean createFolder(String site, String path, String name) throws SiteNotFoundException
site - - the project IDpath - path to create a folder inname - a folder name to createSiteNotFoundExceptionboolean deleteContent(String site, String path, String approver) throws SiteNotFoundException
site - - the project IDpath - path to contentSiteNotFoundExceptionboolean deleteContent(String site, String path, boolean generateActivity, String approver) throws SiteNotFoundException
SiteNotFoundExceptionString copyContent(String site, String fromPath, String toPath)
site - - the project IDfromPath - the source pathtoPath - the target path to copy content toString moveContent(String site, String fromPath, String toPath)
site - - the project IDfromPath - the source pathtoPath - the target path to copy content toContentItemTO getContentItemTree(String site, String path, int depth)
site - - the project IDpath - - the path to root atContentItemTO getContentItem(String site, String path)
site - - the project IDpath - - the path of the content itemContentItemTO getContentItem(String site, String path, int depth)
site - - the project IDpath - - the path of the content itemdepth - - depth to get desendentsVersionTO[] getContentItemVersionHistory(String site, String path)
site - - the project IDpath - - the path of the itemboolean revertContentItem(String site, String path, String version, boolean major, String comment) throws SiteNotFoundException
site - - the project IDpath - - the path of the item to "revert"version - - old version ID to base to version onSiteNotFoundExceptionInputStream getContentVersion(String site, String path, String version) throws ContentNotFoundException
site - - the project IDpath - - the path itemversion - - versionContentNotFoundExceptionString getContentVersionAsString(String site, String path, String version) throws ContentNotFoundException
site - - the project IDpath - - the path itemversion - - versionContentNotFoundExceptionvoid writeContent(String site, String path, String fileName, String contentType, InputStream input, String createFolders, String edit, String unlock) throws ServiceLayerException
site - path - fileName - contentType - input - createFolders - create missing folders in path?edit - unlock - unlock the content upon edit?ServiceLayerExceptionvoid writeContentAndRename(String site, String path, String targetPath, String fileName, String contentType, InputStream input, String createFolders, String edit, String unlock, boolean createFolder) throws ServiceLayerException
ServiceLayerExceptionMap<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
ServiceLayerExceptionString getNextAvailableName(String site, String path)
site - path - ContentItemTO createDummyDmContentItemForDeletedNode(String site, String relativePath)
ResultTO processContent(String id, InputStream input, boolean isXml, Map<String,String> params, String contentChainForm) throws ServiceLayerException
ServiceLayerExceptionGoLiveDeleteCandidates getDeleteCandidates(String site, String uri) throws ServiceLayerException
ServiceLayerExceptionList<DmOrderTO> getItemOrders(String site, String path) throws ContentNotFoundException
ContentNotFoundExceptiondouble reorderItems(String site, String relativePath, String before, String after, String orderName) throws ServiceLayerException
ServiceLayerExceptionboolean renameFolder(String site, String path, String name) throws ServiceLayerException
site - - the project IDpath - path to a folder to renamename - a new folder nameServiceLayerExceptionboolean pushToRemote(String siteId, String remoteName, String remoteBranch) throws ServiceLayerException, InvalidRemoteUrlException, AuthenticationException, org.craftercms.commons.crypto.CryptoException
siteId - site identifierremoteName - remote nameremoteBranch - remote branchServiceLayerExceptionInvalidRemoteUrlExceptionAuthenticationExceptionorg.craftercms.commons.crypto.CryptoExceptionboolean pullFromRemote(String siteId, String remoteName, String remoteBranch) throws ServiceLayerException, InvalidRemoteUrlException, AuthenticationException, org.craftercms.commons.crypto.CryptoException
siteId - site identifierremoteName - remote nameremoteBranch - remote branchServiceLayerExceptionInvalidRemoteUrlExceptionAuthenticationExceptionorg.craftercms.commons.crypto.CryptoExceptionCopyright © 2020 CrafterCMS. All rights reserved.