<% class FaqSearch public mComponentId public mComponentName public mXmlPropFile public mLangFile private mIsDebugMode private mRankStar private mNextPage private mSitePath private mScriptsDirName private mRelPathToRoot private mConstraint private mErrorMessage 'request variables private mReqAct private sub Class_Initialize on error resume next set mErrorObject = Server.CreateObject("Scripting.Dictionary") mErrorObject.Add "Code", 0 mErrorObject.Add "Source", "" mErrorObject.Add "Description", "" mIsDebugMode = false mRankStar = "" mNextPage = "" mReqAct = "" mSitePath = "" mScriptsDirName = "scripts" mRelPathToRoot = "./" mConstraint = "" if Request.Form("toc_question").Item <> "" then mConstraint = Request.Form("toc_question").Item elseif Request.QueryString("question").Item <> "" then mConstraint = Request.QueryString("question").Item end if mErrorMessage = "" end sub private sub Class_Termiante if mErrorMessage <> "" then Response.Write mErrorMessage end sub public function Initialize(ByVal sitePath, ByVal scriptDir, ByVal rootDir, ByVal debugMode) on error resume next Initialize = false mSitePath = sitePath mScriptsDirName = scriptDir mRelPathToRoot = rootDir mIsDebugMode = debugMode mRankStar = Replace(mRankStar, "[[path]]", mRelPathToRoot & mScriptsDirName) Dim xmlDoc set xmlDoc = faqOpenXMLFile(mSitePath & mScriptsDirName & "\" & mXmlPropFile) if xmlDoc is nothing then if err.number = 0 then call err.Raise ( 601, "faq_search.Initialize", faqGetLocaleString("Error.601", Array(mSitePath & mScriptsDirName & "\" & mXmlPropFile)) ) end if call SetError(err) exit function end if Dim ComponentNode set ComponentNode = faqGetNode(xmlDoc,,"Component", Array("name","id"), Array(mComponentName, mComponentId), -1) If ComponentNode Is Nothing Then if err.number = 0 then call err.Raise ( 400, "faq_search.Initialize", faqGetLocaleString("Error.400", Array(mComponentId)) ) end if call SetError(err) exit function end if mNextPage = faqGetProperty(ComponentNode, "nextpage") set ComponentNode = nothing set xmlDoc = nothing if err.number = 0 then Initialize = true end function public sub ShowSearchForm() Response.Write "
" & vbCrLf & _ "" & vbCrLf & _ "" & vbCrLf & _ " " & vbCrLf & _ " " & vbCrLf & _ " " & vbCrLf & _ " " & vbCrLf & _ " " & vbCrLf & _ " " & vbCrLf & _ " " & vbCrLf & _ "
" & _ faqGetLocaleString("faq.SearchForm.Label", null) & "
" & vbCrLf & _ "
" & vbCrLf end sub private sub SetError(ByVal errObj) if mIsDebugMode then mErrorMessage = errObj.Description else mErrorMessage = "

" & faqGetLocaleString("Error.Text.Generic", null) & "

" & _ "

" & faqGetLocaleString("Error.Text.Code", null) & "

" end if errObj.Clear end sub end class %>