Class SY_SearchData

This is a base class to be inherited by other SearchData classes; child classes must implement BuildIndex method.

Constructor

Initialize a Sage.Data.Search object.

ParameterDescription
coSession [input, object, required] Reference to the SY_Session object
bIgnoreNoData [input, boolean, optional] When set, will skip the check for data in the data index used for the search.

Inherits

SY_Constant

Properties

LOCAL cIndexFieldEntityKey$="EntityKey"  

Field used to store a valude used identify groups of entries in the index for an entity; for example, Auto-Complete uses company code to group all entries together for a company

LOCAL cIndexFieldEntityName$="EntityName"  

Field used to store the name of the entity

LOCAL cIndexFieldDocKey$="DocKey"  

Field used to store the key of the current row of the table associated with the entity

LOCAL cIndexFieldDocData$="DocData"  

Field used to store a record of a subset of fields from current row of the table; this record will be included in any search of the index for the entity

LOCAL cIndexFieldDocStored$="DocStored"  

Field used to store a record of a subset of fields from current row of the table; this record will be excluded from any search of the index for the entity

LOCAL cDefaultFieldSep$=SEP  

Default field separator

LOCAL cIndexName$="Index"  

Name to use for the search index file(s); will default to "INDEX" when not set

LOCAL cIndexAlternateSep$=$FF$+SEP  

Alternate field separator to be used when writing index to ensure all results are found

PROPERTY EntityName$   * Read Only *

Name to store for the entity; must be set by child class when using Advanced Search

PROPERTY RebuildMsg$   * Read Only *

[string] The message to display in progress bar when rebuilding the index

PROPERTY ResultCount   * Read Only *

[number] The number of hits found for the current active search, -1 if there is not an active search

PROPERTY SearchResultLimit  

[number] Limit for number of items returned for result of search. The default limit for the size of the result set is 1000 items.

Methods

FUNCTION AdvancedSearch(searchIndex)  

Display the Advanced search dialog to enable user to enter search value and view/select results

ParameterDescription
searchIndex [output, number] Index into the search result set of selected row
Returns [boolean] returns retSUCCESS(1)
FUNCTION BuildIndex(*)  

Build the search index

Returns [boolean] 0 - Failure, 1 - Success
Info

This method must be implemented in child class to build the search index.

Warning

The child method must use _OBJ'TranslateIndexData$() to translate field separator in data value or stored value before adding to search index.

FUNCTION CheckBuildLockFile(bClear)  

A helper method to be used by BuildIndex when the creation of the search index must be restricted to a single user. This method will create a lock file if none exists and call the CreateIndex() method only if a lock can be placed on this file.

ParameterDescription
bClear [input, boolean] When set, will clear the flag used to indicate rebuild of index is required
Returns [boolean] retSUCCESS(1) when lock of file succeeded, retFAILURE(0) when cannot lock the file
FUNCTION CreateIndex()  
FUNCTION CreateIndex(retainData)  
FUNCTION CreateIndex(retainData, indexName$)  
FUNCTION CreateIndex(retainData, indexName$, encryptPassword$)  

Create an index for a search

ParameterDescription
retainData [input, boolean, optional] set to isTRUE to keep the existing data for the entity
indexName$ [input, string, optional] when set will be used instead of the LOCAL property cIndexName$
encryptPassword$ [input, string, optional] password to use to open encrypted index
Returns [boolean] returns retSUCCESS
FUNCTION GetDataIOL$()  

Get IOList to use for separating the search data stored in the DocData field in the search index into fields.

Returns [string] IOLIST to use for DocData field in the search Index
Info

This method can be implemented in child class to define IOLIST for the data to place in the search index to be included as part of a search

FUNCTION GetMlacExpressions(out.DisplayExpr$, out.ReturnExpr$)  

Get expressions to be override Auto-Complete defintion used in *obj/mlac for data display and returned value

ParameterDescription
out.DisplayExpr$ [output, string] Expression to be used to create data value to display in selection list
out.ReturnExpr$ [output, string] Expression to be used to set the data value to be returned for selected row in selection list
Returns [boolean] retSUCCESS(1) when override values are defined, retFAILURE(0) when no override values are defiend
Info

This method should be implemented in child class to define IOLIST for data to display to allow for greater flexibility when using Advanced Search

FUNCTION GetResultsFormat$()  

Get format to use for Report View ListBox when using Advanced Search

Returns [string] Format definition used to display search results in Advanced Search dialog
Info

This method should be implemented in child class to define a format to better match search results. The default format is a single column with the heading 'Results'.

FUNCTION GetResultsIOL$()  

Get IOList to use for data to load into the Report View ListBox when using Advanced Search

Returns [string] IOLIST to use for data to load into Reort View to display the search results in Advanced Search dialog
Info

This method should be implemented in child class to define IOLIST for data to display to allow for greater flexibility when using Advanced Search

FUNCTION GetStoredIOL$()  

Get IOList to use for separating the stored data stored in the DocStored field in the search index into fields.

Returns [string] IOLIST to use for DocStored field in the search Index
Info

This method can be implemented in child class to define IOLIST for data to be stored in the search index but not included as part of a search

FUNCTION IsIndexEncrypted()  

Is index encrypted?

Returns [boolean] 0 - Not Encrytped, 1 - Encrypted
Info

This method must be implemented in child class if associated index is encrypted

FUNCTION MarkIndexRebuildRequired(rebuildMsg$)  
FUNCTION MarkIndexRebuildRequired()  

Mark the current index as out-of-date to force a rebuild when next accessed

ParameterDescription
rebuildMsg$ [input, string] Message to display when rebuilding the index (optional)
Returns [boolean] 0 - Failed to mark index to require a rebuild, 1 - index marked to require a rebuild
FUNCTION OpenIndex()  
FUNCTION OpenIndex(indexName$)  
FUNCTION OpenIndex(indexName$, encryptPassword$)  

Open an index for a search

ParameterDescription
indexName$ [input, string, optional] when set will be used instead of the LOCAL property cIndexName$
encryptPassword$ [input, string, optional] password to use to open encrypted index
Returns [boolean] returns retSUCCESS
FUNCTION ReturnSearch(index, keyValue$)  
FUNCTION ReturnSearch(index, keyValue$, dataValue$)  
FUNCTION ReturnSearch(index, keyValue$, dataValue$, storedValue$)  
FUNCTION ReturnSearch(index, keyValue$, dataValue$, storedValue$, dataRec$)  

Get data returned by search

ParameterDescription
index [input / output, number] Index to returned value in the list of search results
keyValue$ [output, string, required] Key value for the selected row from result set
dataValue$ [output, string, optional] Data value for the selected row from result set
storedValue$ [output, string, optional] Stored value for the selected row from result set
dataRec$ [output, string, optional] Data record to be used by MLAC for selected index (Only returned when index is encrypted)
Returns [boolean] 0 - No Data Found, 1 - Data Found
FUNCTION SearchIndex(searchValue$)  

Do a search within specified entity for search value

ParameterDescription
searchValue$ [input, string] The value to use for the search
Returns [boolean] retSUCCESS(1) for a successful search, retFAILURE(0) when an exception is returned from the search DLL

Properties inherited from: SY_Constant

retFAILURE, retSUCCESS, retNEW, retWARNING, retCANCEL, retYES, retNO, msgYES$, msgNO$, msgCANCEL$, msgOK$, msgRETRY$, msgABORT$, msgIGNORE$, msgNOTONFILE$, msgTIMEOUT$, msgDISABLE, msgACTIVE, msgLinkHELP$, msgLinkMSG$, isFALSE, isTRUE, isYES$, isNO$, isBUSY$, edtNONE, edtEXISTS, edtNEW, ctlDISABLE, ctlENABLE, ctlSHOW, ctlHIDE, ctlLOCK, ctlUNLOCK, ctlLOCKORDISABLE, ctlUNLOCKORENABLE, popHIDE, popDISABLE, popSHOW, popSHOWCHECKED, grdMODEVIEW, grdMODEMAINT, grdMODEADD, filCREATE, filLOCK, filCREATELOCK, filGLOBAL, filCREATEGLOBAL, filLOCKGLOBAL, filCREATELOCKGLOBAL, filCHANNEL, filRAW, filPURGE, filLOAD, filINPUT, filNOOBJECT, filPVX, filREFRESH, filPVX4$, filPVX5$, pthCOMPANY$, pthOTHERCOMPANY$, pthPRCOMPANY$, pthOTHERPRCOMPANY$, pthSYSTEM$, pthUSER$, pthSOA$, pthHOME$, pthROOT$, pthDICTIONARY$, pthTEXTOUT$, pthLOCK$, pthLOCKSYS$, pthPREFIX$, pthARCHIVE$, pthLOGFILES$, folderCOMMONPROGRAMFILES, folderCOMMONAPPLICATIONDATA, errOBJECT, errSYSTEMLOCK, errCONTINUE, errEMBEDDEDIO, errSYSLOCK, extSQLCREATETABLE$, extSQLALLOWNULLDATES$, dbALL$, dbNONE$, dateTOSTRINGFORMAT$, dateLONGMASK$, dateSHORTFMT, dateLONGFMT, dateYEARFIRST, dateMONTHFIRST, dateDAYFIRST, timeMINUTESMASK$, timeMINUTES24MASK$, timeSECONDSMASK$, timeSECONDS24MASK$, idxPRIMARY$, idxBATCH$, idxDISPLAY$, dirFIRST, dirLAST, dirNEXT, dirPREVIOUS, typALPHANUM, typZEROFILL, typCHARNUM, typMASTERNUM, typALPHANUMNF, typMASTERNUMC, typALPHA$, typNUMBERS$, typALPHANUM$, typALPHANUMNF$, typCHARNUM$, typMASTERNUM$, typMASTERNUMCLEN, modTASKOTFDISALLOW$, logALLACTIVITY$, logACTIVITY$, logERROR$, logACTNEWCUSTOMER$, logACTDATASYNC$, logACTDATAIMPORT$, logACTOPTIONCHANGED$, logACTPROGRAMLAUNCH$, logDFDM$, logSECURITY$, logTASKSCHEDULER$, logWEBERROR$, logVISUALINTEGRATOR$, logEntryIDLength, chkOFF$, chkON$, chkGRAYED$, secVIEWONLY, secCREATEONLY, secMODIFYONLY, secCREATEMODIFY, secDELETEONLY, secCREATEDELETE, secMODIFYDELETE, secFULLACCESS, secDEFAULTUSER$, secDEFAULTROLE$, regHKEY_CLASSES_ROOT, regHKEY_CURRENT_USER, regHKEY_LOCAL_MACHINE, regHKEY_USERS, regHKEY_CURRENT_CONFIG, regODBC_PATH$, regMAS_PATH$, E3_MYHANDLE, E3_TASK, E3_QUIT, E3_COCHANGE, E3_DATECHANGE, E3_USERCHANGE, E3_SRVRPATH, E3_HELPFILE, E3_TECHSUPPORT, E3_QUERYTOQUIT, E3_SUPERVISOR, E3_CUSTOMIZE, E3_SWITCHMODULE, E3_DISABLEWIN, E3_CURSOR, E3_USERID, E3_PRIVATETASK, E3_CHAT, E3_BROADCAST, E3_RELOAD, E3_PASSTHROUGH, E3_EXECUTE, E3_EXPCOCHANGE, E3_EXPTASK, E3_EXPLAUNCH, E3_SILENT, E3_DIRECT, E3_NODELIST, E3_OCXITEM, E3_MODULEID, E3_CUSTFAV, E3_HOMEPAGE, E3_MINIMIZE, E3_UNDOCKED, E3_DOCKED, E3_PUBLICTASK, E3_LAUNCHURL, E3_BTNCHANGE, E3_STDBTNRELOAD, E3_MYBUSINESS, E3_REGLOADED, E3_LOADED, E3_V4TASK, E3_PUBMODIFY, E3_TASKRELOAD, E3_SETAUTOHIDE, E3_COCHANGE2, E3_TASK_NC, E3_V4TASK_NC, E3_TASK_ALTC, E3_V4TASK_ALTC, E3_PASSWORD, E3_LAUNCHVIEW, E3_LAUNCHBIETASK, E3_CLEANUPBIE, E3_STARTVIEW, E3_BIE_ADMIN, E3_HELPPATH, E3_CUSTOMERID, E3_MASVERSION, E3_LAUNCHEMBEDDED, E3_LAUNCHERMENU, E3_APP_POINTSIZE, E3_LAUNCHERVERSION, E3_DISABLE, E3_ENABLE, E3_SHOW, E3_HIDE, E3_REFRESH, E3_LIBMASTER, WM_COPY, wtsINITIALPROGRAM, wtsAPPLICATIONNAME, wtsWORKINGDIRECTORY, wtsOEMID, wtsSESSIONID, wtsUSERNAME, wtsWINSTATIONNAME, wtsDOMAINNAME, wtsCONNECTSTATE, wtsCLIENTBUILDNUMBER, wtsCLIENTNAME, wtsCLIENTDIRECTORY, wtsCLIENTPRODUCTID, wtsCLIENTHARDWAREID, wtsCLIENTADDRESS, wtsCLIENTDISPLAY, wtsCLIENTPROTOCOLTYPE, thmNORMAL, thmMETAL, thmOLIVE, rptREPORTTYPESTD, rptREPORTTYPELABEL, rptREPORTTYPEMULTCOL, rptISTRUE, rptISFALSE, rptISDEFAULT, rptPORTRAIT, rptLANDSCAPE, rptASCENDING, rptDESCENDING, rptRIGHTALIGN, rptLEFTALIGN, rptHORCENTERALIGN, rptLSSINGLELINE, rptSTSUM, rptSTAVERAGE, rptSTCOUNT, rptDFLTHSPACING, rptDFLTVSPACING, rptDFLTFONTSIZE, rptDFLTLEFT, rptDFLTTOP, rptTWIPSPERCHARW, rptTWIPSPERCHARH, rptSVTREPORTTITLE, rptEDTDISKFILE, rptGCANYVALUE, rptGCDAILY, rptCRDATEFIELD, rptCRDATETIMEFIELD, crEFTCrystalReport, crEFTRichText, crEFTWordForWindows, crEFTExcel, crEFTPortableDocFormat, crEFTHTML32, crEFTHTML40, crEFTExcelRecord, crEFTText, crEFTCharacterSeparatedValues, crEFTTabSeparatedText, crEFTEditableRTF, crEFTXml, crEFTRPTR, crEFTExcelWorkbook, cContextKeyLen1, cContextKeyLen2, cContextKeyLen3, adCmdText, adCmdStoredProc, adClipString, adExecuteNoRecords, adVarChar, adInteger, adParamInput, adParamOutput, adParamInputOutput, adParamReturnValue, adTextNoRecords, adOpenForwardOnly, adOpenStatic, adLockReadOnly, adUseServer, adUseClient, dbTMP$, dbTEMPDB$, dbSYSDB$, dbPVXDDF, dbPVXDB, dbMYSQL, dbADO, dbSQL, LastErrorMsg$, LastErrorNum$, SageCloudAppDesc$, IolNomads$

Methods inherited from: SY_Constant

GetNOMADSIolist$(), MaskString(), RawString(), ClassValidateEMailAddress(), dateTODAY$(), Element$(), fmtMODCODE$(), fmtMODPREFIX$(), PERFORM FunctionBreak(), GetExceptionMsg$(), GetFileName(), GetJobTitles(), GetPrinterProps(), GetRecordCount(), isALPHA(), isDATE(), isNUMERIC(), MsgPath$(), ParseString(), ParseTagField(), Position(), QUO$(), ValidateFormatType(), ZeroFill$()