cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r470995 - in /cocoon/trunk: blocks/cocoon-flowscript/cocoon-flowscript-impl/src/main/java/org/apache/cocoon/components/flow/javascript/fom/ blocks/cocoon-scratchpad/cocoon-scratchpad-impl/src/main/java/org/apache/cocoon/components/flow/java...
Date Fri, 03 Nov 2006 21:10:27 GMT
Author: cziegeler
Date: Fri Nov  3 13:10:26 2006
New Revision: 470995

URL: http://svn.apache.org/viewvc?view=rev&rev=470995
Log:
Only include interpreter specific flow scripts

Modified:
    cocoon/trunk/blocks/cocoon-flowscript/cocoon-flowscript-impl/src/main/java/org/apache/cocoon/components/flow/javascript/fom/FOM_JavaScriptInterpreter.java
    cocoon/trunk/blocks/cocoon-scratchpad/cocoon-scratchpad-impl/src/main/java/org/apache/cocoon/components/flow/javascript/fom/AO_FOM_JavaScriptInterpreter.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/flow/AbstractInterpreter.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/flow/Interpreter.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/FlowNodeBuilder.java
    cocoon/trunk/core/cocoon-core/src/main/resources/org/apache/cocoon/cocoon.xconf

Modified: cocoon/trunk/blocks/cocoon-flowscript/cocoon-flowscript-impl/src/main/java/org/apache/cocoon/components/flow/javascript/fom/FOM_JavaScriptInterpreter.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-flowscript/cocoon-flowscript-impl/src/main/java/org/apache/cocoon/components/flow/javascript/fom/FOM_JavaScriptInterpreter.java?view=diff&rev=470995&r1=470994&r2=470995
==============================================================================
--- cocoon/trunk/blocks/cocoon-flowscript/cocoon-flowscript-impl/src/main/java/org/apache/cocoon/components/flow/javascript/fom/FOM_JavaScriptInterpreter.java
(original)
+++ cocoon/trunk/blocks/cocoon-flowscript/cocoon-flowscript-impl/src/main/java/org/apache/cocoon/components/flow/javascript/fom/FOM_JavaScriptInterpreter.java
Fri Nov  3 13:10:26 2006
@@ -759,4 +759,11 @@
             FOM_JavaScriptFlowHelper.setFOM_WebContinuation(objectModel, kont);
         }
     }
+
+    /**
+     * @see org.apache.cocoon.components.flow.AbstractInterpreter#getScriptExtension()
+     */
+    public String getScriptExtension() {
+        return ".js";
+    }
 }

Modified: cocoon/trunk/blocks/cocoon-scratchpad/cocoon-scratchpad-impl/src/main/java/org/apache/cocoon/components/flow/javascript/fom/AO_FOM_JavaScriptInterpreter.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-scratchpad/cocoon-scratchpad-impl/src/main/java/org/apache/cocoon/components/flow/javascript/fom/AO_FOM_JavaScriptInterpreter.java?view=diff&rev=470995&r1=470994&r2=470995
==============================================================================
--- cocoon/trunk/blocks/cocoon-scratchpad/cocoon-scratchpad-impl/src/main/java/org/apache/cocoon/components/flow/javascript/fom/AO_FOM_JavaScriptInterpreter.java
(original)
+++ cocoon/trunk/blocks/cocoon-scratchpad/cocoon-scratchpad-impl/src/main/java/org/apache/cocoon/components/flow/javascript/fom/AO_FOM_JavaScriptInterpreter.java
Fri Nov  3 13:10:26 2006
@@ -796,4 +796,10 @@
         }
     }
 
+    /**
+     * @see org.apache.cocoon.components.flow.AbstractInterpreter#getScriptExtension()
+     */
+    public String getScriptExtension() {
+        return ".js";
+    }
 }

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/flow/AbstractInterpreter.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/flow/AbstractInterpreter.java?view=diff&rev=470995&r1=470994&r2=470995
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/flow/AbstractInterpreter.java
(original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/flow/AbstractInterpreter.java
Fri Nov  3 13:10:26 2006
@@ -198,4 +198,11 @@
             throw new Exception("uri is not allowed to contain a scheme (cocoon:/ is always
automatically used)");
         }
     }
+
+    /**
+     * @see org.apache.cocoon.components.flow.Interpreter#getScriptExtension()
+     */
+    public String getScriptExtension() {
+        return null;
+    }
 }

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/flow/Interpreter.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/flow/Interpreter.java?view=diff&rev=470995&r1=470994&r2=470995
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/flow/Interpreter.java
(original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/flow/Interpreter.java
Fri Nov  3 13:10:26 2006
@@ -189,4 +189,14 @@
      *
      */
     void register(String source);
+
+    /**
+     * Return the default extension of script files associated with this
+     * interpreter.
+     * The extension is used by the sitemap to automount all scripts
+     * from the "flow" directory. If this method returns null, no
+     * scripts are mounted automatically.
+     * @return The script extension, like ".js", or null.
+     */
+    String getScriptExtension();
 }

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/FlowNodeBuilder.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/FlowNodeBuilder.java?view=diff&rev=470995&r1=470994&r2=470995
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/FlowNodeBuilder.java
(original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/FlowNodeBuilder.java
Fri Nov  3 13:10:26 2006
@@ -55,19 +55,15 @@
         // since 2.2 we add by default all flow scripts located in the ./flow directory
         // The default location can be overwritten by specifying the location attribute.
         final BeanFactory beanFactory = this.treeBuilder.getContainer().getBeanFactory();
-        if ( beanFactory instanceof ApplicationContext ) {
+        if ( beanFactory instanceof ApplicationContext && node.getInterpreter().getScriptExtension()
!= null ) {
             final ResourceLoader resourceLoader = (ApplicationContext)beanFactory;
             final String scriptLocation = config.getAttribute("location", DEFAULT_FLOW_SCRIPT_LOCATION);
             if ( resourceLoader.getResource(scriptLocation).exists() ) {
                 final ServletContextResourcePatternResolver resolver = new ServletContextResourcePatternResolver(resourceLoader);
-                final Resource[] resources = resolver.getResources(scriptLocation + "/*");
+                final Resource[] resources = resolver.getResources(scriptLocation + "/*"
+ node.getInterpreter().getScriptExtension());
                 if ( resources != null ) {
                     for(int i=0; i < resources.length; i++) {
-                        // exclude everything starting with "." (like .cvs, .svn)
-                        // TODO - We need a better exclusion filtering here!
-                        if ( !resources[i].getFilename().startsWith(".") ) {
-                            node.getInterpreter().register(ResourceUtils.getUri(resources[i]));
-                        }
+                        node.getInterpreter().register(ResourceUtils.getUri(resources[i]));
                     }
                 }
             }

Modified: cocoon/trunk/core/cocoon-core/src/main/resources/org/apache/cocoon/cocoon.xconf
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/resources/org/apache/cocoon/cocoon.xconf?view=diff&rev=470995&r1=470994&r2=470995
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/resources/org/apache/cocoon/cocoon.xconf (original)
+++ cocoon/trunk/core/cocoon-core/src/main/resources/org/apache/cocoon/cocoon.xconf Fri Nov
 3 13:10:26 2006
@@ -31,8 +31,8 @@
 
   <!--+
       | Include all configuration files (for core and blocks) from within the jars.
-  <include dir="resource://META-INF/cocoon/avalon" pattern="*.xconf"/>
       +-->
+  <include dir="classpath*:META-INF/cocoon/avalon" pattern="*.xconf"/>
 
   <!--+
       | Include all configuration files ending with ".xconf"



Mime
View raw message