Edit C:\galaxie\deploy\Tomcat6\webapps\galaxie\admin\metadatatransfer\read.jsp
<%@page session="true" import="com.edeal.frontline.*"%> <%@page import="java.util.*"%> <%@ page import="com.edeal.frontline.navigation.FlRequest"%> <%@ page import="com.edeal.frontline.MetaDataTransferBean"%> <%@page import="com.edeal.frontline.transfer.TransferInitializer"%> <%@taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl"%> <link rel="stylesheet" type="text/css" href="<fl:webapp/>/css/smalltabs_css.jsp"> <jsp:useBean class="com.edeal.frontline.MetaDataTransferBean" id="MetaDataTransfer" scope="request" /> <% FlRequest flRequest = new FlRequest(request); FlContext context = flRequest.getContext(); DataDictionary dico = context.getDataDictionary(); String errorMsg=""; String id = null; try { id = MetaDataTransfer.getID(); } catch (FieldNotInitializedException e) { } try { errorMsg = MetaDataTransfer.getMdtErrorMsg(); } catch (FieldNotInitializedException e) { } String query = null; try{ query = flRequest.getRequestParameterOrAttribute("query"); }catch(Exception e){ } if(query==null){ query = ""; } Vector<Hashtable> objects = (Vector<Hashtable>)flRequest.getAttribute("objects"); Vector<Vector> mocPolitiqueValues = dico.getRefList("MocPolitique"); Integer total = (Integer) request.getAttribute(TransferInitializer.COUNT_ATTR); Integer applied = (Integer) request.getAttribute(TransferInitializer.APPL_ATTR); if (total == null) { total = 0; } if (applied == null) { applied = 0; } String mdtStatus = ""; try { mdtStatus = MetaDataTransfer.getMdtStatus(); mdtStatus = dico.getRefCode("MdtStatus", mdtStatus); } catch (Exception e) { } %> <style> .creationLine{ background-color : #62A9FF; border-bottom: 1px solid #CCC; } .modificationLine{ background-color : #8DEEEE; border-bottom: 1px solid #CCC; } .appliedLine{ background-color : #00CC00; border-bottom: 1px solid #CCC; } .fieldchangeHeader{ color : #84A6AE; border-bottom: 1px solid #CCC; } .fieldchangeGlobalHeader{ color : #84A6AE; font-weight: bold; } </style> <script type="text/javascript"> function change_display(obj, id){ isCollapsed = obj.attr('ed:iscollapsed'); if(isCollapsed == 'true'){ $('#'+id).show(); obj.attr('src', '<fl:webapp/>/admin/metadatatransfer/icons/minus.gif'); obj.attr('ed:iscollapsed', 'false'); }else{ $('#'+id).hide(); obj.attr('src', '<fl:webapp/>/admin/metadatatransfer/icons/plus.gif'); obj.attr('ed:iscollapsed', 'true'); } } function toggleDisplay(){ var isCollapsed = $("#global_displayer").attr('ed:iscollapsed'); if (isCollapsed == 'true') { expandAll(); } else { collapseAll(); } } function collapseAll() { var obj = $("#global_displayer"); obj.attr("ed:iscollapsed", "true"); obj.attr('src', '<fl:webapp/>/admin/metadatatransfer/icons/plus.gif'); $("#keyFields").show(); $("#ignoredFields").show(); $('.fieldchangeGlobalHeader').each(function(index){ $(this).hide(); }); $('.fieldchangeHeader').each(function(index){ $(this).show(); }); $('.fields_part').each(function(index){ $(this).hide(); $(this).prev().find('img').attr('src', '<fl:webapp/>/admin/metadatatransfer/icons/plus.gif'); $(this).prev().find('img').attr('ed:iscollapsed', 'true'); }); } function expandAll() { var obj = $("#global_displayer"); obj.attr("ed:iscollapsed", "false"); obj.attr('src', '<fl:webapp/>/admin/metadatatransfer/icons/minus.gif'); $("#keyFields").hide(); $("#ignoredFields").hide(); $('.fieldchangeGlobalHeader').each(function(index){ $(this).show(); }); $('.fieldchangeHeader').each(function(index){ $(this).hide(); }); $('.fields_part').each(function(index){ $(this).show(); $(this).prev().find('img').attr('src', '<fl:webapp/>/admin/metadatatransfer/icons/minus.gif'); $(this).prev().find('img').attr('ed:iscollapsed', 'false'); }); } $(function () { criteria_change(); collapseAll(); }); function global_politic_changed(obj){ if($(obj).val() != ''){ mocPolitic = $(obj).val(); $('.politic').each(function(index){ mocID = $(this).attr('ed:mocid'); update_politic(mocID, mocPolitic, true); $(this).val(mocPolitic); }); $('.object_politic').each(function(index){ objID = $(this).attr('ed:objid'); update_obj_politic(objID, mocPolitic, true); $(this).val(mocPolitic); }); } } function politic_changed(obj) { mocID = $(obj).attr('ed:mocid'); mocPolitic = $(obj).val(); update_politic(mocID, mocPolitic, false); } function update_politic(mocID, mocPolitic, fromGlobal){ $.ajax({ url: "<fl:webapp/>/update_moc_politic.fl?mocID="+mocID+"&mocPolitic="+mocPolitic, success: function () { if (!fromGlobal) $("#global_politic").val(''); }, error:function (xhr, ajaxOptions, thrownError){ alert(xhr.status); alert(thrownError); } }); } function criteria_change(){ criteria_change_by_page('first'); } function criteria_change_by_page(action){ if($("#object").val() == "Global"){ get_global_differences(); return; } page = $("#page_number").html(); nbpages = $("#nb_pages").html(); if(page == null) page = 1; if(action == 'first'){ page = 1; }else if(action == 'next'){ page++; }else if(action == 'prev'){ page--; } objID = $("#object").val(); differences = ""; modType = $('#modification_type').val(); if(typeof(modType)=='undefined') modType = ''; var filter = $('#filter').val(); if(filter == "<Filtre>") filter = ""; $.getJSON("<fl:webapp/>/get_selected_object_differences.fl?id=<%=id%>&objID="+objID+"&modType="+modType+"&filter="+filter+"&page="+page, function(data) { $('#moc_detail').html(differences); if(data == null || data.Result == 0){ $("#moc_header").hide(); $("#pager").hide(); $("#no_data").show(); return; }else if(data.Result > 50){ $("#moc_header").show(); $("#pager").show(); $("#no_data").hide(); pager = "<tr class=\"dataLabel\" align=\"center\">"+ "<td colspan=\"3\">"+ "<a id=\"page_first\" href=\"#\" onclick=\"criteria_change_by_page('first');return false;\">"+ "<img src=\"<fl:webapp/>/icons/ico/flecheGdouble.gif\">"+ "</a>"+ "<a id=\"page_prev\" href=\"#\" onclick=\"criteria_change_by_page('prev');return false;\">"+ "<img src=\"<fl:webapp/>/icons/ico/flecheG.gif\">"+ "</a>"+ "Page <span id=\"page_number\">" + data.Page + "</span>/<span id=\"nb_pages\">"+data.NbPages+"</span>"+ "<a id=\"page_next\" href=\"#\" onclick=\"criteria_change_by_page('next');return false;\">"+ "<img src=\"<fl:webapp/>/icons/ico/flecheD.gif\">"+ "</a>"+ "</td>"+ "</tr>"; $("#pager").html(pager); }else{ $("#moc_header").show(); $("#no_data").hide(); $("#pager").html(""); } $("#keyFields").html(" <span class=\"dataLabel\"><fl:getMessage code="M3047" js="true" alt="Champ(s) clé(s)"/></span>: <span class=\"dataValue\" style=\"font-style: italic;\">" + data.KeyFields + "</span>"); if(data.IgnoredFields != 'empty'){ $("#ignoredFields").html(" <span class=\"dataLabel\"><fl:getMessage code="F3127" js="true" alt="Champ(s) ignoré(s)"/></span>: <span class=\"dataValue\" style=\"font-style: italic;\">" + data.IgnoredFields + "</span>"); $("#ignoredFields").show(); }else{ $("#ignoredFields").html(""); } $.each(data.Objects, function(i,object){ //5757FF var cssClass; if (object.Applied == "true") { cssClass = "appliedLine"; } else { cssClass = (object.MocIsNew == "true" )? "creationLine" : "modificationLine"; } mocStatus = (object.MocIsNew == "true" )? "<fl:getMessage code="L2078" alt="Création"/>" : "<fl:getMessage code="L62BA" alt="Modification"/>"; differences += "<tr class=\"" + cssClass + " dataValue\">"+ "<td colspan=\"2\" width=\"99%\"> <img src=\"<fl:webapp/>/admin/metadatatransfer/icons/plus.gif\" onclick=\"change_display($(this), '"+object.MocID+"')\" style=\"cursor: pointer\" ed:iscollapsed=\"true\" /> "+object.MocKey+" :: "+mocStatus+"</td>"; if (object.Applied == "true") { differences += "<td align=\"center\"><fl:getMessage code="M2038" alt="Appliquée" js="true"/>"; } else { differences += "<td align=\"right\"><select class=\"input select politic\" style=\"width: 105px; margin-left: 10px\" onchange=\"politic_changed(this)\" ed:mocid=\""+object.MocID+"\">"+ <%for(Vector<String> mocPolitique : mocPolitiqueValues){ String mocPolitiqueID = mocPolitique.get(0); String mocPolitiqueValue = mocPolitique.get(1); %> "<option value=\"<%= mocPolitiqueID %>\" " + ((object.MocPolitic == '<%=mocPolitiqueID %>')? "selected" : "") +"><%=mocPolitiqueValue %></option>"+ <%} %> "</select>"; } differences += "</td>"+ "</tr>"; differences += "<tr class=\"fields_part\" id=\""+object.MocID+"\">"+ "<td colspan=\"3\">"+ "<table class=\"data_column\" cellpadding=\"0\">"+ "<thead class=\"fieldchangeHeader\">"+ "<th></th>"+ "<th align=\"left\"> <fl:getMessage code="L6258" alt="Champ"/></th>"+ "<th align=\"left\"> <fl:getMessage code="L1051" alt="Ancienne valeur"/></th>"+ "<th align=\"left\"> <fl:getMessage code="L1052" alt="Nouvelle valeur"/></th>"+ "</thead>"+ "<tbody>"; $.each(object.MocChangedFields, function(j,field){ fieldcssClass = ((j % 2 >0)? "tabSimpleFdBlanc" : "tabSimpleFdBleu"); differences +="<tr class=\""+fieldcssClass+" dataValue\">"+ "<td width=\"22%\"></td>"+ "<td width=\"26%\">"+field.FldSql+"</td>"+ "<td width=\"26%\">"+decodeURIComponent(field.MfcOldValue)+"</td>"+ "<td width=\"26%\" style=\"border-right: 1px solid #CCC;\">"+decodeURIComponent(field.MfcNewValue)+"</td>"+ "</tr>"; }); differences += "</tbody>"+ "</table>"+ "</td>"+ "</tr>"; }); if(action == 'first'){ $('#page_first').hide(); $('#page_prev').hide(); $('#page_next').show(); }else if(action == 'next'){ $('#page_first').show(); $('#page_prev').show(); if((page) == nbpages){ $('#page_next').hide(); } }else if(action == 'prev'){ $('#page_next').show(); if((page) == 1){ $('#page_first').hide(); $('#page_prev').hide(); } } $('#moc_detail').html(differences); var isCollapsed = $("#global_displayer").attr('ed:iscollapsed'); if (isCollapsed == 'true') { collapseAll(); } else { expandAll(); } }); } function show_detail(id, fldName){ window.open("<fl:webapp/>/show_field_change_detail.fl?id="+id+"&fldName="+fldName,fldName,"menubar=no, status=no, scrollbars=no, menubar=no, width=640, height=530"); } function get_global_differences(){ differences = ""; $.getJSON("<fl:webapp/>/get_global_differences.fl?id=<%=id%>", function(data) { $.each(data.Objects, function(i,object){ var bgColorStr; var applied = object.Appl; var total = object.NbCreation + object.NbModification; if (applied == 0) { bgColorStr = ''; } else { if (applied < total) { bgColorStr = 'style=\"background-color: #99CC00;\"'; } else { bgColorStr = 'style=\"background-color: #00CC00;\"'; } } cssClass = ((i % 2 >0)? "tabSimpleFdBlanc" : "tabSimpleFdBleu"); differences += "<tr class=\""+cssClass+" dataValue\" style=\""+((i == 0)? "border-top: 1px solid #CCC;":"")+"\">"+ "<td width=\"43%\"><a href=\"#\" onClick=\"load_object('"+object.ObjID+"');\">"+object.ObjSql+"</a></td>"+ "<td width=\"5%\" " + bgColorStr + ">" + applied + "/" + total + " <fl:getMessage code="M2037" alt="appliquées" js="true"/></td>"+ "<td width=\"17%\">"+ "<fl:getMessage code="L2078" alt="Création"/>: " +object.NbCreation+ "</td>"+ "<td width=\"17%\">"+ "<fl:getMessage code="L62BA" alt="Modification"/>: " +object.NbModification+ "</td>"+ "<td align=\"right\">"+ "<select class=\"input select object_politic\" style=\"width: 105px; margin-left: 10px\" onchange=\"object_politic_changed(this)\" ed:objid=\""+object.ObjID+"\">"+ "<option value=\"\" disabled " + ((object.ObjPolitic == "_MIX_")? "selected" : "") + "><fl:getMessage code="F609E" alt="Personnalisé"/></option>"+ <% for(Vector<String> mocPolitique : mocPolitiqueValues){ String mocPolitiqueID = mocPolitique.get(0); String mocPolitiqueValue = mocPolitique.get(1); %> "<option value=\"<%=mocPolitiqueID %>\" " + ((object.ObjPolitic == '<%=mocPolitiqueID %>')? "selected" : "") +"><%=mocPolitiqueValue %></option>"+ <%} %> "</select>"+ "</td>"+ "</tr>"; }); $('#moc_detail').html(differences); $("#moc_header").hide(); $("#pager").hide(); $("#no_data").hide(); $("#keyFields").hide(); $("#ignoredFields").hide(); $("#modification_type").attr("disabled", true); $("#filter").attr("disabled", true); }); } function load_object(id){ $("#object").val(id); if($("#object").val() != "Global"){ $("#modification_type").attr("disabled", false); $("#filter").attr("disabled", false); } criteria_change(); } function object_politic_changed(obj){ objID = $(obj).attr('ed:objid'); mocPolitic = $(obj).val(); update_obj_politic(objID, mocPolitic, false); } function update_obj_politic(objID, mocPolitic, fromGlobal){ $.ajax({ url: "<fl:webapp/>/update_obj_politic.fl?objID="+objID+"&mocPolitic="+mocPolitic+"&mdtID=<%= id %>", success: function () { if (!fromGlobal) $("#global_politic").val(''); }, error:function (xhr, ajaxOptions, thrownError){ alert(xhr.status); alert(thrownError); } }); } function object_change(){ if($("#object").val() == "Global"){ $("#modification_type").attr("disabled", true); $("#modification_type").val(""); $("#filter").attr("disabled", true); $("#filter").val("<Filtre>"); } else{ $("#keyFields").show(); $("#ignoredFields").show(); $("#modification_type").attr("disabled", false); $("#filter").attr("disabled", false); } } function enterPressed(evn) { if (window.event && window.event.keyCode == 13) { window.criteria_change(); }else if (evn && evn.keyCode == 13) { window.criteria_change(); } } document.onkeypress = enterPressed; </script> <fl:bigTabs objectTitle="Transfert d'environnement" ou="<%= \"/read_metadatatransfer.fl?id=\" + id %>"> <table class="container" cellpadding="0"> <tr> <td colspan="5" class="titreFiche"> <fl:getProperty name="MetaDataTransfer" property="MdtName" alt=" " /> </td> </tr> <tr class="ligne_separation"> <td></td> </tr> <tr> <td class="column2"> <table class="container" cellpadding="0"> <% String postText = ""; if ("ENCOURS".equals(mdtStatus) || "APPLIED".equals(mdtStatus)) { postText = " (" + applied + "/" + total + " " + Utils.getMessage(session, "M2037", "appliquées") + ")"; } %> <fl:fieldRead property="MdtStatus" alt="" postText="<%= postText %>" /> <fl:fieldRead property="MdtTransferEnded" alt="" /> </table> </td> <td class="separation"> <div class="separation"></div> </td> <td class="column2"> <table class="container" cellpadding="0"> <tr class="fieldline"> <td class="dataLabel"> <fl:label code="L70FE" label="Fichier" /> </td> <td class="dataValue"> <div> <fl:attach name="MetaDataTransfer" colID="MdtSource" edit="false" /> </div> </td> </tr> </table> </td> </tr> </table> <fl:notes name="MdtDescription" title="Description" nbPix="70"> <fl:getProperty name="MetaDataTransfer" property="MdtDescription" alt="" /> </fl:notes> <fl:smallTabs name="SiteRead"> <fl:sTab id="Differences" title="<%= Utils.getMessage(session, \"L7109\", \"Differences\") %>"> <table class="container" cellpadding="0"> <tr class="fieldline"> <td class="dataValue" style="width: 33%; padding-left: 0px;"> <div id="objects" style="display: inline; width: auto;"> <%if(objects.isEmpty()){ %> <span class="dataLabel"><fl:getMessage code="L0001" alt="Aucune entrée disponible"/></span> <%}else{ %> <table class="container" height="20px"> <tr class="fieldLine"> <td> <div id="criteriaTableDiv" class="criteriaTableDiv"> <select id="object" class="dataLabel input select criteriaField" style="width: 105px" onchange="object_change()"> <option value="Global">Global</option> <%for(Hashtable<String, String> object : objects){ String objID = object.get("MocObjID"); String objSql = object.get("MocObjID:ObjSql"); String newObjID = object.get("MocNewObjID"); if (objID == null) { objSql = objID = newObjID; } %> <option value="<%=objID %>"><%=objSql %></option> <%} %> </select> <select id="modification_type" class="dataLabel input select criteriaField" style="width: 105px; margin-left: 10px"> <option value=""><Type></option> <option value="1"><fl:getMessage code="L2078" alt="Création"/></option> <option value="0"><fl:getMessage code="L62BA" alt="Modification"/></option> <option value="2"><fl:getMessage code="M2038" alt="Appliquée"/></option> </select> <input id="filter" name="filter" type="text" value="<Filtre>" class="dataLabel input text criteriaField" style="width: 105px; margin-left: 10px" onfocus="if(this.value=='<Filtre>')this.value='';" onblur="if(this.value=='')this.value='<Filtre>';"/> </div> </td> <td width="99%"></td> <td align="right"><img style="cursor: pointer" src="<fl:webapp/>/icons/ico/valid_green2_long.gif" onclick="criteria_change()" ></td> <td class="separation" width="5px"> </td> <td align="right"> <div title="Appliquer une politique globale"> <select id="global_politic" class="dataLabel input select politic" style="width: 105px;margin-left: 10px; margin-top:15px;" onchange="global_politic_changed(this)"> <option value=""><Pol. création></option> <%for(Vector<String> mocPolitique : mocPolitiqueValues){ String mocPolitiqueID = mocPolitique.get(0); String mocPolitiqueValue = mocPolitique.get(1); %> <option value="<%=mocPolitiqueID%>"><%=mocPolitiqueValue %></option> <%} %> </select> </div> </td> </tr> </table> <span id="no_data" class="dataLabel" style="display:none;"><fl:getMessage code="F010A" alt="Aucune entrée disponible pour les critères choisies"/></span> <table width="100%" cellpadding="0"> <tr><td align="center"><span id="pager" style="font-weight: normal"></span></td></tr> </table> <table id="moc_header" class="data_column" cellpadding="0"> <tr style="border-bottom: 1px solid #CCC;"> <td align="left" width="22%" nowrap> <img id="global_displayer" class="global_displayer" src="<fl:webapp/>/admin/metadatatransfer/icons/plus.gif" onclick="toggleDisplay($(this))" style="cursor: pointer;" ed:iscollapsed="true" title="Tout dérouler/cacher"/><span id="keyFields"></span><span id="ignoredFields"></span></td> <td align="left" width="26%"><span class="fieldchangeGlobalHeader"> <fl:getMessage code="L6258" alt="Champ"/></span></td> <td align="left" width="26%"><span class="fieldchangeGlobalHeader"> <fl:getMessage code="L1051" alt="Ancienne valeur"/></span></td> <td align="left" width="26%"><span class="fieldchangeGlobalHeader"> <fl:getMessage code="L1052" alt="Nouvelle valeur"/></span></td> </tr> </table> <table width="100%" cellpadding="0"> <thead></thead> <tbody id="moc_detail"> </tbody> </table> <%} %> </div> </td> </tr> </table> </fl:sTab> <fl:sTab id="Erreur" title="<%= Utils.getMessage(session, \"F7059\", \"Erreur\") %>"> <table width="100%" cellpadding="0" class="dataValue"> <%=errorMsg %> </table> <textarea class="dataValue" style="border : 0px; width: 100%; height: 20%" readonly="readonly"> <%=query %> </textarea> </fl:sTab> </fl:smallTabs> </fl:bigTabs>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de