You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cr...@apache.org on 2006/03/23 06:17:19 UTC

svn commit: r388041 [2/10] - in /cocoon/trunk: ./ cocoon-ajax/cocoon-ajax-impl/src/main/java/org/apache/cocoon/ajax/resources/macros/ cocoon-ajax/cocoon-ajax-impl/src/main/java/org/apache/cocoon/ajax/resources/xslt/ cocoon-ajax/cocoon-ajax-sample/src/m...

Modified: cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/java/org/apache/cocoon/deployer/monolithic/FileDeployer.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/java/org/apache/cocoon/deployer/monolithic/FileDeployer.java?rev=388041&r1=388040&r2=388041&view=diff
==============================================================================
--- cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/java/org/apache/cocoon/deployer/monolithic/FileDeployer.java (original)
+++ cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/java/org/apache/cocoon/deployer/monolithic/FileDeployer.java Wed Mar 22 21:16:59 2006
@@ -1,38 +1,38 @@
-/*
- * Copyright 2006 The Apache Software Foundation.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.cocoon.deployer.monolithic;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.OutputStream;
-
-import org.apache.cocoon.deployer.logger.Logger;
-
-/**
- * Use this interface for classes that are used by the @link org.apache.cocoon.maven.deployer.monolithic.ZipExtractor
- * to extract ZIP files. Classes implementing this interface can be added together with a rule to the
- * @link org.apache.cocoon.maven.deployer.monolithic.ZipExtractor and when the rule matches, the execute method
- * is called.
- */
-public interface FileDeployer {
-
-	public OutputStream writeResource(String documentName) throws IOException;
-
-	public void setBasedir(File file);
-
-	public void setLogger(Logger logger);
-	
-}
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.deployer.monolithic;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.OutputStream;
+
+import org.apache.cocoon.deployer.logger.Logger;
+
+/**
+ * Use this interface for classes that are used by the @link org.apache.cocoon.maven.deployer.monolithic.ZipExtractor
+ * to extract ZIP files. Classes implementing this interface can be added together with a rule to the
+ * @link org.apache.cocoon.maven.deployer.monolithic.ZipExtractor and when the rule matches, the execute method
+ * is called.
+ */
+public interface FileDeployer {
+
+	public OutputStream writeResource(String documentName) throws IOException;
+
+	public void setBasedir(File file);
+
+	public void setLogger(Logger logger);
+	
+}

Propchange: cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/java/org/apache/cocoon/deployer/monolithic/FileDeployer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/java/org/apache/cocoon/deployer/monolithic/NoRuleFoundException.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/java/org/apache/cocoon/deployer/monolithic/NoRuleFoundException.java?rev=388041&r1=388040&r2=388041&view=diff
==============================================================================
--- cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/java/org/apache/cocoon/deployer/monolithic/NoRuleFoundException.java (original)
+++ cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/java/org/apache/cocoon/deployer/monolithic/NoRuleFoundException.java Wed Mar 22 21:16:59 2006
@@ -1,24 +1,24 @@
-/*
- * Copyright 2006 The Apache Software Foundation.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.cocoon.deployer.monolithic;
-
-public class NoRuleFoundException extends RuntimeException {
-
-	public NoRuleFoundException(String message) {
-		super(message);
-	}
-
-}
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.deployer.monolithic;
+
+public class NoRuleFoundException extends RuntimeException {
+
+	public NoRuleFoundException(String message) {
+		super(message);
+	}
+
+}

Propchange: cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/java/org/apache/cocoon/deployer/monolithic/NoRuleFoundException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/java/org/apache/cocoon/deployer/monolithic/SingleFileDeployer.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/java/org/apache/cocoon/deployer/monolithic/SingleFileDeployer.java?rev=388041&r1=388040&r2=388041&view=diff
==============================================================================
--- cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/java/org/apache/cocoon/deployer/monolithic/SingleFileDeployer.java (original)
+++ cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/java/org/apache/cocoon/deployer/monolithic/SingleFileDeployer.java Wed Mar 22 21:16:59 2006
@@ -1,78 +1,78 @@
-/*
- * Copyright 2006 The Apache Software Foundation.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.cocoon.deployer.monolithic;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-
-import org.apache.cocoon.deployer.logger.Logger;
-import org.apache.commons.lang.Validate;
-
-/**
- * Deploy a single file. 
- */
-public class SingleFileDeployer implements FileDeployer {
-
-	private File basedir;
-	private Logger logger;
-	private String outputDir;
-	
-	public SingleFileDeployer(String outputDir) {
-		Validate.notNull(outputDir, "An outputDir has to be set.");
-		this.outputDir = outputDir;
-	}
-
-	public void setBasedir(final File basedir) {
-		this.basedir = basedir;
-	}
-
-	protected File getBasedir() {
-		return this.basedir;
-	}
-
-	public void setLogger(final Logger logger) {
-		this.logger = logger;
-	}
-	
-	protected Logger getLogger() {
-		return this.logger;
-	}
-	
-	protected String getFileName(String documentName) { 
-		return documentName.substring(documentName.lastIndexOf('/') + 1);
-	}
-
-	protected String getOutputDir() {
-		return this.outputDir;
-	}
-	
-	public OutputStream writeResource(String documentName) throws IOException {
-		this.logger.info("Deploying " + getOutputDir() + "/" + documentName);
-		
-		File outDir = new File(this.getBasedir(), getOutputDir());
-		if(!outDir.exists()) {
-			outDir.mkdirs();
-		}
-		File targetFile = new File(outDir, this.getFileName(documentName));
-		if(targetFile.exists()) {
-			throw new FileAlreadyDeployedException("File '" + targetFile + "' already exists!");
-		}
-		return new FileOutputStream(targetFile);
-	}
-	
-}
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.deployer.monolithic;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+
+import org.apache.cocoon.deployer.logger.Logger;
+import org.apache.commons.lang.Validate;
+
+/**
+ * Deploy a single file. 
+ */
+public class SingleFileDeployer implements FileDeployer {
+
+	private File basedir;
+	private Logger logger;
+	private String outputDir;
+	
+	public SingleFileDeployer(String outputDir) {
+		Validate.notNull(outputDir, "An outputDir has to be set.");
+		this.outputDir = outputDir;
+	}
+
+	public void setBasedir(final File basedir) {
+		this.basedir = basedir;
+	}
+
+	protected File getBasedir() {
+		return this.basedir;
+	}
+
+	public void setLogger(final Logger logger) {
+		this.logger = logger;
+	}
+	
+	protected Logger getLogger() {
+		return this.logger;
+	}
+	
+	protected String getFileName(String documentName) { 
+		return documentName.substring(documentName.lastIndexOf('/') + 1);
+	}
+
+	protected String getOutputDir() {
+		return this.outputDir;
+	}
+	
+	public OutputStream writeResource(String documentName) throws IOException {
+		this.logger.info("Deploying " + getOutputDir() + "/" + documentName);
+		
+		File outDir = new File(this.getBasedir(), getOutputDir());
+		if(!outDir.exists()) {
+			outDir.mkdirs();
+		}
+		File targetFile = new File(outDir, this.getFileName(documentName));
+		if(targetFile.exists()) {
+			throw new FileAlreadyDeployedException("File '" + targetFile + "' already exists!");
+		}
+		return new FileOutputStream(targetFile);
+	}
+	
+}

Propchange: cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/java/org/apache/cocoon/deployer/monolithic/SingleFileDeployer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/java/org/apache/cocoon/deployer/util/WildcardHelper.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/java/org/apache/cocoon/deployer/util/WildcardHelper.java?rev=388041&r1=388040&r2=388041&view=diff
==============================================================================
--- cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/java/org/apache/cocoon/deployer/util/WildcardHelper.java (original)
+++ cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/java/org/apache/cocoon/deployer/util/WildcardHelper.java Wed Mar 22 21:16:59 2006
@@ -1,380 +1,380 @@
-/*
- * Copyright 1999-2005 The Apache Software Foundation.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.cocoon.deployer.util;
-
-import java.util.HashMap;
-
-/**
- * This class is an utility class that perform wilcard-patterns matching and
- * isolation.
- *
- * Copy from cocoon-core.
- */
-public class WildcardHelper {
-
-    /** The int representing '*' in the pattern <code>int []</code>. */
-    protected static final int MATCH_FILE = -1;
-    /** The int representing '**' in the pattern <code>int []</code>. */
-    protected static final int MATCH_PATH = -2;
-    /** The int representing begin in the pattern <code>int []</code>. */
-    protected static final int MATCH_BEGIN = -4;
-    /** The int representing end in pattern <code>int []</code>. */
-    protected static final int MATCH_THEEND = -5;
-    /** The int value that terminates the pattern <code>int []</code>. */
-    protected static final int MATCH_END = -3;
-
-
-    /**
-     * Translate the given <code>String</code> into a <code>int []</code>
-     * representing the pattern matchable by this class.
-     * <br>
-     * This function translates a <code>String</code> into an int array
-     * converting the special '*' and '\' characters.
-     * <br>
-     * Here is how the conversion algorithm works:
-     * <ul>
-     *   <li>The '*' character is converted to MATCH_FILE, meaning that zero
-     *        or more characters (excluding the path separator '/') are to
-     *        be matched.</li>
-     *   <li>The '**' sequence is converted to MATCH_PATH, meaning that zero
-     *       or more characters (including the path separator '/') are to
-     *        be matched.</li>
-     *   <li>The '\' character is used as an escape sequence ('\*' is
-     *       translated in '*', not in MATCH_FILE). If an exact '\' character
-     *       is to be matched the source string must contain a '\\'.
-     *       sequence.</li>
-     * </ul>
-     * When more than two '*' characters, not separated by another character,
-     * are found their value is considered as '**' (MATCH_PATH).
-     * <br>
-     * The array is always terminated by a special value (MATCH_END).
-     * <br>
-     * All MATCH* values are less than zero, while normal characters are equal
-     * or greater.
-     *
-     * @param data The string to translate.
-     * @return The encoded string as an int array, terminated by the MATCH_END
-     *         value (don't consider the array length).
-     * @exception NullPointerException If data is null.
-     */
-    public static int[] compilePattern(String data)
-    throws NullPointerException {
-
-        // Prepare the arrays
-        int expr[] = new int[data.length() + 2];
-        char buff[] = data.toCharArray();
-
-        // Prepare variables for the translation loop
-        int y = 0;
-        boolean slash = false;
-
-        // Must start from beginning
-        expr[y++] = MATCH_BEGIN;
-
-        if (buff.length > 0) {
-            if (buff[0]=='\\') {
-                slash = true;
-            } else if (buff[0] == '*') {
-                expr[y++] = MATCH_FILE;
-            }  else {
-                expr[y++] = buff[0];
-            }
-
-            // Main translation loop
-            for (int x = 1; x < buff.length; x++) {
-                // If the previous char was '\' simply copy this char.
-                if (slash) {
-                    expr[y++] = buff[x];
-                    slash = false;
-                // If the previous char was not '\' we have to do a bunch of checks
-                } else {
-                    // If this char is '\' declare that and continue
-                    if (buff[x] == '\\') {
-                        slash = true;
-                    // If this char is '*' check the previous one
-                    } else if (buff[x] == '*') {
-                        // If the previous character als was '*' match a path
-                        if (expr[y-1] <= MATCH_FILE) {
-                            expr[y-1] = MATCH_PATH;
-                        } else {
-                            expr[y++] = MATCH_FILE;
-                        }
-                    } else {
-                        expr[y++]=buff[x];
-                    }
-                }
-            }
-        }
-
-        // Must match end at the end
-        expr[y] = MATCH_THEEND;
-        return expr;
-    }
-
-    /**
-     * match a pattern agains a string and isolates wildcard replacement into a
-     * <code>Stack</code>.
-     */
-    public static boolean match (HashMap map, String data, int[] expr) 
-    throws NullPointerException {
-        if (data == null) {
-            throw new NullPointerException ("No data provided");
-        }
-        if (expr == null) {
-            throw new NullPointerException ("No pattern expression provided");
-        }
-
-
-        char buff[] = data.toCharArray();
-        // Allocate the result buffer
-        char rslt[] = new char[expr.length + buff.length];
-
-
-        // The previous and current position of the expression character
-        // (MATCH_*)
-        int charpos = 0;
-
-        // The position in the expression, input, translation and result arrays
-        int exprpos = 0;
-        int buffpos = 0;
-        int rsltpos = 0;
-        int offset = -1;
-
-        // The matching count
-        int mcount = 0;
-
-        if ( map != null ) {
-            // We want the complete data be in {0}
-            map.put(Integer.toString(mcount),data);
-        }
-
-        // First check for MATCH_BEGIN
-        boolean matchBegin = false;
-        if (expr[charpos] == MATCH_BEGIN) {
-            matchBegin = true;
-            exprpos = ++charpos;
-        }
-
-        // Search the fist expression character (except MATCH_BEGIN - already skipped)
-        while (expr[charpos] >= 0)
-            charpos++;
-
-        // The expression charater (MATCH_*)
-        int exprchr = expr[charpos];
-
-        while (true) {
-            // Check if the data in the expression array before the current
-            // expression character matches the data in the input buffer
-            if (matchBegin) {
-                if (!matchArray(expr, exprpos, charpos, buff, buffpos))
-                    return (false);
-                matchBegin = false;
-            } else {
-                offset = indexOfArray (expr, exprpos, charpos, buff,
-                        buffpos);
-                if (offset < 0)
-                    return (false);
-            }
-
-            // Check for MATCH_BEGIN
-            if (matchBegin) {
-                if (offset != 0)
-                    return (false);
-                matchBegin = false;
-            }
-
-            // Advance buffpos
-            buffpos += (charpos - exprpos);
-
-            // Check for END's
-            if (exprchr == MATCH_END) {
-                if (rsltpos > 0 && map != null) {
-                    map.put(Integer.toString(++mcount),new String(rslt, 0, rsltpos));
-                }
-                // Don't care about rest of input buffer
-                return (true);
-            } else if (exprchr == MATCH_THEEND) {
-                if (rsltpos > 0 && map != null ) {
-                    map.put (Integer.toString(++mcount),new String(rslt, 0, rsltpos));
-                }
-                // Check that we reach buffer's end
-                return (buffpos == buff.length);
-            }
-
-            // Search the next expression character
-            exprpos = ++charpos;
-            while (expr[charpos] >= 0)
-                charpos++;
-            int prevchr = exprchr;
-            exprchr = expr[charpos];
-
-            // We have here prevchr == * or **.
-            offset = (prevchr == MATCH_FILE) ?
-                    indexOfArray (expr, exprpos, charpos, buff, buffpos) :
-                    lastIndexOfArray (expr, exprpos, charpos, buff,
-                    buffpos);
-
-            if (offset < 0)
-                return (false);
-
-            // Copy the data from the source buffer into the result buffer
-            // to substitute the expression character
-            if (prevchr == MATCH_PATH) {
-                while (buffpos < offset)
-                    rslt[rsltpos++] = buff[buffpos++];
-            } else {
-                // Matching file, don't copy '/'
-                while (buffpos < offset) {
-                    if (buff[buffpos] == '/')
-                        return (false);
-                    rslt[rsltpos++] = buff[buffpos++];
-                }
-            }
-
-            if ( map != null ) {
-                map.put(Integer.toString(++mcount),new String (rslt, 0, rsltpos));
-            }
-            rsltpos = 0;
-        }
-    }
-
-    /**
-      * Get the offset of a part of an int array within a char array.
-      * <br>
-      * This method return the index in d of the first occurrence after dpos of
-      * that part of array specified by r, starting at rpos and terminating at
-      * rend.
-      *
-      * @param r The array containing the data that need to be matched in d.
-      * @param rpos The index of the first character in r to look for.
-      * @param rend The index of the last character in r to look for plus 1.
-      * @param d The array of char that should contain a part of r.
-      * @param dpos The starting offset in d for the matching.
-      * @return The offset in d of the part of r matched in d or -1 if that was
-      *         not found.
-      */
-    protected static int indexOfArray (int r[], int rpos, int rend,
-            char d[], int dpos) {
-        // Check if pos and len are legal
-        if (rend < rpos)
-            throw new IllegalArgumentException ("rend < rpos");
-        // If we need to match a zero length string return current dpos
-        if (rend == rpos)
-            return (d.length); //?? dpos?
-        // If we need to match a 1 char length string do it simply
-        if ((rend - rpos) == 1) {
-            // Search for the specified character
-            for (int x = dpos; x < d.length; x++)
-                if (r[rpos] == d[x])
-                    return (x);
-        }
-        // Main string matching loop. It gets executed if the characters to
-        // match are less then the characters left in the d buffer
-        while ((dpos + rend - rpos) <= d.length) {
-            // Set current startpoint in d
-            int y = dpos;
-            // Check every character in d for equity. If the string is matched
-            // return dpos
-            for (int x = rpos; x <= rend; x++) {
-                if (x == rend)
-                    return (dpos);
-                if (r[x] != d[y++])
-                    break;
-            }
-            // Increase dpos to search for the same string at next offset
-            dpos++;
-        }
-        // The remaining chars in d buffer were not enough or the string
-        // wasn't matched
-        return (-1);
-    }
-
-    /**
-      * Get the offset of a last occurance of an int array within a char array.
-      * <br>
-      * This method return the index in d of the last occurrence after dpos of
-      * that part of array specified by r, starting at rpos and terminating at
-      * rend.
-      *
-      * @param r The array containing the data that need to be matched in d.
-      * @param rpos The index of the first character in r to look for.
-      * @param rend The index of the last character in r to look for plus 1.
-      * @param d The array of char that should contain a part of r.
-      * @param dpos The starting offset in d for the matching.
-      * @return The offset in d of the last part of r matched in d or -1 if that was
-      *         not found.
-      */
-    protected static int lastIndexOfArray (int r[], int rpos, int rend,
-            char d[], int dpos) {
-        // Check if pos and len are legal
-        if (rend < rpos)
-            throw new IllegalArgumentException ("rend < rpos");
-        // If we need to match a zero length string return current dpos
-        if (rend == rpos)
-            return (d.length); //?? dpos?
-
-        // If we need to match a 1 char length string do it simply
-        if ((rend - rpos) == 1) {
-            // Search for the specified character
-            for (int x = d.length - 1; x > dpos; x--)
-                if (r[rpos] == d[x])
-                    return (x);
-        }
-
-        // Main string matching loop. It gets executed if the characters to
-        // match are less then the characters left in the d buffer
-        int l = d.length - (rend - rpos);
-        while (l >= dpos) {
-            // Set current startpoint in d
-            int y = l;
-            // Check every character in d for equity. If the string is matched
-            // return dpos
-            for (int x = rpos; x <= rend; x++) {
-                if (x == rend)
-                    return (l);
-                if (r[x] != d[y++])
-                    break;
-            }
-            // Decrease l to search for the same string at next offset
-            l--;
-        }
-        // The remaining chars in d buffer were not enough or the string
-        // wasn't matched
-        return (-1);
-    }
-
-    /**
-      * Matches elements of array r from rpos to rend with array d, starting from dpos.
-      * <br>
-      * This method return true if elements of array r from rpos to rend
-      * equals elements of array d starting from dpos to dpos+(rend-rpos).
-      *
-      * @param r The array containing the data that need to be matched in d.
-      * @param rpos The index of the first character in r to look for.
-      * @param d The array of char that should start from a part of r.
-      * @param dpos The starting offset in d for the matching.
-      * @return true if array d starts from portion of array r.
-      */
-    protected static boolean matchArray (int r[], int rpos, int rend,
-            char d[], int dpos) {
-        if (d.length - dpos < rend - rpos)
-            return (false);
-        for (int i = rpos; i < rend; i++)
-            if (r[i] != d[dpos++])
-                return (false);
-        return (true);
-    }
-}
+/*
+ * Copyright 1999-2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.deployer.util;
+
+import java.util.HashMap;
+
+/**
+ * This class is an utility class that perform wilcard-patterns matching and
+ * isolation.
+ *
+ * Copy from cocoon-core.
+ */
+public class WildcardHelper {
+
+    /** The int representing '*' in the pattern <code>int []</code>. */
+    protected static final int MATCH_FILE = -1;
+    /** The int representing '**' in the pattern <code>int []</code>. */
+    protected static final int MATCH_PATH = -2;
+    /** The int representing begin in the pattern <code>int []</code>. */
+    protected static final int MATCH_BEGIN = -4;
+    /** The int representing end in pattern <code>int []</code>. */
+    protected static final int MATCH_THEEND = -5;
+    /** The int value that terminates the pattern <code>int []</code>. */
+    protected static final int MATCH_END = -3;
+
+
+    /**
+     * Translate the given <code>String</code> into a <code>int []</code>
+     * representing the pattern matchable by this class.
+     * <br>
+     * This function translates a <code>String</code> into an int array
+     * converting the special '*' and '\' characters.
+     * <br>
+     * Here is how the conversion algorithm works:
+     * <ul>
+     *   <li>The '*' character is converted to MATCH_FILE, meaning that zero
+     *        or more characters (excluding the path separator '/') are to
+     *        be matched.</li>
+     *   <li>The '**' sequence is converted to MATCH_PATH, meaning that zero
+     *       or more characters (including the path separator '/') are to
+     *        be matched.</li>
+     *   <li>The '\' character is used as an escape sequence ('\*' is
+     *       translated in '*', not in MATCH_FILE). If an exact '\' character
+     *       is to be matched the source string must contain a '\\'.
+     *       sequence.</li>
+     * </ul>
+     * When more than two '*' characters, not separated by another character,
+     * are found their value is considered as '**' (MATCH_PATH).
+     * <br>
+     * The array is always terminated by a special value (MATCH_END).
+     * <br>
+     * All MATCH* values are less than zero, while normal characters are equal
+     * or greater.
+     *
+     * @param data The string to translate.
+     * @return The encoded string as an int array, terminated by the MATCH_END
+     *         value (don't consider the array length).
+     * @exception NullPointerException If data is null.
+     */
+    public static int[] compilePattern(String data)
+    throws NullPointerException {
+
+        // Prepare the arrays
+        int expr[] = new int[data.length() + 2];
+        char buff[] = data.toCharArray();
+
+        // Prepare variables for the translation loop
+        int y = 0;
+        boolean slash = false;
+
+        // Must start from beginning
+        expr[y++] = MATCH_BEGIN;
+
+        if (buff.length > 0) {
+            if (buff[0]=='\\') {
+                slash = true;
+            } else if (buff[0] == '*') {
+                expr[y++] = MATCH_FILE;
+            }  else {
+                expr[y++] = buff[0];
+            }
+
+            // Main translation loop
+            for (int x = 1; x < buff.length; x++) {
+                // If the previous char was '\' simply copy this char.
+                if (slash) {
+                    expr[y++] = buff[x];
+                    slash = false;
+                // If the previous char was not '\' we have to do a bunch of checks
+                } else {
+                    // If this char is '\' declare that and continue
+                    if (buff[x] == '\\') {
+                        slash = true;
+                    // If this char is '*' check the previous one
+                    } else if (buff[x] == '*') {
+                        // If the previous character als was '*' match a path
+                        if (expr[y-1] <= MATCH_FILE) {
+                            expr[y-1] = MATCH_PATH;
+                        } else {
+                            expr[y++] = MATCH_FILE;
+                        }
+                    } else {
+                        expr[y++]=buff[x];
+                    }
+                }
+            }
+        }
+
+        // Must match end at the end
+        expr[y] = MATCH_THEEND;
+        return expr;
+    }
+
+    /**
+     * match a pattern agains a string and isolates wildcard replacement into a
+     * <code>Stack</code>.
+     */
+    public static boolean match (HashMap map, String data, int[] expr) 
+    throws NullPointerException {
+        if (data == null) {
+            throw new NullPointerException ("No data provided");
+        }
+        if (expr == null) {
+            throw new NullPointerException ("No pattern expression provided");
+        }
+
+
+        char buff[] = data.toCharArray();
+        // Allocate the result buffer
+        char rslt[] = new char[expr.length + buff.length];
+
+
+        // The previous and current position of the expression character
+        // (MATCH_*)
+        int charpos = 0;
+
+        // The position in the expression, input, translation and result arrays
+        int exprpos = 0;
+        int buffpos = 0;
+        int rsltpos = 0;
+        int offset = -1;
+
+        // The matching count
+        int mcount = 0;
+
+        if ( map != null ) {
+            // We want the complete data be in {0}
+            map.put(Integer.toString(mcount),data);
+        }
+
+        // First check for MATCH_BEGIN
+        boolean matchBegin = false;
+        if (expr[charpos] == MATCH_BEGIN) {
+            matchBegin = true;
+            exprpos = ++charpos;
+        }
+
+        // Search the fist expression character (except MATCH_BEGIN - already skipped)
+        while (expr[charpos] >= 0)
+            charpos++;
+
+        // The expression charater (MATCH_*)
+        int exprchr = expr[charpos];
+
+        while (true) {
+            // Check if the data in the expression array before the current
+            // expression character matches the data in the input buffer
+            if (matchBegin) {
+                if (!matchArray(expr, exprpos, charpos, buff, buffpos))
+                    return (false);
+                matchBegin = false;
+            } else {
+                offset = indexOfArray (expr, exprpos, charpos, buff,
+                        buffpos);
+                if (offset < 0)
+                    return (false);
+            }
+
+            // Check for MATCH_BEGIN
+            if (matchBegin) {
+                if (offset != 0)
+                    return (false);
+                matchBegin = false;
+            }
+
+            // Advance buffpos
+            buffpos += (charpos - exprpos);
+
+            // Check for END's
+            if (exprchr == MATCH_END) {
+                if (rsltpos > 0 && map != null) {
+                    map.put(Integer.toString(++mcount),new String(rslt, 0, rsltpos));
+                }
+                // Don't care about rest of input buffer
+                return (true);
+            } else if (exprchr == MATCH_THEEND) {
+                if (rsltpos > 0 && map != null ) {
+                    map.put (Integer.toString(++mcount),new String(rslt, 0, rsltpos));
+                }
+                // Check that we reach buffer's end
+                return (buffpos == buff.length);
+            }
+
+            // Search the next expression character
+            exprpos = ++charpos;
+            while (expr[charpos] >= 0)
+                charpos++;
+            int prevchr = exprchr;
+            exprchr = expr[charpos];
+
+            // We have here prevchr == * or **.
+            offset = (prevchr == MATCH_FILE) ?
+                    indexOfArray (expr, exprpos, charpos, buff, buffpos) :
+                    lastIndexOfArray (expr, exprpos, charpos, buff,
+                    buffpos);
+
+            if (offset < 0)
+                return (false);
+
+            // Copy the data from the source buffer into the result buffer
+            // to substitute the expression character
+            if (prevchr == MATCH_PATH) {
+                while (buffpos < offset)
+                    rslt[rsltpos++] = buff[buffpos++];
+            } else {
+                // Matching file, don't copy '/'
+                while (buffpos < offset) {
+                    if (buff[buffpos] == '/')
+                        return (false);
+                    rslt[rsltpos++] = buff[buffpos++];
+                }
+            }
+
+            if ( map != null ) {
+                map.put(Integer.toString(++mcount),new String (rslt, 0, rsltpos));
+            }
+            rsltpos = 0;
+        }
+    }
+
+    /**
+      * Get the offset of a part of an int array within a char array.
+      * <br>
+      * This method return the index in d of the first occurrence after dpos of
+      * that part of array specified by r, starting at rpos and terminating at
+      * rend.
+      *
+      * @param r The array containing the data that need to be matched in d.
+      * @param rpos The index of the first character in r to look for.
+      * @param rend The index of the last character in r to look for plus 1.
+      * @param d The array of char that should contain a part of r.
+      * @param dpos The starting offset in d for the matching.
+      * @return The offset in d of the part of r matched in d or -1 if that was
+      *         not found.
+      */
+    protected static int indexOfArray (int r[], int rpos, int rend,
+            char d[], int dpos) {
+        // Check if pos and len are legal
+        if (rend < rpos)
+            throw new IllegalArgumentException ("rend < rpos");
+        // If we need to match a zero length string return current dpos
+        if (rend == rpos)
+            return (d.length); //?? dpos?
+        // If we need to match a 1 char length string do it simply
+        if ((rend - rpos) == 1) {
+            // Search for the specified character
+            for (int x = dpos; x < d.length; x++)
+                if (r[rpos] == d[x])
+                    return (x);
+        }
+        // Main string matching loop. It gets executed if the characters to
+        // match are less then the characters left in the d buffer
+        while ((dpos + rend - rpos) <= d.length) {
+            // Set current startpoint in d
+            int y = dpos;
+            // Check every character in d for equity. If the string is matched
+            // return dpos
+            for (int x = rpos; x <= rend; x++) {
+                if (x == rend)
+                    return (dpos);
+                if (r[x] != d[y++])
+                    break;
+            }
+            // Increase dpos to search for the same string at next offset
+            dpos++;
+        }
+        // The remaining chars in d buffer were not enough or the string
+        // wasn't matched
+        return (-1);
+    }
+
+    /**
+      * Get the offset of a last occurance of an int array within a char array.
+      * <br>
+      * This method return the index in d of the last occurrence after dpos of
+      * that part of array specified by r, starting at rpos and terminating at
+      * rend.
+      *
+      * @param r The array containing the data that need to be matched in d.
+      * @param rpos The index of the first character in r to look for.
+      * @param rend The index of the last character in r to look for plus 1.
+      * @param d The array of char that should contain a part of r.
+      * @param dpos The starting offset in d for the matching.
+      * @return The offset in d of the last part of r matched in d or -1 if that was
+      *         not found.
+      */
+    protected static int lastIndexOfArray (int r[], int rpos, int rend,
+            char d[], int dpos) {
+        // Check if pos and len are legal
+        if (rend < rpos)
+            throw new IllegalArgumentException ("rend < rpos");
+        // If we need to match a zero length string return current dpos
+        if (rend == rpos)
+            return (d.length); //?? dpos?
+
+        // If we need to match a 1 char length string do it simply
+        if ((rend - rpos) == 1) {
+            // Search for the specified character
+            for (int x = d.length - 1; x > dpos; x--)
+                if (r[rpos] == d[x])
+                    return (x);
+        }
+
+        // Main string matching loop. It gets executed if the characters to
+        // match are less then the characters left in the d buffer
+        int l = d.length - (rend - rpos);
+        while (l >= dpos) {
+            // Set current startpoint in d
+            int y = l;
+            // Check every character in d for equity. If the string is matched
+            // return dpos
+            for (int x = rpos; x <= rend; x++) {
+                if (x == rend)
+                    return (l);
+                if (r[x] != d[y++])
+                    break;
+            }
+            // Decrease l to search for the same string at next offset
+            l--;
+        }
+        // The remaining chars in d buffer were not enough or the string
+        // wasn't matched
+        return (-1);
+    }
+
+    /**
+      * Matches elements of array r from rpos to rend with array d, starting from dpos.
+      * <br>
+      * This method return true if elements of array r from rpos to rend
+      * equals elements of array d starting from dpos to dpos+(rend-rpos).
+      *
+      * @param r The array containing the data that need to be matched in d.
+      * @param rpos The index of the first character in r to look for.
+      * @param d The array of char that should start from a part of r.
+      * @param dpos The starting offset in d for the matching.
+      * @return true if array d starts from portion of array r.
+      */
+    protected static boolean matchArray (int r[], int rpos, int rend,
+            char d[], int dpos) {
+        if (d.length - dpos < rend - rpos)
+            return (false);
+        for (int i = rpos; i < rend; i++)
+            if (r[i] != d[dpos++])
+                return (false);
+        return (true);
+    }
+}

Propchange: cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/java/org/apache/cocoon/deployer/util/WildcardHelper.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/resources/xsd/cob-schema-1.0.xsd
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/resources/xsd/cob-schema-1.0.xsd?rev=388041&r1=388040&r2=388041&view=diff
==============================================================================
--- cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/resources/xsd/cob-schema-1.0.xsd (original)
+++ cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/resources/xsd/cob-schema-1.0.xsd Wed Mar 22 21:16:59 2006
@@ -1,96 +1,96 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  Copyright 2005 The Apache Software Foundation
-
-  Licensed under the Apache License, Version 2.0 (the "License");
-  you may not use this file except in compliance with the License.
-  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License. 
--->
-<xs:schema targetNamespace="http://apache.org/cocoon/blocks/cob/1.0" 
- xmlns="http://apache.org/cocoon/blocks/cob/1.0" 
- xmlns:xs="http://www.w3.org/2001/XMLSchema" 
- elementFormDefault="qualified">
- 
-  <xs:element name="block">
-    <xs:complexType>
-      <xs:all>
-        <xs:element name="properties" type="properties" minOccurs="0"/>
-        <xs:element name="requirements" type="requirements" minOccurs="0"/>
-        <xs:element name="implements" type="implements" minOccurs="0"/>
-        <xs:element name="extends" type="extends" minOccurs="0"/>
-        <xs:element name="components" type="configuration" minOccurs="0"/>
-        <xs:element name="servlet" type="configuration" minOccurs="0"/>   
-      </xs:all>
-      <xs:attribute name="id" type="xs:anyURI" use="required"/>
-    </xs:complexType>
-  </xs:element>
-  
-  <!-- properties -->
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright 2005 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License. 
+-->
+<xs:schema targetNamespace="http://apache.org/cocoon/blocks/cob/1.0" 
+ xmlns="http://apache.org/cocoon/blocks/cob/1.0" 
+ xmlns:xs="http://www.w3.org/2001/XMLSchema" 
+ elementFormDefault="qualified">
+ 
+  <xs:element name="block">
+    <xs:complexType>
+      <xs:all>
+        <xs:element name="properties" type="properties" minOccurs="0"/>
+        <xs:element name="requirements" type="requirements" minOccurs="0"/>
+        <xs:element name="implements" type="implements" minOccurs="0"/>
+        <xs:element name="extends" type="extends" minOccurs="0"/>
+        <xs:element name="components" type="configuration" minOccurs="0"/>
+        <xs:element name="servlet" type="configuration" minOccurs="0"/>   
+      </xs:all>
+      <xs:attribute name="id" type="xs:anyURI" use="required"/>
+    </xs:complexType>
+  </xs:element>
+  
+  <!-- properties -->
   <xs:complexType name="properties">
 		<xs:sequence>
 			<xs:element name="property" type="property" maxOccurs="unbounded"/>
 		</xs:sequence>
-  </xs:complexType>
-
+  </xs:complexType>
+
   <xs:complexType name="property">
 		<xs:all>
 			<xs:element name="default" minOccurs="0" maxOccurs="1" type="xs:string"/>
 			<xs:element name="description" minOccurs="1" maxOccurs="1" type="xs:string"/>
 		</xs:all>
 		<xs:attribute name="name" use="required" type="xs:string"/>
-  </xs:complexType>  	
-
-  <!-- requirements -->
+  </xs:complexType>  	
+
+  <!-- requirements -->
   <xs:complexType name="requirements">
 		<xs:sequence>
 			<xs:element name="requires" type="requires" maxOccurs="unbounded"/>
 		</xs:sequence>
-  </xs:complexType>  
-
+  </xs:complexType>  
+
   <xs:complexType name="requires">
   	<xs:attribute name="interface" type="xs:anyURI" use="required"/>
   	<xs:attribute name="default" type="xs:anyURI" use="optional"/>
   	<xs:attribute name="name" type="xs:string" use="required"/>
-  </xs:complexType>  	
-
-  <!-- implements -->
+  </xs:complexType>  	
+
+  <!-- implements -->
   <xs:complexType name="implements">
 		<xs:sequence>
 			<xs:element name="interface" type="interface" maxOccurs="unbounded"/>
 		</xs:sequence>
-  </xs:complexType>  	
-
+  </xs:complexType>  	
+
   <xs:complexType name="interface">
   	<xs:attribute name="id" type="xs:anyURI" use="required"/>
-  </xs:complexType>  	  	
-
-  <!-- extends -->
+  </xs:complexType>  	  	
+
+  <!-- extends -->
   <xs:complexType name="extends">
   	<xs:attribute name="block" type="xs:anyURI" use="required"/>
-  </xs:complexType>  	 
-  
-  <!-- configuration -->
-  <xs:complexType name="configuration">
+  </xs:complexType>  	 
+  
+  <!-- configuration -->
+  <xs:complexType name="configuration">
     <xs:sequence>
       <xs:any namespace="##any"  minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
-    </xs:sequence>
-    <xs:attribute name="class" type="java-classes" use="optional"/>
-  </xs:complexType>  	    	
-  
-  
-  <!-- type for class attributes -->
-  <xs:simpleType name="java-classes">
-    <xs:restriction base="xs:string">
-      <!-- add here the regexp to test for valid package + class name -->
-    </xs:restriction>
-  </xs:simpleType>      
-
-</xs:schema>
+    </xs:sequence>
+    <xs:attribute name="class" type="java-classes" use="optional"/>
+  </xs:complexType>  	    	
+  
+  
+  <!-- type for class attributes -->
+  <xs:simpleType name="java-classes">
+    <xs:restriction base="xs:string">
+      <!-- add here the regexp to test for valid package + class name -->
+    </xs:restriction>
+  </xs:simpleType>      
+
+</xs:schema>

Propchange: cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/resources/xsd/cob-schema-1.0.xsd
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/resources/xsd/deploy-schema-1.0.xsd
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/resources/xsd/deploy-schema-1.0.xsd?rev=388041&r1=388040&r2=388041&view=diff
==============================================================================
--- cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/resources/xsd/deploy-schema-1.0.xsd (original)
+++ cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/resources/xsd/deploy-schema-1.0.xsd Wed Mar 22 21:16:59 2006
@@ -1,89 +1,89 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  Copyright 2005 The Apache Software Foundation
-
-  Licensed under the Apache License, Version 2.0 (the "License");
-  you may not use this file except in compliance with the License.
-  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License. 
--->
-<xs:schema targetNamespace="http://apache.org/cocoon/blocks/deploy/1.0" 
-  xmlns="http://apache.org/cocoon/blocks/deploy/1.0" 
-  xmlns:xs="http://www.w3.org/2001/XMLSchema" 
-  elementFormDefault="qualified">
- 
-  <!--xs:include schemaLocation="wired-block-1.0.xsd"/--> 
- 
-  <xs:element name="deploy">
-    <xs:complexType>
-      <xs:sequence>
-        <xs:element name="cocoon" type="cocoon" minOccurs="1" maxOccurs="1"/>
-        <xs:element name="block" type="block" maxOccurs="unbounded" minOccurs="0"/>
-      </xs:sequence>
-    </xs:complexType>
-  </xs:element>
-  
-  <xs:complexType name="cocoon">
-  	<xs:attribute name="target-url" type="xs:anyURI" use="optional"/>
-  	<xs:attribute name="webapp-urn" type="xs:anyURI" use="optional"/>
-  	<xs:attribute name="block-fw-urn" type="xs:anyURI" use="optional"/>
-  </xs:complexType>
-  
-  <xs:complexType name="block">
-    <xs:sequence>
-      <xs:element name="mount" type="mount" minOccurs="0"/>
-      <xs:element name="connections" type="connections" minOccurs="0"/>
-      <xs:element name="properties" type="properties" minOccurs="0"/>
-    </xs:sequence>
-    <xs:attribute name="id" type="deployBlockId" use="required"/>
-    <xs:attribute name="location" type="xs:anyURI" use="optional"/>
-    <xs:attribute name="urn" type="xs:anyURI" use="required"/>
-    <xs:attribute name="auto-wire" type="xs:boolean" default="true" use="optional"/>    
-  </xs:complexType>  
-  
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright 2005 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License. 
+-->
+<xs:schema targetNamespace="http://apache.org/cocoon/blocks/deploy/1.0" 
+  xmlns="http://apache.org/cocoon/blocks/deploy/1.0" 
+  xmlns:xs="http://www.w3.org/2001/XMLSchema" 
+  elementFormDefault="qualified">
+ 
+  <!--xs:include schemaLocation="wired-block-1.0.xsd"/--> 
+ 
+  <xs:element name="deploy">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element name="cocoon" type="cocoon" minOccurs="1" maxOccurs="1"/>
+        <xs:element name="block" type="block" maxOccurs="unbounded" minOccurs="0"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  
+  <xs:complexType name="cocoon">
+  	<xs:attribute name="target-url" type="xs:anyURI" use="optional"/>
+  	<xs:attribute name="webapp-urn" type="xs:anyURI" use="optional"/>
+  	<xs:attribute name="block-fw-urn" type="xs:anyURI" use="optional"/>
+  </xs:complexType>
+  
+  <xs:complexType name="block">
+    <xs:sequence>
+      <xs:element name="mount" type="mount" minOccurs="0"/>
+      <xs:element name="connections" type="connections" minOccurs="0"/>
+      <xs:element name="properties" type="properties" minOccurs="0"/>
+    </xs:sequence>
+    <xs:attribute name="id" type="deployBlockId" use="required"/>
+    <xs:attribute name="location" type="xs:anyURI" use="optional"/>
+    <xs:attribute name="urn" type="xs:anyURI" use="required"/>
+    <xs:attribute name="auto-wire" type="xs:boolean" default="true" use="optional"/>    
+  </xs:complexType>  
+  
   <xs:simpleType name="deployBlockId">
     <xs:restriction base="xs:ID">
       <xs:pattern value="[a-zA-Z0-9_-]*"/>
     </xs:restriction>
-  </xs:simpleType>
-  
-  <xs:simpleType name="refDeployBlockId">
-    <xs:restriction base="xs:string">
-      <xs:pattern value="[a-z\._0-9-]*"/>
-    </xs:restriction>
-  </xs:simpleType>  
-  
-  <xs:complexType name="mount">
-    <xs:attribute name="path" type="xs:string" use="required"/>
-  </xs:complexType>  	
-  
-  <xs:complexType name="connections">
-    <xs:sequence>
-      <xs:element name="connection" type="connection" minOccurs="0" maxOccurs="unbounded"/>
-    </xs:sequence>
-  </xs:complexType>  	
-  
-  <xs:complexType name="connection">
-    <xs:attribute name="name" type="xs:string" use="required"/>
-    <xs:attribute name="block" type="refDeployBlockId" use="required"/>
-  </xs:complexType>   	
-  
-  <xs:complexType name="properties">
-    <xs:sequence>
-      <xs:element name="property" type="property" minOccurs="1" maxOccurs="unbounded"/>
-    </xs:sequence>
-  </xs:complexType>  	
-  
-  <xs:complexType name="property">
-    <xs:attribute name="name" type="xs:string" use="required"/>
-    <xs:attribute name="value" type="xs:string" use="required"/>
-  </xs:complexType>     
-  
-</xs:schema>
+  </xs:simpleType>
+  
+  <xs:simpleType name="refDeployBlockId">
+    <xs:restriction base="xs:string">
+      <xs:pattern value="[a-z\._0-9-]*"/>
+    </xs:restriction>
+  </xs:simpleType>  
+  
+  <xs:complexType name="mount">
+    <xs:attribute name="path" type="xs:string" use="required"/>
+  </xs:complexType>  	
+  
+  <xs:complexType name="connections">
+    <xs:sequence>
+      <xs:element name="connection" type="connection" minOccurs="0" maxOccurs="unbounded"/>
+    </xs:sequence>
+  </xs:complexType>  	
+  
+  <xs:complexType name="connection">
+    <xs:attribute name="name" type="xs:string" use="required"/>
+    <xs:attribute name="block" type="refDeployBlockId" use="required"/>
+  </xs:complexType>   	
+  
+  <xs:complexType name="properties">
+    <xs:sequence>
+      <xs:element name="property" type="property" minOccurs="1" maxOccurs="unbounded"/>
+    </xs:sequence>
+  </xs:complexType>  	
+  
+  <xs:complexType name="property">
+    <xs:attribute name="name" type="xs:string" use="required"/>
+    <xs:attribute name="value" type="xs:string" use="required"/>
+  </xs:complexType>     
+  
+</xs:schema>

Propchange: cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/resources/xsd/deploy-schema-1.0.xsd
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/resources/xsd/sample-block.xml
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/resources/xsd/sample-block.xml?rev=388041&r1=388040&r2=388041&view=diff
==============================================================================
--- cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/resources/xsd/sample-block.xml (original)
+++ cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/resources/xsd/sample-block.xml Wed Mar 22 21:16:59 2006
@@ -1,52 +1,52 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  Copyright 2005 The Apache Software Foundation
-
-  Licensed under the Apache License, Version 2.0 (the "License");
-  you may not use this file except in compliance with the License.
-  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License. 
--->
-<block xmlns="http://apache.org/cocoon/blocks/cob/1.0"
-	id="http://cocoon.apache.org/blocks/anyblock/1.0">
-	
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright 2005 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License. 
+-->
+<block xmlns="http://apache.org/cocoon/blocks/cob/1.0"
+	id="http://cocoon.apache.org/blocks/anyblock/1.0">
+	
 	<properties>
-		<property name="mailserver">
-			<default>localhost</default>
-			<description>The IP adress or the DNS name of a server that can send mails.</description>
-		</property>
-		<property name="foo">
-			<description>bar</description>
+		<property name="mailserver">
+			<default>localhost</default>
+			<description>The IP adress or the DNS name of a server that can send mails.</description>
 		</property>
-	</properties>
-	
+		<property name="foo">
+			<description>bar</description>
+		</property>
+	</properties>
+	
 	<requirements>
-		<requires 
-		  interface="http://cocoon.apache.org/interface/portal/1.0" 
-		  name="portal"
-		  default="http://cocoon.apache.org/blocks/portal/1.0.2"
+		<requires 
+		  interface="http://cocoon.apache.org/interface/portal/1.0" 
+		  name="portal"
+		  default="http://cocoon.apache.org/blocks/portal/1.0.2"
 		  />
-	</requirements>
-	
-	<extends block="http://cocoon.apache.org/blocks/another-block/1.0"/>
-	
-	<implements>
-		<interface id="http://cocoon.apache.org/interface/bla/1.0"/>
-	</implements>
+	</requirements>
+	
+	<extends block="http://cocoon.apache.org/blocks/another-block/1.0"/>
+	
+	<implements>
+		<interface id="http://cocoon.apache.org/interface/bla/1.0"/>
+	</implements>
   
   <servlet class="org.apache.cocoon.servlet.SitemapServlet">
     <sitemap>COB-INF/sitemap.xmap</sitemap>
-  </servlet>
-  
+  </servlet>
+  
   <components class="org.apache.cocoon.some.component.manager">
     <include>META-INF/block.xconf</include>
-  </components>
-  
+  </components>
+  
 </block>

Propchange: cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/resources/xsd/sample-block.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/resources/xsd/sample-deploy.xml
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/resources/xsd/sample-deploy.xml?rev=388041&r1=388040&r2=388041&view=diff
==============================================================================
--- cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/resources/xsd/sample-deploy.xml (original)
+++ cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/resources/xsd/sample-deploy.xml Wed Mar 22 21:16:59 2006
@@ -1,23 +1,23 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  Copyright 2005 The Apache Software Foundation
-
-  Licensed under the Apache License, Version 2.0 (the "License");
-  you may not use this file except in compliance with the License.
-  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License. 
--->
-<deploy xmlns="http://apache.org/cocoon/blocks/deploy/1.0"
-	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
-  xsi:schemaLocation="http://apache.org/cocoon/blocks/deploy/1.0 deploy-schema-1.0.xsd">
-
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright 2005 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License. 
+-->
+<deploy xmlns="http://apache.org/cocoon/blocks/deploy/1.0"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+  xsi:schemaLocation="http://apache.org/cocoon/blocks/deploy/1.0 deploy-schema-1.0.xsd">
+
   <cocoon version="2.2" url="file://d:/my-cocoon/" exclusive="true"/>
   
   <block id="a" location="00001" urn="webmail:webmail:3.27">
@@ -31,12 +31,12 @@
     </properties>    
   </block>
   
-  <block id="externalskin" location="000002"  urn="mycompany:external-skin:3.1">
-    <connections>
-      <connection name="abc-27" block="abc-27"/>
-    </connections>
-  </block>    
+  <block id="externalskin" location="000002"  urn="mycompany:external-skin:3.1">
+    <connections>
+      <connection name="abc-27" block="abc-27"/>
+    </connections>
+  </block>    
     
-  <block id="internal-skin" location="000003" urn="mycompany:internal-skin:17.2"/>      
-
+  <block id="internal-skin" location="000003" urn="mycompany:internal-skin:17.2"/>      
+
 </deploy>

Propchange: cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/resources/xsd/sample-deploy.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/resources/xsd/sample-wiring.xml
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/resources/xsd/sample-wiring.xml?rev=388041&r1=388040&r2=388041&view=diff
==============================================================================
--- cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/resources/xsd/sample-wiring.xml (original)
+++ cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/resources/xsd/sample-wiring.xml Wed Mar 22 21:16:59 2006
@@ -1,37 +1,37 @@
-<?xml version="1.0"?>
-<!--
-  Copyright 1999-2004 The Apache Software Foundation
-
-  Licensed under the Apache License, Version 2.0 (the "License");
-  you may not use this file except in compliance with the License.
-  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License. 
--->
-
-<wiring xmlns="http://apache.org/cocoon/blocks/wiring/1.0"
-	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
-	xsi:schemaLocation="http://apache.org/cocoon/blocks/wiring/1.0 wiring-schema-1.0.xsd"
->
-
+<?xml version="1.0"?>
+<!--
+  Copyright 1999-2004 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License. 
+-->
+
+<wiring xmlns="http://apache.org/cocoon/blocks/wiring/1.0"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+	xsi:schemaLocation="http://apache.org/cocoon/blocks/wiring/1.0 wiring-schema-1.0.xsd"
+>
+
   <block id="webmail" location="00001">
     <connections>
-      <connection name="external-skin" block="external-skin"/>
+      <connection name="external-skin" block="external-skin"/>
       <connection name="internal-skin" block="internal-skin"/>
-    </connections>
-    <properties>
-      <property name="user" value="guest"/>
-      <property name="password" value="sj3u493"/>
+    </connections>
+    <properties>
+      <property name="user" value="guest"/>
+      <property name="password" value="sj3u493"/>
     </properties>    
-  </block>
-  
-  <block id="external-skin" location="000002"/>
-  <block id="internal-skin" location="000003"/>  
-
+  </block>
+  
+  <block id="external-skin" location="000002"/>
+  <block id="internal-skin" location="000003"/>  
+
 </wiring>

Propchange: cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/main/resources/xsd/sample-wiring.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/java/org/apache/cocoon/deployer/applicationserver/MonoliticServerTest.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/java/org/apache/cocoon/deployer/applicationserver/MonoliticServerTest.java?rev=388041&r1=388040&r2=388041&view=diff
==============================================================================
--- cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/java/org/apache/cocoon/deployer/applicationserver/MonoliticServerTest.java (original)
+++ cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/java/org/apache/cocoon/deployer/applicationserver/MonoliticServerTest.java Wed Mar 22 21:16:59 2006
@@ -1,50 +1,50 @@
-/*
- * Copyright 2006 The Apache Software Foundation.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.cocoon.deployer.applicationserver;
-
-import java.io.File;
-
-import org.apache.cocoon.deployer.AbstractDeployerTestCase;
-import org.apache.cocoon.deployer.logger.ConsoleLogger;
-import org.apache.cocoon.deployer.monolithic.FileAlreadyDeployedException;
-import org.apache.cocoon.deployer.monolithic.SingleFileDeployer;
-
-public class MonoliticServerTest extends AbstractDeployerTestCase {
-
-	private static final String SERVER_DIR = "target/test/monolithicServer23";
-	
-	public void testSimpleDeploy() throws Exception {
-		MonolithicServer23 monolithicServer = new MonolithicServer23(new File(SERVER_DIR), new ConsoleLogger());
-		monolithicServer.addRule("**webdav*.xconf", new SingleFileDeployer("WEB-INF/xconf"));
-		monolithicServer.addRule("**legacy**.xmap", new SingleFileDeployer("WEB-INF/sitemap-additions"));
-		monolithicServer.extract(this.getMockArtefact("validMonolithicBlock-02/valid-block-1.0.jar"));
-		assertTrue(new File("target/test/monolithicServer23/WEB-INF/xconf/my-webdav-server.xconf").exists());
-		assertTrue(new File("target/test/monolithicServer23/WEB-INF/sitemap-additions/sa.xmap").exists());		
-	}
-	
-	public void testNotWorkingDeploy() throws Exception {
-		MonolithicServer23 monolithicServer = new MonolithicServer23(new File(SERVER_DIR), new ConsoleLogger());
-		monolithicServer.addRule("**webdav*.xconf", new SingleFileDeployer("WEB-INF/xconf"));
-		monolithicServer.extract(this.getMockArtefact("validMonolithicBlock-02/valid-block-1.0.jar"));
-		try {
-			monolithicServer.extract(this.getMockArtefact("validMonolithicBlock-02/valid-block-1.0.jar"));		
-			fail("If a file with the same name is deployed twice, an exception should be thrown.");
-		} catch(FileAlreadyDeployedException fade) {
-			// expected
-		}
-	}
-	
-}
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.deployer.applicationserver;
+
+import java.io.File;
+
+import org.apache.cocoon.deployer.AbstractDeployerTestCase;
+import org.apache.cocoon.deployer.logger.ConsoleLogger;
+import org.apache.cocoon.deployer.monolithic.FileAlreadyDeployedException;
+import org.apache.cocoon.deployer.monolithic.SingleFileDeployer;
+
+public class MonoliticServerTest extends AbstractDeployerTestCase {
+
+	private static final String SERVER_DIR = "target/test/monolithicServer23";
+	
+	public void testSimpleDeploy() throws Exception {
+		MonolithicServer23 monolithicServer = new MonolithicServer23(new File(SERVER_DIR), new ConsoleLogger());
+		monolithicServer.addRule("**webdav*.xconf", new SingleFileDeployer("WEB-INF/xconf"));
+		monolithicServer.addRule("**legacy**.xmap", new SingleFileDeployer("WEB-INF/sitemap-additions"));
+		monolithicServer.extract(this.getMockArtefact("validMonolithicBlock-02/valid-block-1.0.jar"));
+		assertTrue(new File("target/test/monolithicServer23/WEB-INF/xconf/my-webdav-server.xconf").exists());
+		assertTrue(new File("target/test/monolithicServer23/WEB-INF/sitemap-additions/sa.xmap").exists());		
+	}
+	
+	public void testNotWorkingDeploy() throws Exception {
+		MonolithicServer23 monolithicServer = new MonolithicServer23(new File(SERVER_DIR), new ConsoleLogger());
+		monolithicServer.addRule("**webdav*.xconf", new SingleFileDeployer("WEB-INF/xconf"));
+		monolithicServer.extract(this.getMockArtefact("validMonolithicBlock-02/valid-block-1.0.jar"));
+		try {
+			monolithicServer.extract(this.getMockArtefact("validMonolithicBlock-02/valid-block-1.0.jar"));		
+			fail("If a file with the same name is deployed twice, an exception should be thrown.");
+		} catch(FileAlreadyDeployedException fade) {
+			// expected
+		}
+	}
+	
+}

Propchange: cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/java/org/apache/cocoon/deployer/applicationserver/MonoliticServerTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/java/org/apache/cocoon/deployer/monolithic/SingleFileDeployerTest.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/java/org/apache/cocoon/deployer/monolithic/SingleFileDeployerTest.java?rev=388041&r1=388040&r2=388041&view=diff
==============================================================================
--- cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/java/org/apache/cocoon/deployer/monolithic/SingleFileDeployerTest.java (original)
+++ cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/java/org/apache/cocoon/deployer/monolithic/SingleFileDeployerTest.java Wed Mar 22 21:16:59 2006
@@ -1,27 +1,27 @@
-/*
- * Copyright 2006 The Apache Software Foundation.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.cocoon.deployer.monolithic;
-
-import junit.framework.TestCase;
-
-public class SingleFileDeployerTest extends TestCase {
-
-	public void testGetFileName() {
-		String documentName = "blah/xyz.txt";
-		assertEquals("xyz.txt", new SingleFileDeployer("").getFileName(documentName));
-	}
-
-}
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.deployer.monolithic;
+
+import junit.framework.TestCase;
+
+public class SingleFileDeployerTest extends TestCase {
+
+	public void testGetFileName() {
+		String documentName = "blah/xyz.txt";
+		assertEquals("xyz.txt", new SingleFileDeployer("").getFileName(documentName));
+	}
+
+}

Propchange: cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/java/org/apache/cocoon/deployer/monolithic/SingleFileDeployerTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-02/blockRoot/META-INF/block.xml
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-02/blockRoot/META-INF/block.xml?rev=388041&r1=388040&r2=388041&view=diff
==============================================================================
--- cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-02/blockRoot/META-INF/block.xml (original)
+++ cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-02/blockRoot/META-INF/block.xml Wed Mar 22 21:16:59 2006
@@ -1,29 +1,29 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  Copyright 2005 The Apache Software Foundation
-
-  Licensed under the Apache License, Version 2.0 (the "License");
-  you may not use this file except in compliance with the License.
-  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License. 
--->
-<block xmlns="http://apache.org/cocoon/blocks/cob/1.0"
-       id="http://cocoon.apache.org/blocks/anyblock-01/1.0">
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright 2005 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License. 
+-->
+<block xmlns="http://apache.org/cocoon/blocks/cob/1.0"
+       id="http://cocoon.apache.org/blocks/anyblock-01/1.0">
   <properties>
-    <property name="prop1">
+    <property name="prop1">
       <default>defaultValue1</default>
       <description>Property 1</description>
-    </property>
-    <property name="prop2">
+    </property>
+    <property name="prop2">
       <default>defaultValue2</default>
       <description>Property2</description>
     </property>
-  </properties>
+  </properties>
 </block>

Propchange: cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-02/blockRoot/META-INF/block.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-03/blockRoot/META-INF/block.xml
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-03/blockRoot/META-INF/block.xml?rev=388041&r1=388040&r2=388041&view=diff
==============================================================================
--- cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-03/blockRoot/META-INF/block.xml (original)
+++ cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-03/blockRoot/META-INF/block.xml Wed Mar 22 21:16:59 2006
@@ -1,28 +1,28 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  Copyright 2005 The Apache Software Foundation
-
-  Licensed under the Apache License, Version 2.0 (the "License");
-  you may not use this file except in compliance with the License.
-  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License. 
--->
-<block xmlns="http://apache.org/cocoon/blocks/cob/1.0"
-  id="anyblock:anyblock-03:1.0">
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright 2005 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License. 
+-->
+<block xmlns="http://apache.org/cocoon/blocks/cob/1.0"
+  id="anyblock:anyblock-03:1.0">
   <properties>
-    <property name="prop1">
+    <property name="prop1">
       <default>defaultValue1</default>
       <description>Property 1</description>
     </property>
-  </properties>
+  </properties>
   <requirements>
     <requires interface="db-interface01" name="db"/>
-  </requirements>
+  </requirements>
 </block>

Propchange: cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-03/blockRoot/META-INF/block.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-04/blockRoot/META-INF/block.xml
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-04/blockRoot/META-INF/block.xml?rev=388041&r1=388040&r2=388041&view=diff
==============================================================================
--- cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-04/blockRoot/META-INF/block.xml (original)
+++ cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-04/blockRoot/META-INF/block.xml Wed Mar 22 21:16:59 2006
@@ -1,29 +1,29 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  Copyright 2006 The Apache Software Foundation
-
-  Licensed under the Apache License, Version 2.0 (the "License");
-  you may not use this file except in compliance with the License.
-  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License. 
--->
-<block xmlns="http://apache.org/cocoon/blocks/cob/1.0"
-  id="anyblock:anyblock-04:1.0">
-  
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright 2006 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License. 
+-->
+<block xmlns="http://apache.org/cocoon/blocks/cob/1.0"
+  id="anyblock:anyblock-04:1.0">
+  
   <implements>
     <interface id="db-interface01"/>
-  </implements>
-  
+  </implements>
+  
   <requirements>
-    <requires interface="interface-01" name="b01" default="anyblock:anyblock-05:1.0"/>
+    <requires interface="interface-01" name="b01" default="anyblock:anyblock-05:1.0"/>
     <requires interface="interface-02" name="b02" default="anyblock:anyblock-06:1.0"/>
-  </requirements>
-  
+  </requirements>
+  
 </block>

Propchange: cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-04/blockRoot/META-INF/block.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-05/blockRoot/META-INF/block.xml
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-05/blockRoot/META-INF/block.xml?rev=388041&r1=388040&r2=388041&view=diff
==============================================================================
--- cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-05/blockRoot/META-INF/block.xml (original)
+++ cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-05/blockRoot/META-INF/block.xml Wed Mar 22 21:16:59 2006
@@ -1,24 +1,24 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  Copyright 2005 The Apache Software Foundation
-
-  Licensed under the Apache License, Version 2.0 (the "License");
-  you may not use this file except in compliance with the License.
-  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License. 
--->
-<block xmlns="http://apache.org/cocoon/blocks/cob/1.0"
-  id="anyblock:anyblock-05:1.0">
-
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright 2005 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License. 
+-->
+<block xmlns="http://apache.org/cocoon/blocks/cob/1.0"
+  id="anyblock:anyblock-05:1.0">
+
   <implements>
     <interface id="interface-01"/>
-  </implements>
-
+  </implements>
+
 </block>

Propchange: cocoon/trunk/cocoon-block-deployer/cocoon-deployer-core/src/test/mocks/validBlock-05/blockRoot/META-INF/block.xml
------------------------------------------------------------------------------
    svn:eol-style = native