<%@ LANGUAGE="VBSCRIPT" %> <% '***************************************************************************************** ' QNguyen 5/02/05 Modified to allow search by applications. ' QNguyen 8/23/05 Modified to use document landing page (docs2.asp) regardless ' of doctype. ' QNguyen 8/25/05 Added File Type column to page. ' QNguyen 9/20/05 Removed Hardcopy link. ' QNguyen 3/08/06 Resolved associated docs not being displayed issue. '***************************************************************************************** dim products dim docTypes dim fams dim docType dim ordDate, ordSize, ordTitle, ordDocNo dim oTogg dim OSimg, ODimg, OTimg, ODNimg dim oTStr, oDStr, oFStr, oDNStr dim tMap, oMap, dMap, dnMap fams = Request.QueryString("FAM") '5/02/05 if fams="" then fams = -999 docType = Request.QueryString("DT") '5/02/05 if docType="" then docType = -999 ordDate = Request.QueryString("OD") ordSize = Request.QueryString("OS") ordTitle = Request.QueryString("OT") ordDocNo = Request.QueryString("DN") oDNStr = "" oTStr = "" oDStr = "" oFStr = "" oTogg = "1" Select Case ordDocNo Case "0" oDNStr = " desc" oTogg = "1" ODNimg = "" dnMap = "" Case "1" oDNStr = " asc" oTogg = "0" ODNimg = "" dnMap = "" Case Else ODNimg = "" dnMap = "" dnMap = dnMap & "" End Select Select Case ordTitle Case "0" oTStr = ", title desc" oTogg = "1" OTimg = "" tMap = "" Case "1" oTStr = ", title asc" oTogg = "0" OTimg = "" tMap = "" Case Else OTimg = "" tMap = "" tMap = tMap & "" End Select Select Case ordSize Case "0" oFStr = ", filesize desc" oTogg = "1" OSimg = "" oMap = "" Case "1" oFStr = ", filesize asc" oTogg = "0" OSimg = "" oMap = "" Case Else OSimg = "" oMap = "" oMap = oMap & "" End Select Select Case ordDate Case "0" 'oDStr = ", updatedate desc" oDStr = ", rupdate desc" oTogg = "1" ODimg = "" dMap = "" Case "1" 'oDStr = ", updatedate asc" oDStr = ", rupdate asc" oTogg = "0" ODimg = "" dMap = "" Case Else ODimg = "" dMap = "" dMap = dMap & "" End Select Set oConn = Server.CreateObject("ADODB.Connection") oConn.Provider = "MSDataShape" oConn.Open strConnWebDB 'docStr = "SHAPE {Select docid, docno, doctype, title, updatedate, filesize, " _ ' & "filetype, parent, businessunitname, familyid, familyshortname, filepath, priority, new from v_AllDocs " _ ' & "where familyid in (" & fams & ") and doctypeid in (" & docType & ") " _ ' & "and isnull(parent, 0) = 0 " _ ' & "order by priority, familyshortname, doctype" & oFStr & oDStr & oTStr & ", docno" & oDNStr & "} AS ParentData " _ ' & "APPEND ({Select docid, docno, doctype, title, updatedate, filesize, " _ ' & "filetype, parent, businessunitname, familyid, familyshortname, filepath, priority, new from v_AllDocs " _ ' & "where familyid in (" & fams & ") and doctypeid in (" & docType & ") " _ ' & "and not isnull(parent, 0) = 0 " _ ' & "order by priority, familyshortname, doctype, docno} " _ ' & "AS oRSDocs " _ ' & "RELATE docid TO parent)" ' 3/08/06 - Removed parent is null line and added doctypeid criteria. docStr = "SHAPE {Select distinct docid, docno, doctype, title, updatedate, filesize, " _ & "filetype, parent, businessunitname, familyid, familyshortname, filepath, priority, new, rupdate from v_AllDocs " _ & "where familyid in (" & fams & ") and doctypeid in (" & docType & ") " _ & "and doctypeid not in (select doctypeid from doctype where searchable = 0) " _ & "order by priority, familyshortname, doctype" & oFStr & oDStr & oTStr & ", docno" & oDNStr & "} AS ParentData " _ & "APPEND ({Select distinct a.docid, a.docno, a.doctype, a.title, a.updatedate, a.filesize, " _ & "a.filetype, a.parent, a.businessunitname, a.familyid, a.familyshortname, " _ & "a.filepath, a.priority, a.new, b.docid, a.rupdate from v_AllDocs a, v_AllDocs b " _ & "where a.familyid in (" & fams & ") and a.doctypeid in (" & docType & ") " _ & "and a.parent = ? " _ & "and a.parent = b.docid " _ & "and a.familyid = b.familyid " _ & "order by a.priority, a.familyshortname, a.doctype, a.docno, a.docid} " _ & "AS oRSDocs " _ & "RELATE docid TO PARAMETER 0)" Set oRs = Server.CreateObject("ADODB.Recordset") oRs.Open docStr, oConn, adOpenDynamic, , adCmdText '5/02/05 dim strAppDocSQL, objAppDocRs, strApps, blnResults blnResults = false strApps = Request.QueryString("APP") if strApps="" then strApps = -999 ' Commented out on 8/23/05 'strAppDocSQL = "SHAPE {Select distinct docid, docno, doctype, title, updatedate, filesize, " _ ' & "filetype, parent, app_id, app_name, filepath, new from v_AllDocs_App " _ ' & "where app_id in (" & strApps & ") and doctypeid in (" & docType & ") " _ ' & "and isnull(parent, 0) = 0 " _ ' & "order by app_name, doctype" & oFStr & oDStr & oTStr & ", docno" & oDNStr & "} AS ParentData " _ ' & "APPEND ({Select distinct a.docid, a.docno, a.doctype, a.title, a.updatedate, a.filesize, " _ ' & "a.filetype, a.parent, a.app_name, a.app_id, " _ ' & "a.filepath, a.new, b.docid from v_AllDocs_App a, v_AllDocs_App b " _ ' & "where a.app_id in (" & strApps & ") and a.doctypeid in (" & docType & ") " _ ' & "and a.parent = ? " _ ' & "and a.parent = b.docid " _ ' & "and a.app_id = b.app_id " _ ' & "order by a.app_name, a.doctype, a.docno, a.docid} " _ ' & "AS objAppDocRSDocs " _ ' & "RELATE docid TO PARAMETER 0)" strAppDocSQL = "Select distinct docid, docno, doctype, title, updatedate, filesize, " _ & "filetype, parent, app_id, app_name, filepath, new, rupdate from v_AllDocs_App " _ & "where app_id in (" & strApps & ") and doctypeid in (" & docType & ") " _ & "and docid not in (select secdocid from docassociations) " _ & "union " _ & "select distinct ad.docid, ad.docno, ad.doctype, ad.title, ad.updatedate, ad.filesize, " _ & "ad.filetype, ad.parent, a.app_id, a.name AS app_name, ad.filepath, ad.new, ad.rupdate " _ & "from v_allDocs_App ad inner join t_ref_design_docs rdd " _ & "on ad.docid = rdd.docid " _ & "inner join t_ref_design rd " _ & "on rdd.ref_id = rd.ref_id " _ & "inner join t_application a " _ & "on rd.app_id = a.app_id " _ & "where a.app_id in (" & strApps & ") and doctypeid in (" & docType & ") " _ & "and ad.docid not in (select secdocid from docassociations) " _ & "order by app_name, doctype" & oFStr & oDStr & oTStr & ", docno" & oDNStr 'Response.Write("strAppDocSQL: " & strAppDocSQL) 'Response.End Set objAppDocRs = Server.CreateObject("ADODB.Recordset") objAppDocRs.Open strAppDocSQL, oConn, adOpenDynamic, , adCmdText %> Documentation Search Results <% Response.Write("" & vbCrLf) %> <%=oMap%> <%=dMap%> <%=tMap%> <%=dnMap%>
  home > documentation search > documentation search results
Documentation   Search Results

<% APPFirst = "" If Not objAppDocRs.EOF Then %> <% objAppDocRs.MoveFirst Do While Not objAppDocRs.EOF APPCurrent = objAppDocRs("app_name") If APPFirst <> APPCurrent Then APPFirst = APPCurrent %> <% End If objAppDocRs.MoveNext Loop %> <% objAppDocRs.MoveFirst End If %> <% BLFirst = "" If Not oRs.EOF Then %> <% oRs.MoveFirst Do While Not oRs.EOF BLCurrent = oRs("businessunitname") If BLFirst <> BLCurrent Then BLFirst = BLCurrent %> <% End If oRs.MoveNext Loop oRs.MoveFirst Else %> <% End If %>
  

 Applications:
<%=objAppDocRs("app_name")%>
 
 Products:
" onclick="nLoc=getCURL()"><%=oRs("businessunitname")%>
 
<% If Not objAppDocRs.EOF Then '5/02/05 - Display application search results %> <% blnNewApp = false APPFirst = "" objAppDocRs.MoveFirst RowCount = 0 Do While Not objAppDocRs.EOF blnResults = true docno = objAppDocRs.Fields("docno") title = objAppDocRs.Fields("title") appid = objAppDocRs.Fields("app_id") APPCurrent = objAppDocRs.Fields("App_Name") If APPFirst <> APPCurrent Then DTFirst = "" if RowCount <> 0 then %>
 
<% end if blnNewApp = true APPFirst = APPCurrent %>
 <%=APPCurrent%>
 
  <%= APPCurrent %>View Reference Designs
<% End IF DTCurrent = objAppDocRs.Fields("DocType") 'if blnNewApp then blnNewApp = false if DTFirst <> DTCurrent then DTFirst = DTCurrent %> <% end if 'End If DCurrent = objAppDocRs.Fields("DocID") If RowCount MOD 2 = 0 Then 'Even Row thisColor = "#FFFFFF" Else 'Odd Row thisColor = "#EDEDED" End If %> <% RowCount = RowCount + 1 objAppDocRs.MoveNext Loop objAppDocRs.Close %>
<%=DTCurrent%>  
<%=ODNimg%> Doc ID  <%=OTimg%> Title<%=ODimg%> Updated   File Type 
 <%=UCASE(docno)%> <%=title%> <%=objAppDocRs.Fields("updatedate")%> <% Call getPic(objAppDocRs.Fields("fileType"),objAppDocRs.Fields("new")) %>

 

<% set objAppDocRs = nothing end if If Not oRs.EOF Then 'Display product search results %> <% setFlag = 0 BLFirst = "" PFFirst = "" DTFirst = "" DFirst = "" oRs.MoveFirst RowCount = 0 Do While Not oRs.EOF blnResults = true docno = oRs.Fields("docno") famID = oRs.Fields("familyid") title = oRs.Fields("title") BLCurrent = oRs.Fields("BusinessUnitName") If BLFirst <> BLCurrent Then If PFFirst <> "" AND BLFIRST <> BLCurrent AND setFlag <> 1 Then %>  
<% setFlag = 1 End If BLFirst = BLCurrent %>
 "><%=BLCurrent%>
 
<% End IF PFCurrent = oRs.Fields("FamilyShortName") If PFFirst <> PFCurrent Then If PFFirst <> "" AND BLFIRST = BLCurrent AND setFlag <> 1 Then %>  
<% End If setFlag = 0 PFFirst = PFCurrent %>
  <%= PFFirst %>
<% If DTFirst = oRs.Fields("DocType") AND RowCount <> 0 Then %> <% ' 8/23/05 'If DTCurrent="Application Note" OR DTCurrent="Technical Note" Then If true then %> <%Else%> <%End If%> <% End If End If DTCurrent = oRs.Fields("DocType") If DTFirst <> DTCurrent Then DTFirst = DTCurrent %> <% ' 8/23/05 'If DTCurrent="Application Note" OR DTCurrent="Technical Note" Then If true then %> <%Else%> <% End If End If DCurrent = oRs.Fields("DocID") If DFirst = DCurrent Then 'DFirst = DCurrent %> <% If RowCount MOD 2 = 0 Then 'Even Row thisColor = "#FFFFFF" Else 'Odd Row thisColor = "#EDEDED" End If %> <% ' 8/23/05 'If DTCurrent="Application Note" OR DTCurrent="Technical Note" Then If true then %> <%Else%> <% Set oRSChild = oRS("oRSDocs").Value 'childFirst = "" Do While Not oRSChild.EOF If PFCurrent = oRsChild("FamilyShortName") Then 'childCurrent = oRSChild("docid") 'If childFirst <> childCurrent Then 'childFirst = childCurrent %> <% End If oRSChild.MoveNext Loop oRSChild.Close End If End If ' New Stuff If DFirst <> DCurrent Then DFirst = DCurrent %> <% If RowCount MOD 2 = 0 Then 'Even Row thisColor = "#FFFFFF" Else 'Odd Row thisColor = "#EDEDED" End If %> <% ' 8/23/05 'If DTCurrent="Application Note" OR DTCurrent="Technical Note" Then If true then %> <%Else%> <% Set oRSChild = oRS("oRSDocs").Value 'childFirst = "" Do While Not oRSChild.EOF If PFCurrent = oRsChild("FamilyShortName") Then 'childCurrent = oRSChild("docid") 'If childFirst <> childCurrent Then 'childFirst = childCurrent %> <% End If oRSChild.MoveNext Loop oRSChild.Close End If End If ' New Stuff RowCount = RowCount + 1 oRs.MoveNext Loop oRs.Close oConn.Close %>
<%=DTCurrent%>  
<%=ODNimg%> Doc ID  <%=OTimg%> Title<%=ODimg%> Updated   File Type 
<%=ODNimg%> Doc ID  <%=OTimg%> Title<%=ODimg%> Updated   File Type <%=OSimg%> Size (KB) 
<%=DTCurrent%>  
<%=ODNimg%> Doc ID  <%=OTimg%> Title<%=ODimg%> Updated   File Type 
<%=ODNimg%> Doc ID  <%=OTimg%> Title<%=ODimg%> Updated   File Type <%=OSimg%> Size (KB) 
 <%=UCASE(docno)%>"><%=title%> <%=oRs.Fields("updatedate")%> "><% Call getPic(oRs.Fields("fileType"),oRs.Fields("new")) %>
"><%=title%> <%=oRs.Fields("updatedate")%> "><% Call getPic(oRs.Fields("fileType"),oRs.Fields("new")) %> <%=oRs.Fields("filesize")%>
     <%=UCASE(oRSChild("docno"))%> "><%=oRSChild.Fields("title")%> <%=oRSChild.Fields("updatedate")%> "><% Call getPic(oRSChild.Fields("fileType"),oRSChild.Fields("new")) %> <%=oRSChild.Fields("filesize")%>
 <%=UCASE(docno)%>"><%=title%> <%=oRs.Fields("updatedate")%> "><% Call getPic(oRs.Fields("fileType"),oRs.Fields("new")) %>
"><%=title%> <%=oRs.Fields("updatedate")%> "><% Call getPic(oRs.Fields("fileType"),oRs.Fields("new")) %> <%=oRs.Fields("filesize")%>
     <%=UCASE(oRSChild("docno"))%> "><%=oRSChild.Fields("title")%> <%=oRSChild.Fields("updatedate")%> "><% Call getPic(oRSChild.Fields("fileType"),oRSChild.Fields("new")) %> <%=oRSChild.Fields("filesize")%>
<% Set oRs = Nothing end if if blnResults = false then '5/02/05 - If no results are returned %>

The Search Returned No Results. Please try again.

<% end if %>