Inheritance: IPersistableSessionObject
Beispiel #1
0
        public void LoadParameters()
        {
            SqlParameter sqlSessionParameter = new SqlParameter("@SessionId", GlymaSession.Session.Id);

            using (IDbConnectionAbstraction parametersDbConnection = GlymaSession.ConnectionFactory.CreateParametersDbConnection())
            {
                SqlCommand selectParametersFromId = new SqlCommand(SelectParametersFromSessionId, parametersDbConnection.Connection);
                selectParametersFromId.Parameters.Add(sqlSessionParameter);

                parametersDbConnection.Open();

                IDataReader parameters = selectParametersFromId.ExecuteReader();

                while (parameters.Read())
                {
                    MapParameter parameter = new MapParameter();

                    parameter.LoadSessionObject(parameters);

                    AddParameter(parameter);
                }

                parametersDbConnection.Close();
            }
        }
        public MapResponse CreateDomain(IGlymaSession glymaSession, string name)
        {
            using (IDbConnectionAbstraction mapDbConnection = glymaSession.ConnectionFactory.CreateMapDbConnection())
            {
                Domain newDomain = new Domain(true);
                newDomain.DomainUid        = Guid.NewGuid();
                newDomain.DomainOriginalId = null;

                TypeResponse types = GetAllMapTypes(glymaSession);

                NodeType     domainNodeType     = types.NodeTypes["DomainNode"];
                MetadataType stringMetadataType = types.MetadataTypes["string"];

                newDomain.PersistSessionObject(mapDbConnection);

                Guid sessionId = BeginTransaction(glymaSession);

                MapParameter domainIdParameter = new MapParameter();
                domainIdParameter.Id            = Guid.NewGuid();
                domainIdParameter.IsDelayed     = false;
                domainIdParameter.ParameterType = MapParameterType.Domain;
                domainIdParameter.SessionId     = sessionId;
                domainIdParameter.Value         = newDomain.DomainUid;

                MapParameter newNode = AddNode(glymaSession, sessionId, domainIdParameter, null, domainNodeType, string.Empty);
                AddMetadata(glymaSession, sessionId, domainIdParameter, null, newNode, null, null, stringMetadataType, "Name", name);

                MapResponse newDomainNodeResponse = CompleteTransaction(glymaSession, sessionId);

                return(newDomainNodeResponse);
            }
        }
Beispiel #3
0
 public void AddParameter(MapParameter parameter)
 {
     if (parameter != null)
     {
         ParameterContainer[parameter.Id] = parameter;
     }
 }
        public MapResponse CreateDomain(IGlymaSession glymaSession, string name)
        {
            using (IDbConnectionAbstraction mapDbConnection = glymaSession.ConnectionFactory.CreateMapDbConnection())
            {
                Domain newDomain = new Domain(true);
                newDomain.DomainUid = Guid.NewGuid();
                newDomain.DomainOriginalId = null;

                TypeResponse types = GetAllMapTypes(glymaSession);

                NodeType domainNodeType = types.NodeTypes["DomainNode"];
                MetadataType stringMetadataType = types.MetadataTypes["string"];

                newDomain.PersistSessionObject(mapDbConnection);

                Guid sessionId = BeginTransaction(glymaSession);

                MapParameter domainIdParameter = new MapParameter();
                domainIdParameter.Id = Guid.NewGuid();
                domainIdParameter.IsDelayed = false;
                domainIdParameter.ParameterType = MapParameterType.Domain;
                domainIdParameter.SessionId = sessionId;
                domainIdParameter.Value = newDomain.DomainUid;

                MapParameter newNode = AddNode(glymaSession, sessionId, domainIdParameter, null, domainNodeType, string.Empty);
                AddMetadata(glymaSession, sessionId, domainIdParameter, null, newNode, null, null, stringMetadataType, "Name", name);

                MapResponse newDomainNodeResponse = CompleteTransaction(glymaSession, sessionId);

                return newDomainNodeResponse;
            }
        }
Beispiel #5
0
        internal MapParameter BuildResponseParameterFromGuid(Guid responseParameter)
        {
            _responseParameter        = GlymaSession.Parameters.AddParameter(responseParameter, ResponseParameterType, Guid.Empty, true);
            Core.ResponseParameterUid = _responseParameter.Id;

            return(_responseParameter);
        }
        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);
        }
Beispiel #7
0
        public MapParameter AddParameter(Guid parameterId, MapParameterType parameterType, Guid parameterValue, bool isDelayed)
        {
            MapParameter newParameter = new MapParameter(parameterId);

            newParameter.Value         = parameterValue;
            newParameter.SessionId     = GlymaSession.Session.Id;
            newParameter.IsDelayed     = isDelayed;
            newParameter.ParameterType = parameterType;

            AddParameter(newParameter);

            return(newParameter);
        }
        public WebAppSPGlymaSession(string callingUrl, Guid sessionId, bool isParameter, MapParameter domainParameter, MapParameter rootMapParameter, params IRight[] requiredRights)
        {
            _callingUrl = callingUrl;
            _sessionId = sessionId;

            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, _sessionId);

            _parameters = new MapParameters(this);
        }
Beispiel #9
0
        public MapParameter this[Guid parameterId]
        {
            get
            {
                if (ParameterContainer.ContainsKey(parameterId))
                {
                    return(ParameterContainer[parameterId]);
                }
                else
                {
                    SqlParameter parameterIdSqlParameter = new SqlParameter("@ParameterId", parameterId);

                    using (IDbConnectionAbstraction parametersDbConnection = GlymaSession.ConnectionFactory.CreateParametersDbConnection())
                    {
                        SqlCommand getParameter = new SqlCommand("SELECT * FROM [Parameters] WHERE [ParameterUid] = @ParameterId;", parametersDbConnection.Connection);
                        getParameter.Parameters.Add(parameterIdSqlParameter);

                        parametersDbConnection.Open();

                        IDataReader parameters = getParameter.ExecuteReader();

                        MapParameter parameter = null;

                        while (parameters.Read())
                        {
                            parameter = new MapParameter();

                            parameter.LoadSessionObject(parameters);

                            AddParameter(parameter);
                        }

                        parametersDbConnection.Close();

                        return(parameter);
                    }
                }
            }
        }
Beispiel #10
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;
        }
Beispiel #11
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;
        }
        public MapParameter DeleteBulkMetadata(IGlymaSession glymaSession, Guid sessionId, Guid responseParameter, MapParameter domainId, MapParameter metadata)
        {
            MapSession    session    = glymaSession.Session;
            MapParameters parameters = glymaSession.Parameters;

            parameters.AddParameter(domainId);
            parameters.AddParameter(metadata);

            MapTransactionWrapper deleteMetadataOpWrapper = new MapTransactionWrapper(glymaSession);
            IMapTransaction       deleteMetadataOpCore    = (IMapTransaction)deleteMetadataOpWrapper;

            deleteMetadataOpCore.OperationId          = TransactionType.DeleteMetadata;
            deleteMetadataOpWrapper.DomainParameter   = domainId;
            deleteMetadataOpWrapper.MetadataParameter = metadata;

            session.Enqueue(deleteMetadataOpWrapper);

            MapParameter response;

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

            glymaSession.PersistSessionObject();

            return(response);
        }
Beispiel #13
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;
        }
 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);
 }
        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 AddBulkMetadata(IGlymaSession glymaSession, Guid sessionId, Guid responseParameter, MapParameter domainId, MapParameter rootMapId, MapParameter node, MapParameter relationship, DescriptorType descriptorType, MetadataType metadataType, string name, string value)
        {
            MapSession session = glymaSession.Session;
            MapParameters parameters = glymaSession.Parameters;

            parameters.AddParameter(domainId);
            parameters.AddParameter(rootMapId);
            parameters.AddParameter(node);
            parameters.AddParameter(relationship);

            MapTransactionWrapper createMetadataOpWrapper = new MapTransactionWrapper(glymaSession);
            IMapTransaction createMetadataOpCore = (IMapTransaction)createMetadataOpWrapper;
            createMetadataOpCore.OperationId = TransactionType.CreateMetadata;
            createMetadataOpWrapper.DomainParameter = domainId;
            createMetadataOpWrapper.RootMapParameter = rootMapId;
            createMetadataOpWrapper.NodeParameter = node;
            createMetadataOpWrapper.RelationshipParameter = relationship;

            if (descriptorType == null)
            {
                createMetadataOpCore.DescriptorTypeUid = null;
            }
            else
            {
                createMetadataOpCore.DescriptorTypeUid = descriptorType.Id;
            }

            if (metadataType == null)
            {
                createMetadataOpCore.MetadataTypeUid = null;
            }
            else
            {
                createMetadataOpCore.MetadataTypeUid = metadataType.Id;
            }

            createMetadataOpCore.MetadataName = name;
            createMetadataOpCore.MetadataValue = value;

            session.Enqueue(createMetadataOpWrapper);

            MapParameter response;

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

            glymaSession.PersistSessionObject();

            return response;
        }
 public MapParameter RelationshipCreate(Guid token, MapParameter delayedDomain, Guid FromToRelationshipTypeId, IDictionary <Guid, MapParameter> nodes)
 {
     throw new NotImplementedException();
 }
        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);
        }
 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));
 }
        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);
        }
 private MapParameter AddMetadata(IGlymaSession glymaSession, Guid sessionId, MapParameter domainId, MapParameter rootMapId, MapParameter node, MapParameter relationship, DescriptorType descriptorType, MetadataType metadataType, string name, string value)
 {
     return(AddBulkMetadata(glymaSession, sessionId, Guid.Empty, domainId, rootMapId, node, relationship, descriptorType, metadataType, name, value));
 }
        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);
        }
Beispiel #23
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;
        }
        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 NodeCreate(Guid token, MapParameter delayedDomain, Guid CompendiumQuestionNodeTypeId)
 {
     throw new NotImplementedException();
 }
        public MapParameter UpdateBulkMetadata(IGlymaSession glymaSession, Guid sessionId, Guid responseParameter, MapParameter domainId, MapParameter metadata, string name, string value)
        {
            MapSession session = glymaSession.Session;
            MapParameters parameters = glymaSession.Parameters;

            parameters.AddParameter(domainId);
            parameters.AddParameter(metadata);

            MapTransactionWrapper updateMetadataOpWrapper = new MapTransactionWrapper(glymaSession);
            IMapTransaction updateMetadataOpCore = (IMapTransaction)updateMetadataOpWrapper;
            updateMetadataOpCore.OperationId = TransactionType.UpdateMetadata;
            updateMetadataOpWrapper.DomainParameter = domainId;
            updateMetadataOpWrapper.MetadataParameter = metadata;
            updateMetadataOpCore.MetadataName = name;
            updateMetadataOpCore.MetadataValue = value;

            session.Enqueue(updateMetadataOpWrapper);

            MapParameter response;

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

            glymaSession.PersistSessionObject();

            return response;
        }
        public MapParameter UpdateBulkMetadata(IGlymaSession glymaSession, Guid sessionId, Guid responseParameter, MapParameter domainId, MapParameter metadata, string name, string value)
        {
            MapSession    session    = glymaSession.Session;
            MapParameters parameters = glymaSession.Parameters;

            parameters.AddParameter(domainId);
            parameters.AddParameter(metadata);

            MapTransactionWrapper updateMetadataOpWrapper = new MapTransactionWrapper(glymaSession);
            IMapTransaction       updateMetadataOpCore    = (IMapTransaction)updateMetadataOpWrapper;

            updateMetadataOpCore.OperationId          = TransactionType.UpdateMetadata;
            updateMetadataOpWrapper.DomainParameter   = domainId;
            updateMetadataOpWrapper.MetadataParameter = metadata;
            updateMetadataOpCore.MetadataName         = name;
            updateMetadataOpCore.MetadataValue        = value;

            session.Enqueue(updateMetadataOpWrapper);

            MapParameter response;

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

            glymaSession.PersistSessionObject();

            return(response);
        }
 public MapParameter NodeCreate(Guid token, MapParameter delayedDomain, Guid CompendiumQuestionNodeTypeId)
 {
     throw new NotImplementedException();
 }
        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 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();
     }
 }
 private MapParameter AddMetadata(IGlymaSession glymaSession, Guid sessionId, MapParameter domainId, MapParameter rootMapId, MapParameter node, MapParameter relationship, DescriptorType descriptorType, MetadataType metadataType, string name, string value)
 {
     return AddBulkMetadata(glymaSession, sessionId, Guid.Empty, domainId, rootMapId, node, relationship, descriptorType, metadataType, name, value);
 }
        public MapParameter AddBulkMetadata(IGlymaSession glymaSession, Guid sessionId, Guid responseParameter, MapParameter domainId, MapParameter rootMapId, MapParameter node, MapParameter relationship, DescriptorType descriptorType, MetadataType metadataType, string name, string value)
        {
            MapSession    session    = glymaSession.Session;
            MapParameters parameters = glymaSession.Parameters;

            parameters.AddParameter(domainId);
            parameters.AddParameter(rootMapId);
            parameters.AddParameter(node);
            parameters.AddParameter(relationship);

            MapTransactionWrapper createMetadataOpWrapper = new MapTransactionWrapper(glymaSession);
            IMapTransaction       createMetadataOpCore    = (IMapTransaction)createMetadataOpWrapper;

            createMetadataOpCore.OperationId              = TransactionType.CreateMetadata;
            createMetadataOpWrapper.DomainParameter       = domainId;
            createMetadataOpWrapper.RootMapParameter      = rootMapId;
            createMetadataOpWrapper.NodeParameter         = node;
            createMetadataOpWrapper.RelationshipParameter = relationship;

            if (descriptorType == null)
            {
                createMetadataOpCore.DescriptorTypeUid = null;
            }
            else
            {
                createMetadataOpCore.DescriptorTypeUid = descriptorType.Id;
            }

            if (metadataType == null)
            {
                createMetadataOpCore.MetadataTypeUid = null;
            }
            else
            {
                createMetadataOpCore.MetadataTypeUid = metadataType.Id;
            }

            createMetadataOpCore.MetadataName  = name;
            createMetadataOpCore.MetadataValue = value;

            session.Enqueue(createMetadataOpWrapper);

            MapParameter response;

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

            glymaSession.PersistSessionObject();

            return(response);
        }
        public MapParameter DeleteBulkMetadata(IGlymaSession glymaSession, Guid sessionId, Guid responseParameter, MapParameter domainId, MapParameter metadata)
        {
            MapSession session = glymaSession.Session;
            MapParameters parameters = glymaSession.Parameters;

            parameters.AddParameter(domainId);
            parameters.AddParameter(metadata);

            MapTransactionWrapper deleteMetadataOpWrapper = new MapTransactionWrapper(glymaSession);
            IMapTransaction deleteMetadataOpCore = (IMapTransaction)deleteMetadataOpWrapper;
            deleteMetadataOpCore.OperationId = TransactionType.DeleteMetadata;
            deleteMetadataOpWrapper.DomainParameter = domainId;
            deleteMetadataOpWrapper.MetadataParameter = metadata;

            session.Enqueue(deleteMetadataOpWrapper);

            MapParameter response;

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

            glymaSession.PersistSessionObject();

            return response;
        }
Beispiel #34
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 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;
        }
Beispiel #36
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;
        }
        internal MapParameter BuildResponseParameterFromGuid(Guid responseParameter)
        {
            _responseParameter = GlymaSession.Parameters.AddParameter(responseParameter, ResponseParameterType, Guid.Empty, true);
            Core.ResponseParameterUid = _responseParameter.Id;

            return _responseParameter;
        }
Beispiel #38
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;
        }
 public MapParameter RelationshipCreate(Guid token, MapParameter delayedDomain, Guid FromToRelationshipTypeId, IDictionary<Guid, MapParameter> nodes)
 {
     throw new NotImplementedException();
 }
Beispiel #40
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;
        }