<commit_before>package org.intermine.web.struts;

/*
 * Copyright (C) 2002-2011 FlyMine
 *
 * This code may be freely distributed and modified under the
 * terms of the GNU Lesser General Public Licence.  This should
 * be distributed with the code.  See the LICENSE file for more
 * information or http://www.gnu.org/copyleft/lesser.html.
 *
 */

import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import java.util.Map.Entry;

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

import org.apache.log4j.Logger;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;
import org.intermine.api.InterMineAPI;
import org.intermine.api.profile.TagManager;
import org.intermine.api.tag.AspectTagUtil;
import org.intermine.api.tag.TagNames;
import org.intermine.metadata.ClassDescriptor;
import org.intermine.metadata.FieldDescriptor;
import org.intermine.model.InterMineObject;
import org.intermine.model.userprofile.Tag;
import org.intermine.objectstore.ObjectStore;
import org.intermine.objectstore.ObjectStoreException;
import org.intermine.api.template.TemplateManager;
import org.intermine.web.displayer.ReportDisplayer;
import org.intermine.web.logic.PortalHelper;
import org.intermine.web.logic.config.InlineList;
import org.intermine.web.logic.results.DisplayCollection;
import org.intermine.web.logic.results.DisplayField;
import org.intermine.web.logic.results.DisplayReference;
import org.intermine.web.logic.results.ReportObject;
import org.intermine.web.logic.results.ReportObjectFactory;
import org.intermine.web.logic.session.SessionMethods;
import org.jfree.util.Log;

/**
 * New objectDetails.
 *
 * @author <NAME>
 */
public class ReportController extends InterMineAction
{
    private static final Logger LOG = Logger.getLogger(ReportController.class);

    /**
     * {@inheritDoc}
     */
    @SuppressWarnings("unused")
    @Override
    public ActionForward execute(@SuppressWarnings("unused") ActionMapping mapping,
            @SuppressWarnings("unused") ActionForm form, HttpServletRequest request,
            @SuppressWarnings("unused") HttpServletResponse response) throws Exception {

        aaa(SessionMethods.getReportObjects(request.getSession()), SessionMethods.getInterMineAPI(request.getSession()).getObjectStore());

        long startTime = System.currentTimeMillis();

        HttpSession session = request.getSession();
        InterMineAPI im = SessionMethods.getInterMineAPI(session);

        if (im.getBagManager().isAnyBagToUpgrade(SessionMethods.getProfile(session))) {
            recordError(new ActionMessage("login.upgradeListManually"), request);
        }
        // fetch & set requested object
        InterMineObject requestedObject = getRequestedObject(im, request);

        if (requestedObject != null) {
            ReportObjectFactory reportObjectFactory = SessionMethods.getReportObjects(session);
            ReportObject reportObject = reportObjectFactory.get(requestedObject);

            request.setAttribute("object", reportObject);
            request.setAttribute("reportObject", reportObject);

            request.setAttribute("requestedObject", requestedObject);

            // hell starts here
            TagManager tagManager = im.getTagManager();
            ServletContext servletContext = session.getServletContext();
            ObjectStore os = im.getObjectStore();
            String superuser = im.getProfileManager().getSuperuser();

            // place InlineLists based on TagManager, reportObject is cached while Controller is not
            Map<String, List<InlineList>> placedInlineLists =<commit_msg>removed debug output<commit_after>package org.intermine.web.struts;

/*
 * Copyright (C) 2002-2011 FlyMine
 *
 * This code may be freely distributed and modified under the
 * terms of the GNU Lesser General Public Licence.  This should
 * be distributed with the code.  See the LICENSE file for more
 * information or http://www.gnu.org/copyleft/lesser.html.
 *
 */

import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import java.util.Map.Entry;

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

import org.apache.log4j.Logger;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;
import org.intermine.api.InterMineAPI;
import org.intermine.api.profile.TagManager;
import org.intermine.api.tag.AspectTagUtil;
import org.intermine.api.tag.TagNames;
import org.intermine.metadata.ClassDescriptor;
import org.intermine.metadata.FieldDescriptor;
import org.intermine.model.InterMineObject;
import org.intermine.model.userprofile.Tag;
import org.intermine.objectstore.ObjectStore;
import org.intermine.objectstore.ObjectStoreException;
import org.intermine.api.template.TemplateManager;
import org.intermine.web.displayer.ReportDisplayer;
import org.intermine.web.logic.PortalHelper;
import org.intermine.web.logic.config.InlineList;
import org.intermine.web.logic.results.DisplayCollection;
import org.intermine.web.logic.results.DisplayField;
import org.intermine.web.logic.results.DisplayReference;
import org.intermine.web.logic.results.ReportObject;
import org.intermine.web.logic.results.ReportObjectFactory;
import org.intermine.web.logic.session.SessionMethods;
import org.jfree.util.Log;

/**
 * New objectDetails.
 *
 * @author <NAME>
 */
public class ReportController extends InterMineAction
{
    private static final Logger LOG = Logger.getLogger(ReportController.class);

    /**
     * {@inheritDoc}
     */
    @SuppressWarnings("unused")
    @Override
    public ActionForward execute(@SuppressWarnings("unused") ActionMapping mapping,
            @SuppressWarnings("unused") ActionForm form, HttpServletRequest request,
            @SuppressWarnings("unused") HttpServletResponse response) throws Exception {

        long startTime = System.currentTimeMillis();

        HttpSession session = request.getSession();
        InterMineAPI im = SessionMethods.getInterMineAPI(session);

        if (im.getBagManager().isAnyBagToUpgrade(SessionMethods.getProfile(session))) {
            recordError(new ActionMessage("login.upgradeListManually"), request);
        }
        // fetch & set requested object
        InterMineObject requestedObject = getRequestedObject(im, request);

        if (requestedObject != null) {
            ReportObjectFactory reportObjectFactory = SessionMethods.getReportObjects(session);
            ReportObject reportObject = reportObjectFactory.get(requestedObject);

            request.setAttribute("object", reportObject);
            request.setAttribute("reportObject", reportObject);

            request.setAttribute("requestedObject", requestedObject);

            // hell starts here
            TagManager tagManager = im.getTagManager();
            ServletContext servletContext = session.getServletContext();
            ObjectStore os = im.getObjectStore();
            String superuser = im.getProfileManager().getSuperuser();

            // place InlineLists based on TagManager, reportObject is cached while Controller is not
            Map<String, List<InlineList>> placedInlineLists =
{'fraction_non_alphanumeric': 0.09778621125869703, 'fraction_numerical': 0.0022770398481973433, 'mean_word_length': 4.267155229846769, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '3316805', 'n_tokens_mistral': 2147, 'n_tokens_neox': 2129, 'n_words': 444}