<commit_before>/**
 * <p>Title: ConflictViewAction Class>
 * <p>Description:	Initialization action for conflict view
 * Copyright:    Copyright (c) year
 * Company: Washington University, School of Medicine, St. Louis.
 * @version 1.00
 * @author <NAME>
 * Created on sep 18,2007
 */

package edu.wustl.catissuecore.action;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import edu.wustl.catissuecore.actionForm.ConflictViewForm;
import edu.wustl.catissuecore.util.global.Constants;
import edu.wustl.catissuecore.util.global.Utility;
import edu.wustl.common.action.SecureAction;
import edu.wustl.common.beans.NameValueBean;
import edu.wustl.common.dao.QuerySessionData;
import edu.wustl.common.dao.queryExecutor.PagenatedResultData;
import edu.wustl.common.util.XMLPropertyHandler;

public class ConflictViewAction extends SecureAction
{

	/**
	 * Overrides the execute method of Action class.
	 * Initializes the various fields in ConflictView.jsp Page.
	 * @param mapping object
	 * @param form object
	 * @param request object
	 * @param response object
	 * @return ActionForward object
	 * @throws Exception object
	 * */
	protected ActionForward executeSecureAction(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception 
	{
		ConflictViewForm conflictViewForm = (ConflictViewForm) form;
		int selectedFilter =  Integer.parseInt(conflictViewForm.getSelectedFilter());
				
		String[] retrieveFilterList = Constants.CONFLICT_FILTER_LIST;
		List filterList = new ArrayList();
		for(int i=0;i<retrieveFilterList.length;i++)
		{
			filterList.add(0,new NameValueBean(retrieveFilterList[i], i));
		}
		Collections.sort(filterList);
	    //Setting the list in request
		request.getSession().setAttribute(Constants.FILTER_LIST, filterList);
		
		
		
		 //Returns the page number to be shown.
        int pageNum = Integer.parseInt(request.getParameter(Constants.PAGE_NUMBER));
		
        //Gets the session of this request.
        HttpSession session = request.getSession();
        
        //The start index in the list of users to be approved/rejected.
        int startIndex = Constants.ZERO;
        String sqlString="";<commit_msg>added code to disallow Non Super Admin users to view Conflicting Reports<commit_after>/**
 * <p>Title: ConflictViewAction Class>
 * <p>Description:	Initialization action for conflict view
 * Copyright:    Copyright (c) year
 * Company: Washington University, School of Medicine, St. Louis.
 * @version 1.00
 * @author <NAME>
 * Created on sep 18,2007
 */

package edu.wustl.catissuecore.action;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import edu.wustl.catissuecore.actionForm.ConflictViewForm;
import edu.wustl.catissuecore.util.global.Constants;
import edu.wustl.catissuecore.util.global.Utility;
import edu.wustl.common.action.SecureAction;
import edu.wustl.common.beans.NameValueBean;
import edu.wustl.common.beans.SessionDataBean;
import edu.wustl.common.dao.QuerySessionData;
import edu.wustl.common.dao.queryExecutor.PagenatedResultData;
import edu.wustl.common.util.XMLPropertyHandler;

public class ConflictViewAction extends SecureAction
{

	/**
	 * Overrides the execute method of Action class.
	 * Initializes the various fields in ConflictView.jsp Page.
	 * @param mapping object
	 * @param form object
	 * @param request object
	 * @param response object
	 * @return ActionForward object
	 * @throws Exception object
	 * */
	protected ActionForward executeSecureAction(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception 
	{
		ConflictViewForm conflictViewForm = (ConflictViewForm) form;
		int selectedFilter =  Integer.parseInt(conflictViewForm.getSelectedFilter());
				
		// Added by Ravindra to disallow Non Super Admin users to view Conflicting Reports
		SessionDataBean sessionDataBean = (SessionDataBean) request.getSession().getAttribute(Constants.SESSION_DATA);
		if(!sessionDataBean.isAdmin())
		{
			ActionErrors errors = new ActionErrors();
	        ActionError error = new ActionError("access.execute.action.denied");
	        errors.add(ActionErrors.GLOBAL_ERROR, error);
	        saveErrors(request, errors);

	        return mapping.findForward(Constants.ACCESS_DENIED);
		}
		String[] retrieveFilterList = Constants.CONFLICT_FILTER_LIST;
		List filterList = new ArrayList();
		for(int i=0;i<retrieveFilterList.length;i++)
		{
			filterList.add(0,new NameValueBean(retrieveFilterList[i], i));
		}
		Collections.sort(filterList);
	    //Setting the list in request
		request.getSession().setAttribute(Constants.FILTER_LIST, filterList);
		
		
		
		 //Returns the page number to be shown.
        int pageNum = Integer.parseInt(request.getParameter(Constants.PAGE_NUMBER));
		
        //Gets the session of this request.
        HttpSession session = request.getSession();
        
        //The start index in the list of users to be approved/rejected.
        int startIndex = Constants.ZERO;
        String sqlString="";
{'fraction_non_alphanumeric': 0.09416652241647915, 'fraction_numerical': 0.0038082049506664357, 'mean_word_length': 4.550432276657061, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1087919', 'n_tokens_mistral': 1744, 'n_tokens_neox': 1646, 'n_words': 406}