<commit_before>/*
 * $Id$
 * $URL$
 */

package org.subethamail.web.action;

import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.subethamail.core.admin.i.ConfigData;
import org.subethamail.web.Backend;
import org.subethamail.web.action.auth.AuthAction;
import org.subethamail.web.model.ErrorMapModel;
import org.tagonist.propertize.Property;

/**
 * Configures settings specific to the site.
 * 
 * @author <NAME>
 */
public class GetSiteSettings extends AuthAction
{
	/** */
	private static Log log = LogFactory.getLog(GetSiteSettings.class);

	public static class Model extends ErrorMapModel
	{
		/** */
		@Property List<ConfigData> configData;
	}

	public void initialize()
	{
		this.getCtx().setModel(new Model());
	}

	/** */
	public void execute() throws Exception
	{
		Model model = (Model)this.getCtx().getModel();
		
		model.configData = Backend.instance().getAdmin().getSiteConfig();
	}
}<commit_msg>Added siteUrl property to the model. These key needs to be accessible from the web frontend. This needs to be fixed, but is commented<commit_after>/*
 * $Id$
 * $URL$
 */

package org.subethamail.web.action;

import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.subethamail.core.admin.i.ConfigData;
import org.subethamail.web.Backend;
import org.subethamail.web.action.auth.AuthAction;
import org.subethamail.web.model.ErrorMapModel;
import org.tagonist.propertize.Property;

/**
 * Configures settings specific to the site.
 * 
 * @author <NAME>
 */
public class GetSiteSettings extends AuthAction
{
	/** */
	private static Log log = LogFactory.getLog(GetSiteSettings.class);

	public static class Model extends ErrorMapModel
	{
		/** */
		@Property List<ConfigData> configData;
		@Property String siteUrl;
	}

	public void initialize()
	{
		this.getCtx().setModel(new Model());
	}

	/** */
	public void execute() throws Exception
	{
		Model model = (Model)this.getCtx().getModel();
		
		model.configData = Backend.instance().getAdmin().getSiteConfig();
		
		for (ConfigData cd : model.configData)
		{
			//TODO: don't use this string here, use the key when it is accessible.
			if(cd.getId().equals("siteUrl"))
			{
				model.siteUrl = cd.getValue().toString();
				break;
			}
		}
	}
}
{'fraction_non_alphanumeric': 0.13256113256113256, 'fraction_numerical': 0.0, 'mean_word_length': 4.114035087719298, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '2650981', 'n_tokens_mistral': 795, 'n_tokens_neox': 756, 'n_words': 173}