?? advancedlogfiltermodehtml.jspf
字號:
<% String[] eventnames = logbean.getAllLocalEventNames(); String[] modulenames = logbean.getLocalModuleNames(ejbcawebbean); HashMap eventtexttoid = logbean.getEventNameToIdMap(); HashMap moduletexttoid = logbean.getModuleNameToIdMap(); HashMap caidtonamemap = ejbcawebbean.getInformationMemory().getCAIdToNameMap(); Collection authorizedcaids = ejbcawebbean.getAuthorizedCAIds(); String[] admintypes = new String[ADMINTYPES.length]; for(int i=0; i < ADMINTYPES.length; i++){ admintypes[i] = ejbcawebbean.getText(ADMINTYPES[i]); } String[] connectorreferences = {"AND","OR","ANDNOT","ORNOT"}; String[] monthreferences = {"MONTHJAN","MONTHFEB","MONTHMAR","MONTHAPR","MONTHMAY","MONTHJUN","MONTHJUL","MONTHAUG","MONTHSEP" ,"MONTHOCT","MONTHNOV","MONTHDEC"}; Calendar calendar = Calendar.getInstance(); int dayofmonth = calendar.get(Calendar.DAY_OF_MONTH); int month = calendar.get(Calendar.MONTH); int year = calendar.get(Calendar.YEAR); int hour = calendar.get(Calendar.HOUR_OF_DAY); hour++; if(hour >= 24) hour =0; int index; // Build sorted CA name List TreeMap canameandids = new TreeMap(); Iterator iter = authorizedcaids.iterator(); while(iter.hasNext()){ Object obj = iter.next(); canameandids.put(caidtonamemap.get(obj),obj); } %> <script language=javascript><!-- var ID = 0; var NAME = 1; var eventfields = new Array(2); eventfields[ID] = new Array(<%= eventnames.length %>); eventfields[NAME] = new Array(<%= eventnames.length %>); <% for(int i = 0; i < eventnames.length; i++){ %> eventfields[ID][<%=i %>] = "<%=eventtexttoid.get(eventnames[i]) %>"; eventfields[NAME][<%=i %>] = "<%=eventnames[i] %>"; <% } %> var cafields = new Array(2); cafields[ID] = new Array(<%= authorizedcaids.size() %>); cafields[NAME] = new Array(<%= authorizedcaids.size() %>); <% Iterator canameiter = canameandids.keySet().iterator(); for(int i=0; i < canameandids.keySet().size(); i++){ String caname = (String) canameiter.next(); %> cafields[ID][<%=i%>] = <%= ((Integer) canameandids.get(caname)).toString() %>; cafields[NAME][<%=i%>] = "<%= caname%>"; <% } %> var modulefields = new Array(2); modulefields[ID] = new Array(<%= modulenames.length %>); modulefields[NAME] = new Array(<%= modulenames.length %>); <% for(int i = 0; i < modulenames.length; i++){ %> modulefields[ID][<%=i %>] = "<%=moduletexttoid.get(modulenames[i]) %>"; modulefields[NAME][<%=i %>] = "<%=modulenames[i] %>"; <% } %> var admintypes = new Array(2); admintypes[ID] = new Array(<%= ADMINTYPES.length %>); admintypes[NAME] = new Array(<%= ADMINTYPES.length %>); <% for(int i = 0; i <ADMINTYPES.length ; i++){ %> admintypes[ID][<%=i %>] = "<%=i%>"; admintypes[NAME][<%=i %>] = "<%=ejbcawebbean.getText(ADMINTYPES[i])%>"; <% } %> var matchtypefields = new Array(2); matchtypefields[ID] = new Array(2); matchtypefields[ID][0]= <%= BasicMatch.MATCH_TYPE_EQUALS %>; matchtypefields[ID][1] = <%= BasicMatch.MATCH_TYPE_BEGINSWITH %>; matchtypefields[ID][2] = <%= BasicMatch.MATCH_TYPE_CONTAINS %>; matchtypefields[NAME] = new Array(3); matchtypefields[NAME][0] = "<%= ejbcawebbean.getText("EQUALS") %>"; matchtypefields[NAME][1] = "<%= ejbcawebbean.getText("BEGINSWITH") %>"; matchtypefields[NAME][2] = "<%= ejbcawebbean.getText("CONTAINS") %>";function changematchfields(row){ // check value on matchwith matchwith = eval("document.form.selectmatchwithrow" + row); matchtype = eval("document.form.selectmatchtyperow" + row); textmatchvalue = eval("document.form.textfieldmatchvaluerow" + row); menumatchvalue = eval("document.form.selectmatchvaluerow" + row); var index = matchwith.selectedIndex; var numofvalues; matchwithvalue = matchwith[index].value; var i; // if eventname use menu and no texfield if(matchwithvalue == <%= LogMatch.MATCH_WITH_EVENT %> ){ menumatchvalue.disabled = false; textmatchvalue.disabled = true; textmatchvalue.value= ""; textmatchvalue.size=1; var numoftypes = matchtype.length; for( i=numoftypes-1; i >= 0; i-- ){ matchtype.options[i]=null; } matchtype.options[0]= new Option(matchtypefields[NAME][0],matchtypefields[ID][0]); numofvalues = menumatchvalue.length; for(i=numofvalues-1; i >= 0; i--){ menumatchvalue.options[i]=null; } for( i = 0; i < eventfields[ID].length; i++){ menumatchvalue.options[i]= new Option(eventfields[NAME][i],eventfields[ID][i]); } }else{ if(matchwithvalue == <%= LogMatch.MATCH_WITH_CA %> ){ menumatchvalue.disabled = false; textmatchvalue.disabled = true; textmatchvalue.value= ""; textmatchvalue.size=1; var numoftypes = matchtype.length; for( i=numoftypes-1; i >= 0; i-- ){ matchtype.options[i]=null; } matchtype.options[0]= new Option(matchtypefields[NAME][0],matchtypefields[ID][0]); numofvalues = menumatchvalue.length; for(i=numofvalues-1; i >= 0; i--){ menumatchvalue.options[i]=null; } for( i = 0; i < cafields[ID].length; i++){ menumatchvalue.options[i]= new Option(cafields[NAME][i],cafields[ID][i]); } } else{ if(matchwithvalue == <%= LogMatch.MATCH_WITH_MODULE %> ){ menumatchvalue.disabled = false; textmatchvalue.disabled = true; textmatchvalue.value= ""; textmatchvalue.size=1; var numoftypes = matchtype.length; for( i=numoftypes-1; i >= 0; i-- ){ matchtype.options[i]=null; } matchtype.options[0]= new Option(matchtypefields[NAME][0],matchtypefields[ID][0]); numofvalues = menumatchvalue.length; for(i=numofvalues-1; i >= 0; i--){ menumatchvalue.options[i]=null; } for( i = 0; i < modulefields[ID].length; i++){ menumatchvalue.options[i]= new Option(modulefields[NAME][i],modulefields[ID][i]); } } else{ // if admintype use manu and no textfield. if(matchwithvalue == <%= LogMatch.MATCH_WITH_SPECIALADMIN %> ){ menumatchvalue.disabled = false; textmatchvalue.disabled = true; textmatchvalue.value= ""; textmatchvalue.size=1; var numoftypes = matchtype.length; for( i=numoftypes-1; i >= 0; i-- ){ matchtype.options[i]=null; } matchtype.options[0]= new Option(matchtypefields[NAME][0],matchtypefields[ID][0]); numofvalues = menumatchvalue.length; for(i=numofvalues-1; i >= 0; i--){ menumatchvalue.options[i]=null; } for( i = 0; i < admintypes[ID].length; i++){ menumatchvalue.options[i]= new Option(admintypes[NAME][i],admintypes[ID][i]); } } else{ // else use textfield. var numoftypes = matchtype.length; for(i=numoftypes-1; i >= 0; i-- ){ matchtype.options[i]=null; } matchtype.options[0]= new Option(matchtypefields[NAME][0],matchtypefields[ID][0]); matchtype.options[1]= new Option(matchtypefields[NAME][1],matchtypefields[ID][1]); matchtype.options[2]= new Option(matchtypefields[NAME][2],matchtypefields[ID][2]); numofvalues = menumatchvalue.length; for(i=numofvalues-1; i >= 0; i--){ menumatchvalue.options[i]=null; } menumatchvalue.disabled = true; textmatchvalue.disabled = false; textmatchvalue.size=40; } } } }}function checkfields(){ var returnval =true; // Check if matchwithfield is admin cert or certificate when check and replace spaces in hex serial number. var matchwithrows1 = eval("document.form.selectmatchwithrow1"); var matchwithrows2 = eval("document.form.selectmatchwithrow2"); var matchwithrows3 = eval("document.form.selectmatchwithrow3"); if(matchwithrows1[matchwithrows1.selectedIndex].value == <%=LogMatch.MATCH_WITH_CERTIFICATE %> || matchwithrows1[matchwithrows1.selectedIndex].value == <%= LogMatch.MATCH_WITH_ADMINCERTIFICATE%>) if(!checkfieldforhexadecimalnumbers("document.form.selectmatchwithrow1", "<%= ejbcawebbean.getText("ONLYHEXNUMBERS") %>")) returnval = false; if(matchwithrows2[matchwithrows2.selectedIndex].value == <%= LogMatch.MATCH_WITH_CERTIFICATE %> || matchwithrows2[matchwithrows2.selectedIndex].value == <%= LogMatch.MATCH_WITH_ADMINCERTIFICATE%>) if(!checkfieldforhexadecimalnumbers("document.form.selectmatchwithrow2" , "<%= ejbcawebbean.getText("ONLYHEXNUMBERS") %>")) returnval = false; if(matchwithrows3[matchwithrows3.selectedIndex].value == <%= LogMatch.MATCH_WITH_CERTIFICATE %> || matchwithrows3[matchwithrows3.selectedIndex].value == <%= LogMatch.MATCH_WITH_ADMINCERTIFICATE%>) if(!checkfieldforhexadecimalnumbers("document.form.selectmatchwithrow3" , "<%= ejbcawebbean.getText("ONLYHEXNUMBERS") %>")) returnval = false; return returnval; } --></script><table width="100%" border="0" cellspacing="1" cellpadding="0"> <tr> <td width="2%"> </td> <td width="5%" align="left"> </td> <td width="93%" align="left"> <% int tempval = -1; if(oldmatchwithrow1!= null) tempval= Integer.parseInt(oldmatchwithrow1); %> <select name="<%=SELECT_MATCHWITH_ROW1 %>" onchange='changematchfields(1)' > <option value='<%= VALUE_NONE %>'><%= ejbcawebbean.getText("NONE") %> </option> <option <% if(tempval == LogMatch.MATCH_WITH_EVENT) out.write(" selected "); %> value='<%= LogMatch.MATCH_WITH_EVENT %>'><%= ejbcawebbean.getText("MATCHEVENT") %> </option> <option <% if(tempval == LogMatch.MATCH_WITH_CA) out.write(" selected "); %> value='<%= LogMatch.MATCH_WITH_CA %>'><%= ejbcawebbean.getText("MATCHCA") %> </option> <option <% if(tempval == LogMatch.MATCH_WITH_MODULE) out.write(" selected "); %> value='<%= LogMatch.MATCH_WITH_MODULE %>'><%= ejbcawebbean.getText("MATCHMODULE") %> </option> <option <% if(tempval == LogMatch.MATCH_WITH_USERNAME) out.write(" selected "); %> value='<%= LogMatch.MATCH_WITH_USERNAME %>'><%= ejbcawebbean.getText("MATCHUSERNAME") %> </option> <option <% if(tempval == LogMatch.MATCH_WITH_CERTIFICATE) out.write(" selected "); %> value='<%= LogMatch.MATCH_WITH_CERTIFICATE %>'><%= ejbcawebbean.getText("MATCHCERTIFICATE") %> </option> <option <%if(tempval == LogMatch.MATCH_WITH_SPECIALADMIN) out.write(" selected "); %> value='<%= LogMatch.MATCH_WITH_SPECIALADMIN %>'><%= ejbcawebbean.getText("MATCHADMINTYPE") %> </option> <option <% if(tempval == LogMatch.MATCH_WITH_ADMINCERTIFICATE) out.write(" selected "); %> value='<%= LogMatch.MATCH_WITH_ADMINCERTIFICATE %>'><%= ejbcawebbean.getText("MATCHADMINCERT") %> </option> <option <% if(tempval == LogMatch.MATCH_WITH_IP) out.write(" selected "); %> value='<%= LogMatch.MATCH_WITH_IP %>'><%= ejbcawebbean.getText("MATCHADMINIP") %> </option> <option <%if(tempval == LogMatch.MATCH_WITH_COMMENT) out.write(" selected "); %> value='<%= LogMatch.MATCH_WITH_COMMENT %>'><%= ejbcawebbean.getText("MATCHCOMMENT") %> </option> </select> <% tempval = -1; if(oldmatchtyperow1!= null) tempval= Integer.parseInt(oldmatchtyperow1); %> <select name="<%=SELECT_MATCHTYPE_ROW1 %>"> <% if(oldmatchwithrow1 != null){ if(Integer.parseInt(oldmatchwithrow1) == LogMatch.MATCH_WITH_EVENT || Integer.parseInt(oldmatchwithrow1) == LogMatch.MATCH_WITH_MODULE || Integer.parseInt(oldmatchwithrow1) == LogMatch.MATCH_WITH_SPECIALADMIN || Integer.parseInt(oldmatchwithrow1) == LogMatch.MATCH_WITH_CA){ %> <option <% if(tempval == BasicMatch.MATCH_TYPE_EQUALS){ out.write(" selected "); } %> value='<%= Integer.toString(BasicMatch.MATCH_TYPE_EQUALS) %>'><%= ejbcawebbean.getText("EQUALS") %> </option> <% } else{ %> <option <% if(tempval == BasicMatch.MATCH_TYPE_EQUALS){ out.write(" selected ");
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -