head	1.15;
access;
symbols
	TIGRIS_1_1_0RC2:1.7
	TIGRIS_1_1_0RC1:1.7
	TIGRIS_1_1:1.7.0.4
	TIGRIS_1_0_8:1.7
	TIGRIS_1_0_8RC3:1.7
	TIGRIS_1_0_8RC2:1.7
	TIGRIS_1_0_8RC1:1.7
	TIGRIS_1_0_7:1.7
	TIGRIS_1_0_7RC3:1.7
	TIGRIS_1_0_7RC2:1.7
	TIGRIS_1_0_7RC1:1.7
	TIGRIS_1_0_6:1.7
	TIGRIS_1_0_6RC5:1.7
	TIGRIS_1_0_6RC4:1.7
	TIGRIS_1_0_6RC3:1.7
	TIGRIS_1_0_6RC2:1.7
	TIGRIS_1_0_6RC1:1.7
	TIGRIS_1_0_5:1.7
	TIGRIS_1_0_5RC6:1.7
	TIGRIS_1_0_5RC5:1.7
	TIGRIS_1_0_5RC4:1.7
	TIGRIS_1_0_5RC3:1.7
	TIGRIS_1_0_5RC2:1.7
	TIGRIS_1_0_5RC1:1.7
	TIGRIS_1_0_4:1.7
	TIGRIS_1_0_3:1.7
	TIGRIS_1_0_2:1.7
	TIGRIS_1_0_1:1.7
	TIGRIS_1_0:1.7.0.6
	TIGRIS_1_0_0:1.7
	TIGRIS_1_0_0_RC1:1.7.0.2
	TIGRIS_0_9_2_4:1.3
	TIGRIS_0_9_2_3:1.3
	HELM_PEER_PORT_BRANCH:1.5.0.2
	TURBINE_PEER:1.5
	TIGRIS_0_9_2_1:1.5
	TIGRIS_0_9_2:1.3.0.4
	TIGRIS_0_9_0:1.3.0.2;
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.07.20.53.12;	author leonardr;	state Exp;
branches;
next	1.13;

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

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

1.11
date	2001.07.18.10.17.30;	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.07.17.20.54.07;	author leonardr;	state Exp;
branches;
next	1.8;

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

1.7
date	2001.02.21.05.04.17;	author edk;	state Exp;
branches;
next	1.6;

1.6
date	2001.02.21.04.09.25;	author edk;	state Exp;
branches;
next	1.5;

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

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

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

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

1.1
date	2000.12.13.19.37.04;	author leonardr;	state Exp;
branches;
next	;

1.5.2.1
date	2001.01.28.01.02.19;	author dlr;	state dead;
branches;
next	;


desc
@@


1.15
log
@Upgrading to Turbine 3.0-dev, Fulcrum 1.0, and Torque 1.0.
@
text
@/* ================================================================
 * Copyright (c) 2000 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.tool.audit;

import java.util.*;
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.tool.SessionManager;
import org.tigris.helm.tool.ContextAPI;
import org.tigris.helm.om.*;
import org.tigris.helm.security.*;

/**
 * View or add rationale to an audit event.
 *
 * @@author <a href="mailto:leonardr@@collab.net">Leonard Richardson</a>
 * @@version $Id: AuditEventDetail.java,v 1.14 2001/08/07 20:53:12 leonardr Exp $
 */
public class AuditEventDetail extends org.tigris.helm.security.HelmServlet 
{
    private static String ADD_TO_RATIONALE_ACTION="Append to Rationale";
    private static String RATIONALE_APPEND_FIELD="rationaleAppend";
    
    /**
     *  Add to rationale, if such is specified.
     */
    protected String processRequest(Context context)
        throws NestableException, RedirectException
    {
        String templateName = super.processRequest(context);
        try 
        {
            String action = getAction(context);

            AuditLogEntry entry = getCurrentAuditLogEntry(context);

            // Gather any user input, adding it to the context as well.
            String rationaleAdd = ContextAPI.processField
                (context, RATIONALE_APPEND_FIELD, "");
            if (ADD_TO_RATIONALE_ACTION.equals(action))
            {
                if (rationaleAdd.equals(""))
                {
                    ContextAPI.addError
                        (context,
                         "You must provide some text to add to the rationale.");
                }
                if (ContextAPI.isValidUserInput(context))
                {
                    entry.appendToRationale(rationaleAdd);
                }
            }
        } 
        catch (Exception e) 
        {
            Log.error(e);
            throw new NestableException(e);
        }

        return templateName;  
    }
}
@


1.14
log
@Got rid of lingering Webmacro dependencies.
@
text
@d54 1
a54 1
import org.apache.turbine.util.TurbineException;
d67 1
a67 1
 * @@version $Id: AuditEventDetail.java,v 1.13 2001/07/24 00:02:28 leonardr Exp $
d78 1
a78 1
        throws TurbineException, RedirectException
d107 1
a107 1
            throw new TurbineException(e);
@


1.13
log
@The final pieces of the error handling revolution.
@
text
@a55 1
import org.webmacro.util.*;
d67 1
a67 1
 * @@version $Id: AuditEventDetail.java,v 1.12 2001/07/19 19:54:06 dlr Exp $
@


1.12
log
@Removed Joist references.
@
text
@d68 1
a68 1
 * @@version $Id: AuditEventDetail.java,v 1.11 2001/07/18 10:17:30 dlr Exp $
a84 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;
                appendToMessage(context, errorMessage);
            }
@


1.11
log
@clean up
@
text
@a58 3
import org.joist.*;
import org.joist.util.*;

d68 1
a68 1
 * @@version $Id: AuditEventDetail.java,v 1.10 2001/07/18 10:05:16 dlr Exp $
@


1.10
log
@Ported Joist Redirect*Exception to Helm.
@
text
@d50 3
a54 6
import org.apache.turbine.util.TurbineException;

import java.util.*;
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
d61 1
a63 3

import org.tigris.helm.security.RedirectException;

d71 1
a71 1
 * @@version $Id: AuditEventDetail.java,v 1.9 2001/07/17 20:54:07 leonardr Exp $
a74 2
    public static final  String versionID = "$Id: AuditEventDetail.java,v 1.9 2001/07/17 20:54:07 leonardr Exp $";

d82 1
a82 1
	throws TurbineException, RedirectException
d84 1
a84 1
	String templateName = super.processRequest(context);
d125 1
a125 4

} /* end class AuditEventDetail */


@


1.9
log
@Cleanup for port to new error handling system.
@
text
@d67 1
a67 1
import org.joist.security.RedirectException;
d76 1
a76 1
 * @@version $Id: AuditEventDetail.java,v 1.8 2001/05/23 01:50:21 dlr Exp $
d80 1
a80 1
    public static final  String versionID = "$Id: AuditEventDetail.java,v 1.8 2001/05/23 01:50:21 dlr Exp $";
@


1.8
log
@Ported Helm from WebMacro to Velocity.
@
text
@d65 1
d76 1
a76 1
 * @@version $Id: AuditEventDetail.java,v 1.7 2001/02/21 05:04:17 edk Exp $
d80 1
a80 1
    public static final  String versionID = "$Id: AuditEventDetail.java,v 1.7 2001/02/21 05:04:17 edk Exp $";
d108 3
a110 4
            ArrayList missingFields = new ArrayList();
            ArrayList validationErrors = new ArrayList();
            String rationaleAdd = processField(context, RATIONALE_APPEND_FIELD, "");
            if (action != null && action.equals(ADD_TO_RATIONALE_ACTION))
d114 3
a116 1
                    validationErrors.add("You must provide some text to add to the rationale.");
d118 1
a118 1
                if (isValidUserInput(missingFields, validationErrors))
a120 4
                } else {
                    // Report missing fields and validation errors.
                    reportInvalidUserInput(context, missingFields, 
                                           validationErrors);
d123 3
a125 1
        } catch (Exception e) {
@


1.7
log
@fix import and catch
@
text
@d51 2
d60 1
a60 1
import org.webmacro.servlet.*;
d64 1
a64 1
import org.joist.session.*;
d75 1
a75 1
 * @@version $Id: AuditEventDetail.java,v 1.6 2001/02/21 04:09:25 edk Exp $
d79 1
a79 1
    public static final  String versionID = "$Id: AuditEventDetail.java,v 1.6 2001/02/21 04:09:25 edk Exp $";
d87 2
a88 2
    protected String processRequest (Connection connection, WebContext context)
	throws HandlerException, RedirectException
d90 1
a90 1
	String templateName = super.processRequest(connection, context);
d127 1
a127 1
            throw new HandlerException(e.getMessage());
@


1.6
log
@use the peer port objects
@
text
@d50 2
d73 1
a73 1
 * @@version $Id: AuditEventDetail.java,v 1.5 2001/01/26 18:29:11 edk Exp $
d77 1
a77 1
    public static final  String versionID = "$Id: AuditEventDetail.java,v 1.5 2001/01/26 18:29:11 edk Exp $";
d123 1
a123 1
        } catch (aSetException e) {
@


1.5
log
@readding all the files as part of the process of returning to the way
things were as of tuesday
@
text
@a61 2
import com.workingdogs.village.*;

a62 1
import org.joist.database.*;
d64 1
a64 1
import org.tigris.helm.business.*;
d71 1
a71 1
 * @@version $Id: AuditEventDetail.java,v 1.3 2000/12/13 22:44:23 leonardr Exp $
d75 1
a75 1
    public static final  String versionID = "$Id: AuditEventDetail.java,v 1.3 2000/12/13 22:44:23 leonardr Exp $";
a76 3
    private static Log log = new Log("AuditEvent", "Audit Event Detail servlet");
    private static boolean debug = true;
    
d121 2
a122 5
        } catch (DataSetException e) {
            log.exception(e);
            throw new HandlerException(e.getMessage());
        } catch (SQLException e) {
            log.exception(e);
@


1.5.2.1
log
@Porting to the Turbine Peer system.  -dlr and leonardr
@
text
@d74 1
a74 1
 * @@version $Id: AuditEventDetail.java,v 1.5 2001/01/26 18:29:11 edk Exp $
d78 1
a78 1
    public static final  String versionID = "$Id: AuditEventDetail.java,v 1.5 2001/01/26 18:29:11 edk 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
@Rationale append works now.
@
text
@d74 1
a74 1
 * @@version $Id: AuditEventDetail.java,v 1.2 2000/12/13 22:05:13 leonardr Exp $
d78 1
a78 1
    public static final  String versionID = "$Id: AuditEventDetail.java,v 1.2 2000/12/13 22:05:13 leonardr Exp $";
@


1.2
log
@More work on AuditEventDetail.
@
text
@d74 1
a74 1
 * @@version $Id: AuditEventDetail.java,v 1.1 2000/12/13 19:37:04 leonardr Exp $
d78 1
a78 1
    public static final  String versionID = "$Id: AuditEventDetail.java,v 1.1 2000/12/13 19:37:04 leonardr Exp $";
d117 1
a117 1
                }            
@


1.1
log
@New servlet: AuditEventDetail
@
text
@d48 1
a48 1
package org.tigris.helm.security;
d74 1
a74 1
 * @@version $Id: AuditEventDetail.java,v 1.2 2000/12/08 16:59:43 leonardr Exp $
d78 1
a78 1
    public static final  String versionID = "$Id: AuditEventDetail.java,v 1.2 2000/12/08 16:59:43 leonardr Exp $";
d83 1
a83 1
    private static String ADD_TO_RATIONALE_ACTION="Add to Rationale";
a111 5
            if (rationaleAdd.equals(""))
            {
                validationErrors.add("You must provide some text to add to the rationale.");
            }
            
d114 4
@

