Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            ExportApiHelperConfig config = new ExportApiHelperConfig()
            {
                RelativityUrl = new Uri("https://fest2018-current-sandbox.relativity.one"),
                WorkspaceId   = 1082531,
                Credentials   = new UsernamePasswordCredentials("*****@*****.**", "Password goes here"),
                QueryRequest  = new QueryRequest()
                {
                    Fields = new FieldRef[]
                    {
                        new FieldRef {
                            Name = "Control Number"
                        },
                        new FieldRef {
                            Name = "Extracted Text"
                        }
                    },
                    MaxCharactersForLongTextValues = 100 * 1024
                },
                BlockSize   = 1000,
                ScaleFactor = 4
            };

            ExportApiHelper helper = config.Create();

            helper.Run(new MyExportApihandler());
        }
Ejemplo n.º 2
0
        private void Run()
        {
            ExportApiHelperConfig config = new ExportApiHelperConfig()
            {
                BlockSize    = 1000,
                QueryRequest = new QueryRequest()
                {
                    Fields = new FieldRef[]
                    {
                        new FieldRef {
                            Name = "Control Number"
                        },
                        new FieldRef {
                            Name = "Extracted Text"
                        }
                    },
                    MaxCharactersForLongTextValues = 100 * 1024
                },
                WorkspaceId   = 1234567,
                RelativityUrl = new Uri("https://relativity.mycompany.com"),
                Credentials   = new UsernamePasswordCredentials("*****@*****.**", "Password goes here"),
                ScaleFactor   = 4
            };

            Relativity.ObjectManager.ExportApiHelper.ExportApiHelper helper = config.Create();

            Metrics metrics = new Metrics();

            metrics.Begin();

            CancellationTokenSource cts = new CancellationTokenSource();

            helper.Run(new ExportApiHandler(metrics), cts.Token);

            metrics.End();
            Console.WriteLine(metrics);
        }
Ejemplo n.º 3
0
        public static void Main(string[] args)
        {
            // read credentials and settings from app.config file
            var configReader = new AppSettingsReader();

            // the base URL should be stricly the instance name
            // --no "/Relativity" appended at the end
            string url      = configReader.GetValue("RelativityBaseURI", typeof(string)).ToString();
            string user     = configReader.GetValue("RelativityUserName", typeof(string)).ToString();
            string password = configReader.GetValue("RelativityPassword", typeof(string)).ToString();

            int    workspaceId      = 0;
            string workspaceIdAsStr = configReader.GetValue("WorkspaceId", typeof(string)).ToString();

            if (!String.IsNullOrEmpty(workspaceIdAsStr))
            {
                workspaceId = Int32.Parse(workspaceIdAsStr);
            }

            if (workspaceId == 0)
            {
                Console.WriteLine("Invalid workspace ID.");
                return;
            }

            var config = new ExportApiHelperConfig
            {
                BlockSize    = 1000,
                QueryRequest = new QueryRequest
                {
                    Fields = new FieldRef[]
                    {
                        new FieldRef {
                            Name = "Control Number"
                        },
                        new FieldRef {
                            Name = "Extracted Text"
                        }
                    },

                    // this is the cutoff value--anything greater
                    // than this many bytes will be streamed
                    MaxCharactersForLongTextValues = 1000 * 1024
                },

                WorkspaceId   = workspaceId,
                RelativityUrl = new Uri(url),
                Credentials   = new UsernamePasswordCredentials(user, password),
                ScaleFactor   = 8
            };

            ExportApiHelper exportHelper = config.Create();

            var cts = new System.Threading.CancellationTokenSource();

            // Extracted Text is the second field in the config.Fields collection
            int extractedTextIndex = 1;

            exportHelper.Run(new MyExportHandler(extractedTextIndex), cts.Token);

            Pause();
        }