public TypeResponse LoadTypesFromDb() { TypeResponse types = new TypeResponse(); SqlCommand selectTypes = new SqlCommand(SelectTypes, MapDbConnection.Connection); MapDbConnection.Open(); SqlDataReader typesReader = selectTypes.ExecuteReader(); int count = 0; do { count++; while (typesReader.Read()) { switch (count) { case 1: NodeType nodeType = new NodeType(); nodeType.LoadSessionObject(typesReader); types.NodeTypes[nodeType.Name] = nodeType; break; case 2: RelationshipType relationshipType = new RelationshipType(); relationshipType.LoadSessionObject(typesReader); types.RelationshipTypes[relationshipType.Name] = relationshipType; break; case 3: DescriptorType descriptorType = new DescriptorType(); descriptorType.LoadSessionObject(typesReader); types.DescriptorTypes[descriptorType.Name] = descriptorType; break; case 4: MetadataType metadataType = new MetadataType(); metadataType.LoadSessionObject(typesReader); types.MetadataTypes[metadataType.Name] = metadataType; break; default: break; } } } while (typesReader.NextResult()); MapDbConnection.Close(); return types; }
public MapParameter UpdateBulkRelationship(GlymaSessionConfiguration configuration, Guid sessionId, Guid responseParameter, MapParameter domainId, MapParameter relationshipId, Dictionary<DescriptorType, MapParameter> nodes, RelationshipType relationshipType) { using (IGlymaSession glymaSession = new SvcAppSPGlymaSession(configuration, sessionId)) { return Base.UpdateBulkRelationship(glymaSession, sessionId, responseParameter, domainId, relationshipId, nodes, relationshipType); } }
public MapParameter UpdateRelationship(GlymaSessionConfiguration configuration, Guid sessionId, MapParameter domainId, MapParameter relationshipId, Dictionary<DescriptorType, MapParameter> nodes, RelationshipType relationshipType) { return UpdateBulkRelationship(configuration, sessionId, Guid.Empty, domainId, relationshipId, nodes, relationshipType); }
public MapParameter AddBulkRelationship(GlymaSessionConfiguration configuration, Guid sessionId, Guid responseParameter, MapParameter domainId, MapParameter rootMapId, Dictionary<DescriptorType, MapParameter> nodes, RelationshipType relationshipType, string originalId) { using (IGlymaSession glymaSession = new SvcAppSPGlymaSession(configuration, sessionId)) { return Base.AddBulkRelationship(glymaSession, sessionId, responseParameter, domainId, rootMapId, nodes, relationshipType, originalId); } }
public MapParameter AddRelationship(GlymaSessionConfiguration configuration, Guid sessionId, MapParameter domainId, MapParameter rootMapId, Dictionary<DescriptorType, MapParameter> nodes, RelationshipType relationshipType, string originalId) { return AddBulkRelationship(configuration, sessionId, Guid.Empty, domainId, rootMapId, nodes, relationshipType, originalId); }
public MapParameter UpdateBulkRelationship(string callingUrl, Guid sessionId, Guid responseParameter, MapParameter domainId, MapParameter relationshipId, Dictionary<DescriptorType, MapParameter> nodes, RelationshipType relationshipType) { using (GlymaNSApp.NodeServiceClient nodeServiceClient = new GlymaNSApp.NodeServiceClient(callingUrl)) { return nodeServiceClient.UpdateBulkRelationship(callingUrl, sessionId, responseParameter, domainId, relationshipId, nodes, relationshipType); } }
public MapParameter UpdateRelationship(string callingUrl, Guid sessionId, MapParameter domainId, MapParameter relationshipId, Dictionary<DescriptorType, MapParameter> nodes, RelationshipType relationshipType) { return UpdateBulkRelationship(callingUrl, sessionId, Guid.Empty, domainId, relationshipId, nodes, relationshipType); }
public MapParameter AddRelationship(string callingUrl, Guid sessionId, MapParameter domainId, MapParameter rootMapId, Dictionary<DescriptorType, MapParameter> nodes, RelationshipType relationshipType, string originalId) { return AddBulkRelationship(callingUrl, sessionId, Guid.Empty, domainId, rootMapId, nodes, relationshipType, originalId); }
public MapParameter UpdateBulkRelationship(IGlymaSession glymaSession, Guid sessionId, Guid responseParameter, MapParameter domainId, MapParameter relationshipId, Dictionary<DescriptorType, MapParameter> nodes, RelationshipType relationshipType) { MapSession session = glymaSession.Session; MapParameters parameters = glymaSession.Parameters; parameters.AddParameter(domainId); parameters.AddParameter(relationshipId); MapParameter response = null; if (relationshipType != null) { MapTransactionWrapper updateRelationshipOpWrapper = new MapTransactionWrapper(glymaSession); IMapTransaction updateRelationshipOpCore = (IMapTransaction)updateRelationshipOpWrapper; updateRelationshipOpCore.OperationId = TransactionType.UpdateRelationship; updateRelationshipOpWrapper.DomainParameter = domainId; updateRelationshipOpWrapper.RelationshipParameter = relationshipId; updateRelationshipOpCore.RelationshipTypeUid = relationshipType.Id; session.Enqueue(updateRelationshipOpWrapper); if (responseParameter == Guid.Empty) { response = updateRelationshipOpWrapper.ResponseParameter; } else { response = updateRelationshipOpWrapper.BuildResponseParameterFromGuid(responseParameter); } } if (nodes != null) { foreach (KeyValuePair<DescriptorType, MapParameter> descriptorToUpdate in nodes) { parameters.AddParameter(descriptorToUpdate.Value); MapTransactionWrapper updateDescriptorOpWrapper = new MapTransactionWrapper(glymaSession); IMapTransaction updateDescriptorOpCore = (IMapTransaction)updateDescriptorOpWrapper; updateDescriptorOpCore.OperationId = TransactionType.UpdateDescriptor; updateDescriptorOpWrapper.DomainParameter = domainId; updateDescriptorOpWrapper.RelationshipParameter = relationshipId; updateDescriptorOpWrapper.NodeParameter = descriptorToUpdate.Value; updateDescriptorOpCore.DescriptorTypeUid = descriptorToUpdate.Key.Id; session.Enqueue(updateDescriptorOpWrapper); } } glymaSession.PersistSessionObject(); return response; }
public MapParameter AddBulkRelationship(IGlymaSession glymaSession, Guid sessionId, Guid responseParameter, MapParameter domainId, MapParameter rootMapId, Dictionary<DescriptorType, MapParameter> nodes, RelationshipType relationshipType, string originalId) { MapSession session = glymaSession.Session; MapParameters parameters = glymaSession.Parameters; parameters.AddParameter(domainId); parameters.AddParameter(rootMapId); MapTransactionWrapper createRelationshipOpWrapper = new MapTransactionWrapper(glymaSession); IMapTransaction createRelationshipOpCore = (IMapTransaction)createRelationshipOpWrapper; createRelationshipOpCore.OperationId = TransactionType.CreateRelationship; createRelationshipOpWrapper.DomainParameter = domainId; createRelationshipOpWrapper.RootMapParameter = rootMapId; createRelationshipOpCore.RelationshipTypeUid = relationshipType.Id; session.Enqueue(createRelationshipOpWrapper); MapParameter response; if (responseParameter == Guid.Empty) { response = createRelationshipOpWrapper.ResponseParameter; } else { response = createRelationshipOpWrapper.BuildResponseParameterFromGuid(responseParameter); } if (nodes != null) { /// The nodes collection could be null if this is a relationship that is being created without the descriptors having yet been declaread. foreach (KeyValuePair<DescriptorType, MapParameter> descriptorToCreate in nodes) { parameters.AddParameter(descriptorToCreate.Value); MapTransactionWrapper createDescriptorOpWrapper = new MapTransactionWrapper(glymaSession); IMapTransaction createDescriptorOpCore = (IMapTransaction)createDescriptorOpWrapper; createDescriptorOpCore.OperationId = TransactionType.CreateDescriptor; createDescriptorOpWrapper.DomainParameter = domainId; createDescriptorOpWrapper.RootMapParameter = rootMapId; createDescriptorOpCore.DescriptorTypeUid = descriptorToCreate.Key.Id; createDescriptorOpWrapper.NodeParameter = descriptorToCreate.Value; createDescriptorOpWrapper.RelationshipParameter = createRelationshipOpWrapper.ResponseParameter; session.Enqueue(createDescriptorOpWrapper); } } glymaSession.PersistSessionObject(); return response; }
public MapParameter UpdateBulkRelationship(GlymaSessionConfiguration configuration, Guid sessionId, Guid responseParameter, MapParameter domainId, MapParameter relationshipId, Dictionary<DescriptorType, MapParameter> nodes, RelationshipType relationshipType) { MapParameter result = null; // run the call against the application proxy NodeServiceApplicationProxy.Invoke(_serviceContext, proxy => result = proxy.UpdateBulkRelationship(configuration, sessionId, responseParameter, domainId, relationshipId, nodes, relationshipType)); return result; }
public MapParameter AddRelationship(GlymaSessionConfiguration configuration, Guid sessionId, MapParameter domainId, MapParameter rootMapId, Dictionary<DescriptorType, MapParameter> nodes, RelationshipType relationshipType, string originalId) { MapParameter result = null; // run the call against the application proxy NodeServiceApplicationProxy.Invoke(_serviceContext, proxy => result = proxy.AddRelationship(configuration, sessionId, domainId, rootMapId, nodes, relationshipType, originalId)); return result; }
public MapParameter UpdateBulkRelationship(string callingUrl, Guid sessionId, Guid responseParameter, MapParameter domainId, MapParameter relationshipId, Dictionary<DescriptorType, MapParameter> nodes, RelationshipType relationshipType) { using (GlymaNSApp.NodeServiceClient nodeServiceClient = new GlymaNSApp.NodeServiceClient(callingUrl)) { using (WebAppSPGlymaSession glymaSession = new WebAppSPGlymaSession(callingUrl, true, domainId, null, SPGlymaRightFactory.Instance.MapUpdateRight)) { GlymaSessionConfiguration configuration = glymaSession.ExportGlymaSession(); return nodeServiceClient.UpdateBulkRelationship(configuration, sessionId, responseParameter, domainId, relationshipId, nodes, relationshipType); } } }