portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From morci...@apache.org
Subject cvs commit: jakarta-jetspeed/xdocs changes.xml
Date Thu, 27 Mar 2003 21:26:37 GMT
morciuch    2003/03/27 13:26:37

  Modified:    docs/site changes.html
               src/java/org/apache/jetspeed/util OverwriteProperties.java
               src/java/org/apache/jetspeed/util/ant
                        OverwritePropertiesTask.java
               xdocs    changes.xml
  Log:
  Minor changes to OverwriteProperties ant task (check style + added failonerror property).
Patch by Eric Pugh (see Bugzilla issue# 16551).
  
  Revision  Changes    Path
  1.123     +10 -0     jakarta-jetspeed/docs/site/changes.html
  
  Index: changes.html
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/docs/site/changes.html,v
  retrieving revision 1.122
  retrieving revision 1.123
  diff -u -r1.122 -r1.123
  --- changes.html	26 Mar 2003 16:36:30 -0000	1.122
  +++ changes.html	27 Mar 2003 21:26:36 -0000	1.123
  @@ -133,6 +133,16 @@
   </li>
   -->
   <li>
  +  Add -   Bug # 16551 - 2003/03/27 - Minor fixes to OverwritePproperties ant task, patch
by Eric Pugh. (MO)
  +</li>
  +<li>
  +  Add -   Bug # 18208 - 2003/03/27 - Added "skinning" capability to action icons. (STW)
  +</li>
  +<li>
  +  Fix -   Bug # 18304 - 2003/03/27 - Fixed issue with JetspeedTemplateLocatorService not
recognizing the
  +  "default.layout.template" property of the respective TemplateEngineService. (STW)
  +</li>	
  +<li>
     Fix -   Bug # 18346 - 2003/03/26 - Hide 'Create New Account' on login screen if topnav.user_creation.enable
is false  (MO)
   </li>
   <li>
  
  
  
  1.3       +198 -162  jakarta-jetspeed/src/java/org/apache/jetspeed/util/OverwriteProperties.java
  
  Index: OverwriteProperties.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/util/OverwriteProperties.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- OverwriteProperties.java	12 Feb 2003 01:17:27 -0000	1.2
  +++ OverwriteProperties.java	27 Mar 2003 21:26:37 -0000	1.3
  @@ -1,107 +1,106 @@
  -/* ====================================================================
  - * The Apache Software License, Version 1.1
  +/*
  + *  ====================================================================
  + *  The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2000-2001 The Apache Software Foundation.  All rights
  - * reserved.
  + *  Copyright (c) 2000-2001 The Apache Software Foundation.  All rights
  + *  reserved.
    *
  - * Redistribution and use in source and binary forms, with or without
  - * modification, are permitted provided that the following conditions
  - * are met:
  + *  Redistribution and use in source and binary forms, with or without
  + *  modification, are permitted provided that the following conditions
  + *  are met:
    *
  - * 1. Redistributions of source code must retain the above copyright
  - *    notice, this list of conditions and the following disclaimer.
  + *  1. Redistributions of source code must retain the above copyright
  + *  notice, this list of conditions and the following disclaimer.
    *
  - * 2. Redistributions in binary form must reproduce the above copyright
  - *    notice, this list of conditions and the following disclaimer in
  - *    the documentation and/or other materials provided with the
  - *    distribution.
  + *  2. Redistributions in binary form must reproduce the above copyright
  + *  notice, this list of conditions and the following disclaimer in
  + *  the documentation and/or other materials provided with the
  + *  distribution.
    *
  - * 3. The end-user documentation included with the redistribution,
  - *    if any, must include the following acknowledgment:
  - *       "This product includes software developed by the
  - *        Apache Software Foundation (http://www.apache.org/)."
  - *    Alternately, this acknowledgment may appear in the software itself,
  - *    if and wherever such third-party acknowledgments normally appear.
  + *  3. The end-user documentation included with the redistribution,
  + *  if any, must include the following acknowledgment:
  + *  "This product includes software developed by the
  + *  Apache Software Foundation (http://www.apache.org/)."
  + *  Alternately, this acknowledgment may appear in the software itself,
  + *  if and wherever such third-party acknowledgments normally appear.
    *
  - * 4. The names "Apache" and "Apache Software Foundation" and
  - *     "Apache Jetspeed" must not be used to endorse or promote products
  - *    derived from this software without prior written permission. For
  - *    written permission, please contact apache@apache.org.
  + *  4. The names "Apache" and "Apache Software Foundation" and
  + *  "Apache Jetspeed" must not be used to endorse or promote products
  + *  derived from this software without prior written permission. For
  + *  written permission, please contact apache@apache.org.
    *
  - * 5. Products derived from this software may not be called "Apache" or
  - *    "Apache Jetspeed", nor may "Apache" appear in their name, without
  - *    prior written permission of the Apache Software Foundation.
  + *  5. Products derived from this software may not be called "Apache" or
  + *  "Apache Jetspeed", nor may "Apache" appear in their name, without
  + *  prior written permission of the Apache Software Foundation.
    *
  - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  - * SUCH DAMAGE.
  - * ====================================================================
  + *  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  + *  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  + *  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  + *  DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  + *  ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  + *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  + *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  + *  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  + *  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  + *  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  + *  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  + *  SUCH DAMAGE.
  + *  ====================================================================
    *
  - * This software consists of voluntary contributions made by many
  - * individuals on behalf of the Apache Software Foundation.  For more
  - * information on the Apache Software Foundation, please see
  - * <http://www.apache.org/>.
  + *  This software consists of voluntary contributions made by many
  + *  individuals on behalf of the Apache Software Foundation.  For more
  + *  information on the Apache Software Foundation, please see
  + *  <http://www.apache.org/>.
    */
  -
   package org.apache.jetspeed.util;
   
  +import java.io.File;
  +import java.io.BufferedReader;
  +import java.io.FileNotFoundException;
  +import java.io.FileOutputStream;
  +import java.io.FileReader;
  +import java.io.IOException;
   
   import java.util.ArrayList;
   import java.util.HashMap;
   import java.util.StringTokenizer;
  -import java.io.FileReader;
  -import java.io.BufferedReader;
  -import java.io.FileNotFoundException;
  -import java.io.IOException;
  -import java.io.FileOutputStream;
  -import java.io.File;
   
   /**
    * Task to overwrite Properties: used for JRP, TRP and Torque.properties
    *
  - * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
  - * @author <a href="mailto:ruchi@bluesunrise.com">Ruchi Gatha</a>
  + * @author     <a href="mailto:taylor@apache.org">David Sean Taylor</a>
    * @author     <a href="mailto:epugh@upstate.com">Eric Pugh</a>
  - * 
  - * @version $Id$
  + * @created    January 29, 2003
  + * @version    $Id$
    */
  -
  -public class OverwriteProperties
  -{
  -    // The file to merge properties into
  +public class OverwriteProperties {
  +    /**  The file to merge properties into */
       protected File baseProperties;
  -    // The file to pull the properties from
  +    /**  The file to pull the properties from */
       protected File properties;
  -    // The directory to look in for include files
  +    /**  The directory to look in for include files */
       protected File includeRoot;
   
  +    /**  Description of the Field */
       public boolean verbose = false;
   
       /**  An array of all the properties */
  -    protected ArrayList baseArray = new ArrayList(1024);   
  -    /**  An array of all the properties that will be removed */  
  +    protected ArrayList baseArray = new ArrayList(1024);
  +    /**  An array of all the properties that will be removed */
       protected ArrayList removeArray = new ArrayList(128);
       /**  Description of the Field */
       protected HashMap baseMap = new HashMap();
  -    /**  What to use as a line seperator */    
  +    /**  What to use as a line seperator */
       protected String lineSeparator = System.getProperty("line.separator", "\r\n");
   
  - 
  +
       /**
        *  Sets the file to merge properties into
        *
        * @param  baseProperties  The file path to merge properties into
        */
  -    public void setBaseProperties(File baseProperties) {
  +    public void setBaseProperties(File baseProperties)
  +    {
           this.baseProperties = baseProperties;
       }
   
  @@ -111,7 +110,8 @@
        *
        * @param  properties  The file path to the pull the merge properties from
        */
  -    public void setProperties(File properties) {
  +    public void setProperties(File properties)
  +    {
           this.properties = properties;
       }
   
  @@ -121,7 +121,8 @@
        *
        * @param  includeRoot  the directory to look in.
        */
  -    public void setIncludeRoot(File includeRoot) {
  +    public void setIncludeRoot(File includeRoot)
  +    {
           this.includeRoot = includeRoot;
       }
   
  @@ -131,7 +132,8 @@
        *
        * @param  verbose  The new verbose value
        */
  -    public void setVerbose(boolean verbose) {
  +    public void setVerbose(boolean verbose)
  +    {
           this.verbose = verbose;
       }
   
  @@ -141,7 +143,8 @@
        *
        * @return    The baseProperties value
        */
  -    public File getBaseProperties() {
  +    public File getBaseProperties()
  +    {
           return baseProperties;
       }
   
  @@ -151,7 +154,8 @@
        *
        * @return    The properties value
        */
  -    public File getProperties() {
  +    public File getProperties()
  +    {
           return properties;
       }
   
  @@ -161,7 +165,8 @@
        *
        * @return    The includeRoot value
        */
  -    public File getIncludeRoot() {
  +    public File getIncludeRoot()
  +    {
           return includeRoot;
       }
   
  @@ -171,7 +176,8 @@
        *
        * @return    The verbose value
        */
  -    public boolean getVerbose() {
  +    public boolean getVerbose()
  +    {
           return verbose;
       }
   
  @@ -183,14 +189,13 @@
        * @exception  Exception  Description of the Exception
        */
       public static void main(String[] args)
  -        throws Exception 
  +        throws Exception
       {
  -        
           OverwriteProperties overwriteProperties = new OverwriteProperties();
   
  -        try 
  +        try
           {
  -            if (args.length < 3) 
  +            if (args.length < 3)
               {
                   System.out.println("Usage: java OverwriteProperties c:/temp/File1.props
c:/temp/File2.props c:/include-root/");
                   System.out.println("Usage: File1 will be modified, new parameters from
File 2 will be added,");
  @@ -202,108 +207,120 @@
               overwriteProperties.setIncludeRoot(new File(args[2]));
   
               overwriteProperties.execute();
  -    
  +
           }
           catch (FileNotFoundException ex)
           {
               System.err.println(ex.getMessage());
           }
  -        catch (IOException ex) 
  +        catch (IOException ex)
           {
               System.err.println(ex.getMessage());
           }
  -        catch (SecurityException ex) 
  +        catch (SecurityException ex)
           {
               System.err.println(ex.getMessage());
           }
       }
  - 
  -    public void execute() 
  -        throws FileNotFoundException,IOException,SecurityException
  -    {   
  -        if (verbose) 
  -        {
  -            System.out.println("Merging into file " + getBaseProperties() + " file " +
getProperties());
  -        }
   
  -        if (!getBaseProperties().exists())
  -        {
  -            throw new FileNotFoundException("Could not find file:" + getBaseProperties());
  -        }
  - 
  -        if (!getProperties().exists())
  -        {
  -            throw new FileNotFoundException("Could not find file:" + getProperties());
  -        }
  -        
  -        if (!getIncludeRoot().exists() || !getIncludeRoot().isDirectory())
  -        {
  -            throw new FileNotFoundException("Could not find directory:" + getIncludeRoot());
  -        }
  - 
  -        BufferedReader reader = new BufferedReader(new FileReader(baseProperties));
  -        int index = 0;
  -        String key = null;
  -        String line = null;
  -        while ((line = reader.readLine()) != null) 
  -        {
  -            StringTokenizer tokenizer = new StringTokenizer(line, "=");
  -            baseArray.add(index, line);
  +
  +    /**  Description of the Method */
  +    public void execute() throws FileNotFoundException, IOException, SecurityException
  +    {
  +
               if (verbose)
               {
  -                System.out.println("While reading baseArray[" + index + "] = " + line);
  +                System.out.println("Merging into file " + getBaseProperties() + " file
" + getProperties());
               }
  -            if (tokenizer.countTokens() >= 1 &&
  -                    !line.startsWith("#") &&
  -                    !line.startsWith("include") &&
  -                    !line.startsWith("module.packages")) 
  +
  +            if (!getBaseProperties().exists())
               {
  -                key = tokenizer.nextToken().trim();
  -                if (key != null && key.length() > 0) 
  +              throw new FileNotFoundException("Could not find file:" + getBaseProperties());
  +            }
  +
  +            if (!getProperties().exists())
  +            {
  +              throw new FileNotFoundException("Could not find file:" + getProperties());
  +            }
  +
  +            if (!getIncludeRoot().exists() || !getIncludeRoot().isDirectory())
  +            {
  +              throw new FileNotFoundException("Could not find directory:" + getIncludeRoot());
  +            }
  +
  +            BufferedReader reader = new BufferedReader(new FileReader(baseProperties));
  +            int index = 0;
  +            String key = null;
  +            String line = null;
  +            while ((line = reader.readLine()) != null)
  +            {
  +                StringTokenizer tokenizer = new StringTokenizer(line, "=");
  +                baseArray.add(index, line);
  +                if (verbose)
  +                {
  +                    System.out.println("While reading baseArray[" + index + "] = " + line);
  +                }
  +                if (tokenizer.countTokens() >= 1 
  +                    && !line.startsWith("#") 
  +                    && !line.startsWith("include") 
  +                    && !line.startsWith("module.packages"))
                   {
  -                    baseMap.put(key, new Integer(index));
  -                    if (verbose) 
  +                    key = tokenizer.nextToken().trim();
  +                    if (key != null && key.length() > 0)
                       {
  -                        System.out.println("baseMap[" + key + "," + index + "]");
  +                        baseMap.put(key, new Integer(index));
  +                        if (verbose)
  +                        {
  +                            System.out.println("baseMap[" + key + "," + index + "]");
  +                        }
                       }
                   }
  +                index++;
               }
  -            index++;
  -        }
  -        reader.close();
  -        if (verbose) 
  -        {
  -            System.out.println("\nOverwrite with Delta\n");
  -        }
  -        readProperties(properties, index);
  - 
  -        boolean flags[] = removeProperties();
  - 
  -        baseArray.trimToSize();
  -        writeToFile(flags);
  -    
  +            reader.close();
  +            if (verbose)
  +            {
  +                System.out.println("\nOverwrite with Delta\n");
  +            }
  +
  +            readProperties(properties, index);
  +
  +            boolean flags[] = removeProperties();
  +
  +            baseArray.trimToSize();
  +            writeToFile(flags);
  +
  +
       }
   
  - 
  -    public void writeToFile(boolean [] flags) throws FileNotFoundException, IOException
  -    {
  +
  +    /**
  +     *  Description of the Method
  +     *
  +     * @param  flags                      Description of the Parameter
  +     * @exception  FileNotFoundException  Description of the Exception
  +     * @exception  IOException            Description of the Exception
  +     */
  +    public void writeToFile(boolean[] flags)
  +        throws FileNotFoundException, IOException
  +        {
           FileOutputStream writer = new FileOutputStream(baseProperties);
           writer.flush();
  -        for(int i = 0; i < baseArray.size(); i++)
  +        for (int i = 0; i < baseArray.size(); i++)
           {
               if (true == flags[i])
               {
                   if (verbose)
                   {
  -                    System.out.println("Skipping property["+i+"] = "+baseArray.get(i));
  +                    System.out.println("Skipping property[" + i + "] = " + baseArray.get(i));
                   }
                   continue;
               }
               if (verbose)
               {
  -                System.out.println("Writing property["+i+"] = "+baseArray.get(i));
  +                System.out.println("Writing property[" + i + "] = " + baseArray.get(i));
               }
  -            writer.write(((String)baseArray.get(i)).getBytes());
  +            writer.write(((String) baseArray.get(i)).getBytes());
               writer.write(lineSeparator.getBytes());
               writer.flush();
           }
  @@ -311,6 +328,12 @@
   
       }
   
  +
  +    /**
  +     *  Description of the Method
  +     *
  +     * @return    Description of the Return Value
  +     */
       public boolean[] removeProperties()
       {
   
  @@ -322,10 +345,10 @@
           }
           for (int ix = 0; ix < removeArray.size(); ix++)
           {
  -            String prefix = (String)removeArray.get(ix);
  +            String prefix = (String) removeArray.get(ix);
               for (int iy = 0; iy < baseArray.size(); iy++)
               {
  -                String line = (String)baseArray.get(iy);
  +                String line = (String) baseArray.get(iy);
                   if (line.startsWith(prefix))
                   {
                       flags[iy] = true;
  @@ -339,14 +362,23 @@
           return flags;
       }
   
  +
  +    /**
  +     *  Reads in the properties from the specified file
  +     *
  +     * @param  propFile                   Description of the Parameter
  +     * @param  index                      Description of the Parameter
  +     * @exception  FileNotFoundException  Description of the Exception
  +     * @exception  IOException            Description of the Exception
  +     */
       public void readProperties(File propFile, int index)
           throws FileNotFoundException, IOException
  -    {
  +        {
           BufferedReader reader = new BufferedReader(new FileReader(propFile));
           String key = null;
           String line = null;
   
  -        while((line = reader.readLine()) != null)
  +        while ((line = reader.readLine()) != null)
           {
               StringTokenizer tokenizer = new StringTokenizer(line, "=");
   
  @@ -357,55 +389,57 @@
                   File includeFile = new File(includeRoot + tokenizer.nextToken().trim());
                   if (verbose)
                   {
  -                    System.out.println("include File = " + includeFile);
  +                  System.out.println("include File = " + includeFile);
                   }
                   readProperties(includeFile, index);
                   continue;
  -            }                                                   
  -            if (count >= 1 &&  line.startsWith("module.packages"))
  +            }
  +            if (count >= 1 && line.startsWith("module.packages"))
               {
                   baseArray.add(index, line);
                   if (verbose)
                   {
  -                    System.out.println("Adding module.package to baseArray["+index+"] =
"+line);
  +                    System.out.println("Adding module.package to baseArray[" + index +
"] = " + line);
                   }
                   index++;
   
                   key = line.trim();
                   if (baseMap.containsKey(key))
                   {
  -                    int ix = ((Integer)baseMap.get(key)).intValue();
  -                    baseArray.set( ix, line);
  -                    if(verbose)
  +                    int ix = ((Integer) baseMap.get(key)).intValue();
  +                    baseArray.set(ix, line);
  +                    if (verbose)
                       {
  -                        System.out.println("Resetting baseArray["+ix+"] = "+line);
  +                        System.out.println("Resetting baseArray[" + ix + "] = " + line);
                       }
                   }
   
                   continue;
               }
  -            if (count >= 1 && line.startsWith("-")) // remove from base
  +            if (count >= 1 && line.startsWith("-"))
               {
  +                // remove from base
  +
                   String prefix = line.trim().substring(1);
                   removeArray.add(prefix);
                   if (verbose)
                   {
  -                    System.out.println("Flagging for removal = "+line);
  +                    System.out.println("Flagging for removal = " + line);
                   }
                   continue;
               }
               if (count >= 1 && !line.startsWith("#"))
               {
                   key = tokenizer.nextToken().trim();
  -                if(key != null && key.length() > 0)
  +                if (key != null && key.length() > 0)
                   {
  -                    if(baseMap.containsKey(key))
  +                    if (baseMap.containsKey(key))
                       {
  -                        int ix = ((Integer)baseMap.get(key)).intValue();
  -                        baseArray.set( ix, line);
  +                        int ix = ((Integer) baseMap.get(key)).intValue();
  +                        baseArray.set(ix, line);
                           if (verbose)
                           {
  -                            System.out.println("Resetting baseArray["+ix+"] = "+line);
  +                            System.out.println("Resetting baseArray[" + ix + "] = " + line);
                           }
                       }
                       else
  @@ -413,12 +447,12 @@
                           baseArray.add(index, line);
                           if (verbose)
                           {
  -                            System.out.println("Adding new entry to baseArray["+index+"]
= "+line);
  +                            System.out.println("Adding new entry to baseArray[" + index
+ "] = " + line);
                           }
                           baseMap.put(key, new Integer(index));
                           if (verbose)
                           {
  -                            System.out.println("baseMap["+key+","+index+"]");
  +                            System.out.println("baseMap[" + key + "," + index + "]");
                           }
                           index++;
                       }
  @@ -431,5 +465,7 @@
       }
   
   }
  +
  +
   
   
  
  
  
  1.2       +1 -168    jakarta-jetspeed/src/java/org/apache/jetspeed/util/ant/OverwritePropertiesTask.java
  
  Index: OverwritePropertiesTask.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/util/ant/OverwritePropertiesTask.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- OverwritePropertiesTask.java	11 Feb 2003 23:18:57 -0000	1.1
  +++ OverwritePropertiesTask.java	27 Mar 2003 21:26:37 -0000	1.2
  @@ -1,168 +1 @@
  -/*
  - *  ====================================================================
  - *  The Apache Software License, Version 1.1
  - *
  - *  Copyright (c) 2000-2001 The Apache Software Foundation.  All rights
  - *  reserved.
  - *
  - *  Redistribution and use in source and binary forms, with or without
  - *  modification, are permitted provided that the following conditions
  - *  are met:
  - *
  - *  1. Redistributions of source code must retain the above copyright
  - *  notice, this list of conditions and the following disclaimer.
  - *
  - *  2. Redistributions in binary form must reproduce the above copyright
  - *  notice, this list of conditions and the following disclaimer in
  - *  the documentation and/or other materials provided with the
  - *  distribution.
  - *
  - *  3. The end-user documentation included with the redistribution,
  - *  if any, must include the following acknowledgment:
  - *  "This product includes software developed by the
  - *  Apache Software Foundation (http://www.apache.org/)."
  - *  Alternately, this acknowledgment may appear in the software itself,
  - *  if and wherever such third-party acknowledgments normally appear.
  - *
  - *  4. The names "Apache" and "Apache Software Foundation" and
  - *  "Apache Jetspeed" must not be used to endorse or promote products
  - *  derived from this software without prior written permission. For
  - *  written permission, please contact apache@apache.org.
  - *
  - *  5. Products derived from this software may not be called "Apache" or
  - *  "Apache Jetspeed", nor may "Apache" appear in their name, without
  - *  prior written permission of the Apache Software Foundation.
  - *
  - *  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  - *  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  - *  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  - *  DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  - *  ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  - *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  - *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  - *  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  - *  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  - *  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  - *  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  - *  SUCH DAMAGE.
  - *  ====================================================================
  - *
  - *  This software consists of voluntary contributions made by many
  - *  individuals on behalf of the Apache Software Foundation.  For more
  - *  information on the Apache Software Foundation, please see
  - *  <http://www.apache.org/>.
  - */
  -package org.apache.jetspeed.util.ant;
  -
  -import java.io.*;
  -import java.util.*;
  -
  -import org.apache.tools.ant.*;
  -
  -import org.apache.jetspeed.util.OverwriteProperties;
  -
  -/**
  - * <code>OverwritePropertiesTask</code> is the task definition for an Ant
  - * interface to the <code>OverwriteProperties</code>.
  - *
  - * @author     Eric Pugh
  - * @created    January 29, 2003
  - * @version    $Revision$
  - * @see        org.apache.tools.ant.Task
  - */
  -public class OverwritePropertiesTask extends Task {
  -
  -    /** File to merge properties into */
  -    private File mergeBaseProperties;
  -
  -    /** File to merge properties from */
  -    private File mergeProperties;
  -
  -    /** Directory to look for includes in */
  -    private File includesDir;
  -
  -
  -    /**
  -     *  Sets the File to merge properties into
  -     *
  -     * @param  mergeBaseProperties  File to merge properties into
  -     */
  -    public void setMergeBaseProperties(File mergeBaseProperties) {
  -        this.mergeBaseProperties = mergeBaseProperties;
  -    }
  -
  -
  -    /**
  -     *  Sets the File to merge properties from
  -     *
  -     * @param  mergeProperties  File to merge properties from
  -     */
  -    public void setMergeProperties(File mergeProperties) {
  -        this.mergeProperties = mergeProperties;
  -    }
  -
  -
  -    /**
  -     *  Sets the Directory to look for includes in
  -     *
  -     * @param  includesDir  Directory to look for includes in
  -     */
  -    public void setIncludesDir(File includesDir) {
  -        this.includesDir = includesDir;
  -    }
  -
  -
  -    /**
  -     *  Gets the File to merge properties into
  -     *
  -     * @return    File to merge properties into
  -     */
  -    public File getMergeBaseProperties() {
  -        return mergeBaseProperties;
  -    }
  -
  -
  -    /**
  -     *  Gets the File to merge properties from
  -     *
  -     * @return    File to merge properties from
  -     */
  -    public File getMergeProperties() {
  -        return mergeProperties;
  -    }
  -
  -
  -    /**
  -     *  Gets the Directory to look for includes in
  -     *
  -     * @return    Directory to look for includes in
  -     */
  -    public File getIncludesDir() {
  -        return includesDir;
  -    }
  -
  -
  -
  -    /**
  -     * Load the step and then execute it
  -     *
  -     * @exception  BuildException  Description of the Exception
  -     */
  -    public void execute() throws BuildException {
  -      try {
  -        OverwriteProperties overwriteProperties = new OverwriteProperties();
  -        overwriteProperties.setBaseProperties(getMergeBaseProperties());
  -        overwriteProperties.setProperties(getMergeProperties());
  -        overwriteProperties.setIncludeRoot(getIncludesDir());
  -
  -        overwriteProperties.execute();
  -
  -      }
  -      catch (Exception e){
  -        throw new BuildException(e.toString());
  -      }
  -
  -
  -    }
  -}
  -
  +/*
 *  ====================================================================
 *  The Apache
Software License, Version 1.1
 *
 *  Copyright (c) 2000-2001 The Apache Software Foundation.
 All rights
 *  reserved.
 *
 *  Redistribution and use in source and binary forms, with or
without
 *  modification, are permitted provided that the following conditions
 *  are met:
*
 *  1. Redistributions of source code must retain the above copyright
 *  notice, this list
of conditions and the following disclaimer.
 *
 *  2. Redistributions in binary form must
reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer
in
 *  the documentation and/or other materials provided with the
 *  distribution.
 *
 *
 3. The end-user documentation included with the redistribution,
 *  if any, must include
the following acknowledgment:
 *  "This product includes software developed by the
 *  Apache
Software Foundation (http://www.apache.org/)."
 *  Alternately, this acknowledgment may appear
in the software itself,
 *  if and wherever such third-party acknowledgments normally appear.
*
 *  4. The names "Apache" and "Apache Software Foundation" and
 *  "Apache Jetspeed" must
not be used to endorse or promote products
 *  derived from this software without prior written
permission. For
 *  written permission, please contact apache@apache.org.
 *
 *  5. Products
derived from this software may not be called "Apache" or
 *  "Apache Jetspeed", nor may "Apache"
appear in their name, without
 *  prior written permission of the Apache Software Foundation.
*
 *  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 *  WARRANTIES, INCLUDING,
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 *  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE
 *  DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
 *  ITS CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT
 *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
*  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 *  ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 *  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT
 *  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
OF
 *  SUCH DAMAGE.
 *  ====================================================================
*
 *  This software consists of voluntary contributions made by many
 *  individuals on behalf
of the Apache Software Foundation.  For more
 *  information on the Apache Software Foundation,
please see
 *  <http://www.apache.org/>.
 */

package org.apache.jetspeed.util.ant;

import
java.io.File;

import org.apache.tools.ant.Task;
import org.apache.tools.ant.BuildException;

import
org.apache.jetspeed.util.OverwriteProperties;

/**
 * <code>OverwritePropertiesTask</code>
is the task definition for an Ant
 * interface to the <code>OverwriteProperties</code>.
* 
 * @created January 29, 2003
 * @author Eric Pugh
 * @version $Revision$
 * @see org.apache.tools.ant.Task
*/

public class OverwritePropertiesTask extends Task
{
    /** File to merge properties into
*/
    private File mergeBaseProperties;

    /** File to merge properties from */
    private
File mergeProperties;

    /** Directory to look for includes in */
    private File includesDir;

   /** Fail on error flag */
    private boolean failonerror = true;

    /**
     *  Sets
the File to merge properties into
     * 
     * @param mergeBaseProperties
     *       
       File to merge properties into
     */

    public void setMergeBaseProperties(File
mergeBaseProperties)
    {
        this.mergeBaseProperties = mergeBaseProperties;
    }

   /**
     *  Sets the File to merge properties from
     *
     * @param  mergeProperties
 File to merge properties from
     */

    public void setMergeProperties(File mergeProperties)
   {
        this.mergeProperties = mergeProperties;
    }

    /**
     *  Sets the Directory
to look for includes in
     *
     * @param  includesDir  Directory to look for includes
in
     */
    public void setIncludesDir(File includesDir)
    {

        this.includesDir
= includesDir;
    }

    /**
     * If false, note errors to the output but keep going.
    * @param failonerror true or false
     */
     public void setFailOnError(boolean failonerror)

     {
         this.failonerror = failonerror;
     }

    /**
     *  Gets the File to
merge properties into
     * 
     * @return File to merge properties into
     */
    public
File getMergeBaseProperties()
    {

        return mergeBaseProperties;
    }

    /**
 
   *  Gets the File to merge properties from
     * 
     * @return File to merge properties
from
     */
    public File getMergeProperties()
    {

        return mergeProperties;
   }

    /**
     *  Gets the Directory to look for includes in
     * 
     * @return Directory
to look for includes in
     */
    public File getIncludesDir()
    {

        return includesDir;
   }

    /**
     * Load the step and then execute it
     * 
     * @exception BuildException
    *                   Description of the Exception
     */
    public void execute() throws
BuildException 
    {

        try
        {
            OverwriteProperties overwriteProperties
= new OverwriteProperties();
            overwriteProperties.setBaseProperties(getMergeBaseProperties());
           overwriteProperties.setProperties(getMergeProperties());
            overwriteProperties.setIncludeRoot(getIncludesDir());

           overwriteProperties.execute();
        }
        catch (Exception e)
        {
           if (!this.failonerror) 
            {
                log(e.toString());
     
      } 
            else 
            {
                throw new BuildException(e.toString());
           }
        }
    }
}
  \ No newline at end of file
  
  
  
  1.140     +5 -2      jakarta-jetspeed/xdocs/changes.xml
  
  Index: changes.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/xdocs/changes.xml,v
  retrieving revision 1.139
  retrieving revision 1.140
  diff -u -r1.139 -r1.140
  --- changes.xml	27 Mar 2003 21:18:32 -0000	1.139
  +++ changes.xml	27 Mar 2003 21:26:37 -0000	1.140
  @@ -23,7 +23,10 @@
   </li>
   -->
   <li>
  -  Add -  Bug # 18208 - 2003/03/27 - Added "skinning" capability to action icons. (STW)
  +  Add -   Bug # 16551 - 2003/03/27 - Minor fixes to OverwritePproperties ant task, patch
by Eric Pugh. (MO)
  +</li>
  +<li>
  +  Add -   Bug # 18208 - 2003/03/27 - Added "skinning" capability to action icons. (STW)
   </li>
   <li>
     Fix -   Bug # 18304 - 2003/03/27 - Fixed issue with JetspeedTemplateLocatorService not
recognizing the
  
  
  

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


Mime
View raw message