diff --git a/PROMS/DataLoader/PROMSFixes.Sql b/PROMS/DataLoader/PROMSFixes.Sql index 282954d7..6774757e 100644 --- a/PROMS/DataLoader/PROMSFixes.Sql +++ b/PROMS/DataLoader/PROMSFixes.Sql @@ -15485,6 +15485,370 @@ IF (@@Error = 0) PRINT 'Procedure Creation: addItemSiblingBefore Succeeded' ELSE PRINT 'Procedure Creation: addItemSiblingBefore Error on Creation' GO +/*************** May 2020 - Modifications to search queries to allow for 'ByWord'. To do this a sql prefix and suffix were added +* If search string's adjacent character is text '[^a-zA-Z]' (for example 'red' prefix is next to 'r', suffix is next to 'd') +* If search string's adjacent character is numeric '[^0-9a-zA-Z.vbpi:\\-]' (for example 10%, prefix is next to '1') +*/ +IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[vefn_FixSearchStringByWord]') AND OBJECTPROPERTY(id,N'IsScalarFunction') = 1) +DROP FUNCTION [vefn_FixSearchStringByWord]; +GO + +/* +select .dbo.vefn_FixSearchStringByWord('0%', '[^0-9A-Z.vbpi:\\-]', '') +select .dbo.vefn_FixSearchStringByWord('step 25', '[^a-z]', '[^0-9A-Z.vbpi:\\-]') +*/ +/***************************************************************************** + Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE + Copyright 2020 - Volian Enterprises, Inc. All rights reserved. +*****************************************************************************/ +CREATE FUNCTION [dbo].[vefn_FixSearchStringByWord](@SearchString nvarchar(MAX), @Prefix nvarchar(64), @Suffix nvarchar(64)) +RETURNS nvarchar(MAX) +WITH EXECUTE AS OWNER +AS +BEGIN + -- This code adds % at the beginning and end if the beginning and end + -- of the search string if it does not have % at the beginning or end + Set @SearchString = replace(@SearchString,'[','[[]') + Set @SearchString = replace(@SearchString,'_','[_]') + Set @SearchString = replace(@SearchString,'%','[%]') + Set @SearchString = replace(@SearchString,'*','%') + Set @SearchString = replace(@SearchString,'?','_') + Set @SearchString = replace(@SearchString,'\%','*') + Set @SearchString = replace(@SearchString,'\_','?') + Set @SearchString = replace(@SearchString,'-','\u8209?') + Set @SearchString = replace(@SearchString,'\''A9','\u169?') -- copyright symbol + Set @SearchString = replace(@SearchString,'\''AE','\u174?') -- Register symbol + Set @SearchString = replace(@SearchString,'\\line ','\line ') -- newline + Set @SearchString = replace(@SearchString,'\\','\u9586?') -- use a double backslash to search for a backslash + IF(@SearchString like '[%]%') RETURN '%' + @Prefix + SubString(@SearchString,2,len(@SearchString)) -- beginning of text + IF(@SearchString like '%[%]') RETURN SubString(@SearchString, 0, len(@SearchString)-1) + @Suffix + '%' -- end of text + Set @SearchString = replace('%' + @Prefix + @SearchString + @Suffix + '%','%%','%') + RETURN @SearchString +END +GO +-- Display the status +IF (@@Error = 0) PRINT 'ScalerFunction [vefn_FixSearchStringByWord] Succeeded' +ELSE PRINT 'ScalerFunction [vefn_FixSearchStringByWord] Error on Creation' +go + +IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[vefn_SiblingAndChildrenItemsNewByWord]') AND OBJECTPROPERTY(id,N'IsTableFunction') = 1) + DROP FUNCTION [vefn_SiblingAndChildrenItemsNewByWord]; +GO +/* +select Text from vefn_SiblingAndChildrenItemsNewByWord('194','','%[^a-z]red[^a-z]%', '%[^a-z]red[^a-z]%','') +select Text from vefn_SiblingAndChildrenItemsNewByWord('194','','%[^a-zA-Z]step 25[^0-9a-zA-Z.vbpi:\\-]%','%[^a-zA-Z]step 25[^0-9a-zA-Z.vbpi:\\-]%','') +*/ +/***************************************************************************** + Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE + Copyright 2020 - Volian Enterprises, Inc. All rights reserved. +*****************************************************************************/ +CREATE FUNCTION [dbo].[vefn_SiblingAndChildrenItemsNewByWord](@DocVersionList varchar(MAX),@UnitPrefix varchar(MAX),@SearchString varchar(MAX),@SearchStringx varchar(MAX), @StepTypeList varchar(MAX)) +RETURNS @SiblingAndChildren TABLE +( + [ILastChanged] varbinary(8) + , [ItemID] int PRIMARY KEY + , [DVPath] nvarchar(max) + , [Path] nvarchar(max) + , [FromType] int + , [Ordinal] int + , [ParentID] int + , [PreviousID] int + , [ContentID] int + , [DTS] datetime + , [UserID] nvarchar(100) + , [pContentID] int + , [pDTS] datetime + , [pUserID] nvarchar(100) + , [IsRNO] int + , Text nvarchar(max) + , DocAscii nvarchar(max) + , Number nvarchar(256) + , CType int + , CFormatID int + , CConfig nvarchar(max) + , CDTS datetime + , CUserID nvarchar(100) + , CLastChanged varbinary(8) + , PLastChanged varbinary(8) +) +WITH EXECUTE AS OWNER +AS +BEGIN +Declare @Delim char(1) +Set @Delim=char(7) +Declare @DelimNumber char(1) +Set @DelimNumber=char(17) +Declare @DelimStep char(1) +Set @DelimStep='.' +declare @TextPrefix nvarchar(1) +declare @TextSuffix nvarchar(1) +set @TextPrefix = '' +set @TextSuffix = '' +if (@SearchString like '[%]%') set @TextPrefix = '~' +if (@SearchString like '%[%]') set @TextSuffix = '~' +BEGIN +with Itemz([ILastChanged], [ItemID], VersionID,[Path], [FromType],[Ordinal], [ParentID], [PreviousID], [ContentID], [DTS], [UserID],[pContentID], + [pDTS],[pUserID],[IsRNO], Text, Number, PPath, CType, CFormatID, CConfig, CDTS, CUserID, CLastChanged, PLastChanged) as ( + Select Cast(I.LastChanged as varbinary(8)) ILastChanged,[I].[ItemID], VersionID, + Cast(Case when C.Type < 20000 then @Delim + @UnitPrefix + Isnull(C.Number,'') + @DelimNumber + Isnull(C.Text,'') else '1' end as nvarchar(max)) [Path] + , 0 [FromType], 0 [Ordinal], 0 [ParentID], [PreviousID],[I].[ContentID],[I].[DTS],[I].[UserID] + ,0 [pContentID],[I].[DTS] [pDTS], [I].[UserID] [pUserID],0 IsRNO, C.Text, C.Number, + Cast('' as nvarchar(max)) [PPath], C.Type CType, C.FormatID CFormatID, C.Config CConfig, C.Dts CDTS,C.UserID CUSERID, + Cast(C.LastChanged as varbinary(8)) CLastChanged, Cast(0 as varbinary(8)) PLastChanged + FROM [Items] I + Join Contents C on C.ContentID=I.ContentID + JOIN vefn_DocVersionSplit(@DocVersionList) DV + ON I.[ItemID] = DV.[ItemID] +Union All +-- Children + select Cast(I.LastChanged as varbinary(8)) ILastChanged,I.[ItemID], VersionID, + Path + case C.Type/10000 + when 0 then @Delim + @UnitPrefix + Isnull(C.Number,'') + @DelimNumber + Isnull(C.Text,'') -- Procedure + when 1 then @Delim + Isnull(C.Number,'') + @DelimNumber + Isnull(C.Text,'') -- Section + else + case P.FromType + --when 1 then 'PRC' + @Delim + cast(1 as varchar(4)) + --when 2 then 'SEC' + @Delim + cast(1 as varchar(4)) + when 3 then @DelimStep +'Caution' + @DelimStep + cast(1 as varchar(4)) + when 4 then @DelimStep +'Note' + @DelimStep + cast(1 as varchar(4)) + when 5 then @DelimStep +'RNO' + @DelimStep + when 7 then @DelimStep +'Table' + @DelimStep + cast(1 as varchar(4)) + when 8 then @DelimStep +'SupInfo' + @DelimStep + else case when Z.FromType < 3 then @Delim else @DelimStep end + cast(1 as varchar(4)) + end end Path, + P.[FromType],0 [Ordinal], Z.ItemID [ParentID],I.[PreviousID], I.[ContentID],I.[DTS],I.[UserID], + P.[ContentID] [pContentID],P.[DTS] [pDTS],P.[UserID] [pUserID], + case when P.FromType = 5 then -1 else 0 end IsRNO, + C.Text,c.Number, + Path + case C.Type/10000 + when 2 then + case P.FromType + when 3 then @DelimStep + 'Caution' + when 4 then @DelimStep + 'Note' + when 8 then @DelimStep + 'SupInfo' + else '' end + else '' end [PPath], C.Type CType, C.FormatID CFormatID, C.Config CConfig, C.Dts CDTS,C.UserID CUSERID, + Cast(C.LastChanged as varbinary(8)) CLastChanged, Cast(P.LastChanged as varbinary(8)) PLastChanged + from Itemz Z + join Parts P on P.ContentID = Z.ContentID + join Items I on I.ItemID = P.ItemID + join Contents C on C.ContentID = I.ContentID + Union All +-- Siblings + select Cast(I.LastChanged as varbinary(8)) ILastChanged,I.[ItemID], VersionID, PPath + case C.Type/10000 + when 0 then @Delim + @UnitPrefix + Isnull(C.Number,'') + @DelimNumber + Isnull(C.Text,'') -- Procedure + when 1 then @Delim + Isnull(C.Number,'') + @DelimNumber + Isnull(C.Text,'') -- Section + else case when .dbo.vefn_GetLastDelim(Path) = '.' then @DelimStep else @Delim end + cast(Ordinal + 2 as varchar(4)) + end Path, + [FromType],Z.[Ordinal] +1,Z.[ParentID], I.[PreviousID], I.[ContentID],I.[DTS],I.[UserID] + ,null,null,null, + 0 IsRNO, + C.Text, C.Number, + PPath, C.Type CType, C.FormatID CFormatID, C.Config CConfig, C.Dts CDTS,C.UserID CUSERID, + Cast(C.LastChanged as varbinary(8)) CLastChanged, Cast(0 as varbinary(8)) PLastChanged + from Itemz Z + join Items I on I.PreviousID = Z.ItemID + join Contents C on C.ContentID = I.ContentID + --where Z.[Level] > 0 +) + +insert into @SiblingAndChildren +select ZZ.ILastChanged,ZZ.[ItemID], dvpath, [Path],[FromType],[Ordinal], [ParentID], [PreviousID],ZZ.[ContentID],ZZ.[DTS],ZZ.[UserID], + [pContentID],[pDTS],[pUserID],[IsRNO],Text,DocAscii, Number, CType, CFormatID, CConfig, CDTS, CUserID, CLastChanged, PLastChanged + From Itemz ZZ + join vefn_DocVersionSplit(@DocVersionList) DV ON DV.VersionID=zz.VersionID + Left Join Entries EE ON EE.ContentID=ZZ.ContentID + Left Join Documents DD ON DD.DocID = ee.DocID + where (@TextPrefix+text+@TextSuffix like @SearchString OR Replace(DD.DocAscii,nchar(176),'\''B0') like @SearchString or @TextPrefix+text+@TextSuffix like @SearchStringx OR + Replace(DD.DocAscii,nchar(176),'\''B0') like @SearchStringx ) + and (isnull(@StepTypeList,'') = '' or (dbo.vefn_AllSections(CType) in (Select ID from vefn_SplitInt(@StepTypeList,',')))) + OPTION (MAXRECURSION 10000) +END +RETURN +END +GO + +IF (@@Error = 0) PRINT 'Function: vefn_SiblingAndChildrenItemsNewByWord Succeeded' +ELSE PRINT 'Function: vefn_SiblingAndChildrenItemsNewByWord Error on Creation' +GO + +IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[vesp_SearchItemAndChildrenNewByWord]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1) +DROP PROCEDURE [vesp_SearchItemAndChildrenNewByWord]; +GO +/* +exec vesp_SearchItemAndChildrenNewByWord '194','','red',0,0,0,0,'','[^a-z]','[^a-z]' +exec vesp_SearchItemAndChildrenNewByWord '194','','0%',0,0,0,0,'','[^0-9A-Z.vbpi:\\-]','' +exec vesp_SearchItemAndChildrenNewByWord '194','','10%',0,0,0,0,'','[^0-9A-Z.vbpi:\\-]','' +exec vesp_SearchItemAndChildrenNewByWord '194','','25%',0,0,0,0,'','[^0-9A-Z.vbpi:\\-]','[^0-9A-Z.vbpi:\\-]' +exec vesp_SearchItemAndChildrenNewByWord '194','','25%',0,0,0,0,'','','[^0-9A-Z.vbpi:\\-]' +exec vesp_SearchItemAndChildrenNewByWord '194','','25%',0,0,0,0,'','[^0-9A-Z.vbpi:\\-]','' +exec vesp_SearchItemAndChildrenNewByWord '194','','step 25',0,0,0,1,'','[^a-zA-Z]','[^0-9a-zA-Z.vbpi:\\-]' +exec vesp_SearchItemAndChildrenNewByWord '194','','25',0,0,0,0,'','','' +*/ + +/***************************************************************************** + Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE + Copyright 2020 - Volian Enterprises, Inc. All rights reserved. +*****************************************************************************/ +CREATE PROCEDURE [dbo].[vesp_SearchItemAndChildrenNewByWord] (@DocVersionList varchar(MAX), @StepTypeList varchar(MAX), +@SearchString varchar(MAX), @CaseSensitive as int, @IncludeLinks as int, @IncludeRtfFormatting as int, @IncludeSpecialCharacters as int, @UnitPrefix as varchar(MAX), +@ByWordPrefix varchar(64), @ByWordSuffix varchar(64)) +WITH EXECUTE AS OWNER +AS +Set @SearchString = .dbo.vefn_FixSearchStringByWord(@SearchString, @ByWordPrefix, @ByWordSuffix) +declare @TextPrefix nvarchar(1) +declare @TextSuffix nvarchar(1) +set @TextPrefix = '' +set @TextSuffix = '' +if (@SearchString like '[%]%') set @TextPrefix = '~' +if (@SearchString like '%[%]') set @TextSuffix = '~' +Declare @SearchStringx nvarchar(200) +set @SearchStringx = replace(@SearchString,'\u8209?','-') --JSJ B2016-209 not finding dashes in Word sections (FixSearchString converts '-' to '\u8209?') +if (@IncludeLinks + @IncludeRtfFormatting + @IncludeSpecialCharacters = 0) +begin +if (@CaseSensitive = 0) +Begin + select ZZ.DvPath, ZZ.Path, ZZ.[FromType],ZZ.[Ordinal], ZZ.[ParentID], ZZ.[ItemID],ZZ.[PreviousID],ZZ.[ContentID],ZZ.[DTS],ZZ.[UserID] + ,ZZ.[ILastChanged] + ,ZZ.[Number],ZZ.[Text],ZZ.[CType] [Type],ZZ.[CFormatID] [FormatID],ZZ.[CConfig] [Config],ZZ.[CDTS] ,ZZ.[CUserID] + ,ZZ.[cLastChanged], + zz.[pContentID], ZZ.[pDTS],ZZ.[pUserID], ZZ.[pLastChanged], + (SELECT COUNT(*) FROM [Annotations] WHERE [Annotations].[ItemID]=ZZ.[ItemID]) [AnnotationCount], + (SELECT COUNT(*) FROM [DocVersions] WHERE [DocVersions].[ItemID]=ZZ.[ItemID]) [DocVersionCount], + (SELECT COUNT(*) FROM [Items] [Next] WHERE [Next].[PreviousID]=ZZ.[ItemID]) [NextCount], + (SELECT COUNT(*) FROM [Parts] WHERE [Parts].[ItemID]=ZZ.[ItemID]) [PartCount], + (SELECT COUNT(*) FROM [Transitions] WHERE [Transitions].[RangeID]=ZZ.[ItemID]) [Transition_RangeIDCount], + (SELECT COUNT(*) FROM [Transitions] WHERE [Transitions].[ToID]=ZZ.[ItemID]) [Transition_ToIDCount], + (SELECT COUNT(*) FROM [Details] WHERE [Details].[ContentID]=ZZ.[ContentID]) [DetailCount], + (SELECT COUNT(*) FROM [Entries] WHERE [Entries].[ContentID]=ZZ.[ContentID]) [EntryCount], + (SELECT COUNT(*) FROM [Grids] WHERE [Grids].[ContentID]=ZZ.[ContentID]) [GridCount], + (SELECT COUNT(*) FROM [Images] WHERE [Images].[ContentID]=ZZ.[ContentID]) [ImageCount], + (SELECT COUNT(*) FROM [Items] WHERE [Items].[ContentID]=ZZ.[ContentID]) [ItemCount], + (SELECT COUNT(*) FROM [Parts] WHERE [Parts].[ContentID]=ZZ.[ContentID]) [cPartCount], + (SELECT COUNT(*) FROM [RoUsages] WHERE [RoUsages].[ContentID]=ZZ.[ContentID]) [RoUsageCount], + (SELECT COUNT(*) FROM [Transitions] WHERE [Transitions].[FromID]=ZZ.[ContentID]) [TransitionCount], + (SELECT COUNT(*) FROM [ZContents] WHERE [ZContents].[ContentID]=ZZ.[ContentID]) [ZContentCount] +from vefn_SiblingAndChildrenItemsNewByWord(@DocVersionList, @UnitPrefix, @SearchString, @SearchStringx,@StepTypeList) ZZ + --Join Items II on ZZ.ItemID=II.ItemID + --Left Join Parts PP on ZZ.PContentID=PP.ContentID and ZZ.FromType = PP.FromType + --Join Contents CC on CC.ContentID=ZZ.ContentID +--where ZZ.Text like @SearchString or zz.text like @SearchStringx-- ZZ.ContentID in (select ContentID from vefn_FindText(@DocVersionList,@SearchString,@CaseSensitive,@IncludeLinks,@IncludeRtfFormatting,@IncludeSpecialCharacters,@StepTypeList)) + order by DvPath + end + else + begin + + select ZZ.DvPath, ZZ.Path, ZZ.[FromType],ZZ.[Ordinal], ZZ.[ParentID], ZZ.[ItemID],ZZ.[PreviousID],ZZ.[ContentID],ZZ.[DTS],ZZ.[UserID] + ,ZZ.[ILastChanged] + ,ZZ.[Number],ZZ.[Text],ZZ.[CType] [Type],ZZ.[CFormatID] [FormatID],ZZ.[CConfig] [Config],ZZ.[CDTS] ,ZZ.[CUserID] + ,ZZ.[cLastChanged], + zz.[pContentID], ZZ.[pDTS],ZZ.[pUserID], ZZ.[pLastChanged], + (SELECT COUNT(*) FROM [Annotations] WHERE [Annotations].[ItemID]=ZZ.[ItemID]) [AnnotationCount], + (SELECT COUNT(*) FROM [DocVersions] WHERE [DocVersions].[ItemID]=ZZ.[ItemID]) [DocVersionCount], + (SELECT COUNT(*) FROM [Items] [Next] WHERE [Next].[PreviousID]=ZZ.[ItemID]) [NextCount], + (SELECT COUNT(*) FROM [Parts] WHERE [Parts].[ItemID]=ZZ.[ItemID]) [PartCount], + (SELECT COUNT(*) FROM [Transitions] WHERE [Transitions].[RangeID]=ZZ.[ItemID]) [Transition_RangeIDCount], + (SELECT COUNT(*) FROM [Transitions] WHERE [Transitions].[ToID]=ZZ.[ItemID]) [Transition_ToIDCount], + (SELECT COUNT(*) FROM [Details] WHERE [Details].[ContentID]=ZZ.[ContentID]) [DetailCount], + (SELECT COUNT(*) FROM [Entries] WHERE [Entries].[ContentID]=ZZ.[ContentID]) [EntryCount], + (SELECT COUNT(*) FROM [Grids] WHERE [Grids].[ContentID]=ZZ.[ContentID]) [GridCount], + (SELECT COUNT(*) FROM [Images] WHERE [Images].[ContentID]=ZZ.[ContentID]) [ImageCount], + (SELECT COUNT(*) FROM [Items] WHERE [Items].[ContentID]=ZZ.[ContentID]) [ItemCount], + (SELECT COUNT(*) FROM [Parts] WHERE [Parts].[ContentID]=ZZ.[ContentID]) [cPartCount], + (SELECT COUNT(*) FROM [RoUsages] WHERE [RoUsages].[ContentID]=ZZ.[ContentID]) [RoUsageCount], + (SELECT COUNT(*) FROM [Transitions] WHERE [Transitions].[FromID]=ZZ.[ContentID]) [TransitionCount], + (SELECT COUNT(*) FROM [ZContents] WHERE [ZContents].[ContentID]=ZZ.[ContentID]) [ZContentCount] +from vefn_SiblingAndChildrenItemsNewByWord(@DocVersionList, @UnitPrefix, @SearchString, @SearchStringx,@StepTypeList) ZZ + --Join Items II on ZZ.ItemID=II.ItemID + --Left Join Parts PP on ZZ.PContentID=PP.ContentID and ZZ.FromType = PP.FromType + --Join Contents CC on CC.ContentID=ZZ.ContentID +--where ZZ.Text like @SearchString or zz.text like @SearchStringx-- ZZ.ContentID in (select ContentID from vefn_FindText(@DocVersionList,@SearchString,@CaseSensitive,@IncludeLinks,@IncludeRtfFormatting,@IncludeSpecialCharacters,@StepTypeList)) +--where zz.text Collate SQL_Latin1_General_CP1_CS_AS like @SearchString or +--zz.text Collate SQL_Latin1_General_CP1_CS_AS like @SearchStringx or +where @TextPrefix+zz.text+@TextSuffix Collate SQL_Latin1_General_CP1_CS_AS like @SearchString or +@TextPrefix+zz.text+@TextSuffix Collate SQL_Latin1_General_CP1_CS_AS like @SearchStringx or +-- docascii are the word sections +Replace(zz.DocAscii,nchar(176),'\''B0') Collate SQL_Latin1_General_CP1_CS_AS like @SearchString or +Replace(zz.DocAscii,nchar(176),'\''B0') Collate SQL_Latin1_General_CP1_CS_AS like @SearchStringx + order by DvPath + end + end -- no links + else +begin -- include linked text +if (@CaseSensitive = 0) +Begin + select ZZ.DvPath, ZZ.Path, ZZ.[FromType],ZZ.[Ordinal], ZZ.[ParentID], ZZ.[ItemID],ZZ.[PreviousID],ZZ.[ContentID],ZZ.[DTS],ZZ.[UserID] + ,ZZ.[ILastChanged] + ,ZZ.[Number],ZZ.[Text],ZZ.[CType] [Type],ZZ.[CFormatID] [FormatID],ZZ.[CConfig] [Config],ZZ.[CDTS] ,ZZ.[CUserID] + ,ZZ.[cLastChanged], + zz.[pContentID], ZZ.[pDTS],ZZ.[pUserID], ZZ.[pLastChanged], + (SELECT COUNT(*) FROM [Annotations] WHERE [Annotations].[ItemID]=ZZ.[ItemID]) [AnnotationCount], + (SELECT COUNT(*) FROM [DocVersions] WHERE [DocVersions].[ItemID]=ZZ.[ItemID]) [DocVersionCount], + (SELECT COUNT(*) FROM [Items] [Next] WHERE [Next].[PreviousID]=ZZ.[ItemID]) [NextCount], + (SELECT COUNT(*) FROM [Parts] WHERE [Parts].[ItemID]=ZZ.[ItemID]) [PartCount], + (SELECT COUNT(*) FROM [Transitions] WHERE [Transitions].[RangeID]=ZZ.[ItemID]) [Transition_RangeIDCount], + (SELECT COUNT(*) FROM [Transitions] WHERE [Transitions].[ToID]=ZZ.[ItemID]) [Transition_ToIDCount], + (SELECT COUNT(*) FROM [Details] WHERE [Details].[ContentID]=ZZ.[ContentID]) [DetailCount], + (SELECT COUNT(*) FROM [Entries] WHERE [Entries].[ContentID]=ZZ.[ContentID]) [EntryCount], + (SELECT COUNT(*) FROM [Grids] WHERE [Grids].[ContentID]=ZZ.[ContentID]) [GridCount], + (SELECT COUNT(*) FROM [Images] WHERE [Images].[ContentID]=ZZ.[ContentID]) [ImageCount], + (SELECT COUNT(*) FROM [Items] WHERE [Items].[ContentID]=ZZ.[ContentID]) [ItemCount], + (SELECT COUNT(*) FROM [Parts] WHERE [Parts].[ContentID]=ZZ.[ContentID]) [cPartCount], + (SELECT COUNT(*) FROM [RoUsages] WHERE [RoUsages].[ContentID]=ZZ.[ContentID]) [RoUsageCount], + (SELECT COUNT(*) FROM [Transitions] WHERE [Transitions].[FromID]=ZZ.[ContentID]) [TransitionCount], + (SELECT COUNT(*) FROM [ZContents] WHERE [ZContents].[ContentID]=ZZ.[ContentID]) [ZContentCount] +from vefn_SiblingAndChildrenItemsNewByWord(@DocVersionList, @UnitPrefix, @SearchString, @SearchStringx,@StepTypeList) ZZ + --Join Items II on ZZ.ItemID=II.ItemID + --Left Join Parts PP on ZZ.PContentID=PP.ContentID and ZZ.FromType = PP.FromType + --Join Contents CC on CC.ContentID=ZZ.ContentID +--where ZZ.Text like @SearchString or zz.text like @SearchStringx-- ZZ.ContentID in (select ContentID from vefn_FindText(@DocVersionList,@SearchString,@CaseSensitive,@IncludeLinks,@IncludeRtfFormatting,@IncludeSpecialCharacters,@StepTypeList)) +where .dbo.vefn_RemoveExtraText(@TextPrefix+zz.text+@TextSuffix,@IncludeLinks, @IncludeRtfFormatting, @IncludeSpecialCharacters) Collate SQL_Latin1_General_CP1_CI_AS like @SearchString or +.dbo.vefn_RemoveExtraText(@TextPrefix+zz.text+@TextSuffix,@IncludeLinks, @IncludeRtfFormatting, @IncludeSpecialCharacters) Collate SQL_Latin1_General_CP1_CI_AS like @SearchStringx or +-- docascii are the word sections +Replace(zz.DocAscii,nchar(176),'\''B0') Collate SQL_Latin1_General_CP1_CI_AS like @SearchString or +Replace(zz.DocAscii,nchar(176),'\''B0') Collate SQL_Latin1_General_CP1_CI_AS like @SearchStringx + order by DvPath + end + else -- case sensitive + begin + select ZZ.DvPath, ZZ.Path, ZZ.[FromType],ZZ.[Ordinal], ZZ.[ParentID], ZZ.[ItemID],ZZ.[PreviousID],ZZ.[ContentID],ZZ.[DTS],ZZ.[UserID] + ,ZZ.[ILastChanged] + ,ZZ.[Number],ZZ.[Text],ZZ.[CType] [Type],ZZ.[CFormatID] [FormatID],ZZ.[CConfig] [Config],ZZ.[CDTS] ,ZZ.[CUserID] + ,ZZ.[cLastChanged], + zz.[pContentID], ZZ.[pDTS],ZZ.[pUserID], ZZ.[pLastChanged], + (SELECT COUNT(*) FROM [Annotations] WHERE [Annotations].[ItemID]=ZZ.[ItemID]) [AnnotationCount], + (SELECT COUNT(*) FROM [DocVersions] WHERE [DocVersions].[ItemID]=ZZ.[ItemID]) [DocVersionCount], + (SELECT COUNT(*) FROM [Items] [Next] WHERE [Next].[PreviousID]=ZZ.[ItemID]) [NextCount], + (SELECT COUNT(*) FROM [Parts] WHERE [Parts].[ItemID]=ZZ.[ItemID]) [PartCount], + (SELECT COUNT(*) FROM [Transitions] WHERE [Transitions].[RangeID]=ZZ.[ItemID]) [Transition_RangeIDCount], + (SELECT COUNT(*) FROM [Transitions] WHERE [Transitions].[ToID]=ZZ.[ItemID]) [Transition_ToIDCount], + (SELECT COUNT(*) FROM [Details] WHERE [Details].[ContentID]=ZZ.[ContentID]) [DetailCount], + (SELECT COUNT(*) FROM [Entries] WHERE [Entries].[ContentID]=ZZ.[ContentID]) [EntryCount], + (SELECT COUNT(*) FROM [Grids] WHERE [Grids].[ContentID]=ZZ.[ContentID]) [GridCount], + (SELECT COUNT(*) FROM [Images] WHERE [Images].[ContentID]=ZZ.[ContentID]) [ImageCount], + (SELECT COUNT(*) FROM [Items] WHERE [Items].[ContentID]=ZZ.[ContentID]) [ItemCount], + (SELECT COUNT(*) FROM [Parts] WHERE [Parts].[ContentID]=ZZ.[ContentID]) [cPartCount], + (SELECT COUNT(*) FROM [RoUsages] WHERE [RoUsages].[ContentID]=ZZ.[ContentID]) [RoUsageCount], + (SELECT COUNT(*) FROM [Transitions] WHERE [Transitions].[FromID]=ZZ.[ContentID]) [TransitionCount], + (SELECT COUNT(*) FROM [ZContents] WHERE [ZContents].[ContentID]=ZZ.[ContentID]) [ZContentCount] +from vefn_SiblingAndChildrenItemsNewByWord(@DocVersionList, @UnitPrefix, @SearchString, @SearchStringx,@StepTypeList) ZZ + --Join Items II on ZZ.ItemID=II.ItemID + --Left Join Parts PP on ZZ.PContentID=PP.ContentID and ZZ.FromType = PP.FromType + --Join Contents CC on CC.ContentID=ZZ.ContentID +--where ZZ.Text like @SearchString or zz.text like @SearchStringx-- ZZ.ContentID in (select ContentID from vefn_FindText(@DocVersionList,@SearchString,@CaseSensitive,@IncludeLinks,@IncludeRtfFormatting,@IncludeSpecialCharacters,@StepTypeList)) +-- +where .dbo.vefn_RemoveExtraText(replace(@TextPrefix+zz.text+@TextSuffix,'\''b0', '\''B0'),@IncludeLinks, @IncludeRtfFormatting, @IncludeSpecialCharacters) Collate SQL_Latin1_General_CP1_CS_AS like replace(@SearchString,'\''b0', '\''B0') or +.dbo.vefn_RemoveExtraText(replace(@TextPrefix+zz.text+@TextSuffix,'\''b0', '\''B0'),@IncludeLinks, @IncludeRtfFormatting, @IncludeSpecialCharacters) Collate SQL_Latin1_General_CP1_CS_AS like replace(@SearchStringx,'\''b0', '\''B0') or +-- docascii are the word sections +Replace(zz.DocAscii,nchar(176),'\''B0') Collate SQL_Latin1_General_CP1_CS_AS like @SearchString or +Replace(zz.DocAscii,nchar(176),'\''B0') Collate SQL_Latin1_General_CP1_CS_AS like @SearchStringx + order by DvPath + end + end -- include links + GO +IF (@@Error = 0) PRINT 'Procedure Creation: vesp_SearchItemAndChildrenNewByWord Succeeded' +ELSE PRINT 'Procedure Creation: vesp_SearchItemAndChildrenNewByWord Error on Creation' +GO ----------------------------------------------------------------------------- /* @@ -15511,8 +15875,8 @@ BEGIN TRY -- Try Block set nocount on DECLARE @RevDate varchar(255) DECLARE @RevDescription varchar(255) - set @RevDate = '01/09/2020 11:00 AM' - set @RevDescription = 'Referenced Object data in sql server' + set @RevDate = '05/04/2020 10:00 AM' + set @RevDescription = 'Allow Search By Word' Select cast(@RevDate as datetime) RevDate, @RevDescription RevDescription PRINT 'SQL Code Revision ' + @RevDate + ' - ' + @RevDescription IF( @@TRANCOUNT > 0 ) COMMIT diff --git a/PROMS/VEPROMS User Interface/PROMSFixes.Sql b/PROMS/VEPROMS User Interface/PROMSFixes.Sql index 282954d7..6774757e 100644 --- a/PROMS/VEPROMS User Interface/PROMSFixes.Sql +++ b/PROMS/VEPROMS User Interface/PROMSFixes.Sql @@ -15485,6 +15485,370 @@ IF (@@Error = 0) PRINT 'Procedure Creation: addItemSiblingBefore Succeeded' ELSE PRINT 'Procedure Creation: addItemSiblingBefore Error on Creation' GO +/*************** May 2020 - Modifications to search queries to allow for 'ByWord'. To do this a sql prefix and suffix were added +* If search string's adjacent character is text '[^a-zA-Z]' (for example 'red' prefix is next to 'r', suffix is next to 'd') +* If search string's adjacent character is numeric '[^0-9a-zA-Z.vbpi:\\-]' (for example 10%, prefix is next to '1') +*/ +IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[vefn_FixSearchStringByWord]') AND OBJECTPROPERTY(id,N'IsScalarFunction') = 1) +DROP FUNCTION [vefn_FixSearchStringByWord]; +GO + +/* +select .dbo.vefn_FixSearchStringByWord('0%', '[^0-9A-Z.vbpi:\\-]', '') +select .dbo.vefn_FixSearchStringByWord('step 25', '[^a-z]', '[^0-9A-Z.vbpi:\\-]') +*/ +/***************************************************************************** + Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE + Copyright 2020 - Volian Enterprises, Inc. All rights reserved. +*****************************************************************************/ +CREATE FUNCTION [dbo].[vefn_FixSearchStringByWord](@SearchString nvarchar(MAX), @Prefix nvarchar(64), @Suffix nvarchar(64)) +RETURNS nvarchar(MAX) +WITH EXECUTE AS OWNER +AS +BEGIN + -- This code adds % at the beginning and end if the beginning and end + -- of the search string if it does not have % at the beginning or end + Set @SearchString = replace(@SearchString,'[','[[]') + Set @SearchString = replace(@SearchString,'_','[_]') + Set @SearchString = replace(@SearchString,'%','[%]') + Set @SearchString = replace(@SearchString,'*','%') + Set @SearchString = replace(@SearchString,'?','_') + Set @SearchString = replace(@SearchString,'\%','*') + Set @SearchString = replace(@SearchString,'\_','?') + Set @SearchString = replace(@SearchString,'-','\u8209?') + Set @SearchString = replace(@SearchString,'\''A9','\u169?') -- copyright symbol + Set @SearchString = replace(@SearchString,'\''AE','\u174?') -- Register symbol + Set @SearchString = replace(@SearchString,'\\line ','\line ') -- newline + Set @SearchString = replace(@SearchString,'\\','\u9586?') -- use a double backslash to search for a backslash + IF(@SearchString like '[%]%') RETURN '%' + @Prefix + SubString(@SearchString,2,len(@SearchString)) -- beginning of text + IF(@SearchString like '%[%]') RETURN SubString(@SearchString, 0, len(@SearchString)-1) + @Suffix + '%' -- end of text + Set @SearchString = replace('%' + @Prefix + @SearchString + @Suffix + '%','%%','%') + RETURN @SearchString +END +GO +-- Display the status +IF (@@Error = 0) PRINT 'ScalerFunction [vefn_FixSearchStringByWord] Succeeded' +ELSE PRINT 'ScalerFunction [vefn_FixSearchStringByWord] Error on Creation' +go + +IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[vefn_SiblingAndChildrenItemsNewByWord]') AND OBJECTPROPERTY(id,N'IsTableFunction') = 1) + DROP FUNCTION [vefn_SiblingAndChildrenItemsNewByWord]; +GO +/* +select Text from vefn_SiblingAndChildrenItemsNewByWord('194','','%[^a-z]red[^a-z]%', '%[^a-z]red[^a-z]%','') +select Text from vefn_SiblingAndChildrenItemsNewByWord('194','','%[^a-zA-Z]step 25[^0-9a-zA-Z.vbpi:\\-]%','%[^a-zA-Z]step 25[^0-9a-zA-Z.vbpi:\\-]%','') +*/ +/***************************************************************************** + Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE + Copyright 2020 - Volian Enterprises, Inc. All rights reserved. +*****************************************************************************/ +CREATE FUNCTION [dbo].[vefn_SiblingAndChildrenItemsNewByWord](@DocVersionList varchar(MAX),@UnitPrefix varchar(MAX),@SearchString varchar(MAX),@SearchStringx varchar(MAX), @StepTypeList varchar(MAX)) +RETURNS @SiblingAndChildren TABLE +( + [ILastChanged] varbinary(8) + , [ItemID] int PRIMARY KEY + , [DVPath] nvarchar(max) + , [Path] nvarchar(max) + , [FromType] int + , [Ordinal] int + , [ParentID] int + , [PreviousID] int + , [ContentID] int + , [DTS] datetime + , [UserID] nvarchar(100) + , [pContentID] int + , [pDTS] datetime + , [pUserID] nvarchar(100) + , [IsRNO] int + , Text nvarchar(max) + , DocAscii nvarchar(max) + , Number nvarchar(256) + , CType int + , CFormatID int + , CConfig nvarchar(max) + , CDTS datetime + , CUserID nvarchar(100) + , CLastChanged varbinary(8) + , PLastChanged varbinary(8) +) +WITH EXECUTE AS OWNER +AS +BEGIN +Declare @Delim char(1) +Set @Delim=char(7) +Declare @DelimNumber char(1) +Set @DelimNumber=char(17) +Declare @DelimStep char(1) +Set @DelimStep='.' +declare @TextPrefix nvarchar(1) +declare @TextSuffix nvarchar(1) +set @TextPrefix = '' +set @TextSuffix = '' +if (@SearchString like '[%]%') set @TextPrefix = '~' +if (@SearchString like '%[%]') set @TextSuffix = '~' +BEGIN +with Itemz([ILastChanged], [ItemID], VersionID,[Path], [FromType],[Ordinal], [ParentID], [PreviousID], [ContentID], [DTS], [UserID],[pContentID], + [pDTS],[pUserID],[IsRNO], Text, Number, PPath, CType, CFormatID, CConfig, CDTS, CUserID, CLastChanged, PLastChanged) as ( + Select Cast(I.LastChanged as varbinary(8)) ILastChanged,[I].[ItemID], VersionID, + Cast(Case when C.Type < 20000 then @Delim + @UnitPrefix + Isnull(C.Number,'') + @DelimNumber + Isnull(C.Text,'') else '1' end as nvarchar(max)) [Path] + , 0 [FromType], 0 [Ordinal], 0 [ParentID], [PreviousID],[I].[ContentID],[I].[DTS],[I].[UserID] + ,0 [pContentID],[I].[DTS] [pDTS], [I].[UserID] [pUserID],0 IsRNO, C.Text, C.Number, + Cast('' as nvarchar(max)) [PPath], C.Type CType, C.FormatID CFormatID, C.Config CConfig, C.Dts CDTS,C.UserID CUSERID, + Cast(C.LastChanged as varbinary(8)) CLastChanged, Cast(0 as varbinary(8)) PLastChanged + FROM [Items] I + Join Contents C on C.ContentID=I.ContentID + JOIN vefn_DocVersionSplit(@DocVersionList) DV + ON I.[ItemID] = DV.[ItemID] +Union All +-- Children + select Cast(I.LastChanged as varbinary(8)) ILastChanged,I.[ItemID], VersionID, + Path + case C.Type/10000 + when 0 then @Delim + @UnitPrefix + Isnull(C.Number,'') + @DelimNumber + Isnull(C.Text,'') -- Procedure + when 1 then @Delim + Isnull(C.Number,'') + @DelimNumber + Isnull(C.Text,'') -- Section + else + case P.FromType + --when 1 then 'PRC' + @Delim + cast(1 as varchar(4)) + --when 2 then 'SEC' + @Delim + cast(1 as varchar(4)) + when 3 then @DelimStep +'Caution' + @DelimStep + cast(1 as varchar(4)) + when 4 then @DelimStep +'Note' + @DelimStep + cast(1 as varchar(4)) + when 5 then @DelimStep +'RNO' + @DelimStep + when 7 then @DelimStep +'Table' + @DelimStep + cast(1 as varchar(4)) + when 8 then @DelimStep +'SupInfo' + @DelimStep + else case when Z.FromType < 3 then @Delim else @DelimStep end + cast(1 as varchar(4)) + end end Path, + P.[FromType],0 [Ordinal], Z.ItemID [ParentID],I.[PreviousID], I.[ContentID],I.[DTS],I.[UserID], + P.[ContentID] [pContentID],P.[DTS] [pDTS],P.[UserID] [pUserID], + case when P.FromType = 5 then -1 else 0 end IsRNO, + C.Text,c.Number, + Path + case C.Type/10000 + when 2 then + case P.FromType + when 3 then @DelimStep + 'Caution' + when 4 then @DelimStep + 'Note' + when 8 then @DelimStep + 'SupInfo' + else '' end + else '' end [PPath], C.Type CType, C.FormatID CFormatID, C.Config CConfig, C.Dts CDTS,C.UserID CUSERID, + Cast(C.LastChanged as varbinary(8)) CLastChanged, Cast(P.LastChanged as varbinary(8)) PLastChanged + from Itemz Z + join Parts P on P.ContentID = Z.ContentID + join Items I on I.ItemID = P.ItemID + join Contents C on C.ContentID = I.ContentID + Union All +-- Siblings + select Cast(I.LastChanged as varbinary(8)) ILastChanged,I.[ItemID], VersionID, PPath + case C.Type/10000 + when 0 then @Delim + @UnitPrefix + Isnull(C.Number,'') + @DelimNumber + Isnull(C.Text,'') -- Procedure + when 1 then @Delim + Isnull(C.Number,'') + @DelimNumber + Isnull(C.Text,'') -- Section + else case when .dbo.vefn_GetLastDelim(Path) = '.' then @DelimStep else @Delim end + cast(Ordinal + 2 as varchar(4)) + end Path, + [FromType],Z.[Ordinal] +1,Z.[ParentID], I.[PreviousID], I.[ContentID],I.[DTS],I.[UserID] + ,null,null,null, + 0 IsRNO, + C.Text, C.Number, + PPath, C.Type CType, C.FormatID CFormatID, C.Config CConfig, C.Dts CDTS,C.UserID CUSERID, + Cast(C.LastChanged as varbinary(8)) CLastChanged, Cast(0 as varbinary(8)) PLastChanged + from Itemz Z + join Items I on I.PreviousID = Z.ItemID + join Contents C on C.ContentID = I.ContentID + --where Z.[Level] > 0 +) + +insert into @SiblingAndChildren +select ZZ.ILastChanged,ZZ.[ItemID], dvpath, [Path],[FromType],[Ordinal], [ParentID], [PreviousID],ZZ.[ContentID],ZZ.[DTS],ZZ.[UserID], + [pContentID],[pDTS],[pUserID],[IsRNO],Text,DocAscii, Number, CType, CFormatID, CConfig, CDTS, CUserID, CLastChanged, PLastChanged + From Itemz ZZ + join vefn_DocVersionSplit(@DocVersionList) DV ON DV.VersionID=zz.VersionID + Left Join Entries EE ON EE.ContentID=ZZ.ContentID + Left Join Documents DD ON DD.DocID = ee.DocID + where (@TextPrefix+text+@TextSuffix like @SearchString OR Replace(DD.DocAscii,nchar(176),'\''B0') like @SearchString or @TextPrefix+text+@TextSuffix like @SearchStringx OR + Replace(DD.DocAscii,nchar(176),'\''B0') like @SearchStringx ) + and (isnull(@StepTypeList,'') = '' or (dbo.vefn_AllSections(CType) in (Select ID from vefn_SplitInt(@StepTypeList,',')))) + OPTION (MAXRECURSION 10000) +END +RETURN +END +GO + +IF (@@Error = 0) PRINT 'Function: vefn_SiblingAndChildrenItemsNewByWord Succeeded' +ELSE PRINT 'Function: vefn_SiblingAndChildrenItemsNewByWord Error on Creation' +GO + +IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[vesp_SearchItemAndChildrenNewByWord]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1) +DROP PROCEDURE [vesp_SearchItemAndChildrenNewByWord]; +GO +/* +exec vesp_SearchItemAndChildrenNewByWord '194','','red',0,0,0,0,'','[^a-z]','[^a-z]' +exec vesp_SearchItemAndChildrenNewByWord '194','','0%',0,0,0,0,'','[^0-9A-Z.vbpi:\\-]','' +exec vesp_SearchItemAndChildrenNewByWord '194','','10%',0,0,0,0,'','[^0-9A-Z.vbpi:\\-]','' +exec vesp_SearchItemAndChildrenNewByWord '194','','25%',0,0,0,0,'','[^0-9A-Z.vbpi:\\-]','[^0-9A-Z.vbpi:\\-]' +exec vesp_SearchItemAndChildrenNewByWord '194','','25%',0,0,0,0,'','','[^0-9A-Z.vbpi:\\-]' +exec vesp_SearchItemAndChildrenNewByWord '194','','25%',0,0,0,0,'','[^0-9A-Z.vbpi:\\-]','' +exec vesp_SearchItemAndChildrenNewByWord '194','','step 25',0,0,0,1,'','[^a-zA-Z]','[^0-9a-zA-Z.vbpi:\\-]' +exec vesp_SearchItemAndChildrenNewByWord '194','','25',0,0,0,0,'','','' +*/ + +/***************************************************************************** + Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE + Copyright 2020 - Volian Enterprises, Inc. All rights reserved. +*****************************************************************************/ +CREATE PROCEDURE [dbo].[vesp_SearchItemAndChildrenNewByWord] (@DocVersionList varchar(MAX), @StepTypeList varchar(MAX), +@SearchString varchar(MAX), @CaseSensitive as int, @IncludeLinks as int, @IncludeRtfFormatting as int, @IncludeSpecialCharacters as int, @UnitPrefix as varchar(MAX), +@ByWordPrefix varchar(64), @ByWordSuffix varchar(64)) +WITH EXECUTE AS OWNER +AS +Set @SearchString = .dbo.vefn_FixSearchStringByWord(@SearchString, @ByWordPrefix, @ByWordSuffix) +declare @TextPrefix nvarchar(1) +declare @TextSuffix nvarchar(1) +set @TextPrefix = '' +set @TextSuffix = '' +if (@SearchString like '[%]%') set @TextPrefix = '~' +if (@SearchString like '%[%]') set @TextSuffix = '~' +Declare @SearchStringx nvarchar(200) +set @SearchStringx = replace(@SearchString,'\u8209?','-') --JSJ B2016-209 not finding dashes in Word sections (FixSearchString converts '-' to '\u8209?') +if (@IncludeLinks + @IncludeRtfFormatting + @IncludeSpecialCharacters = 0) +begin +if (@CaseSensitive = 0) +Begin + select ZZ.DvPath, ZZ.Path, ZZ.[FromType],ZZ.[Ordinal], ZZ.[ParentID], ZZ.[ItemID],ZZ.[PreviousID],ZZ.[ContentID],ZZ.[DTS],ZZ.[UserID] + ,ZZ.[ILastChanged] + ,ZZ.[Number],ZZ.[Text],ZZ.[CType] [Type],ZZ.[CFormatID] [FormatID],ZZ.[CConfig] [Config],ZZ.[CDTS] ,ZZ.[CUserID] + ,ZZ.[cLastChanged], + zz.[pContentID], ZZ.[pDTS],ZZ.[pUserID], ZZ.[pLastChanged], + (SELECT COUNT(*) FROM [Annotations] WHERE [Annotations].[ItemID]=ZZ.[ItemID]) [AnnotationCount], + (SELECT COUNT(*) FROM [DocVersions] WHERE [DocVersions].[ItemID]=ZZ.[ItemID]) [DocVersionCount], + (SELECT COUNT(*) FROM [Items] [Next] WHERE [Next].[PreviousID]=ZZ.[ItemID]) [NextCount], + (SELECT COUNT(*) FROM [Parts] WHERE [Parts].[ItemID]=ZZ.[ItemID]) [PartCount], + (SELECT COUNT(*) FROM [Transitions] WHERE [Transitions].[RangeID]=ZZ.[ItemID]) [Transition_RangeIDCount], + (SELECT COUNT(*) FROM [Transitions] WHERE [Transitions].[ToID]=ZZ.[ItemID]) [Transition_ToIDCount], + (SELECT COUNT(*) FROM [Details] WHERE [Details].[ContentID]=ZZ.[ContentID]) [DetailCount], + (SELECT COUNT(*) FROM [Entries] WHERE [Entries].[ContentID]=ZZ.[ContentID]) [EntryCount], + (SELECT COUNT(*) FROM [Grids] WHERE [Grids].[ContentID]=ZZ.[ContentID]) [GridCount], + (SELECT COUNT(*) FROM [Images] WHERE [Images].[ContentID]=ZZ.[ContentID]) [ImageCount], + (SELECT COUNT(*) FROM [Items] WHERE [Items].[ContentID]=ZZ.[ContentID]) [ItemCount], + (SELECT COUNT(*) FROM [Parts] WHERE [Parts].[ContentID]=ZZ.[ContentID]) [cPartCount], + (SELECT COUNT(*) FROM [RoUsages] WHERE [RoUsages].[ContentID]=ZZ.[ContentID]) [RoUsageCount], + (SELECT COUNT(*) FROM [Transitions] WHERE [Transitions].[FromID]=ZZ.[ContentID]) [TransitionCount], + (SELECT COUNT(*) FROM [ZContents] WHERE [ZContents].[ContentID]=ZZ.[ContentID]) [ZContentCount] +from vefn_SiblingAndChildrenItemsNewByWord(@DocVersionList, @UnitPrefix, @SearchString, @SearchStringx,@StepTypeList) ZZ + --Join Items II on ZZ.ItemID=II.ItemID + --Left Join Parts PP on ZZ.PContentID=PP.ContentID and ZZ.FromType = PP.FromType + --Join Contents CC on CC.ContentID=ZZ.ContentID +--where ZZ.Text like @SearchString or zz.text like @SearchStringx-- ZZ.ContentID in (select ContentID from vefn_FindText(@DocVersionList,@SearchString,@CaseSensitive,@IncludeLinks,@IncludeRtfFormatting,@IncludeSpecialCharacters,@StepTypeList)) + order by DvPath + end + else + begin + + select ZZ.DvPath, ZZ.Path, ZZ.[FromType],ZZ.[Ordinal], ZZ.[ParentID], ZZ.[ItemID],ZZ.[PreviousID],ZZ.[ContentID],ZZ.[DTS],ZZ.[UserID] + ,ZZ.[ILastChanged] + ,ZZ.[Number],ZZ.[Text],ZZ.[CType] [Type],ZZ.[CFormatID] [FormatID],ZZ.[CConfig] [Config],ZZ.[CDTS] ,ZZ.[CUserID] + ,ZZ.[cLastChanged], + zz.[pContentID], ZZ.[pDTS],ZZ.[pUserID], ZZ.[pLastChanged], + (SELECT COUNT(*) FROM [Annotations] WHERE [Annotations].[ItemID]=ZZ.[ItemID]) [AnnotationCount], + (SELECT COUNT(*) FROM [DocVersions] WHERE [DocVersions].[ItemID]=ZZ.[ItemID]) [DocVersionCount], + (SELECT COUNT(*) FROM [Items] [Next] WHERE [Next].[PreviousID]=ZZ.[ItemID]) [NextCount], + (SELECT COUNT(*) FROM [Parts] WHERE [Parts].[ItemID]=ZZ.[ItemID]) [PartCount], + (SELECT COUNT(*) FROM [Transitions] WHERE [Transitions].[RangeID]=ZZ.[ItemID]) [Transition_RangeIDCount], + (SELECT COUNT(*) FROM [Transitions] WHERE [Transitions].[ToID]=ZZ.[ItemID]) [Transition_ToIDCount], + (SELECT COUNT(*) FROM [Details] WHERE [Details].[ContentID]=ZZ.[ContentID]) [DetailCount], + (SELECT COUNT(*) FROM [Entries] WHERE [Entries].[ContentID]=ZZ.[ContentID]) [EntryCount], + (SELECT COUNT(*) FROM [Grids] WHERE [Grids].[ContentID]=ZZ.[ContentID]) [GridCount], + (SELECT COUNT(*) FROM [Images] WHERE [Images].[ContentID]=ZZ.[ContentID]) [ImageCount], + (SELECT COUNT(*) FROM [Items] WHERE [Items].[ContentID]=ZZ.[ContentID]) [ItemCount], + (SELECT COUNT(*) FROM [Parts] WHERE [Parts].[ContentID]=ZZ.[ContentID]) [cPartCount], + (SELECT COUNT(*) FROM [RoUsages] WHERE [RoUsages].[ContentID]=ZZ.[ContentID]) [RoUsageCount], + (SELECT COUNT(*) FROM [Transitions] WHERE [Transitions].[FromID]=ZZ.[ContentID]) [TransitionCount], + (SELECT COUNT(*) FROM [ZContents] WHERE [ZContents].[ContentID]=ZZ.[ContentID]) [ZContentCount] +from vefn_SiblingAndChildrenItemsNewByWord(@DocVersionList, @UnitPrefix, @SearchString, @SearchStringx,@StepTypeList) ZZ + --Join Items II on ZZ.ItemID=II.ItemID + --Left Join Parts PP on ZZ.PContentID=PP.ContentID and ZZ.FromType = PP.FromType + --Join Contents CC on CC.ContentID=ZZ.ContentID +--where ZZ.Text like @SearchString or zz.text like @SearchStringx-- ZZ.ContentID in (select ContentID from vefn_FindText(@DocVersionList,@SearchString,@CaseSensitive,@IncludeLinks,@IncludeRtfFormatting,@IncludeSpecialCharacters,@StepTypeList)) +--where zz.text Collate SQL_Latin1_General_CP1_CS_AS like @SearchString or +--zz.text Collate SQL_Latin1_General_CP1_CS_AS like @SearchStringx or +where @TextPrefix+zz.text+@TextSuffix Collate SQL_Latin1_General_CP1_CS_AS like @SearchString or +@TextPrefix+zz.text+@TextSuffix Collate SQL_Latin1_General_CP1_CS_AS like @SearchStringx or +-- docascii are the word sections +Replace(zz.DocAscii,nchar(176),'\''B0') Collate SQL_Latin1_General_CP1_CS_AS like @SearchString or +Replace(zz.DocAscii,nchar(176),'\''B0') Collate SQL_Latin1_General_CP1_CS_AS like @SearchStringx + order by DvPath + end + end -- no links + else +begin -- include linked text +if (@CaseSensitive = 0) +Begin + select ZZ.DvPath, ZZ.Path, ZZ.[FromType],ZZ.[Ordinal], ZZ.[ParentID], ZZ.[ItemID],ZZ.[PreviousID],ZZ.[ContentID],ZZ.[DTS],ZZ.[UserID] + ,ZZ.[ILastChanged] + ,ZZ.[Number],ZZ.[Text],ZZ.[CType] [Type],ZZ.[CFormatID] [FormatID],ZZ.[CConfig] [Config],ZZ.[CDTS] ,ZZ.[CUserID] + ,ZZ.[cLastChanged], + zz.[pContentID], ZZ.[pDTS],ZZ.[pUserID], ZZ.[pLastChanged], + (SELECT COUNT(*) FROM [Annotations] WHERE [Annotations].[ItemID]=ZZ.[ItemID]) [AnnotationCount], + (SELECT COUNT(*) FROM [DocVersions] WHERE [DocVersions].[ItemID]=ZZ.[ItemID]) [DocVersionCount], + (SELECT COUNT(*) FROM [Items] [Next] WHERE [Next].[PreviousID]=ZZ.[ItemID]) [NextCount], + (SELECT COUNT(*) FROM [Parts] WHERE [Parts].[ItemID]=ZZ.[ItemID]) [PartCount], + (SELECT COUNT(*) FROM [Transitions] WHERE [Transitions].[RangeID]=ZZ.[ItemID]) [Transition_RangeIDCount], + (SELECT COUNT(*) FROM [Transitions] WHERE [Transitions].[ToID]=ZZ.[ItemID]) [Transition_ToIDCount], + (SELECT COUNT(*) FROM [Details] WHERE [Details].[ContentID]=ZZ.[ContentID]) [DetailCount], + (SELECT COUNT(*) FROM [Entries] WHERE [Entries].[ContentID]=ZZ.[ContentID]) [EntryCount], + (SELECT COUNT(*) FROM [Grids] WHERE [Grids].[ContentID]=ZZ.[ContentID]) [GridCount], + (SELECT COUNT(*) FROM [Images] WHERE [Images].[ContentID]=ZZ.[ContentID]) [ImageCount], + (SELECT COUNT(*) FROM [Items] WHERE [Items].[ContentID]=ZZ.[ContentID]) [ItemCount], + (SELECT COUNT(*) FROM [Parts] WHERE [Parts].[ContentID]=ZZ.[ContentID]) [cPartCount], + (SELECT COUNT(*) FROM [RoUsages] WHERE [RoUsages].[ContentID]=ZZ.[ContentID]) [RoUsageCount], + (SELECT COUNT(*) FROM [Transitions] WHERE [Transitions].[FromID]=ZZ.[ContentID]) [TransitionCount], + (SELECT COUNT(*) FROM [ZContents] WHERE [ZContents].[ContentID]=ZZ.[ContentID]) [ZContentCount] +from vefn_SiblingAndChildrenItemsNewByWord(@DocVersionList, @UnitPrefix, @SearchString, @SearchStringx,@StepTypeList) ZZ + --Join Items II on ZZ.ItemID=II.ItemID + --Left Join Parts PP on ZZ.PContentID=PP.ContentID and ZZ.FromType = PP.FromType + --Join Contents CC on CC.ContentID=ZZ.ContentID +--where ZZ.Text like @SearchString or zz.text like @SearchStringx-- ZZ.ContentID in (select ContentID from vefn_FindText(@DocVersionList,@SearchString,@CaseSensitive,@IncludeLinks,@IncludeRtfFormatting,@IncludeSpecialCharacters,@StepTypeList)) +where .dbo.vefn_RemoveExtraText(@TextPrefix+zz.text+@TextSuffix,@IncludeLinks, @IncludeRtfFormatting, @IncludeSpecialCharacters) Collate SQL_Latin1_General_CP1_CI_AS like @SearchString or +.dbo.vefn_RemoveExtraText(@TextPrefix+zz.text+@TextSuffix,@IncludeLinks, @IncludeRtfFormatting, @IncludeSpecialCharacters) Collate SQL_Latin1_General_CP1_CI_AS like @SearchStringx or +-- docascii are the word sections +Replace(zz.DocAscii,nchar(176),'\''B0') Collate SQL_Latin1_General_CP1_CI_AS like @SearchString or +Replace(zz.DocAscii,nchar(176),'\''B0') Collate SQL_Latin1_General_CP1_CI_AS like @SearchStringx + order by DvPath + end + else -- case sensitive + begin + select ZZ.DvPath, ZZ.Path, ZZ.[FromType],ZZ.[Ordinal], ZZ.[ParentID], ZZ.[ItemID],ZZ.[PreviousID],ZZ.[ContentID],ZZ.[DTS],ZZ.[UserID] + ,ZZ.[ILastChanged] + ,ZZ.[Number],ZZ.[Text],ZZ.[CType] [Type],ZZ.[CFormatID] [FormatID],ZZ.[CConfig] [Config],ZZ.[CDTS] ,ZZ.[CUserID] + ,ZZ.[cLastChanged], + zz.[pContentID], ZZ.[pDTS],ZZ.[pUserID], ZZ.[pLastChanged], + (SELECT COUNT(*) FROM [Annotations] WHERE [Annotations].[ItemID]=ZZ.[ItemID]) [AnnotationCount], + (SELECT COUNT(*) FROM [DocVersions] WHERE [DocVersions].[ItemID]=ZZ.[ItemID]) [DocVersionCount], + (SELECT COUNT(*) FROM [Items] [Next] WHERE [Next].[PreviousID]=ZZ.[ItemID]) [NextCount], + (SELECT COUNT(*) FROM [Parts] WHERE [Parts].[ItemID]=ZZ.[ItemID]) [PartCount], + (SELECT COUNT(*) FROM [Transitions] WHERE [Transitions].[RangeID]=ZZ.[ItemID]) [Transition_RangeIDCount], + (SELECT COUNT(*) FROM [Transitions] WHERE [Transitions].[ToID]=ZZ.[ItemID]) [Transition_ToIDCount], + (SELECT COUNT(*) FROM [Details] WHERE [Details].[ContentID]=ZZ.[ContentID]) [DetailCount], + (SELECT COUNT(*) FROM [Entries] WHERE [Entries].[ContentID]=ZZ.[ContentID]) [EntryCount], + (SELECT COUNT(*) FROM [Grids] WHERE [Grids].[ContentID]=ZZ.[ContentID]) [GridCount], + (SELECT COUNT(*) FROM [Images] WHERE [Images].[ContentID]=ZZ.[ContentID]) [ImageCount], + (SELECT COUNT(*) FROM [Items] WHERE [Items].[ContentID]=ZZ.[ContentID]) [ItemCount], + (SELECT COUNT(*) FROM [Parts] WHERE [Parts].[ContentID]=ZZ.[ContentID]) [cPartCount], + (SELECT COUNT(*) FROM [RoUsages] WHERE [RoUsages].[ContentID]=ZZ.[ContentID]) [RoUsageCount], + (SELECT COUNT(*) FROM [Transitions] WHERE [Transitions].[FromID]=ZZ.[ContentID]) [TransitionCount], + (SELECT COUNT(*) FROM [ZContents] WHERE [ZContents].[ContentID]=ZZ.[ContentID]) [ZContentCount] +from vefn_SiblingAndChildrenItemsNewByWord(@DocVersionList, @UnitPrefix, @SearchString, @SearchStringx,@StepTypeList) ZZ + --Join Items II on ZZ.ItemID=II.ItemID + --Left Join Parts PP on ZZ.PContentID=PP.ContentID and ZZ.FromType = PP.FromType + --Join Contents CC on CC.ContentID=ZZ.ContentID +--where ZZ.Text like @SearchString or zz.text like @SearchStringx-- ZZ.ContentID in (select ContentID from vefn_FindText(@DocVersionList,@SearchString,@CaseSensitive,@IncludeLinks,@IncludeRtfFormatting,@IncludeSpecialCharacters,@StepTypeList)) +-- +where .dbo.vefn_RemoveExtraText(replace(@TextPrefix+zz.text+@TextSuffix,'\''b0', '\''B0'),@IncludeLinks, @IncludeRtfFormatting, @IncludeSpecialCharacters) Collate SQL_Latin1_General_CP1_CS_AS like replace(@SearchString,'\''b0', '\''B0') or +.dbo.vefn_RemoveExtraText(replace(@TextPrefix+zz.text+@TextSuffix,'\''b0', '\''B0'),@IncludeLinks, @IncludeRtfFormatting, @IncludeSpecialCharacters) Collate SQL_Latin1_General_CP1_CS_AS like replace(@SearchStringx,'\''b0', '\''B0') or +-- docascii are the word sections +Replace(zz.DocAscii,nchar(176),'\''B0') Collate SQL_Latin1_General_CP1_CS_AS like @SearchString or +Replace(zz.DocAscii,nchar(176),'\''B0') Collate SQL_Latin1_General_CP1_CS_AS like @SearchStringx + order by DvPath + end + end -- include links + GO +IF (@@Error = 0) PRINT 'Procedure Creation: vesp_SearchItemAndChildrenNewByWord Succeeded' +ELSE PRINT 'Procedure Creation: vesp_SearchItemAndChildrenNewByWord Error on Creation' +GO ----------------------------------------------------------------------------- /* @@ -15511,8 +15875,8 @@ BEGIN TRY -- Try Block set nocount on DECLARE @RevDate varchar(255) DECLARE @RevDescription varchar(255) - set @RevDate = '01/09/2020 11:00 AM' - set @RevDescription = 'Referenced Object data in sql server' + set @RevDate = '05/04/2020 10:00 AM' + set @RevDescription = 'Allow Search By Word' Select cast(@RevDate as datetime) RevDate, @RevDescription RevDescription PRINT 'SQL Code Revision ' + @RevDate + ' - ' + @RevDescription IF( @@TRANCOUNT > 0 ) COMMIT diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs index 072e41c8..874baf84 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs @@ -6021,11 +6021,11 @@ namespace VEPROMS.CSLA.Library #endregion // EnhancedGetMissingEnh #endregion // EnhancedSupport #region Text Search - public static ItemInfoList GetListFromTextSearch(string docVersionList, string stepTypeList, string searchString, int caseSensitive, ItemSearchIncludeLinks includeLinks, bool includeRtfFormatting, bool includeSpecialCharacters, string unitPrefix) + public static ItemInfoList GetListFromTextSearch(string docVersionList, string stepTypeList, string searchString, int caseSensitive, ItemSearchIncludeLinks includeLinks, bool includeRtfFormatting, bool includeSpecialCharacters, string unitPrefix, string byWordPrefix, string byWordSuffix) { try { - ItemInfoList tmp = DataPortal.Fetch(new ItemListSearchCriteria(docVersionList, stepTypeList, searchString, caseSensitive, includeLinks, includeRtfFormatting, includeSpecialCharacters, unitPrefix)); + ItemInfoList tmp = DataPortal.Fetch(new ItemListSearchCriteria(docVersionList, stepTypeList, searchString, caseSensitive, includeLinks, includeRtfFormatting, includeSpecialCharacters, unitPrefix, byWordPrefix, byWordSuffix)); tmp.SourceOfList = "Search"; ItemInfo.AddList(tmp); tmp.AddEvents(); @@ -6088,8 +6088,25 @@ namespace VEPROMS.CSLA.Library get { return _UnitPrefix; } set { _UnitPrefix = value; } } + // C2020-009: Search - Allow search 'By Word'. + // Prefix & Suffix are sql expression to use before/after search string, they limit for alpha or numeric before/after + // the search string. These are set in Volian.Controls.Library.DisplaySearch.cs + private string _ByWordPrefix; + public string ByWordPrefix + { + get { return _ByWordPrefix; } + set { _ByWordPrefix = value; } + } + private string _ByWordSuffix; + + public string ByWordSuffix + { + get { return _ByWordSuffix; } + set { _ByWordSuffix = value; } + } public ItemListSearchCriteria(string docVersionList, string stepTypeList, string searchString, - int caseSensitive, ItemSearchIncludeLinks includeLinks, bool includeRtfFormatting, bool includeSpecialCharacters, string unitPrefix) + int caseSensitive, ItemSearchIncludeLinks includeLinks, bool includeRtfFormatting, bool includeSpecialCharacters, + string unitPrefix, string byWordPrefix, string byWordSuffix) { _DocVersionList = docVersionList; _StepTypeList = stepTypeList; @@ -6099,6 +6116,8 @@ namespace VEPROMS.CSLA.Library _IncludeRtfFormatting = includeRtfFormatting; _IncludeSpecialCharacters = includeSpecialCharacters; _UnitPrefix = unitPrefix; + _ByWordPrefix = byWordPrefix; + _ByWordSuffix = byWordSuffix; } } private void DataPortal_Fetch(ItemListSearchCriteria criteria) @@ -6111,7 +6130,7 @@ namespace VEPROMS.CSLA.Library using (SqlCommand cm = cn.CreateCommand()) { cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "vesp_SearchItemAndChildrenNew"; + cm.CommandText = "vesp_SearchItemAndChildrenNewByWord"; cm.Parameters.AddWithValue("@DocVersionList", criteria.DocVersionList); cm.Parameters.AddWithValue("@StepTypeList", criteria.StepTypeList); cm.Parameters.AddWithValue("@SearchString", criteria.SearchString); @@ -6120,6 +6139,8 @@ namespace VEPROMS.CSLA.Library cm.Parameters.AddWithValue("@IncludeRtfFormatting", criteria.IncludeRtfFormatting ? 1 : 0); cm.Parameters.AddWithValue("@IncludeSpecialCharacters", criteria.IncludeSpecialCharacters ? 1 : 0); cm.Parameters.AddWithValue("@UnitPrefix", criteria.UnitPrefix); + cm.Parameters.AddWithValue("@ByWordPrefix", criteria.ByWordPrefix); + cm.Parameters.AddWithValue("@ByWordSuffix", criteria.ByWordSuffix); cm.CommandTimeout = Database.DefaultTimeout; using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) { diff --git a/PROMS/Volian.Controls.Library/DisplaySearch.Designer.cs b/PROMS/Volian.Controls.Library/DisplaySearch.Designer.cs index 78385e52..9173e078 100644 --- a/PROMS/Volian.Controls.Library/DisplaySearch.Designer.cs +++ b/PROMS/Volian.Controls.Library/DisplaySearch.Designer.cs @@ -50,24 +50,25 @@ namespace Volian.Controls.Library this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DisplaySearch)); this.tabSearchTypes = new DevComponents.DotNetBar.TabControl(); - this.tabControlPanel2 = new DevComponents.DotNetBar.TabControlPanel(); - this.gpFindROs = new DevComponents.DotNetBar.Controls.GroupPanel(); - this.lblSrchRoMsg = new DevComponents.DotNetBar.LabelX(); - this.cbxFndUnLnkROVals = new DevComponents.DotNetBar.Controls.CheckBoxX(); - this.cmboTreeROs = new DevComponents.DotNetBar.Controls.ComboTree(); - this.tabROSearch = new DevComponents.DotNetBar.TabItem(this.components); this.tabControlPanel4 = new DevComponents.DotNetBar.TabControlPanel(); this.gpSrchText = new DevComponents.DotNetBar.Controls.GroupPanel(); this.panel1 = new System.Windows.Forms.Panel(); this.cbxTextSearchText = new DevComponents.DotNetBar.Controls.ComboBoxEx(); this.label1 = new System.Windows.Forms.Label(); this.panel3 = new System.Windows.Forms.Panel(); + this.cbxByWord = new DevComponents.DotNetBar.Controls.CheckBoxX(); this.cbxBooleanTxtSrch = new DevComponents.DotNetBar.Controls.CheckBoxX(); this.cbxIncROTextSrch = new DevComponents.DotNetBar.Controls.CheckBoxX(); this.cbxCaseSensitive = new DevComponents.DotNetBar.Controls.CheckBoxX(); this.rbtnSrchTxt = new DevComponents.DotNetBar.Controls.CheckBoxX(); this.cbxSrchTypeUsage = new DevComponents.DotNetBar.Controls.CheckBoxX(); this.tabStepTypeSearch = new DevComponents.DotNetBar.TabItem(this.components); + this.tabControlPanel2 = new DevComponents.DotNetBar.TabControlPanel(); + this.gpFindROs = new DevComponents.DotNetBar.Controls.GroupPanel(); + this.lblSrchRoMsg = new DevComponents.DotNetBar.LabelX(); + this.cbxFndUnLnkROVals = new DevComponents.DotNetBar.Controls.CheckBoxX(); + this.cmboTreeROs = new DevComponents.DotNetBar.Controls.ComboTree(); + this.tabROSearch = new DevComponents.DotNetBar.TabItem(this.components); this.tabControlPanel5 = new DevComponents.DotNetBar.TabControlPanel(); this.pnlTranCategory = new System.Windows.Forms.Panel(); this.cbxTranCategory = new DevComponents.DotNetBar.Controls.ComboBoxEx(); @@ -138,12 +139,12 @@ namespace Volian.Controls.Library this.superTooltip1 = new DevComponents.DotNetBar.SuperTooltip(); ((System.ComponentModel.ISupportInitialize)(this.tabSearchTypes)).BeginInit(); this.tabSearchTypes.SuspendLayout(); - this.tabControlPanel2.SuspendLayout(); - this.gpFindROs.SuspendLayout(); this.tabControlPanel4.SuspendLayout(); this.gpSrchText.SuspendLayout(); this.panel1.SuspendLayout(); this.panel3.SuspendLayout(); + this.tabControlPanel2.SuspendLayout(); + this.gpFindROs.SuspendLayout(); this.tabControlPanel5.SuspendLayout(); this.pnlTranCategory.SuspendLayout(); this.pnlTranFormat.SuspendLayout(); @@ -165,10 +166,10 @@ namespace Volian.Controls.Library this.tabSearchTypes.CanReorderTabs = false; this.tabSearchTypes.CloseButtonOnTabsAlwaysDisplayed = false; this.tabSearchTypes.CloseButtonPosition = DevComponents.DotNetBar.eTabCloseButtonPosition.Right; - this.tabSearchTypes.Controls.Add(this.tabControlPanel4); - this.tabSearchTypes.Controls.Add(this.tabControlPanel2); - this.tabSearchTypes.Controls.Add(this.tabControlPanel5); this.tabSearchTypes.Controls.Add(this.tabControlPanel3); + this.tabSearchTypes.Controls.Add(this.tabControlPanel4); + this.tabSearchTypes.Controls.Add(this.tabControlPanel5); + this.tabSearchTypes.Controls.Add(this.tabControlPanel2); this.tabSearchTypes.Controls.Add(this.contextMenuBar1); this.tabSearchTypes.Dock = System.Windows.Forms.DockStyle.Top; this.tabSearchTypes.Location = new System.Drawing.Point(0, 0); @@ -189,6 +190,248 @@ namespace Volian.Controls.Library this.tabSearchTypes.Text = "tabControl1"; this.tabSearchTypes.ThemeAware = true; // + // tabControlPanel4 + // + this.tabControlPanel4.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007; + this.tabControlPanel4.Controls.Add(this.gpSrchText); + this.tabControlPanel4.Controls.Add(this.rbtnSrchTxt); + this.tabControlPanel4.Controls.Add(this.cbxSrchTypeUsage); + this.tabControlPanel4.DisabledBackColor = System.Drawing.Color.Empty; + this.tabControlPanel4.Dock = System.Windows.Forms.DockStyle.Fill; + this.tabControlPanel4.Location = new System.Drawing.Point(0, 24); + this.tabControlPanel4.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.tabControlPanel4.Name = "tabControlPanel4"; + this.tabControlPanel4.Padding = new System.Windows.Forms.Padding(1); + this.tabControlPanel4.Size = new System.Drawing.Size(369, 114); + this.tabControlPanel4.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(253)))), ((int)(((byte)(253)))), ((int)(((byte)(254))))); + this.tabControlPanel4.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(157)))), ((int)(((byte)(188)))), ((int)(((byte)(227))))); + this.tabControlPanel4.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine; + this.tabControlPanel4.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(146)))), ((int)(((byte)(165)))), ((int)(((byte)(199))))); + this.tabControlPanel4.Style.BorderSide = ((DevComponents.DotNetBar.eBorderSide)(((DevComponents.DotNetBar.eBorderSide.Left | DevComponents.DotNetBar.eBorderSide.Right) + | DevComponents.DotNetBar.eBorderSide.Bottom))); + this.tabControlPanel4.Style.GradientAngle = 90; + this.superTooltip1.SetSuperTooltip(this.tabControlPanel4, new DevComponents.DotNetBar.SuperTooltipInfo("Text Search", "", "Enter the text you want to search, or select from the drop down list.\r\n\r\nLeave bl" + + "ank to search for the usage of the selected types in \"Filter By Types\".", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(175, 140))); + this.tabControlPanel4.TabIndex = 4; + this.tabControlPanel4.TabItem = this.tabStepTypeSearch; + // + // gpSrchText + // + this.gpSrchText.CanvasColor = System.Drawing.SystemColors.Control; + this.gpSrchText.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007; + this.gpSrchText.Controls.Add(this.panel1); + this.gpSrchText.Controls.Add(this.panel3); + this.gpSrchText.DisabledBackColor = System.Drawing.Color.Empty; + this.gpSrchText.Dock = System.Windows.Forms.DockStyle.Fill; + this.gpSrchText.Location = new System.Drawing.Point(30, 1); + this.gpSrchText.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.gpSrchText.Name = "gpSrchText"; + this.gpSrchText.Size = new System.Drawing.Size(338, 90); + // + // + // + this.gpSrchText.Style.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; + this.gpSrchText.Style.BackColorGradientAngle = 90; + this.gpSrchText.Style.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; + this.gpSrchText.Style.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid; + this.gpSrchText.Style.BorderBottomWidth = 1; + this.gpSrchText.Style.BorderColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; + this.gpSrchText.Style.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid; + this.gpSrchText.Style.BorderLeftWidth = 1; + this.gpSrchText.Style.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid; + this.gpSrchText.Style.BorderRightWidth = 1; + this.gpSrchText.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid; + this.gpSrchText.Style.BorderTopWidth = 1; + this.gpSrchText.Style.CornerDiameter = 4; + this.gpSrchText.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; + this.gpSrchText.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center; + this.gpSrchText.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText; + this.gpSrchText.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near; + // + // + // + this.gpSrchText.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // + this.gpSrchText.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.gpSrchText.TabIndex = 5; + this.gpSrchText.EnabledChanged += new System.EventHandler(this.gpSrchText_EnabledChanged); + // + // panel1 + // + this.panel1.BackColor = System.Drawing.Color.Transparent; + this.panel1.Controls.Add(this.cbxTextSearchText); + this.panel1.Controls.Add(this.label1); + this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom; + this.panel1.Location = new System.Drawing.Point(0, 2); + this.panel1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(332, 28); + this.panel1.TabIndex = 5; + // + // cbxTextSearchText + // + this.contextMenuBar1.SetContextMenuEx(this.cbxTextSearchText, this.btnCMIFindText); + this.cbxTextSearchText.DisplayMember = "Text"; + this.cbxTextSearchText.Dock = System.Windows.Forms.DockStyle.Fill; + this.cbxTextSearchText.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; + this.cbxTextSearchText.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.cbxTextSearchText.FormattingEnabled = true; + this.cbxTextSearchText.ItemHeight = 16; + this.cbxTextSearchText.Location = new System.Drawing.Point(39, 0); + this.cbxTextSearchText.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.cbxTextSearchText.Name = "cbxTextSearchText"; + this.cbxTextSearchText.Size = new System.Drawing.Size(293, 22); + this.superTooltip1.SetSuperTooltip(this.cbxTextSearchText, new DevComponents.DotNetBar.SuperTooltipInfo("Search for Text", "", resources.GetString("cbxTextSearchText.SuperTooltip"), null, null, DevComponents.DotNetBar.eTooltipColor.Gray)); + this.cbxTextSearchText.TabIndex = 2; + this.cbxTextSearchText.WatermarkFont = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.cbxTextSearchText.WatermarkText = "Enter Search Text Here"; + this.cbxTextSearchText.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.ProcessEnterKey); + this.cbxTextSearchText.Leave += new System.EventHandler(this.cbxTextSearchText_Leave); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.BackColor = System.Drawing.Color.Transparent; + this.label1.Dock = System.Windows.Forms.DockStyle.Left; + this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label1.Location = new System.Drawing.Point(0, 0); + this.label1.Name = "label1"; + this.label1.Padding = new System.Windows.Forms.Padding(0, 6, 0, 0); + this.label1.Size = new System.Drawing.Size(39, 23); + this.superTooltip1.SetSuperTooltip(this.label1, new DevComponents.DotNetBar.SuperTooltipInfo("Search For Text", "", resources.GetString("label1.SuperTooltip"), null, null, DevComponents.DotNetBar.eTooltipColor.Gray)); + this.label1.TabIndex = 4; + this.label1.Text = "Find:"; + // + // panel3 + // + this.panel3.BackColor = System.Drawing.Color.Transparent; + this.panel3.Controls.Add(this.cbxByWord); + this.panel3.Controls.Add(this.cbxBooleanTxtSrch); + this.panel3.Controls.Add(this.cbxIncROTextSrch); + this.panel3.Controls.Add(this.cbxCaseSensitive); + this.panel3.Dock = System.Windows.Forms.DockStyle.Bottom; + this.panel3.Location = new System.Drawing.Point(0, 30); + this.panel3.Margin = new System.Windows.Forms.Padding(4); + this.panel3.Name = "panel3"; + this.panel3.Size = new System.Drawing.Size(332, 54); + this.panel3.TabIndex = 6; + // + // cbxByWord + // + this.cbxByWord.BackColor = System.Drawing.Color.Transparent; + // + // + // + this.cbxByWord.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.cbxByWord.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.cbxByWord.Location = new System.Drawing.Point(142, 7); + this.cbxByWord.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.cbxByWord.Name = "cbxByWord"; + this.cbxByWord.Size = new System.Drawing.Size(74, 18); + this.superTooltip1.SetSuperTooltip(this.cbxByWord, new DevComponents.DotNetBar.SuperTooltipInfo("Case Sensitive", "", "When this box is checked, Search will find only exact matches of the search text " + + "you had entered.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(180, 100))); + this.cbxByWord.TabIndex = 7; + this.cbxByWord.Text = "By Word"; + // + // cbxBooleanTxtSrch + // + // + // + // + this.cbxBooleanTxtSrch.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.cbxBooleanTxtSrch.Location = new System.Drawing.Point(213, 28); + this.cbxBooleanTxtSrch.Margin = new System.Windows.Forms.Padding(4); + this.cbxBooleanTxtSrch.Name = "cbxBooleanTxtSrch"; + this.cbxBooleanTxtSrch.Size = new System.Drawing.Size(115, 18); + this.superTooltip1.SetSuperTooltip(this.cbxBooleanTxtSrch, new DevComponents.DotNetBar.SuperTooltipInfo("Boolean Search", "", resources.GetString("cbxBooleanTxtSrch.SuperTooltip"), null, null, DevComponents.DotNetBar.eTooltipColor.Gray)); + this.cbxBooleanTxtSrch.TabIndex = 6; + this.cbxBooleanTxtSrch.Text = "Boolean Search"; + this.cbxBooleanTxtSrch.Visible = false; + this.cbxBooleanTxtSrch.CheckedChanged += new System.EventHandler(this.cbxBooleanTxtSrch_CheckedChanged); + // + // cbxIncROTextSrch + // + // + // + // + this.cbxIncROTextSrch.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.cbxIncROTextSrch.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.cbxIncROTextSrch.Location = new System.Drawing.Point(12, 28); + this.cbxIncROTextSrch.Margin = new System.Windows.Forms.Padding(4); + this.cbxIncROTextSrch.Name = "cbxIncROTextSrch"; + this.cbxIncROTextSrch.Size = new System.Drawing.Size(225, 15); + this.superTooltip1.SetSuperTooltip(this.cbxIncROTextSrch, new DevComponents.DotNetBar.SuperTooltipInfo("Search RO and Transition Text", "", "When this box is checked, Search will include matches found in RO and Transition " + + "text as well as regular text.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray)); + this.cbxIncROTextSrch.TabIndex = 5; + this.cbxIncROTextSrch.Text = "Search RO and Transition Text"; + // + // cbxCaseSensitive + // + this.cbxCaseSensitive.BackColor = System.Drawing.Color.Transparent; + // + // + // + this.cbxCaseSensitive.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.cbxCaseSensitive.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.cbxCaseSensitive.Location = new System.Drawing.Point(12, 7); + this.cbxCaseSensitive.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.cbxCaseSensitive.Name = "cbxCaseSensitive"; + this.cbxCaseSensitive.Size = new System.Drawing.Size(139, 18); + this.superTooltip1.SetSuperTooltip(this.cbxCaseSensitive, new DevComponents.DotNetBar.SuperTooltipInfo("Case Sensitive", "", "When this box is checked, Search will find only exact matches of the search text " + + "you had entered.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(180, 100))); + this.cbxCaseSensitive.TabIndex = 3; + this.cbxCaseSensitive.Text = "Case Sensitive"; + // + // rbtnSrchTxt + // + this.rbtnSrchTxt.BackColor = System.Drawing.Color.Transparent; + // + // + // + this.rbtnSrchTxt.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.rbtnSrchTxt.CheckBoxStyle = DevComponents.DotNetBar.eCheckBoxStyle.RadioButton; + this.rbtnSrchTxt.Checked = true; + this.rbtnSrchTxt.CheckState = System.Windows.Forms.CheckState.Checked; + this.rbtnSrchTxt.CheckValue = "Y"; + this.rbtnSrchTxt.Dock = System.Windows.Forms.DockStyle.Left; + this.rbtnSrchTxt.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.rbtnSrchTxt.Location = new System.Drawing.Point(1, 1); + this.rbtnSrchTxt.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.rbtnSrchTxt.Name = "rbtnSrchTxt"; + this.rbtnSrchTxt.Size = new System.Drawing.Size(29, 90); + this.rbtnSrchTxt.TabIndex = 6; + this.rbtnSrchTxt.CheckedChanged += new System.EventHandler(this.rbtnSrchTxt_CheckedChanged); + // + // cbxSrchTypeUsage + // + this.cbxSrchTypeUsage.BackColor = System.Drawing.Color.Transparent; + // + // + // + this.cbxSrchTypeUsage.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.cbxSrchTypeUsage.CheckBoxStyle = DevComponents.DotNetBar.eCheckBoxStyle.RadioButton; + this.cbxSrchTypeUsage.Dock = System.Windows.Forms.DockStyle.Bottom; + this.cbxSrchTypeUsage.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.cbxSrchTypeUsage.Location = new System.Drawing.Point(1, 91); + this.cbxSrchTypeUsage.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.cbxSrchTypeUsage.Name = "cbxSrchTypeUsage"; + this.cbxSrchTypeUsage.Size = new System.Drawing.Size(367, 22); + this.superTooltip1.SetSuperTooltip(this.cbxSrchTypeUsage, new DevComponents.DotNetBar.SuperTooltipInfo("Find Selected Step Elements", "", "This option will have Search show you where the selected Step Elements are used.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray)); + this.cbxSrchTypeUsage.TabIndex = 4; + this.cbxSrchTypeUsage.Text = " Find Selected Step Elements"; + this.cbxSrchTypeUsage.CheckedChanged += new System.EventHandler(this.cbxSrchTypeUsage_CheckedChanged); + // + // tabStepTypeSearch + // + this.tabStepTypeSearch.AttachedControl = this.tabControlPanel4; + this.tabStepTypeSearch.Name = "tabStepTypeSearch"; + this.superTooltip1.SetSuperTooltip(this.tabStepTypeSearch, new DevComponents.DotNetBar.SuperTooltipInfo("Search for Text", "", "Allows you to search for entered text in selected procedure sets and within selec" + + "ted procedure text types.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(170, 110))); + this.tabStepTypeSearch.Text = "Text"; + this.tabStepTypeSearch.Click += new System.EventHandler(this.tabStepTypeSearch_Click); + // // tabControlPanel2 // this.tabControlPanel2.Controls.Add(this.gpFindROs); @@ -317,230 +560,6 @@ namespace Volian.Controls.Library this.tabROSearch.Name = "tabROSearch"; this.tabROSearch.Text = "Referenced Objects"; // - // tabControlPanel4 - // - this.tabControlPanel4.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007; - this.tabControlPanel4.Controls.Add(this.gpSrchText); - this.tabControlPanel4.Controls.Add(this.rbtnSrchTxt); - this.tabControlPanel4.Controls.Add(this.cbxSrchTypeUsage); - this.tabControlPanel4.DisabledBackColor = System.Drawing.Color.Empty; - this.tabControlPanel4.Dock = System.Windows.Forms.DockStyle.Fill; - this.tabControlPanel4.Location = new System.Drawing.Point(0, 24); - this.tabControlPanel4.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); - this.tabControlPanel4.Name = "tabControlPanel4"; - this.tabControlPanel4.Padding = new System.Windows.Forms.Padding(1); - this.tabControlPanel4.Size = new System.Drawing.Size(369, 114); - this.tabControlPanel4.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(253)))), ((int)(((byte)(253)))), ((int)(((byte)(254))))); - this.tabControlPanel4.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(157)))), ((int)(((byte)(188)))), ((int)(((byte)(227))))); - this.tabControlPanel4.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine; - this.tabControlPanel4.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(146)))), ((int)(((byte)(165)))), ((int)(((byte)(199))))); - this.tabControlPanel4.Style.BorderSide = ((DevComponents.DotNetBar.eBorderSide)(((DevComponents.DotNetBar.eBorderSide.Left | DevComponents.DotNetBar.eBorderSide.Right) - | DevComponents.DotNetBar.eBorderSide.Bottom))); - this.tabControlPanel4.Style.GradientAngle = 90; - this.superTooltip1.SetSuperTooltip(this.tabControlPanel4, new DevComponents.DotNetBar.SuperTooltipInfo("Text Search", "", "Enter the text you want to search, or select from the drop down list.\r\n\r\nLeave bl" + - "ank to search for the usage of the selected types in \"Filter By Types\".", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(175, 140))); - this.tabControlPanel4.TabIndex = 4; - this.tabControlPanel4.TabItem = this.tabStepTypeSearch; - // - // gpSrchText - // - this.gpSrchText.CanvasColor = System.Drawing.SystemColors.Control; - this.gpSrchText.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007; - this.gpSrchText.Controls.Add(this.panel1); - this.gpSrchText.Controls.Add(this.panel3); - this.gpSrchText.DisabledBackColor = System.Drawing.Color.Empty; - this.gpSrchText.Dock = System.Windows.Forms.DockStyle.Fill; - this.gpSrchText.Location = new System.Drawing.Point(30, 1); - this.gpSrchText.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); - this.gpSrchText.Name = "gpSrchText"; - this.gpSrchText.Size = new System.Drawing.Size(338, 90); - // - // - // - this.gpSrchText.Style.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; - this.gpSrchText.Style.BackColorGradientAngle = 90; - this.gpSrchText.Style.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; - this.gpSrchText.Style.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.gpSrchText.Style.BorderBottomWidth = 1; - this.gpSrchText.Style.BorderColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; - this.gpSrchText.Style.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.gpSrchText.Style.BorderLeftWidth = 1; - this.gpSrchText.Style.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.gpSrchText.Style.BorderRightWidth = 1; - this.gpSrchText.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.gpSrchText.Style.BorderTopWidth = 1; - this.gpSrchText.Style.CornerDiameter = 4; - this.gpSrchText.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; - this.gpSrchText.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center; - this.gpSrchText.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText; - this.gpSrchText.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near; - // - // - // - this.gpSrchText.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.gpSrchText.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.gpSrchText.TabIndex = 5; - this.gpSrchText.EnabledChanged += new System.EventHandler(this.gpSrchText_EnabledChanged); - // - // panel1 - // - this.panel1.BackColor = System.Drawing.Color.Transparent; - this.panel1.Controls.Add(this.cbxTextSearchText); - this.panel1.Controls.Add(this.label1); - this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom; - this.panel1.Location = new System.Drawing.Point(0, 2); - this.panel1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); - this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(332, 28); - this.panel1.TabIndex = 5; - // - // cbxTextSearchText - // - this.contextMenuBar1.SetContextMenuEx(this.cbxTextSearchText, this.btnCMIFindText); - this.cbxTextSearchText.DisplayMember = "Text"; - this.cbxTextSearchText.Dock = System.Windows.Forms.DockStyle.Fill; - this.cbxTextSearchText.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; - this.cbxTextSearchText.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.cbxTextSearchText.FormattingEnabled = true; - this.cbxTextSearchText.ItemHeight = 16; - this.cbxTextSearchText.Location = new System.Drawing.Point(39, 0); - this.cbxTextSearchText.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); - this.cbxTextSearchText.Name = "cbxTextSearchText"; - this.cbxTextSearchText.Size = new System.Drawing.Size(293, 22); - this.superTooltip1.SetSuperTooltip(this.cbxTextSearchText, new DevComponents.DotNetBar.SuperTooltipInfo("Search for Text", "", resources.GetString("cbxTextSearchText.SuperTooltip"), null, null, DevComponents.DotNetBar.eTooltipColor.Gray)); - this.cbxTextSearchText.TabIndex = 2; - this.cbxTextSearchText.WatermarkFont = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.cbxTextSearchText.WatermarkText = "Enter Search Text Here"; - this.cbxTextSearchText.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.ProcessEnterKey); - this.cbxTextSearchText.Leave += new System.EventHandler(this.cbxTextSearchText_Leave); - // - // label1 - // - this.label1.AutoSize = true; - this.label1.BackColor = System.Drawing.Color.Transparent; - this.label1.Dock = System.Windows.Forms.DockStyle.Left; - this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label1.Location = new System.Drawing.Point(0, 0); - this.label1.Name = "label1"; - this.label1.Padding = new System.Windows.Forms.Padding(0, 6, 0, 0); - this.label1.Size = new System.Drawing.Size(39, 23); - this.superTooltip1.SetSuperTooltip(this.label1, new DevComponents.DotNetBar.SuperTooltipInfo("Search For Text", "", resources.GetString("label1.SuperTooltip"), null, null, DevComponents.DotNetBar.eTooltipColor.Gray)); - this.label1.TabIndex = 4; - this.label1.Text = "Find:"; - // - // panel3 - // - this.panel3.BackColor = System.Drawing.Color.Transparent; - this.panel3.Controls.Add(this.cbxBooleanTxtSrch); - this.panel3.Controls.Add(this.cbxIncROTextSrch); - this.panel3.Controls.Add(this.cbxCaseSensitive); - this.panel3.Dock = System.Windows.Forms.DockStyle.Bottom; - this.panel3.Location = new System.Drawing.Point(0, 30); - this.panel3.Margin = new System.Windows.Forms.Padding(4); - this.panel3.Name = "panel3"; - this.panel3.Size = new System.Drawing.Size(332, 54); - this.panel3.TabIndex = 6; - // - // cbxBooleanTxtSrch - // - // - // - // - this.cbxBooleanTxtSrch.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.cbxBooleanTxtSrch.Location = new System.Drawing.Point(168, 11); - this.cbxBooleanTxtSrch.Margin = new System.Windows.Forms.Padding(4); - this.cbxBooleanTxtSrch.Name = "cbxBooleanTxtSrch"; - this.cbxBooleanTxtSrch.Size = new System.Drawing.Size(148, 18); - this.superTooltip1.SetSuperTooltip(this.cbxBooleanTxtSrch, new DevComponents.DotNetBar.SuperTooltipInfo("Boolean Search", "", resources.GetString("cbxBooleanTxtSrch.SuperTooltip"), null, null, DevComponents.DotNetBar.eTooltipColor.Gray)); - this.cbxBooleanTxtSrch.TabIndex = 6; - this.cbxBooleanTxtSrch.Text = "Boolean Search"; - this.cbxBooleanTxtSrch.Visible = false; - this.cbxBooleanTxtSrch.CheckedChanged += new System.EventHandler(this.cbxBooleanTxtSrch_CheckedChanged); - // - // cbxIncROTextSrch - // - // - // - // - this.cbxIncROTextSrch.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.cbxIncROTextSrch.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.cbxIncROTextSrch.Location = new System.Drawing.Point(12, 32); - this.cbxIncROTextSrch.Margin = new System.Windows.Forms.Padding(4); - this.cbxIncROTextSrch.Name = "cbxIncROTextSrch"; - this.cbxIncROTextSrch.Size = new System.Drawing.Size(225, 15); - this.superTooltip1.SetSuperTooltip(this.cbxIncROTextSrch, new DevComponents.DotNetBar.SuperTooltipInfo("Search RO and Transition Text", "", "When this box is checked, Search will include matches found in RO and Transition " + - "text as well as regular text.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray)); - this.cbxIncROTextSrch.TabIndex = 5; - this.cbxIncROTextSrch.Text = "Search RO and Transition Text"; - // - // cbxCaseSensitive - // - this.cbxCaseSensitive.BackColor = System.Drawing.Color.Transparent; - // - // - // - this.cbxCaseSensitive.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.cbxCaseSensitive.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.cbxCaseSensitive.Location = new System.Drawing.Point(12, 7); - this.cbxCaseSensitive.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); - this.cbxCaseSensitive.Name = "cbxCaseSensitive"; - this.cbxCaseSensitive.Size = new System.Drawing.Size(139, 18); - this.superTooltip1.SetSuperTooltip(this.cbxCaseSensitive, new DevComponents.DotNetBar.SuperTooltipInfo("Case Sensitive", "", "When this box is checked, Search will find only exact matches of the search text " + - "you had entered.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(180, 100))); - this.cbxCaseSensitive.TabIndex = 3; - this.cbxCaseSensitive.Text = "Case Sensitive"; - // - // rbtnSrchTxt - // - this.rbtnSrchTxt.BackColor = System.Drawing.Color.Transparent; - // - // - // - this.rbtnSrchTxt.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.rbtnSrchTxt.CheckBoxStyle = DevComponents.DotNetBar.eCheckBoxStyle.RadioButton; - this.rbtnSrchTxt.Checked = true; - this.rbtnSrchTxt.CheckState = System.Windows.Forms.CheckState.Checked; - this.rbtnSrchTxt.CheckValue = "Y"; - this.rbtnSrchTxt.Dock = System.Windows.Forms.DockStyle.Left; - this.rbtnSrchTxt.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.rbtnSrchTxt.Location = new System.Drawing.Point(1, 1); - this.rbtnSrchTxt.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); - this.rbtnSrchTxt.Name = "rbtnSrchTxt"; - this.rbtnSrchTxt.Size = new System.Drawing.Size(29, 90); - this.rbtnSrchTxt.TabIndex = 6; - this.rbtnSrchTxt.CheckedChanged += new System.EventHandler(this.rbtnSrchTxt_CheckedChanged); - // - // cbxSrchTypeUsage - // - this.cbxSrchTypeUsage.BackColor = System.Drawing.Color.Transparent; - // - // - // - this.cbxSrchTypeUsage.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.cbxSrchTypeUsage.CheckBoxStyle = DevComponents.DotNetBar.eCheckBoxStyle.RadioButton; - this.cbxSrchTypeUsage.Dock = System.Windows.Forms.DockStyle.Bottom; - this.cbxSrchTypeUsage.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.cbxSrchTypeUsage.Location = new System.Drawing.Point(1, 91); - this.cbxSrchTypeUsage.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); - this.cbxSrchTypeUsage.Name = "cbxSrchTypeUsage"; - this.cbxSrchTypeUsage.Size = new System.Drawing.Size(367, 22); - this.superTooltip1.SetSuperTooltip(this.cbxSrchTypeUsage, new DevComponents.DotNetBar.SuperTooltipInfo("Find Selected Step Elements", "", "This option will have Search show you where the selected Step Elements are used.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray)); - this.cbxSrchTypeUsage.TabIndex = 4; - this.cbxSrchTypeUsage.Text = " Find Selected Step Elements"; - this.cbxSrchTypeUsage.CheckedChanged += new System.EventHandler(this.cbxSrchTypeUsage_CheckedChanged); - // - // tabStepTypeSearch - // - this.tabStepTypeSearch.AttachedControl = this.tabControlPanel4; - this.tabStepTypeSearch.Name = "tabStepTypeSearch"; - this.superTooltip1.SetSuperTooltip(this.tabStepTypeSearch, new DevComponents.DotNetBar.SuperTooltipInfo("Search for Text", "", "Allows you to search for entered text in selected procedure sets and within selec" + - "ted procedure text types.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(170, 110))); - this.tabStepTypeSearch.Text = "Text"; - this.tabStepTypeSearch.Click += new System.EventHandler(this.tabStepTypeSearch_Click); - // // tabControlPanel5 // this.tabControlPanel5.Controls.Add(this.pnlTranCategory); @@ -1462,13 +1481,13 @@ namespace Volian.Controls.Library this.Size = new System.Drawing.Size(369, 832); ((System.ComponentModel.ISupportInitialize)(this.tabSearchTypes)).EndInit(); this.tabSearchTypes.ResumeLayout(false); - this.tabControlPanel2.ResumeLayout(false); - this.gpFindROs.ResumeLayout(false); this.tabControlPanel4.ResumeLayout(false); this.gpSrchText.ResumeLayout(false); this.panel1.ResumeLayout(false); this.panel1.PerformLayout(); this.panel3.ResumeLayout(false); + this.tabControlPanel2.ResumeLayout(false); + this.gpFindROs.ResumeLayout(false); this.tabControlPanel5.ResumeLayout(false); this.pnlTranCategory.ResumeLayout(false); this.pnlTranFormat.ResumeLayout(false); @@ -1580,6 +1599,7 @@ namespace Volian.Controls.Library private System.Windows.Forms.Label lblTranCategory; private DevComponents.DotNetBar.Controls.ComboBoxEx cbxTranCategory; private DevComponents.DotNetBar.LabelX lblSrchRoMsg; + private DevComponents.DotNetBar.Controls.CheckBoxX cbxByWord; //end transition search controls } } diff --git a/PROMS/Volian.Controls.Library/DisplaySearch.cs b/PROMS/Volian.Controls.Library/DisplaySearch.cs index aa9da23c..85a9bff3 100644 --- a/PROMS/Volian.Controls.Library/DisplaySearch.cs +++ b/PROMS/Volian.Controls.Library/DisplaySearch.cs @@ -1391,7 +1391,7 @@ namespace Volian.Controls.Library ReportTitle = "Step Element Report"; //"Proms - Search by Type: " + typstr; TypesSelected = "Filtered By: " + typstr; SearchString = null; - SearchResults = ItemInfoList.GetListFromTextSearch(DVISearchList, TypeSearchList, "", cbxBooleanTxtSrch.Checked ? 2 : cbxCaseSensitive.Checked ? 1 : 0, ItemSearchIncludeLinks.Value, includeRTFformat, includeSpecialChars, unitPrefix); + SearchResults = ItemInfoList.GetListFromTextSearch(DVISearchList, TypeSearchList, "", cbxBooleanTxtSrch.Checked ? 2 : cbxCaseSensitive.Checked ? 1 : 0, ItemSearchIncludeLinks.Value, includeRTFformat, includeSpecialChars, unitPrefix,"",""); cmbResultsStyleIndex = 1; //display step locations in results } } @@ -1406,10 +1406,38 @@ namespace Volian.Controls.Library //{ //ReportTitle = string.Format("Proms - {0} Search for '{1}'", cbxBooleanTxtSrch.Checked ? "Boolean" : "Text", TextSearchString); ReportTitle = string.Format("Search for '{0}'", TextSearchString); + + // C2020-009: Search - Allow search 'By Word'. + string byWordPrefix = ""; + string byWordSuffix = ""; + if (cbxByWord.Checked) + { + // Generate a prefix & suffix to be used in the sql query around the search string. + // If the search string starts (prefix)/ends(suffix) with a number, then use an expression that + // does not allow the preceding/following text to have a number, '.', letter or other rtf + // commands. If the search string starts/ends with a letter, then use an expression that does not + // find the preceding/following text that is text, i.e. a letter. + if (Regex.IsMatch(TextSearchString, @"^[\d\.]")) // starts with a number or '.' decimal pt + { + byWordPrefix = @"[^0-9a-zA-Z.vbpi:\\-]"; + } + else if (Regex.IsMatch(TextSearchString, @"^[a-zA-Z]")) // starts with a letter + { + byWordPrefix = @"[^a-zA-Z]"; + } + if (Regex.IsMatch(TextSearchString, @"[\d\.]$")) // ends with a number or decimal + { + byWordSuffix = @"[^0-9a-zA-Z.vbpi:\\-]"; + } + else if (Regex.IsMatch(TextSearchString, @"[a-zA-Z]$")) // ends with a letter + { + byWordSuffix = @"[^a-zA-Z]"; + } + } SearchString = TextSearchString; //TypesSelected = (typstr != null) ? "Searched Step Types: " + typstr : "Searched All Step Types"; //TypesSelected = "Searched Step Types: " + ((typstr != null) ? typstr : "All Step Types"); - SearchResults = ItemInfoList.GetListFromTextSearch(DVISearchList, TypeSearchList, TextSearchString /*.Replace(@"\",@"\u9586?")*/, cbxBooleanTxtSrch.Checked ? 2 : cbxCaseSensitive.Checked ? 1 : 0, cbxIncROTextSrch.Checked ? ItemSearchIncludeLinks.Value : ItemSearchIncludeLinks.Nothing, includeRTFformat, includeSpecialChars, unitPrefix); + SearchResults = ItemInfoList.GetListFromTextSearch(DVISearchList, TypeSearchList, TextSearchString /*.Replace(@"\",@"\u9586?")*/, cbxBooleanTxtSrch.Checked ? 2 : cbxCaseSensitive.Checked ? 1 : 0, cbxIncROTextSrch.Checked ? ItemSearchIncludeLinks.Value : ItemSearchIncludeLinks.Nothing, includeRTFformat, includeSpecialChars, unitPrefix, byWordPrefix, byWordSuffix); cmbResultsStyleIndex = 3; // display step text in results //} } @@ -1445,7 +1473,7 @@ namespace Volian.Controls.Library //TypesSelected = "Searched Step Types: " + ((typstr != null) ? typstr : "All Step Types"); if (cbxFndUnLnkROVals.Enabled && cbxFndUnLnkROVals.Checked) { - SearchResults = ItemInfoList.GetListFromTextSearch(DVISearchList, TypeSearchList, ROSearchList, cbxBooleanTxtSrch.Checked ? 2 : cbxCaseSensitive.Checked ? 1 : 0, ItemSearchIncludeLinks.Nothing, includeRTFformat, includeSpecialChars, unitPrefix); + SearchResults = ItemInfoList.GetListFromTextSearch(DVISearchList, TypeSearchList, ROSearchList, cbxBooleanTxtSrch.Checked ? 2 : cbxCaseSensitive.Checked ? 1 : 0, ItemSearchIncludeLinks.Nothing, includeRTFformat, includeSpecialChars, unitPrefix, "", ""); cmbResultsStyleIndex = 3; // display step text in results } else