Reversed incorrect checkin

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@7438 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2007-11-26 17:17:01 +00:00
parent 4c97ed0b2c
commit 08f0ed882c
4 changed files with 232 additions and 40 deletions

View File

@@ -220,7 +220,6 @@ public class ImporterComponent
*/
public void importView(Reader viewReader, Location location, ImporterBinding binding, ImporterProgress progress)
{
System.out.println("PATCHED IMPORTERCOMPONENT FOR MIKEF");
NodeRef nodeRef = getNodeRef(location, binding);
parserImport(nodeRef, location.getChildAssocType(), viewReader, new DefaultStreamHandler(), binding, progress);
}
@@ -230,7 +229,6 @@ public class ImporterComponent
*/
public void importView(ImportPackageHandler importHandler, Location location, ImporterBinding binding, ImporterProgress progress) throws ImporterException
{
System.out.println("PATCHED IMPORTERCOMPONENT FOR MIKEF");
importHandler.startImport();
Reader dataFileReader = importHandler.getDataStream();
NodeRef nodeRef = getNodeRef(location, binding);
@@ -662,18 +660,17 @@ public class ImporterComponent
{
DataTypeDefinition dataTypeDef = dictionaryService.getDataType(DataTypeDefinition.CONTENT);
ContentData contentData = (ContentData)DefaultTypeConverter.INSTANCE.convert(dataTypeDef, importContentData);
nodeService.setProperty(nodeRef, propertyName, contentData);
// 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);
// }
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);
}
}
}