Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wcf schema #1

Merged
merged 2 commits into from
Jul 29, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Lithnet.Acma.Ecma2/Lithnet.Acma.Ecma2.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Lithnet.Acma.Ecma2</RootNamespace>
<AssemblyName>Lithnet.Acma.Ecma2</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
Expand Down
4 changes: 2 additions & 2 deletions src/Lithnet.Acma.Ecma2/packages.config
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Costura.Fody" version="1.3.3.0" targetFramework="net40" />
<package id="Fody" version="1.29.4" targetFramework="net40" developmentDependency="true" />
<package id="Fody" version="1.29.4" targetFramework="net40" developmentDependency="true" requireReinstallation="true" />
<package id="ILMerge" version="2.14.1208" targetFramework="net40" />
<package id="Lithnet.Common.ObjectModel" version="1.0.5777.18973" targetFramework="net40" />
<package id="Lithnet.Logging" version="1.0.5774.20685" targetFramework="net40" />
<package id="Lithnet.MetadirectoryServices" version="1.0.6017.24789" targetFramework="net40" />
<package id="PropertyChanged.Fody" version="1.51.3" targetFramework="net40" developmentDependency="true" />
<package id="PropertyChanged.Fody" version="1.51.3" targetFramework="net40" developmentDependency="true" requireReinstallation="true" />
</packages>
2 changes: 1 addition & 1 deletion src/Lithnet.Acma.Editor/Lithnet.Acma.Editor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Lithnet.Acma.Editor</RootNamespace>
<AssemblyName>Lithnet.Acma.Editor</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
Expand Down
2 changes: 1 addition & 1 deletion src/Lithnet.Acma.Editor/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/Lithnet.Acma.Editor/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/Lithnet.Acma.Editor/app.config
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
</setting>
</Lithnet.Acma.Editor.Properties.Settings>
</userSettings>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup></configuration>
4 changes: 2 additions & 2 deletions src/Lithnet.Acma.Editor/packages.config
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Fody" version="1.29.4" targetFramework="net40" developmentDependency="true" />
<package id="Fody" version="1.29.4" targetFramework="net40" developmentDependency="true" requireReinstallation="true" />
<package id="Lithnet.Common.ObjectModel" version="1.0.5777.18973" targetFramework="net40" />
<package id="Lithnet.Common.Presentation" version="1.0.5777.18976" targetFramework="net40" />
<package id="Lithnet.Logging" version="1.0.5774.20685" targetFramework="net40" />
<package id="Lithnet.MetadirectoryServices.Resolver" version="1.0.6006.11723" targetFramework="net40" />
<package id="PropertyChanged.Fody" version="1.51.3" targetFramework="net40" developmentDependency="true" />
<package id="PropertyChanged.Fody" version="1.51.3" targetFramework="net40" developmentDependency="true" requireReinstallation="true" />
<package id="System.Windows.Interactivity.WPF" version="2.0.20525" targetFramework="net40" />
</packages>
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Lithnet.Acma.Installer</RootNamespace>
<AssemblyName>Lithnet.Acma.Installer.CustomActions</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<WixCATargetsPath Condition=" '$(WixCATargetsPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.CA.targets</WixCATargetsPath>
<TargetFrameworkProfile />
Expand Down
2 changes: 1 addition & 1 deletion src/Lithnet.Acma.Installer/Product.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Product Id="*"
Name="Lithnet ACMA"
Language="1033"
Version="1.1.5954"
Version="1.1.6058"
Manufacturer="Lithnet"
UpgradeCode="bcb559bd-8b3a-4a77-9d30-df3fa44b7a13">

Expand Down
2 changes: 1 addition & 1 deletion src/Lithnet.Acma.PS/AcmaObjects/GetAcmaObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

namespace Lithnet.Acma.PS
{
[Cmdlet(VerbsCommon.Get, "AcmaObject", DefaultParameterSetName = "GetResource")]
[Cmdlet(VerbsCommon.Get, "AcmaObject", DefaultParameterSetName = "GetResourceByKey")]
public class GetAcmaObjectCmdLet : AcmaCmdletConnected
{
[Parameter(ParameterSetName = "GetResource", ValueFromPipeline = true, Mandatory = true, Position = 1)]
Expand Down
2 changes: 1 addition & 1 deletion src/Lithnet.Acma.PS/Lithnet.Acma.PS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Lithnet.Acma.PS</RootNamespace>
<AssemblyName>Lithnet.Acma.PS</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
Expand Down
9 changes: 8 additions & 1 deletion src/Lithnet.Acma.PS/Wrappers/AcmaPSObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,14 @@ internal MAObjectHologram GetResourceWithAppliedChanges()
{
foreach (var property in this.Properties)
{
if (ActiveConfig.DB.GetAttribute(property.Name).IsReadOnlyInClass(this.Hologram.ObjectClass))
AcmaSchemaAttribute attribute = ActiveConfig.DB.GetAttribute(property.Name);

if (attribute.IsReadOnlyInClass(this.Hologram.ObjectClass))
{
continue;
}

if (attribute.Operation == AcmaAttributeOperation.AcmaInternalTemp)
{
continue;
}
Expand Down
6 changes: 3 additions & 3 deletions src/Lithnet.Acma.PS/packages.config
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Fody" version="1.29.4" targetFramework="net40" developmentDependency="true" />
<package id="Fody" version="1.29.4" targetFramework="net40" developmentDependency="true" requireReinstallation="true" />
<package id="Lithnet.Common.ObjectModel" version="1.0.5777.18973" targetFramework="net40" />
<package id="Lithnet.Logging" version="1.0.5774.20685" targetFramework="net40" />
<package id="Lithnet.MetadirectoryServices" version="1.0.6017.24789" targetFramework="net40" />
<package id="Lithnet.MetadirectoryServices.Resolver" version="1.0.6006.11723" targetFramework="net40" />
<package id="PropertyChanged.Fody" version="1.51.3" targetFramework="net40" developmentDependency="true" />
<package id="System.Management.Automation" version="6.1.7601.17515" targetFramework="net40" />
<package id="PropertyChanged.Fody" version="1.51.3" targetFramework="net40" developmentDependency="true" requireReinstallation="true" />
<package id="System.Management.Automation" version="6.1.7601.17515" targetFramework="net40" requireReinstallation="true" />
</packages>
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Lithnet.Acma.Presentation</RootNamespace>
<AssemblyName>Lithnet.Acma.Presentation</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
Expand Down
4 changes: 2 additions & 2 deletions src/Lithnet.Acma.Presentation/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
<packages>
<package id="AvalonEdit" version="5.0.3" targetFramework="net40" />
<package id="DocX" version="1.0.0.19" targetFramework="net40" />
<package id="Fody" version="1.29.4" targetFramework="net40" developmentDependency="true" />
<package id="Fody" version="1.29.4" targetFramework="net40" developmentDependency="true" requireReinstallation="true" />
<package id="Lithnet.Common.ObjectModel" version="1.0.5777.18973" targetFramework="net40" />
<package id="Lithnet.Common.Presentation" version="1.0.5777.18976" targetFramework="net40" />
<package id="Lithnet.Logging" version="1.0.5774.20685" targetFramework="net40" />
<package id="Lithnet.MetadirectoryServices" version="1.0.6017.24789" targetFramework="net40" />
<package id="Lithnet.Transforms" version="1.5.6017.25693" targetFramework="net40" />
<package id="Lithnet.Transforms.Presentation" version="1.5.6017.25705" targetFramework="net40" />
<package id="PropertyChanged.Fody" version="1.51.3" targetFramework="net40" developmentDependency="true" />
<package id="PropertyChanged.Fody" version="1.51.3" targetFramework="net40" developmentDependency="true" requireReinstallation="true" />
<package id="System.Windows.Interactivity.WPF" version="2.0.20525" targetFramework="net40" />
</packages>
4 changes: 2 additions & 2 deletions src/Lithnet.Acma.Service/AcmaService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

namespace Lithnet.Acma.Service
{
[ServiceBehavior(Namespace = AcmaServiceConstants.Namespace)]
public class AcmaService : IAcmaService
[ServiceBehavior(Namespace = AcmaServiceConstants.ResourcesNamespace)]
public class AcmaService : IAcmaResourceService
{
internal static ManualResetEvent ConfigLock = new ManualResetEvent(true);

Expand Down
2 changes: 1 addition & 1 deletion src/Lithnet.Acma.Service/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@


<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
</startup>
</configuration>
2 changes: 1 addition & 1 deletion src/Lithnet.Acma.Service/Lithnet.Acma.Service.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Lithnet.Acma.Service</RootNamespace>
<AssemblyName>Lithnet.Acma.Service</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
Expand Down
8 changes: 4 additions & 4 deletions src/Lithnet.Acma.Service/ServiceMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -180,16 +180,16 @@ private void StartSyncServiceHost()

private void StartAcmaServiceHost()
{
this.acmaServiceHost = new ServiceHost(typeof(AcmaService), new Uri(AcmaServiceConfig.NetTcpUri));
this.acmaServiceHost.AddServiceEndpoint(typeof(IAcmaService), AcmaServiceConfig.NetTcpBinding, "");
this.acmaServiceHost = new ServiceHost(typeof(AcmaService), new Uri(AcmaResourceServiceConfig.NetTcpUri));
this.acmaServiceHost.AddServiceEndpoint(typeof(IAcmaResourceService), AcmaResourceServiceConfig.NetTcpBinding, "");
if (this.acmaServiceHost.Description.Behaviors.Find<ServiceMetadataBehavior>() == null)
{
this.acmaServiceHost.Description.Behaviors.Add(AcmaServiceConfig.ServiceMetadataDisabledBehavior);
this.acmaServiceHost.Description.Behaviors.Add(AcmaResourceServiceConfig.ServiceMetadataDisabledBehavior);
}

if (this.acmaServiceHost.Description.Behaviors.Find<ServiceDebugBehavior>() == null)
{
this.acmaServiceHost.Description.Behaviors.Add(AcmaServiceConfig.ServiceDebugBehavior);
this.acmaServiceHost.Description.Behaviors.Add(AcmaResourceServiceConfig.ServiceDebugBehavior);
}

this.acmaServiceHost.Authorization.ServiceAuthorizationManager = new AcmaServiceAuthorizationManager();
Expand Down
4 changes: 2 additions & 2 deletions src/Lithnet.Acma.Service/packages.config
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Fody" version="1.29.4" targetFramework="net40" developmentDependency="true" />
<package id="Fody" version="1.29.4" targetFramework="net40" developmentDependency="true" requireReinstallation="true" />
<package id="Lithnet.Common.ObjectModel" version="1.0.5777.18973" targetFramework="net40" />
<package id="Lithnet.Logging" version="1.0.5774.20685" targetFramework="net40" />
<package id="Lithnet.MetadirectoryServices" version="1.0.6017.24789" targetFramework="net40" />
<package id="Lithnet.MetadirectoryServices.Resolver" version="1.0.6006.11723" targetFramework="net40" />
<package id="PropertyChanged.Fody" version="1.51.3" targetFramework="net40" developmentDependency="true" />
<package id="PropertyChanged.Fody" version="1.51.3" targetFramework="net40" developmentDependency="true" requireReinstallation="true" />
</packages>
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@

namespace Lithnet.Acma.ServiceModel
{
public class AcmaServiceClient : ClientBase<IAcmaService>, IAcmaService
public class AcmaResourceServiceClient : ClientBase<IAcmaResourceService>, IAcmaResourceService
{
public AcmaServiceClient()
: base(AcmaServiceConfig.NetTcpBinding, AcmaServiceConfig.NetTcpEndpointAddress)
public AcmaResourceServiceClient()
: base(AcmaResourceServiceConfig.NetTcpBinding, AcmaResourceServiceConfig.NetTcpEndpointAddress)
{
}

public AcmaServiceClient(string hostname)
: base(AcmaServiceConfig.NetTcpBinding,
public AcmaResourceServiceClient(string hostname)
: base(AcmaResourceServiceConfig.NetTcpBinding,
new EndpointAddress(
new Uri(string.Format(AcmaServiceConfig.NetTcpHostnamePlaceHolderUri, hostname))))
new Uri(string.Format(AcmaResourceServiceConfig.NetTcpHostnamePlaceHolderUri, hostname))))
{
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@

namespace Lithnet.Acma.ServiceModel
{
public class AcmaServiceConfig
public class AcmaResourceServiceConfig
{
public const string NetTcpUri = "net.tcp://localhost:44889/acma/client";
public const string NetTcpUri = "net.tcp://localhost:44889/acma/resource";

public const string NetTcpHostnamePlaceHolderUri = "net.tcp://{0}:44889/acma/client";
public const string NetTcpHostnamePlaceHolderUri = "net.tcp://{0}:44889/acma/resource";

public static ServiceMetadataBehavior ServiceMetadataDisabledBehavior
{
Expand Down Expand Up @@ -65,7 +65,7 @@ public static EndpointAddress NetTcpEndpointAddress
{
get
{
return new EndpointAddress(AcmaServiceConfig.NetTcpUri);
return new EndpointAddress(AcmaResourceServiceConfig.NetTcpUri);
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/Lithnet.Acma.ServiceModel.Client/AcmaServiceConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ namespace Lithnet.Acma.ServiceModel
{
public class AcmaServiceConstants
{
public const string Namespace = "http://lithnet.local/acma/client";
public const string ResourcesNamespace = "http://lithnet.local/acma/resource/";
public const string SchemaNamespace = "http://lithnet.local/acma/schema/";

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

namespace Lithnet.Acma.ServiceModel
{
[ServiceContract(Namespace = AcmaServiceConstants.Namespace)]
public interface IAcmaService
[ServiceContract(Namespace = AcmaServiceConstants.ResourcesNamespace)]
public interface IAcmaResourceService
{
[OperationContract]
[WebGet(UriTemplate = "/resource/{id}")]
Expand All @@ -24,10 +24,6 @@ public interface IAcmaService
[WebGet(UriTemplate = "/resource/?searchAttribute={key}&searchValue={keyValue}&operator={op}")]
IList<AcmaResource> GetResourcesByAttributePair(string key, string keyValue, string op = "Equals");

//[OperationContract]
//[WebGet(UriTemplate = "/resource/?searchAttribute1={key1}&searchValue1={keyValue1}&searchAttribute2={key2}&searchValue2={keyValue2}")]
//IList<AcmaResource> GetResourcesByAttributePairs(string key1, string keyValue1, string key2, string keyValue2);

[OperationContract]
[WebInvoke(UriTemplate = "/resource/{id}", Method="PUT")]
void ReplaceResource(string id, AcmaResource resource);
Expand Down
76 changes: 76 additions & 0 deletions src/Lithnet.Acma.ServiceModel.Client/IAcmaSchemaService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using Lithnet.Acma;
using System.ServiceModel.Web;

namespace Lithnet.Acma.ServiceModel
{
[ServiceContract(Namespace = AcmaServiceConstants.SchemaNamespace)]
public interface IAcmaSchemaService
{
[OperationContract]
[WebGet(UriTemplate = "/schema/objectclass/{name}")]
string GetObjectClass(string name);

[OperationContract]
[WebGet(UriTemplate = "/schema/objectclass/{name}/binding/")]
string GetObjectClassBindings(string name);

[OperationContract]
[WebGet(UriTemplate = "/schema/objectclass/{name}/backlink/")]
string GetObjectClassBackLinks(string name);

[OperationContract]
[WebGet(UriTemplate = "/schema/objectclass/{name}/shadowlink/")]
string GetObjectClassShadowLinks(string name);

[OperationContract]
[WebGet(UriTemplate = "/schema/attribute/{name}")]
string GetAttribute(string name);

[OperationContract]
[WebGet(UriTemplate = "/resource/{objectType}/{key}/{keyValue}")]
AcmaResource GetResourceByTypeAndKey(string objectType, string key, string keyValue);

[OperationContract]
[WebGet(UriTemplate = "/resource/?searchAttribute={key}&searchValue={keyValue}&operator={op}")]
IList<AcmaResource> GetResourcesByAttributePair(string key, string keyValue, string op = "Equals");

[OperationContract]
[WebInvoke(UriTemplate = "/resource/{id}", Method="PUT")]
void ReplaceResource(string id, AcmaResource resource);

[OperationContract]
[WebInvoke(UriTemplate = "/resource/{id}", Method = "PATCH")]
void PatchResource(string id, AcmaResource resource);

[OperationContract]
[WebInvoke(UriTemplate = "/schema/objectclass/{name}", Method = "DELETE")]
void DeleteObjectClass(string name);

[OperationContract]
[WebInvoke(UriTemplate = "/schema/attribute/{name}", Method = "DELETE")]
void DeleteAttribute(string name);

[OperationContract]
[WebInvoke(UriTemplate = "/schema/objectclass/{name}/binding/{attribute}", Method = "DELETE")]
void DeleteBinding(string name, string attribute);

[OperationContract]
[WebInvoke(UriTemplate = "/schema/objectclass/", Method = "POST")]
void CreateObjectClass(object resource);

[OperationContract]
[WebInvoke(UriTemplate = "/schema/attribute/", Method = "POST")]
void CreateAttribute(object resource);

[OperationContract]
[WebInvoke(UriTemplate = "/schema/objectclass/{name}/binding/{attribute}", Method = "POST")]
void CreateBinding(object resource);

}
}
Loading