db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r910600 [13/29] - in /db/torque/torque4/trunk: maven-torque-gf-plugin/ maven-torque-gf-plugin/src/ maven-torque-gf-plugin/src/main/ maven-torque-gf-plugin/src/main/java/ maven-torque-gf-plugin/src/main/java/org/ maven-torque-gf-plugin/src/m...
Date Tue, 16 Feb 2010 17:16:02 GMT
Added: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/source/xml/package.html
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/source/xml/package.html?rev=910600&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/source/xml/package.html (added)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/source/xml/package.html Tue Feb 16 17:15:43 2010
@@ -0,0 +1,26 @@
+<!--
+ Copyright 2001-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.
+-->
+<html>
+  <head>
+    <title>Torque-gf XML sources</title>
+  </head>
+  <body>
+    <p>
+      This package contains the handling of XML source files
+      in Torque-gf.
+    </p>
+  </body>
+</html>

Added: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/template/TemplateFilter.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/template/TemplateFilter.java?rev=910600&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/template/TemplateFilter.java (added)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/template/TemplateFilter.java Tue Feb 16 17:15:43 2010
@@ -0,0 +1,39 @@
+package org.apache.torque.gf.template;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+import java.io.IOException;
+import java.io.InputStream;
+
+/**
+ * An Filter which preprocesses a template.
+ */
+public interface TemplateFilter
+{
+    /**
+     * Filters (i.e modifies) a template.
+     * @param toFilter the input stream for the template to filter.
+     * @param encoding the encoding of the template.
+     * @return A stream containing the filtered template.
+     * @throws IOException if an error occurs while reading or filtering
+     *         the template.
+     */
+    InputStream filter(InputStream toFilter, String encoding) throws IOException;
+}

Added: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/template/TemplateGenerator.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/template/TemplateGenerator.java?rev=910600&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/template/TemplateGenerator.java (added)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/template/TemplateGenerator.java Tue Feb 16 17:15:43 2010
@@ -0,0 +1,42 @@
+package org.apache.torque.gf.template;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+import org.apache.torque.gf.configuration.ConfigurationException;
+import org.apache.torque.gf.control.ControllerState;
+import org.apache.torque.gf.generator.Generator;
+
+/**
+ * A Generator which interprets a template.
+ */
+public interface TemplateGenerator extends Generator
+{
+    /**
+     * Returns the contents as a Template as a String.
+     *
+     * @param controllerState the state of the controller, not null.
+     *
+     * @return the template as a String.
+     *
+     * @throws ConfigurationException if the template cannot be read.
+     */
+    String getContent(ControllerState controllerState)
+            throws ConfigurationException;
+}

Added: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/template/TemplateGeneratorImpl.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/template/TemplateGeneratorImpl.java?rev=910600&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/template/TemplateGeneratorImpl.java (added)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/template/TemplateGeneratorImpl.java Tue Feb 16 17:15:43 2010
@@ -0,0 +1,247 @@
+package org.apache.torque.gf.template;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.torque.gf.configuration.ConfigurationException;
+import org.apache.torque.gf.configuration.ConfigurationProvider;
+import org.apache.torque.gf.control.ControllerState;
+import org.apache.torque.gf.control.TokenReplacer;
+import org.apache.torque.gf.generator.GeneratorImpl;
+import org.apache.torque.gf.qname.QualifiedName;
+
+/**
+ * An implementation of the TemplateGenerator interface.
+ */
+public abstract class TemplateGeneratorImpl
+        extends GeneratorImpl
+        implements TemplateGenerator
+{
+    /** The log of the class. */
+    private static Log log = LogFactory.getLog(TemplateGeneratorImpl.class);
+
+    /**
+     * The content of the templates.
+     * The key is the resolved template path, the value is the template content.
+     * There may be more than one template content per template because
+     * the template path can contain tokens.
+     */
+    private Map<String, String> contentMap = new HashMap<String, String>();
+
+    /**
+     * The path to the template. May contain unresolved tokens.
+     */
+    private String path = null;
+
+    /**
+     * The encoding of the template.
+     */
+    private String encoding = null;
+
+    /**
+     * The configuration provider for accessing the template content.
+     */
+    private ConfigurationProvider configurationProvider;
+
+    /**
+     * The Filter for filtering the template content.
+     */
+    private TemplateFilter templateFilter;
+
+    /** Buffer size for loading the template File. */
+    private static final int LOAD_BUFFER_SIZE = 8192;
+
+    /**
+     * How many characters of a template content should be output
+     * in the toString method.
+     */
+    private static final int CONTENT_TO_STRING_MAX_OUTPUT_LENGTH = 40;
+
+    /**
+     * Constructs a TemplateGeneratorImpl with the given name.
+     *
+     * @param name the name of this generator, not null.
+     * @param configurationProvider the provider for reading the templates,
+     *        not null.
+     * @param path the path to the templates, not null.
+     *        May contain tokens of the form ${....}, these are parsed.
+     * @param encoding the encoding of the file, or null if the system's
+     *        default encoding should be used.
+     * @param templateFilter a possible filter for preprocessing the template,
+     *        not null.
+     *
+     * @throws NullPointerException if name or inputStream are null.
+     * @throws ConfigurationException if the template cannot be loaded.
+     */
+    protected TemplateGeneratorImpl(
+            QualifiedName name,
+            ConfigurationProvider configurationProvider,
+            String path,
+            String encoding,
+            TemplateFilter templateFilter)
+        throws ConfigurationException
+    {
+        super(name);
+        if (configurationProvider == null)
+        {
+            throw new NullPointerException(
+                    "configurationProvider must not be null");
+        }
+        if (path == null)
+        {
+            throw new NullPointerException("path must not be null");
+        }
+        this.configurationProvider = configurationProvider;
+        this.path = path;
+        this.encoding = encoding;
+        this.templateFilter = templateFilter;
+    }
+
+    public String getContent(ControllerState controllerState)
+            throws ConfigurationException
+    {
+        TokenReplacer tokenReplacer = new TokenReplacer(controllerState);
+        String detokenizedPath = tokenReplacer.process(path);
+
+        String result = contentMap.get(detokenizedPath);
+        if (result == null)
+        {
+            InputStream templateInputStream = null;
+            try
+            {
+                templateInputStream
+                        = configurationProvider.getTemplateInputStream(
+                            detokenizedPath);
+                result = load(templateInputStream, encoding, templateFilter);
+            }
+            catch (IOException e)
+            {
+                throw new ConfigurationException(e);
+            }
+            finally
+            {
+                if (templateInputStream != null)
+                {
+                    try
+                    {
+                        templateInputStream.close();
+                    }
+                    catch (IOException e)
+                    {
+                        log.warn("Could not close template reader", e);
+                    }
+                }
+            }
+            contentMap.put(detokenizedPath, result);
+        }
+
+        return result;
+    }
+
+    /**
+     * Loads the template, possibly filtering the content..
+     *
+     * @param inputStream the stream to read from.
+     * @param encoding the encoding of the template, or null for auto detection.
+     * @param filter a filter for modifying the template,
+     *        or null for no filtering.
+     *
+     * @return the content of the read and filtered template.
+     *
+     * @throws IOException if an error occurs while reading the template.
+     */
+    protected String load(
+            InputStream inputStream,
+            String encoding,
+            TemplateFilter filter)
+        throws IOException
+    {
+        InputStream filteredStream;
+        if (filter != null)
+        {
+            filteredStream = filter.filter(inputStream, encoding);
+        }
+        else
+        {
+            filteredStream = inputStream;
+        }
+        Reader reader;
+        if (encoding == null)
+        {
+            reader = new InputStreamReader(filteredStream);
+        }
+        else
+        {
+            reader = new InputStreamReader(filteredStream, encoding);
+        }
+
+        StringBuffer contentBuffer = new StringBuffer();
+        while (true)
+        {
+            char[] charBuffer = new char[LOAD_BUFFER_SIZE];
+            int filledChars = reader.read(charBuffer);
+            if (filledChars == -1)
+            {
+                break;
+            }
+            contentBuffer.append(charBuffer, 0, filledChars);
+        }
+
+        return contentBuffer.toString();
+    }
+
+    /**
+     * Returns a String representation of this generator for debugging purposes.
+     *
+     * @return a String representation of this generator, never null.
+     *
+     * @see Object#toString()
+     */
+    @Override
+    public String toString()
+    {
+        StringBuffer result = new StringBuffer(super.toString()).append(",");
+        result.append("encoding=").append(encoding).append(",");
+        result.append("content=");
+        if (!contentMap.isEmpty())
+        {
+            String firstContent = contentMap.values().iterator().next();
+            if (firstContent.length() > CONTENT_TO_STRING_MAX_OUTPUT_LENGTH)
+            {
+                result.append(firstContent.substring(
+                        0,
+                        CONTENT_TO_STRING_MAX_OUTPUT_LENGTH));
+            }
+            else
+            {
+                result.append(firstContent);
+            }
+        }
+        return result.toString();
+    }
+}

Added: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/template/package.html
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/template/package.html?rev=910600&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/template/package.html (added)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/template/package.html Tue Feb 16 17:15:43 2010
@@ -0,0 +1,26 @@
+<!--
+ Copyright 2001-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.
+-->
+<html>
+  <head>
+    <title>Torque-gf v template generators</title>
+  </head>
+  <body>
+    <p>
+      This package contains the handling of template-based generators
+      in Torque-gf.
+    </p>
+  </body>
+</html>

Added: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/template/velocity/TorqueGfVelocity.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/template/velocity/TorqueGfVelocity.java?rev=910600&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/template/velocity/TorqueGfVelocity.java (added)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/template/velocity/TorqueGfVelocity.java Tue Feb 16 17:15:43 2010
@@ -0,0 +1,287 @@
+package org.apache.torque.gf.template.velocity;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+import java.util.Date;
+import java.util.List;
+
+import org.apache.torque.gf.control.ControllerState;
+import org.apache.torque.gf.generator.GeneratorException;
+import org.apache.torque.gf.source.SourceElement;
+import org.apache.torque.gf.variable.Variable;
+
+/**
+ * This class acts as an interface to the Torque generator from the
+ * templates. It lets the user access Torque generator properties from the
+ * templates, and allows to execute certain action from within the templates.
+ */
+public class TorqueGfVelocity
+{
+    /**
+     * The state of the controller in which this generator interface is used.
+     */
+    private ControllerState controllerState;
+
+    /**
+     * The generator in which context this class is used.
+     */
+    private VelocityGenerator generator;
+
+    /**
+     * A counter which can be used in velocity templates.
+     */
+    private static int counter = 1;
+    
+    /**
+     * Constructs a generator interface within the given controllerState.
+     *
+     * @param generator the controller state in which this
+     *        generator interface will be used, not null.
+     * @param controllerState the controller context.
+     *
+     * @throws NullPointerException if controllerState is null.
+     */
+    public TorqueGfVelocity(
+            VelocityGenerator generator,
+            ControllerState controllerState)
+    {
+        if (controllerState == null)
+        {
+            throw new NullPointerException("controllerState may not be null");
+        }
+        if (generator == null)
+        {
+            throw new NullPointerException("generator may not be null");
+        }
+        this.controllerState = controllerState;
+        this.generator = generator;
+    }
+
+    /**
+     * Processes the mergepoint with the given name.
+     *
+     * @param mergepointName the name of the mergepoint.
+     * @return the output generated by the mergepoint.
+     * @throws GeneratorException if the mergepoint could not be processed
+     *         completely.
+     */
+    public String mergepoint(String mergepointName)
+        throws GeneratorException
+    {
+        return generator.mergepoint(mergepointName, controllerState);
+    }
+
+    /**
+     * Returns the current controller state.
+     *
+     * @return The current controller state, never null.
+     */
+    public ControllerState getControllerState()
+    {
+        return controllerState;
+    }
+
+    /**
+     * Returns the current source element. This method is shorthand for
+     * <code>getControllerState().getSourceElement()</code>
+     *
+     * @return the current source element, never null.
+     */
+    public SourceElement getSourceElement()
+    {
+        return controllerState.getSourceElement();
+    }
+
+    /**
+     * Returns all children of the current source element.
+     * This method is shorthand for
+     * <code>getSourceElement().getChildren()</code>
+     *
+     * @return the children of the current source element, never null.
+     */
+    public List<SourceElement> getChildren()
+    {
+        return getSourceElement().getChildren();
+    }
+
+    /**
+     * Returns the children of the current source element with a certain name.
+     * This method is shorthand for
+     * <code>getSourceElement().getChildren(name)</code>
+     *
+     * @param name the name of the children elements to select.
+     *
+     * @return the children of the current source element with the name name,
+     *         never null.
+     */
+    public List<SourceElement> getChildren(String name)
+    {
+        return getSourceElement().getChildren(name);
+    }
+
+    /**
+     * Returns the first child of the current source element
+     * with the given name.
+     * This method is shorthand for
+     * <code>getSourceElement().getChild(name)</code>
+     *
+     * @param name the name of the child element to select.
+     *
+     * @return the first child with the given name, or null if no such child
+     *         exists.
+     */
+    public SourceElement getChild(String name)
+    {
+        return getSourceElement().getChild(name);
+    }
+
+    /**
+     * Returns the parent of the current source element.
+     * <code>getSourceElement().getParent()</code>
+     *
+     * @return the parent of the current source element, or null if the current
+     *         source element has no parent.
+     */
+    public SourceElement getParent()
+    {
+        return getSourceElement().getParent();
+    }
+
+    /**
+     * Returns the option with the given key. The key can either be a name
+     * prefixed with a namespace, or a name without namespace, in which case
+     * the namespace of the generator is used.
+     *
+     * In the case that the option is not set in this namespace, the parent
+     * namespaces are searched recursively.  If the option is not set in any
+     * of the parent namespaces, null is returned.
+     *
+     * @param key the key for the option to retrieve.
+     * @return the option for the given key.
+     */
+    public Object option(String key)
+    {
+        Object result = controllerState.getOption(key);
+
+        return result;
+    }
+
+    /**
+     * Returns the option with the given key as boolean value.
+     * The key can either be a name prefixed with a namespace,
+     * or a name without namespace, in which case the namespace of the
+     * generator is used.
+     *
+     * In the case that the option is not set in this namespace, the parent
+     * namespaces are searched recursively.  If the option is not set in any
+     * of the parent namespaces, false is returned.
+     *
+     * @param key the key for the option to retrieve.
+     * @return the option for the given key, converted to a boolean
+     */
+    public boolean booleanOption(String key)
+    {
+        boolean result = controllerState.getBooleanOption(key);
+
+        return result;
+    }
+
+    /**
+     * Returns the variable with the given key. The key can either be a name
+     * prefixed with a namespace, or a name without namespace, in which case
+     * the namespace of the generator is used.
+     *
+     * In the case that the variable is not set in this namespace, the parent
+     * namespaces are searched recursively.  If the variable is not set in any
+     * of the parent namespaces, null is returned.
+     *
+     * @param key the key for the variable to retrieve.
+     * @return the variable for the given key, or null if the variable is not
+     *         set or explicitly set to null.
+     */
+    public Object getVariable(String key)
+    {
+        return generator.getVariable(key, controllerState);
+    }
+
+    /**
+     * Sets a variable. The key can be given with or without namespace;
+     * in the latter case, the variable is set in the namespace of this
+     * generator. the Scope of the variable is this generator and its children.
+     *
+     * @param key the name of the variable, not null
+     * @param value the value of the variable, may be null.
+     *
+     * @throws NullPointerException if key or scope is null.
+     * @throws IllegalArgumentException if the key is no valid QualifiedName.
+     */
+    public void setVariable(String key, Object value)
+    {
+        generator.setVariable(key, value, controllerState);
+    }
+
+    /**
+     * Sets a variable. The key can be given with or without namespace;
+     * in the latter case, the variable is set in the namespace of this
+     * generator.
+     *
+     * @param key the name of the variable, not null.
+     * @param value the value of the variable, may be null.
+     * @param scope the scope of the variable, not null.
+     *
+     * @throws NullPointerException if key or scope is null.
+     * @throws IllegalArgumentException if the key is no valid QualifiedName.
+     */
+    public void setVariable(String key, Object value, Variable.Scope scope)
+    {
+        generator.setVariable(key, value, scope, controllerState);
+    }
+
+    /**
+     * Returns the current date.
+     *
+     * @return the current date, not null.
+     */
+    public Date now()
+    {
+        return new Date();
+    }
+
+    /**
+     * Returns a counter value which is increased each time this function is
+     * accessed. Start value is 1.
+     * If <code>resetCounter</code> is not called, the returned value is unique
+     * over the generation process.
+     *
+     * @return the counter value.
+     */
+    public static synchronized int getCounter()
+    {
+        return counter++;
+    }
+
+    /**
+     * Resets the counter accessible though <code>getCounter()</code> back to 1.
+     */
+    public static synchronized void resetCounter()
+    {
+        counter = 1;
+    }
+}

Added: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/template/velocity/VelocityGenerator.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/template/velocity/VelocityGenerator.java?rev=910600&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/template/velocity/VelocityGenerator.java (added)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/template/velocity/VelocityGenerator.java Tue Feb 16 17:15:43 2010
@@ -0,0 +1,366 @@
+package org.apache.torque.gf.template.velocity;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+import java.io.StringWriter;
+import java.io.Writer;
+import java.util.Set;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.torque.gf.configuration.ConfigurationException;
+import org.apache.torque.gf.configuration.ConfigurationProvider;
+import org.apache.torque.gf.control.ControllerState;
+import org.apache.torque.gf.generator.GeneratorException;
+import org.apache.torque.gf.option.Option;
+import org.apache.torque.gf.option.Options;
+import org.apache.torque.gf.qname.Namespace;
+import org.apache.torque.gf.qname.QualifiedName;
+import org.apache.torque.gf.qname.QualifiedNameMap;
+import org.apache.torque.gf.source.SourceElement;
+import org.apache.torque.gf.template.TemplateGeneratorImpl;
+import org.apache.torque.gf.variable.Variable;
+import org.apache.torque.gf.variable.VariableStore;
+import org.apache.velocity.VelocityContext;
+import org.apache.velocity.app.Velocity;
+import org.apache.velocity.context.Context;
+import org.apache.velocity.util.StringUtils;
+
+/**
+ * A Generator which uses a velocity template for generation.
+ */
+public class VelocityGenerator extends TemplateGeneratorImpl
+{
+    /**
+     * The name under which the Torque generator will be put
+     * into the context.
+     */
+    public static final String TORQUE_GF_CONTEXT_NAME = "torqueGf";
+
+    /**
+     * The name under which the Torque generator will be put
+     * into the context.
+     */
+    public static final String STRING_UTILS_CONTEXT_NAME = "stringUtils";
+
+    /**
+     * The key under which the null attribute of a source element is put
+     * into the context.
+     */
+    public static final String NULL_KEY_CONTEXT_NAME = "value";
+
+    /** The log. */
+    private static Log log = LogFactory.getLog(VelocityGenerator.class);
+
+    /**
+     * Whether the options should be put into the context.
+     */
+    private boolean optionsInContext = true;
+
+    /**
+     * Whether the variables should be put into the context.
+     */
+    private boolean variablesInContext = true;
+
+    /**
+     * Whether the attributes of the current source element should be put
+     * into the context.
+     */
+    private boolean sourceAttributesInContext = true;
+
+    /**
+     * Constructs a new VelocityTemplateGenerator.
+     *
+     * @param name the name of this generator, not null.
+     * @param configurationProvider the provider for reading the templates,
+     *        not null.
+     * @param path the path to the templates, not null.
+     *        May contain tokens of the form ${....}, these are parsed.
+     * @param encoding the encoding of the file, or null if the system's
+     *        default encoding should be used.
+     *
+     * @throws NullPointerException if name, path or directories are null.
+     * @throws ConfigurationException if an error occurs while reading the
+     *         template.
+     */
+    public VelocityGenerator(
+            QualifiedName name,
+            ConfigurationProvider configurationProvider,
+            String path,
+            String encoding)
+        throws ConfigurationException
+    {
+        super(name,
+              configurationProvider,
+              path,
+              encoding,
+              new VelocityTemplateFilter());
+    }
+
+    /**
+     * Tells the generator to put all options which name space is visible to
+     * the name space of this generator into the context.
+     * Only the variable names are used as keys in the context, the name spaces
+     * are stripped.
+     *
+     * @param optionsInContext whether to put the options into the context.
+     */
+    public void setOptionsInContext(boolean optionsInContext)
+    {
+        this.optionsInContext = optionsInContext;
+    }
+
+    /**
+     * Returns whether all options which name spaces are visible to
+     * the name space of this generator are put into the context.
+     *
+     * @return whether the generator puts the options into the context.
+     */
+    public boolean isOptionsInContext()
+    {
+        return optionsInContext;
+    }
+
+    /**
+     * Tells the generator to put all variables which are visible to this
+     * generator into the context.
+     * Only the variable names are used as keys in the context, the name spaces
+     * are stripped.
+     *
+     * @param variablesInContext whether to put the variables into the context.
+     */
+    public void setVariablesInContext(boolean variablesInContext)
+    {
+        this.variablesInContext = variablesInContext;
+    }
+
+    /**
+     * Returns whether all variables which are visible to this
+     * generator are put into the context.
+     *
+     * @return whether the generator puts the variables into the context.
+     */
+    public boolean isVariablesInContext()
+    {
+        return variablesInContext;
+    }
+
+    /**
+     * Tells the generator to put the attributes of the current source element
+     * into the context or not.
+     *
+     * @param sourceAttributesInContext whether to put the source attributes
+     *        into the context.
+     */
+    public void setSourceAttributesInContext(
+            boolean sourceAttributesInContext)
+    {
+        this.sourceAttributesInContext = sourceAttributesInContext;
+    }
+
+    /**
+     * Returns whether the attributes of the current source element
+     * are put into the context.
+     *
+     * @return whether the generator puts the attributes of the current source
+     *         element into the context.
+     */
+    public boolean isSourceAttributesInContext()
+    {
+        return sourceAttributesInContext;
+    }
+
+    /**
+     * Executes the generation process; the result is returned.
+     *
+     * @param controllerState the current controller state.
+     *
+     * @return the result of the generation, not null.
+     *
+     * @see org.apache.torque.gf.generator.Generator#execute(ControllerState)
+     */
+    @Override
+    public String execute(ControllerState controllerState)
+        throws GeneratorException
+
+    {
+        if (log.isDebugEnabled())
+        {
+            log.debug("Start executing VelocityGenerator " + getName());
+        }
+        controllerState.getVariableStore().startGenerator();
+
+        try
+        {
+            try
+            {
+                Velocity.init();
+            }
+            catch (Exception e)
+            {
+                throw new GeneratorException(
+                        "Could not initialize velocity",
+                        e);
+            }
+
+            SourceElement sourceElement = controllerState.getSourceElement();
+
+            String inputElementName = getInputElementName();
+            if (inputElementName != null
+                    && !inputElementName.equals(sourceElement.getName()))
+            {
+                throw new GeneratorException("Input element name, "
+                        + sourceElement.getName()
+                        + ", is not the expected name, "
+                        + getInputElementName()
+                        + ", for generator "
+                        + getName());
+            }
+
+            Context context = createVelocityContext(controllerState);
+
+            Writer writer = new StringWriter();
+            try
+            {
+                Velocity.evaluate(context, writer,
+                        "VelocityTemplateGenerator:" + getName(),
+                        getContent(controllerState));
+                writer.flush();
+                writer.close();
+            }
+            catch (Exception e)
+            {
+                log.error("error during execution of generator "
+                            + getName()
+                            + " : " + e.getMessage(),
+                        e);
+                throw new GeneratorException(
+                        "Error during execution of generator "
+                            + getName()
+                            + " : "
+                            + e.getMessage(),
+                        e);
+            }
+
+            return writer.toString();
+        }
+        finally
+        {
+            controllerState.getVariableStore().endGenerator();
+            if (log.isDebugEnabled())
+            {
+                log.debug("End executing VelocityGenerator " + getName());
+            }
+        }
+    }
+
+    /**
+     * Creates the velocity context for the generator.
+     *
+     * @param controllerState the controller state, not null.
+     * @return
+     */
+    private Context createVelocityContext(
+            ControllerState controllerState)
+    {
+        Context context = new VelocityContext();
+        context.put(
+                TORQUE_GF_CONTEXT_NAME,
+                new TorqueGfVelocity(this, controllerState));
+        context.put(
+                STRING_UTILS_CONTEXT_NAME,
+                new StringUtils());
+
+        if (optionsInContext)
+        {
+            // Only consider options visible from the current namespace.
+            Options visibleOptions
+                    = controllerState.getVisibleOptions();
+            for (Option option : visibleOptions.values())
+            {
+                QualifiedName qualifiedName = option.getQualifiedName();
+                context.put(qualifiedName.getName(), option.getValue());
+            }
+            log.debug("Put options in context " + visibleOptions.keySet());
+        }
+        else
+        {
+            log.debug("options in context are disabled");
+        }
+
+        SourceElement sourceElement = controllerState.getSourceElement();
+        if (sourceAttributesInContext)
+        {
+            Set<String> attributes = sourceElement.getAttributeNames();
+            for (String key : attributes)
+            {
+                Object value = sourceElement.getAttribute(key);
+                if (key == null)
+                {
+                    // The null key cannot be accessed in the context.
+                    // So if the attribute NULL_KEY_CONTEXT_NAME does not
+                    // exist, use this as attribute name.
+                    if (sourceElement.getAttributeNames().contains(
+                            NULL_KEY_CONTEXT_NAME))
+                    {
+                        continue;
+                    }
+                    key = NULL_KEY_CONTEXT_NAME;
+                }
+                context.put(key, value);
+            }
+            log.debug("Put attributes in context " + attributes);
+        }
+        else
+        {
+            log.debug("source attributes in context are disabled");
+        }
+
+        if (variablesInContext)
+        {
+            // Only consider variables visible from the namespace
+            // of this generator. If a name exists in different
+            // namespaces visible from this namespace,
+            // only consider the most significant name.
+            Namespace namespace = getName().getNamespace();
+            VariableStore variableStore
+                    = controllerState.getVariableStore();
+            QualifiedNameMap<Variable> visibleVariables
+                    = variableStore
+                        .getContent()
+                        .getInHierarchy(namespace);
+            for (Variable variable : visibleVariables.values())
+            {
+                QualifiedName qualifiedName = variable.getName();
+                context.put(
+                        qualifiedName.getName(),
+                        variable.getValue());
+            }
+            log.debug("Put variables in context "
+                    + visibleVariables.keySet());
+        }
+        else
+        {
+            log.debug("variables in context are disabled");
+        }
+
+        return context;
+    }
+}

Added: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/template/velocity/VelocityGeneratorState.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/template/velocity/VelocityGeneratorState.java?rev=910600&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/template/velocity/VelocityGeneratorState.java (added)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/template/velocity/VelocityGeneratorState.java Tue Feb 16 17:15:43 2010
@@ -0,0 +1,52 @@
+package org.apache.torque.gf.template.velocity;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+import org.apache.velocity.context.Context;
+
+/**
+ * The generator state of a velocity template generator.
+ */
+public class VelocityGeneratorState
+{
+    /**
+     * The velocity context which is currently used.
+     */
+    private Context context;
+
+    /**
+     * Returns the current velocity context.
+     *
+     * @return the current velocity context.
+     */
+    public Context getContext()
+    {
+        return context;
+    }
+
+    /**
+     * Sets the current velocity context.
+     * @param context the current velocity context.
+     */
+    public void setContext(Context context)
+    {
+        this.context = context;
+    }
+}

Added: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/template/velocity/VelocityTemplateFilter.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/template/velocity/VelocityTemplateFilter.java?rev=910600&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/template/velocity/VelocityTemplateFilter.java (added)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/template/velocity/VelocityTemplateFilter.java Tue Feb 16 17:15:43 2010
@@ -0,0 +1,147 @@
+package org.apache.torque.gf.template.velocity;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+import java.io.BufferedReader;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
+
+import org.apache.torque.gf.template.TemplateFilter;
+
+/**
+ * A Filter for velocity templates. It has the effect of beautifying the output
+ * of the velocity generator.
+ */
+public class VelocityTemplateFilter implements TemplateFilter
+{
+    /**
+     * With which String tabs should be replaced
+     */
+    private String tabReplacement = "    ";
+
+    /**
+     * This method filters the template and replaces some
+     * unwanted characters. For example it removes leading
+     * spaces in front of velocity commands and replaces
+     * tabs with spaces to prevent bounces in different
+     * code editors with different tab-width-setting.
+     *
+     * @param resource the input stream to filter
+     *
+     * @return the filtered input stream.
+     *
+     * @throws IOException if creating, reading or writing to a stream fails.
+     */
+    public InputStream filter(InputStream resource, String encoding)
+            throws IOException
+    {
+        InputStreamReader streamReader;
+        if (encoding == null)
+        {
+            streamReader = new InputStreamReader(resource);
+        }
+        else
+        {
+            streamReader = new InputStreamReader(resource, encoding);
+        }
+        BufferedReader bufferedReader = new BufferedReader(streamReader);
+        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
+        Writer outputStreamWriter = null;
+        if (encoding == null)
+        {
+            outputStreamWriter = new OutputStreamWriter(outputStream);
+        }
+        else
+        {
+            outputStreamWriter = new OutputStreamWriter(outputStream, encoding);
+        }
+
+        boolean onlySpacesInLineSoFar = true;
+        StringBuilder startLineBuffer = new StringBuilder();
+        while (true)
+        {
+            int readChar = bufferedReader.read();
+
+            if (readChar == -1)
+            {
+                break;
+            }
+            if (!onlySpacesInLineSoFar)
+            {
+                outputStreamWriter.write(readChar);
+                if ('\r' == readChar || '\n' == readChar)
+                {
+                    onlySpacesInLineSoFar = true;
+                }
+            }
+            else
+            {
+                if (' ' == readChar)
+                {
+                    startLineBuffer.append((char) readChar);
+                }
+                else if ('\t' == readChar)
+                {
+                    startLineBuffer.append(tabReplacement);
+                }
+                else if ('#' == readChar)
+                {
+                    if (startLineBuffer.length() != 0)
+                    {
+                        startLineBuffer = new StringBuilder();
+                    }
+                    outputStreamWriter.write(readChar);
+                    onlySpacesInLineSoFar = false;
+                }
+                else if ('\r' == readChar || '\n' == readChar)
+                {
+                    if (startLineBuffer.length() != 0)
+                    {
+                        outputStreamWriter.write(startLineBuffer.toString());
+                        startLineBuffer = new StringBuilder();
+                    }
+                    outputStreamWriter.write(readChar);
+                }
+                else
+                {
+                    if (startLineBuffer.length() != 0)
+                    {
+                        outputStreamWriter.write(startLineBuffer.toString());
+                        startLineBuffer = new StringBuilder();
+                    }
+                    outputStreamWriter.write(readChar);
+                    onlySpacesInLineSoFar = false;
+
+                 }
+            }
+        }
+        outputStreamWriter.write(startLineBuffer.toString());
+
+        outputStreamWriter.flush();
+        outputStreamWriter.close();
+
+        return new ByteArrayInputStream(outputStream.toByteArray());
+    }
+}

Added: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/template/velocity/package.html
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/template/velocity/package.html?rev=910600&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/template/velocity/package.html (added)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/template/velocity/package.html Tue Feb 16 17:15:43 2010
@@ -0,0 +1,25 @@
+<!--
+ Copyright 2001-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.
+-->
+<html>
+  <head>
+    <title>Torque-gf v elocity generators</title>
+  </head>
+  <body>
+    <p>
+      This package contains the handling of velocity generators in Torque-gf.
+    </p>
+  </body>
+</html>

Added: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/variable/Variable.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/variable/Variable.java?rev=910600&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/variable/Variable.java (added)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/variable/Variable.java Tue Feb 16 17:15:43 2010
@@ -0,0 +1,218 @@
+package org.apache.torque.gf.variable;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+import org.apache.torque.gf.qname.QualifiedName;
+
+/**
+ * A variable which can be used to transport data in and between
+ * generators.
+ * A variable has a name (possibly with a name space),
+ * a value (which may be null),
+ * and a scope (determining in which generators this variable will be visible).
+ * if the scope is <code>CHILDREN</code>, the generator in which this
+ * variable was set is also stored in the variable.
+ */
+public class Variable
+{
+    /**
+     * The scope of a variable.
+     */
+    public enum Scope
+    {
+        /**
+         * The scope of the variable is limited to the current generator.
+         */
+        GENERATOR,
+        /**
+         * The scope of the variable is the current generator and
+         * recursively all the generators in the merge points accessed
+         * in the generation process.
+         */
+        CHILDREN,
+        /**
+         * The variable is visible throughout the generation process of this
+         * file.
+         */
+        FILE,
+        /**
+         * The variable is visible throughout the whole generation process.
+         */
+        GLOBAL
+    }
+
+    /**
+     * The name of the variable.
+     */
+    private QualifiedName name;
+
+    /**
+     * The value fo the variable. May be null.
+     */
+    private Object value;
+
+    /**
+     * The scope of this variable. Is never null.
+     */
+    private Scope scope;
+
+    /**
+     * Constructor.
+     *
+     * @param name the name of the variable, not null.
+     * @param value the value of the variable.
+     * @param scope the scope of the variable, not null.
+     */
+    public Variable(
+            QualifiedName name,
+            Object value,
+            Scope scope)
+    {
+        if (name == null)
+        {
+            throw new NullPointerException("name must not be null");
+        }
+        if (scope == null)
+        {
+            throw new NullPointerException("scope must not be null");
+        }
+        this.name = name;
+        this.value = value;
+        this.scope = scope;
+    }
+
+    /**
+     * Returns the name of the variable.
+     *
+     * @return the name of the variable, not null.
+     */
+    public QualifiedName getName()
+    {
+        return name;
+    }
+
+    /**
+     * Returns the value of the variable,
+     * @return the value of the variable, may be null.
+     */
+    public Object getValue()
+    {
+        return value;
+    }
+
+    /**
+     * Sets the value of the variable.
+     *
+     * @param value the value to set in the variable.
+     */
+    public void setValue(Object value)
+    {
+        this.value = value;
+    }
+
+    /**
+     * Returns the scope of the variable.
+     *
+     * @return the scope of the variable, not null.
+     */
+    public Scope getScope()
+    {
+        return scope;
+    }
+
+    @Override
+    public int hashCode()
+    {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + ((name == null) ? 0 : name.hashCode());
+        result = prime * result + ((scope == null) ? 0 : scope.hashCode());
+        result = prime * result + ((value == null) ? 0 : value.hashCode());
+        return result;
+    }
+
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (this == obj)
+        {
+            return true;
+        }
+        if (obj == null)
+        {
+            return false;
+        }
+        if (getClass() != obj.getClass())
+        {
+            return false;
+        }
+
+        final Variable other = (Variable) obj;
+
+        if (name == null)
+        {
+            if (other.name != null)
+            {
+                return false;
+            }
+        }
+        else if (!name.equals(other.name))
+        {
+            return false;
+        }
+
+        if (scope == null)
+        {
+            if (other.scope != null)
+            {
+                return false;
+            }
+        }
+        else if (!scope.equals(other.scope))
+        {
+            return false;
+        }
+
+        if (value == null)
+        {
+            if (other.value != null)
+            {
+                return false;
+            }
+        }
+        else if (!value.equals(other.value))
+        {
+            return false;
+        }
+
+        return true;
+    }
+
+    @Override
+    public String toString()
+    {
+        StringBuilder result = new StringBuilder();
+        result.append("(name=").append(name)
+              .append(", value=").append(value)
+              .append(", scope=").append(scope)
+              .append(")");
+        return result.toString();
+    }
+}

Added: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/variable/VariableStore.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/variable/VariableStore.java?rev=910600&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/variable/VariableStore.java (added)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/variable/VariableStore.java Tue Feb 16 17:15:43 2010
@@ -0,0 +1,284 @@
+package org.apache.torque.gf.variable;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+import java.util.LinkedList;
+
+import org.apache.torque.gf.qname.Namespace;
+import org.apache.torque.gf.qname.QualifiedName;
+import org.apache.torque.gf.qname.QualifiedNameMap;
+
+/**
+ * Stores all variables which are currently accessible.
+ */
+public class VariableStore
+{
+    /**
+     * contains all variables with the scope
+     * <code>Variable.Scope.GENERATOR<code>.
+     */
+    private QualifiedNameMap<Variable> generatorScope
+            = new QualifiedNameMap<Variable>();
+
+    /**
+     * contains all variables with the scope
+     * <code>Variable.Scope.CHILDREN<code>.
+     * The QualifiedNameMap with the largest index contains the variables added
+     * in the current generator, and with descending index the variables added
+     * to the respective calling generators.
+     */
+    private LinkedList<QualifiedNameMap<Variable>> childrenScopeList
+            = new LinkedList<QualifiedNameMap<Variable>>();
+
+    /**
+     * contains all variables with the scope
+     * <code>Variable.Scope.FILE<code>.
+     */
+    private QualifiedNameMap<Variable> fileScope
+            = new QualifiedNameMap<Variable>();
+
+    /**
+     * contains all variables with the scope
+     * <code>Variable.Scope.GLOBAL<code>.
+     */
+    private QualifiedNameMap<Variable> globalScope
+            = new QualifiedNameMap<Variable>();
+
+    /**
+     * Sets a variable.
+     *
+     * @param variable the variable to set.
+     *
+     * @throws NullPointerException if variable is null.
+     */
+    public void set(Variable variable)
+    {
+        if (Variable.Scope.GENERATOR.equals(variable.getScope()))
+        {
+            generatorScope.put(variable.getName(), variable);
+        }
+        else if (Variable.Scope.CHILDREN.equals(variable.getScope()))
+        {
+            QualifiedNameMap<Variable> qualifiedNameMap
+                = childrenScopeList.getLast();
+            qualifiedNameMap.put(variable.getName(), variable);
+        }
+        else if (Variable.Scope.FILE.equals(variable.getScope()))
+        {
+            fileScope.put(variable.getName(), variable);
+        }
+        else if (Variable.Scope.GLOBAL.equals(variable.getScope()))
+        {
+            globalScope.put(variable.getName(), variable);
+        }
+    }
+
+    /**
+     * removes a variable from the store.
+     *
+     * @param variable the variable to remove, not null.
+     *
+     * @throws NullPointerException if variable is null.
+     */
+    public void remove(Variable variable)
+    {
+        if (Variable.Scope.GENERATOR.equals(variable.getScope()))
+        {
+            generatorScope.remove(variable.getName());
+        }
+        else if (Variable.Scope.CHILDREN.equals(variable.getScope()))
+        {
+            QualifiedNameMap<Variable> qualifiedNameMap
+                = childrenScopeList.getLast();
+            qualifiedNameMap.remove(variable.getName());
+        }
+        else if (Variable.Scope.FILE.equals(variable.getScope()))
+        {
+            fileScope.remove(variable.getName());
+        }
+        else if (Variable.Scope.GLOBAL.equals(variable.getScope()))
+        {
+            globalScope.remove(variable.getName());
+        }
+    }
+
+    /**
+     * Signals this store that the processing of a generator has ended.
+     * Removes all variables with the scope
+     * <code>Variable.Scope.GENERATOR</code>,
+     * and all variables with the scope <code>Variable.Scope.CHILDREN</code>
+     * which were set by the generator which processing ended.
+     */
+    public void startGenerator()
+    {
+        childrenScopeList.addLast(new QualifiedNameMap<Variable>());
+    }
+
+    /**
+     * Signals this store that the processing of a generator has ended.
+     * Removes all variables with the scope
+     * <code>Variable.Scope.GENERATOR</code>,
+     * and all variables with the scope <code>Variable.Scope.CHILDREN</code>
+     * which were set by the generator which processing ended.
+     */
+    public void endGenerator()
+    {
+        generatorScope.clear();
+        childrenScopeList.removeLast();
+    }
+
+    /**
+     * Signals this store that the processing of one file has ended.
+     * Removes all variables with the scope <code>FILE</code>.
+     */
+    public void endFile()
+    {
+        fileScope.clear();
+    }
+
+    /**
+     * Signals this store that generation has ended. Removes the variables
+     * from all scopes.
+     */
+    public void endGeneration()
+    {
+        clear();
+    }
+
+    /**
+     * Removes all variables from this store.
+     */
+    public void clear()
+    {
+        generatorScope.clear();
+        childrenScopeList.clear();
+        fileScope.clear();
+        globalScope.clear();
+    }
+
+    /**
+     * Returns a map with the variables contained in this store.
+     * Note that if one variable is hidden by another with a more specific
+     * scope, only the variable with the more specific scope is returned.
+     * <p>
+     * The Map is not backed by this stores, i.e. adding and removing
+     * variables to the returned nmap has no effect on this store.
+     * However, the variables in the returned map are the variables in this
+     * store, i.e. setting the value of the variable will change the variable
+     * in this store.
+     * <p>
+     * Note: The current store content is rebuilt each time this method is
+     * called. For this reason, <code>store.getInHierarchy(qualifiedName)</code>
+     * is much faster than <code>store.getContent().get(qualifiedName)<code>.
+     *
+     * @return a map with the variables contained ins this store, never null.
+     */
+    public QualifiedNameMap<Variable> getContent()
+    {
+        QualifiedNameMap<Variable> result = new QualifiedNameMap<Variable>();
+        result.putAll(globalScope);
+        result.putAll(fileScope);
+
+        for (QualifiedNameMap<Variable> childrenScope : childrenScopeList)
+        {
+            result.putAll(childrenScope);
+        }
+
+        result.putAll(generatorScope);
+
+        return result;
+    }
+
+    /**
+     * Returns the most specific variable which is visible from the key's
+     * namespace and has the same name as the key's name.
+     *
+     * if several most specific variables are found in the different scopes,
+     * the one with the most specific scope is returned.
+     *
+     * @param key The key for the variable.
+     * @return the most specific matching variable, or null if no variable
+     *         matches.
+     */
+    public Variable getInHierarchy(QualifiedName key)
+    {
+        Variable inGeneratorScope = generatorScope.getInHierarchy(key);
+        Variable inFileScope = fileScope.getInHierarchy(key);
+        Variable inGenerationScope = globalScope.getInHierarchy(key);
+
+        // look through children, with precedence to the generators which
+        // started later
+        Variable result = null;
+        for (QualifiedNameMap<Variable> childrenScope : childrenScopeList)
+        {
+            Variable inChildrenScope = childrenScope.getInHierarchy(key);
+            result = getMoreSpecific(inChildrenScope, result);
+        }
+        result = getMoreSpecific(inGeneratorScope, result);
+        result = getMoreSpecific(result, inFileScope);
+        result = getMoreSpecific(result, inGenerationScope);
+        return result;
+    }
+
+    /**
+     * Returns the more specific variable out of two variables (the variable
+     * which hides the other variable).
+     *
+     * If one of the two variables is null, the other is returned.
+     * If both variables is null, null is returned.
+     * If both variables are in the same namespace, variable1 is returned.
+     *
+     * It is assumed that variable1 is in an ancestor namespace of
+     * variable2 or that variable 2 is in an ancestor namespace of
+     * variable1 or both variables are in the same namespace.
+     *
+     * @param variable1 the first variable to compare.
+     * @param variable2 the second variable to compare.
+     * @return the more specific variable, or null if both variable1 and
+     *         variable2 are null.
+     *
+     */
+    private Variable getMoreSpecific(Variable variable1, Variable variable2)
+    {
+        if (variable1 == null)
+        {
+            return variable2;
+        }
+        if (variable2 == null)
+        {
+            return variable1;
+        }
+        Namespace variable1Namespace
+                = variable1.getName().getNamespace();
+        Namespace variable2Namespace
+                = variable2.getName().getNamespace();
+        if (variable2Namespace.isVisibleFrom(variable1Namespace))
+        {
+            // variable1 is more specific or in the same naemspace
+            // as variable2, so return variable1
+            return variable1;
+        }
+        else
+        {
+            // variable2 is more specific than variable1
+            return variable2;
+        }
+    }
+}

Added: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/variable/package.html
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/variable/package.html?rev=910600&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/variable/package.html (added)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/variable/package.html Tue Feb 16 17:15:43 2010
@@ -0,0 +1,25 @@
+<!--
+ Copyright 2001-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.
+-->
+<html>
+  <head>
+    <title>Torque-gf variables</title>
+  </head>
+  <body>
+    <p>
+      This package contains the variable handling in Torque-gf.
+    </p>
+  </body>
+</html>

Added: db/torque/torque4/trunk/torque-generator/src/main/resources/org/apache/torque/gf/configuration/configuration.xsd
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/resources/org/apache/torque/gf/configuration/configuration.xsd?rev=910600&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/resources/org/apache/torque/gf/configuration/configuration.xsd (added)
+++ db/torque/torque4/trunk/torque-generator/src/main/resources/org/apache/torque/gf/configuration/configuration.xsd Tue Feb 16 17:15:43 2010
@@ -0,0 +1,137 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you 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.
+-->
+
+<schema xmlns="http://www.w3.org/2001/XMLSchema" 
+    xmlns:configuration="http://db.apache.org/torque/gf/4.0/configuration"
+    targetNamespace="http://db.apache.org/torque/gf/4.0/configuration"
+    elementFormDefault="qualified"
+    attributeFormDefault="unqualified">
+
+  <!--  use HTTP location, will be resolved locally by entity resolver -->
+  <include schemaLocation="http://db.apache.org/torque/gf/4.0/generator.xsd"/>
+
+  <simpleType name="loglevelType">
+    <restriction base="string">
+      <enumeration value="trace"/>
+      <enumeration value="debug"/>
+      <enumeration value="info"/>
+      <enumeration value="warn"/>
+      <enumeration value="error"/>
+    </restriction>
+  </simpleType>
+  
+  <complexType name="baseOptions" abstract="true">
+    <annotation>
+      <documentation>
+        A reference to a options file.
+      </documentation>
+    </annotation>
+  </complexType>
+
+  <complexType name="xmlOptions">
+    <complexContent>
+      <extension base="configuration:baseOptions">
+        <sequence>
+          <any processContents="skip" minOccurs="0" maxOccurs="unbounded"/>
+        </sequence>
+        <attribute name="path" type="string" use="required"/>
+      </extension>
+    </complexContent>
+  </complexType>
+
+  <complexType name="propertiesOptions">
+    <complexContent>
+      <extension base="configuration:baseOptions">
+        <sequence>
+          <any processContents="skip" minOccurs="0" maxOccurs="unbounded"/>
+        </sequence>
+        <attribute name="path" type="string" use="required"/>
+      </extension>
+    </complexContent>
+  </complexType>
+
+  <complexType name="output">
+    <sequence>
+      <element name="filenameGenerator" type="configuration:baseGenerator" minOccurs="0"/>
+      <element name="source"/>
+      <element name="generator" type="configuration:generatorReference"/>
+    </sequence>
+    <attribute name="name" type="string" use="required">
+      <annotation>
+        <documentation>
+          The name by which this output can be identified.
+          Must be unique over one project.
+        </documentation>
+      </annotation>
+    </attribute>
+    <attribute name="file" type="string" use="optional">
+      <annotation>
+        <documentation>
+          This attribute contains the name of the generated file.
+          Relative paths are relative to the target directory.
+          If the file name is not fixed, omit this attribute and use
+          the child element filenameGenerator instead.
+        </documentation>
+      </annotation>
+    </attribute>
+    <attribute name="skipIfExists" type="boolean" use="optional">
+      <annotation>
+        <documentation>
+          If set to true, the file will be skipped if it already exists.
+          Default is false.
+        </documentation>
+      </annotation>
+    </attribute>
+  </complexType>
+  
+  <complexType name="source">
+    <sequence>
+      <element name="transformer" type="configuration:transformer" minOccurs="0" maxOccurs="unbounded"/>
+    </sequence>
+    <attribute name="type" type="string" use="optional"/>
+    <attribute name="path" type="string" use="required"/>
+  </complexType>
+  
+  <complexType name="transformer">
+    <attribute name="class" type="string" use="required"/>
+    <attribute name="elements" type="string" use="optional"/>
+  </complexType>
+
+  <complexType name="generatorReference">
+    <attribute name="name" type="string" use="required"/>
+  </complexType>
+
+  <element name="control">
+    <complexType>
+      <sequence>
+        <element name="options" type="configuration:baseOptions" minOccurs="0" maxOccurs="unbounded"/>
+        <element name="output" type="configuration:output" minOccurs="0" maxOccurs="unbounded"/>
+      </sequence>
+      <attribute name="loglevel" type="configuration:loglevelType" use="optional">
+        <annotation>
+          <documentation>
+            The loglevel defines the log level during the generation process.
+            The default loglevel is info.
+          </documentation>
+        </annotation>
+      </attribute>
+    </complexType>
+  </element>
+</schema>
\ No newline at end of file

Added: db/torque/torque4/trunk/torque-generator/src/main/resources/org/apache/torque/gf/configuration/generator.xsd
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/resources/org/apache/torque/gf/configuration/generator.xsd?rev=910600&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/resources/org/apache/torque/gf/configuration/generator.xsd (added)
+++ db/torque/torque4/trunk/torque-generator/src/main/resources/org/apache/torque/gf/configuration/generator.xsd Tue Feb 16 17:15:43 2010
@@ -0,0 +1,145 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you 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.
+-->
+
+<schema xmlns="http://www.w3.org/2001/XMLSchema" 
+    xmlns:configuration="http://db.apache.org/torque/gf/4.0/configuration"
+    targetNamespace="http://db.apache.org/torque/gf/4.0/configuration"
+    elementFormDefault="qualified"
+    attributeFormDefault="unqualified">
+
+  <element name="generators">
+    <complexType>
+      <sequence>
+        <element name="generator" type="configuration:baseGenerator" maxOccurs="unbounded"/>
+        <!-- 
+          The mergepoints defined here must be fully qualified with the name of the generator.
+          The mergepoint must already be known at this time. This is only ensured if the
+          generator is defined in the same file (then the definition of the mergepoint
+          outside the generator does not make sense) or in a parent module.
+          The mergepoint definition here overrides any previous definition.
+         -->
+        <element name="mergepoint" type="configuration:mergepoint" minOccurs="0" maxOccurs="unbounded"/>
+      </sequence>
+    </complexType>
+  </element>
+
+  <complexType name="baseGenerator" abstract="true">
+    <sequence>
+      <element name="input" type="configuration:input" minOccurs="0"/>
+      <element name="mergepoint" type="configuration:mergepoint" minOccurs="0" maxOccurs="unbounded" />
+    </sequence>
+    <!--  
+      name is optional in filenameGenerators but required in normal generators.
+      However, this can not be  forced here, so use is set to optional.
+    -->
+    <attribute name="name" type="string" use="optional"/>
+  </complexType>
+
+  <complexType name="javaGenerator">
+    <complexContent>
+      <extension base="configuration:baseGenerator">
+        <sequence>
+          <any processContents="skip" minOccurs="0" maxOccurs="unbounded"/>
+        </sequence>
+        <attribute name="class" type="string" use="required"/>
+      </extension>
+    </complexContent>
+  </complexType>
+
+  <complexType name="velocityGenerator">
+    <complexContent>
+      <extension base="configuration:baseGenerator">
+        <attribute name="path" type="string" use="required"/>
+        <attribute name="optionsInContext" type="string" use="optional"/>
+        <attribute name="sourceAttributesInContext" type="string" use="optional"/>
+        <attribute name="variablesInContext" type="string" use="optional"/>
+      </extension>
+    </complexContent>
+  </complexType>
+  
+  <!-- not yet implemented -->
+  <complexType name="xalanGenerator">
+    <complexContent>
+      <extension base="configuration:baseGenerator">
+        <attribute name="path" type="string" use="required"/>
+      </extension>
+    </complexContent>
+  </complexType>
+  
+  <complexType name="input">
+    <attribute name="elementName" use="required" />
+  </complexType>
+
+  <complexType name="mergepoint">
+    <sequence>
+      <element name="action" type="configuration:baseAction" minOccurs="0" maxOccurs="unbounded" /> 
+    </sequence>
+    <attribute name="name" use="required" />
+  </complexType>
+
+  <complexType name="baseAction" abstract="true">
+  </complexType>
+
+  <complexType name="applyAction">
+    <complexContent>
+      <extension base="configuration:baseAction">
+        <attribute name="generator" type="string" use="required"/>
+        <attribute name="acceptNotSet" type="boolean" use="optional"/>
+      </extension>
+    </complexContent>
+  </complexType>
+
+  <complexType name="optionAction">
+    <complexContent>
+      <extension base="configuration:baseAction">
+        <attribute name="option" type="string" use="required"/>
+        <attribute name="acceptNotSet" type="boolean" use="optional"/>
+      </extension>
+    </complexContent>
+  </complexType>
+
+  <complexType name="outputAction">
+    <complexContent>
+      <extension base="configuration:baseAction">
+        <attribute name="value" type="string" use="required"/>
+      </extension>
+    </complexContent>
+  </complexType>
+
+  <complexType name="sourceElementAttributeAction">
+    <complexContent>
+      <extension base="configuration:baseAction">
+        <attribute name="element" type="string" use="required"/>
+        <attribute name="attribute" type="string" use="optional"/>
+        <attribute name="acceptNotSet" type="boolean" use="optional"/>
+      </extension>
+    </complexContent>
+  </complexType>
+
+  <complexType name="traverseAllAction">
+    <complexContent>
+      <extension base="configuration:baseAction">
+        <attribute name="element" type="string" use="required"/>
+        <attribute name="generator" type="string" use="required"/>
+      </extension>
+    </complexContent>
+  </complexType>
+
+</schema>
\ No newline at end of file

Added: db/torque/torque4/trunk/torque-generator/src/main/resources/org/apache/torque/gf/log4j.properties
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/resources/org/apache/torque/gf/log4j.properties?rev=910600&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/resources/org/apache/torque/gf/log4j.properties (added)
+++ db/torque/torque4/trunk/torque-generator/src/main/resources/org/apache/torque/gf/log4j.properties Tue Feb 16 17:15:43 2010
@@ -0,0 +1,28 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you 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.
+
+log4j.rootLogger = INFO, generator, console
+
+log4j.appender.generator = org.apache.log4j.FileAppender
+log4j.appender.generator.file = target/torque-gf/log/generator.log
+log4j.appender.generator.append = true
+log4j.appender.generator.layout = org.apache.log4j.PatternLayout
+log4j.appender.generator.layout.conversionPattern = %d [%t] %-5p %c - %m%n
+
+log4j.appender.console = org.apache.log4j.ConsoleAppender
+log4j.appender.console.layout = org.apache.log4j.PatternLayout
+log4j.appender.console.layout.conversionPattern = %-5p %c - %m%n

Added: db/torque/torque4/trunk/torque-generator/src/maven-plugin-config/checkstyle/checkstyle-license.txt
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/maven-plugin-config/checkstyle/checkstyle-license.txt?rev=910600&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/maven-plugin-config/checkstyle/checkstyle-license.txt (added)
+++ db/torque/torque4/trunk/torque-generator/src/maven-plugin-config/checkstyle/checkstyle-license.txt Tue Feb 16 17:15:43 2010
@@ -0,0 +1,20 @@
+
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message