Skip to content

Commit

Permalink
Content Edition Version reporting #48
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinJump committed May 5, 2016
1 parent 65c8ecc commit b0e0e28
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 3 deletions.
23 changes: 23 additions & 0 deletions Jumoo.uSync.BackOffice/Controllers/uSyncBackOfficeApiController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
using System.Text;
using System.Threading.Tasks;
using System.Web.Http;
using Umbraco.Core;
using Umbraco.Core.Logging;
using Umbraco.Web.Editors;
using Umbraco.Web.Mvc;
using Umbraco.Web.WebApi;
Expand Down Expand Up @@ -47,10 +49,25 @@ public IEnumerable<uSyncAction> Import(bool force)
[HttpGet]
public BackOfficeSettings GetSettings()
{
string addOnString = "";

var types = TypeFinder.FindClassesOfType<IuSyncAddOn>();
foreach (var t in types)
{
var typeInstance = Activator.CreateInstance(t) as IuSyncAddOn;
if (typeInstance != null)
{
LogHelper.Debug<Events>("Loading AddOn Versions: {0}", () => typeInstance.GetVersionInfo());
addOnString = string.Format("{0} [{1}]", addOnString, typeInstance.GetVersionInfo());
}
}


var settings = new BackOfficeSettings()
{
backOfficeVersion = uSyncBackOfficeContext.Instance.Version,
coreVersion = uSyncCoreContext.Instance.Version,
addOns = addOnString,
settings = uSyncBackOfficeContext.Instance.Configuration.Settings,
};

Expand Down Expand Up @@ -97,6 +114,12 @@ public class BackOfficeSettings
{
public string backOfficeVersion { get; set; }
public string coreVersion { get; set; }
public string addOns { get; set; }
public uSyncBackOfficeSettings settings { get; set; }
}

public interface IuSyncAddOn
{
string GetVersionInfo();
}
}
19 changes: 19 additions & 0 deletions Jumoo.uSync.Content/ContentEdition.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Jumoo.uSync.BackOffice.Controllers;

namespace Jumoo.uSync.Content
{
public class ContentEdition : IuSyncAddOn
{
public string GetVersionInfo()
{
return string.Format("uSync.Content: {0}", typeof(Jumoo.uSync.Content.ContentEdition)
.Assembly.GetName().Version.ToString());
}
}
}
1 change: 1 addition & 0 deletions Jumoo.uSync.Content/Jumoo.uSync.Content.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="BaseContentHandler.cs" />
<Compile Include="ContentEdition.cs" />
<Compile Include="ContentHandler.cs" />
<Compile Include="MediaHandler.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
Expand Down
2 changes: 1 addition & 1 deletion Jumoo.uSync.Content/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.1.1.740")]
[assembly: AssemblyVersion("3.1.2.740")]
4 changes: 2 additions & 2 deletions Jumoo.uSync.Content/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<info>
<package>
<name>uSync.ContentEdition</name>
<version>3.1.0.740</version>
<version>3.1.2.740</version>
<license url="http://opensource.org/licenses/MIT">MIT License</license>
<url>http://jumoo.uk/uSync</url>
<requirements>
Expand All @@ -24,7 +24,7 @@
<website>http://jumoo.uk</website>
</author>
<readme>
<![CDATA[ uSync3 : uSync.ContentEdition 3.1.0.740
<![CDATA[ uSync3 : uSync.ContentEdition 3.1.2.740
======================
Content Edition Extended uSync.BackOffice with Handlers for Content and Media
]]>
Expand Down

0 comments on commit b0e0e28

Please sign in to comment.