cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Klimetschek <alexander.klimetsc...@mindquarry.com>
Subject Re: [RT] Simplify flow usage
Date Thu, 12 Oct 2006 09:21:17 GMT
I just run into a problem with the automatic loading of all files inside 
flow/: if there is a subversion directory (.svn) inside, it will try to 
call getInputStream() on it, which will fail on a directory.

So the problem is very general: you probably want to traverse 
sub-directories in order to let users structure their flow-directory. 
But how do you know that you have one of those "hidden" directories of a 
version control system (.svn, CVS,....). The "." for hidden dirs is not 
an exclusion criteria, because CVS doesn't use it. IMHO the conclusion 
is that there are two cases:

a) skip traversing of sub-directories (simple)
b) write some magic code that is able to skip any special/hidden directory

I could quickly provide a patch for a). So what do you think?

Alexander Klimetschek
(Mindquarry)

The stacktrace:

Caused by: org.apache.excalibur.source.SourceNotFoundException: 
file:/Users/alex/Mindquarry/hack/mindquarry-teamspace-web/mindquarry-teamspace-block/src/main/resources/COB-INF/flow/.svn/

doesn't exist.
	at 
org.apache.excalibur.source.impl.FileSource.getInputStream(FileSource.java:150)
	at 
org.apache.cocoon.components.flow.javascript.fom.FOM_JavaScriptInterpreter.compileScript(FOM_JavaScriptInterpreter.java:502)
	at 
org.apache.cocoon.components.flow.CompilingInterpreter$ScriptSourceEntry.getScript(CompilingInterpreter.java:112)
	at 
org.apache.cocoon.components.flow.javascript.fom.FOM_JavaScriptInterpreter.setupContext(FOM_JavaScriptInterpreter.java:453)
	at 
org.apache.cocoon.components.flow.javascript.fom.FOM_JavaScriptInterpreter.callFunction(FOM_JavaScriptInterpreter.java:572)
	at 
org.apache.cocoon.components.treeprocessor.sitemap.CallFunctionNode.invoke(CallFunctionNode.java:109)
	... 43 more
Caused by: java.io.FileNotFoundException: 
/Users/alex/Mindquarry/hack/mindquarry-teamspace-web/mindquarry-teamspace-block/src/main/resources/COB-INF/flow/.svn

(No such file or directory)
	at java.io.FileInputStream.open(Native Method)
	at java.io.FileInputStream.<init>(FileInputStream.java:106)
	at 
org.apache.excalibur.source.impl.FileSource.getInputStream(FileSource.java:146)
	... 48 more

Carsten Ziegeler wrote:
> I now implemented this "convention" stuff - all files located in the
> "flow" directory relative to the current sitemap are added to the flow
> interpreter - regardless of the file name suffix and the used
> interpreter (javascript, javaflow etc). The directory is of course optional.
> By this we show a best practice of how to use flow - if for any reason
> the user wants to use a different location, it's possible by specifying
> the "location" attribute on the flow node.
> 
> I think we should leave the other "convention" directories for spring
> and avalon configurations and the properties inside the "config"
> directory for now.
> 
> Carsten
> 


Mime
View raw message