Пример #1
0
        public static WcfRepositoryClient GetRepositoryClient()
        {
            var Url          = ConfigurationManager.AppSettings["URL"].ToString();
            var UserName     = ConfigurationManager.AppSettings["UserName"].ToString();
            var UserPassword = System.Configuration.ConfigurationManager.AppSettings["Password"].ToString();

            RepositoryConnectionInfo info = new RepositoryConnectionInfo()
            {
                // TODO Update the hostname as appropriate.
                // Url = "localhost",
                //Url = "https://clsr-clrdp2w01p.ad.ucl.ac.uk",
                //AuthenticationMethod = RepositoryAuthenticationMethod.Windows,
                //TransportMethod = RepositoryTransportMethod.NetTcp

                Url = Url,
                AuthenticationMethod = RepositoryAuthenticationMethod.UserName,
                UserName             = UserName,
                Password             = UserPassword,
                TransportMethod      = RepositoryTransportMethod.NetTcp
            };

            var client = new WcfRepositoryClient(info);

            //var client1 = new RepositoryClientBase(info);
            // var test = new Algenta.Colectica.Model.Ddi.Utility.MetadataUpdateBuilder();
            // test.UpdateProperty
            return(client);
        }
Пример #2
0
        public static WcfRepositoryClient GetClient()
        {
            var Url          = ConfigurationManager.AppSettings["URL"].ToString();
            var UserName     = ConfigurationManager.AppSettings["UserName"].ToString();
            var UserPassword = System.Configuration.ConfigurationManager.AppSettings["Password"].ToString();

            RepositoryConnectionInfo info = new RepositoryConnectionInfo()
            {
                // TODO Update the hostname as appropriate.
                // Url = "localhost",
                //Url = "https://clsr-clrdp2w01p.ad.ucl.ac.uk",
                //AuthenticationMethod = RepositoryAuthenticationMethod.Windows,
                //TransportMethod = RepositoryTransportMethod.NetTcp

                Url = Url,
                AuthenticationMethod = RepositoryAuthenticationMethod.UserName,
                UserName             = UserName,
                Password             = UserPassword,
                TransportMethod      = RepositoryTransportMethod.NetTcp
            };

            var client = new WcfRepositoryClient(info);

            return(client);
        }
        private static void TestUserIdSearch()
        {
            RepositoryConnectionInfo info = new RepositoryConnectionInfo();

            info.AuthenticationMethod = RepositoryAuthenticationMethod.Windows;
            info.Url             = "localhost:19893";
            info.TransportMethod = RepositoryTransportMethod.NetTcp;
            WcfRepositoryClient client = new WcfRepositoryClient(info);

            Category c = new Category()
            {
                AgencyId = "int.example"
            };

            c.ItemName.Current    = "Test Category";
            c.Label.Current       = "Test Category Label";
            c.Description.Current = "TestCategoryDesc";
            string userId = Guid.NewGuid().ToString();

            c.UserIds.Add(new UserId("sometype", userId));
            client.RegisterItem(c, new CommitOptions());

            var facet = new SearchFacet();

            facet.SearchTargets.Add(DdiStringType.UserId);
            //facet.SearchTerms.Add("TestCategoryDesc");
            facet.SearchTerms.Add(userId);

            var response = client.Search(facet);

            Console.WriteLine("Found " + response.Results.Count + " items");
        }
Пример #4
0
        public static WcfRepositoryClient GetClient()
        {
            RepositoryConnectionInfo info = new RepositoryConnectionInfo()
            {
                // TODO Update the hostname as appropriate.
                Url = "localhost",
                AuthenticationMethod = RepositoryAuthenticationMethod.Windows,
                TransportMethod = RepositoryTransportMethod.NetTcp
            };

            var client = new WcfRepositoryClient(info);
            return client;
        }
        // helpers
        public static WcfRepositoryClient GetRepositoryApiWindows()
        {
            var info = new RepositoryConnectionInfo()
            {
                AuthenticationMethod = RepositoryAuthenticationMethod.Windows,
                Url             = "localhost",
                TransportMethod = RepositoryTransportMethod.NetTcp,
            };

            var api = new WcfRepositoryClient(info);

            return(api);
        }
Пример #6
0
        public static RepositoryClientBase GetClient1()
        {
            // Get a client that can be used to interact with Colectica Repository.
            RepositoryConnectionInfo connectionInfo = new RepositoryConnectionInfo()
            {
                Url = "localhost",
                AuthenticationMethod = RepositoryAuthenticationMethod.Windows,
                TransportMethod      = RepositoryTransportMethod.NetTcp
            };

            WcfRepositoryClient client = new WcfRepositoryClient(connectionInfo);

            return(client);
        }
Пример #7
0
        public static WcfRepositoryClient GetClient()
        {
            RepositoryConnectionInfo info = new RepositoryConnectionInfo()
            {
                // TODO Update the hostname as appropriate.
                Url = "localhost",
                AuthenticationMethod = RepositoryAuthenticationMethod.Windows,
                TransportMethod      = RepositoryTransportMethod.NetTcp
            };

            var client = new WcfRepositoryClient(info);

            return(client);
        }
        public static WcfRepositoryClient GetRepositoryApiUsername()
        {
            var info = new RepositoryConnectionInfo()
            {
                AuthenticationMethod = RepositoryAuthenticationMethod.UserName,
                Url             = "localhost:19893",
                TransportMethod = RepositoryTransportMethod.NetTcp,
                UserName        = "******",
                Password        = "******"
            };

            var api = new WcfRepositoryClient(info);

            return(api);
        }
        public static RepositoryClientBase GetClient(string url = "localhost")
        {
            // The WcfRepositoryClient takes a configation object
            // detailing how to connect to the Repository.
            var connectionInfo = new RepositoryConnectionInfo()
            {
                Url = url,
                AuthenticationMethod = RepositoryAuthenticationMethod.Windows,
                TransportMethod      = RepositoryTransportMethod.NetTcp,
            };

            var repo = new WcfRepositoryClient(connectionInfo);

            return(repo);
        }
        /// <summary>
        /// Configures and returns a client object that can be used to communicate
        /// with Colectica Repository via its Web Services.
        /// </summary>
        public static RepositoryClientBase GetClient()
        {
            // The WcfRepositoryClient takes a configation object
            // detailing how to connect to the Repository.
            var connectionInfo = new RepositoryConnectionInfo()
            {
                // TODO Replace this with the hostname of your Colectica Repository
                Url = "localhost",
                AuthenticationMethod = RepositoryAuthenticationMethod.Windows,
                TransportMethod = RepositoryTransportMethod.NetTcp,
            };

            // Create the client object, passing in the connection information.
            var client = new WcfRepositoryClient(connectionInfo);
            return client;
        }
Пример #11
0
        public static RepositoryClientBase GetClient()
        {
            // The WcfRepositoryClient takes a configation object
            // detailing how to connect to the Repository.
            var connectionInfo = new RepositoryConnectionInfo()
            {
                // TODO Replace this with the hostname of your Colectica Repository
                Url = "localhost",
                AuthenticationMethod = RepositoryAuthenticationMethod.Windows,
                TransportMethod      = RepositoryTransportMethod.NetTcp,
            };

            // Create the client object, passing in the connection information.
            var client = new WcfRepositoryClient(connectionInfo);

            return(client);
        }
Пример #12
0
        public static Item GetDetail(string agency, Guid id, WcfRepositoryClient client)
        {
            MultilingualString.CurrentCulture = "en-GB";

            long             version   = client.GetLatestVersionNumber(id, agency);
            Item             newitem   = new Item();
            IdentifierTriple variable1 = new IdentifierTriple(id, version, agency);

            try
            {
                IVersionable item = client.GetLatestItem(id, agency);

                string itemtype = null;
                if (item is PhysicalInstance)
                {
                    newitem.QuestionValue = item.ItemType.ToString();
                }
                itemtype   = DataItem(item);
                newitem.Id = itemtype;
            }
            catch
            {
                IVersionable item = client.GetItem(id, agency, version - 1);

                string itemtype = null;
                if (item is PhysicalInstance)
                {
                    newitem.QuestionValue = item.ItemType.ToString();
                }
                itemtype   = DataItem(item);
                newitem.Id = itemtype;

                // newitem.Id = "Error";
            }
            return(newitem);
        }
Пример #13
0
 public MarkUpdatedReferencesDirtyVisitor(
     WcfRepositoryClient repositoryClient)
 {
     this.RepositoryClient = repositoryClient;
 }