home *** CD-ROM | disk | FTP | other *** search
/ ftp.rsa.com / 2014.05.ftp.rsa.com.tar / ftp.rsa.com / pub / partner_engineering / ClearTrust / Verity / header.jnc next >
Text File  |  2014-05-02  |  7KB  |  206 lines

  1. <%@ include file="HTMLEncode.jnc" %>
  2. <%@ include file="cookies.jnc" %>
  3.  
  4. <%  
  5.     // Initialize the servlet context.
  6.     ServletContext contxt = getServletConfig().getServletContext();
  7.     
  8.     // Get all the tab names and the URLs and view source links. 
  9.     Vector tabs = new Vector();
  10.     Vector tabURLs = new Vector();
  11.     Vector tabViewSource = new Vector();
  12.     int Hdri = 1;
  13.     
  14.     String tabi = "tab";
  15.     tabi = tabi + Integer.toString(Hdri);
  16.     
  17.     String s = null;
  18.     while  ((s = contxt.getInitParameter(tabi)) != null){
  19.         tabs.addElement(s);
  20.         
  21.         // Get the URL associated with this tab
  22.         tabi = tabi + "URL";
  23. // <Bruce Bordelon>
  24. //  changed reference to /verity_templates to request.getContextPath()
  25. //  so that contexts could be arbitrary
  26.         String tabURL = request.getContextPath() + contxt.getInitParameter(tabi);
  27. // </Bruce Bordelon>
  28.         tabURLs.addElement(tabURL);
  29.         
  30.         // Get the view sourceURL associated with this tab
  31.         tabi = tabi + "VS";
  32. // <Bruce Bordelon>
  33. //  changed reference to /verity_templates to request.getContextPath()
  34. //  so that contexts could be arbitrary
  35.         String tabVS = request.getContextPath() + contxt.getInitParameter(tabi);
  36. // </Bruce Bordelon>
  37.         tabViewSource.addElement(tabVS);
  38.         
  39.         Hdri++;
  40.         tabi = "tab" + Integer.toString(Hdri);
  41.     }
  42.  
  43.     String hdrSSpec = request.getParameter("serverSpec");
  44.     if(hdrSSpec == null || hdrSSpec.equals("")){
  45.         hdrSSpec = (String)System.getProperty("VERITY_K2_HOSTPORT");
  46. // <Bruce Bordelon>
  47. //  also check the context configuration for the VERITY_K2_HOSTPORT property
  48.     if (hdrSSpec == null || hdrSSpec.equals(""))
  49.       hdrSSpec = (String)getServletConfig().getServletContext().getInitParameter("VERITY_K2_HOSTPORT");
  50. // </Bruce Bordelon>
  51.     }
  52.  
  53. %>
  54. <html>
  55. <script language="Javascript">
  56.  
  57. function focusQueryText() {
  58.  
  59.     // Search/AdvSearch/Recommendation search query text box
  60.     if(document.echo && document.echo.QueryText){ 
  61.         document.echo.QueryText.focus();
  62.     }
  63.     
  64.     // Browse search query text box    
  65.     else if(document.Content && document.Content.QueryText){
  66.         document.Content.QueryText.focus();
  67.     }
  68. }
  69.  
  70. //function ticketprompt(){
  71. //   var rATTR = "copyhistory=no,directories=no,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no,height=325,width=300";
  72. //   var url = '../ticket.jsp?serverSpec=' + '<%=hdrSSpec%>';
  73. //   window.open(url, "", rATTR);       
  74. //}
  75.  
  76. //function logout(){
  77. //   var rATTR = "copyhistory=no,directories=no,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no,height=325,width=300";
  78. //   var url = '../ticket.jsp?logout=true&serverSpec=' + '<%=hdrSSpec%>';
  79. //   window.open(url, "", rATTR);
  80. //}  
  81.  
  82. <%
  83.   // <Bruce Bordelon>
  84.   //  Javascript function added to popup doc view windows instead of just using a TARGET spec
  85. %>
  86. function popup(wdwName){
  87.     viewwdw = window.open("<%=request.getContextPath()%>/common/blank.html",wdwName,'width=800,height=600,scrollbars=yes,resizable=yes,location=yes,toolbar=yes,status=yes');
  88.     viewwdw.focus();
  89.     //viewwdw.location.href=href;
  90.     //return false;
  91. }
  92. <%
  93.   // </Bruce Bordelon>
  94. %>
  95.  
  96. </script>
  97.     <head>
  98.         <title>Verity K2 Enterprise</title>
  99. <%
  100. // <Bruce Bordelon>
  101. //  changed reference to /verity_templates to request.getContextPath()
  102. //  so that contexts could be arbitrary
  103. %>
  104.         <link rel="stylesheet" href="<%=request.getContextPath()%>/common/site.css">
  105. <%
  106. // </Bruce Bordelon>
  107. %>
  108.         <script type="text/javascript" src="../../common/check_all.js"></script>
  109.     </head> 
  110.  
  111.     <body bgcolor="#ffffff" onload="focusQueryText();">        
  112.     <table border="0" cellpadding="0" cellspacing="0" width="100%">         
  113.         <tr>
  114.             <td>                    
  115. <%          int HdrTabNum;
  116.             for (HdrTabNum = 0; HdrTabNum < tabViewSource.size(); HdrTabNum++){
  117.                 if (HdrTabNum == currentTab){ //currentTab is defined in main page.
  118. %>
  119.                    <b><A target = "view_source" href=<%=(String)tabViewSource.elementAt(HdrTabNum)%>>view source</a> </b> 
  120. <%              }   
  121.             }   
  122. %>      
  123.  
  124. <%
  125.             String enableTicket = contxt.getInitParameter("EnableTicket");
  126.             if( enableTicket != null && enableTicket.equals("1") )
  127.             {
  128. %>
  129. <%@ include file="../jsp/ticket.jnc"%>
  130. <%              HttpSession Hdrsess = request.getSession(true);
  131.                 String Hdrticket = (String)Hdrsess.getAttribute("ticket");
  132.                 String HdrUser = (String)Hdrsess.getAttribute("user");
  133.                 String strCookieLoggedOn = getCookieValue(request.getCookies(),"SAMPLE_TEMPLATES_LOGGEDON", "");
  134.                 
  135. //                if ((Hdrticket == null) || (Hdrticket.equals(""))) {  
  136. //                    if ( !strCookieLoggedOn.equals("") ) {  // session has timed out
  137.  
  138.                             %>
  139.                               
  140.  
  141. <!--                            <script type="text/javascript">ticketprompt();</script> -->
  142.                             <%
  143. //                    }
  144. %>                 <!-- <A href="javascript:ticketprompt();">login</a></b> -->      </td> 
  145. <%
  146. //                } else {
  147. %>                  User: <%=HdrUser%> </b></td>
  148. <%                }   %>
  149. <%          }   %>
  150.             <td align="right" rowspan="2">
  151.                 <div align="right">
  152. <%
  153. // <Bruce Bordelon>  
  154. //  add a version indicator 
  155. %>
  156. <font size="-2"><i>v 1.3</i></font>
  157. <%
  158. // </Bruce Bordelon>   
  159. %>
  160. <%
  161. // <Bruce Bordelon>
  162. //  changed reference to /verity_templates to request.getContextPath()
  163. //  so that contexts could be arbitrary
  164. %>
  165.                 <a target = "verity_home" href="http://www.verity.com"><IMG border=0 height=66 src="<%=request.getContextPath()%>/images/verity_logo.gif" vspace=7 width=133></a></div></td>    
  166. <%
  167. // </Bruce Bordelon>
  168. %>
  169.         </tr>           
  170.         <tr>                
  171.             <td align="left" valign="bottom">                   
  172.                 <table border="0" cellpadding="0" cellspacing="0">                      
  173.                     <tr>
  174. <%                      for (HdrTabNum = 0; HdrTabNum < tabs.size(); HdrTabNum++){
  175.                             if (HdrTabNum == currentTab){ // currentTab is defined in main page.
  176. %>
  177. <%
  178. // <Bruce Bordelon>
  179. //  changed reference to /verity_templates to request.getContextPath()
  180. //  so that contexts could be arbitrary
  181. %>
  182.                                 <td><IMG border=0 height=19 id=IMG1 src="<%=request.getContextPath()%>/images/tabs_0<%=HdrTabNum+1%>.gif" ></td>
  183. <%
  184. // </Bruce Bordelon>
  185. %>
  186. <%                          } else {
  187. %>
  188. <%
  189. // <Bruce Bordelon>
  190. //  changed reference to /verity_templates to request.getContextPath()
  191. //  so that contexts could be arbitrary
  192. %>
  193.                                 <td><a href=<%=(String)tabURLs.elementAt(HdrTabNum)%>?serverSpec=<%=hdrSSpec%> target="_top"><IMG border=0 height=19 id=IMG1 src="<%=request.getContextPath()%>/images/tabs_black_0<%=HdrTabNum+1%>.gif" ></a></td>
  194. <%
  195. // </Bruce Bordelon>
  196. %>
  197. <%                          
  198.                             }   
  199.                         }   
  200. %>      
  201.                     </tr>                   
  202.                 </table>                
  203.             </td>           
  204.         </tr>       
  205.     </table>        
  206.