public boolean init(){
  log.config("");
  MClient client=MClient.get(Env.getCtx());
  String ASPFilter="";
  if (client.isUseASP())   ASPFilter="   AND (   p.AD_Process_Para_ID IN ( " + "              SELECT pp.AD_Process_Para_ID " + "                FROM ASP_Process_Para pp, ASP_Process p, ASP_Level l, ASP_ClientLevel cl "+ "               WHERE p.ASP_Level_ID = l.ASP_Level_ID "+ "                 AND cl.AD_Client_ID = " + client.getAD_Client_ID() + "                 AND cl.ASP_Level_ID = l.ASP_Level_ID "+ "                 AND pp.ASP_Process_ID = p.ASP_Process_ID "+ "                 AND pp.IsActive = 'Y' "+ "                 AND p.IsActive = 'Y' "+ "                 AND l.IsActive = 'Y' "+ "                 AND cl.IsActive = 'Y' "+ "                 AND pp.ASP_Status = 'S') "+ "        OR p.AD_Process_Para_ID IN ( "+ "              SELECT AD_Process_Para_ID "+ "                FROM ASP_ClientException ce "+ "               WHERE ce.AD_Client_ID = "+ client.getAD_Client_ID()+ "                 AND ce.IsActive = 'Y' "+ "                 AND ce.AD_Process_Para_ID IS NOT NULL "+ "                 AND ce.AD_Tab_ID IS NULL "+ "                 AND ce.AD_Field_ID IS NULL "+ "                 AND ce.ASP_Status = 'S') "+ "       ) "+ "   AND p.AD_Process_Para_ID NOT IN ( "+ "          SELECT AD_Process_Para_ID "+ "            FROM ASP_ClientException ce "+ "           WHERE ce.AD_Client_ID = "+ client.getAD_Client_ID()+ "             AND ce.IsActive = 'Y' "+ "             AND ce.AD_Process_Para_ID IS NOT NULL "+ "             AND ce.AD_Tab_ID IS NULL "+ "             AND ce.AD_Field_ID IS NULL "+ "             AND ce.ASP_Status = 'H')";
  String sql=null;
  if (Env.isBaseLanguage(Env.getCtx(),"AD_Process_Para"))   sql="SELECT p.Name, p.Description, p.Help, " + "p.AD_Reference_ID, p.AD_Process_Para_ID, " + "p.FieldLength, p.IsMandatory, p.IsRange, p.ColumnName, "+ "p.DefaultValue, p.DefaultValue2, p.VFormat, p.ValueMin, p.ValueMax, "+ "p.SeqNo, p.AD_Reference_Value_ID, vr.Code AS ValidationCode, "+ "p.ReadOnlyLogic, p.DisplayLogic "+ "FROM AD_Process_Para p"+ " LEFT OUTER JOIN AD_Val_Rule vr ON (p.AD_Val_Rule_ID=vr.AD_Val_Rule_ID) "+ "WHERE p.AD_Process_ID=?"+ " AND p.IsActive='Y' " + ASPFilter + " ORDER BY SeqNo";
 else   sql="SELECT t.Name, t.Description, t.Help, " + "p.AD_Reference_ID, p.AD_Process_Para_ID, " + "p.FieldLength, p.IsMandatory, p.IsRange, p.ColumnName, "+ "p.DefaultValue, p.DefaultValue2, p.VFormat, p.ValueMin, p.ValueMax, "+ "p.SeqNo, p.AD_Reference_Value_ID, vr.Code AS ValidationCode, "+ "p.ReadOnlyLogic, p.DisplayLogic "+ "FROM AD_Process_Para p"+ " INNER JOIN AD_Process_Para_Trl t ON (p.AD_Process_Para_ID=t.AD_Process_Para_ID)"+ " LEFT OUTER JOIN AD_Val_Rule vr ON (p.AD_Val_Rule_ID=vr.AD_Val_Rule_ID) "+ "WHERE p.AD_Process_ID=?"+ " AND t.AD_Language='" + Env.getAD_Language(Env.getCtx()) + "'"+ " AND p.IsActive='Y' "+ ASPFilter+ " ORDER BY SeqNo";
  boolean hasFields=false;
  Rows rows=new Rows();
  try {
    PreparedStatement pstmt=DB.prepareStatement(sql,null);
    pstmt.setInt(1,m_processInfo.getAD_Process_ID());
    ResultSet rs=pstmt.executeQuery();
    int field=0;
    Row row=null;
    while (rs.next()) {
      hasFields=true;
      field++;
      if (field % 2 == 0 && mode == BROWSER_MODE) {
        row=createField(rs,rows,row);
      }
 else {
        row=createField(rs,rows,null);
      }
    }
    rs.close();
    pstmt.close();
  }
 catch (  SQLException e) {
    log.log(Level.SEVERE,sql,e);
  }
  if (m_mFields.size() != m_mFields2.size() || m_mFields.size() != m_wEditors.size() || m_mFields2.size() != m_wEditors2.size())   log.log(Level.SEVERE,"View & Model vector size is different");
  if (hasFields) {
    centerPanel.appendChild(rows);
    dynamicDisplay();
  }
 else   dispose();
  return hasFields;
}

public boolean init ( ) { log . config ( "" ) ; MClient client = MClient . get ( Env . getCtx ( ) ) ; String ASPFilter = "" ; if ( client . isUseASP ( ) ) ASPFilter = "   AND (   p.AD_Process_Para_ID IN ( " + "              SELECT pp.AD_Process_Para_ID " + "                FROM ASP_Process_Para pp, ASP_Process p, ASP_Level l, ASP_ClientLevel cl " + "               WHERE p.ASP_Level_ID = l.ASP_Level_ID " + "                 AND cl.AD_Client_ID = " + client . getAD_Client_ID ( ) + "                 AND cl.ASP_Level_ID = l.ASP_Level_ID " + "                 AND pp.ASP_Process_ID = p.ASP_Process_ID " + "                 AND pp.IsActive = 'Y' " + "                 AND p.IsActive = 'Y' " + "                 AND l.IsActive = 'Y' " + "                 AND cl.IsActive = 'Y' " + "                 AND pp.ASP_Status = 'S') " + "        OR p.AD_Process_Para_ID IN ( " + "              SELECT AD_Process_Para_ID " + "                FROM ASP_ClientException ce " + "               WHERE ce.AD_Client_ID = " + client . getAD_Client_ID ( ) + "                 AND ce.IsActive = 'Y' " + "                 AND ce.AD_Process_Para_ID IS NOT NULL " + "                 AND ce.AD_Tab_ID IS NULL " + "                 AND ce.AD_Field_ID IS NULL " + "                 AND ce.ASP_Status = 'S') " + "       ) " + "   AND p.AD_Process_Para_ID NOT IN ( " + "          SELECT AD_Process_Para_ID " + "            FROM ASP_ClientException ce " + "           WHERE ce.AD_Client_ID = " + client . getAD_Client_ID ( ) + "             AND ce.IsActive = 'Y' " + "             AND ce.AD_Process_Para_ID IS NOT NULL " + "             AND ce.AD_Tab_ID IS NULL " + "             AND ce.AD_Field_ID IS NULL " + "             AND ce.ASP_Status = 'H')" ; String sql = null ; if ( Env . isBaseLanguage ( Env . getCtx ( ) , "AD_Process_Para" ) ) sql = "SELECT p.Name, p.Description, p.Help, " + "p.AD_Reference_ID, p.AD_Process_Para_ID, " + "p.FieldLength, p.IsMandatory, p.IsRange, p.ColumnName, " + "p.DefaultValue, p.DefaultValue2, p.VFormat, p.ValueMin, p.ValueMax, " + "p.SeqNo, p.AD_Reference_Value_ID, vr.Code AS ValidationCode, " + "p.ReadOnlyLogic, p.DisplayLogic " + "FROM AD_Process_Para p" + " LEFT OUTER JOIN AD_Val_Rule vr ON (p.AD_Val_Rule_ID=vr.AD_Val_Rule_ID) " + "WHERE p.AD_Process_ID=?" + " AND p.IsActive='Y' " + ASPFilter + " ORDER BY SeqNo" ; else sql = "SELECT t.Name, t.Description, t.Help, " + "p.AD_Reference_ID, p.AD_Process_Para_ID, " + "p.FieldLength, p.IsMandatory, p.IsRange, p.ColumnName, " + "p.DefaultValue, p.DefaultValue2, p.VFormat, p.ValueMin, p.ValueMax, " + "p.SeqNo, p.AD_Reference_Value_ID, vr.Code AS ValidationCode, " + "p.ReadOnlyLogic, p.DisplayLogic " + "FROM AD_Process_Para p" + " INNER JOIN AD_Process_Para_Trl t ON (p.AD_Process_Para_ID=t.AD_Process_Para_ID)" + " LEFT OUTER JOIN AD_Val_Rule vr ON (p.AD_Val_Rule_ID=vr.AD_Val_Rule_ID) " + "WHERE p.AD_Process_ID=?" + " AND t.AD_Language='" + Env . getAD_Language ( Env . getCtx ( ) ) + "'" + " AND p.IsActive='Y' " + ASPFilter + " ORDER BY SeqNo" ; boolean hasFields = false ; Rows rows = new Rows ( ) ; try { PreparedStatement pstmt = DB . prepareStatement ( sql , null ) ; pstmt . setInt ( 1 , m_processInfo . getAD_Process_ID ( ) ) ; ResultSet rs = pstmt . executeQuery ( ) ; int field = 0 ; Row row = null ; while ( rs . next ( ) ) { hasFields = true ; field ++ ; if ( field % 2 == 0 && mode == BROWSER_MODE ) { row = createField ( rs , rows , row ) ; } else { row = createField ( rs , rows , null ) ; } } rs . close ( ) ; pstmt . close ( ) ; } catch ( SQLException e ) { log . log ( Level . SEVERE , sql , e ) ; } if ( m_mFields . size ( ) != m_mFields2 . size ( ) || m_mFields . size ( ) != m_wEditors . size ( ) || m_mFields2 . size ( ) != m_wEditors2 . size ( ) ) log . log ( Level . SEVERE , "View & Model vector size is different" ) ; if ( hasFields ) { centerPanel . appendChild ( rows ) ; dynamicDisplay ( ) ; } else dispose ( ) ; return hasFields ; }
read fields to display
