mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-06-16 17:55:15 +00:00
Fix issue where imported content does not have associated binary content stream (i.e. fixes "ContentData does not have a content url" error).
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2232 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
parent
c81c8f59e8
commit
c131dd7dec
@ -590,18 +590,20 @@ public class ImporterComponent
|
||||
// bind import content data description
|
||||
DataTypeDefinition dataTypeDef = dictionaryService.getDataType(DataTypeDefinition.CONTENT);
|
||||
importContentData = bindPlaceHolder(importContentData, binding);
|
||||
ContentData contentData = (ContentData)DefaultTypeConverter.INSTANCE.convert(dataTypeDef, importContentData);
|
||||
|
||||
String contentUrl = contentData.getContentUrl();
|
||||
if (contentUrl != null && contentUrl.length() > 0)
|
||||
if (importContentData != null && importContentData.length() > 0)
|
||||
{
|
||||
// import the content from the url
|
||||
InputStream contentStream = streamHandler.importStream(contentUrl);
|
||||
ContentWriter writer = contentService.getWriter(nodeRef, propertyName, true);
|
||||
writer.setEncoding(contentData.getEncoding());
|
||||
writer.setMimetype(contentData.getMimetype());
|
||||
writer.putContent(contentStream);
|
||||
reportContentCreated(nodeRef, contentUrl);
|
||||
ContentData contentData = (ContentData)DefaultTypeConverter.INSTANCE.convert(dataTypeDef, importContentData);
|
||||
String contentUrl = contentData.getContentUrl();
|
||||
if (contentUrl != null && contentUrl.length() > 0)
|
||||
{
|
||||
// import the content from the url
|
||||
InputStream contentStream = streamHandler.importStream(contentUrl);
|
||||
ContentWriter writer = contentService.getWriter(nodeRef, propertyName, true);
|
||||
writer.setEncoding(contentData.getEncoding());
|
||||
writer.setMimetype(contentData.getMimetype());
|
||||
writer.putContent(contentStream);
|
||||
reportContentCreated(nodeRef, contentUrl);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user