head	1.12;
access;
symbols
	TIGRIS_1_1_0RC2:1.9
	TIGRIS_1_1_0RC1:1.9
	TIGRIS_1_1:1.9.0.4
	TIGRIS_1_0_8:1.9
	TIGRIS_1_0_8RC3:1.9
	TIGRIS_1_0_8RC2:1.9
	TIGRIS_1_0_8RC1:1.9
	TIGRIS_1_0_7:1.9
	TIGRIS_1_0_7RC3:1.9
	TIGRIS_1_0_7RC2:1.9
	TIGRIS_1_0_7RC1:1.9
	TIGRIS_1_0_6:1.9
	TIGRIS_1_0_6RC5:1.9
	TIGRIS_1_0_6RC4:1.9
	TIGRIS_1_0_6RC3:1.9
	TIGRIS_1_0_6RC2:1.9
	TIGRIS_1_0_6RC1:1.9
	TIGRIS_1_0_5:1.9
	TIGRIS_1_0_5RC6:1.9
	TIGRIS_1_0_5RC5:1.9
	TIGRIS_1_0_5RC4:1.9
	TIGRIS_1_0_5RC3:1.9
	TIGRIS_1_0_5RC2:1.9
	TIGRIS_1_0_5RC1:1.9
	TIGRIS_1_0_4:1.9
	TIGRIS_1_0_3:1.9
	TIGRIS_1_0_2:1.9
	TIGRIS_1_0_1:1.9
	TIGRIS_1_0:1.9.0.6
	TIGRIS_1_0_0:1.9
	TIGRIS_1_0_0_RC1:1.9.0.2
	dlr:1.1.1
	TIGRIS_0_9_2_4:1.2.2.1
	TIGRIS_0_9_2_3:1.2
	HELM_PEER_PORT_BRANCH:1.1.1.2
	TURBINE_PEER:1.4
	TIGRIS_0_9_2_1:1.4
	TIGRIS_0_9_2:1.2.0.2
	TIGRIS_0_9_0:1.1.1.1.0.4
	TIGRIS_0_8_4:1.1.1.1.0.2
	NEWHELM:1.1.1.1
	TIGRIS_NOV_12_2000:1.1.1;
locks; strict;
comment	@# @;


1.12
date	2001.07.16.02.23.42;	author jrobbins;	state dead;
branches;
next	1.11;

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

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

1.9
date	2001.03.07.01.53.24;	author lucas;	state Exp;
branches;
next	1.8;

1.8
date	2001.02.27.02.20.28;	author elicia;	state Exp;
branches;
next	1.7;

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

1.6
date	2001.02.01.00.29.56;	author elicia;	state Exp;
branches;
next	1.5;

1.5
date	2001.01.30.02.59.47;	author elicia;	state Exp;
branches;
next	1.4;

1.4
date	2001.01.26.18.29.04;	author edk;	state Exp;
branches
	1.4.2.1;
next	1.3;

1.3
date	2001.01.26.05.24.06;	author edk;	state dead;
branches;
next	1.2;

1.2
date	2001.01.16.23.06.37;	author elicia;	state Exp;
branches
	1.2.2.1;
next	1.1;

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

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

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

1.2.2.1
date	2001.02.01.18.49.24;	author jrobbins;	state Exp;
branches;
next	;

1.4.2.1
date	2001.01.28.01.02.18;	author dlr;	state dead;
branches;
next	1.4.2.2;

1.4.2.2
date	2001.02.17.00.19.47;	author elicia;	state Exp;
branches;
next	1.4.2.3;

1.4.2.3
date	2001.02.17.20.35.18;	author elicia;	state Exp;
branches;
next	1.4.2.4;

1.4.2.4
date	2001.02.20.01.27.49;	author dlr;	state Exp;
branches;
next	;


desc
@@


1.12
log
@factoring project documents out to project nidaba.tigris.org
@
text
@/* ================================================================
 * Copyright (c) 2000-2001 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 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 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.project;

import java.io.*;
import java.sql.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;

import org.apache.turbine.util.*;
import org.apache.velocity.context.Context;

import com.workingdogs.village.*;

import org.joist.*;
import org.joist.util.*;
import org.joist.security.RedirectException;

import org.tigris.helm.security.*;
import org.tigris.helm.om.*;

public class ProjectDocumentApproval extends HelmServlet
{
    private static final boolean DEBUG = true;
    private static String DISAPPROVE_LIST="disapproveList";

    protected String processRequest(Context ctx)
        throws TurbineException, RedirectException
    {
        String templateName = super.processRequest(ctx);

        String action = (String)ctx.get("action");
        if (DEBUG) Log.debug("ProjectDocumentApproval: action=" + action );

        try
        {
            boolean validAction = false;
            ArrayList disapproveList = new ArrayList();

            if (action.equals("none"))
            {
                validAction = true;
            }

            if (action.equals("Perform Actions"))
            {
                validAction = true;
                User loginUser = getLoginUser(ctx);
                AccessControlList acl = loginUser.getACL();
                Enumeration paramNames = getRequest(ctx).getParameterNames();
                String paramName;
                while (paramNames.hasMoreElements())
                {
                    paramName = (String) paramNames.nextElement();
                    if (DEBUG) Log.debug("DocApproval: param name=" + paramName);
                    if (paramName.startsWith("action_"))
                    {
                        String desiredAction = getParameter(ctx, paramName);
                        if (DEBUG) 
                            Log.debug("DocApproval: desired action=" + desiredAction);
                        String documentID = paramName.substring(7);
                        if (DEBUG) Log.debug("documentID=" + documentID);

                        ProjectDocument document = (ProjectDocument)
                            ProjectDocumentPeer.getInstance(documentID);

                        if (desiredAction.equals("Approve"))
                        {
                            document.approve(acl);
                        }
                        if (desiredAction.equals("Disapprove"))
                        {
                           disapproveList.add((ProjectDocument)
                                              ProjectDocumentPeer
                                              .getInstance(documentID));
                        }
                    }
                }
                String url;
                Project currentProject = getCurrentProject(ctx);
                if (disapproveList.isEmpty())
                {
                    url = currentProject.getProjectPageURL
                          ("ProjectDocumentList").toString();
                } else {
                    url = currentProject.getProjectPageURL
                          ("ProjectDocumentApprovalReason").toString();
                    HttpSession session = getSessionManager(ctx).getSession();
                    session.putValue(DISAPPROVE_LIST, disapproveList); 
                }
                redirectToURL(ctx, url);
            }

            if (!validAction) redirectToUnauthorized();
        }
        catch (RedirectException e)
        {
            throw e;
        }
        catch (Exception e)
        {
            Log.error(e);
            String message = "ProjectDocumentApproval: " + e.getMessage();
            if (DEBUG) Log.debug(message);
            ctx.put("message", message);
        }

        if (DEBUG) Log.debug("ProjectDocumentApproval:  done");
        return templateName;
    }
}
@


1.11
log
@Clean up.
@
text
@@


1.10
log
@Ported Helm from WebMacro to Velocity.
@
text
@d66 1
a66 1
import org.tigris.helm.om.*;
d137 1
a137 1
            } 
d140 1
a140 1
        } 
@


1.9
log
@Corrected regex madness for Torque upgrade.  -dlr
@
text
@d56 1
a56 1
import org.webmacro.servlet.*;
d72 2
a73 2
    protected String processRequest (Connection conn, WebContext ctx)
        throws HandlerException, RedirectException
d75 1
a75 1
        String templateName = super.processRequest(conn, ctx);
d95 1
a95 2
                Enumeration paramNames =
                    ctx.getRequest().getParameterNames();
d103 1
a103 1
                        String desiredAction = ctx.getForm(paramName);
@


1.8
log
@added extra step to allow disapproving admin to provide reason for disapproval
@
text
@d66 1
a66 2
import org.tigris.helm.om.peer.*;

@


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
@a61 1
import org.joist.session.*;
d71 1
d84 1
d120 3
a122 3
                            String htURL = URL.schemeAndServer(ctx)
                                + "/servlets/ProjectDocumentList";
                            document.disapprove(acl, htURL);
d126 1
d128 10
a137 1
                String url = currentProject.getProjectPageURL("ProjectDocumentList").toString();
@


1.6
log
@passing context to Document to determine url for .htaccess file
@
text
@d2 1
a2 1
 * Copyright (c) 2000 CollabNet.  All rights reserved.
d17 1
a17 1
 * software developed by Collab.Net (http://www.Collab.Net/)."
d32 1
a32 1
 * IN NO EVENT SHALL COLLAB.NET OR ITS CONTRIBUTORS BE LIABLE FOR ANY
d55 1
a55 1
import org.webmacro.util.*;
a63 1
import org.joist.database.JoistDatabaseException;
d65 8
a72 13
import org.tigris.helm.security.HelmServlet;
import org.tigris.helm.security.AccessControlList;
import org.tigris.helm.project.Document;
import org.tigris.helm.domain.User;

public class ProjectDocumentApproval extends HelmServlet {
    public static final  String versionID = "$Id: ProjectDocumentApproval.java,v 1.5 2001/01/30 02:59:47 elicia Exp $";
    private static Log log = new Log("ProjectDocumentApproval", "DocApprvl");
    private static boolean debug = true;

    /**
     * Process requests for document approval.
     */
d74 1
a74 1
	    throws HandlerException, RedirectException
d76 1
a76 1
	    if (debug) log.info("ProjectDocumentApproval: started!");
d78 2
a79 4
	    String templateName = super.processRequest(conn, ctx);
	
	    String action = (String)ctx.get("action");
	    if (debug) log.info("ProjectDocumentApproval: action=" + action );
d81 2
a82 2
	    try
	    {
d91 2
a92 2
	        {
	        	validAction = true;
d94 2
a95 1
		        Enumeration paramNames =
d97 28
a124 27
		        String paramName;
		        while (paramNames.hasMoreElements())
		        {
		            paramName = (String) paramNames.nextElement();
		            if (debug) log.info("DocApproval: param name=" + paramName);
		            if (paramName.startsWith("action_"))
		            {
			            String desiredAction = ctx.getForm(paramName);
			            if (debug) 
                           log.info("DocApproval: desired action=" + desiredAction);
			            String documentID = paramName.substring(7);
                        if (debug) log.info("documentID=" + documentID);

                        AccessControlList acl = getACL(ctx, conn);
                        Document document = 
                            new Document(conn, dMgr, documentID);

			            if (desiredAction.equals("Approve"))
			            {
			               document.approve(acl);
			            }
			            if (desiredAction.equals("Disapprove"))
			            {
                           document.disapprove(acl, ctx);
			            }
		            }
		        }
d126 3
a128 3
                String url = currentProject.getProjectPageURL("ProjectDocuments").toString();
		        redirectToURL(ctx, url);
	        } 
d131 1
a131 1
	    } 
d134 1
a134 1
           throw e;
d138 4
a141 4
	       log.exception(e);
	       String message = "ProjectDocumentApproval: " + e.getMessage();
	       if (debug) log.debug(message);
	       ctx.put("message", message);
d144 1
a144 2
        if (debug) log.info("ProjectDocumentApproval:  done");

d146 2
a147 3
   }
  
} /* end class ProjectDocumentApproval */
@


1.5
log
@added editing of .htaccess file on edit and deleting of a file
@
text
@d72 1
a72 1
    public static final  String versionID = "$Id: ProjectDocumentApproval.java,v 1.4 2001/01/26 18:29:04 edk Exp $";
d127 1
a127 3
                           String htURL = URL.schemeAndServer(ctx) 
                                          + "/servlets/ProjectDocuments";
                           document.disapprove(acl, htURL);
@


1.4
log
@readding all the files as part of the process of returning to the way
things were as of tuesday
@
text
@d72 1
a72 1
    public static final  String versionID = "$Id: ProjectDocumentApproval.java,v 1.2 2001/01/16 23:06:37 elicia Exp $";
d127 3
a129 1
                           document.disapprove(acl);
@


1.4.2.1
log
@Porting to the Turbine Peer system.  -dlr and leonardr
@
text
@d72 1
a72 1
    public static final  String versionID = "$Id: ProjectDocumentApproval.java,v 1.4 2001/01/26 18:29:04 edk Exp $";
@


1.4.2.2
log
@ported to turbine
@
text
@d55 1
d57 1
a57 1
import org.apache.turbine.util.Log;
d64 1
d68 2
a69 2
import org.tigris.helm.om.*;
import org.tigris.helm.om.peer.*;
d71 3
a73 2
public class ProjectDocumentApproval extends HelmServlet 
{
d76 3
d82 1
a82 1
	    if (debug) Log.debug("ProjectDocumentApproval: started!");
d87 1
a87 1
	    if (debug) Log.debug("ProjectDocumentApproval: action=" + action );
d108 1
a108 1
		            if (debug) Log.debug("DocApproval: param name=" + paramName);
d113 1
a113 1
                           Log.debug("DocApproval: desired action=" + desiredAction);
d115 1
a115 1
                        if (debug) Log.debug("documentID=" + documentID);
d117 3
a119 3
                        AccessControlList acl = loginUser.getACL();
                        ProjectDocument document = (ProjectDocument)
                            ProjectDocumentPeer.getInstance(documentID);
d127 1
a127 3
                           String htURL = URL.schemeAndServer(ctx)
                                          + "/servlets/ProjectDocumentList";
                           document.disapprove(acl, htURL);
d132 1
a132 1
                String url = currentProject.getProjectPageURL("ProjectDocumentList").toString();
d144 1
a144 1
	       Log.error(e);
d146 1
a146 1
	       if (debug) Log.debug(message);
d150 1
a150 1
        if (debug) Log.debug("ProjectDocumentApproval:  done");
@


1.4.2.3
log
@cleanup
@
text
@a54 1
import org.apache.turbine.util.*;
d56 1
a56 1

d64 2
a65 1
import org.tigris.helm.security.*;
d69 2
a70 1
public class ProjectDocumentApproval extends HelmServlet {
a95 1
                AccessControlList acl = loginUser.getACL();
d111 1
d121 2
a122 2
                            String htURL = URL.schemeAndServer(ctx)
                                           + "/servlets/ProjectDocumentList";
@


1.4.2.4
log
@Formatting and copy right changes.
@
text
@d2 1
a2 1
 * Copyright (c) 2000-2001 CollabNet.  All rights reserved.
d17 1
a17 1
 * software developed by Collab.Net (http://www.collab.net/)."
d32 1
a32 1
 * IN NO EVENT SHALL COLLABNET OR ITS CONTRIBUTORS BE LIABLE FOR ANY
d69 2
a70 3
public class ProjectDocumentApproval extends HelmServlet
{
    private static final boolean DEBUG = true;
d73 1
a73 1
        throws HandlerException, RedirectException
d75 1
a75 1
        String templateName = super.processRequest(conn, ctx);
d77 4
a80 2
        String action = (String)ctx.get("action");
        if (DEBUG) Log.debug("ProjectDocumentApproval: action=" + action );
d82 2
a83 2
        try
        {
d92 2
a93 2
            {
                validAction = true;
d96 1
a96 1
                Enumeration paramNames =
d98 12
a109 12
                String paramName;
                while (paramNames.hasMoreElements())
                {
                    paramName = (String) paramNames.nextElement();
                    if (DEBUG) Log.debug("DocApproval: param name=" + paramName);
                    if (paramName.startsWith("action_"))
                    {
                        String desiredAction = ctx.getForm(paramName);
                        if (DEBUG) 
                            Log.debug("DocApproval: desired action=" + desiredAction);
                        String documentID = paramName.substring(7);
                        if (DEBUG) Log.debug("documentID=" + documentID);
d114 6
a119 6
                        if (desiredAction.equals("Approve"))
                        {
                            document.approve(acl);
                        }
                        if (desiredAction.equals("Disapprove"))
                        {
d121 5
a125 5
                                + "/servlets/ProjectDocumentList";
                            document.disapprove(acl, htURL);
                        }
                    }
                }
d128 2
a129 2
                redirectToURL(ctx, url);
            } 
d132 1
a132 1
        } 
d135 1
a135 1
            throw e;
d139 4
a142 4
            Log.error(e);
            String message = "ProjectDocumentApproval: " + e.getMessage();
            if (DEBUG) Log.debug(message);
            ctx.put("message", message);
d145 2
a146 1
        if (DEBUG) Log.debug("ProjectDocumentApproval:  done");
d148 3
a150 2
    }
}
@


1.3
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.2
log
@made functional
@
text
@d72 1
a72 1
    public static final  String versionID = "$Id: ProjectDocumentApproval.java,v 1.1 2001/01/16 21:19:57 elicia Exp $";
@


1.2.2.1
log
@moved changed from HEAD for ProjectDocuments and ProjectDownloads
@
text
@d72 1
a72 1
    public static final  String versionID = "$Id: ProjectDocumentApproval.java,v 1.6 2001/02/01 00:29:56 elicia Exp $";
d127 1
a127 1
                           document.disapprove(acl, ctx);
@


1.1
log
@Initial revision
@
text
@a46 1

d50 1
a51 1
import java.sql.*;
d57 2
a58 3
import org.webmacro.engine.*;
import org.webmacro.broker.*;
import org.webmacro.resource.*;
d63 2
d67 7
a73 9
import org.joist.security.RedirectException;
import org.joist.database.DataManager;




public class ProjectDocumentApproval extends org.tigris.helm.security.HelmServlet {
    public static final  String versionID = "$Id: ProjectDocumentApproval.java,v 1.4 2000/11/06 06:15:31 edk Exp $";
    private static Log log = new Log("ProjectDocumentApproval", "Tigris StartPage");
d77 1
a77 1
     *  Display and process the login screen.
d79 2
a80 3
    protected String
	processRequest (Connection connection, WebContext context)
	throws HandlerException, RedirectException
d82 1
a82 1
	if (debug) log.debug("ProjectDocumentApproval: started!");
d84 1
a84 1
	String templateName = super.processRequest(connection, context);
d86 2
d89 60
a148 29
	if (debug) log.debug("ProjectDocumentApproval: step 1");

	HttpServletRequest request = context.getRequest();
	HttpServletResponse response = context.getResponse();
	HttpSession session = context.getSession();
	SessionManager sMgr = getSessionManager(context);
	DataManager dMgr = sMgr.getDataManager();

	if (debug) log.debug("ProjectDocumentApproval: step 2");

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

        if (debug) log.debug("ProjectDocumentApproval: step 3");

	try {
	    String userID = sMgr.getUserID();
	    if (debug) log.debug("ProjectDocumentApproval: userID=" + userID );
	    String loginID = sMgr.getLoginID();
	    context.put("loginID", loginID);
	    if (debug) log.debug("ProjectDocumentApproval: loginID=" + loginID );
	}
	catch (Exception e) {
	    log.exception(e);
	    String message = "ProjectDocumentApproval: " + e.getMessage();
	    if (debug) log.debug(message);
	    context.put("message", message);
	}
	
	if (debug) log.debug("ProjectDocumentApproval: action=" + action );
d150 1
a150 1
	if (debug) log.debug("ProjectDocumentApproval:  done");
d153 1
a153 1
    }
@


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
@d2 1
a2 1
 * Copyright (c) 2000-2001 CollabNet.  All rights reserved.
d17 1
a17 1
 * software developed by Collab.Net (http://www.collab.net/)."
d32 1
a32 1
 * IN NO EVENT SHALL COLLABNET OR ITS CONTRIBUTORS BE LIABLE FOR ANY
d47 1
d51 1
a52 1
import java.util.*;
d56 1
a56 1
import org.apache.turbine.util.*;
d58 3
a60 2

import com.workingdogs.village.*;
d65 2
d68 1
a69 7
import org.tigris.helm.security.*;
import org.tigris.helm.om.*;
import org.tigris.helm.om.peer.*;

public class ProjectDocumentApproval extends HelmServlet
{
    private static final boolean DEBUG = true;
d71 13
a83 2
    protected String processRequest (Connection conn, WebContext ctx)
        throws HandlerException, RedirectException
d85 6
a90 1
        String templateName = super.processRequest(conn, ctx);
d92 27
a118 2
        String action = (String)ctx.get("action");
        if (DEBUG) Log.debug("ProjectDocumentApproval: action=" + action );
d120 1
a120 62
        try
        {
            boolean validAction = false;

            if (action.equals("none"))
            {
                validAction = true;
            }

            if (action.equals("Perform Actions"))
            {
                validAction = true;
                User loginUser = getLoginUser(ctx);
                AccessControlList acl = loginUser.getACL();
                Enumeration paramNames =
                    ctx.getRequest().getParameterNames();
                String paramName;
                while (paramNames.hasMoreElements())
                {
                    paramName = (String) paramNames.nextElement();
                    if (DEBUG) Log.debug("DocApproval: param name=" + paramName);
                    if (paramName.startsWith("action_"))
                    {
                        String desiredAction = ctx.getForm(paramName);
                        if (DEBUG) 
                            Log.debug("DocApproval: desired action=" + desiredAction);
                        String documentID = paramName.substring(7);
                        if (DEBUG) Log.debug("documentID=" + documentID);

                        ProjectDocument document = (ProjectDocument)
                            ProjectDocumentPeer.getInstance(documentID);

                        if (desiredAction.equals("Approve"))
                        {
                            document.approve(acl);
                        }
                        if (desiredAction.equals("Disapprove"))
                        {
                            String htURL = URL.schemeAndServer(ctx)
                                + "/servlets/ProjectDocumentList";
                            document.disapprove(acl, htURL);
                        }
                    }
                }
                Project currentProject = getCurrentProject(ctx);
                String url = currentProject.getProjectPageURL("ProjectDocumentList").toString();
                redirectToURL(ctx, url);
            } 

            if (!validAction) redirectToUnauthorized();
        } 
        catch (RedirectException e)
        {
            throw e;
        }
        catch (Exception e)
        {
            Log.error(e);
            String message = "ProjectDocumentApproval: " + e.getMessage();
            if (DEBUG) Log.debug(message);
            ctx.put("message", message);
        }
a121 1
        if (DEBUG) Log.debug("ProjectDocumentApproval:  done");
d124 2
a125 1
}
@

