head	1.15;
access;
symbols
	TIGRIS_1_1_0RC2:1.5.2.1
	TIGRIS_1_1_0RC1:1.5.2.1
	TIGRIS_1_1:1.5.2.1.0.2
	TIGRIS_1_0_8:1.5.2.1
	TIGRIS_1_0_8RC3:1.5.2.1
	TIGRIS_1_0_8RC2:1.5.2.1
	TIGRIS_1_0_8RC1:1.5.2.1
	TIGRIS_1_0_7:1.5.2.1
	TIGRIS_1_0_7RC3:1.5.2.1
	TIGRIS_1_0_7RC2:1.5.2.1
	TIGRIS_1_0_7RC1:1.5.2.1
	TIGRIS_1_0_6:1.5.2.1
	TIGRIS_1_0_6RC5:1.5.2.1
	TIGRIS_1_0_6RC4:1.5.2.1
	TIGRIS_1_0_6RC3:1.5.2.1
	TIGRIS_1_0_6RC2:1.5.2.1
	TIGRIS_1_0_6RC1:1.5.2.1
	TIGRIS_1_0_5:1.5.2.1
	TIGRIS_1_0_5RC6:1.5.2.1
	TIGRIS_1_0_5RC5:1.5.2.1
	TIGRIS_1_0_5RC4:1.5.2.1
	TIGRIS_1_0_5RC3:1.5.2.1
	TIGRIS_1_0_5RC2:1.5.2.1
	TIGRIS_1_0_5RC1:1.5.2.1
	TIGRIS_1_0_4:1.5.2.1
	TIGRIS_1_0_3:1.5.2.1
	TIGRIS_1_0_2:1.5.2.1
	TIGRIS_1_0_1:1.5.2.1
	TIGRIS_1_0:1.5.2.1.0.4
	TIGRIS_1_0_0:1.5.2.1
	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.15
date	2001.08.11.09.08.09;	author dlr;	state Exp;
branches;
next	1.14;

1.14
date	2001.08.09.22.07.29;	author ms;	state Exp;
branches;
next	1.13;

1.13
date	2001.08.03.00.37.00;	author ms;	state Exp;
branches;
next	1.12;

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

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

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

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

1.8
date	2001.05.05.08.43.59;	author ms;	state Exp;
branches;
next	1.7;

1.7
date	2001.04.16.18.38.37;	author ms;	state Exp;
branches;
next	1.6;

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

1.5
date	2001.03.27.13.20.16;	author ms;	state Exp;
branches
	1.5.2.1;
next	1.4;

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

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

1.2
date	2001.02.21.01.08.26;	author dlr;	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.22;	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	1.1.2.3;

1.1.2.3
date	2001.02.16.03.01.36;	author dlr;	state Exp;
branches;
next	;

1.5.2.1
date	2001.03.29.01.26.14;	author ms;	state Exp;
branches;
next	;


desc
@@


1.15
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 org.tigris.helm.security.RedirectException;

import org.tigris.eyebrowse.core.BrowseList;

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

/**
 * Browse mailing lists.
 *
 * @@author <a href="mailto:ms@@collab.net">Michael Salmon</a>
 * @@author <a href="mailto:dlr@@collab.net">Daniel Rall</a>
 * @@version $Id: EbBrowseList.java,v 1.14 2001/08/09 22:07:29 ms Exp $
 */
public class EbBrowseList extends HelmServlet
{
    public static final int WINDOW_SIZE = 21;

    public String processRequest(Context context)
        throws NestableException, RedirectException
    {
        String templateName = super.processRequest(context);
        String listName = ContextAPI.getParameter(context, "listName");
        context.put("by", ContextAPI.getParameter(context, "by"));
        context.put("from", ContextAPI.getParameter(context, "from"));
        context.put("to", ContextAPI.getParameter(context, "to"));
        context.put("first", ContextAPI.getParameter(context, "first"));
        context.put("count", ContextAPI.getParameter(context, "count"));
        context.put("windowSize", 
                    ContextAPI.getParameter(context, "windowSize"));

        //verify that the list is in the same project as the current project.
        AccessControlList acl = null;
        try 
        {
            if (listName == null)
            {
                throw new NestableException("No list name specified");
            }
            acl = getLoginUser(context).getACL();
            Project currentProject = getCurrentProject(context);
            MailingList ml = MailingListPeer.getInstanceByName(currentProject, 
                                                               listName);
            if (!ml.isViewableBy(acl)) 
            {
                redirectToUnauthorized();
            }
            if (acl.hasPermission("Mailing List - Edit"))
            {
                context.put("admin", "true");
            } 
            context.put("fullListName", ml.getAddress(null));
            BrowseList.core(context);
            context.put("listName", listName);
        } 
        catch (RedirectException e) 
        {
            throw e;
        }
        catch (Exception e) 
        {
            throw new NestableException("Error verifying access", e);
        }
        return templateName;
    }
}
@


1.14
log
@adding new better paging system for list browsing
@
text
@d4 1
a4 1
import org.apache.turbine.util.TurbineException;
d22 1
a22 1
 * @@version $Id: EbBrowseList.java,v 1.13 2001/08/03 00:37:00 ms Exp $
d29 1
a29 1
        throws TurbineException, RedirectException
d47 1
a47 1
                throw new TurbineException("No list name specified");
d71 1
a71 1
            throw new TurbineException("Error verifying access", e);
@


1.13
log
@eyebrowse handles velocity now
@
text
@d22 1
a22 1
 * @@version $Id: EbBrowseList.java,v 1.12 2001/07/18 10:05:16 dlr Exp $
d38 2
@


1.12
log
@Ported Joist Redirect*Exception to Helm.
@
text
@a10 1
import org.tigris.eyebrowse.core.ContextAdaptor;
d15 1
d22 1
a22 1
 * @@version $Id: EbBrowseList.java,v 1.11 2001/05/23 01:50:22 dlr Exp $
d26 1
a26 1
  public static final int WINDOW_SIZE = 21;
d28 2
a29 10
  public String processRequest(Context ctx)
      throws TurbineException, RedirectException
  {
    String templateName = super.processRequest(ctx);
    ContextAdaptor context = new EbVelocityContext(ctx);
    String listName = context.getParameter("listName");
    context.put("listName", listName);
    //verify that the list is in the same project as the current project.
    AccessControlList acl = null;
    try 
d31 11
a41 1
        if (listName == null)
d43 21
a63 7
            throw new TurbineException("No list name specified");
        }
        acl = getLoginUser(ctx).getACL();
        Project currentProject = getCurrentProject(ctx);
        MailingList ml = MailingListPeer.getInstanceByName(currentProject, 
                                                           listName);
        if (!ml.isViewableBy(acl)) 
d65 1
a65 1
            redirectToUnauthorized();
d67 1
a67 1
        if (acl.hasPermission("Mailing List - Edit"))
d69 1
a69 1
            context.put("admin", "true");
d71 1
a71 10
        context.put("fullListName", ml.getAddress(null));
        BrowseList.core(context);
    } 
    catch (RedirectException e) 
    {
        throw e;
    }
    catch (Exception e) 
    {
        throw new TurbineException("Error verifying access", e);
a72 2
    return templateName;
  }
@


1.11
log
@Ported Helm from WebMacro to Velocity.
@
text
@d8 1
a8 1
import org.joist.security.RedirectException;
d22 1
a22 1
 * @@version $Id: EbBrowseList.java,v 1.10 2001/05/21 17:19:41 dlr Exp $
@


1.10
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;
d22 1
a22 1
 * @@version $Id: EbBrowseList.java,v 1.9 2001/05/21 16:52:51 dlr Exp $
d28 2
a29 2
  public String processRequest(Connection connection, WebContext ctx)
    throws HandlerException, RedirectException
d31 2
a32 2
    String templateName = super.processRequest(connection, ctx);
    ContextAdaptor context = new EyebrowseWMContext(ctx);
d41 1
a41 1
            throw new HandlerException("No listName specified");
d56 1
d64 1
a64 4
        e.printStackTrace();
        throw new HandlerException(
                "exception verifying access via MailingList obj: " +
                e.getMessage());
a65 1
    context = BrowseList.core(context);
@


1.9
log
@Made use of new ContextAdaptor class which was introduced so that EB could play nicely with other types of contexts.
@
text
@d23 1
a23 1
 * @@version $Id: EbBrowseList.java,v 1.8 2001/05/05 08:43:59 ms Exp $
d44 2
a45 2
        acl = getLoginUser(context).getACL();
        Project currentProject = getCurrentProject(context);
@


1.8
log
@skip out if the list isnt passed
@
text
@d10 4
a16 2
import org.tigris.eyebrowse.core.BrowseList;

d23 1
a23 1
 * @@version $Id: EbBrowseList.java,v 1.7 2001/04/16 18:38:37 ms Exp $
d29 1
a29 1
  public String processRequest(Connection connection, WebContext context) 
d32 3
a34 2
    String templateName = super.processRequest(connection, context);
    String listName = context.getForm("listName");
@


1.7
log
@
PR:
Obtained from:
Submitted by:
Reviewed by:
@
text
@d21 1
a21 1
 * @@version $Id: EbBrowseList.java,v 1.6 2001/03/28 01:58:02 ms Exp $
d37 4
@


1.6
log
@use method to get address that i didnt know of previously
@
text
@d12 1
d21 1
a21 1
 * @@version $Id: EbBrowseList.java,v 1.5 2001/03/27 13:20:16 ms Exp $
d34 1
d37 1
d41 1
a41 1
        if (!ml.isViewableBy(getLoginUser(context).getACL())) 
d44 4
@


1.5
log
@Changed in eyebrowse the ability to lookup lists by both listId and by listName.
Greatly cleans up the coupling between the archives and helm IMO.

I also removed the useless projecID's in the templates.

This requires an update in eyebrowse also to compile.

note: SearchList is now a bit broken, will be fixed tomorow..

QA note. i tested this with two different lists, browsed by date author etc, it
showed no problems that dont already exist (date browsing).
@
text
@d20 1
a20 1
 * @@version $Id: EbBrowseList.java,v 1.4 2001/03/10 07:52:57 edk Exp $
d42 1
a42 5
        context.put("fullListName", 
                    ml.getEmailPrefix() + "@@" 
                    + currentProject.getName()
                    + "." + getCurrentDomain(context).getName() 
                    );
@


1.5.2.1
log
@Committing diff from head. basically more efficient gathering of
list address.
@
text
@d20 1
a20 1
 * @@version $Id: EbBrowseList.java,v 1.6 2001/03/28 01:58:02 ms Exp $
d42 5
a46 1
        context.put("fullListName", ml.getAddress(null));
@


1.4
log
@check isViewableBy, which helps us do a better job enforcing permissions
as well as the isPrivate flag
@
text
@d20 1
a20 1
 * @@version $Id: EbBrowseList.java,v 1.3 2001/03/07 01:53:28 lucas Exp $
d30 28
a57 14
    String listId = context.getForm("listId");
    try { //verify that the list is in the same project as the current project.
      Project currentProject = getCurrentProject(context);
      MailingList ml = MailingListPeer.getInstance(currentProject, listId);
      if (!ml.isViewableBy(getLoginUser(context).getACL())) {
        redirectToUnauthorized();
      }
    } catch (RedirectException e) {
      throw e;
    } catch (Exception e) {
      e.printStackTrace();
      throw new HandlerException(
          "exception verifying access via MailingList obj: " +
          e.getMessage());
@


1.3
log
@Corrected regex madness for Torque upgrade.  -dlr
@
text
@d20 1
a20 1
 * @@version $Id: EbBrowseList.java,v 1.2 2001/02/21 01:08:26 dlr Exp $
d34 3
@


1.2
log
@This is the highest revision from the HELM_PEER_PORT_BRANCH.  The previous import caused too many conflicts to resolve manually
@
text
@a10 2
import org.tigris.helm.om.peer.*;
import org.tigris.helm.om.base.*;
d20 1
a20 1
 * @@version $Id: EbBrowseList.java,v 1.1.2.3 2001/02/16 03:01:36 dlr Exp $
@


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
@a0 45
/* ================================================================
 * 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.
 */
a2 3
import org.tigris.helm.tool.mail.MailingList;
import org.tigris.helm.project.Project;

a3 2
import org.tigris.helm.security.HelmServlet;
import org.joist.security.RedirectException;
d8 6
d17 7
a30 1
System.err.println("BROWSE 1");
a32 1
System.err.println("BROWSE 1");
d35 1
a35 2
      MailingList ml = new MailingList(connection,
          getDataManager(context), listId, currentProject);
@


1.1.1.1
log
@Replacing the HEAD with the HELM_PEER_PORT_BRANCH.
@
text
@d1 45
d48 3
d52 2
a57 6
import org.joist.security.RedirectException;

import org.tigris.helm.om.*;
import org.tigris.helm.om.peer.*;
import org.tigris.helm.om.base.*;
import org.tigris.helm.security.HelmServlet;
a60 7
/**
 * Browse mailing lists.
 *
 * @@author <a href="mailto:ms@@collab.net">Michael Salmon</a>
 * @@author <a href="mailto:dlr@@collab.net">Daniel Rall</a>
 * @@version $Id: EbBrowseList.java,v 1.1.2.3 2001/02/16 03:01:36 dlr Exp $
 */
d68 1
d71 1
d74 2
a75 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 45
d48 3
d52 2
a57 5
import org.joist.security.RedirectException;

import org.tigris.helm.om.*;
import org.tigris.helm.om.peer.*;
import org.tigris.helm.security.HelmServlet;
a60 7
/**
 * Browse mailing lists.
 *
 * @@author <a href="mailto:ms@@collab.net">Michael Salmon</a>
 * @@author <a href="mailto:dlr@@collab.net">Daniel Rall</a>
 * @@version $Id: EbBrowseList.java,v 1.3.6.1 2001/02/09 20:40:59 dlr Exp $
 */
d68 1
d71 1
d74 2
a75 1
      MailingList ml = MailingListPeer.getInstance(currentProject, listId);
@


1.1.2.3
log
@Added new imports necessitated by Torque.
@
text
@a11 1
import org.tigris.helm.om.base.*;
d21 1
a21 1
 * @@version $Id: EbBrowseList.java,v 1.1.2.2 2001/02/13 13:19:38 ms Exp $
@


