Skip to content

Commit

Permalink
Merge remote branch 'remotes/origin/RemoteAPI_bug_fix'
Browse files Browse the repository at this point in the history
  • Loading branch information
Markus Zorn committed Nov 29, 2011
2 parents aa63fb7 + 7607fde commit ed9e708
Show file tree
Hide file tree
Showing 15 changed files with 1,181 additions and 872 deletions.
27 changes: 15 additions & 12 deletions GraphDS/Client/Implementations/GraphDSRemoteClient/ConvertHelper.cs
Expand Up @@ -56,19 +56,22 @@ internal static ServiceEdgeInstance ToServiceEdgeInstance(IEdge myEdge)
internal static IAttributeDefinition ToAttributeDefinition(ServiceAttributeDefinition mySvcAttributeDefinition, IServiceToken myServiceToken)
{
IAttributeDefinition AttributeDefinition = null;
switch(mySvcAttributeDefinition.Kind)
if (mySvcAttributeDefinition != null)
{
case ServiceAttributeType.Property:
AttributeDefinition = new RemotePropertyDefinition((ServicePropertyDefinition)mySvcAttributeDefinition, myServiceToken);
break;
case ServiceAttributeType.BinaryProperty:
throw new NotImplementedException();
case ServiceAttributeType.IncomingEdge:
AttributeDefinition = new RemoteIncomingEdgeDefinition((ServiceIncomingEdgeDefinition)mySvcAttributeDefinition, myServiceToken);
break;
case ServiceAttributeType.OutgoingEdge:
AttributeDefinition = new RemoteOutgoingEdgeDefinition((ServiceOutgoingEdgeDefinition)mySvcAttributeDefinition, myServiceToken);
break;
switch (mySvcAttributeDefinition.Kind)
{
case ServiceAttributeType.Property:
AttributeDefinition = new RemotePropertyDefinition((ServicePropertyDefinition)mySvcAttributeDefinition, myServiceToken);
break;
case ServiceAttributeType.BinaryProperty:
throw new NotImplementedException();
case ServiceAttributeType.IncomingEdge:
AttributeDefinition = new RemoteIncomingEdgeDefinition((ServiceIncomingEdgeDefinition)mySvcAttributeDefinition, myServiceToken);
break;
case ServiceAttributeType.OutgoingEdge:
AttributeDefinition = new RemoteOutgoingEdgeDefinition((ServiceOutgoingEdgeDefinition)mySvcAttributeDefinition, myServiceToken);
break;
}
}
return AttributeDefinition;
}
Expand Down
Expand Up @@ -93,6 +93,7 @@
<Compile Include="StubExtensions\ServiceRequests\ServicePropertyPredefinition.cs" />
<Compile Include="StubExtensions\ServiceRequests\ServiceSingleEdgeUpdateDefinition.cs" />
<Compile Include="StubExtensions\ServiceRequests\ServiceUniquePredefinition.cs" />
<Compile Include="StubExtensions\ServiceRequests\ServiceUnknownAttributePredefinition.cs" />
<Compile Include="StubExtensions\ServiceRequests\ServiceVertexTypePredefinition.cs" />
<Compile Include="StubExtensions\ServiceTypeManagement\ServiceBaseType.cs" />
<Compile Include="StubExtensions\ServiceTypeManagement\ServiceEdgeType.cs" />
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Expand Up @@ -36,6 +36,10 @@ internal ServiceAlterVertexChangeset(RequestAlterVertexType myRequestAlterVertex
this.ToBeRemovedMandatories = (myRequestAlterVertexType.ToBeRemovedMandatories == null)
? null : myRequestAlterVertexType.ToBeRemovedMandatories.ToList();
this.ToBeRenamedProperties = myRequestAlterVertexType.ToBeRenamedProperties;
this.ToBeDefinedAttributes = (myRequestAlterVertexType.ToBeDefinedAttributes == null)
? null : myRequestAlterVertexType.ToBeDefinedAttributes.Select(x => new ServiceUnknownAttributePredefinition(x)).ToList();
this.ToBeUndefinedAttributes = (myRequestAlterVertexType.ToBeUndefinedAttributes == null)
? null : myRequestAlterVertexType.ToBeUndefinedAttributes.ToList();
}
}
}
Expand Up @@ -11,7 +11,7 @@ public partial class ServiceIndexPredefinition
internal ServiceIndexPredefinition(IndexPredefinition myIndexPredefinition)
{
this.Edition = myIndexPredefinition.Edition;
this.TypeName = myIndexPredefinition.TypeName;
this.IndexTypeName = myIndexPredefinition.TypeName;
this.Name = myIndexPredefinition.Name;
this.IndexOptions = myIndexPredefinition.IndexOptions;
this.Properties = myIndexPredefinition.Properties.ToList();
Expand Down
@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using sones.GraphDB.TypeSystem;

namespace sones.GraphDS.GraphDSRemoteClient.sonesGraphDSRemoteAPI
{
public partial class ServiceUnknownAttributePredefinition
{
internal ServiceUnknownAttributePredefinition(UnknownAttributePredefinition myPredef)
: base(myPredef)
{
DefaultValue = myPredef.DefaultValue;
EdgeType = myPredef.EdgeType;
InnerEdgeType = myPredef.InnerEdgeType;
IsMandatory = myPredef.IsMandatory;
IsUnique = myPredef.IsUnique;
Multiplicity = myPredef.Multiplicity;
}
}
}
Expand Up @@ -74,5 +74,11 @@ public class ServiceAlterVertexChangeset

[DataMember]
public Dictionary<String, String> ToBeRenamedProperties;

[DataMember]
public List<ServiceUnknownAttributePredefinition> ToBeDefinedAttributes;

[DataMember]
public List<String> ToBeUndefinedAttributes;
}
}
Expand Up @@ -40,7 +40,7 @@ public class ServiceIndexPredefinition
/// The name of the index type.
/// </summary>
[DataMember]
public string TypeName;
public string IndexTypeName;

/// <summary>
/// The name of the index
Expand All @@ -54,14 +54,6 @@ public class ServiceIndexPredefinition
[DataMember]
public Dictionary<String, Object> IndexOptions;

/// <summary>
/// The options that will be passed to the index instance
/// </summary>
[DataMember]
public String IndexType;



/// <summary>
/// The set of properties that will be indexed.
/// </summary>
Expand All @@ -81,10 +73,9 @@ public class ServiceIndexPredefinition
public IndexPredefinition ToIndexPredefinition()
{
IndexPredefinition IndexPreDef = new IndexPredefinition(this.Name, this.VertexTypeName);

IndexPreDef.SetComment(this.Comment);
IndexPreDef.SetEdition(this.Edition);
IndexPreDef.SetIndexType(this.IndexType);
IndexPreDef.SetIndexType(this.IndexTypeName);
if (this.IndexOptions != null)
{
IndexPreDef.AddOptions(this.IndexOptions);
Expand Down
Expand Up @@ -32,7 +32,6 @@ namespace sones.GraphDS.Services.RemoteAPIService.DataContracts.ServiceRequests
[DataContract(Namespace = sonesRPCServer.Namespace)]
public class ServiceUniquePredefinition
{

/// <summary>
/// The set of properties that will be unique together.
/// </summary>
Expand All @@ -47,8 +46,6 @@ public UniquePredefinition ToUniquePredefinition()
uniquepredefinition.AddPropery(Property);
}
return uniquepredefinition;

}

}
}
@@ -0,0 +1,69 @@
/*
* sones GraphDB - Community Edition - http://www.sones.com
* Copyright (C) 2007-2011 sones GmbH
*
* This file is part of sones GraphDB Community Edition.
*
* sones GraphDB is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* sones GraphDB is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with sones GraphDB. If not, see <http://www.gnu.org/licenses/>.
*
*/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using sones.GraphDB.TypeSystem;

namespace sones.GraphDS.Services.RemoteAPIService.DataContracts.ServiceRequests
{
[DataContract(Namespace = sonesRPCServer.Namespace)]
public class ServiceUnknownAttributePredefinition : ServiceAttributePredefinition
{
[DataMember]
public String Multiplicity;

[DataMember]
public String DefaultValue;

[DataMember]
public String EdgeType;

[DataMember]
public String InnerEdgeType;

[DataMember]
public bool IsMandatory;

[DataMember]
public bool IsUnique;

public UnknownAttributePredefinition ToUnknownAttributePredefinition()
{
var attributePredef = new UnknownAttributePredefinition(this.AttributeName, this.AttributeType);
attributePredef.SetMultiplicity(this.Multiplicity);
attributePredef.SetDefaultValue(this.DefaultValue);
attributePredef.SetEdgeType(this.EdgeType);
attributePredef.SetInnerEdgeType(this.InnerEdgeType);
if (this.IsMandatory == true)
{
attributePredef.SetAsMandatory();
}
if (this.IsUnique == true)
{
attributePredef.SetAsUnique();
}
return attributePredef;
}
}
}
Expand Up @@ -87,6 +87,7 @@
<Compile Include="DataContracts\ServiceRequests\ServiceOutgoingEdgePredefinition.cs" />
<Compile Include="DataContracts\ServiceRequests\ServicePropertyPredefinition.cs" />
<Compile Include="DataContracts\ServiceRequests\ServiceUniquePredefinition.cs" />
<Compile Include="DataContracts\ServiceRequests\ServiceUnknownAttributePredefinition.cs" />
<Compile Include="DataContracts\ServiceRequests\ServiceVertexTypePredefinition.cs" />
<Compile Include="DataContracts\ServiceTypeManagement\ServiceAttributeDefinition.cs" />
<Compile Include="DataContracts\ServiceTypeManagement\ServiceAttributeType.cs" />
Expand Down

0 comments on commit ed9e708

Please sign in to comment.