You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by jb...@apache.org on 2006/02/15 13:45:49 UTC
svn commit: r377997 -
/cocoon/branches/BRANCH_2_1_X/src/blocks/xsp/java/org/apache/cocoon/bean/XSPPrecompileWrapper.java
Author: jbq
Date: Wed Feb 15 04:45:47 2006
New Revision: 377997
URL: http://svn.apache.org/viewcvs?rev=377997&view=rev
Log:
Propagate exceptions, remove unnecessary sitemap compilation and show filename before compiling
Patched by Guillaume Déflache <gu...@anyware-tech.com>
Modified:
cocoon/branches/BRANCH_2_1_X/src/blocks/xsp/java/org/apache/cocoon/bean/XSPPrecompileWrapper.java
Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/xsp/java/org/apache/cocoon/bean/XSPPrecompileWrapper.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/xsp/java/org/apache/cocoon/bean/XSPPrecompileWrapper.java?rev=377997&r1=377996&r2=377997&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/xsp/java/org/apache/cocoon/bean/XSPPrecompileWrapper.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/xsp/java/org/apache/cocoon/bean/XSPPrecompileWrapper.java Wed Feb 15 04:45:47 2006
@@ -54,7 +54,7 @@
/**
* Allow subclasses to recursively precompile XSPs.
*/
- public void precompile() {
+ public void precompile() throws Exception {
recursivelyPrecompile(context, context);
}
@@ -67,27 +67,16 @@
* a <code>File</code> value for a single XSP file or a
* directory to scan recursively
*/
- private void recursivelyPrecompile(File contextDir, File file) {
+ private void recursivelyPrecompile(File contextDir, File file) throws Exception {
if (file.isDirectory()) {
String entries[] = file.list();
for (int i = 0; i < entries.length; i++) {
recursivelyPrecompile(contextDir, new File(file, entries[i]));
}
- } else if (file.getName().toLowerCase().endsWith(".xmap")) {
- try {
- // necessary?
- this.processXMAP(IOUtils.getContextFilePath(contextDir
- .getCanonicalPath(), file.getCanonicalPath()));
- } catch (Exception e) {
- // Ignore for now.
- }
} else if (file.getName().toLowerCase().endsWith(".xsp")) {
- try {
- this.processXSP(IOUtils.getContextFilePath(contextDir
- .getCanonicalPath(), file.getCanonicalPath()));
- } catch (Exception e) {
- // Ignore for now.
- }
+ String contextFilePath = IOUtils.getContextFilePath(contextDir
+ .getCanonicalPath(), file.getCanonicalPath());
+ this.processXSP(contextFilePath);
}
}
@@ -146,6 +135,7 @@
if (log.isDebugEnabled()) {
log.debug("XSP generation begin:" + fileName);
}
+ System.out.println("Compiling " + fileName);
programGenerator = (ProgramGenerator) getComponentManager().lookup(
ProgramGenerator.ROLE);
@@ -243,4 +233,4 @@
super.initialize();
sourceResolver = (SourceResolver) getComponentManager().lookup(SourceResolver.ROLE);
}
-}
\ No newline at end of file
+}