Files
gateway-mnp-dbc/dbcmnpsrc/FE/mnpdev/crontab/web/jsp/GUI/Configurazione.jsp
2024-05-13 12:54:14 +02:00

170 lines
5.1 KiB
Plaintext

<%@page import = "mnp.crontab.objects.ui.TaskBean"%>
<%@page import = "mnp.crontab.command.CrontabCostants"%>
<%@page import = "mnp.crontab.utility.Resources"%>
<%@page import = "mnp.crontab.config.ui.ProfileConfig"%>
<%@page import = "mnp.crontab.database.dao.ProfiloDAO"%>
<%@page import = "mnp.crontab.objects.ui.LoginBean"%>
<%@page import = "mnp.crontab.command.AmministrazioneCostants"%>
<%@page import = "java.io.*"%>
<HTML>
<head>
<TITLE>
Mnp
</TITLE>
<script language = "Javascript">
function controllo()
{
document.formCentrale.Ripristina.value=document.formCentrale.nuovoFile.value
if (document.formCentrale.nuovoFile.value !='')
messageAlert(document.formCentrale,<%= CrontabCostants.CMD_RELOAD_XML %>,'Ripristinare il file XML.','Index.do' )
else
alert('Errore.Inserire almeno un carattere');
}
</script>
<%@page import = "mnp.crontab.objects.*, mnp.crontab.utility.ui.Res"%>
<jsp:include page="/jsp/VerificheScriptCrontab.txt" flush = "true"/>
<%
String pathFileCfg = (String)request.getAttribute(CrontabCostants.OBJECT_RESULT_BEAN);
String xmlVer = (String)request.getAttribute(CrontabCostants.XML_CONF_VER);
String xmlSubVer = (String)request.getAttribute(CrontabCostants.XML_CONF_SUBVER);
String xmlName = (String)request.getAttribute(CrontabCostants.XML_CONF_NAME);
LoginBean aLoginBean = (LoginBean) session.getAttribute(AmministrazioneCostants.OBJECT_LOGINBEAN_SESSION);
ProfiloDAO pr = new ProfiloDAO();
ProfileConfig _prConf = pr.listFunctionApplication(aLoginBean.getCodiceProfilo(), ProfileConfig.DOMINIO_CRONTAB,ProfileConfig.LISTA_CONFIGURAZIONE);
%>
<form method="post" action="" name="formCentrale">
<INPUT type="hidden" name="JSP_FUNCTION" value="">
<INPUT type="hidden" name="Ripristina" value="">
<BODY>
<!-- tabella che include il menu verticale -->
<table width = "100%" class = "tableBannerRosso" border = 0>
<tr>
<td align = "left" width = "100%"><IMG border = 0 SRC ="<%=Res.ApplContext%>/images/banner.gif"></td>
</tr>
</table>
<table width = "100%" border = "0">
<tr>
<td width = "10%">
<jsp:include page="/jsp/GUI/Banner.jsp" flush = "true"/>
</td>
<td width = "90%" valign="top">
<DIV align="center">
<center>
<table border="0" width="100%">
<tr align = "center" valign = "top" width="45%" bgcolor="#D61414">
<td><b><i>
<P class="Titolo"><font color="#FFFFFF">
<%= (String)Resources.getDay()%></font></P></i></b>
</td>
<td align = "right" valign = "top" width="45%" bgcolor="#D61414">
<b><i>
<P class="Titolo"><font color="#FFFFFF">CONFIGURAZIONE ver: <%=xmlVer%> subver: <%=xmlSubVer%></font></P></i></b>
</td>
</tr>
<tr >
<td align = "right" valign = "top" width="85%" colspan="5">
&nbsp;
</td>
</tr>
</table>
<p align='center'>
<table width = '664' border='0'>
<tr >
<td align = "left" valign = "top" width="636" colspan="3" bgcolor="#000080">
<b><i>
<P class="Titolo"><font color="#FFFFFF">Configurazione del file xml: <%=pathFileCfg%></font></P></i></b>
</td>
</tr>
<tr>
<td align= 'center' width="158">&nbsp;
<p>&nbsp;</td>
<td align= 'center' width="325"></td>
<td align= 'center' width="161"></td>
</tr>
<% if (_prConf.visualizzaFunction(String.valueOf(CrontabCostants.CMD_SAVE_XML)))
{ %>
<tr>
<td align= 'center' bgcolor="#FFFFCC" width="158"><i><b>Salva file&nbsp;</b></i></td>
<td align= 'left' colspan="2" width="492" >
<TABLE height="17" border="0" width="30%">
<TR >
<td height="17" nowrap align="center" width="50%" class="hmenu"><A class="hmenu" href="javascript:messageAlert(document.formCentrale,<%= CrontabCostants.CMD_SAVE_XML %>,'Salvare il file XML.','Index.do' )"> Salva</A></TD>
</tr>
</Table>
</td>
</tr>
<% } %>
<tr>
<td align= 'center' width="158" >&nbsp;
<p>&nbsp;</td>
<td align= 'center' width="325" ></td>
<td align= 'center' width="161" ></td>
</tr>
<tr>
<td align= 'center' bgcolor="#FFFFCC" width="158"><b><i>Ripristina file</i></b></td>
<td align= 'center' width="325" >
<SELECT name="nuovoFile" >
<%
File fileDir = new File(pathFileCfg).getParentFile();
File[] listFile = fileDir.listFiles(new FileFilter()
{
public boolean accept(File file)
{
org.apache.regexp.RE regExp = new org.apache.regexp.RE(Resources.getFormatoFileXML_CONF());
//System.out.println("nomeFile: " + file.getName() + " - regExp.match(): " + regExp.match(file.getName()));
return regExp.match(file.getName());
}
});
for (int i = 0; i < listFile.length; i++) {
if(!listFile[i].isDirectory())
{
%>
<OPTION value="<%=listFile[i].getAbsolutePath()%>"> <%=listFile[i].getName()%></OPTION>
<%
}
}
%>
</SELECT>
</td>
<td align= 'center' width="161" >
<center>
<TABLE height="17" border="0" width="60%">
<TR >
<td height="17" nowrap align="center" width="50%" class="hmenu"><A class="hmenu" href="javascript:controllo()">Ripristina</A></TD>
</tr>
</Table>
</center>
</td>
</tr>
<tr>
<td align= 'center' width="158" >&nbsp;
<p>&nbsp;</td>
<td align= 'center' width="325" ></td>
<td align= 'center' width="161" ></td>
</tr>
</table>
</center>
<p align='center'>
&nbsp;
</div>
</table>
<!-- tabella x menu -->
</BODY>
</form>
</HTML>