Inheritance: MapTypeElement
Esempio n. 1
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 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);
     }
 }
 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);
 }
 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);
     }
 }
 public MapParameter AddMetadata(string callingUrl, Guid sessionId, MapParameter domainId, MapParameter rootMapId, MapParameter node, MapParameter relationship, DescriptorType descriptorType, MetadataType metadataType, string name, string value)
 {
     return AddBulkMetadata(callingUrl, 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;
        }
Esempio n. 7
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;
        }
        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))
            {
                using (WebAppSPGlymaSession glymaSession = new WebAppSPGlymaSession(callingUrl, true, domainId, rootMapId, SPGlymaRightFactory.Instance.MapCreateRight))
                {
                    GlymaSessionConfiguration configuration = glymaSession.ExportGlymaSession();

                    return nodeServiceClient.AddBulkMetadata(configuration, sessionId, responseParameter, domainId, rootMapId, node, relationship, descriptorType, metadataType, name, value);
                }
            }
        }