Skip to content

Commit

Permalink
Merge branch 'release/1.7.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
dawoe committed Nov 27, 2018
2 parents 48b5378 + 8e6def9 commit cb69535
Show file tree
Hide file tree
Showing 17 changed files with 84 additions and 65 deletions.
4 changes: 2 additions & 2 deletions Source/Our.Umbraco.Nexu.Core.Tests/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// 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("1.6.0.0")]
[assembly: AssemblyFileVersion("1.6.0.0")]
[assembly: AssemblyVersion("1.7.0.0")]
[assembly: AssemblyFileVersion("1.7.0.0")]
13 changes: 11 additions & 2 deletions Source/Our.Umbraco.Nexu.Core/BootStrapper.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace Our.Umbraco.Nexu.Core
using Umbraco.Core.Logging;

namespace Our.Umbraco.Nexu.Core
{
using System;
using System.Collections.Generic;
Expand Down Expand Up @@ -114,7 +116,14 @@ private void ServerVariablesParserParsing(object sender, Dictionary<string, obje

private void ParseContentInBackground(object info)
{
NexuService.Current.ParseContent((IContent)info);
try
{
NexuService.Current.ParseContent((IContent)info);
}
catch (Exception e)
{
LogHelper.Error<BootStrapper>("An unhandled exception occurred while parsing content", e);
}
}
}
}
2 changes: 1 addition & 1 deletion Source/Our.Umbraco.Nexu.Core/Interfaces/INexuService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/// <summary>
/// The NexuService interface.
/// </summary>
internal interface INexuService
public interface INexuService
{
/// <summary>
/// Gets all property parsrs
Expand Down
2 changes: 1 addition & 1 deletion Source/Our.Umbraco.Nexu.Core/Models/PropertyWithParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/// <summary>
/// The property with parser.
/// </summary>
internal class PropertyWithParser
public class PropertyWithParser
{
/// <summary>
/// Initializes a new instance of the <see cref="PropertyWithParser"/> class.
Expand Down
4 changes: 2 additions & 2 deletions Source/Our.Umbraco.Nexu.Core/NexuService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
/// <summary>
/// Nexu service
/// </summary>
internal class NexuService : INexuService
public class NexuService : INexuService
{
/// <summary>
/// Internal service instance
Expand Down Expand Up @@ -60,7 +60,7 @@ internal class NexuService : INexuService
/// <param name="dataTypeService">
/// The data Type Service.
/// </param>
public NexuService(
internal NexuService(
ProfilingLogger profiler,
IRelationService relationService,
PropertyParserResolver propertyParserResolver,
Expand Down
4 changes: 2 additions & 2 deletions Source/Our.Umbraco.Nexu.Core/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
// 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("1.6.0.0")]
[assembly: AssemblyFileVersion("1.6.0.0")]
[assembly: AssemblyVersion("1.7.0.0")]
[assembly: AssemblyFileVersion("1.7.0.0")]


84 changes: 47 additions & 37 deletions Source/Our.Umbraco.Nexu.Core/WebApi/NexuApiController.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
namespace Our.Umbraco.Nexu.Core.WebApi
using System;
using Umbraco.Core.Logging;

namespace Our.Umbraco.Nexu.Core.WebApi
{
using System.Collections.Generic;
using System.Linq;
Expand Down Expand Up @@ -188,56 +191,63 @@ public HttpResponseMessage Rebuild(int id = Constants.System.Root)
/// </param>
internal void RebuildJob(object id)
{
var rootLevelItems = new List<IContent>();


var attempInt = id.TryConvertTo<int>();

if (!attempInt.Success)
try
{
return;
}
var rootLevelItems = new List<IContent>();

// mark rebuild in progress
NexuContext.Current.IsProcessing = true;

if (attempInt.Result == Constants.System.Root)
{
// get the root level content items
rootLevelItems = this.contentService.GetRootContent().ToList();
}
else
{
// get the indicated start item
var startItem = this.contentService.GetById(attempInt.Result);
var attempInt = id.TryConvertTo<int>();

if (startItem != null)
if (!attempInt.Success)
{
rootLevelItems.Add(startItem);
return;
}
}

// parse content tree
foreach (var item in rootLevelItems)
{
this.ParseContent(item);
}
// mark rebuild in progress
NexuContext.Current.IsProcessing = true;

// parser recyle bin
if (attempInt.Result == Constants.System.Root)
{
rootLevelItems = this.contentService.GetChildren(Constants.System.RecycleBinContent).ToList();
if (attempInt.Result == Constants.System.Root)
{
// get the root level content items
rootLevelItems = this.contentService.GetRootContent().ToList();
}
else
{
// get the indicated start item
var startItem = this.contentService.GetById(attempInt.Result);

if (startItem != null)
{
rootLevelItems.Add(startItem);
}
}

// parse content tree
foreach (var item in rootLevelItems)
{
this.ParseContent(item);
}
}

// reset context variables after processing
NexuContext.Current.IsProcessing = false;
NexuContext.Current.ItemsProcessed = 0;
NexuContext.Current.ItemInProgress = string.Empty;
// parser recyle bin
if (attempInt.Result == Constants.System.Root)
{
rootLevelItems = this.contentService.GetChildren(Constants.System.RecycleBinContent).ToList();

foreach (var item in rootLevelItems)
{
this.ParseContent(item);
}
}

// reset context variables after processing
NexuContext.Current.IsProcessing = false;
NexuContext.Current.ItemsProcessed = 0;
NexuContext.Current.ItemInProgress = string.Empty;
}
catch (Exception e)
{
LogHelper.Error<NexuApiController>("An unhandled exception occurred while parsing content", e);
}
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// 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("1.6.0.0")]
[assembly: AssemblyFileVersion("1.6.0.0")]
[assembly: AssemblyVersion("1.7.0.0")]
[assembly: AssemblyFileVersion("1.7.0.0")]
4 changes: 2 additions & 2 deletions Source/Our.Umbraco.Nexu.Parsers/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// 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("1.6.0.0")]
[assembly: AssemblyFileVersion("1.6.0.0")]
[assembly: AssemblyVersion("1.7.0.0")]
[assembly: AssemblyFileVersion("1.7.0.0")]
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ public IEnumerable<ILinkedEntity> GetLinkedEntities(object propertyValue)
{
try
{
var parsers = new Dictionary<string, IPropertyParser>();
var parsers = new Dictionary<KeyValuePair<string,string>, IPropertyParser>();
var dataTypes = new Dictionary<Guid, IDataTypeDefinition>();
var modelFieldSets = model["fieldsets"];
if (modelFieldSets.Any())
{
{
foreach (var fieldset in modelFieldSets)
{
var items = this._aliasToIdMappings[fieldset["alias"].ToString()];
Expand All @@ -112,18 +112,18 @@ public IEnumerable<ILinkedEntity> GetLinkedEntities(object propertyValue)
{
var parser = PropertyParserResolver.Current.Parsers.FirstOrDefault(x => x.IsParserFor(dataType));
if (parser != null)
{
parsers.Add(prop.Key, parser);
{
parsers.Add(new KeyValuePair<string, string>(prop.Key,fieldset["id"].ToString()), parser);
}
}
}

foreach (var alias in parsers.Keys)
foreach (var keyValuePair in parsers.Keys)
{
var item = fieldset["properties"].FirstOrDefault(x => x["alias"].ToString() == alias);
var item = fieldset["properties"].FirstOrDefault(x=>x["alias"].ToString() == keyValuePair.Key);
if (item != null)
{
entities.AddRange(parsers[alias].GetLinkedEntities(item["value"]));
entities.AddRange(parsers[keyValuePair].GetLinkedEntities(item["value"]));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public IEnumerable<ILinkedEntity> GetLinkedEntities(object propertyValue)
var vortoDataType = this.dataTypeService.GetDataTypeDefinitionById(new Guid(vortoDataTypeGuid));

var preValues =
this.dataTypeService.GetPreValuesCollectionByDataTypeId(vortoDataType.Id).PreValuesAsDictionary;
this.dataTypeService.GetPreValuesCollectionByDataTypeId(vortoDataType.Id).FormatAsDictionary();

var editorDataTypeGuid = JsonConvert.DeserializeObject<JObject>(preValues["dataType"].Value).Value<string>("guid");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public bool IsParserFor(IDataTypeDefinition dataTypeDefinition)
}

var prevalues =
this.dataTypeService.GetPreValuesCollectionByDataTypeId(dataTypeDefinition.Id).PreValuesAsDictionary;
this.dataTypeService.GetPreValuesCollectionByDataTypeId(dataTypeDefinition.Id).FormatAsDictionary();

if (!prevalues.ContainsKey("startNode"))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public bool IsParserFor(IDataTypeDefinition dataTypeDefinition)
}

var prevalues =
this.dataTypeService.GetPreValuesCollectionByDataTypeId(dataTypeDefinition.Id).PreValuesAsDictionary;
this.dataTypeService.GetPreValuesCollectionByDataTypeId(dataTypeDefinition.Id).FormatAsDictionary();

if (!prevalues.ContainsKey("startNode"))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public bool IsParserFor(IDataTypeDefinition dataTypeDefinition)
}

var prevalues =
this.dataTypeService.GetPreValuesCollectionByDataTypeId(dataTypeDefinition.Id).PreValuesAsDictionary;
this.dataTypeService.GetPreValuesCollectionByDataTypeId(dataTypeDefinition.Id).FormatAsDictionary();

if (!prevalues.ContainsKey("startNode"))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public bool IsParserFor(IDataTypeDefinition dataTypeDefinition)
}

var prevalues =
this.dataTypeService.GetPreValuesCollectionByDataTypeId(dataTypeDefinition.Id).PreValuesAsDictionary;
this.dataTypeService.GetPreValuesCollectionByDataTypeId(dataTypeDefinition.Id).FormatAsDictionary();

if (!prevalues.ContainsKey("startNode"))
{
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ environment:
os: Visual Studio 2015

# Version format
version: 1.6.0.{build}
version: 1.7.0.{build}

cache:
- Source\packages -> **\packages.config # preserve "packages" directory in the root of build folder but will reset it if packages.config is modified
Expand Down
2 changes: 1 addition & 1 deletion docs/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ From v1.5.0 the dashboard will also list the values from the [configuration opti
- [Multi Url Picker](https://our.umbraco.org/projects/backoffice-extensions/multi-url-picker/)
- [ArcheType](https://our.umbraco.org/projects/backoffice-extensions/archetype/)
- [Stacked Content](https://our.umbraco.org/projects/backoffice-extensions/stacked-content/)

- [Content List](https://our.umbraco.com/projects/backoffice-extensions/content-list/)
## Supported grid editors ##

### Core grid editors ###
Expand Down

0 comments on commit cb69535

Please sign in to comment.