Beispiel #1
0
        public override Response PopulateScriptBlocks()
        {
            //Create a response object with default values
            kCura.EventHandler.Response retVal = new kCura.EventHandler.Response();
            retVal.Success = true;
            retVal.Message = String.Empty;

            /*
             *
             * //Let's get the url to our custom pages so we can pull in script/css pages from there
             * String applicationPath = getApplicationPath(this.Application.ApplicationUrl);
             *
             * // Before the elements are loaded on a page, register the JavaScript file.
             * // You can load a JavaScript file into Relativity via a custom page.
             * this.RegisterLinkedClientScript(applicationPath + "javascript/myjavascriptfunctions.js");
             *
             * // You can also register functions directly.
             * String alertFunction = "<script type=\"text/javascript\"> function alertWithText(text){alert(text);}</script>";
             * this.RegisterClientScriptBlock(new kCura.EventHandler.ScriptBlock() { Key = "alertFunc", Script = alertFunction });
             *
             * // After the elements are loaded on the page, register the JavaScript.
             * this.RegisterLinkedStartupScript(applicationPath + "functionCall.js");
             *
             * // You can also call functions directly
             * String alert = "<script type=\"text/javascript\"> alertWithText('Successfully called a function registered earlier!');</script>";
             * this.RegisterStartupScriptBlock(new kCura.EventHandler.ScriptBlock() { Key = "alertKey", Script = alert });
             *
             * // Your custom page can include a .css file for loading into a page.
             * this.RegisterLinkedCss(applicationPath + "styles/loadedCSS.css");
             *
             */
            return(retVal);
        }
        public override Response PreMassOperation()
        {
            ConsoleEventHandlerComment console = new ConsoleEventHandlerComment();

            kCura.EventHandler.Response retVal = new kCura.EventHandler.Response();
            retVal.Success = true;
            retVal.Message = "Successful Pre Execute Operation method";
            IDBContext dbContext = this.Helper.GetDBContext(this.Helper.GetActiveCaseID());
            string     sqlText   = $" SELECT * FROM [Comment] WHERE ArtifactID IN (SELECT ARTIFACTID from[RESOURCE].[{ this.MassActionTableName}]) ";

            System.Data.DataRowCollection results = dbContext.ExecuteSqlStatementAsDataTable(sqlText).Rows;
            foreach (System.Data.DataRow row in results)
            {
                DTOs.RDO comme = new DTOs.RDO((int)row.ItemArray[0]);
                comme.ArtifactTypeGuids.Add(new Guid(ARTIFACT_TYPE));

                comme.Fields.Add(new DTOs.FieldValue(new Guid(COMMENT_FIELD_GUID.ToString()), row.ItemArray[1]));
                console.insertJob(dbContext, this.Helper.GetAuthenticationManager().UserInfo.FullName, comme);


                DTOs.Choice choice = new DTOs.Choice(ERROR_TYPE_FIELD_GUID);
                comme.Fields.Add(new DTOs.FieldValue(TYPE_FIELD_GUID, choice));

                using (kCura.Relativity.Client.IRSAPIClient client =
                           this.Helper.GetServicesManager().CreateProxy <kCura.Relativity.Client.IRSAPIClient>(Relativity.API.ExecutionIdentity.System))
                {
                    client.APIOptions.WorkspaceID = this.Helper.GetActiveCaseID();
                    client.Repositories.RDO.UpdateSingle(comme);
                }
            }
            return(retVal);
        }
Beispiel #3
0
        public override Response PopulateScriptBlocks()
        {
            //Create a response object with default values
            kCura.EventHandler.Response retVal = new kCura.EventHandler.Response();
            retVal.Success = true;
            retVal.Message = String.Empty;
            //var client = Relativity.API.Services.Helper.GetServicesManager().CreateProxy<kCura.Relativity.Client.IRSAPIClient>(Relativity.API.ExecutionIdentity.System);
            IRSAPIClient client = Helper.GetServicesManager().CreateProxy <IRSAPIClient>(ExecutionIdentity.System);

            client.APIOptions.WorkspaceID = Helper.GetActiveCaseID();

            // var javaScriptHelper = new JavaScriptPI();

            var JavaScripts = JavaScriptPI.Helpers.JavaScripts.GetAll(client);

            int    counter         = 0;
            string scriptBlockName = "";
            bool   addBlockType    = false;

            foreach (var js in JavaScripts)
            {
                if (js.ViewMode == JavaScriptBlock.ViewModeValue.ViewOnly && this.PageMode == kCura.EventHandler.Helper.PageMode.Edit)
                {
                    addBlockType = false;
                }
                else if (js.ViewMode == JavaScriptBlock.ViewModeValue.EditOnly && this.PageMode == kCura.EventHandler.Helper.PageMode.View)
                {
                    addBlockType = false;
                }
                else
                {
                    addBlockType = true;
                }

                if (addBlockType == true)
                {
                    scriptBlockName = "ScriptBlockName" + counter.ToString();
                    counter++;
                    this.RegisterStartupScriptBlock(new kCura.EventHandler.ScriptBlock()
                    {
                        Key = scriptBlockName, Script = js.Text
                    });
                }
                //this.RegisterClientScriptBlock(new kCura.EventHandler.ScriptBlock() { Key = "alertFunc", Script = alertFunction });
            }

            //if (this.PageMode == kCura.EventHandler.Helper.PageMode.Edit)
            //{
            //    this.RegisterStartupScriptBlock(new kCura.EventHandler.ScriptBlock() { Key = "registerEventsScript", Script = registerEventsScript });
            //}

            return(retVal);
        }
        public override kCura.EventHandler.Response Execute()
        {
            //Construct a response object with default values.
            kCura.EventHandler.Response retVal = new kCura.EventHandler.Response();
            retVal.Success = true;
            retVal.Message = String.Empty;
            try
            {
                /*
                 *
                 * Int32 currentWorkspaceArtifactID = this.Helper.GetActiveCaseID();
                 * //Setting up an RSAPI Client
                 * using (IRSAPIClient proxy =
                 *      Helper.GetServicesManager().CreateProxy<IRSAPIClient>(ExecutionIdentity.System))
                 * {
                 *      //Set the proxy to use the current workspace
                 *      proxy.APIOptions.WorkspaceID = currentWorkspaceArtifactID;
                 *      //Add code for working with RSAPIClient
                 * }
                 *
                 *
                 * Relativity.API.IDBContext workspaceContext = this.Helper.GetDBContext(currentWorkspaceArtifactID);
                 *
                 * //Get a dbContext for the EDDS database
                 * Relativity.API.IDBContext eddsDBContext = this.Helper.GetDBContext(-1);
                 *
                 *
                 * //Use version properties to alter your workflow
                 * if (this.CurrentVersion != null && this.CurrentVersion < new System.Version("2.0.0.0")
                 * {
                 *
                 * }
                 *
                 * //Dirty flag indicates that the application has been unlocked since the previous install, thus the validity of the application can't be determined
                 * if (this.Dirty == true)
                 * {
                 *
                 * }
                 *
                 */
            }
            catch (System.Exception ex)
            {
                //Change the response Success property to false to let the user know an error occurred
                retVal.Success = false;
                retVal.Message = ex.ToString();
            }

            return(retVal);
        }
Beispiel #5
0
        public override Response Execute()
        {
            //Construct a response object with default values.
            kCura.EventHandler.Response retVal = new kCura.EventHandler.Response();
            retVal.Success = true;
            retVal.Message = string.Empty;
            try
            {
                Int32 currentWorkspaceArtifactID = Helper.GetActiveCaseID();

                //The Object Manager is the newest and preferred way to interact with Relativity instead of the Relativity Services API(RSAPI).
                //The RSAPI will be scheduled for depreciation after the Object Manager reaches feature party with it.
                using (IObjectManager objectManager = this.Helper.GetServicesManager().CreateProxy <IObjectManager>(ExecutionIdentity.System))
                {
                    retVal.Success = false;
                    retVal.Message = "FirstTime";
                }

                //Setting up an RSAPI Client
                using (IRSAPIClient proxy =
                           Helper.GetServicesManager().CreateProxy <IRSAPIClient>(ExecutionIdentity.System))
                {
                    //Set the proxy to use the current workspace
                    proxy.APIOptions.WorkspaceID = currentWorkspaceArtifactID;
                    //Add code for working with RSAPIClient
                }

                Relativity.API.IDBContext workspaceContext = Helper.GetDBContext(currentWorkspaceArtifactID);

                //Get a dbContext for the EDDS database
                Relativity.API.IDBContext eddsDBContext = Helper.GetDBContext(-1);

                IAPILog logger = Helper.GetLoggerFactory().GetLogger();
                logger.LogVerbose("Log information throughout execution.");
            }
            catch (Exception ex)
            {
                //Change the response Success property to false to let the user know an error occurred
                retVal.Success = false;
                retVal.Message = ex.ToString();
            }

            return(retVal);
        }
        public override kCura.EventHandler.Response Execute()
        {
            //Construct a response object with default values.
            kCura.EventHandler.Response retVal = new kCura.EventHandler.Response();
            retVal.Success = true;
            retVal.Message = String.Empty;
            try
            {
                /*
                 *
                 * Int32 currentWorkspaceArtifactID = this.Helper.GetActiveCaseID();
                 * //Setting up an RSAPI Client
                 * using (IRSAPIClient proxy =
                 *      Helper.GetServicesManager().CreateProxy<IRSAPIClient>(ExecutionIdentity.System))
                 * {
                 * //Set the proxy to use the current workspace
                 * proxy.APIOptions.WorkspaceID = currentWorkspaceArtifactID;
                 * //Add code for working with RSAPIClient
                 * }
                 *
                 *
                 * Relativity.API.IDBContext workspaceContext = this.Helper.GetDBContext(currentWorkspaceArtifactID);
                 *
                 * //Get a dbContext for the EDDS database
                 * Relativity.API.IDBContext eddsDBContext = this.Helper.GetDBContext(-1);
                 *
                 */
            }
            catch (System.Exception ex)
            {
                //Change the response Success property to false to let the user know an error occurred
                retVal.Success = false;
                retVal.Message = ex.ToString();
            }

            return(retVal);
        }
        public override Response PopulateScriptBlocks()
        {
            //Create a response object with default values
            kCura.EventHandler.Response retVal = new kCura.EventHandler.Response();
            retVal.Success = true;
            retVal.Message = String.Empty;

            string registerEventsScript = @"
                <script type=""text/javascript"">
                    function setDecisionDisplay(){
                        //could make this global so you don't have to type name twice, but should stay away from variables with global scope because it could cause ugly problems down the road.
                        var decision_dropdown = $(""#_dynamicTemplate__dynamicViewFieldRenderer_ctl02_dropDownList"");
                        var a_label = $(""#_dynamicTemplate__dynamicViewFieldRenderer_ctl03_nameCell"");
                        var a_textbox = $(""input[name='_dynamicTemplate$_dynamicViewFieldRenderer$ctl03$textBox$textBox']"");
                        var b_label = $(""#_dynamicTemplate__dynamicViewFieldRenderer_ctl04_nameCell"");
                        var b_textbox = $(""input[name='_dynamicTemplate$_dynamicViewFieldRenderer$ctl04$textBox$textBox']"");
                        
                        var selectedText = decision_dropdown.find("":selected"").text();

                        if (selectedText == ""A"")
                        {          
                            a_textbox.show();
                            a_label.show();
                            b_textbox.hide();
                            b_label.hide();
                        }
                        else if (selectedText == ""B"")
                        {
                            b_textbox.show();
                            b_label.show();
                            a_textbox.hide();
                            a_label.hide();
                        }
                        else
                        {
                            a_textbox.show();
                            a_label.show();
                            b_textbox.show();
                            b_label.show();
                        }

                    }

                    $(document).ready(
                        function() {
                            $('#_dynamicTemplate__dynamicViewFieldRenderer_ctl02_dropDownList').change(setDecisionDisplay);
                        }
                    )
                </script>
            ";



            if (this.PageMode == kCura.EventHandler.Helper.PageMode.Edit)
            {
                this.RegisterStartupScriptBlock(new kCura.EventHandler.ScriptBlock()
                {
                    Key = "registerEventsScript", Script = registerEventsScript
                });
            }

            return(retVal);
        }
        public override Response PopulateScriptBlocks()
        {
            kCura.EventHandler.Response retVal = new kCura.EventHandler.Response();
            retVal.Success = true;
            retVal.Message = string.Empty;

            // Obtain Workspace-specific ArtifactIDs for the Fields we're addressing by GUID, as only ArtifactID and
            // Field's Friendly Name can be used directly to obtain the Field's DOM reference.
            string CONTAIN_ID = this.ActiveArtifact.Fields[CONTAIN_ENTHUSIASM_GUID.ToString()].ArtifactID.ToString();
            string MAXIMUM_ID = this.ActiveArtifact.Fields[MAXIMUM_ENTHUSIASM_GUID.ToString()].ArtifactID.ToString();
            string CURRENT_ID = this.ActiveArtifact.Fields[CURRENT_ENTHUSIASM_GUID.ToString()].ArtifactID.ToString();

            // Controls are different in View mode than in Edit (which includes both Edit and Add)
            // We need to know this in the JavaScript.
            bool   isViewMode   = this.PageMode == kCura.EventHandler.Helper.PageMode.View;
            string jsIsViewMode = isViewMode ? "true" : "false";

            String startUp;

            #region JavaScript PIEH code

            startUp = String.Format(@"<script type=""text/javascript"">
$(document).ready(function() {{
	// Note the use of jQuery in the line above.
	// This assumes that jQuery will always be available on the window.
	// That assumption may one day not be safe.

	// functions to get Field Cells (parent DOM element containing the Field you want)

		function getFieldCellByArtifactId(artifactId) {{
			return document.querySelector(""[faartifactid = '"" + artifactId + ""']"").parentElement;
		}}

		function getFieldCellByFriendlyName(friendlyName) {{
			return document.querySelector(""[fafriendlyname='"" + friendlyName + ""']"").parentElement;
		}}


	// functions to get values for Fields (Input for text and number, Radio for yes/no* (in radio mode only))
	
		function getFieldInputValue(fieldCell) {{
			// Note the DOM traversal here, and the inherent assumption that the markup
			// for this Field type will not change significantly.
			var value = fieldCell.childNodes[2].childNodes[0][isViewMode ? 'innerText' : 'value'];
			return value.trim();
		}}

		function getFieldRadioValue(fieldCell) {{
			// Again, note the DOM traversal. For radio button display types, the
			// Markup is quite different in View mode than it is in Edit mode.
			// In View mode, the value is determined by string comparison, which
			// could be brittle. If someone alters the Yes/No values for this Field
			// it may be catastrophic to the operation of this event handler in View
			// mode. Obviously, the given selector will not work properly if the
			// Layout for this type were to change the display type of the Yes/No
			// Field to something other than radio.
			var value;
			if (isViewMode) {{
				value = fieldCell.childNodes[2].textContent === yesValue;
			}} else {{
				var radio = fieldCell.childNodes[2];
				var yesRadio = radio.querySelectorAll(""[type = 'radio']"")[0];
	
				value = yesRadio.checked;
			}}
			return value;
		}}


	// functions for the show/hide behaviors

		function toggleMaximumEnthusiasm(show) {{
			// Direct access to the DOM element makes easy synchronous work
			// of performing this hide.
			maximumEnthusiasmCell.hidden = !show;
		}}

		function toggleMaximumEnthusiasmByRadio() {{
			toggleMaximumEnthusiasm(getFieldRadioValue(containEnthusiasmCell));
		}}


	// variable definitions

		// EH PageMode Shortcut
		var isViewMode = {0};

		// Name Field
		var nameCell = getFieldCellByFriendlyName('Name');
    
		// Yes/No Field shown as radio. ""yesValue"" used within get value function for this type
		var containEnthusiasmFieldId = '{1}';
		var containEnthusiasmCell = getFieldCellByArtifactId(containEnthusiasmFieldId); 
		var yesValue = 'Ok, I will.';

		// Whole Number Fields for Max and Current Enthusiasm
		var maximumEnthusiasmFieldId = '{2}';
		var maximumEnthusiasmCell = getFieldCellByArtifactId(maximumEnthusiasmFieldId);
		var currentEnthusiasmFieldId = '{3}';
		var currentEnthusiasmCell = getFieldCellByArtifactId(currentEnthusiasmFieldId);

	// Execute immediately upon document ready

		// When we're not in View mode, we want a change event on the radio button yes/no Field
		if (!isViewMode) {{
			containEnthusiasmCell.onclick = toggleMaximumEnthusiasmByRadio;
		}}

		// Make sure the 'Maximum Enthusiasm' cell is shown or hidden appropriately
		toggleMaximumEnthusiasmByRadio();

}});
</script>", jsIsViewMode, CONTAIN_ID, MAXIMUM_ID, CURRENT_ID);

            #endregion

            this.RegisterStartupScriptBlock(new kCura.EventHandler.ScriptBlock()
            {
                Key = "startup", Script = startUp
            });

            return(retVal);
        }
        public override Response PopulateScriptBlocks()
        {
            Response retVal = new kCura.EventHandler.Response();

            retVal.Success = true;
            retVal.Message = String.Empty;

            string markerTypeArtifactId           = GetArtifactIdByGuid(Constant.Guids.Fields.ExtractorTargetText.MarkerType).ToString();
            string startMarkerPlainTextArtifactId = GetArtifactIdByGuid(Constant.Guids.Fields.ExtractorTargetText.PlainTextStartMarker).ToString();
            string stopMarkerPlainTextArtifactId  = GetArtifactIdByGuid(Constant.Guids.Fields.ExtractorTargetText.PlainTextStopMarker).ToString();
            string startRegexArtifactId           = GetArtifactIdByGuid(Constant.Guids.Fields.ExtractorTargetText.RegularExpressionStartMarker).ToString();
            string stopRegexArtifactId            = GetArtifactIdByGuid(Constant.Guids.Fields.ExtractorTargetText.RegularExpressionStopMarker).ToString();
            string applyStopmarkerArtifactId      = GetArtifactIdByGuid(Constant.Guids.Fields.ExtractorTargetText.ApplyStopMarker).ToString();
            string caseSensitiveArtifactId        = GetArtifactIdByGuid(Constant.Guids.Fields.ExtractorTargetText.CaseSensitive).ToString();
            string directionArtifactId            = GetArtifactIdByGuid(Constant.Guids.Fields.ExtractorTargetText.Direction).ToString();
            string choicePlainTextArtifactId      = GetArtifactIdByGuid(Constant.Guids.Choices.MarkerType.PlainText).ToString();
            string choiceRegExArtifactId          = GetArtifactIdByGuid(Constant.Guids.Choices.MarkerType.RegularExpression).ToString();
            string occurrenceArtifactId           = GetArtifactIdByGuid(Constant.Guids.Fields.ExtractorTargetText.Occurrence).ToString();
            string charachterLengthArtifactId     = GetArtifactIdByGuid(Constant.Guids.Fields.ExtractorTargetText.NumberofCharacters).ToString();
            string minExtractionsArtifactId       = GetArtifactIdByGuid(Constant.Guids.Fields.ExtractorTargetText.MinimumExtractions).ToString();
            string maxExtractionsArtifactId       = GetArtifactIdByGuid(Constant.Guids.Fields.ExtractorTargetText.MaximumExtractions).ToString();
            string delimiterArtifactId            = GetArtifactIdByGuid(Constant.Guids.Fields.ExtractorTargetText.ResultsCustomDelimiter).ToString();

            String pageInteractionScript = "<script type=\"text/javascript\"></script>";

            var layoutArtifactIdByGuid = GetArtifactIdByGuid(Constant.Guids.Layout.TargetText);
            var layoutArtifactId       = ActiveLayout.ArtifactID;

            var validator = new Validator();

            //check if this is the Text Extractor Target Text layout
            if (!validator.VerifyIfNotLayout(layoutArtifactIdByGuid, layoutArtifactId))
            {
                if (PageMode == kCura.EventHandler.Helper.PageMode.Edit)
                {
                    pageInteractionScript = "<script type=\"text/javascript\">$(document).ready(function(){ var isStopMarkerApplied = false; var isPlainText = false; var $markerType = $('[faartifactid=" + markerTypeArtifactId + "]').parent().find('td select'); var $startMarkerTextBox = $('[faartifactid=" + startMarkerPlainTextArtifactId + "]').closest('tr'); var $stopMarkerTextBox = $('[faartifactid=" + stopMarkerPlainTextArtifactId + "]').closest('tr'); var $regExStartContainer = $('[faartifactid=" + startRegexArtifactId + "]').closest('tr');var $regExStopContainer = $('[faartifactid=" + stopRegexArtifactId + "]').closest('tr'); var $applyStopMarkerInput = $('[faartifactid=" + applyStopmarkerArtifactId + "]').closest('tr'); var $caseSensitiveContainer = $('[faartifactid=" + caseSensitiveArtifactId + "]').closest('tr');var $directionContainer = $('[faartifactid=" + directionArtifactId + "]').closest('tr'); var $occurrenceContainer = $('[faartifactid=" + occurrenceArtifactId + "]').closest('tr'); var $charLenContainer = $('[faartifactid=" + charachterLengthArtifactId + "]').closest('tr'); var $minExtractionsContainer = $('[faartifactid=" + minExtractionsArtifactId + "]').closest('tr'); var $maxExtractionsContainer = $('[faartifactid=" + maxExtractionsArtifactId + "]').closest('tr');var $delimiterContainer = $('[faartifactid=" + delimiterArtifactId + "]').closest('tr'); var initialViewChanged = false; function hideInitialFields(){var radioValue = $applyStopMarkerInput.find('input[checked]').val(); if(radioValue === 'True'){ isStopMarkerApplied = true; } if($markerType.find('option[selected]').val() == " + choicePlainTextArtifactId + "){ isPlainText  = true; showCommonFields(); toggleContainersVisibility(); } else if ( $markerType.find('option[selected]').val() == " + choiceRegExArtifactId + "){ showCommonFields(); toggleContainersVisibility(); } else { $startMarkerTextBox.hide(); $stopMarkerTextBox.hide(); $regExStartContainer.hide(); $regExStopContainer.hide(); $caseSensitiveContainer.hide(); $directionContainer.hide(); $occurrenceContainer.hide(); $charLenContainer.hide(); $minExtractionsContainer.hide(); $maxExtractionsContainer.hide(); $delimiterContainer.hide();}} hideInitialFields(); $markerType.change(function(){showCommonFields(); if(this.value === '" + choicePlainTextArtifactId + "'){isPlainText = true;} else if(this.value == '" + choiceRegExArtifactId + "'){ isPlainText = false;}toggleContainersVisibility();});$applyStopMarkerInput.find('input:nth-child(1)').change(function(){ showCommonFields(); var radioValue = $applyStopMarkerInput.find('input:last').val();if(radioValue === '0'){ isStopMarkerApplied = true;} else {isStopMarkerApplied = false;}toggleContainersVisibility();}); function toggleContainersVisibility(){ if(isPlainText){ $startMarkerTextBox.show(); $caseSensitiveContainer.show(); $regExStartContainer.hide(); $regExStopContainer.hide(); if(isStopMarkerApplied){ $stopMarkerTextBox.show(); } else { $stopMarkerTextBox.hide(); } } else { $caseSensitiveContainer.hide(); $startMarkerTextBox.hide(); $regExStartContainer.show(); $stopMarkerTextBox.hide(); if (isStopMarkerApplied) { $regExStopContainer.show(); } else { $regExStopContainer.hide(); } } if(isStopMarkerApplied){ $directionContainer.hide(); } else { $directionContainer.show(); } }  function showCommonFields(){ if(!initialViewChanged){$occurrenceContainer.show(); $charLenContainer.show(); $minExtractionsContainer.show(); $maxExtractionsContainer.show(); $delimiterContainer.show(); } initialViewChanged = true;} });</script>";
                }
                else if (PageMode == kCura.EventHandler.Helper.PageMode.View)
                {
                    var markerTypeFieldValue = (kCura.EventHandler.ChoiceCollection)ActiveArtifact.Fields[GetArtifactIdByGuid(Constant.Guids.Fields.ExtractorTargetText.MarkerType)].Value.Value;

                    String markerType = null;
                    foreach (kCura.EventHandler.Choice markerChoice in markerTypeFieldValue)
                    {
                        if (markerChoice.IsSelected)
                        {
                            markerType = markerChoice.Name;
                            break;
                        }
                    }

                    var applyStopMarkerFieldValue = ActiveArtifact.Fields[GetArtifactIdByGuid(Constant.Guids.Fields.ExtractorTargetText.ApplyStopMarker)].Value.Value;
                    var applyStopMarker           = Convert.ToBoolean(applyStopMarkerFieldValue);

                    switch (markerType)
                    {
                    case Constant.Choices.MarkerType.REGULAR_EXPRESSION:
                        if (applyStopMarker == false)
                        {
                            pageInteractionScript = "<script type=\"text/javascript\">$('[faartifactid=" + startMarkerPlainTextArtifactId + "]').closest('tr').hide(); $('[faartifactid=" + stopMarkerPlainTextArtifactId + "]').closest('tr').hide(); $('[faartifactid=" + caseSensitiveArtifactId + "]').closest('tr').hide(); $('[faartifactid=" + stopRegexArtifactId + "]').closest('tr').hide();</script>";
                        }
                        else
                        {
                            pageInteractionScript = "<script type=\"text/javascript\">$('[faartifactid=" + startMarkerPlainTextArtifactId + "]').closest('tr').hide(); $('[faartifactid=" + stopMarkerPlainTextArtifactId + "]').closest('tr').hide(); $('[faartifactid=" + caseSensitiveArtifactId + "]').closest('tr').hide(); $('[faartifactid=" + directionArtifactId + "]').closest('tr').hide();</script>";
                        }
                        break;

                    case Constant.Choices.MarkerType.PLAIN_TEXT:

                        if (applyStopMarker == false)
                        {
                            pageInteractionScript = "<script type=\"text/javascript\">$('[faartifactid=" + startRegexArtifactId + "]').closest('tr').hide(); $('[faartifactid=" + stopMarkerPlainTextArtifactId + "]').closest('tr').hide(); $('[faartifactid=" + stopRegexArtifactId + "]').closest('tr').hide(); </script>";
                        }
                        else
                        {
                            pageInteractionScript = "<script type=\"text/javascript\">$('[faartifactid=" + startRegexArtifactId + "]').closest('tr').hide(); $('[faartifactid=" + directionArtifactId + "]').closest('tr').hide(); $('[faartifactid=" + stopRegexArtifactId + "]').closest('tr').hide(); </script>";
                        }
                        break;
                    }
                }
            }

            this.RegisterStartupScriptBlock(new kCura.EventHandler.ScriptBlock()
            {
                Key = "targetTextPageInteraction", Script = pageInteractionScript
            });

            return(retVal);
        }