head	1.10;
access;
symbols;
locks; strict;
comment	@# @;


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

1.9
date	2001.08.03.00.37.00;	author ms;	state Exp;
branches;
next	1.8;

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

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

1.6
date	2001.05.21.21.07.45;	author ms;	state Exp;
branches;
next	1.5;

1.5
date	2001.05.21.20.37.57;	author ms;	state Exp;
branches;
next	1.4;

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

1.3
date	2001.05.21.16.52.51;	author dlr;	state Exp;
branches;
next	1.2;

1.2
date	2001.05.05.08.43.59;	author ms;	state Exp;
branches;
next	1.1;

1.1
date	2001.04.14.10.23.17;	author ms;	state Exp;
branches;
next	;


desc
@@


1.10
log
@Upgrading to Turbine 3.0-dev, Fulcrum 1.0, and Torque 1.0.
@
text
@package org.tigris.helm.tool.mail;

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

import org.apache.velocity.context.Context;

import com.quiotix.util.*;
import com.quiotix.util.io.*;

import org.tigris.eyebrowse.core.DelMsg;

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.security.HelmServlet;
import org.tigris.helm.security.AccessControlList;
import org.tigris.helm.tool.ContextAPI;

/**
 * Handles confirmation of message deletion.
 *
 * @@author <a href="mailto:ms@@collab.net">Michael Salmon</a>
 * @@author <a href="mailto:dlr@@collab.net">Daniel Rall</a>
 */
public class EbDelMsg extends HelmServlet
{
    public String processRequest (Context context)
        throws NestableException, RedirectException
    {
        String templateName = super.processRequest(context);
        String confirm = ContextAPI.getParameter(context, "confirm");
        String listName = ContextAPI.getParameter(context, "listName");

        // HelmServlet doesnt put query string data in the context anymore
        context.put("msgId", ContextAPI.getParameter(context, "msgId"));
        context.put("listName", listName);
        try
        {
            if (listName == null)
            {
                throw new NestableException("No list name specified");
            }
            AccessControlList acl = getLoginUser(context).getACL();
            Project currentProject = getCurrentProject(context);
            MailingList ml = MailingListPeer.getInstanceByName(currentProject,
                                                               listName);
            if (!ml.isViewableBy(acl)
                || !acl.hasPermission("Mailing List - Edit"))
            {
                redirectToUnauthorized();
            }
            if (confirm != null && confirm.equals("yes"))
            {
                context = DelMsg.core(context);
                redirectTo("SummarizeList");
            }
        } 
        catch (RedirectException e)
        {
            throw e;
        }
        catch (Exception e)
        {
            throw new NestableException("Error verifying access", e);
        }
        return templateName;
    }
}
@


1.9
log
@eyebrowse handles velocity now
@
text
@d4 1
a4 1
import org.apache.turbine.util.TurbineException;
d31 1
a31 1
        throws TurbineException, RedirectException
d44 1
a44 1
                throw new TurbineException("No list name specified");
d67 1
a67 1
            throw new TurbineException("Error verifying access", e);
@


1.8
log
@Ported Joist Redirect*Exception to Helm.
@
text
@a10 1
import org.tigris.eyebrowse.core.ContextAdaptor;
d20 1
d30 1
a30 1
    public String processRequest(Context ctx)
d33 6
a38 5
        String templateName = super.processRequest(ctx);
        ContextAdaptor context = new EbVelocityContext(ctx);
        String confirm = context.getParameter("confirm");
        String listName = context.getParameter("listName");
        context.put("msgId", context.getParameter("msgId"));
a39 1

d46 2
a47 2
            AccessControlList acl = getLoginUser(ctx).getACL();
            Project currentProject = getCurrentProject(ctx);
d55 1
a55 1
            if(confirm != null && confirm.equals("yes"))
@


1.7
log
@Ported Helm from WebMacro to Velocity.
@
text
@d14 1
a14 1
import org.joist.security.RedirectException;
@


1.6
log
@description not used in these servlets.
@
text
@d3 2
a4 1
import java.sql.Connection;
d6 1
a6 2
import org.webmacro.servlet.WebContext;
import org.webmacro.servlet.HandlerException;
a10 1
import org.tigris.eyebrowse.EyebrowseWMContext;
d17 2
a18 1
import org.tigris.helm.om.MailingListPeer;import org.tigris.helm.om.Project;
d23 2
a24 2
 * EbDelMsg
 * Handles confirmation of message delete
d26 1
a26 1
 * @@version $Id: EbDelMsg.java,v 1.5 2001/05/21 20:37:57 ms Exp $
d30 2
a31 2
    public String processRequest(Connection connection, WebContext ctx)
        throws HandlerException, RedirectException
d33 2
a34 2
        String templateName = super.processRequest(connection, ctx);
        ContextAdaptor context = new EyebrowseWMContext(ctx);
d39 1
d44 1
a44 1
                throw new HandlerException("No listName specified");
d67 1
a67 4
            e.printStackTrace();
            throw new HandlerException(
                "exception verifying access via MailingList obj: " +
                e.getMessage());
a70 1

@


1.5
log
@used description from helm
@
text
@d26 1
a26 1
 * @@version $Id: EbDelMsg.java,v 1.4 2001/05/21 17:19:41 dlr Exp $
a56 1
                context.put("description", ml.getDescription());
@


1.4
log
@HelmServlet methods take a specific type of context object, rather than the adaptor.
@
text
@d26 1
a26 1
 * @@version $Id: EbDelMsg.java,v 1.3 2001/05/21 16:52:51 dlr Exp $
d57 1
@


1.3
log
@Made use of new ContextAdaptor class which was introduced so that EB could play nicely with other types of contexts.
@
text
@d26 1
a26 1
 * @@version $Id: EbDelMsg.java,v 1.2 2001/05/05 08:43:59 ms Exp $
d45 2
a46 2
            AccessControlList acl = getLoginUser(context).getACL();
            Project currentProject = getCurrentProject(context);
@


1.2
log
@skip out if the list isnt passed
@
text
@d8 7
a21 5
import com.quiotix.util.*;
import com.quiotix.util.io.*;

import org.tigris.eyebrowse.core.DelMsg;

d26 1
a26 1
 * @@version $Id: EbDelMsg.java,v 1.1 2001/04/14 10:23:17 ms Exp $
d30 1
a30 1
    public String processRequest(Connection connection, WebContext context) 
d33 5
a37 4
        String templateName = super.processRequest(connection, context);
        String confirm = context.getForm("confirm");
        String listName = context.getForm("listName");
        context.put("msgId",context.getForm("msgId"));
@


1.1
log
@Servlet to manage confirm of message delete from mail archives.
This servlet is linked from EbBrowseList and EbReadList, is it allowed to be
used by the permission Mailing list - Edit, that should probably be changed.
This will require an up and rebuild of eyebrowse.
@
text
@d24 1
a24 1
 * @@version $Id: EbReadMsg.java,v 1.5 2001/03/27 13:20:16 ms Exp $
d38 4
d54 1
a54 1
                redirectTo("BrowseList");
@

