<commit_before>/**
 * This file is part of CMDit.
 *
 * CMDit is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * CMDit is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with CMDit.  If not, see <http://www.gnu.org/licenses/>.
 */
package org.malaguna.cmdit.bbeans;

import java.io.File;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;

import javax.el.ELContext;
import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.component.UIData;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.faces.context.Flash;
import javax.faces.model.SelectItem;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.io.FileUtils;
import org.malaguna.cmdit.model.AbstractObject;
import org.malaguna.cmdit.model.usrmgt.User;
import org.malaguna.cmdit.service.BeanNames;
import org.malaguna.cmdit.service.CommandRunner;
import org.malaguna.cmdit.service.ServiceDelegate;
import org.malaguna.cmdit.service.commands.Command;
import org.malaguna.cmdit.service.commands.CommandException;
import org.malaguna.cmdit.service.commands.ResultCommand;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

/**
 * Clase abstracta con los atributos comunes a cualquier
 * Back Bean de la aplicación:
 *  - Acceso a la sesion
 *  - Acceso a la capa de servicio
 *  - Tratamiento común de errores en la lógica
 *  
 */
public class AbstractBean extends CommandRunner{
	private final static String AUTH_USER_KEY = "authuser";
	@Deprecated
	protected final static String PDF_CONTENT_TYPE = "application/pdf";
	private Flash flash = null;
	
	/**
	 * Resuelve el locale del cliente
	 */
	public Locale getLocale(){
		return getFacesContext().getViewRoot().getLocale();
	}

	/**<commit_msg>removed deprecated constant<commit_after>/**
 * This file is part of CMDit.
 *
 * CMDit is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * CMDit is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with CMDit.  If not, see <http://www.gnu.org/licenses/>.
 */
package org.malaguna.cmdit.bbeans;

import java.io.File;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;

import javax.el.ELContext;
import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.component.UIData;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.faces.context.Flash;
import javax.faces.model.SelectItem;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.io.FileUtils;
import org.malaguna.cmdit.model.AbstractObject;
import org.malaguna.cmdit.model.usrmgt.User;
import org.malaguna.cmdit.service.BeanNames;
import org.malaguna.cmdit.service.CommandRunner;
import org.malaguna.cmdit.service.ServiceDelegate;
import org.malaguna.cmdit.service.commands.Command;
import org.malaguna.cmdit.service.commands.CommandException;
import org.malaguna.cmdit.service.commands.ResultCommand;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

/**
 * Clase abstracta con los atributos comunes a cualquier
 * Back Bean de la aplicación:
 *  - Acceso a la sesion
 *  - Acceso a la capa de servicio
 *  - Tratamiento común de errores en la lógica
 *  
 */
public class AbstractBean extends CommandRunner{
	private final static String AUTH_USER_KEY = "authuser";
	private Flash flash = null;
	
	/**
	 * Resuelve el locale del cliente
	 */
	public Locale getLocale(){
		return getFacesContext().getViewRoot().getLocale();
	}

	/**
{'fraction_non_alphanumeric': 0.08801341156747695, 'fraction_numerical': 0.00041911148365465214, 'mean_word_length': 4.723021582733813, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1369111', 'n_tokens_mistral': 1405, 'n_tokens_neox': 1381, 'n_words': 439}