Web Script Framework extraction - allows web scripts to be hosted in a stand-alone presentation tier.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@7437 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
David Caruana
2007-11-26 17:04:44 +00:00
parent 719b34fe5f
commit 4c97ed0b2c
4 changed files with 40 additions and 232 deletions

View File

@@ -220,6 +220,7 @@ 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);
}
@@ -229,6 +230,7 @@ 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);
@@ -660,17 +662,18 @@ public class ImporterComponent
{
DataTypeDefinition dataTypeDef = dictionaryService.getDataType(DataTypeDefinition.CONTENT);
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);
}
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);
// }
}
}