public class NewsAttachmentsServiceImpl extends Object implements NewsAttachmentsService
| Modifier and Type | Field and Description |
|---|---|
static String |
NEWS_ATTACHMENTS_NODES_FOLDER |
| Constructor and Description |
|---|
NewsAttachmentsServiceImpl(org.exoplatform.services.jcr.ext.app.SessionProviderService sessionProviderService,
org.exoplatform.services.jcr.RepositoryService repositoryService,
org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator nodeHierarchyCreator,
org.exoplatform.services.jcr.ext.distribution.DataDistributionManager dataDistributionManager,
org.exoplatform.social.core.space.spi.SpaceService spaceService,
org.exoplatform.upload.UploadService uploadService,
org.exoplatform.services.cms.documents.DocumentService documentService) |
| Modifier and Type | Method and Description |
|---|---|
void |
addAttachmentFromExistingResource(javax.jcr.Node newsNode,
String resourceId)
Add an existing resource with the given id to the given news node
|
String |
addAttachmentFromUploadedResource(javax.jcr.Node newsNode,
String uploadId)
Add the resource with the given upload id to the given news node
|
protected NewsAttachment |
convertNodeToNewsAttachment(javax.jcr.Node attachmentNode) |
NewsAttachment |
getNewsAttachment(String attachmentId)
Get the attachment with the given id
|
String |
getNewsAttachmentOpenUrl(String attachmentId)
Get the URL to open the attachment with the given id
|
List<NewsAttachment> |
getNewsAttachments(javax.jcr.Node newsNode)
Get the list of attachments of the given news node
|
InputStream |
getNewsAttachmentStream(String attachmentId)
Get data stream of the attachment with the given id
|
void |
makeAttachmentsPublic(javax.jcr.Node newsNode) |
void |
removeAttachment(javax.jcr.Node newsNode,
String attachmentId)
Remove the attachment with the given id from the given news node
|
void |
unmakeAttachmentsPublic(javax.jcr.Node newsNode) |
List<NewsAttachment> |
updateNewsAttachments(News updatedNews,
javax.jcr.Node newsNode)
Adds new attachments to the News and remove the attachments to remove.
|
public static final String NEWS_ATTACHMENTS_NODES_FOLDER
public NewsAttachmentsServiceImpl(org.exoplatform.services.jcr.ext.app.SessionProviderService sessionProviderService,
org.exoplatform.services.jcr.RepositoryService repositoryService,
org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator nodeHierarchyCreator,
org.exoplatform.services.jcr.ext.distribution.DataDistributionManager dataDistributionManager,
org.exoplatform.social.core.space.spi.SpaceService spaceService,
org.exoplatform.upload.UploadService uploadService,
org.exoplatform.services.cms.documents.DocumentService documentService)
public List<NewsAttachment> getNewsAttachments(javax.jcr.Node newsNode) throws Exception
getNewsAttachments in interface NewsAttachmentsServicenewsNode - The news nodeException - when errorpublic NewsAttachment getNewsAttachment(String attachmentId) throws Exception
getNewsAttachment in interface NewsAttachmentsServiceattachmentId - The attachment idException - when errorpublic InputStream getNewsAttachmentStream(String attachmentId) throws Exception
getNewsAttachmentStream in interface NewsAttachmentsServiceattachmentId - The attachment idException - when errorpublic String getNewsAttachmentOpenUrl(String attachmentId) throws Exception
getNewsAttachmentOpenUrl in interface NewsAttachmentsServiceattachmentId - The attachment idException - when errorpublic List<NewsAttachment> updateNewsAttachments(News updatedNews, javax.jcr.Node newsNode) throws Exception
updateNewsAttachments in interface NewsAttachmentsServiceupdatedNews - The updated NewsnewsNode - The existing News nodejavax.jcr.RepositoryException - when errorExceptionpublic String addAttachmentFromUploadedResource(javax.jcr.Node newsNode, String uploadId) throws Exception
addAttachmentFromUploadedResource in interface NewsAttachmentsServicenewsNode - The news nodeuploadId - The id of the uploaded resourceException - when errorpublic void addAttachmentFromExistingResource(javax.jcr.Node newsNode,
String resourceId)
throws Exception
addAttachmentFromExistingResource in interface NewsAttachmentsServicenewsNode - The news noderesourceId - The id of the existing resourceException - when errorpublic void makeAttachmentsPublic(javax.jcr.Node newsNode)
throws Exception
makeAttachmentsPublic in interface NewsAttachmentsServiceExceptionpublic void unmakeAttachmentsPublic(javax.jcr.Node newsNode)
throws Exception
unmakeAttachmentsPublic in interface NewsAttachmentsServiceExceptionpublic void removeAttachment(javax.jcr.Node newsNode,
String attachmentId)
removeAttachment in interface NewsAttachmentsServicenewsNode - The news nodeattachmentId - The attachment idprotected NewsAttachment convertNodeToNewsAttachment(javax.jcr.Node attachmentNode) throws Exception
ExceptionCopyright © 2003–2020 eXo Platform SAS. All rights reserved.