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
This commit is contained in:
Ariel Backenroth
2006-08-22 21:43:22 +00:00
parent a6c83ecbe0
commit 6fd275ab0e

View File

@@ -55,6 +55,8 @@ import org.alfresco.repo.avm.*;
public class OutputUtil public class OutputUtil
{ {
private static final Log LOGGER = LogFactory.getLog(OutputUtil.class); 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, public static void generate(NodeRef createdNode,
Document xml, Document xml,
@@ -105,14 +107,13 @@ public class OutputUtil
} }
AVMService avmService = AVMContext.fgInstance.getAVMService(); AVMService avmService = AVMContext.fgInstance.getAVMService();
String parentPath = "repo-1:/repo-1/alice/appBase/avm_webapps/my_webapp";
try try
{ {
out = new OutputStreamWriter(avmService.createFile(parentPath, fileName)); out = new OutputStreamWriter(avmService.createFile(PARENT_AVM_PATH, fileName));
} }
catch (AVMExistsException e) 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"); LOGGER.debug("generating " + fileName + " to avm");
tom.generate(xml, tt, out); tom.generate(xml, tt, out);
@@ -171,14 +172,14 @@ public class OutputUtil
LOGGER.debug("generated " + fileName + " using " + tom); LOGGER.debug("generated " + fileName + " using " + tom);
AVMService avmService = AVMContext.fgInstance.getAVMService(); AVMService avmService = AVMContext.fgInstance.getAVMService();
String parentPath = "repo-1:/repo-1/alice/appBase/avm_webapps/ROOT/home-insurance";
try try
{ {
out = new OutputStreamWriter(avmService.createFile(parentPath, generatedFileName)); out = new OutputStreamWriter(avmService.createFile(PARENT_AVM_PATH, generatedFileName));
} }
catch (AVMExistsException e) 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"); LOGGER.debug("generating " + generatedFileName + " to avm");
tom.generate(xml, tt, out); tom.generate(xml, tt, out);