head	1.16;
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
	TIGRIS_0_9_2_3:1.2
	HELM_PEER_PORT_BRANCH:1.1.1.1
	TURBINE_PEER:1.5
	TIGRIS_0_9_2_1:1.5
	TIGRIS_0_9_2:1.2.0.2;
locks; strict;
comment	@# @;


1.16
date	2001.08.28.17.45.17;	author leonardr;	state Exp;
branches;
next	1.15;

1.15
date	2001.08.28.17.13.33;	author leonardr;	state Exp;
branches;
next	1.14;

1.14
date	2001.08.11.09.08.07;	author dlr;	state Exp;
branches;
next	1.13;

1.13
date	2001.07.31.19.57.31;	author edk;	state Exp;
branches;
next	1.12;

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

1.11
date	2001.07.18.10.05.14;	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.25;	author lucas;	state Exp;
branches;
next	1.8;

1.8
date	2001.02.22.22.19.23;	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.09.21.04.57;	author elicia;	state Exp;
branches;
next	1.5;

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

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

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

1.2
date	2001.01.16.23.00.40;	author elicia;	state Exp;
branches;
next	1.1;

1.1
date	2001.01.16.21.19.57;	author elicia;	state Exp;
branches
	1.1.1.1;
next	;

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

1.5.2.1
date	2001.01.28.01.02.18;	author dlr;	state dead;
branches;
next	1.5.2.2;

1.5.2.2
date	2001.02.10.01.50.15;	author elicia;	state Exp;
branches;
next	1.5.2.3;

1.5.2.3
date	2001.02.10.02.20.40;	author leonardr;	state Exp;
branches;
next	1.5.2.4;

1.5.2.4
date	2001.02.15.20.50.42;	author leonardr;	state Exp;
branches;
next	1.5.2.5;

1.5.2.5
date	2001.02.16.03.01.34;	author dlr;	state Exp;
branches;
next	;


desc
@@


1.16
log
@More methods migrated to ContextAPI.
@
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 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 CollabNet.
 */

package org.tigris.helm.project;

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

public class ProjectNewsApproval extends HelmServlet 
{
    private static boolean debug = true;
    private static String DISAPPROVE_LIST="disapproveList";

    /**
     * Process requests for project approval.
     */
    protected String processRequest(Context ctx)
	    throws NestableException, RedirectException
    {
        if (debug) Log.debug("ProjectNewsApproval: started!");

        String templateName = super.processRequest(ctx);
        User loginUser = getLoginUser(ctx);
	
        String action = (String)getAction(ctx);
        if (debug) Log.debug("ProjectNewsApproval: action=" + action );
        
        try
        {
            AccessControlList acl = loginUser.getACL();
            boolean validAction = false;
            ArrayList disapproveList = new ArrayList();

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

            if (action.equals("Perform Actions"))
            {
                validAction = true;
                Enumeration paramNames =
                    ContextAPI.getRequest(ctx).getParameterNames();
                String paramName;
                while (paramNames.hasMoreElements())
                {
                    paramName = (String) paramNames.nextElement();
                    if (debug) Log.debug("ProjectNewsApproval: param name=" +
                                         paramName);
                    if (paramName.startsWith("action_"))
                    {
                        String desiredAction = ContextAPI.getParameter
                            (ctx, paramName);
                        if (debug)
                        {
                            Log.debug("ProjectNewsApproval: desired action="
                                      + desiredAction);
                        }
                        String newsID = paramName.substring(7);
                        if (debug) Log.debug("newsID=" + newsID);
                        
                        NewsItem newsItem =
                            (NewsItem)NewsItemPeer.getInstance(newsID);
                        
                        if (desiredAction.equals("Approve"))
                        {
                            newsItem.approve(acl);
                        }
                        if (desiredAction.equals("Disapprove"))
                        {
                            disapproveList.add((NewsItem)NewsItemPeer
                                               .getInstance(newsID));
                        }
                    }
                }
                Project currentProject = getCurrentProject(ctx);
                String url;
                if (disapproveList.isEmpty())
                {
                    
                    url = currentProject.getProjectPageURL
                        ("ProjectNewsList").toString();
                } else {
                    HttpSession session = getSessionManager(ctx).getSession();
                    session.putValue(DISAPPROVE_LIST, disapproveList); 
                    url = currentProject.getProjectPageURL
                        ("ProjectNewsApprovalReason").toString();
                }
                redirectToURL(ctx, url);
            } 
            
            if (!validAction) redirectToUnauthorized();
        } 
        catch (RedirectException e)
        {
            throw e;
        }
        catch (Exception e)
        {
            Log.error(e);
            String message = "ProjectNewsApproval: " + e.getMessage();
            if (debug) Log.debug(message);
            ctx.put("message", message);
        }
        
        if (debug) Log.debug("ProjectNewsApproval:  done");
        
        return templateName;    
    }
}
@


1.15
log
@Completed migration of more methods to ContextAPI.
@
text
@d106 2
a107 1
                        String desiredAction = getParameter(ctx, paramName);
d109 1
d112 1
@


1.14
log
@Upgrading to Turbine 3.0-dev, Fulcrum 1.0, and Torque 1.0.
@
text
@d61 1
d74 1
a74 1
	    if (debug) Log.debug("ProjectNewsApproval: started!");
d76 1
a76 1
	    String templateName = super.processRequest(ctx);
d79 5
a83 5
	    String action = (String)getAction(ctx);
	    if (debug) Log.debug("ProjectNewsApproval: action=" + action );

	    try
	    {
d94 9
a102 9
	        {
	        	validAction = true;
		        Enumeration paramNames =
                    getRequest(ctx).getParameterNames();
		        String paramName;
		        while (paramNames.hasMoreElements())
		        {
		            paramName = (String) paramNames.nextElement();
		            if (debug) Log.debug("ProjectNewsApproval: param name=" +
d104 4
a107 4
		            if (paramName.startsWith("action_"))
		            {
			            String desiredAction = getParameter(ctx, paramName);
			            if (debug)
d110 1
a110 1
			            String newsID = paramName.substring(7);
d112 1
a112 1

d114 13
a126 13
                           (NewsItem)NewsItemPeer.getInstance(newsID);

			            if (desiredAction.equals("Approve"))
			            {
			               newsItem.approve(acl);
			            }
			            if (desiredAction.equals("Disapprove"))
			            {
                           disapproveList.add((NewsItem)NewsItemPeer
                                              .getInstance(newsID));
			            }
		            }
		        }
d131 1
a131 1

d140 3
a142 3
		        redirectToURL(ctx, url);
	        } 

d144 1
a144 1
	    } 
d147 1
a147 1
           throw e;
d151 4
a154 4
	       Log.error(e);
	       String message = "ProjectNewsApproval: " + e.getMessage();
	       if (debug) Log.debug(message);
	       ctx.put("message", message);
d156 1
a156 1

d158 3
a160 3

        return templateName;
   }
@


1.13
log
@fix cut and paste error which would produce a confusing error message
@
text
@d55 1
a55 1
import org.apache.turbine.util.TurbineException;
d71 1
a71 1
	    throws TurbineException, RedirectException
@


1.12
log
@Removed Joist references.
@
text
@d151 1
a151 1
	       String message = "ProjectIssues: " + e.getMessage();
@


1.11
log
@Ported Joist Redirect*Exception to Helm.
@
text
@a49 1
import java.sql.*;
a53 2
import org.apache.velocity.context.Context;
import com.workingdogs.village.*;
a55 1
import org.apache.turbine.util.TurbineException;
d57 1
a57 2
import org.tigris.helm.security.RedirectException;
import org.joist.database.JoistDatabaseException;
d61 1
a61 1
import org.tigris.helm.om.*;
d101 2
a102 1
		            if (debug) Log.debug("ProjectNewsApproval: param name=" + paramName);
d106 3
a108 2
			            if (debug) Log.debug("ProjectNewsApproval: desired action="
			               + desiredAction);
d131 2
a132 1
                    url = currentProject.getProjectPageURL("ProjectNewsList").toString();
d136 2
a137 1
                    url = currentProject.getProjectPageURL("ProjectNewsApprovalReason").toString();
d160 1
a160 2
  
} /* end class ProjectNewsApproval */
@


1.10
log
@Ported Helm from WebMacro to Velocity.
@
text
@d61 1
a61 1
import org.joist.security.RedirectException;
@


1.9
log
@Corrected regex madness for Torque upgrade.  -dlr
@
text
@d55 1
a55 1
import org.webmacro.servlet.*;
d58 2
d75 2
a76 2
    protected String processRequest (Connection conn, WebContext ctx)
	    throws HandlerException, RedirectException
d80 1
a80 1
	    String templateName = super.processRequest(conn, ctx);
d101 1
a101 1
                    ctx.getRequest().getParameterNames();
d109 1
a109 1
			            String desiredAction = ctx.getForm(paramName);
@


1.8
log
@now when you disapprove a news item, you redirect to another page to give you reasons for disapproval
@
text
@d64 1
a64 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
@a54 1
//import org.webmacro.util.*;
a55 1

a56 1

a58 3
//import org.joist.*;
//import org.joist.util.*;
//import org.joist.session.*;
d62 1
a62 2
import org.tigris.helm.security.HelmServlet;
import org.tigris.helm.security.AccessControlList;
a64 1
import org.tigris.helm.om.base.*;
d66 2
a67 1
public class ProjectNewsApproval extends HelmServlet {
d69 1
d89 1
d123 2
a124 1
                           newsItem.disapprove(acl, "");
d129 10
a138 1
                String url = currentProject.getProjectPageURL("ProjectNews").toString();
@


1.6
log
@cleanup formatting

in case there are items to be disapproved, redirect to ProjectNewsApprovalReason to give reason and do disapproval
@
text
@d2 1
a2 1
 * Copyright (c) 2000 CollabNet.  All rights reserved.
d55 1
a55 1
import org.webmacro.util.*;
d60 5
a64 3
import org.joist.*;
import org.joist.util.*;
import org.joist.session.*;
d70 3
a72 1
import org.tigris.helm.domain.*;
a74 2
    public static final  String versionID = "$Id: ProjectNewsApproval.java,v 1.5 2001/01/26 18:29:05 edk Exp $";
    private static Log log = new Log("ProjectNewsApproval", "ProjectNewsApproval");
d78 1
a78 1
     * Process requests for project news approval.
d83 1
a83 1
	if (debug) log.info("ProjectNewsApproval: started!");
d85 5
a89 8
	String templateName = super.processRequest(conn, ctx);
    
	String action = (String)ctx.get("action");
	if (debug) log.info("ProjectNewsApproval: action=" + action );

	try
	{
	    boolean validAction = false;
d91 1
a91 1
	    if (action.equals("none"))
d93 43
a135 2
		validAction = true;
	    }
d137 1
a137 49
	    if (action.equals("Perform Actions"))
	    {
		validAction = true;
		Enumeration paramNames =
		   ctx.getRequest().getParameterNames();
		String paramName;
		List disapproveList = new ArrayList();

		while (paramNames.hasMoreElements())
		{
		    paramName = (String) paramNames.nextElement();
		    if (debug) log.info("ProjectNewsApproval: param name=" + paramName);
		    if (paramName.startsWith("action_"))
		    {
		       String desiredAction = ctx.getForm(paramName);
		       if (debug) log.info("ProjectNewsApproval: desired action=" + desiredAction);
		       String newsID = paramName.substring(7);

		       AccessControlList acl = 
			   getACL(ctx, conn);
		       NewsItem newsItem = 
		           new NewsItem(conn, dMgr, newsID);

		       if (desiredAction.equals("Approve"))
		       {
			  newsItem.approve(acl);
		       }
		       if (desiredAction.equals("Disapprove"))
		       {
		          disapproveList.add(newsItem);
		       }
		    }
		}
		Project currentProject = getCurrentProject(ctx);
		String url;
		if (!disapproveList.isEmpty())
		{
		    url = currentProject.getProjectPageURL
		        ("ProjectNewsApprovalReason").toString();
		    // Put list of items to be disapproved into session
		    HttpSession session = getSessionManager(ctx).getSession();
                    session.putValue("disapproveList", disapproveList );
		    session.putValue("teststring", "hello");
		    redirectToURL(ctx, "ProjectNewsApprovalReason");
		} else {
		    url = currentProject.getProjectPageURL("ProjectNews").
			toString();
		}
		redirectToURL(ctx, url);
d139 11
d151 1
a151 15
	    if (!validAction) redirectToUnauthorized();
	} 
	catch (RedirectException e)
	{
	   throw e;
	}
	catch (Exception e)
	{
	   log.exception(e);
	   String message = "ProjectNewsApproval: " + e.getMessage();
	   if (debug) log.debug(message);
	   ctx.put("message", message);
	}

	if (debug) log.info("ProjectNewsApproval:  done");
d153 1
a153 1
	return templateName;
@


1.5
log
@readding all the files as part of the process of returning to the way
things were as of tuesday
@
text
@d71 1
a71 1
    public static final  String versionID = "$Id: ProjectNewsApproval.java,v 1.2 2001/01/16 23:00:40 elicia Exp $";
d78 1
a78 1
    protected String processRequest (Connection connection, WebContext context)
d81 1
a81 1
	    if (debug) log.info("ProjectNewsApproval: started!");
d83 8
a90 4
	    String templateName = super.processRequest(connection, context);
	
	    String action = (String)context.get("action");
	    if (debug) log.info("ProjectNewsApproval: action=" + action );
d92 1
a92 1
	    try
d94 2
a95 1
            boolean validAction = false;
d97 50
a146 42
            if (action.equals("none"))
            {
                validAction = true;
            }

            if (action.equals("Perform Actions"))
	        {
	        	validAction = true;
                User loginUser = getLoginUser(context);
		        Enumeration paramNames =
                    context.getRequest().getParameterNames();
		        String paramName;
		        while (paramNames.hasMoreElements())
		        {
		            paramName = (String) paramNames.nextElement();
		            if (debug) log.info("ProjectNewsApproval: param name=" + paramName);
		            if (paramName.startsWith("action_"))
		            {
			            String desiredAction = context.getForm(paramName);
			            if (debug) log.info("ProjectNewsApproval: desired action="
			               + desiredAction);
			            String newsID = paramName.substring(7);
                        if (debug) log.info("newsID=" + newsID);

                        AccessControlList acl = getACL(context, connection);
                        NewsItem newsItem = 
                            new NewsItem(connection, dMgr, newsID);

			            if (desiredAction.equals("Approve"))
			            {
			               newsItem.approve(acl);
			            }
			            if (desiredAction.equals("Disapprove"))
			            {
                           newsItem.disapprove(acl);
			            }
		            }
		        }
                Project currentProject = getCurrentProject(context);
                String url = currentProject.getProjectPageURL("ProjectNews").toString();
		        redirectToURL(context, url);
	        } 
d148 13
a160 13
            if (!validAction) redirectToUnauthorized();
	    } 
        catch (RedirectException e)
        {
           throw e;
        }
        catch (Exception e)
        {
	       log.exception(e);
	       String message = "ProjectNewsApproval: " + e.getMessage();
	       if (debug) log.debug(message);
	       context.put("message", message);
        }
d162 1
a162 1
        if (debug) log.info("ProjectNewsApproval:  done");
d164 1
a164 1
        return templateName;
@


1.5.2.1
log
@Porting to the Turbine Peer system.  -dlr and leonardr
@
text
@d71 1
a71 1
    public static final  String versionID = "$Id: ProjectNewsApproval.java,v 1.5 2001/01/26 18:29:05 edk Exp $";
@


1.5.2.2
log
@ported to turbine
@
text
@d55 1
a55 1
//import org.webmacro.util.*;
d60 3
a62 5
import org.apache.turbine.util.Log;

//import org.joist.*;
//import org.joist.util.*;
//import org.joist.session.*;
d68 1
a68 2
import org.tigris.helm.om.*;
import org.tigris.helm.om.peer.*;
d71 2
d76 1
a76 1
     * Process requests for project approval.
d78 1
a78 1
    protected String processRequest (Connection conn, WebContext ctx)
d81 1
a81 1
	    if (debug) Log.debug("ProjectNewsApproval: started!");
d83 1
a83 2
	    String templateName = super.processRequest(conn, ctx);
        User loginUser = getLoginUser(ctx);
d85 2
a86 2
	    String action = (String)getAction(ctx);
	    if (debug) Log.debug("ProjectNewsApproval: action=" + action );
a89 1
            AccessControlList acl = loginUser.getACL();
d100 1
d102 1
a102 1
                    ctx.getRequest().getParameterNames();
d107 1
a107 1
		            if (debug) Log.debug("ProjectNewsApproval: param name=" + paramName);
d110 2
a111 2
			            String desiredAction = ctx.getForm(paramName);
			            if (debug) Log.debug("ProjectNewsApproval: desired action="
d114 1
a114 1
                        if (debug) Log.debug("newsID=" + newsID);
d116 3
a118 2
                        NewsItem newsItem =
                           (NewsItem)NewsItemPeer.getInstance(newsID);
d130 1
a130 1
                Project currentProject = getCurrentProject(ctx);
d132 1
a132 1
		        redirectToURL(ctx, url);
d143 4
a146 4
	       Log.error(e);
	       String message = "ProjectIssues: " + e.getMessage();
	       if (debug) Log.debug(message);
	       ctx.put("message", message);
d149 1
a149 1
        if (debug) Log.debug("ProjectNewsApproval:  done");
@


1.5.2.3
log
@Changed method signiature.
@
text
@d127 1
a127 1
                           newsItem.disapprove(acl, "");
@


1.5.2.4
log
@Normalized copyright dates.
@
text
@d2 1
a2 1
 * Copyright (c) 2000-2001 CollabNet.  All rights reserved.
@


1.5.2.5
log
@Added new imports necessitated by Torque.
@
text
@a71 1
import org.tigris.helm.om.base.*;
@


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
@d71 1
a71 1
    public static final  String versionID = "$Id: ProjectNewsApproval.java,v 1.3 2001/01/25 01:57:24 lucas Exp $";
d118 1
a118 1
                            new NewsItem(dMgr, newsID);
@


1.3
log
@updated to use new NewsItem cxtr
@
text
@d71 1
a71 1
    public static final  String versionID = "$Id: ProjectNewsApproval.java,v 1.2 2001/01/16 23:00:40 elicia Exp $";
@


1.2
log
@minor cleanup
@
text
@d71 1
a71 1
    public static final  String versionID = "$Id: ProjectNewsApproval.java,v 1.1 2001/01/16 21:19:57 elicia Exp $";
d118 1
a118 1
                            new NewsItem(connection, dMgr, newsID);
@


1.1
log
@changed name from NewsItemApproval
@
text
@d71 1
a71 1
    public static final  String versionID = "$Id: ProjectNewsApproval.java,v 1.1 2000/12/19 20:40:00 elicia Exp $";
d76 1
a76 1
     * Process requests for project approval.
d144 1
a144 1
	       String message = "ProjectIssues: " + e.getMessage();
@


1.1.1.1
log
@Replacing the HEAD with the HELM_PEER_PORT_BRANCH.
@
text
@d2 1
a2 1
 * Copyright (c) 2000-2001 CollabNet.  All rights reserved.
d55 1
a55 1
//import org.webmacro.util.*;
d60 3
a62 5
import org.apache.turbine.util.Log;

//import org.joist.*;
//import org.joist.util.*;
//import org.joist.session.*;
d68 1
a68 3
import org.tigris.helm.om.*;
import org.tigris.helm.om.peer.*;
import org.tigris.helm.om.base.*;
d71 2
d78 1
a78 1
    protected String processRequest (Connection conn, WebContext ctx)
d81 1
a81 1
	    if (debug) Log.debug("ProjectNewsApproval: started!");
d83 1
a83 2
	    String templateName = super.processRequest(conn, ctx);
        User loginUser = getLoginUser(ctx);
d85 2
a86 2
	    String action = (String)getAction(ctx);
	    if (debug) Log.debug("ProjectNewsApproval: action=" + action );
a89 1
            AccessControlList acl = loginUser.getACL();
d100 1
d102 1
a102 1
                    ctx.getRequest().getParameterNames();
d107 1
a107 1
		            if (debug) Log.debug("ProjectNewsApproval: param name=" + paramName);
d110 2
a111 2
			            String desiredAction = ctx.getForm(paramName);
			            if (debug) Log.debug("ProjectNewsApproval: desired action="
d114 1
a114 1
                        if (debug) Log.debug("newsID=" + newsID);
d116 3
a118 2
                        NewsItem newsItem =
                           (NewsItem)NewsItemPeer.getInstance(newsID);
d126 1
a126 1
                           newsItem.disapprove(acl, "");
d130 1
a130 1
                Project currentProject = getCurrentProject(ctx);
d132 1
a132 1
		        redirectToURL(ctx, url);
d143 1
a143 1
	       Log.error(e);
d145 2
a146 2
	       if (debug) Log.debug(message);
	       ctx.put("message", message);
d149 1
a149 1
        if (debug) Log.debug("ProjectNewsApproval:  done");
@


