using System.Collections.Generic;
using zero.Core.Plugins;
namespace zero.Core.Options
{
public class ZeroOptions : IZeroOptions
{
public ZeroOptions()
{
SupportedLanguages = new string[2] { "en-US", "de-DE" };
DefaultLanguage = SupportedLanguages[0];
TokenExpiration = 60;
BackofficePath = "/zero";
Sections = new SectionOptions();
Features = new FeatureOptions();
Pages = new PageOptions();
Permissions = new PermissionOptions();
Renderers = new RendererOptions();
Settings = new SettingsOptions();
Spaces = new SpaceOptions();
}
///
public string ZeroVersion { get; set; }
///
public string DefaultLanguage { get; set; }
///
public string[] SupportedLanguages { get; private set; }
///
public int TokenExpiration { get; set; }
///
public RavenOptions Raven { get; set; }
///
public string BackofficePath { get; set; }
///
//public IZeroPluginConfiguration Backoffice { get; set; }
///
public PluginCollection Plugins { get; set; }
///
public SectionOptions Sections { get; private set; }
///
public FeatureOptions Features { get; private set; }
///
public PageOptions Pages { get; private set; }
///
public PermissionOptions Permissions { get; private set; }
///
public RendererOptions Renderers { get; private set; }
///
public SettingsOptions Settings { get; private set; }
///
public SpaceOptions Spaces { get; private set; }
}
public class RavenOptions
{
public string Url { get; set; }
public string Database { get; set; }
}
public interface IZeroOptions
{
///
/// The currently active version
/// This should not be set manually, as it is used for setup and migrations and incremented automatically
///
string ZeroVersion { get; set; }
///
/// Default language ISO code
///
string DefaultLanguage { get; set; }
///
/// Language ISO codes which are supported by the zero backoffice
///
string[] SupportedLanguages { get; }
///
/// Expiration in minutes of a generated change token for an entity
///
int TokenExpiration { get; set; }
///
/// RavenDB configuration data
///
RavenOptions Raven { get; set; }
///
/// URL path to the backoffice (defaults to /zero)
///
string BackofficePath { get; set; }
///
///
///
PluginCollection Plugins { get; set; }
///
///
///
SectionOptions Sections { get; }
///
///
///
FeatureOptions Features { get; }
///
///
///
PageOptions Pages { get; }
///
///
///
PermissionOptions Permissions { get; }
///
///
///
RendererOptions Renderers { get; }
///
///
///
SettingsOptions Settings { get; }
///
///
///
SpaceOptions Spaces { get; }
///
/// Default settings for the backoffice
///
//IZeroPluginConfiguration Backoffice { get; set; }
}
}