Skip to content

Commit

Permalink
Making configurable 'app short name' for better branding support.
Browse files Browse the repository at this point in the history
  • Loading branch information
mawtex committed Feb 18, 2016
1 parent d38194f commit 42e59bb
Show file tree
Hide file tree
Showing 11 changed files with 57 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ namespace Composite.Core.Configuration.BuildinPlugins.GlobalSettingsProvider
{
internal sealed class BuildinGlobalSettingsProvider : IGlobalSettingsProvider
{
private string _applicationName = "Freja";
private string _applicationName = "Composite C1";
private string _applicationShortName = "C1";
private string _brandedVersionAssemblySource = "Composite";
private string _configurationDirectory = "~";
private string _generatedAssembliesDirectory = "~";
Expand Down Expand Up @@ -38,6 +39,11 @@ public string ApplicationName
get { return _applicationName; }
}

public string ApplicationShortName
{
get { return _applicationShortName; }
}

public string BrandedVersionAssemblySource
{
get { return _brandedVersionAssemblySource; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ public static string ApplicationName



public static string ApplicationShortName
{
get
{
return UseReaderLock(provider => provider.ApplicationShortName);
}
}



public static string BrandedVersionAssemblySource
{
get
Expand Down
11 changes: 11 additions & 0 deletions Composite/Core/Configuration/GlobalSettingsFacade.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,17 @@ public static string ApplicationName
}
}

/// <summary>
/// The short name of the application to be displayed in the UI.
/// </summary>
public static string ApplicationShortName
{
get
{
return _globalSettingsFacade.ApplicationShortName;
}
}

/// <summary>
/// Name of an assembly file, which version should displayed as a product version in UI.
/// </summary>
Expand Down
8 changes: 8 additions & 0 deletions Composite/Core/Configuration/GlobalSettingsFacadeImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ public string ApplicationName
}
}

public string ApplicationShortName
{
get
{
return GlobalSettingsProviderPluginFacade.ApplicationShortName;
}
}

public string BrandedVersionAssemblySource
{
get { return GlobalSettingsProviderPluginFacade.BrandedVersionAssemblySource; }
Expand Down
1 change: 1 addition & 0 deletions Composite/Core/Configuration/IGlobalSettingsFacade.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ namespace Composite.Core.Configuration
internal interface IGlobalSettingsFacade
{
string ApplicationName { get; }
string ApplicationShortName { get; }
string BrandedVersionAssemblySource { get; }
CultureInfo DefaultCultureInfo { get; }
string DefaultCultureName { get; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ internal interface IGlobalSettingsProvider
{
string ApplicationName { get; }

string ApplicationShortName { get; }

string BrandedVersionAssemblySource { get; }

string DefaultCultureName { get; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ public string ApplicationName
}


public string ApplicationShortName
{
get { return _configurationData.ApplicationShortName; }
}


public string BrandedVersionAssemblySource
{
get { return _configurationData.BrandedVersionAssemblySource; }
Expand Down Expand Up @@ -335,6 +341,14 @@ public string ApplicationName
set { base[_applicationNamePropertyName] = value; }
}

private const string _applicationShortNamePropertyName = "applicationShortName";
[ConfigurationProperty(_applicationShortNamePropertyName, IsRequired = true, DefaultValue = "C1")]
public string ApplicationShortName
{
get { return (string)base[_applicationShortNamePropertyName]; }
set { base[_applicationShortNamePropertyName] = value; }
}

private const string _brandedVersionAssemblySourcePropertyName = "brandedVersionAssemblySource";
[ConfigurationProperty(_brandedVersionAssemblySourcePropertyName, IsRequired = false, DefaultValue = "Composite")]
public string BrandedVersionAssemblySource
Expand Down
1 change: 1 addition & 0 deletions Website/App_Data/Composite/Composite.config
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
<add type="Composite.Plugins.GlobalSettings.GlobalSettingsProviders.ConfigBasedGlobalSettingsProvider, Composite" name="ConfigBasedGlobalSettingsProvider"
autoCreatedAdministratorUserName="admin"
applicationName="Composite C1"
applicationShortName="C1"
brandedVersionAssemblySource="Composite"
defaultCultureName="en-US"
enableDataTypesAutoUpdate="true"
Expand Down
1 change: 1 addition & 0 deletions Website/App_Data/Composite/ReleaseBuild.Composite.config
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
<add type="Composite.Plugins.GlobalSettings.GlobalSettingsProviders.ConfigBasedGlobalSettingsProvider, Composite" name="ConfigBasedGlobalSettingsProvider"
autoCreatedAdministratorUserName="admin"
applicationName="Composite C1"
applicationShortName="C1"
brandedVersionAssemblySource="Composite"
defaultCultureName="en-US"
enableDataTypesAutoUpdate="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,4 @@ Changes in 5.0 or later
Changes in 5.1 or later
<add userControlVirtualPath="~/Composite/controls/FormsControls/FormUiControlTemplates/Selectors/SvgIconSelector.ascx" cacheCompiledUserControlType="true" type="Composite.Plugins.Forms.WebChannel.UiControlFactories.TemplatedSvgIconSelectorUiControlFactory, Composite" name="SvgIconSelector" />
<add userControlVirtualPath="~/Composite/controls/FormsControls/FormUiControlTemplates/Selectors/SvgIconSelector.ascx" cacheCompiledUserControlType="true" type="Composite.Plugins.Forms.WebChannel.UiControlFactories.TemplatedSvgIconSelectorUiControlFactory, Composite" name="ConsoleIconSelector" svgSpritePath="~/Composite/images/sprite.svg" />
- Added a global configuration settings @applicationShortName
2 changes: 1 addition & 1 deletion Website/Composite/top.aspx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<%--<meta http-equiv="x-ua-compatible" content="IE=EmulateIE9" >--%>
<%--<meta http-equiv="X-UA-Compatible" content="IE=5">--%>

<title>C1: <%= Request.Url.Host%></title>
<title><%= Composite.Core.Configuration.GlobalSettingsFacade.ApplicationShortName %>: <%= Request.Url.Host%></title>
<meta name="robots" content="noindex, nofollow" />
<meta name="google" value="notranslate" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down

0 comments on commit 42e59bb

Please sign in to comment.