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 |
|---|---|
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 |
removeAttachment(javax.jcr.Node newsNode,
String attachmentId)
Remove the attachment with the given id from the given news node
|
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 nodeExceptionpublic NewsAttachment getNewsAttachment(String attachmentId) throws Exception
getNewsAttachment in interface NewsAttachmentsServiceattachmentId - The attachment idExceptionpublic InputStream getNewsAttachmentStream(String attachmentId) throws Exception
getNewsAttachmentStream in interface NewsAttachmentsServiceattachmentId - The attachment idExceptionpublic String getNewsAttachmentOpenUrl(String attachmentId) throws Exception
getNewsAttachmentOpenUrl in interface NewsAttachmentsServiceattachmentId - The attachment idExceptionpublic List<NewsAttachment> updateNewsAttachments(News updatedNews, javax.jcr.Node newsNode) throws Exception
updateNewsAttachments in interface NewsAttachmentsServiceupdatedNews - The updated NewsnewsNode - The existing News nodejavax.jcr.RepositoryExceptionExceptionpublic String addAttachmentFromUploadedResource(javax.jcr.Node newsNode, String uploadId) throws Exception
addAttachmentFromUploadedResource in interface NewsAttachmentsServicenewsNode - The news nodeuploadId - The id of the uploaded resourceExceptionpublic 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–2019 eXo Platform SAS. All rights reserved.