コード例 #1
0
    // Use this for initialization
    void Start()
    {
        mapParameter = new MapParameter("stage_ice");
        int max_x = MapPosition.MapData.MAX_X;
        int max_y = MapPosition.MapData.MAX_Y;

        for (int i = 0; i < max_x; i++)
        {
            for (int j = 0; j < max_y; j++)
            {
                int val = mapParameter.GetMapChipNumber(i, j);
                if (val == NONE_CHIP)
                {
                    mapchips[i, j] = null; continue;
                }

                var chip = GameObject.Instantiate(template_chip) as GameObject;

                chip.transform.parent     = transform;
                chip.transform.localScale = new Vector3(32F, 32F, 1F);
                chip.GetComponent <MapChip>().SetMapPosition(i, j);
                mapchips[i, j] = chip.GetComponent <MapChip>();
            }
        }
    }
コード例 #2
0
        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);
        }
コード例 #3
0
        public MapParameter UpdateBulkNode(GlymaSessionConfiguration configuration, Guid sessionId, Guid responseParameter, MapParameter domainId, MapParameter nodeId, NodeType nodeType)
        {
            MapParameter result = null;

            // run the call against the application proxy
            NodeServiceApplicationProxy.Invoke(_serviceContext,
                                               proxy => result = proxy.UpdateBulkNode(configuration, sessionId, responseParameter, domainId, nodeId, nodeType));

            return(result);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        public MapParameter DeleteBulkRelationship(GlymaSessionConfiguration configuration, Guid sessionId, Guid responseParameter, MapParameter domainId, MapParameter relationshipId)
        {
            MapParameter result = null;

            // run the call against the application proxy
            NodeServiceApplicationProxy.Invoke(_serviceContext,
                                               proxy => result = proxy.DeleteBulkRelationship(configuration, sessionId, responseParameter, domainId, relationshipId));

            return(result);
        }
コード例 #6
0
        public MapParameter AddBulkMetadata(GlymaSessionConfiguration configuration, Guid sessionId, Guid responseParameter, MapParameter domainId, MapParameter rootMapId, MapParameter node, MapParameter relationship, DescriptorType descriptorType, MetadataType metadataType, string name, string value)
        {
            MapParameter result = null;

            // run the call against the application proxy
            NodeServiceApplicationProxy.Invoke(_serviceContext,
                                               proxy => result = proxy.AddBulkMetadata(configuration, sessionId, responseParameter, domainId, rootMapId, node, relationship, descriptorType, metadataType, name, value));

            return(result);
        }
コード例 #7
0
        public MapParameter DeleteMetadata(GlymaSessionConfiguration configuration, Guid sessionId, MapParameter domainId, MapParameter metadata)
        {
            MapParameter result = null;

            // run the call against the application proxy
            NodeServiceApplicationProxy.Invoke(_serviceContext,
                                               proxy => result = proxy.DeleteMetadata(configuration, sessionId, domainId, metadata));

            return(result);
        }
コード例 #8
0
        public MapParameter UpdateBulkMetadata(GlymaSessionConfiguration configuration, Guid sessionId, Guid responseParameter, MapParameter domainId, MapParameter metadata, string name, string value)
        {
            MapParameter result = null;

            // run the call against the application proxy
            NodeServiceApplicationProxy.Invoke(_serviceContext,
                                               proxy => result = proxy.UpdateBulkMetadata(configuration, sessionId, responseParameter, domainId, metadata, name, value));

            return(result);
        }
コード例 #9
0
        public MapParameter AddBulkNode(GlymaSessionConfiguration configuration, Guid sessionId, Guid responseParameter, MapParameter domainId, MapParameter rootMapId, NodeType nodeType, string originalId)
        {
            MapParameter result = null;

            // run the call against the application proxy
            NodeServiceApplicationProxy.Invoke(_serviceContext,
                                               proxy => result = proxy.AddBulkNode(configuration, sessionId, responseParameter, domainId, rootMapId, nodeType, originalId));

            return(result);
        }
コード例 #10
0
        public MapParameter UpdateBulkMetadata(GlymaSessionConfiguration configuration, Guid sessionId, Guid responseParameter, MapParameter domainId, MapParameter metadata, string name, string value)
        {
            MapParameter result = null;

            // execute the call against the service app
            ExecuteOnChannel("UpdateBulkMetadata",
                             delegate(IGlymaNodeServiceApp channel)
            {
                result = channel.UpdateBulkMetadata(configuration, sessionId, responseParameter, domainId, metadata, name, value);
            });

            return(result);
        }
コード例 #11
0
        public MapParameter AddBulkNode(GlymaSessionConfiguration configuration, Guid sessionId, Guid responseParameter, MapParameter domainId, MapParameter rootMapId, NodeType nodeType, string originalId)
        {
            MapParameter result = null;

            // execute the call against the service app
            ExecuteOnChannel("AddBulkNode",
                             delegate(IGlymaNodeServiceApp channel)
            {
                result = channel.AddBulkNode(configuration, sessionId, responseParameter, domainId, rootMapId, nodeType, originalId);
            });

            return(result);
        }
コード例 #12
0
        public MapParameter DeleteBulkRelationship(GlymaSessionConfiguration configuration, Guid sessionId, Guid responseParameter, MapParameter domainId, MapParameter relationshipId)
        {
            MapParameter result = null;

            // execute the call against the service app
            ExecuteOnChannel("DeleteBulkRelationship",
                             delegate(IGlymaNodeServiceApp channel)
            {
                result = channel.DeleteBulkRelationship(configuration, sessionId, responseParameter, domainId, relationshipId);
            });

            return(result);
        }
コード例 #13
0
        public MapParameter AddBulkMetadata(GlymaSessionConfiguration configuration, Guid sessionId, Guid responseParameter, MapParameter domainId, MapParameter rootMapId, MapParameter node, MapParameter relationship, DescriptorType descriptorType, MetadataType metadataType, string name, string value)
        {
            MapParameter result = null;

            // execute the call against the service app
            ExecuteOnChannel("AddBulkMetadata",
                             delegate(IGlymaNodeServiceApp channel)
            {
                result = channel.AddBulkMetadata(configuration, sessionId, responseParameter, domainId, rootMapId, node, relationship, descriptorType, metadataType, name, value);
            });

            return(result);
        }
コード例 #14
0
        public MapParameter UpdateBulkRelationship(GlymaSessionConfiguration configuration, Guid sessionId, Guid responseParameter, MapParameter domainId, MapParameter relationshipId, Dictionary <DescriptorType, MapParameter> nodes, RelationshipType relationshipType)
        {
            MapParameter result = null;

            // execute the call against the service app
            ExecuteOnChannel("UpdateBulkRelationship",
                             delegate(IGlymaNodeServiceApp channel)
            {
                result = channel.UpdateBulkRelationship(configuration, sessionId, responseParameter, domainId, relationshipId, nodes, relationshipType);
            });

            return(result);
        }
コード例 #15
0
        public MapParameter UpdateBulkNode(GlymaSessionConfiguration configuration, Guid sessionId, Guid responseParameter, MapParameter domainId, MapParameter nodeId, NodeType nodeType)
        {
            MapParameter result = null;

            // execute the call against the service app
            ExecuteOnChannel("UpdateBulkNode",
                             delegate(IGlymaNodeServiceApp channel)
            {
                result = channel.UpdateBulkNode(configuration, sessionId, responseParameter, domainId, nodeId, nodeType);
            });

            return(result);
        }
コード例 #16
0
        public MapParameter AddRelationship(GlymaSessionConfiguration configuration, Guid sessionId, MapParameter domainId, MapParameter rootMapId, Dictionary <DescriptorType, MapParameter> nodes, RelationshipType relationshipType, string originalId)
        {
            MapParameter result = null;

            // execute the call against the service app
            ExecuteOnChannel("AddRelationship",
                             delegate(IGlymaNodeServiceApp channel)
            {
                result = channel.AddRelationship(configuration, sessionId, domainId, rootMapId, nodes, relationshipType, originalId);
            });

            return(result);
        }
コード例 #17
0
        public MapParameter DeleteMetadata(GlymaSessionConfiguration configuration, Guid sessionId, MapParameter domainId, MapParameter metadata)
        {
            MapParameter result = null;

            // execute the call against the service app
            ExecuteOnChannel("DeleteMetadata",
                             delegate(IGlymaNodeServiceApp channel)
            {
                result = channel.DeleteMetadata(configuration, sessionId, domainId, metadata);
            });

            return(result);
        }
コード例 #18
0
    // Use this for initialization
    void Start()
    {
        mapParameter = new MapParameter("stage_ice");
        int max_x = MapPosition.MapData.MAX_X;
        int max_y = MapPosition.MapData.MAX_Y;

        for (int i = 0; i < max_x; i++)
        {
            for (int j = 0; j < max_y; j++)
            {
                int val = mapParameter.GetMapChipNumber(i, j);
                if (val == NONE_CHIP) { mapchips[i, j] = null; continue; }

                var chip = GameObject.Instantiate(template_chip) as GameObject;

                chip.transform.parent = transform;
                chip.transform.localScale = new Vector3(32F, 32F, 1F);
                chip.GetComponent<MapChip>().SetMapPosition(i, j);
                mapchips[i, j] = chip.GetComponent<MapChip>();
            }
        }
    }
コード例 #19
0
        public WebAppSPGlymaSession(string callingUrl, bool isParameter, MapParameter domainParameter, MapParameter rootMapParameter, params IRight[] requiredRights)
        {
            _callingUrl = callingUrl;
            _sessionId  = Guid.Empty;

            IRight[] heightenedRightRequirement = requiredRights;

            Guid?domainId  = null;
            Guid?rootMapId = null;

            if (rootMapParameter == null || rootMapParameter.IsDelayed)
            {
                /// If they passed through a delayed rootmap ID parameter, they are going to have to be a Glyma Map Manager at the very minimum to finish this transaction.
                heightenedRightRequirement = new IRight[] { SPGlymaRightFactory.Instance.RootMapCreateRight };
            }
            else
            {
                rootMapId = rootMapParameter.Value;
            }

            if (domainParameter == null || domainParameter.IsDelayed)
            {
                /// If they passed through a delayed domain ID parameter, they are going to have to be a Glyma Project Manager at the very minimum to finish this transaction.
                heightenedRightRequirement = new IRight[] { SPGlymaRightFactory.Instance.ProjectCreateRight };
            }
            else
            {
                domainId = domainParameter.Value;
            }

            if (!IsAuthorised(domainId, rootMapId, heightenedRightRequirement))
            {
                throw new UnauthorizedAccessException("This user does not have the required privileges for this task.");
            }

            _session    = new MapSession(this);
            _parameters = new MapParameters(this);
        }
コード例 #20
0
 public MapParameter UpdateMetadata(GlymaSessionConfiguration configuration, Guid sessionId, MapParameter domainId, MapParameter metadata, string name, string value)
 {
     return UpdateBulkMetadata(configuration, sessionId, Guid.Empty, domainId, metadata, name, value);
 }
コード例 #21
0
 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);
 }
コード例 #22
0
 public MapParameter UpdateNode(GlymaSessionConfiguration configuration, Guid sessionId, MapParameter domainId, MapParameter nodeId, NodeType nodeType)
 {
     return UpdateBulkNode(configuration, sessionId, Guid.Empty, domainId, nodeId, nodeType);
 }
コード例 #23
0
 public MapParameter DeleteMetadata(GlymaSessionConfiguration configuration, Guid sessionId, MapParameter domainId, MapParameter metadata)
 {
     return DeleteBulkMetadata(configuration, sessionId, Guid.Empty, domainId, metadata);
 }
コード例 #24
0
 public MapParameter DeleteRelationship(GlymaSessionConfiguration configuration, Guid sessionId, MapParameter domainId, MapParameter relationshipId)
 {
     return DeleteBulkRelationship(configuration, sessionId, Guid.Empty, domainId, relationshipId);
 }
コード例 #25
0
 public MapParameter UpdateMetadata(GlymaSessionConfiguration configuration, Guid sessionId, MapParameter domainId, MapParameter metadata, string name, string value)
 {
     return(UpdateBulkMetadata(configuration, sessionId, Guid.Empty, domainId, metadata, name, value));
 }
コード例 #26
0
 public MapParameter UpdateNode(GlymaSessionConfiguration configuration, Guid sessionId, MapParameter domainId, MapParameter nodeId, NodeType nodeType)
 {
     return(UpdateBulkNode(configuration, sessionId, Guid.Empty, domainId, nodeId, nodeType));
 }
コード例 #27
0
ファイル: DeleteDomain.cs プロジェクト: chris-tomich/Glyma
        public int ExecuteDeletion(Guid domainId)
        {
            //SqlCommand deleteMetadataByDomain = new SqlCommand(DeleteDomainMetadataSql, MapDbConnection.Connection);
            //deleteMetadataByDomain.Parameters.Add(new SqlParameter("@DomainUid", domainId));

            //deleteMetadataByDomain.ExecuteNonQuery();

            //SqlCommand deleteDescriptorsByDomain = new SqlCommand(DeleteDomainDescriptorsSql, MapDbConnection.Connection);
            //deleteDescriptorsByDomain.Parameters.Add(new SqlParameter("@DomainUid", domainId));

            //deleteDescriptorsByDomain.ExecuteNonQuery();

            //SqlCommand deleteRelationshipsByDomain = new SqlCommand(DeleteDomainRelationshipsSql, MapDbConnection.Connection);
            //deleteRelationshipsByDomain.Parameters.Add(new SqlParameter("@DomainUid", domainId));

            //deleteRelationshipsByDomain.ExecuteNonQuery();

            //SqlCommand deleteNodesByDomain = new SqlCommand(DeleteDomainNodesSql, MapDbConnection.Connection);
            //deleteNodesByDomain.Parameters.Add(new SqlParameter("@DomainUid", domainId));

            //deleteNodesByDomain.ExecuteNonQuery();

            //SqlCommand deleteDomain = new SqlCommand(DeleteDomainSql, MapDbConnection.Connection);
            //deleteDomain.Parameters.Add(new SqlParameter("@DomainUid", domainId));

            //deleteDomain.ExecuteNonQuery();

            SqlCommand deleteByDomain = new SqlCommand(DeleteDomainSql, MapDbConnection.Connection);
            deleteByDomain.Parameters.Add(new SqlParameter("@DomainUid", domainId));

            int rowsDeleted = deleteByDomain.ExecuteNonQuery();

            Guid sessionId = Guid.NewGuid();

            MapTransaction beginTransaction = new MapTransaction();
            beginTransaction.SessionUid = sessionId;
            beginTransaction.TransactionTimestamp = DateTime.Now.ToUniversalTime();
            beginTransaction.User = User;
            beginTransaction.OperationId = TransactionType.BeginSession;
            beginTransaction.PersistSessionObject(SessionDbConnection);

            MapParameter domainParameter = new MapParameter();
            domainParameter.SessionId = sessionId;
            domainParameter.IsDelayed = false;
            domainParameter.ParameterType = MapParameterType.Domain;
            domainParameter.Value = domainId;
            domainParameter.PersistSessionObject(ParametersDbConnection);

            MapTransaction createRootMapTransaction = new MapTransaction();
            createRootMapTransaction.SessionUid = sessionId;
            createRootMapTransaction.TransactionTimestamp = DateTime.Now.ToUniversalTime();
            createRootMapTransaction.User = User;
            createRootMapTransaction.OperationId = TransactionType.DeleteDomain;
            createRootMapTransaction.DomainParameterUid = domainParameter.Id;
            createRootMapTransaction.PersistSessionObject(SessionDbConnection);

            MapTransaction endTransaction = new MapTransaction();
            endTransaction.SessionUid = sessionId;
            endTransaction.TransactionTimestamp = DateTime.Now.ToUniversalTime();
            endTransaction.User = User;
            endTransaction.OperationId = TransactionType.CompleteSession;
            endTransaction.PersistSessionObject(SessionDbConnection);

            if (rowsDeleted > 0)
            {
                return 1;
            }
            else
            {
                return 0;
            }
        }
コード例 #28
0
ファイル: CreateRootMap.cs プロジェクト: chris-tomich/Glyma
        public Guid Create(Guid domainId, string name, NodeType nodeType, string originalId)
        {
            SqlCommand getDomainNodeId = new SqlCommand(GetDomainNodeId, MapDbConnection.Connection);

            getDomainNodeId.Parameters.Add(new SqlParameter("@NodeTypeUid", new Guid("263754C2-2F31-4D21-B9C4-6509E00A5E94")));
            getDomainNodeId.Parameters.Add(new SqlParameter("@DomainUid", domainId));

            Guid?domainNodeId = (Guid?)getDomainNodeId.ExecuteScalar();

            if (domainNodeId == null)
            {
                return(Guid.Empty);
            }

            Guid     nodeId      = Guid.NewGuid();
            DateTime currentTime = DateTime.Now.ToUniversalTime();

            SqlCommand createRootMapCommand = new SqlCommand(CreateRootMapNode, MapDbConnection.Connection);

            createRootMapCommand.Parameters.Add(new SqlParameter("@NodeUid", nodeId));

            if (string.IsNullOrEmpty(originalId))
            {
                createRootMapCommand.Parameters.Add(new SqlParameter("@NodeOriginalId", DBNull.Value));
            }
            else
            {
                createRootMapCommand.Parameters.Add(new SqlParameter("@NodeOriginalId", originalId));
            }

            createRootMapCommand.Parameters.Add(new SqlParameter("@NodeTypeUid", nodeType.Id));
            createRootMapCommand.Parameters.Add(new SqlParameter("@DomainUid", domainId));
            createRootMapCommand.Parameters.Add(new SqlParameter("@RootMapUid", nodeId));
            createRootMapCommand.Parameters.Add(new SqlParameter("@Created", currentTime));
            createRootMapCommand.Parameters.Add(new SqlParameter("@Modified", currentTime));
            createRootMapCommand.Parameters.Add(new SqlParameter("@CreatedBy", User));
            createRootMapCommand.Parameters.Add(new SqlParameter("@ModifiedBy", User));

            createRootMapCommand.ExecuteNonQuery();

            Guid metadataId = Guid.NewGuid();

            SqlCommand metadataRootMapCommand = new SqlCommand(CreateRootMapNameMetadata, MapDbConnection.Connection);

            metadataRootMapCommand.Parameters.Add(new SqlParameter("@MetadataId", metadataId));
            metadataRootMapCommand.Parameters.Add(new SqlParameter("@MetadataTypeUid", new Guid("C7628C1E-77C1-4A07-A2E8-8DE9F4E9803C")));
            metadataRootMapCommand.Parameters.Add(new SqlParameter("@NodeUid", nodeId));
            metadataRootMapCommand.Parameters.Add(new SqlParameter("@RelationshipUid", DBNull.Value));
            metadataRootMapCommand.Parameters.Add(new SqlParameter("@DescriptorTypeUid", DBNull.Value));
            metadataRootMapCommand.Parameters.Add(new SqlParameter("@MetadataName", "Name"));

            if (string.IsNullOrEmpty(name))
            {
                metadataRootMapCommand.Parameters.Add(new SqlParameter("@MetadataValue", DBNull.Value));
            }
            else
            {
                metadataRootMapCommand.Parameters.Add(new SqlParameter("@MetadataValue", name));
            }

            metadataRootMapCommand.Parameters.Add(new SqlParameter("@RootMapUid", nodeId));
            metadataRootMapCommand.Parameters.Add(new SqlParameter("@DomainUid", domainId));
            metadataRootMapCommand.Parameters.Add(new SqlParameter("@Created", currentTime));
            metadataRootMapCommand.Parameters.Add(new SqlParameter("@Modified", currentTime));
            metadataRootMapCommand.Parameters.Add(new SqlParameter("@CreatedBy", User));
            metadataRootMapCommand.Parameters.Add(new SqlParameter("@ModifiedBy", User));

            metadataRootMapCommand.ExecuteNonQuery();

            Guid relationshipId = Guid.NewGuid();

            SqlCommand relationshipRootMapCommand = new SqlCommand(CreateRootMapRelationship, MapDbConnection.Connection);

            relationshipRootMapCommand.Parameters.Add(new SqlParameter("@RelationshipUid", relationshipId));
            relationshipRootMapCommand.Parameters.Add(new SqlParameter("@RelationshipOriginalId", ""));
            relationshipRootMapCommand.Parameters.Add(new SqlParameter(@"RelationshipTypeUid", new Guid("4AFF46D7-87BE-48DD-B703-A93E38EF8FFB")));
            relationshipRootMapCommand.Parameters.Add(new SqlParameter(@"DomainUid", domainId));
            relationshipRootMapCommand.Parameters.Add(new SqlParameter(@"RootMapUid", nodeId));
            relationshipRootMapCommand.Parameters.Add(new SqlParameter(@"Created", currentTime));
            relationshipRootMapCommand.Parameters.Add(new SqlParameter(@"Modified", currentTime));
            relationshipRootMapCommand.Parameters.Add(new SqlParameter(@"CreatedBy", User));
            relationshipRootMapCommand.Parameters.Add(new SqlParameter(@"ModifiedBy", User));

            relationshipRootMapCommand.ExecuteNonQuery();

            Guid fromDescriptorId = Guid.NewGuid();

            SqlCommand fromDescriptorRootMapCommand = new SqlCommand(CreateRootMapDescriptors, MapDbConnection.Connection);

            fromDescriptorRootMapCommand.Parameters.Add(new SqlParameter("@DescriptorUid", fromDescriptorId));
            fromDescriptorRootMapCommand.Parameters.Add(new SqlParameter("@DescriptorTypeUid", new Guid("96DA1782-058C-4F9B-BB1A-31B048F8C75A")));
            fromDescriptorRootMapCommand.Parameters.Add(new SqlParameter("@NodeUid", nodeId));
            fromDescriptorRootMapCommand.Parameters.Add(new SqlParameter("@RelationshipUid", relationshipId));

            fromDescriptorRootMapCommand.ExecuteNonQuery();

            Guid toDescriptorId = Guid.NewGuid();

            SqlCommand toDescriptorRootMapCommand = new SqlCommand(CreateRootMapDescriptors, MapDbConnection.Connection);

            toDescriptorRootMapCommand.Parameters.Add(new SqlParameter("@DescriptorUid", toDescriptorId));
            toDescriptorRootMapCommand.Parameters.Add(new SqlParameter("@DescriptorTypeUid", new Guid("07C91D35-4DAC-431B-966B-64C924B8CDAB")));
            toDescriptorRootMapCommand.Parameters.Add(new SqlParameter("@NodeUid", domainNodeId.Value));
            toDescriptorRootMapCommand.Parameters.Add(new SqlParameter("@RelationshipUid", relationshipId));

            toDescriptorRootMapCommand.ExecuteNonQuery();

            Guid sessionId = Guid.NewGuid();

            MapTransaction beginTransaction = new MapTransaction();

            beginTransaction.SessionUid           = sessionId;
            beginTransaction.TransactionTimestamp = DateTime.Now.ToUniversalTime();
            beginTransaction.User        = User;
            beginTransaction.OperationId = TransactionType.BeginSession;
            beginTransaction.PersistSessionObject(SessionDbConnection);

            MapParameter domainParameter = new MapParameter();

            domainParameter.SessionId     = sessionId;
            domainParameter.IsDelayed     = false;
            domainParameter.ParameterType = MapParameterType.Domain;
            domainParameter.Value         = domainId;
            domainParameter.PersistSessionObject(ParametersDbConnection);

            MapParameter rootMapParameter = new MapParameter();

            rootMapParameter.SessionId     = sessionId;
            rootMapParameter.IsDelayed     = false;
            rootMapParameter.ParameterType = MapParameterType.RootMap;
            rootMapParameter.Value         = nodeId;
            rootMapParameter.PersistSessionObject(ParametersDbConnection);

            MapTransaction createRootMapTransaction = new MapTransaction();

            createRootMapTransaction.SessionUid           = sessionId;
            createRootMapTransaction.TransactionTimestamp = DateTime.Now.ToUniversalTime();
            createRootMapTransaction.User                = User;
            createRootMapTransaction.OperationId         = TransactionType.CreateRootMap;
            createRootMapTransaction.DomainParameterUid  = domainParameter.Id;
            createRootMapTransaction.RootMapParameterUid = rootMapParameter.Id;
            createRootMapTransaction.NodeParameterUid    = rootMapParameter.Id;
            createRootMapTransaction.NodeTypeUid         = nodeType.Id;
            createRootMapTransaction.PersistSessionObject(SessionDbConnection);

            MapTransaction endTransaction = new MapTransaction();

            endTransaction.SessionUid           = sessionId;
            endTransaction.TransactionTimestamp = DateTime.Now.ToUniversalTime();
            endTransaction.User        = User;
            endTransaction.OperationId = TransactionType.CompleteSession;
            endTransaction.PersistSessionObject(SessionDbConnection);

            return(nodeId);
        }
コード例 #29
0
 public MapParameter DeleteBulkMetadata(GlymaSessionConfiguration configuration, Guid sessionId, Guid responseParameter, MapParameter domainId, MapParameter metadata)
 {
     using (IGlymaSession glymaSession = new SvcAppSPGlymaSession(configuration, sessionId))
     {
         return(Base.DeleteBulkMetadata(glymaSession, sessionId, responseParameter, domainId, metadata));
     }
 }
コード例 #30
0
 public MapParameter DeleteMetadata(GlymaSessionConfiguration configuration, Guid sessionId, MapParameter domainId, MapParameter metadata)
 {
     return(DeleteBulkMetadata(configuration, sessionId, Guid.Empty, domainId, metadata));
 }
コード例 #31
0
 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));
 }
コード例 #32
0
 public MapParameter UpdateBulkNode(GlymaSessionConfiguration configuration, Guid sessionId, Guid responseParameter, MapParameter domainId, MapParameter nodeId, NodeType nodeType)
 {
     using (IGlymaSession glymaSession = new SvcAppSPGlymaSession(configuration, sessionId))
     {
         return(Base.UpdateBulkNode(glymaSession, sessionId, responseParameter, domainId, nodeId, nodeType));
     }
 }
コード例 #33
0
 public MapParameter AddBulkNode(GlymaSessionConfiguration configuration, Guid sessionId, Guid responseParameter, MapParameter domainId, MapParameter rootMapId, NodeType nodeType, string originalId)
 {
     using (IGlymaSession glymaSession = new SvcAppSPGlymaSession(configuration, sessionId))
     {
         return Base.AddBulkNode(glymaSession, sessionId, responseParameter, domainId, rootMapId, nodeType, originalId);
     }
 }
コード例 #34
0
 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));
     }
 }
コード例 #35
0
 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);
     }
 }
コード例 #36
0
 public MapParameter AddBulkMetadata(GlymaSessionConfiguration configuration, Guid sessionId, Guid responseParameter, MapParameter domainId, MapParameter rootMapId, MapParameter node, MapParameter relationship, DescriptorType descriptorType, MetadataType metadataType, string name, string value)
 {
     using (IGlymaSession glymaSession = new SvcAppSPGlymaSession(configuration, sessionId))
     {
         return Base.AddBulkMetadata(glymaSession, sessionId, responseParameter, domainId, rootMapId, node, relationship, descriptorType, metadataType, name, value);
     }
 }
コード例 #37
0
 public MapParameter AddBulkMetadata(string callingUrl, Guid sessionId, Guid responseParameter, MapParameter domainId, MapParameter rootMapId, MapParameter node, MapParameter relationship, DescriptorType descriptorType, MetadataType metadataType, string name, string value)
 {
     using (GlymaNSApp.NodeServiceClient nodeServiceClient = new GlymaNSApp.NodeServiceClient(callingUrl))
     {
         return nodeServiceClient.AddBulkMetadata(callingUrl, sessionId, responseParameter, domainId, rootMapId, node, relationship, descriptorType, metadataType, name, value);
     }
 }
コード例 #38
0
 public MapParameter UpdateBulkMetadata(GlymaSessionConfiguration configuration, Guid sessionId, Guid responseParameter, MapParameter domainId, MapParameter metadata, string name, string value)
 {
     using (IGlymaSession glymaSession = new SvcAppSPGlymaSession(configuration, sessionId))
     {
         return(Base.UpdateBulkMetadata(glymaSession, sessionId, responseParameter, domainId, metadata, name, value));
     }
 }
コード例 #39
0
ファイル: DeleteRootMap.cs プロジェクト: chris-tomich/Glyma
        public int ExecuteDeletion(Guid domainId, Guid rootMapId)
        {
            //SqlCommand deleteMetadataByRootMap = new SqlCommand(DeleteRootMapMetadataSql, MapDbConnection.Connection);
            //deleteMetadataByRootMap.Parameters.Add(new SqlParameter("@DomainUid", domainId));
            //deleteMetadataByRootMap.Parameters.Add(new SqlParameter("@RootMapUid", rootMapId));

            //deleteMetadataByRootMap.ExecuteNonQuery();

            //SqlCommand deleteDescriptorsByRootMap = new SqlCommand(DeleteRootMapDescriptorsSql, MapDbConnection.Connection);
            //deleteDescriptorsByRootMap.Parameters.Add(new SqlParameter("@DomainUid", domainId));
            //deleteDescriptorsByRootMap.Parameters.Add(new SqlParameter("@RootMapUid", rootMapId));

            //deleteDescriptorsByRootMap.ExecuteNonQuery();

            //SqlCommand deleteRelationshipsByRootMap = new SqlCommand(DeleteRootMapRelationshipsSql, MapDbConnection.Connection);
            //deleteRelationshipsByRootMap.Parameters.Add(new SqlParameter("@DomainUid", domainId));
            //deleteRelationshipsByRootMap.Parameters.Add(new SqlParameter("@RootMapUid", rootMapId));

            //deleteRelationshipsByRootMap.ExecuteNonQuery();

            //SqlCommand deleteNodesByRootMap = new SqlCommand(DeleteRootMapNodesSql, MapDbConnection.Connection);
            //deleteNodesByRootMap.Parameters.Add(new SqlParameter("@DomainUid", domainId));
            //deleteNodesByRootMap.Parameters.Add(new SqlParameter("@RootMapUid", rootMapId));

            //deleteNodesByRootMap.ExecuteNonQuery();

            SqlCommand deleteByRootMap = new SqlCommand(DeleteRootMapSql, MapDbConnection.Connection);

            deleteByRootMap.Parameters.Add(new SqlParameter("@DomainUid", domainId));
            deleteByRootMap.Parameters.Add(new SqlParameter("@RootMapUid", rootMapId));

            int rowsDeleted = deleteByRootMap.ExecuteNonQuery();

            Guid sessionId = Guid.NewGuid();

            MapTransaction beginTransaction = new MapTransaction();

            beginTransaction.SessionUid           = sessionId;
            beginTransaction.TransactionTimestamp = DateTime.Now.ToUniversalTime();
            beginTransaction.User        = User;
            beginTransaction.OperationId = TransactionType.BeginSession;
            beginTransaction.PersistSessionObject(SessionDbConnection);

            MapParameter domainParameter = new MapParameter();

            domainParameter.SessionId     = sessionId;
            domainParameter.IsDelayed     = false;
            domainParameter.ParameterType = MapParameterType.Domain;
            domainParameter.Value         = domainId;
            domainParameter.PersistSessionObject(ParametersDbConnection);

            MapParameter rootMapParameter = new MapParameter();

            rootMapParameter.SessionId     = sessionId;
            rootMapParameter.IsDelayed     = false;
            rootMapParameter.ParameterType = MapParameterType.RootMap;
            rootMapParameter.Value         = rootMapId;
            rootMapParameter.PersistSessionObject(ParametersDbConnection);

            MapTransaction createRootMapTransaction = new MapTransaction();

            createRootMapTransaction.SessionUid           = sessionId;
            createRootMapTransaction.TransactionTimestamp = DateTime.Now.ToUniversalTime();
            createRootMapTransaction.User                = User;
            createRootMapTransaction.OperationId         = TransactionType.DeleteRootMap;
            createRootMapTransaction.DomainParameterUid  = domainParameter.Id;
            createRootMapTransaction.RootMapParameterUid = rootMapParameter.Id;
            createRootMapTransaction.NodeParameterUid    = rootMapParameter.Id;
            createRootMapTransaction.PersistSessionObject(SessionDbConnection);

            MapTransaction endTransaction = new MapTransaction();

            endTransaction.SessionUid           = sessionId;
            endTransaction.TransactionTimestamp = DateTime.Now.ToUniversalTime();
            endTransaction.User        = User;
            endTransaction.OperationId = TransactionType.CompleteSession;
            endTransaction.PersistSessionObject(SessionDbConnection);

            if (rowsDeleted > 0)
            {
                return(1);
            }
            else
            {
                return(0);
            }
        }
コード例 #40
0
 public MapParameter DeleteNode(string callingUrl, Guid sessionId, MapParameter domainId, MapParameter nodeId)
 {
     return DeleteBulkNode(callingUrl, sessionId, Guid.Empty, domainId, nodeId);
 }
コード例 #41
0
 public WebAppSPGlymaSession(string callingUrl, Guid sessionId, bool preload, bool isParameter, MapParameter domainParameter, MapParameter rootMapParameter, params IRight[] requiredRights)
     : this(callingUrl, sessionId, isParameter, domainParameter, rootMapParameter, requiredRights)
 {
     if (preload)
     {
         _session.LoadTransactions();
         _parameters.LoadParameters();
     }
 }
コード例 #42
0
 public MapParameter DeleteRelationship(string callingUrl, Guid sessionId, MapParameter domainId, MapParameter relationshipId)
 {
     return DeleteBulkRelationship(callingUrl, sessionId, Guid.Empty, domainId, relationshipId);
 }
コード例 #43
0
 public MapParameter AddNode(GlymaSessionConfiguration configuration, Guid sessionId, MapParameter domainId, MapParameter rootMapId, NodeType nodeType, string originalId)
 {
     return AddBulkNode(configuration, sessionId, Guid.Empty, domainId, rootMapId, nodeType, originalId);
 }
コード例 #44
0
 public MapParameter DeleteBulkRelationship(string callingUrl, Guid sessionId, Guid responseParameter, MapParameter domainId, MapParameter relationshipId)
 {
     using (GlymaNSApp.NodeServiceClient nodeServiceClient = new GlymaNSApp.NodeServiceClient(callingUrl))
     {
         return nodeServiceClient.DeleteBulkRelationship(callingUrl, sessionId, responseParameter, domainId, relationshipId);
     }
 }
コード例 #45
0
 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);
 }
コード例 #46
0
 public MapParameter DeleteMetadata(string callingUrl, Guid sessionId, MapParameter domainId, MapParameter metadata)
 {
     return DeleteBulkMetadata(callingUrl, sessionId, Guid.Empty, domainId, metadata);
 }
コード例 #47
0
 public MapParameter AddMetadata(GlymaSessionConfiguration configuration, Guid sessionId, MapParameter domainId, MapParameter rootMapId, MapParameter node, MapParameter relationship, DescriptorType descriptorType, MetadataType metadataType, string name, string value)
 {
     return AddBulkMetadata(configuration, sessionId, Guid.Empty, domainId, rootMapId, node, relationship, descriptorType, metadataType, name, value);
 }
コード例 #48
0
 public MapParameter UpdateNode(string callingUrl, Guid sessionId, MapParameter domainId, MapParameter nodeId, NodeType nodeType)
 {
     return UpdateBulkNode(callingUrl, sessionId, Guid.Empty, domainId, nodeId, nodeType);
 }
コード例 #49
0
 public MapParameter DeleteNode(GlymaSessionConfiguration configuration, Guid sessionId, MapParameter domainId, MapParameter nodeId)
 {
     return DeleteBulkNode(configuration, sessionId, Guid.Empty, domainId, nodeId);
 }
コード例 #50
0
 public MapParameter UpdateBulkNode(string callingUrl, Guid sessionId, Guid responseParameter, MapParameter domainId, MapParameter nodeId, NodeType nodeType)
 {
     using (GlymaNSApp.NodeServiceClient nodeServiceClient = new GlymaNSApp.NodeServiceClient(callingUrl))
     {
         return nodeServiceClient.UpdateBulkNode(callingUrl, sessionId, responseParameter, domainId, nodeId, nodeType);
     }
 }
コード例 #51
0
 public MapParameter DeleteBulkRelationship(GlymaSessionConfiguration configuration, Guid sessionId, Guid responseParameter, MapParameter domainId, MapParameter relationshipId)
 {
     using (IGlymaSession glymaSession = new SvcAppSPGlymaSession(configuration, sessionId))
     {
         return Base.DeleteBulkRelationship(glymaSession, sessionId, responseParameter, domainId, relationshipId);
     }
 }
コード例 #52
0
 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);
 }
コード例 #53
0
 public MapParameter DeleteBulkMetadata(GlymaSessionConfiguration configuration, Guid sessionId, Guid responseParameter, MapParameter domainId, MapParameter metadata)
 {
     using (IGlymaSession glymaSession = new SvcAppSPGlymaSession(configuration, sessionId))
     {
         return Base.DeleteBulkMetadata(glymaSession, sessionId, responseParameter, domainId, metadata);
     }
 }
コード例 #54
0
 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);
     }
 }
コード例 #55
0
 public MapParameter UpdateBulkNode(GlymaSessionConfiguration configuration, Guid sessionId, Guid responseParameter, MapParameter domainId, MapParameter nodeId, NodeType nodeType)
 {
     using (IGlymaSession glymaSession = new SvcAppSPGlymaSession(configuration, sessionId))
     {
         return Base.UpdateBulkNode(glymaSession, sessionId, responseParameter, domainId, nodeId, nodeType);
     }
 }
コード例 #56
0
 public MapParameter UpdateMetadata(string callingUrl, Guid sessionId,  MapParameter domainId, MapParameter metadata, string name, string value)
 {
     return UpdateBulkMetadata(callingUrl, sessionId, Guid.Empty, domainId, metadata, name, value);
 }
コード例 #57
0
 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);
     }
 }
コード例 #58
0
 public MapParameter UpdateBulkMetadata(string callingUrl, Guid sessionId, Guid responseParameter, MapParameter domainId, MapParameter metadata, string name, string value)
 {
     using (GlymaNSApp.NodeServiceClient nodeServiceClient = new GlymaNSApp.NodeServiceClient(callingUrl))
     {
         return nodeServiceClient.UpdateBulkMetadata(callingUrl, sessionId, responseParameter, domainId, metadata, name, value);
     }
 }
コード例 #59
0
 public MapParameter UpdateBulkMetadata(GlymaSessionConfiguration configuration, Guid sessionId, Guid responseParameter, MapParameter domainId, MapParameter metadata, string name, string value)
 {
     using (IGlymaSession glymaSession = new SvcAppSPGlymaSession(configuration, sessionId))
     {
         return Base.UpdateBulkMetadata(glymaSession, sessionId, responseParameter, domainId, metadata, name, value);
     }
 }
コード例 #60
0
 public MapParameter DeleteRelationship(GlymaSessionConfiguration configuration, Guid sessionId, MapParameter domainId, MapParameter relationshipId)
 {
     return(DeleteBulkRelationship(configuration, sessionId, Guid.Empty, domainId, relationshipId));
 }