public override kCura.EventHandler.Response Execute()
        {
            var response = new kCura.EventHandler.Response {
                Success = true, Message = String.Empty
            };
            var artifactQueries     = new ArtifactQueries();
            var servicesMgr         = Helper.GetServicesManager();
            var workspaceArtifactId = Helper.GetActiveCaseID();

            try
            {
                List <ExtractorRegullarExpression> regExList = PopulateRegExList();

                //Populates Regular Expressions
                foreach (var regEx in regExList)
                {
                    artifactQueries.CreateExtractorRegularExpressionRecord(servicesMgr, Relativity.API.ExecutionIdentity.System, workspaceArtifactId, regEx.Name, regEx.RegularExpression, regEx.Description);
                }
            }
            catch (Exception ex)
            {
                response.Success = false;
                response.Message = "Post-Install regular expression population failed with message: " + ex;
            }
            return(response);
        }
Ejemplo n.º 2
0
        public void CreateExtractorRegularExpressionRecordTest()
        {
            IntegrationSettings    testSettings        = new IntegrationSettings();
            IntegrationDBContext   testDBContext       = new IntegrationDBContext(testSettings.DBContextSettings);
            IntegrationServicesMgr testServiceManager  = new IntegrationServicesMgr(testSettings.RsapiSettings);
            SqlQueryHelper         testSqlQueryHelpers = new SqlQueryHelper();
            ArtifactQueries        artifactQueries     = new ArtifactQueries();

            Int32  workspaceArtifactId = 1016201;
            string regExName           = "RegEx created from Unit Test";
            string regEx       = @"[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?";
            string description = "Matches emails";

            artifactQueries.CreateExtractorRegularExpressionRecord(testServiceManager, ExecutionIdentity.CurrentUser, workspaceArtifactId, regExName, regEx, description);
        }