From: Mario H. <ma...@de...> - 2011-02-13 18:51:35
|
Hi XMLVM list, i'm playing with the JavaScript/ Qooxdoo/ WebOs backend and i finally managed to run a simple AWT program on a palm simulator. Any way, there seems to be a error in the WebOsOutputProcess during the project generation. The stage-assistant.js and the index.html templates are not found, due to wrong paths and the getResourceAsStream method. I rewrote those 2 lines with help of UniversalFiles and attached my changes as patch, in case anyone is interested :o) Greetings, Mario Index: src/xmlvm/org/xmlvm/proc/out/WebOsOutputProcess.java =================================================================== --- src/xmlvm/org/xmlvm/proc/out/WebOsOutputProcess.java (revision 1502) +++ src/xmlvm/org/xmlvm/proc/out/WebOsOutputProcess.java (working copy) @@ -33,6 +33,7 @@ import org.xmlvm.proc.XmlvmProcessImpl; import org.xmlvm.util.FileUtil; import org.xmlvm.util.InputReaderThread; +import org.xmlvm.util.universalfile.UniversalFile; import org.xmlvm.util.universalfile.UniversalFileCreator; /** @@ -173,14 +174,15 @@ return false; } + /** The path to the XMLVM emulation library. */ + UniversalFile assistantTemplate = UniversalFileCreator.createFile("/xmlvm2js" + + STAGE_ASSISTANT_TEMPLATE, "./src/xmlvm2js" + STAGE_ASSISTANT_TEMPLATE); // Read template we use to create a custom stage assistant file. - InputStream stageAssistantTemplate = WebOsOutputProcess.class - .getResourceAsStream(STAGE_ASSISTANT_TEMPLATE); - if (stageAssistantTemplate == null) { + if (assistantTemplate == null) { Log.error("Stage assistant template file could not be read."); return false; } - String stageAssistantContent = FileUtil.readStringFromStream(stageAssistantTemplate); + String stageAssistantContent = assistantTemplate.getFileAsString(); if (stageAssistantContent.isEmpty()) { Log.error("Could not read contents of stage assistant file."); @@ -258,15 +260,14 @@ } // Read template we use to create a custom stage assistant file. - InputStream indexHtmlTemplate = WebOsOutputProcess.class - .getResourceAsStream(INDEX_HTML_TEMPLATE); - - if (indexHtmlTemplate == null) { + UniversalFile indexTemplate = UniversalFileCreator.createFile("/xmlvm2js" + + INDEX_HTML_TEMPLATE, "./src/xmlvm2js" + INDEX_HTML_TEMPLATE); + if (indexTemplate == null) { Log.error("Could not read index.html template for Palm Pre project."); return false; } - String indexHtmlContent = FileUtil.readStringFromStream(indexHtmlTemplate); + String indexHtmlContent = indexTemplate.getFileAsString(); if (indexHtmlContent.isEmpty()) { Log.error("Could not read contents of index.html template file for Palm Pre project."); return false; |