confTranscodeSearch.jsp 4.02 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144
<%@ include file="/project/include.jsp" %>	
<script type="text/javascript">
	function prepareToCreateTranscode() {
		var dataRif = document.getElementById('dataInizioCLD').value;
		var tipo = getComboValueById('selectTipo');
		
		if (dataRif == '') {
			alert('Inserire la data di riferimento.');
			return;
		}
		dataRif = completeDateString(dataRif);				
		if (dataRif == null) {
			alert('Inserire una data nel formato: gg/mm/aaaa.');
			return;			
		}
		if (tipo == '') {
			alert('Scegliere il tipo di nomenclatore.');
			return;
		}
		
		params = 'dataRif=' + dataRif + '&tipo=' + tipo;
		buiPrepareToCreate(-1, params);
	}
	
	function exportTranscodeIass() {
		juiceDownload('it.cedaf.icare.iass.etc.ExportTranscodeIassFileContentProvider');
	}
	
	function exportConfigurazioneIass() {
		juiceDownload('it.cedaf.icare.iass.etc.ExportConfigurationIassFileContentProvider');
	}
	
	function importConfigurazioneIass() {
		if(confirm('Attenzione. Importando una nuova configurazione, la precedente verr completamente eliminata.\nContinuare?')) {
			shellFileUploadDialog(
				'it.cedaf.icare.iass.control.action.ImportConfigurazioneFileUploadExecutor', 
				'Scegliere il file...', 
				"Seleziona il file xml che si intende importare:", 
				'importaConfigurazione');
		}
	
		
	}
	
	function importaConfigurazione() {
    	jsLoadMap('it.cedaf.icare.iass.control.action.ImportConfigurazioniExecutor', null, 'importConfigurazioniHandler', JS_SYNC);
    }
    
    function importConfigurazioniHandler(map){
		var result = map.get('result');
		var log = "";
		if (result == 'OK') {
			document.getElementById('idTrOk').style.display = '';
			document.getElementById('idTrErrore').style.display = 'none';
			var nrImport = map.get('nrImport');
			log = 'Importati ' + nrImport + ' records.';
			document.getElementById('txtLog').value = log;
		} else {
			document.getElementById('msgErrore').innerHTML = result;
			document.getElementById('idTrOk').style.display = 'none';
			document.getElementById('idTrErrore').style.display = '';
			log = 'Elenco problemi: \n';
			var nrLine = map.get('nrLine');
			if (nrLine > 0) {
				for (var i = 0; i < nrLine; i++ ) {
					log += ' - ' + map.get('line_' + i) + '\n';
				}
				document.getElementById('txtLog').value = log;
			} else {
				document.getElementById('txtLog').value = '';
			}
		}
				
		var rec = getClientAreaRectangle().resize(500, 350, HORIZONTAL_CENTER | VERTICAL_CENTER);
		var buttons = [
   			{ 'img'		: juiceGetResource('shell', 'img/misc/confirm-small.gif'),
   			  'text'	: 'Chiudi',
   			  'onclick'	: 
   			  	function() { 
   					hideModal('idImportConfigurazioniResult');
   				}
   			}
   		];
   		showDivModal('idImportConfigurazioniResult', 'Importazione configurazione', rec, true, false, buttons);		
	}
	
	function verifyIassTranscode() {
		shellDownload('it.cedaf.icare.iass.etc.ControlloTranscodeFileContentProvider');
	}
	
</script>

<div id="idImportConfigurazioniResult" class="modalElement">
	<table width="100%" style="padding: 4px 4px 4px 4px;">
		<tr id="idTrErrore" style="display:none;">
			<td class="form-label">
				<span id="msgErrore"/>
			</td>			
		</tr>
		<tr id="idTrOk" style="display:none;">
			<td class="form-label">
				Importazione terminata correttamente.
			</td>
		</tr>
		<tr>
			<td class="form-values">
				<textarea id="txtLog" rows="12" cols="60" readonly>
				</textarea>
			</td>
		</tr>		
	</table>
</div>

<shell:fieldset title="Parametri di ricerca">
	<table border="0" cellpadding="0" cellspacing="3">
		<tr>
			<td class="form-label">
				<shell:label prop="dataValidita" />
			</td>
			<td class="form-values">
				<j:bind prop="dataValidita">
					<j:text class="form-date" id="dataInizioCLD" />
					<shell:calendar inputId="dataInizioCLD" />
					<shell:error />
				</j:bind>	
			</td>
		</tr>
		<tr>
			<td class="form-label">
				<shell:label prop="tipo" />
			</td>
			<td class="form-values">
				<j:bind prop="tipo">
					<j:select id="selectTipo" class="form-input" emptyOptionDescr=" " />
					<shell:error />
				</j:bind>	
			</td>
		</tr>
	</table>
</shell:fieldset>