head	1.11;
access;
symbols
	TIGRIS_1_1_0RC2:1.5
	TIGRIS_1_1_0RC1:1.5
	TIGRIS_1_1:1.5.0.4
	TIGRIS_1_0_8:1.5
	TIGRIS_1_0_8RC3:1.5
	TIGRIS_1_0_8RC2:1.5
	TIGRIS_1_0_8RC1:1.5
	TIGRIS_1_0_7:1.5
	TIGRIS_1_0_7RC3:1.5
	TIGRIS_1_0_7RC2:1.5
	TIGRIS_1_0_7RC1:1.5
	TIGRIS_1_0_6:1.5
	TIGRIS_1_0_6RC5:1.5
	TIGRIS_1_0_6RC4:1.5
	TIGRIS_1_0_6RC3:1.5
	TIGRIS_1_0_6RC2:1.5
	TIGRIS_1_0_6RC1:1.5
	TIGRIS_1_0_5:1.5
	TIGRIS_1_0_5RC6:1.5
	TIGRIS_1_0_5RC5:1.5
	TIGRIS_1_0_5RC4:1.5
	TIGRIS_1_0_5RC3:1.5
	TIGRIS_1_0_5RC2:1.5
	TIGRIS_1_0_5RC1:1.5
	TIGRIS_1_0_4:1.5
	TIGRIS_1_0_3:1.5
	TIGRIS_1_0_2:1.5
	TIGRIS_1_0_1:1.5
	TIGRIS_1_0:1.5.0.6
	TIGRIS_1_0_0:1.5
	TIGRIS_1_0_0_RC1:1.5.0.2
	dlr:1.1.1
	HELM_PEER_PORT_BRANCH:1.1.1.1;
locks; strict;
comment	@# @;


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

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

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

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

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

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

1.5
date	2001.03.10.07.52.57;	author edk;	state Exp;
branches;
next	1.4;

1.4
date	2001.03.07.01.53.28;	author lucas;	state Exp;
branches;
next	1.3;

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

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

1.1
date	2001.02.13.12.26.39;	author ms;	state Exp;
branches
	1.1.1.1
	1.1.2.1;
next	;

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

1.1.2.1
date	2001.02.13.13.03.59;	author ms;	state Exp;
branches;
next	1.1.2.2;

1.1.2.2
date	2001.02.13.13.19.38;	author ms;	state Exp;
branches;
next	;


desc
@@


1.11
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 org.tigris.eyebrowse.core.ViewLists;

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.tool.ContextAPI;

/**
 * ViewListsServlet
 * A thin wrapper around the logic in org.tigris.eyebrowse.core.ViewLists 
 *
 * @@author <a href="mailto:ms@@collab.net">Michael Salmon</a>
 * @@author <a href="mailto:dlr@@collab.net">Daniel Rall</a>
 * @@version $Id: EbViewLists.java,v 1.10 2001/08/03 00:37:00 ms Exp $
 */
public class EbViewLists extends HelmServlet
{
    public String processRequest(Context context)
        throws NestableException, RedirectException 
    {
        String templateName = super.processRequest(context);
        String listName = ContextAPI.getParameter(context, "listName");

        //verify that the list is in the same project as the current project.
        try 
        { 
            Project currentProject = getCurrentProject(context);
            MailingList ml = MailingListPeer.getInstance(currentProject, listName);
            if (!ml.isViewableBy(getLoginUser(context).getACL()))
            {
                redirectToUnauthorized();
            }
            context = ViewLists.core(context);
        }
        catch (RedirectException e)
        {
            throw e;
        }
        catch (Exception e)
        {
            throw new NestableException("Error verifying access", e);
        }
        return templateName;
    }
}
@


1.10
log
@eyebrowse handles velocity now
@
text
@d4 1
a4 1
import org.apache.turbine.util.TurbineException;
d26 1
a26 1
 * @@version $Id: EbViewLists.java,v 1.9 2001/07/18 10:05:16 dlr Exp $
d31 1
a31 1
        throws TurbineException, RedirectException 
d53 1
a53 1
            throw new TurbineException("Error verifying access", e);
@


1.9
log
@Ported Joist Redirect*Exception to Helm.
@
text
@a9 1
import org.tigris.eyebrowse.core.ContextAdaptor;
d18 1
d26 1
a26 1
 * @@version $Id: EbViewLists.java,v 1.8 2001/05/23 01:50:22 dlr Exp $
d30 26
a55 17
  public String processRequest(Context ctx)
    throws TurbineException, RedirectException 
  {
    String templateName = super.processRequest(ctx);
    ContextAdaptor context = new EbVelocityContext(ctx);
    String listId = context.getParameter("listId");
    try { //verify that the list is in the same project as the current project.
      Project currentProject = getCurrentProject(ctx);
      MailingList ml = MailingListPeer.getInstance(currentProject, listId);
      if (!ml.isViewableBy(getLoginUser(ctx).getACL())) {
        redirectToUnauthorized();
      }
      context = ViewLists.core(context);
    } catch (RedirectException e) {
      throw e;
    } catch (Exception e) {
        throw new TurbineException("Error verifying access", e);
a56 2
    return templateName;
  }
@


1.8
log
@Ported Helm from WebMacro to Velocity.
@
text
@d13 1
a13 1
import org.joist.security.RedirectException;
d26 1
a26 1
 * @@version $Id: EbViewLists.java,v 1.7 2001/05/21 17:19:41 dlr Exp $
@


1.7
log
@HelmServlet methods take a specific type of context object, rather than the adaptor.
@
text
@d3 2
a4 1
import java.sql.Connection;
d6 1
a6 2
import org.webmacro.servlet.WebContext;
import org.webmacro.servlet.HandlerException;
a9 1
import org.tigris.eyebrowse.EyebrowseWMContext;
d26 1
a26 1
 * @@version $Id: EbViewLists.java,v 1.6 2001/05/21 16:52:51 dlr 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);
d42 1
d46 1
a46 4
      e.printStackTrace();
      throw new HandlerException(
          "exception verifying access via MailingList obj: " +
          e.getMessage());
a47 1
    context = ViewLists.core(context);
@


1.6
log
@Made use of new ContextAdaptor class which was introduced so that EB could play nicely with other types of contexts.
@
text
@d27 1
a27 1
 * @@version $Id: EbViewLists.java,v 1.5 2001/03/10 07:52:57 edk Exp $
d38 1
a38 1
      Project currentProject = getCurrentProject(context);
d40 1
a40 1
      if (!ml.isViewableBy(getLoginUser(context).getACL())) {
@


1.5
log
@check isViewableBy, which helps us do a better job enforcing permissions
as well as the isPrivate flag
@
text
@d8 6
d17 2
a18 1
import org.tigris.helm.om.MailingListPeer;import org.tigris.helm.om.Project;
a19 3
import org.tigris.eyebrowse.core.ViewLists;

import com.quiotix.util.*;
d27 1
a27 1
 * @@version $Id: EbViewLists.java,v 1.4 2001/03/07 01:53:28 lucas Exp $
d31 1
a31 1
  public String processRequest(Connection connection, WebContext context) 
d34 3
a36 2
    String templateName = super.processRequest(connection, context);
    String listId = context.getForm("listId");
@


1.4
log
@Corrected regex madness for Torque upgrade.  -dlr
@
text
@d23 1
a23 1
 * @@version $Id: EbViewLists.java,v 1.3 2001/02/21 01:08:26 dlr Exp $
d35 3
@


1.3
log
@This is the highest revision from the HELM_PEER_PORT_BRANCH.  The previous import caused too many conflicts to resolve manually
@
text
@d11 1
a11 2
import org.tigris.helm.om.peer.MailingListPeer;
import org.tigris.helm.om.Project;
d23 1
a23 1
 * @@version $Id: EbViewLists.java,v 1.1.2.2 2001/02/13 13:19:38 ms Exp $
@


1.2
log
@bad package
@
text
@a0 33
/*
 * Copyright (c) 2000, Quiotix Corporation
 *        All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 * 
 *      Redistributions of source code must retain the above copyright
 * notice, this list of conditions and the following disclaimer.
 * 
 *      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.
 * 
 *      Neither name of Quiotix Corporation nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * ``AS IS'' AND ANY EXPRESS 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 COPYRIGHT
 * HOLDER OR 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.
 */


d3 1
a3 2
import org.tigris.helm.tool.mail.MailingList;
import org.tigris.helm.project.Project;
a4 1
import org.tigris.helm.security.HelmServlet;
d10 4
a13 2
import java.sql.Connection;

d21 5
a25 2
 * @@author Michael Salmon
*/
d35 1
a35 2
      MailingList ml = new MailingList(connection,
          getDataManager(context), listId, currentProject);
@


1.1
log
@Adding these to helm for logical organization and for build depdancy
flow. To install these servlets eyebrowse must be built and installed
with the helm top-level make target's "eyebrowse" and
"eyebrowse-install". If succesful these servlets will be installed also.
@
text
@d34 1
a34 1
package org.tigris.eyebrowse.helmservlets;
@


1.1.1.1
log
@Replacing the HEAD with the HELM_PEER_PORT_BRANCH.
@
text
@d1 34
a34 1
package org.tigris.helm.tool.mail;
d36 2
a37 1
import java.sql.Connection;
d39 1
d45 2
a46 4
import org.tigris.helm.om.MailingList;
import org.tigris.helm.om.peer.MailingListPeer;
import org.tigris.helm.om.Project;
import org.tigris.helm.security.HelmServlet;
d54 2
a55 5
 *
 * @@author <a href="mailto:ms@@collab.net">Michael Salmon</a>
 * @@author <a href="mailto:dlr@@collab.net">Daniel Rall</a>
 * @@version $Id: EbViewLists.java,v 1.1.2.2 2001/02/13 13:19:38 ms Exp $
 */
d65 2
a66 1
      MailingList ml = MailingListPeer.getInstance(currentProject, listId);
@


1.1.2.1
log
@Ported changes to HEAD to branch. Moved servlets into logical container
of org.tigris.helm.tool.mail and changed build system and jserv config
to match changes.
@
text
@@


1.1.2.2
log
@Merged Dlr's eyebrowse servlets that follow the peer model into helm.
@
text
@d1 34
a34 1
package org.tigris.helm.tool.mail;
d36 2
a37 1
import java.sql.Connection;
d39 1
d45 2
a46 4
import org.tigris.helm.om.MailingList;
import org.tigris.helm.om.peer.MailingListPeer;
import org.tigris.helm.om.Project;
import org.tigris.helm.security.HelmServlet;
d54 2
a55 5
 *
 * @@author <a href="mailto:ms@@collab.net">Michael Salmon</a>
 * @@author <a href="mailto:dlr@@collab.net">Daniel Rall</a>
 * @@version $Id: EbViewLists.java,v 1.3.6.1 2001/02/09 20:51:44 dlr Exp $
 */
d65 2
a66 1
      MailingList ml = MailingListPeer.getInstance(currentProject, listId);
@


