<% /****************************************************************************** * Copyright (c) 2000-2008 e-Deal * * e-Deal S.A. * 55 rue Brillat Savarin * 75013 Paris * France * * T: +33 (0)1 53 80 80 30 * F: +33 (0)1 73 01 69 77 * http://www.e-deal.com * * La diffusion de ce code source sous quelque forme que ce soit sans * l'autorisation de E-DEAL est interdite. * * Vous êtes autorisés à modifier ce code source uniquement pour votre usage * propre et sous réserve que les mentions de copyright demeurent intactes. * * Ce code est fourni en l'état. Aucune garantie d'aucune sorte, explicite ou * implicite n'est donnée. En aucun cas E-DEAL ne pourra être tenu pour * responsable des dommages pouvant résulter de l'utilisation de ce code * source. ******************************************************************************/ %><%@page session="true" import="com.edeal.frontline.*,java.util.*,com.edeal.frontline.custom.*"%> <%@ page import="com.edeal.frontline.navigation.FlRequest" %> <%@page import="com.edeal.frontline.navigation.WebUtils"%> <%@taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl" %> <% final org.apache.commons.logging.Log logger = org.apache.commons.logging.LogFactory.getLog(getClass()); FlRequest flRequest = new FlRequest(request); FlContext context = flRequest.getContext(); DataDictionary dico = context.getDataDictionary(); String operationID = dico.getRefIdByCode("Cr2Ope","exist"); // Selection Pattern ID String id = flRequest.getRequestParameterOrAttribute("id"); String type = flRequest.getRequestParameterOrAttribute("type"); boolean isMultival = false; boolean isControledByRef = false; boolean isControledByFob = false; boolean isMultipleValues = false; boolean isBoolean = false; boolean isDate = false; boolean isDecimal = false; boolean isInteger = false; boolean isNumeric = false; boolean isText = false; boolean isFirstLoad= true; boolean _date= false; Vector vectChx = new Vector(); Vector listPID = new Vector(); // for node agraggate clonning Vector listPAID = new Vector(); String[] fieldS = {"Cr2ID", "Cr2FobID", "Cr2FldID", "Cr2Ope", "Cr2TempName", "Cr2Chx"}; String[][] queryS = {{"Cr2Se2ID = "+Utils.formatToSQL(context, id), "Cr2Ope <> null","Cr2IsTemplate=1", "Cr2Ope <> "+Utils.formatToSQL(context, operationID) }}; String[] fieldA={"Cr2ID", "Cr2TempName", "Cr2CardOpe", "Cr2Card"}; String[][] queryA={{"Cr2Se2ID = "+Utils.formatToSQL(context, id), "Cr2CardOpe <> null", "Cr2Card = null"}}; Vector listA = new Vector(); listA = Criteria2Bean.listSummary(session, fieldA, queryA); Vector list = new Vector(); list = Criteria2Bean.listSummary(session, fieldS, queryS); int h = list.size(); int m=listA.size(); boolean isVisible= false; if(h==0 && m==0) { isVisible = true; } String falseH ="0"; Selection2Bean selBean = null; try { selBean= new Selection2Bean(id,context); } catch(FrontlineException e){} catch(AccessDeniedException e){} String selName = null; try { selName = selBean.getSe2Name(); } catch (FieldNotInitializedException ex){} %> <fl:getMessage code="L2025" alt="E-DEAL"/>
" ignoreList="true" showFooter="false">
"/>
<% if (list != null && list.size() > 0) { %> <% for (int i = 0; i < list.size(); i++) { FieldBean fld = null; String fldType = null; isMultival = false; isControledByRef = false; isControledByFob = false; isMultipleValues = false; isBoolean = false; isDate = false; isDecimal = false; isInteger = false; isNumeric = false; isText = false; Hashtable row1 = (Hashtable) list.elementAt(i); String Cr2ID = (String) row1.get("Cr2ID"); listPID.addElement(Cr2ID); String Label = (String) row1.get("Cr2TempName"); Label = Utils.getMessage(session, Label, Utils.getMessage(session, "L60E0", "")); String op = (String) row1.get("Cr2Ope"); String field = (String) row1.get("Cr2FldID"); if(field != null) { fld = dico.getFieldByID(field); String opeDisp = (String)dico.getRefDisp(session, "Cr2Ope", op); try { fldType = dico.getRefCode("FldFltID", fld.getFldFltID()); } catch (FieldNotInitializedException ex) {}; try { isControledByRef = (fld.getFldTabID() != null); } catch (FieldNotInitializedException ex) {}; try { isControledByFob = (fld.getFldFobID() != null); } catch (FieldNotInitializedException ex) {}; if("BIT".equals(fldType)) { isBoolean = true; } else if("DATE".equals(fldType) || "TIME".equals(fldType) || "TIMESTAMP".equals(fldType)) { isDate = true; } else if("FLOAT|DOUBLE".equals(fldType) || "REAL".equals(fldType)) { isDecimal = true; isNumeric = true; } else if("INTEGER".equals(fldType) || "BIGINT".equals(fldType) || "SMALLINT".equals(fldType) || "DECIMAL|NUMERIC".equals(fldType) || "TINYINT".equals(fldType)) { isInteger = true; isNumeric = true; } else if("CHAR|VARCHAR|LONGVARCHAR|CLOB".equals(fldType)) { isText = true; } String opeID = dico.getRefIdByCode("Cr2Ope","in"); if(fld.isFldMultival()||op.equals(opeID)) { isMultipleValues = true; } %> "> <% } // end if field }// end for session.setAttribute("listPID", listPID); }// end if if (listA != null && listA.size() > 0) { for (int i = 0; i < listA.size(); i++) { Hashtable row1 = (Hashtable) listA.elementAt(i); String Cr2ID = (String) row1.get("Cr2ID"); listPAID.addElement(Cr2ID); String Label = (String) row1.get("Cr2TempName"); Label = Utils.getMessage(session, Label, Utils.getMessage(session, "L60E0", "")); %> "> <% } } session.setAttribute("listPAID", listPAID); %>
<%=Label%>
<% if(isControledByFob){ String fldFob = null; try { fldFob = fld.getFldFobID(); }catch (FieldNotInitializedException ex) {} ObjectsBean ctlFob = null; if (fldFob != null) { ctlFob = dico.getTable("id", fldFob); } if(fldFob != null && isMultipleValues){ %> <fl:getMessage code="> <fl:getMessage code="> <% } } %>
<% if(isControledByFob) { String fldFob = null; logger.warn("test fob"+i); try { fldFob = fld.getFldFobID(); }catch (FieldNotInitializedException ex) {} ObjectsBean ctlFob = null; if (fldFob != null) { ctlFob = dico.getTable("id", fldFob); %> <% if(isMultipleValues) { %> <% } else { %> <% } %>
">
"> " readonly onfocus="this.blur();">
<fl:getMessage code="> <fl:getMessage code=">
<% } } else if(isControledByRef) { Vector vectRef = dico.getRefList(session, fld.getFldSql()); %> <% } else if(isDate) { String strDate = ""; String strTime = ""; if(vectChx.size() > 0) { java.util.Date date = Utils.formatDateFromWeb(session, (String)vectChx.firstElement()); strDate = Utils.formatToWebDate(session, date, true); strTime = Utils.formatToWebTime(session, date, true).substring(0, 5); } %> ');" class="input date"> ';return true;" onMouseOut="window.status=' '; return true"> ');" class="input date"> <% } else if(isNumeric || isText) { %> " size="40" class="<%=(isNumeric) ? "input number" : "input text" %>"<% if(isNumeric) { %> onBlur="ctrlNumField(this, '<%= isDecimal ? "float" : "integer" %>', '');"<% } %>> <% if (isNumeric) { %> <% } else { %> <% } %> <% if(isMultipleValues) { %>
<% } } else if(isBoolean) { %> <% } %>
<%=Label%> ');">