mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Small changes to model/interfaces
Cropping some data Adding an Update method, and renaming to ITopologyDescriptorManager --HG-- branch : dev
This commit is contained in:
@@ -83,15 +83,9 @@ namespace Orchard.Tests.Environment.Topology {
|
||||
|
||||
var descriptor = new ShellTopologyDescriptor {
|
||||
SerialNumber = 6655321,
|
||||
Settings = new ShellSettings {
|
||||
Name = "Testing",
|
||||
DataProvider = "s1",
|
||||
DataConnectionString = "s2",
|
||||
DataPrefix = "s3"
|
||||
},
|
||||
EnabledFeatures = new[] {
|
||||
new TopologyFeature {ExtensionName = "f1", FeatureName = "f2"},
|
||||
new TopologyFeature {ExtensionName = "f3", FeatureName = "f4"},
|
||||
new TopologyFeature { Name = "f2"},
|
||||
new TopologyFeature { Name = "f4"},
|
||||
},
|
||||
Parameters = new[] {
|
||||
new TopologyParameter {Component = "p1", Name = "p2",Value = "p3"},
|
||||
@@ -104,8 +98,8 @@ namespace Orchard.Tests.Environment.Topology {
|
||||
var result = service.Fetch("Hello");
|
||||
var resultInfo = result.ToDataString();
|
||||
|
||||
Assert.That(descriptorInfo, Is.StringContaining("Testing"));
|
||||
Assert.That(resultInfo, Is.StringContaining("Testing"));
|
||||
Assert.That(descriptorInfo, Is.StringContaining("6655321"));
|
||||
Assert.That(resultInfo, Is.StringContaining("6655321"));
|
||||
Assert.That(descriptorInfo, Is.EqualTo(resultInfo));
|
||||
|
||||
}
|
||||
|
@@ -6,9 +6,13 @@ using Orchard.Environment.Topology;
|
||||
using Orchard.Environment.Topology.Models;
|
||||
|
||||
namespace Orchard.Core.Settings.Services {
|
||||
public class TopologyDescriptorProvider : ITopologyDescriptorProvider {
|
||||
public class TopologyDescriptorManager : ITopologyDescriptorManager {
|
||||
public ShellTopologyDescriptor GetTopologyDescriptor() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void UpdateTopologyDescriptor(int priorSerialNumber, IEnumerable<TopologyFeature> enabledFeatures, IEnumerable<TopologyParameter> parameters) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,26 @@
|
||||
using System.Collections.Generic;
|
||||
using Orchard.Environment.Topology.Models;
|
||||
|
||||
namespace Orchard.Environment.Topology {
|
||||
/// <summary>
|
||||
/// Service resolved out of the shell container. Primarily used by host.
|
||||
/// </summary>
|
||||
public interface ITopologyDescriptorManager {
|
||||
/// <summary>
|
||||
/// Uses shell-specific database or other resources to return
|
||||
/// the current "correct" configuration. The host will use this information
|
||||
/// to reinitialize the shell.
|
||||
/// </summary>
|
||||
ShellTopologyDescriptor GetTopologyDescriptor();
|
||||
|
||||
/// <summary>
|
||||
/// Alters databased information to match information passed as arguments.
|
||||
/// Prior SerialNumber used for optomistic concurrency, and an exception
|
||||
/// should be thrown if the number in storage doesn't match what's provided.
|
||||
/// </summary>
|
||||
void UpdateTopologyDescriptor(
|
||||
int priorSerialNumber,
|
||||
IEnumerable<TopologyFeature> enabledFeatures,
|
||||
IEnumerable<TopologyParameter> parameters);
|
||||
}
|
||||
}
|
@@ -1,15 +0,0 @@
|
||||
using Orchard.Environment.Topology.Models;
|
||||
|
||||
namespace Orchard.Environment.Topology {
|
||||
/// <summary>
|
||||
/// Service resolved out of the shell container. Primarily used by host.
|
||||
/// </summary>
|
||||
public interface ITopologyDescriptorProvider {
|
||||
/// <summary>
|
||||
/// Uses shell-specific database or other resources to return
|
||||
/// the current "correct" configuration. The host will use this information
|
||||
/// to reinitialize the shell.
|
||||
/// </summary>
|
||||
ShellTopologyDescriptor GetTopologyDescriptor();
|
||||
}
|
||||
}
|
@@ -4,14 +4,12 @@ using Orchard.Environment.Configuration;
|
||||
namespace Orchard.Environment.Topology.Models {
|
||||
public class ShellTopologyDescriptor {
|
||||
public int SerialNumber { get; set; }
|
||||
public ShellSettings Settings { get; set; }
|
||||
public IEnumerable<TopologyFeature> EnabledFeatures { get; set; }
|
||||
public IEnumerable<TopologyParameter> Parameters { get; set; }
|
||||
}
|
||||
|
||||
public class TopologyFeature {
|
||||
public string ExtensionName { get; set; }
|
||||
public string FeatureName { get; set; }
|
||||
public string Name { get; set; }
|
||||
}
|
||||
|
||||
public class TopologyParameter {
|
||||
|
Reference in New Issue
Block a user