<commit_before>package com.imcode.imcms.servlet;

import com.imcode.imcms.flow.DispatchCommand;
import com.imcode.imcms.flow.Page;
import com.imcode.imcms.servlet.superadmin.AdminManager;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class SearchDocuments extends HttpServlet {

    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        if (null != Page.fromRequest(request)) {
            request.getRequestDispatcher("/servlet/PageDispatcher").forward(request, response);
        } else {
            SearchDocumentsPage searchDocumentsPage = new SearchDocumentsPage();
            DocumentFinder documentFinder = new DocumentFinder(searchDocumentsPage);
            documentFinder.setLogged(true);
            documentFinder.addExtraSearchResultColumn(new AdminManager.DatesSummarySearchResultColumn());
            documentFinder.setCancelCommand(new DispatchCommand() {
                public void dispatch(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
                    request.getRequestDispatcher("BackDoc").forward(request, response);
                }
            });
            searchDocumentsPage.updateFromRequest(request);
            documentFinder.forward(request, response);
        }<commit_msg>IMCMS-377 - Add API for monitoring logged in users: - Replace with lambda<commit_after>package com.imcode.imcms.servlet;

import com.imcode.imcms.flow.DispatchCommand;
import com.imcode.imcms.flow.Page;
import com.imcode.imcms.servlet.superadmin.AdminManager;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class SearchDocuments extends HttpServlet {

    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        if (null != Page.fromRequest(request)) {
            request.getRequestDispatcher("/servlet/PageDispatcher").forward(request, response);
        } else {
            SearchDocumentsPage searchDocumentsPage = new SearchDocumentsPage();
            DocumentFinder documentFinder = new DocumentFinder(searchDocumentsPage);
            documentFinder.setLogged(true);
            documentFinder.addExtraSearchResultColumn(new AdminManager.DatesSummarySearchResultColumn());
            documentFinder.setCancelCommand((DispatchCommand) (request1, response1) -> request1.getRequestDispatcher("BackDoc").forward(request1, response1));
            searchDocumentsPage.updateFromRequest(request);
            documentFinder.forward(request, response);
        }
{'fraction_non_alphanumeric': 0.08434151399930867, 'fraction_numerical': 0.00276529554096094, 'mean_word_length': 4.113074204946996, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '675854', 'n_tokens_mistral': 704, 'n_tokens_neox': 688, 'n_words': 132}