Package org.exoplatform.ecms.uploads
Class HTMLUploadImageProcessorImpl
- java.lang.Object
-
- org.exoplatform.ecms.uploads.HTMLUploadImageProcessorImpl
-
- All Implemented Interfaces:
org.exoplatform.social.common.service.HTMLUploadImageProcessor
public class HTMLUploadImageProcessorImpl extends Object implements org.exoplatform.social.common.service.HTMLUploadImageProcessor
Service to parse an HTML content, extract temporary uploaded files, store them in a permanent location and replace URLs in the HTML content with the permanent URLs
-
-
Field Summary
Fields Modifier and Type Field Description static StringIP_REGEXstatic StringURL_OR_URI_REGEX
-
Constructor Summary
Constructors Constructor Description HTMLUploadImageProcessorImpl(org.exoplatform.container.PortalContainer portalContainer, org.exoplatform.upload.UploadService uploadService, org.exoplatform.services.jcr.RepositoryService repositoryService, org.exoplatform.services.cms.link.LinkManager linkManager, org.exoplatform.services.jcr.ext.app.SessionProviderService sessionProviderService, org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator nodeHierarchyCreator, org.exoplatform.services.wcm.core.WCMService wcmService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetRepositoryName()StringprocessImages(String content, String parentNodeId, String imagesSubFolderPath)Process the given HTML content, extract temporary uploaded files, store them in a permanent location and replace URLs in the HTML content with the permanent URLsStringprocessImagesForExport(String content_)Process the given HTML content, export Files and replace URLs in the HTML content with files nameStringprocessSpaceImages(String content, String spaceGroupId, String imagesSubLocationPath)StringprocessUserImages(String content, String userId, String imagesSubLocationPath)
-
-
-
Field Detail
-
IP_REGEX
public static final String IP_REGEX
- See Also:
- Constant Field Values
-
URL_OR_URI_REGEX
public static final String URL_OR_URI_REGEX
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
HTMLUploadImageProcessorImpl
public HTMLUploadImageProcessorImpl(org.exoplatform.container.PortalContainer portalContainer, org.exoplatform.upload.UploadService uploadService, org.exoplatform.services.jcr.RepositoryService repositoryService, org.exoplatform.services.cms.link.LinkManager linkManager, org.exoplatform.services.jcr.ext.app.SessionProviderService sessionProviderService, org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator nodeHierarchyCreator, org.exoplatform.services.wcm.core.WCMService wcmService)
-
-
Method Detail
-
processImages
public String processImages(String content, String parentNodeId, String imagesSubFolderPath) throws IllegalArgumentException
Process the given HTML content, extract temporary uploaded files, store them in a permanent location and replace URLs in the HTML content with the permanent URLs- Specified by:
processImagesin interfaceorg.exoplatform.social.common.service.HTMLUploadImageProcessor- Parameters:
content- The HTML contentparentNodeId- The parent node to store the images. This node must exist.imagesSubFolderPath- The subpath of the folder under parentNode to store the images. If the nodes of this path do not exist, they are automatically created, only if there are images to store.- Returns:
- The updated HTML content with the permanent images URLs
- Throws:
IllegalArgumentException- When Content location cannot be found or File cannot be created
-
processSpaceImages
public String processSpaceImages(String content, String spaceGroupId, String imagesSubLocationPath) throws IllegalArgumentException
- Specified by:
processSpaceImagesin interfaceorg.exoplatform.social.common.service.HTMLUploadImageProcessor- Throws:
IllegalArgumentException
-
processUserImages
public String processUserImages(String content, String userId, String imagesSubLocationPath) throws IllegalArgumentException
- Specified by:
processUserImagesin interfaceorg.exoplatform.social.common.service.HTMLUploadImageProcessor- Throws:
IllegalArgumentException
-
processImagesForExport
public String processImagesForExport(String content_) throws IllegalArgumentException
Process the given HTML content, export Files and replace URLs in the HTML content with files name- Specified by:
processImagesForExportin interfaceorg.exoplatform.social.common.service.HTMLUploadImageProcessor- Parameters:
content_- The HTML content- Returns:
- The updated HTML content with the images names
- Throws:
IllegalArgumentException
-
getRepositoryName
public String getRepositoryName()
-
-