Inheritance: MapTypeElement
 public QueryResponse CreateRootMap(string callingUrl, Guid domainId, string name, NodeType nodeType, string originalId)
 {
     using (GlymaNSApp.NodeServiceClient nodeServiceClient = new GlymaNSApp.NodeServiceClient(callingUrl))
     {
         return nodeServiceClient.CreateRootMap(callingUrl, domainId, name, nodeType, originalId);
     }
 }
Example #2
0
        public QueryResponse CreateRootMap(GlymaSessionConfiguration configuration, Guid domainId, string name, NodeType nodeType, string originalId)
        {
            QueryResponse result = null;

            // run the call against the application proxy
            NodeServiceApplicationProxy.Invoke(_serviceContext,
                proxy => result = proxy.CreateRootMap(configuration, domainId, name, nodeType, originalId));

            return result;
        }
Example #3
0
        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 QueryResponse CreateRootMap(string callingUrl, Guid domainId, string name, NodeType nodeType, string originalId)
        {
            using (GlymaNSApp.NodeServiceClient nodeServiceClient = new GlymaNSApp.NodeServiceClient(callingUrl))
            {
                using (WebAppSPGlymaSession glymaSession = new WebAppSPGlymaSession(callingUrl, domainId, null, SPGlymaRightFactory.Instance.RootMapCreateRight))
                {
                    GlymaSessionConfiguration configuration = glymaSession.ExportGlymaSession();

                    return nodeServiceClient.CreateRootMap(configuration, domainId, name, nodeType, originalId);
                }
            }
        }
        public QueryResponse CreateRootMap(IGlymaSession glymaSession, Guid domainId, string name, NodeType nodeType, string originalId)
        {
            IDbConnectionAbstraction mapDbConnection = null;
            IDbConnectionAbstraction parametersDbConnection = null;
            IDbConnectionAbstraction sessionDbConnection = null;

            try
            {
                mapDbConnection = glymaSession.ConnectionFactory.CreateMapDbConnection();
                parametersDbConnection = glymaSession.ConnectionFactory.CreateParametersDbConnection();
                sessionDbConnection = glymaSession.ConnectionFactory.CreateSessionDbConnection();

                CreateRootMap createRootMapOperation = new CreateRootMap(mapDbConnection, parametersDbConnection, sessionDbConnection);

                mapDbConnection.Open();
                parametersDbConnection.Open();
                sessionDbConnection.Open();

                Guid nodeId = createRootMapOperation.Create(domainId, name, nodeType, originalId);

                sessionDbConnection.Close();
                parametersDbConnection.Close();
                mapDbConnection.Close();

                QueryResponse response = QueryMap(glymaSession, domainId, nodeId, 0, false, null, null, 0, false);

                return response;
            }
            finally
            {
                if (mapDbConnection != null)
                {
                    mapDbConnection.Dispose();
                }

                if (parametersDbConnection != null)
                {
                    parametersDbConnection.Dispose();
                }

                if (sessionDbConnection != null)
                {
                    sessionDbConnection.Dispose();
                }
            }
        }
 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);
     }
 }
 public MapParameter UpdateNode(string callingUrl, Guid sessionId, MapParameter domainId, MapParameter nodeId, NodeType nodeType)
 {
     return UpdateBulkNode(callingUrl, sessionId, Guid.Empty, domainId, nodeId, nodeType);
 }
 public MapParameter AddBulkNode(string callingUrl, Guid sessionId, Guid responseParameter, MapParameter domainId, MapParameter rootMapId, NodeType nodeType, string originalId)
 {
     using (GlymaNSApp.NodeServiceClient nodeServiceClient = new GlymaNSApp.NodeServiceClient(callingUrl))
     {
         return nodeServiceClient.AddBulkNode(callingUrl, sessionId, responseParameter, domainId, rootMapId, nodeType, originalId);
     }
 }
 public MapParameter AddNode(string callingUrl, Guid sessionId, MapParameter domainId, MapParameter rootMapId, NodeType nodeType, string originalId)
 {
     return AddBulkNode(callingUrl, sessionId, Guid.Empty, domainId, rootMapId, nodeType, originalId);
 }
        public MapParameter UpdateBulkNode(string callingUrl, Guid sessionId, Guid responseParameter, MapParameter domainId, MapParameter nodeId, NodeType nodeType)
        {
            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.UpdateBulkNode(configuration, sessionId, responseParameter, domainId, nodeId, nodeType);
                }
            }
        }
 public MapParameter UpdateNode(GlymaSessionConfiguration configuration, Guid sessionId, MapParameter domainId, MapParameter nodeId, NodeType nodeType)
 {
     return UpdateBulkNode(configuration, sessionId, Guid.Empty, domainId, nodeId, nodeType);
 }
 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);
 }
 private MapParameter AddNode(IGlymaSession glymaSession, Guid sessionId, MapParameter domainId, MapParameter rootMapId, NodeType nodeType, string originalId)
 {
     return AddBulkNode(glymaSession, sessionId, Guid.Empty, domainId, rootMapId, nodeType, originalId);
 }
Example #14
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;
        }
Example #15
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;
        }
        public MapParameter AddBulkNode(IGlymaSession glymaSession, Guid sessionId, Guid responseParameter, MapParameter domainId, MapParameter rootMapId, NodeType nodeType, string originalId)
        {
            MapSession session = glymaSession.Session;
            MapParameters parameters = glymaSession.Parameters;
            parameters.AddParameter(domainId);
            parameters.AddParameter(rootMapId);

            MapTransactionWrapper createNodeOpWrapper = new MapTransactionWrapper(glymaSession);
            IMapTransaction createNodeOpCore = (IMapTransaction)createNodeOpWrapper;
            createNodeOpCore.OperationId = TransactionType.CreateNode;
            createNodeOpWrapper.DomainParameter = domainId;
            createNodeOpWrapper.RootMapParameter = rootMapId;
            createNodeOpCore.NodeTypeUid = nodeType.Id;

            session.Enqueue(createNodeOpWrapper);

            MapParameter response;

            if (responseParameter == Guid.Empty)
            {
                response = createNodeOpWrapper.ResponseParameter;
            }
            else
            {
                response = createNodeOpWrapper.BuildResponseParameterFromGuid(responseParameter);
            }

            glymaSession.PersistSessionObject();

            return response;
        }
 public QueryResponse CreateRootMap(GlymaSessionConfiguration configuration, Guid domainId, string name, NodeType nodeType, string originalId)
 {
     using (IGlymaSession glymaSession = new SvcAppSPGlymaSession(configuration))
     {
         return Base.CreateRootMap(glymaSession, domainId, name, nodeType, originalId);
     }
 }
        public MapParameter UpdateBulkNode(IGlymaSession glymaSession, Guid sessionId, Guid responseParameter, MapParameter domainId, MapParameter nodeId, NodeType nodeType)
        {
            MapSession session = glymaSession.Session;
            MapParameters parameters = glymaSession.Parameters;

            parameters.AddParameter(domainId);
            parameters.AddParameter(nodeId);

            MapTransactionWrapper updateNodeOpWrapper = new MapTransactionWrapper(glymaSession);
            IMapTransaction updateNodeOpCore = (IMapTransaction)updateNodeOpWrapper;
            updateNodeOpCore.OperationId = TransactionType.UpdateNode;
            updateNodeOpWrapper.DomainParameter = domainId;
            updateNodeOpWrapper.NodeParameter = nodeId;
            updateNodeOpCore.NodeTypeUid = nodeType.Id;

            session.Enqueue(updateNodeOpWrapper);

            MapParameter response;

            if (responseParameter == Guid.Empty)
            {
                response = updateNodeOpWrapper.ResponseParameter;
            }
            else
            {
                response = updateNodeOpWrapper.BuildResponseParameterFromGuid(responseParameter);
            }

            glymaSession.PersistSessionObject();

            return response;
        }
 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);
     }
 }
Example #20
0
        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;
        }
 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);
     }
 }
        public MapParameter AddBulkNode(string callingUrl, Guid sessionId, Guid responseParameter, MapParameter domainId, MapParameter rootMapId, NodeType nodeType, string originalId)
        {
            using (GlymaNSApp.NodeServiceClient nodeServiceClient = new GlymaNSApp.NodeServiceClient(callingUrl))
            {
                using (WebAppSPGlymaSession glymaSession = new WebAppSPGlymaSession(callingUrl, true, domainId, rootMapId, SPGlymaRightFactory.Instance.MapCreateRight))
                {
                    GlymaSessionConfiguration configuration = glymaSession.ExportGlymaSession();

                    return nodeServiceClient.AddBulkNode(configuration, sessionId, responseParameter, domainId, rootMapId, nodeType, originalId);
                }
            }
        }