head	1.11;
access;
symbols
	TIGRIS_1_1_0RC2:1.8
	TIGRIS_1_1_0RC1:1.8
	TIGRIS_1_1:1.8.0.4
	TIGRIS_1_0_8:1.8
	TIGRIS_1_0_8RC3:1.8
	TIGRIS_1_0_8RC2:1.8
	TIGRIS_1_0_8RC1:1.8
	TIGRIS_1_0_7:1.8
	TIGRIS_1_0_7RC3:1.8
	TIGRIS_1_0_7RC2:1.8
	TIGRIS_1_0_7RC1:1.8
	TIGRIS_1_0_6:1.8
	TIGRIS_1_0_6RC5:1.8
	TIGRIS_1_0_6RC4:1.8
	TIGRIS_1_0_6RC3:1.8
	TIGRIS_1_0_6RC2:1.8
	TIGRIS_1_0_6RC1:1.8
	TIGRIS_1_0_5:1.8
	TIGRIS_1_0_5RC6:1.8
	TIGRIS_1_0_5RC5:1.8
	TIGRIS_1_0_5RC4:1.8
	TIGRIS_1_0_5RC3:1.8
	TIGRIS_1_0_5RC2:1.8
	TIGRIS_1_0_5RC1:1.8
	TIGRIS_1_0_4:1.8
	TIGRIS_1_0_3:1.8
	TIGRIS_1_0_2:1.8
	TIGRIS_1_0_1:1.8
	TIGRIS_1_0:1.8.0.6
	TIGRIS_1_0_0:1.8
	TIGRIS_1_0_0_RC1:1.8.0.2
	dlr:1.1.1
	TIGRIS_0_9_2_4:1.4
	TIGRIS_0_9_2_3:1.4
	HELM_PEER_PORT_BRANCH:1.1.1.2
	TURBINE_PEER:1.6
	TIGRIS_0_9_2_1:1.6
	TIGRIS_0_9_2:1.4.0.2
	TIGRIS_0_9_0:1.3.0.4
	TIGRIS_0_8_4:1.3.0.2
	NEWHELM:1.1.1.1
	TIGRIS_NOV_12_2000:1.1.1;
locks; strict;
comment	@# @;


1.11
date	2001.06.07.21.18.09;	author elicia;	state dead;
branches;
next	1.10;

1.10
date	2001.05.23.01.50.15;	author dlr;	state Exp;
branches;
next	1.9;

1.9
date	2001.04.26.16.16.44;	author leonardr;	state Exp;
branches;
next	1.8;

1.8
date	2001.03.14.19.09.53;	author dlr;	state Exp;
branches;
next	1.7;

1.7
date	2001.02.21.01.08.23;	author dlr;	state Exp;
branches;
next	1.6;

1.6
date	2001.01.26.18.29.05;	author edk;	state Exp;
branches
	1.6.2.1;
next	1.5;

1.5
date	2001.01.26.05.24.06;	author edk;	state dead;
branches;
next	1.4;

1.4
date	2000.12.29.04.01.50;	author dlr;	state Exp;
branches;
next	1.3;

1.3
date	2000.11.20.22.53.47;	author leonardr;	state Exp;
branches;
next	1.2;

1.2
date	2000.11.14.23.37.47;	author elicia;	state Exp;
branches;
next	1.1;

1.1
date	2000.11.12.21.16.09;	author dlr;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	2000.11.12.21.16.09;	author dlr;	state Exp;
branches;
next	1.1.1.2;

1.1.1.2
date	2001.02.21.00.35.01;	author dlr;	state Exp;
branches;
next	;

1.6.2.1
date	2001.01.28.01.02.18;	author dlr;	state dead;
branches;
next	1.6.2.2;

1.6.2.2
date	2001.02.15.20.06.59;	author leonardr;	state Exp;
branches;
next	1.6.2.3;

1.6.2.3
date	2001.02.15.20.50.42;	author leonardr;	state Exp;
branches;
next	;


desc
@@


1.11
log
@removed obsolete file
@
text
@/* ================================================================
 * Copyright (c) 2000-2001 CollabNet.  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 acknowlegement: "This product includes
 * software developed by Collab.Net (http://www.Collab.Net/)."
 * Alternately, this acknowlegement may appear in the software itself, if
 * and wherever such third-party acknowlegements normally appear.
 * 
 * 4. The hosted project names must not be used to endorse or promote
 * products derived from this software without prior written
 * permission. For written permission, please contact info@@collab.net.
 * 
 * 5. Products derived from this software may not use the "Tigris" name
 * nor may "Tigris" appear in their names without prior written
 * permission of Collab.Net.
 * 
 * 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 COLLAB.NET 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 CollabNet.
 */


package org.tigris.helm.project;

import java.util.*;
import java.sql.Connection;

import org.apache.velocity.context.Context;

import org.apache.turbine.util.Log;
import org.apache.turbine.util.TurbineException;
import org.apache.turbine.util.TurbineException;

import org.joist.security.RedirectException;

import org.tigris.helm.security.*;
import org.tigris.helm.om.*;
import org.tigris.helm.tool.DBFlag;

/** 
 * Change the project's information.
 *
 * @@version $Id: ProjectEditInfo.java,v 1.10 2001/05/23 01:50:15 dlr Exp $ */
public class ProjectEditInfo extends org.tigris.helm.security.HelmServlet 
{
    /**
     * Version string.
     */
    public static final  String versionID = "$Id: ProjectEditInfo.java,v 1.10 2001/05/23 01:50:15 dlr Exp $";
       	
    /**
     * Is in debug state.
     */	
    private static boolean DEBUG = true;
			
    /** 
     * Short description form field name
     */
    private final static String SHORT_DESCRIPTION_FIELD = "shortDescription";
	
    /**
     * Long description form field name.
     */
    private final static String LONG_DESCRIPTION_FIELD = "longDescription";

    /**
     * Use index checkbox field name.
     */
    private final static String USE_INDEX_FIELD = "useIndex";

    /**
     * Status form field name.
     */
    private final static String STATUS_FIELD = "status";
	
    
    /** 
     * The 'action' when the form is submitted
     */
    private final static String SUBMIT_CHANGES_ACTION = "Submit Changes";
	

    /** 
     * Property file field name for success page
     */
    private static final String SUCCESS_PAGE = "successPage";
       	       
    /** 
     * Process ProjectEditInfo form.
     * @@param connection    Database connection for this servlet to use
     * @@param context       Current webmacro context.
     * @@exception HanderException
     * @@exception RedirectException     This how joist does fake redirect 
     */
    protected String processRequest(Context context)
        throws TurbineException, RedirectException
    {
        String templateName = super.processRequest(context);
        String action = getAction(context);
        try 
        {
            Project currentProject = getCurrentProject(context);
            
            if (currentProject == null)
            {
                appendToError(context, 
                              "No project.",
                              null /* This method checks for null */);
		// Fall out of this servlet.
                //We can't do anything w/o a project
            } else {
                // Need to perpetuate projectID.  If i don't get it and
                // put it back into the context again, it gets lost.  If
                // no projectID, fail out.
                //context.put(PROJECTID_KEY, project.getID()); 
                
                // Now switch on the action
                if (action != null)
                {
                    if (action.equals(SUBMIT_CHANGES_ACTION))
                    {
                        String shortDescription = 
                            processField(context, SHORT_DESCRIPTION_FIELD);
                        String longDescription =
                            processField(context, LONG_DESCRIPTION_FIELD);
                        String useIndex =
                            processField(context, USE_INDEX_FIELD);
                        String status =
                            processField(context, STATUS_FIELD);

                        //TODO: Check whether fields differ from those in
                        //currentProject.
                        currentProject.updateInfo(getACL(context),
                                                  null,   // license
                                                  null,   // isPublic
                                                  shortDescription,
                                                  longDescription,
                                                  useIndex,
                                                  status,
                                                  null);   // aliasURL
                        
                        String projectHome = currentProject.getProjectHome();
                        redirectToURL(context, projectHome);   
                    }
                }
            }
        }
        catch (RedirectException e)
        {
            throw e;
        }
        catch (Exception e)
        {
            Log.error("Exception thrown in ProjectEditInfo", e);
            throw new TurbineException(e);
        }
        return templateName;
    }
}
@


1.10
log
@Ported Helm from WebMacro to Velocity.
@
text
@d68 1
a68 1
 * @@version $Id: ProjectEditInfo.java,v 1.9 2001/04/26 16:16:44 leonardr Exp $ */
d74 1
a74 1
    public static final  String versionID = "$Id: ProjectEditInfo.java,v 1.9 2001/04/26 16:16:44 leonardr Exp $";
@


1.9
log
@Patches I forgot to commit before, for decoupling privateness from proprietariness.
@
text
@d53 1
a53 1
import org.webmacro.servlet.*;
d56 2
d68 1
a68 1
 * @@version $Id: ProjectEditInfo.java,v 1.8 2001/03/14 19:09:53 dlr Exp $ */
d74 1
a74 1
    public static final  String versionID = "$Id: ProjectEditInfo.java,v 1.8 2001/03/14 19:09:53 dlr Exp $";
d120 2
a121 2
    protected String processRequest (Connection connection, WebContext context)
        throws HandlerException, RedirectException
d123 1
a123 1
        String templateName = super.processRequest(connection, context);
d180 1
a180 1
            throw new HandlerException(e.getMessage());
@


1.8
log
@* No longer check the Use Index box behind the user's back.  If the user
desires no description, that's what they're gonna get.

* Rethrow RedirectExceptions.
@
text
@d66 1
a66 1
 * @@version $Id: ProjectEditInfo.java,v 1.7 2001/02/21 01:08:23 dlr Exp $ */
d72 1
a72 1
    public static final  String versionID = "$Id: ProjectEditInfo.java,v 1.7 2001/02/21 01:08:23 dlr Exp $";
d88 1
a88 1
	
d158 1
@


1.7
log
@This is the highest revision from the HELM_PEER_PORT_BRANCH.  The previous import caused too many conflicts to resolve manually
@
text
@d66 1
a66 1
 * @@version $Id: ProjectEditInfo.java,v 1.6.2.3 2001/02/15 20:50:42 leonardr Exp $ */
d72 1
a72 1
    public static final  String versionID = "$Id: ProjectEditInfo.java,v 1.6.2.3 2001/02/15 20:50:42 leonardr Exp $";
a150 5
                        if (!haveValue(longDescription) && 
                            !haveValue(useIndex))
                        {
                            useIndex = DBFlag.ON;
                        }
d155 1
a155 1
                        //CurrentProject.
d169 7
a175 1
        } catch (Exception e) {
d181 1
a181 2
      
} /* end class ProjectEditInfo */
@


1.6
log
@readding all the files as part of the process of returning to the way
things were as of tuesday
@
text
@d2 1
a2 1
 * Copyright (c) 2000 CollabNet.  All rights reserved.
a49 1
import java.io.*;
d51 1
a51 3
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
a52 1
import org.webmacro.util.*;
d54 3
a56 7
import org.webmacro.engine.*;
import org.webmacro.broker.*;
import org.webmacro.resource.*;

import org.joist.*;
import org.joist.util.*;
import org.joist.session.*;
a57 1
import org.joist.database.DataManager;
d59 2
a60 2
import org.tigris.helm.security.HelmServlet;
import org.tigris.helm.database.ProjectManager;
d63 4
a66 42
/** Handle ProjectEditInfo form.
* Makes use of new 
* Issues:
* <ol>
*		<li>Any of these fields can be empty.  We might not always want this.  The way this servlet
*       works, it just shoves the stuff straight in the database.</li>
* </ol>
* <p>
* Test Cases:
* <ol>
* <li>What happens when form is empty and it's submitted?
* 	<ol>
* 		<li>Goes to home page.  Even if all fields are empty, the form is supposed to fill the db.</li>
* 	</ol>
* </li>
* <li>What happens when form is partially completed?  Does the missing fields messages display?
* 	<ol>
*		<li>The missingFields is never to show on this form.  All fields can be empty.</li>
* 	</ol>
* </li>
* <li>On successful submission, does the content show up in the database?  
* 		<ol>
*			<li>Yes. In HELM_PROJECT</li>
*		</ol>
* </li>
* <li>On successful submission, are we taken to the next page, the project home page?
* 	<ol>
*		<li>Yes.  To ProjectHome.</li>
*	</ol>
* </li>
* <li>Check the javadoc.  How does it come out?
* 		<ol>
*			<li>Looks good.  I used: 
*               <pre>/home/stack/software/jdk1.3/bin/javadoc -d javadoc -classpath /home/stack/cvsroot/sandbox/site/lib/joist.jar:${CLASSPATH}  -sourcepath . org.tigris.helm.project.ProjectEditInfo
*               </pre>
*          </li>
*		</ol>
* </li>
* </ol>
*
* @@version $Id: ProjectEditInfo.java,v 1.4 2000/12/29 04:01:50 dlr Exp $
*/ 
d69 14
a82 5
	/**
         * Version string.
         */
    public static final  String versionID = "$Id: ProjectEditInfo.java,v 1.4 2000/12/29 04:01:50 dlr Exp $";
    
d84 4
a87 15
	/**
         * Instance of logging class.
         */
	private static Log log = new Log("ProjectEditInfo", "Tigris StartPage");
	
	
	/**
         * Is in debug state.
         */	
    private static boolean debug = true;
	
	
	/** Key to pull projectID from query string
	*/
	private static final String PROJECTID_KEY = "projectID";
d89 9
a97 24
	
	/** Key to pull 'action' from context w/ getForm()
	*/
	private static final String ACTION_KEY = "action";
	
	
	/** Short description form field name
	*/
	private final static String SHORT_DESCRIPTION_FORM_FIELD = "shortDescription";
	
	/**
         * Long description form field name.
         */
	private final static String LONG_DESCRIPTION_FORM_FIELD = "longDescription";
	
    	/**
         * Use index checkbox field name.
         */
	private final static String USE_INDEX_FORM_FIELD = "useIndex";

	/**
         * Status form field name.
         */
	private final static String STATUS_FORM_FIELD = "status";
d100 4
a103 14
	/** The 'action' when the form is submitted
	*/
	private final static String SUBMIT_CHANGES = "Submit Changes";
	

	/** Property file field name for success page
	*/
	private static final String SUCCESS_PAGE = "successPage";
    
    
    /** Name of this class
    */
    private String thisClassName = null;
	
d106 5
d122 1
a122 1
        String action = (String)context.get(ACTION_KEY);
a124 3
            // Need to perpetuate projectID.  If i don't get it and
            // put it back into the context again, it gets lost.  If
            // no projectID, fail out.
a125 1
            String projectID = currentProject.getID();
d129 3
a131 3
                appendToMessage(context, 
                                "No project.",
                                null /* This method checks for null */);
d135 4
a138 1
                context.put(PROJECTID_KEY, projectID); 
d141 1
a141 1
                if (action.equals(SUBMIT_CHANGES))
d143 1
a143 7
                    String shortDescription = 
                        processField(context, SHORT_DESCRIPTION_FORM_FIELD);
                    String longDescription =
                        processField(context, LONG_DESCRIPTION_FORM_FIELD);
                    String useIndex =
                        processField(context, USE_INDEX_FORM_FIELD);
                    if (!haveValue(longDescription) && !haveValue(useIndex))
d145 26
a170 1
                        useIndex = DBFlag.ON;
a171 17
                    String status =
                        processField(context, STATUS_FORM_FIELD);

                    //TODO: Check whether fields differ from those in
                    //CurrentProject.
                    currentProject.updateInfo(getACL(context, connection),
                                              null,   // license
                                              shortDescription,
                                              longDescription,
                                              useIndex,
                                              status,
                                              null);   // aliaseURL
                    
                    String projectHome = currentProject.getProjectHome( );                             
                    if( debug )
                        log.debug( "Done -- redirecting to: " + projectHome );
                    redirectToURL( context, projectHome  );   
d173 1
a173 1
            }	
d175 2
a176 3
            log.exception(e);
            String message = "ProjectEditInfo: " + e.getMessage();
            context.put("message", message);
@


1.6.2.1
log
@Porting to the Turbine Peer system.  -dlr and leonardr
@
text
@d112 1
a112 1
* @@version $Id: ProjectEditInfo.java,v 1.6 2001/01/26 18:29:05 edk Exp $
d119 1
a119 1
    public static final  String versionID = "$Id: ProjectEditInfo.java,v 1.6 2001/01/26 18:29:05 edk Exp $";
@


1.6.2.2
log
@Ported ProjectEditInfo servlet.
@
text
@d50 1
d52 3
a54 1
import java.sql.Connection;
d56 1
d58 7
a64 3

import org.apache.turbine.util.Log;

d66 1
d68 2
a69 2
import org.tigris.helm.security.*;
import org.tigris.helm.om.*;
d72 42
a113 4
/** 
 * Change the project's information.
 *
 * @@version $Id: ProjectEditInfo.java,v 1.6 2001/01/26 18:29:05 edk Exp $ */
d116 3
a118 3
    /**
     * Version string.
     */
d120 42
a161 10
       	
    /**
     * Is in debug state.
     */	
    private static boolean DEBUG = true;
			
    /** 
     * Short description form field name
     */
    private final static String SHORT_DESCRIPTION_FIELD = "shortDescription";
d163 4
a166 4
    /**
     * Long description form field name.
     */
    private final static String LONG_DESCRIPTION_FIELD = "longDescription";
a167 4
    /**
     * Use index checkbox field name.
     */
    private final static String USE_INDEX_FIELD = "useIndex";
d169 8
a176 4
    /**
     * Status form field name.
     */
    private final static String STATUS_FIELD = "status";
a177 5
    
    /** 
     * The 'action' when the form is submitted
     */
    private final static String SUBMIT_CHANGES_ACTION = "Submit Changes";
a180 5
     * Property file field name for success page
     */
    private static final String SUCCESS_PAGE = "successPage";
       	       
    /** 
d191 1
a191 1
        String action = getAction(context);
d194 3
d198 1
d202 3
a204 3
                appendToError(context, 
                              "No project.",
                              null /* This method checks for null */);
d208 1
a208 4
                // Need to perpetuate projectID.  If i don't get it and
                // put it back into the context again, it gets lost.  If
                // no projectID, fail out.
                //context.put(PROJECTID_KEY, project.getID()); 
d211 1
a211 1
                if (action != null)
d213 7
a219 1
                    if (action.equals(SUBMIT_CHANGES_ACTION))
d221 1
a221 26
                        String shortDescription = 
                            processField(context, SHORT_DESCRIPTION_FIELD);
                        String longDescription =
                            processField(context, LONG_DESCRIPTION_FIELD);
                        String useIndex =
                            processField(context, USE_INDEX_FIELD);
                        if (!haveValue(longDescription) && 
                            !haveValue(useIndex))
                        {
                            useIndex = DBFlag.ON;
                        }
                        String status =
                            processField(context, STATUS_FIELD);

                        //TODO: Check whether fields differ from those in
                        //CurrentProject.
                        currentProject.updateInfo(getACL(context),
                                                  null,   // license
                                                  shortDescription,
                                                  longDescription,
                                                  useIndex,
                                                  status,
                                                  null);   // aliasURL
                        
                        String projectHome = currentProject.getProjectHome();
                        redirectToURL(context, projectHome);   
d223 17
d241 1
a241 1
            }
d243 3
a245 2
            Log.error("Exception thrown in ProjectEditInfo", e);
            throw new HandlerException(e.getMessage());
@


1.6.2.3
log
@Normalized copyright dates.
@
text
@d2 1
a2 1
 * Copyright (c) 2000-2001 CollabNet.  All rights reserved.
d66 1
a66 1
 * @@version $Id: ProjectEditInfo.java,v 1.6.2.2 2001/02/15 20:06:59 leonardr Exp $ */
d72 1
a72 1
    public static final  String versionID = "$Id: ProjectEditInfo.java,v 1.6.2.2 2001/02/15 20:06:59 leonardr Exp $";
@


1.5
log
@revert this stuff to its state as of 2001/01/24 12:42:00 GMT -- with
the following exceptions, which have some different modifications so
they'll work with changes which have happened in joist:

ProjectNewsEdit.java
SkinManager.java
SkinStyleElementValueManager.java
StyleElementManager.java
StyleManager.java

it compiles.  i dunno if it works, though.
@
text
@@


1.4
log
@Made use of new DBFlag class.
@
text
@d112 1
a112 1
* @@version $Id: ProjectEditInfo.java,v 1.3 2000/11/20 22:53:47 leonardr Exp $
d119 1
a119 1
    public static final  String versionID = "$Id: ProjectEditInfo.java,v 1.3 2000/11/20 22:53:47 leonardr Exp $";
@


1.3
log
@Corrected spacing.
@
text
@d65 2
a68 2
import org.joist.security.RedirectException;
import org.joist.database.DataManager;
d70 1
a70 1

d112 1
a112 1
* @@version $Id: ProjectEditInfo.java,v 1.2 2000/11/14 23:37:47 elicia Exp $
d116 4
a119 3
	/** Version string.
	*/
    public static final  String versionID = "$Id: ProjectEditInfo.java,v 1.2 2000/11/14 23:37:47 elicia Exp $";
d122 3
a124 2
	/** Instance of logging class.
	*/
d128 3
a130 2
	/** Is in debug state.
	*/	
d148 3
a150 3
	
	/** Long description form field name
	*/
d153 8
a160 3
    
	/** Long description form field name
	*/
d217 6
d232 1
@


1.2
log
@removed references to member policy
@
text
@d112 1
a112 1
* @@version $Id: ProjectEditInfo.java,v 1.1.1.1 2000/11/12 21:16:09 dlr Exp $
d118 1
a118 1
    public static final  String versionID = "$Id: ProjectEditInfo.java,v 1.1.1.1 2000/11/12 21:16:09 dlr Exp $";
d220 1
a220 1
                                              
d222 3
a224 3
 					if( debug )
						log.debug( "Done -- redirecting to: " + projectHome );
					redirectToURL( context, projectHome  );   
@


1.1
log
@Initial revision
@
text
@d112 1
a112 1
* @@version $Id: ProjectEditInfo.java,v 1.20 2000/11/11 03:33:33 dlr Exp $
d118 1
a118 1
    public static final  String versionID = "$Id: ProjectEditInfo.java,v 1.20 2000/11/11 03:33:33 dlr Exp $";
d219 1
a219 2
                                              null,   // aliaseURL
                                              null);  // memberPolicy
@


1.1.1.1
log
@Merging newhelm tree into helm, as per IZ issue #557.  Previous major version of helm is tagged TIGRIS_NOV_11_2000.
@
text
@@


1.1.1.2
log
@Replacing the HEAD with the HELM_PEER_PORT_BRANCH.
@
text
@d2 1
a2 1
 * Copyright (c) 2000-2001 CollabNet.  All rights reserved.
d50 1
d52 3
a54 1
import java.sql.Connection;
d56 1
d58 7
d66 1
a66 2
import org.apache.turbine.util.Log;

d68 2
a70 3
import org.tigris.helm.security.*;
import org.tigris.helm.om.*;
import org.tigris.helm.tool.DBFlag;
d72 42
a113 4
/** 
 * Change the project's information.
 *
 * @@version $Id: ProjectEditInfo.java,v 1.6.2.3 2001/02/15 20:50:42 leonardr Exp $ */
d116 38
a153 14
    /**
     * Version string.
     */
    public static final  String versionID = "$Id: ProjectEditInfo.java,v 1.6.2.3 2001/02/15 20:50:42 leonardr Exp $";
       	
    /**
     * Is in debug state.
     */	
    private static boolean DEBUG = true;
			
    /** 
     * Short description form field name
     */
    private final static String SHORT_DESCRIPTION_FIELD = "shortDescription";
d155 4
a158 4
    /**
     * Long description form field name.
     */
    private final static String LONG_DESCRIPTION_FIELD = "longDescription";
a159 4
    /**
     * Use index checkbox field name.
     */
    private final static String USE_INDEX_FIELD = "useIndex";
d161 8
a168 4
    /**
     * Status form field name.
     */
    private final static String STATUS_FIELD = "status";
a169 5
    
    /** 
     * The 'action' when the form is submitted
     */
    private final static String SUBMIT_CHANGES_ACTION = "Submit Changes";
a172 5
     * Property file field name for success page
     */
    private static final String SUCCESS_PAGE = "successPage";
       	       
    /** 
d183 1
a183 1
        String action = getAction(context);
d186 3
d190 1
d194 3
a196 3
                appendToError(context, 
                              "No project.",
                              null /* This method checks for null */);
d200 1
a200 4
                // Need to perpetuate projectID.  If i don't get it and
                // put it back into the context again, it gets lost.  If
                // no projectID, fail out.
                //context.put(PROJECTID_KEY, project.getID()); 
d203 1
a203 1
                if (action != null)
d205 21
a225 29
                    if (action.equals(SUBMIT_CHANGES_ACTION))
                    {
                        String shortDescription = 
                            processField(context, SHORT_DESCRIPTION_FIELD);
                        String longDescription =
                            processField(context, LONG_DESCRIPTION_FIELD);
                        String useIndex =
                            processField(context, USE_INDEX_FIELD);
                        if (!haveValue(longDescription) && 
                            !haveValue(useIndex))
                        {
                            useIndex = DBFlag.ON;
                        }
                        String status =
                            processField(context, STATUS_FIELD);

                        //TODO: Check whether fields differ from those in
                        //CurrentProject.
                        currentProject.updateInfo(getACL(context),
                                                  null,   // license
                                                  shortDescription,
                                                  longDescription,
                                                  useIndex,
                                                  status,
                                                  null);   // aliasURL
                        
                        String projectHome = currentProject.getProjectHome();
                        redirectToURL(context, projectHome);   
                    }
d227 1
a227 1
            }
d229 3
a231 2
            Log.error("Exception thrown in ProjectEditInfo", e);
            throw new HandlerException(e.getMessage());
@

