<fim-prefix>t java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import org.olat.core.CoreSpringFactory;
import org.olat.core.configuration.AbstractSpringModule;
import org.apache.logging.log4j.Logger;
import org.olat.core.logging.Tracing;
import org.olat.core.util.StringHelper;
import org.olat.core.util.coordinate.CoordinatorManager;
import org.olat.core.util.xml.XStreamHelper;
import org.olat.course.site.model.CourseSiteConfiguration;
import org.olat.course.site.model.LanguageConfiguration;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.thoughtworks.xstream.XStream;

/**
 * Description:<br>
 * This is the module for sites definition and configuration
 * 
 * <P>
 * Initial Date:  12.07.2005 <br>
 *
 * @author Felix Jost
 * @author srosse, stephane.rosse@frentix.com, http://www.frentix.com
 */
@Service("olatsites")
public class SiteDefinitions extends AbstractSpringModule {
	
	private static final Logger log = Tracing.createLoggerFor(SiteDefinitions.class);

	private Map<String,SiteDefinition> siteDefMap;
	private Map<String,SiteConfiguration> siteConfigMap = new ConcurrentHashMap<>();
	
	private String configSite1;
	private String configSite2;
	private String configSite3;
	private String configSite4;
	private String sitesSettings;
	
	@Autowired
	private List<SiteDefinition> configurers;
	
	private static final XStream xStream = XStreamHelper.createXStreamInstance();
	static {
		// BUG: CWE-91 XML Injection (aka Blind XPath Injection)
		// 
		// FIXED: 
<fim-middle>		XStreamHelper.allowDefaultPackage(xStream);
		xStream.alias("coursesite", CourseSiteConfiguration.class);
		xStream.alias("languageConfig", LanguageConfiguration.class);
		xStream.alias("siteconfig",<fix-suffix> SiteConfiguration.class);
	}
	
	@Autowired
	public SiteDefinitions(CoordinatorManager coordinatorManager) {
		super(coordinatorManager);
	}
	
	
	
	public String getConfigCourseSite1() {
		return configSite1;
	}

	public void setConfigCourseSite1(String config) {
		setStringProperty("site.1.config", config, true);
	}

	public String getConfigCourseSite2() {
		return configSite2;
	}

	public void setConfigCourseSite2(String config) {
		setStringProperty("site.2.config", config, true);
	}
	
	public String getConfigCourseSite3() {
		return configSite3;
	}

	public void setConfigCourseSite3(String config) {
		setStringProperty("site.3.config", config, true);
	}
	
	public String getConfigCourseSite4() {
		return configSite4;
	}

	public void setConfigCourseSite4(String config) {
		setStringProperty("site.4.config", config, true);
	}
	
	public SiteConfiguration getConfigurationSite(String id) {
		return siteConfigMap.computeIfAbsent(id, springId -> {
			SiteConfiguration c = new SiteConfigur<|endoftext|>