head	1.12;
access;
symbols
	TIGRIS_1_1_0RC2:1.8.6.2
	TIGRIS_1_1_0RC1:1.8.6.2
	TIGRIS_1_1:1.8.6.2.0.2
	TIGRIS_1_0_8:1.8.6.2
	TIGRIS_1_0_8RC3:1.8.6.2
	TIGRIS_1_0_8RC2:1.8.6.1
	TIGRIS_1_0_8RC1:1.8.6.1
	TIGRIS_1_0_7:1.8.6.1
	TIGRIS_1_0_7RC3:1.8.6.1
	TIGRIS_1_0_7RC2:1.8.6.1
	TIGRIS_1_0_7RC1:1.8.6.1
	TIGRIS_1_0_6:1.8.6.1
	TIGRIS_1_0_6RC5:1.8.6.1
	TIGRIS_1_0_6RC4:1.8.6.1
	TIGRIS_1_0_6RC3:1.8.6.1
	TIGRIS_1_0_6RC2:1.8.6.1
	TIGRIS_1_0_6RC1:1.8.6.1
	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.3
	TIGRIS_0_9_2_3:1.3
	HELM_PEER_PORT_BRANCH:1.1.1.2
	TURBINE_PEER:1.6
	TIGRIS_0_9_2_1:1.6
	TIGRIS_0_9_2:1.3.0.4
	TIGRIS_0_9_0:1.3.0.2
	TIGRIS_0_8_4:1.2.0.2
	NEWHELM:1.1.1.1
	TIGRIS_NOV_12_2000:1.1.1;
locks; strict;
comment	@# @;


1.12
date	2001.08.28.17.45.19;	author leonardr;	state Exp;
branches;
next	1.11;

1.11
date	2001.08.11.09.08.09;	author dlr;	state Exp;
branches;
next	1.10;

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

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

1.8
date	2001.03.07.01.53.28;	author lucas;	state Exp;
branches
	1.8.6.1;
next	1.7;

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

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

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

1.4
date	2001.01.25.00.26.08;	author edk;	state Exp;
branches;
next	1.3;

1.3
date	2000.12.14.02.50.36;	author edk;	state Exp;
branches;
next	1.2;

1.2
date	2000.11.13.19.45.21;	author edk;	state Exp;
branches;
next	1.1;

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

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

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

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

1.6.2.2
date	2001.02.20.09.49.21;	author edk;	state Exp;
branches;
next	;

1.8.6.1
date	2001.06.06.17.52.44;	author edk;	state Exp;
branches;
next	1.8.6.2;

1.8.6.2
date	2001.07.14.22.00.59;	author edk;	state Exp;
branches;
next	;


desc
@@


1.12
log
@More methods migrated to ContextAPI.
@
text
@/* ================================================================
 * Copyright (c) 2000 Collab.Net.  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 Collab.Net.
 */


package org.tigris.helm.tool.mail;

import java.sql.*;

import javax.servlet.*;
import javax.servlet.http.*;

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

import org.apache.velocity.context.Context;

import org.tigris.helm.security.RedirectException;

import org.tigris.helm.om.MailingList;
import org.tigris.helm.om.MailingListPeer;import org.tigris.helm.om.Project;
import org.tigris.helm.om.User;
import org.tigris.helm.security.HelmServlet;
import org.tigris.helm.security.AccessControlList;
import org.tigris.helm.tool.ContextAPI;

/**
 * Delete a mailing list (with confirmation).
 *
 * @@author <a href="mailto:edk@@collab.net">Ed Korthof</a>
 * @@version $Id: MailingListDelete.java,v 1.11 2001/08/11 09:08:09 dlr Exp $
 */
public class MailingListDelete extends HelmServlet
{
    private static final boolean debug = true;

    protected String processRequest(Context context)
        throws NestableException, RedirectException
    {
        String templateName = super.processRequest(context);
        // super sets $UserName, Cancel

        Project project = getCurrentProject(context);
        if (project == null)
            redirectToError(context, "MailingListDelete: No project specified");

        String list = ContextAPI.getParameter(context, "list");
        if (list == null)
            redirectToError(context, "MailingListDelete: No list name "+
                    "specified");
        context.put("listname", list);

        String action = (String) context.get("action");

        if (action.equals("Confirm Delete")) {
            try {
                MailingList mList =
                    MailingListPeer.getInstanceByName(project, list);
                User loginUser = getLoginUser(context);
                mList.delete(loginUser.getACL());
            }
            catch (Exception e) {
                throw new NestableException("Error deleting maling list", e);
            }
            redirectTo("ProjectEdit");
        }	
        return templateName;
    }
}
@


1.11
log
@Upgrading to Turbine 3.0-dev, Fulcrum 1.0, and Torque 1.0.
@
text
@d67 1
d73 1
a73 1
 * @@version $Id: MailingListDelete.java,v 1.10 2001/07/18 10:05:16 dlr Exp $
d89 1
a89 1
        String list = getParameter(context, "list");
@


1.10
log
@Ported Joist Redirect*Exception to Helm.
@
text
@d56 1
a56 1
import org.apache.turbine.util.TurbineException;
d72 1
a72 1
 * @@version $Id: MailingListDelete.java,v 1.9 2001/05/23 01:50:22 dlr Exp $
d79 1
a79 1
        throws TurbineException, RedirectException
d104 1
a104 1
                throw new TurbineException("Error deleting maling list", e);
@


1.9
log
@Ported Helm from WebMacro to Velocity.
@
text
@d60 1
a60 1
import org.joist.security.RedirectException;
d72 1
a72 1
 * @@version $Id: MailingListDelete.java,v 1.8 2001/03/07 01:53:28 lucas Exp $
@


1.8
log
@Corrected regex madness for Torque upgrade.  -dlr
@
text
@d50 1
a50 4
import org.webmacro.util.*;
import org.webmacro.servlet.*;
import org.webmacro.engine.*;
import org.webmacro.broker.*;
d55 4
a58 1
import java.sql.*;
d72 1
a72 1
 * @@version $Id: MailingListDelete.java,v 1.7 2001/02/21 01:08:26 dlr Exp $
d74 3
a76 4
public class MailingListDelete extends HelmServlet {
    static private Log log = new Log("pmlDel", "MailingListDelete");
    static private boolean debug = true;

d78 2
a79 2
    protected String processRequest(Connection connection,
            WebContext context) throws HandlerException, RedirectException
d81 1
a81 1
        String templateName = super.processRequest(connection, context);
d88 1
a88 1
        String list = context.getForm("list");
d104 1
a104 4
                log.exception(e);
                String message = "MailingListDelete: " + e.getMessage();
                if (debug) log.debug(message);
                throw new HandlerException(e.getMessage());
d110 1
a110 1
} /* end class MailingListDelete */
@


1.8.6.1
log
@redirect to ProjectMailingListList rather than ProjectEdit (and make this
easier to change).
@
text
@d72 1
a72 1
 * @@version $Id: MailingListDelete.java,v 1.8 2001/03/07 01:53:28 lucas Exp $
a77 1
    static String REDIRECT_SERVLET_KEY = "deleteCompletedServlet";
d110 1
a110 10
            String servletRedirect =
                myProperties.getProperty( REDIRECT_SERVLET_KEY );
            if (servletRedirect == null || servletRedirect.equals(""))
            {
                redirectToHomePage(context);
            }
            else
            {
                redirectTo(servletRedirect);
            }
@


1.8.6.2
log
@use an external redirect rather than an internal one
@
text
@d72 1
a72 1
 * @@version $Id: MailingListDelete.java,v 1.8.6.1 2001/06/06 17:52:44 edk Exp $
d119 1
a119 1
                redirectToURL(context, servletRedirect);
@


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
@d63 1
a63 2
import org.tigris.helm.om.peer.MailingListPeer;
import org.tigris.helm.om.Project;
a64 1

d72 1
a72 1
 * @@version $Id: MailingListDelete.java,v 1.6.2.2 2001/02/20 09:49:21 edk Exp $
@


1.6
log
@readding all the files as part of the process of returning to the way
things were as of tuesday
@
text
@d62 5
a67 2
import org.tigris.helm.project.Project;
import org.tigris.helm.database.MailingListManager;
a68 3
import org.joist.database.DataManager;

import com.workingdogs.village.DataSetException;
d74 1
a74 1
 * @@version $Id: MailingListDelete.java,v 1.3 2000/12/14 02:50:36 edk Exp $
a98 2
        MailingListManager mlMgr = (MailingListManager)
            dMgr.getManager("org.tigris.helm.database.MailingListManager");
d101 4
a104 4
                MailingList mList = 
                    new MailingList(connection, dMgr, project.getID(), list);
                AccessControlList acl = getACL(context, connection);
                mList.delete(acl);
@


1.6.2.1
log
@Porting to the Turbine Peer system.  -dlr and leonardr
@
text
@d74 1
a74 1
 * @@version $Id: MailingListDelete.java,v 1.6 2001/01/26 18:29:11 edk Exp $
@


1.6.2.2
log
@* port MailingList* to the peer system
* add some necessary methods to MailingList, update AnzuTask to use those
* this compiles, but some methods still need to be implemented, so it
  doesn't all work
@
text
@a61 5
import org.tigris.helm.om.MailingList;
import org.tigris.helm.om.peer.MailingListPeer;
import org.tigris.helm.om.Project;
import org.tigris.helm.om.User;

d63 2
d66 3
d99 2
d103 4
a106 4
                MailingList mList =
                    MailingListPeer.getInstanceByName(project, list);
                User loginUser = getLoginUser(context);
                mList.delete(loginUser.getACL());
@


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
@d74 1
a74 1
 * @@version $Id: MailingListDelete.java,v 1.4 2001/01/25 00:26:08 edk Exp $
d104 1
a104 1
                    new MailingList(dMgr, project.getID(), list);
@


1.4
log
@MailingList changes to more closely resemble other business objects (I
don't like certain parts of the pattern, but consistency is more important)
including changes to avoid keeping reference to Connections.
@
text
@d74 1
a74 1
 * @@version $Id: MailingListDelete.java,v 1.3 2000/12/14 02:50:36 edk Exp $
@


1.3
log
@use delete rather than remove where appropriate
@
text
@d74 1
a74 1
 * @@version $Id: MailingListDelete.java,v 1.2 2000/11/13 19:45:21 edk Exp $
d104 1
a104 1
                    new MailingList(connection, dMgr, project.getID(), list);
@


1.2
log
@updates from last night: use ArrayList instead of String[]'s; and correct
Util's prefix pattern
@
text
@d74 1
a74 1
 * @@version $Id: MailingListDelete.java,v 1.4 2000/11/11 11:57:00 edk Exp $
d106 1
a106 1
                mList.remove(acl);
@


1.1
log
@Initial revision
@
text
@@


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
@a61 5
import org.tigris.helm.om.MailingList;
import org.tigris.helm.om.peer.MailingListPeer;
import org.tigris.helm.om.Project;
import org.tigris.helm.om.User;

d63 2
d66 3
d74 1
a74 1
 * @@version $Id: MailingListDelete.java,v 1.6.2.2 2001/02/20 09:49:21 edk Exp $
d99 2
d103 4
a106 4
                MailingList mList =
                    MailingListPeer.getInstanceByName(project, list);
                User loginUser = getLoginUser(context);
                mList.delete(loginUser.getACL());
@

