head	1.20;
access;
symbols
	TIGRIS_1_1_0RC2:1.13
	TIGRIS_1_1_0RC1:1.13
	TIGRIS_1_1:1.13.0.4
	TIGRIS_1_0_8:1.13
	TIGRIS_1_0_8RC3:1.13
	TIGRIS_1_0_8RC2:1.13
	TIGRIS_1_0_8RC1:1.13
	TIGRIS_1_0_7:1.13
	TIGRIS_1_0_7RC3:1.13
	TIGRIS_1_0_7RC2:1.13
	TIGRIS_1_0_7RC1:1.13
	TIGRIS_1_0_6:1.13
	TIGRIS_1_0_6RC5:1.13
	TIGRIS_1_0_6RC4:1.13
	TIGRIS_1_0_6RC3:1.13
	TIGRIS_1_0_6RC2:1.13
	TIGRIS_1_0_6RC1:1.13
	TIGRIS_1_0_5:1.13
	TIGRIS_1_0_5RC6:1.13
	TIGRIS_1_0_5RC5:1.13
	TIGRIS_1_0_5RC4:1.13
	TIGRIS_1_0_5RC3:1.13
	TIGRIS_1_0_5RC2:1.13
	TIGRIS_1_0_5RC1:1.13
	TIGRIS_1_0_4:1.13
	TIGRIS_1_0_3:1.13
	TIGRIS_1_0_2:1.13
	TIGRIS_1_0_1:1.13
	TIGRIS_1_0:1.13.0.6
	TIGRIS_1_0_0:1.13
	TIGRIS_1_0_0_RC1:1.13.0.2
	dlr:1.1.1
	TIGRIS_0_9_2_4:1.2
	TIGRIS_0_9_2_3:1.2
	HELM_PEER_PORT_BRANCH:1.1.1.1
	TURBINE_PEER:1.5
	TIGRIS_0_9_2_1:1.5
	TIGRIS_0_9_2:1.2.0.4
	TIGRIS_0_9_0:1.2.0.2
	TIGRIS_0_8_4:1.1.0.2;
locks; strict;
comment	@# @;


1.20
date	2001.08.28.00.56.12;	author leonardr;	state Exp;
branches;
next	1.19;

1.19
date	2001.08.11.09.08.01;	author dlr;	state Exp;
branches;
next	1.18;

1.18
date	2001.07.18.10.05.12;	author dlr;	state Exp;
branches;
next	1.17;

1.17
date	2001.07.17.20.54.06;	author leonardr;	state Exp;
branches;
next	1.16;

1.16
date	2001.07.17.17.55.45;	author leonardr;	state Exp;
branches;
next	1.15;

1.15
date	2001.06.29.00.57.48;	author leonardr;	state Exp;
branches;
next	1.14;

1.14
date	2001.05.23.01.50.10;	author dlr;	state Exp;
branches;
next	1.13;

1.13
date	2001.03.13.21.28.36;	author leonardr;	state Exp;
branches;
next	1.12;

1.12
date	2001.03.12.18.44.54;	author dlr;	state Exp;
branches;
next	1.11;

1.11
date	2001.03.08.19.05.37;	author leonardr;	state Exp;
branches;
next	1.10;

1.10
date	2001.03.07.01.53.20;	author lucas;	state Exp;
branches;
next	1.9;

1.9
date	2001.02.27.01.43.36;	author dlr;	state Exp;
branches;
next	1.8;

1.8
date	2001.02.23.23.36.24;	author elicia;	state Exp;
branches;
next	1.7;

1.7
date	2001.02.22.00.28.18;	author leonardr;	state Exp;
branches;
next	1.6;

1.6
date	2001.02.21.01.08.21;	author dlr;	state Exp;
branches;
next	1.5;

1.5
date	2001.01.26.18.29.02;	author edk;	state Exp;
branches
	1.5.2.1;
next	1.4;

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

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

1.2
date	2000.12.18.19.15.54;	author leonardr;	state Exp;
branches;
next	1.1;

1.1
date	2000.11.29.23.57.50;	author leonardr;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	2001.02.21.00.32.35;	author dlr;	state Exp;
branches;
next	;

1.5.2.1
date	2001.01.28.01.02.17;	author dlr;	state dead;
branches;
next	1.5.2.2;

1.5.2.2
date	2001.02.14.00.34.09;	author leonardr;	state Exp;
branches;
next	1.5.2.3;

1.5.2.3
date	2001.02.15.20.50.35;	author leonardr;	state Exp;
branches;
next	1.5.2.4;

1.5.2.4
date	2001.02.16.03.01.26;	author dlr;	state Exp;
branches;
next	;


desc
@@


1.20
log
@Moved code out of BaseHelmServlet and into other classes which suit it better.
@
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 CollabNet (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 CollabNet.
 * 
 * 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 COLLABNET 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.domain;


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

import org.apache.velocity.context.Context;

import org.apache.turbine.util.Log;
import org.apache.commons.util.exception.NestableException;

import org.tigris.helm.security.RedirectException;

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

/**
 * Changes the info for the selected project group. Also can remove
 * projects from the group.
 * @@author <a href="mailto:leonardr@@collab.net">Leonard Richardson</a>
 */
public class ProjectGroupEdit extends HelmServlet 
{
    private static final boolean DEBUG = true;
    
    private static String MAKE_CHANGES_ACTION = "Submit Changes";
    private static String REMOVE_ELEMENTS_ACTION = "Remove Elements";

    private static String PARENT_FIELD="parent";
    private static String SHORT_DESCRIPTION_FIELD = "shortDescription";
    private static String LONG_DESCRIPTION_FIELD = "longDescription";
    private static String REMOVE_ELEMENT_FIELD_PREFIX = "Remove";

    /**
     *  If they've submitted changes, make them.
     */
    protected String processRequest(Context context)
	throws NestableException, RedirectException
    {
	String templateName = super.processRequest(context);
        try 
        {
            String action = getAction(context);

            String shortDescription  =
                ContextAPI.processField(context, SHORT_DESCRIPTION_FIELD);
            String longDescription  =
                ContextAPI.processField(context, LONG_DESCRIPTION_FIELD);

            Domain currentDomain = getCurrentDomain(context);
            AccessControlList acl = getLoginUser(context).getACL();
            ProjectGroup group = getCurrentProjectGroup(context);
            
            Project currentParent = group.getParentProject();

            String parentID = ContextAPI.processField
                (context, PARENT_FIELD, currentParent.getID());
            Project newParent = ProjectPeer.getInstance(parentID);

            if (MAKE_CHANGES_ACTION.equals(action))
            {
                //Change the group's information.                
                group.updateInfo(acl, shortDescription, longDescription);

                if (parentID != currentParent.getID())
                {
                    group.changeParent(acl, newParent);
                }

                context.put("currentProjectGroup", group);
                ContextAPI.addMessage(context, "Update succeeded.");
            } 
            else if (REMOVE_ELEMENTS_ACTION.equals(action))
            {
                List projectIDsToRemove = ContextAPI.searchParamsForPrefix
                    (context, REMOVE_ELEMENT_FIELD_PREFIX);
                
                for (Iterator i = projectIDsToRemove.iterator(); i.hasNext();)
                {
                    String projectID =  (String)i.next();
                    Project project = ProjectPeer.getInstance(projectID);
                    group.disassociate(acl, project);
                }

                String msg = String.valueOf(projectIDsToRemove.size())
                    + " project" + (projectIDsToRemove.size() == 1?"":"s")
                    + " removed.";
                ContextAPI.addMessage(context, msg);
            }
        } 
        catch (RedirectException e)
        {
            throw e;
        }
        catch (Exception e)
        {
            String msg = "Couldn't edit project group: " + e.getMessage();
            Log.error(msg, e);
            throw new NestableException(e);
        }    
        return templateName;        
    }
}
@


1.19
log
@Upgrading to Turbine 3.0-dev, Fulcrum 1.0, and Torque 1.0.
@
text
@d123 1
a123 1
                List projectIDsToRemove = searchParamsForPrefix
@


1.18
log
@Ported Joist Redirect*Exception to Helm.
@
text
@d57 1
a57 1
import org.apache.turbine.util.TurbineException;
d86 1
a86 1
	throws TurbineException, RedirectException
d147 1
a147 1
            throw new TurbineException(e);
@


1.17
log
@Cleanup for port to new error handling system.
@
text
@d59 1
a59 1
import org.joist.security.RedirectException;
@


1.16
log
@Porting of domain package to new error handling API.
@
text
@d104 1
a104 1
            String parentID = processField
@


1.15
log
@Implemented basic project group and category nesting.
@
text
@d63 1
a91 2
            List missingFields = new ArrayList();
            List validationErrors = new ArrayList();
d94 1
a94 1
                processField(context, SHORT_DESCRIPTION_FIELD);
d96 1
a96 1
                processField(context, LONG_DESCRIPTION_FIELD);
d119 1
a119 1
                appendToMessage(context, "Update succeeded.");
d136 1
a136 1
                appendToMessage(context, msg);
@


1.14
log
@Ported Helm from WebMacro to Velocity.
@
text
@a57 1
import org.apache.turbine.util.TurbineException;
d62 1
a63 2
import org.tigris.helm.om.*;
import org.tigris.helm.om.*;
d76 3
a78 4
    private static String GROUP_NAME_FIELD = "name";
    private static String GROUP_SHORT_DESCRIPTION_FIELD = "shortDescription";
    private static String GROUP_LONG_DESCRIPTION_FIELD = "longDescription";
    private static String IS_CATEGORY_FIELD = "isCategory";
a93 4
            /* Commented out until project names can be changed.
               String name =
               processField(context, GROUP_NAME_FIELD, missingFields);
            */
d95 1
a95 1
                processField(context, GROUP_SHORT_DESCRIPTION_FIELD);
d97 11
a107 3
                processField(context, GROUP_LONG_DESCRIPTION_FIELD);
            boolean isCategory  = 
                processCheckbox(context, IS_CATEGORY_FIELD);
d109 1
a109 1
            if (action != null)
d111 2
a112 3
                Domain currentDomain = getCurrentDomain(context);
                ProjectGroup group = getCurrentProjectGroup(context);
                AccessControlList acl = getLoginUser(context).getACL();
d114 1
a114 1
                if (action.equals(MAKE_CHANGES_ACTION))
d116 2
a117 1
                    //Change the project group's information.
d119 13
a131 37
                    // Type can be "group" or "category"
                    // If the isCategory checkbox was checked, 
                    // set to "category"
                    String type = (isCategory ?
                                   "category" :
                                   "group");
                    group.updateInfo(acl, shortDescription, 
                                     longDescription, type);
                    context.put("currentProjectGroup", group);
                    appendToMessage(context, "Update succeeded.");
                } else if (action.equals(REMOVE_ELEMENTS_ACTION)) {
                    Enumeration paramNames = getRequest(context)
                        .getParameterNames();
                    List projectsToRemove = new ArrayList();
                    while (paramNames.hasMoreElements())
                    {
                        String paramName = (String)paramNames.nextElement();
                        if (paramName.startsWith(REMOVE_ELEMENT_FIELD_PREFIX))
                        {
                            StringTokenizer tok = 
                                new StringTokenizer(paramName);
                            tok.nextToken();
                            String userID = tok.nextToken();
                            projectsToRemove.add(ProjectPeer.getInstance(userID));
                        }
                    }
                    
                    for (Iterator i = projectsToRemove.iterator(); 
                         i.hasNext();)
                    {
                        Project project = (Project)i.next();
                        group.removeProject(acl, project);
                    }
                    String msg = String.valueOf(projectsToRemove.size())
                        + " project" + (projectsToRemove.size() == 1?"":"s")
                        + " removed.";
                    appendToMessage(context, msg);
d133 5
@


1.13
log
@Corrected typo.
@
text
@d54 1
a54 1
import org.webmacro.servlet.*;
d57 2
d87 2
a88 2
    protected String processRequest (Connection connection, WebContext context)
	throws HandlerException, RedirectException
d90 1
a90 1
	String templateName = super.processRequest(connection, context);
d129 1
a129 1
                    Enumeration paramNames = context.getRequest()
d166 1
a166 1
            throw new HandlerException(msg);
@


1.12
log
@* Made DEBUG final.
* Removed CVS id.
@
text
@d150 1
a150 1
                        + " projects" + (projectsToRemove.size() == 1?"":"s")
@


1.11
log
@Political correctness strikes Tigris.org! The components of project and user groups no longer wish to be called "members", as that causes them to be confused with users who have roles in projects. The new, approved term is "elements".
@
text
@d71 1
a71 3
    public static final  String versionID = "$Id: ProjectGroupEdit.java,v 1.10 2001/03/07 01:53:20 lucas Exp $";

    private static boolean DEBUG = true;
@


1.10
log
@Corrected regex madness for Torque upgrade.  -dlr
@
text
@d71 1
a71 1
    public static final  String versionID = "$Id: ProjectGroupEdit.java,v 1.9 2001/02/27 01:43:36 dlr Exp $";
d76 1
a76 1
    private static String REMOVE_MEMBERS_ACTION = "Remove Members";
d82 1
a82 1
    private static String REMOVE_MEMBER_FIELD_PREFIX = "Remove";
d128 1
a128 1
                } else if (action.equals(REMOVE_MEMBERS_ACTION)) {
d135 1
a135 1
                        if (paramName.startsWith(REMOVE_MEMBER_FIELD_PREFIX))
@


1.9
log
@Improved error messaging and removed unnecessary special "Error" query
string parameter check.
@
text
@d63 1
a63 3
import org.tigris.helm.om.peer.*;
import org.tigris.helm.om.base.*;

d71 1
a71 1
    public static final  String versionID = "$Id: ProjectGroupEdit.java,v 1.8 2001/02/23 23:36:24 elicia Exp $";
@


1.8
log
@passing type (category or group) field to ProjectGroup.updateInfo method
@
text
@d73 1
a73 1
    public static final  String versionID = "$Id: ProjectGroupEdit.java,v 1.7 2001/02/22 00:28:18 leonardr Exp $";
a95 9
            // If we are returning to this page as a result of an
            // error, we just want to refresh the display, without
            // doing any further action.
            String errorMessage = (String)context.get("Error");
            if (errorMessage != null)
            {
                action = null;
                appendToError(context, errorMessage);
            }
d166 3
a168 3
            Log.error("Exception thrown in ProjectInvite", e);
            appendToError(context, e.getMessage());
            throw new HandlerException(e.getMessage());
d172 1
a172 1
} /* end class ProjectGroupEdit */
@


1.7
log
@Brought into line with UserGroupEdit.
@
text
@d73 1
a73 1
    public static final  String versionID = "$Id: ProjectGroupEdit.java,v 1.6 2001/02/21 01:08:21 dlr Exp $";
d83 1
d116 2
d128 9
a136 1
                    group.updateInfo(acl, shortDescription, longDescription);
@


1.6
log
@This is the highest revision from the HELM_PEER_PORT_BRANCH.  The previous import caused too many conflicts to resolve manually
@
text
@d73 1
a73 1
    public static final  String versionID = "$Id: ProjectGroupEdit.java,v 1.5.2.4 2001/02/16 03:01:26 dlr Exp $";
d83 1
d131 1
d135 1
a135 1
                        if (paramName.startsWith("Remove"))
d140 2
a141 3
                            String projectID = tok.nextToken();
                            Project p = ProjectPeer.getInstance(projectID);
                            group.removeProject(acl, p);
d144 11
a154 2

                    appendToMessage(context, "Removal succeeded.");
@


1.5
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.
d50 1
a53 1
import org.webmacro.util.*;
d56 2
a57 1
import com.workingdogs.village.*;
a58 1
import org.joist.database.JoistDatabaseException;
d60 5
a64 7
import org.tigris.helm.DoesNotExist;
import org.tigris.helm.security.HelmServlet;
import org.joist.security.RedirectException;
import org.tigris.helm.security.AccessControlList;
import org.tigris.helm.security.ACLException;
import org.tigris.helm.domain.ProjectGroup;
import org.tigris.helm.project.Project;
d67 1
a67 1
 * Changes the info for the selected project group. Also removes
d71 1
a71 1
public class ProjectGroupEdit extends org.tigris.helm.security.HelmServlet 
d73 3
a75 3
    public static final  String versionID = "$Id: ProjectGroupEdit.java,v 1.3 2001/01/22 22:56:00 leonardr Exp $";
    private static Log log = new Log("PrjGrpEdit", "Project Group Edit");
    private static boolean debug = true;
a90 1
        
d94 21
d120 1
d123 1
a123 11
                    List missingFields = new ArrayList();
                    List validationErrors = new ArrayList();
                    
                    /* Don't do name until it's supported.
                       String name =
                       processField(context, GROUP_NAME_FIELD, missingFields);
                    */
                    String shortDescription  =
                        processField(context, GROUP_SHORT_DESCRIPTION_FIELD);
                    String longDescription  =
                        processField(context, GROUP_LONG_DESCRIPTION_FIELD);
a129 1
                    ArrayList projectsToRemove = new ArrayList();
d139 2
a140 2
                            projectsToRemove.add(new Project(connection, dMgr,
                                                             projectID));
a143 5
                    for (Iterator i = projectsToRemove.iterator(); i.hasNext();)
                    {
                        Project project = (Project)i.next();
                        group.removeProject(acl, project);
                    }
d146 10
a155 4
            } 
            
        } catch (DataSetException e) {
            log.exception(e);
d157 2
a158 11
        } catch (SQLException e) {
            log.exception(e);
            throw new HandlerException(e.getMessage());
        } catch (JoistDatabaseException e) {
            log.exception(e);
            throw new HandlerException(e.getMessage());
        } catch (DoesNotExist e) {
            log.exception(e);
            throw new HandlerException(e.getMessage());
        }
        return templateName;
a159 1
  
@


1.5.2.1
log
@Porting to the Turbine Peer system.  -dlr and leonardr
@
text
@d75 1
a75 1
    public static final  String versionID = "$Id: ProjectGroupEdit.java,v 1.5 2001/01/26 18:29:02 edk Exp $";
@


1.5.2.2
log
@Adding support for project group manipulation servlets.
@
text
@a49 1

d53 1
d56 3
a58 1
import org.apache.turbine.util.Log;
d60 2
d63 4
a66 5

import org.tigris.helm.security.*;

import org.tigris.helm.om.*;
import org.tigris.helm.om.peer.*;
d69 1
a69 1
 * Changes the info for the selected project group. Also can remove
d73 1
a73 1
public class ProjectGroupEdit extends HelmServlet 
d76 2
a77 2

    private static boolean DEBUG = true;
d93 1
a96 21
            // If we are returning to this page as a result of an
            // error, we just want to refresh the display, without
            // doing any further action.
            String errorMessage = (String)context.get("Error");
            if (errorMessage != null)
            {
                action = null;
                appendToError(context, errorMessage);
            }
            List missingFields = new ArrayList();
            List validationErrors = new ArrayList();

            /* Commented out until project names can be changed.
               String name =
               processField(context, GROUP_NAME_FIELD, missingFields);
            */
            String shortDescription  =
                processField(context, GROUP_SHORT_DESCRIPTION_FIELD);
            String longDescription  =
                processField(context, GROUP_LONG_DESCRIPTION_FIELD);

a101 1

d104 11
a114 1
                    //Change the project group's information.
d121 1
d131 2
a132 2
                            Project p = ProjectPeer.getInstance(projectID);
                            group.removeProject(acl, p);
d136 5
d143 14
a156 5
            }
        } 
        catch (RedirectException e)
        {
            throw e;
d158 1
a158 7
        catch (Exception e)
        {
            Log.error("Exception thrown in ProjectInvite", e);
            appendToError(context, e.getMessage());
            throw new HandlerException(e.getMessage());
        }    
        return templateName;        
d160 1
@


1.5.2.3
log
@Normalized copyright dates.
@
text
@d2 1
a2 1
 * Copyright (c) 2000-2001 CollabNet.  All rights reserved.
d72 1
a72 1
    public static final  String versionID = "$Id: ProjectGroupEdit.java,v 1.5.2.2 2001/02/14 00:34:09 leonardr Exp $";
@


1.5.2.4
log
@Added new imports necessitated by Torque.
@
text
@a63 1
import org.tigris.helm.om.base.*;
d72 1
a72 1
    public static final  String versionID = "$Id: ProjectGroupEdit.java,v 1.5.2.3 2001/02/15 20:50:35 leonardr Exp $";
@


1.4
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.3
log
@Added status messages on successful updates.
@
text
@d75 1
a75 1
    public static final  String versionID = "$Id: ProjectGroupEdit.java,v 1.2 2000/12/18 19:15:54 leonardr Exp $";
@


1.2
log
@Project groups now have summary and description like regular projects.
@
text
@d75 1
a75 1
    public static final  String versionID = "$Id: ProjectGroupEdit.java,v 1.1 2000/11/29 23:57:50 leonardr Exp $";
a115 1
                    log.info("Description is now " + group.getShortDescription());
d117 1
a124 1
                        log.info("Processing " +paramName);
a126 1
                            log.info("Aha! " +paramName);
d141 1
@


1.1
log
@Added project group edit and delete.
@
text
@d75 1
a75 1
    public static final  String versionID = "$Id: ProjectGroupEdit.java,v 1.9 2000/11/28 21:08:23 leonardr Exp $";
d83 2
a84 1
    private static String GROUP_DESCRIPTION_FIELD = "description";
d111 6
a116 4
                    String description  =
                        processField(context, GROUP_DESCRIPTION_FIELD);
                    group.updateInfo(acl, description);
                    log.info("Description is now " + group.getDescription());
@


1.1.1.1
log
@Replacing the HEAD with the HELM_PEER_PORT_BRANCH.
@
text
@d2 1
a2 1
 * Copyright (c) 2000-2001 CollabNet.  All rights reserved.
a49 1

d53 1
d56 3
a58 1
import org.apache.turbine.util.Log;
d60 2
d63 4
a66 6

import org.tigris.helm.security.*;

import org.tigris.helm.om.*;
import org.tigris.helm.om.peer.*;
import org.tigris.helm.om.base.*;
d69 1
a69 1
 * Changes the info for the selected project group. Also can remove
d73 1
a73 1
public class ProjectGroupEdit extends HelmServlet 
d75 3
a77 3
    public static final  String versionID = "$Id: ProjectGroupEdit.java,v 1.5.2.4 2001/02/16 03:01:26 dlr Exp $";

    private static boolean DEBUG = true;
d83 1
a83 2
    private static String GROUP_SHORT_DESCRIPTION_FIELD = "shortDescription";
    private static String GROUP_LONG_DESCRIPTION_FIELD = "longDescription";
d92 1
a95 21
            // If we are returning to this page as a result of an
            // error, we just want to refresh the display, without
            // doing any further action.
            String errorMessage = (String)context.get("Error");
            if (errorMessage != null)
            {
                action = null;
                appendToError(context, errorMessage);
            }
            List missingFields = new ArrayList();
            List validationErrors = new ArrayList();

            /* Commented out until project names can be changed.
               String name =
               processField(context, GROUP_NAME_FIELD, missingFields);
            */
            String shortDescription  =
                processField(context, GROUP_SHORT_DESCRIPTION_FIELD);
            String longDescription  =
                processField(context, GROUP_LONG_DESCRIPTION_FIELD);

a100 1

d103 11
a113 2
                    //Change the project group's information.
                    group.updateInfo(acl, shortDescription, longDescription);
a114 1
                    appendToMessage(context, "Update succeeded.");
d118 1
d122 1
d125 1
d130 2
a131 2
                            Project p = ProjectPeer.getInstance(projectID);
                            group.removeProject(acl, p);
d135 5
a139 1
                    appendToMessage(context, "Removal succeeded.");
d141 14
a154 5
            }
        } 
        catch (RedirectException e)
        {
            throw e;
d156 1
a156 7
        catch (Exception e)
        {
            Log.error("Exception thrown in ProjectInvite", e);
            appendToError(context, e.getMessage());
            throw new HandlerException(e.getMessage());
        }    
        return templateName;        
d158 1
@


