From 6fd275ab0e1e6da875e2007aa8b06aeba769b482 Mon Sep 17 00:00:00 2001 From: Ariel Backenroth Date: Tue, 22 Aug 2006 21:43:22 +0000 Subject: [PATCH] forgot that this codepath got split. writing to the correct path on create now... no wonder only regenerate appeared to be working. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3573 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../org/alfresco/web/templating/OutputUtil.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/source/java/org/alfresco/web/templating/OutputUtil.java b/source/java/org/alfresco/web/templating/OutputUtil.java index ea7896286c..67ca810d8a 100644 --- a/source/java/org/alfresco/web/templating/OutputUtil.java +++ b/source/java/org/alfresco/web/templating/OutputUtil.java @@ -55,6 +55,8 @@ import org.alfresco.repo.avm.*; public class OutputUtil { private static final Log LOGGER = LogFactory.getLog(OutputUtil.class); + private static final String PARENT_AVM_PATH = + "repo-1:/repo-1/alice/appBase/avm_webapps/ROOT/home-insurance"; public static void generate(NodeRef createdNode, Document xml, @@ -105,14 +107,13 @@ public class OutputUtil } AVMService avmService = AVMContext.fgInstance.getAVMService(); - String parentPath = "repo-1:/repo-1/alice/appBase/avm_webapps/my_webapp"; try { - out = new OutputStreamWriter(avmService.createFile(parentPath, fileName)); + out = new OutputStreamWriter(avmService.createFile(PARENT_AVM_PATH, fileName)); } catch (AVMExistsException e) { - out = new OutputStreamWriter(avmService.getFileOutputStream(parentPath + "/" + fileName)); + out = new OutputStreamWriter(avmService.getFileOutputStream(PARENT_AVM_PATH + "/" + fileName)); } LOGGER.debug("generating " + fileName + " to avm"); tom.generate(xml, tt, out); @@ -171,14 +172,14 @@ public class OutputUtil LOGGER.debug("generated " + fileName + " using " + tom); AVMService avmService = AVMContext.fgInstance.getAVMService(); - String parentPath = "repo-1:/repo-1/alice/appBase/avm_webapps/ROOT/home-insurance"; + try { - out = new OutputStreamWriter(avmService.createFile(parentPath, generatedFileName)); + out = new OutputStreamWriter(avmService.createFile(PARENT_AVM_PATH, generatedFileName)); } catch (AVMExistsException e) { - out = new OutputStreamWriter(avmService.getFileOutputStream(parentPath + "/" + generatedFileName)); + out = new OutputStreamWriter(avmService.getFileOutputStream(PARENT_AVM_PATH + "/" + generatedFileName)); } LOGGER.debug("generating " + generatedFileName + " to avm"); tom.generate(xml, tt, out);