Package org.uengine.ui.list.datamodel

Examples of org.uengine.ui.list.datamodel.DataList


  /***********************************************************************/
  /*                            Define                                   */
  /***********************************************************************/
  QueryCondition condition = new QueryCondition();
  DataList dl = null;

  // Work List BF.
  //  WorkListBusinessFacade workListBF = null;

  int intPageCnt = 50;
  int nPagesetSize = 10;
  int currentPage = reqMap.getInt("CURRENTPAGE", 1);
  int totalCount = 0;
  int totalPageCount = 0;

  String strTarget = reqMap.getString("TARGETCOND", "procins.instancename");
  String strKeyword = reqMap.getString("KEYWORDCOND", "");
  String strDateKeyStart = reqMap.getString("INIT_START_DATE", "");
  String strDateKeyEnd = reqMap.getString("INIT_END_DATE", "");
  String strDefCategoryId = reqMap.getString("DEFCATEGORYID", "");
  String strDefTypeId = reqMap.getString("DEFTYPEID", "");

  String strSortColumn = reqMap.getString("SORT_COLUMN", "");
  String strSortCond = reqMap.getString("SORT_COND", "");
  String menuItemId = reqMap.getString("MENU_ITEMID", "item_bpm");
  //  String filtering = reqMap.getString("FILTERING","");
  //  RequestContext reqCtx = new RequestContext(request);
  //  User logdUser = reqCtx.getUser();
  //  loggedUserCompanyId=   logdUser.getCompanyId();

  /***********************************************************************/
  /*                            Check & Set Parameter                    */
  /***********************************************************************/
  condition.setMap(reqMap);
  condition.setOnePageCount(intPageCnt);
  condition.setPageNo(currentPage);

  HashMap colors = new HashMap(10);
  colors.put("Failed", "red");
  colors.put("Suspended", "yellow");
  colors.put("Skipped", "blue");
  colors.put("Ready", "green");
  colors.put("Running", "green");
  colors.put("Complete", "gray");
  colors.put("Stopped", "black");

  StringBuffer condStr = new StringBuffer();

  String _status = request.getParameter("status");
  String _Instance = request.getParameter("Instance");
  String complete_end_date = request.getParameter("complete_end_date");
  String simpleKeyWord = reqMap.getString("simpleKeyWord", "");
  String docTitle = request.getParameter("docTitle");
  String _Initiator = request.getParameter("Initiator");
  String _Initiator_display = request.getParameter("Initiator_display");
  String _Initiator__which_is_xml_value = request.getParameter("Initiator__which_is_xml_value");
  String _Nowperson = request.getParameter("Nowperson");
  String _Nowperson_display = request.getParameter("Nowperson_display");
  String _Nowperson__which_is_xml_value = request.getParameter("Nowperson__which_is_xml_value");
  String complete_start_date = request.getParameter("complete_start_date");
  String init_start_date = request.getParameter("init_start_date");
  String init_end_date = request.getParameter("init_end_date");
 
 
  if (UEngineUtil.isNotEmpty(_status) && !_status.equals("All")) {
    condStr.append("AND a.status = '" + _status + "' ");
  } else {
    _status = "";
  }
 
  String _defId = request.getParameter("defId");
  if (UEngineUtil.isNotEmpty(_defId)) {
    condStr.append(" AND a.defid = " + UEngineUtil.searchStringFilter(_defId) + " ");
  } else {
    _defId = "";
  }
 
  if (UEngineUtil.isNotEmpty(simpleKeyWord)) {

    String typeOfDBMS = DAOFactory.getInstance(null).getDBMSProductName().toUpperCase();
    String lowerCaseFunctionName = ("ORACLE".equals(typeOfDBMS)) ? "LOWER" : "LCASE";
   
    String simpleKeyWordLowerCase = UEngineUtil.searchStringFilter(simpleKeyWord).toLowerCase();
   
    condStr.append(" AND ( ");
    condStr.append("  ").append(lowerCaseFunctionName).append("(a.DEFNAME)     LIKE '%").append(simpleKeyWordLowerCase).append("%' ").append(" OR ");
    condStr.append("  ").append(lowerCaseFunctionName).append("(a.INFO)       LIKE '%").append(simpleKeyWordLowerCase).append("%' ").append(" OR ");
    condStr.append("  ").append(lowerCaseFunctionName).append("(a.NAME)       LIKE '%").append(simpleKeyWordLowerCase).append("%' ").append(" OR ");
    condStr.append("  ").append(lowerCaseFunctionName).append("(a.INITEP)       LIKE '%").append(simpleKeyWordLowerCase).append("%' ").append(" OR ");
    condStr.append("  ").append(lowerCaseFunctionName).append("(a.INITRSNM)     LIKE '%").append(simpleKeyWordLowerCase).append("%' ").append(" OR ");
    condStr.append("  ").append(lowerCaseFunctionName).append("(a.CURREP)       LIKE '%").append(simpleKeyWordLowerCase).append("%' ").append(" OR ");
    condStr.append("  ").append(lowerCaseFunctionName).append("(a.CURRRSNM)    LIKE '%").append(simpleKeyWordLowerCase).append("%' ");
    try {
      Integer.parseInt(simpleKeyWordLowerCase);
      condStr.append(" OR ").append("   instid = ").append(simpleKeyWordLowerCase);
    } catch(Exception e) { }
    condStr.append(" ) ");
   
  } else {
    if (UEngineUtil.isNotEmpty(docTitle)) {
      //docTitle = decode(docTitle);
      condStr.append("AND a.name like '%" + UEngineUtil.searchStringFilter(docTitle) + "%' ");
    } else {
      docTitle = "";
    }
   
    //2009-08-04 InitiatorName start
    if (UEngineUtil.isNotEmpty(_Initiator)) {
     
      condStr.append(" AND a.initep in ( ");
      StringBuffer searchInitiatorString = new StringBuffer();
      for (String initiator : _Initiator.split(";")) {
        if (searchInitiatorString.length() > 0) searchInitiatorString.append(",");
        searchInitiatorString.append("'").append(initiator).append("'");
      }
      condStr.append(searchInitiatorString).append(" ) ");
     
    } else {
      _Initiator = "";
    }
 
    if (!UEngineUtil.isNotEmpty(_Initiator_display)) {
      _Initiator_display = "";
    }
 
    if (!UEngineUtil.isNotEmpty(_Initiator__which_is_xml_value)) {
      _Initiator__which_is_xml_value = "";
    }
    //2009-08-04 InitiatorName end
   
   
    //2009-08-04 NowPersonName start
    if(UEngineUtil.isNotEmpty(_Nowperson)){
     
      condStr.append(" AND a.currep in ( ");
      StringBuffer searchNowpersonString = new StringBuffer();
      for (String nowperson : _Nowperson.split(";")) {
        if (searchNowpersonString.length() > 0) searchNowpersonString.append(",");
        searchNowpersonString.append("'").append(nowperson).append("'");
      }
      condStr.append(searchNowpersonString).append(" ) ");
     
    }else{
      _Nowperson = "";
    }
 
    if(!UEngineUtil.isNotEmpty(_Nowperson_display)){
      _Nowperson_display = "";
    }
 
    if(!UEngineUtil.isNotEmpty(_Nowperson__which_is_xml_value)){
      _Nowperson__which_is_xml_value = "";
    }
    //2009-08-04 NowPersonName end
 
    if (UEngineUtil.isNotEmpty(init_start_date)) {
      condStr.append("AND a.StartedDATE >= '" + UEngineUtil.searchStringFilter(init_start_date) + "' ");
    } else {
      init_start_date = "";
    }
 
    if (UEngineUtil.isNotEmpty(init_end_date)) {
      condStr.append("AND a.StartedDATE <= '" + UEngineUtil.searchStringFilter(init_end_date) + "' ");
    } else {
      init_end_date = "";
    }
 
    if (UEngineUtil.isNotEmpty(complete_start_date)) {
      condStr.append("AND a.finishedDATE >= '" + UEngineUtil.searchStringFilter(complete_start_date) + "' ");
    } else {
      complete_start_date = "";
    }
 
    if (UEngineUtil.isNotEmpty(complete_end_date)) {
      condStr.append("AND a.finishedDATE <= '" + UEngineUtil.searchStringFilter(complete_end_date) + "' ");
    } else {
      complete_end_date = "";
    }
 
    // 2009-08-05 add
    if(UEngineUtil.isNotEmpty(_Instance)){
      condStr.append(" AND instid = " + UEngineUtil.searchStringFilter(_Instance) + " ");
    } else {
      _Instance = "";
    }
  }
 
  String sqlFrom = null;
  if(!loggedUserIsMaster)
  {
    String dBMSProductName = null;
    try {
      dBMSProductName = DAOFactory.getInstance().getDBMSProductName();
    } catch (Exception e) {
      e.printStackTrace();
    }

    if ("MySQL".equals(dBMSProductName)) {
      sqlFrom = " FROM bpm_procinst a, bpm_procdef b WHERE a.defid = b.defid AND b.comcode = '" + loggedUserGlobalCom + "' AND ";
    } else {
      sqlFrom = " FROM bpm_procinst a LEFT JOIN bpm_procdef b ON a.defid = b.defid WHERE b.comcode = '" + loggedUserGlobalCom + "' AND ";
    }
  }
  else
  {
    sqlFrom = " FROM bpm_procinst a WHERE ";
  }

  String sql = "SELECT a.instid, a.defname, a.startedDate, a.finishedDate, a.status, a.info, a.name, a.isDeleted, a.ext1, a.defid, "
      + " a.initep, a.initrsnm, a.currep, a.currrsnm " // add view column
      + sqlFrom + " a.instid = rootinstid "
      + " AND a.isDeleted = 0 "
      + condStr
      + " ORDER BY a.starteddate DESC";

  System.out.println("[ SQL : "+ sql +" ]");

      out.write("\r\n");
      out.write("\r\n");
      out.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"");
      out.print(org.uengine.kernel.GlobalContext.WEB_CONTEXT_ROOT);
      out.write("/style/default.css\" />\r\n");
      out.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"");
      out.print(org.uengine.kernel.GlobalContext.WEB_CONTEXT_ROOT);
      out.write("/style/uengine.css\" />\r\n");
      out.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"");
      out.print(org.uengine.kernel.GlobalContext.WEB_CONTEXT_ROOT);
      out.write("/style/en_US.css\" />\r\n");
      out.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"");
      out.print(org.uengine.kernel.GlobalContext.WEB_CONTEXT_ROOT);
      out.write("/style/bbs.css\" />\r\n");
      out.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"");
      out.print(org.uengine.kernel.GlobalContext.WEB_CONTEXT_ROOT);
      out.write("/style/classic/css/main.css\" />\r\n");
      out.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"");
      out.print(org.uengine.kernel.GlobalContext.WEB_CONTEXT_ROOT);
      out.write("/style/formdefault.css\" />\r\n");
      out.write("\r\n");
      out.write("<script type=\"text/javascript\" src=\"");
      out.print(org.uengine.kernel.GlobalContext.WEB_CONTEXT_ROOT);
      out.write("/scripts/bbs.js\"></script>");
      out.write("\r\n");
      out.write("\r\n");
      out.write("<style type=\"text/css\">\r\n");
      out.write("th {\r\n");
      out.write("\tfont-size: 9pt;\r\n");
      out.write("}\r\n");
      out.write("td {\r\n");
      out.write("\tfont-size: 8pt;\r\n");
      out.write("\t\r\n");
      out.write("}\r\n");
      out.write("\r\n");
      out.write("</style>\r\n");
      out.write("\t");
      org.apache.jasper.runtime.JspRuntimeLibrary.include(request, response, "../scripts/formActivity.js.jsp" + (("../scripts/formActivity.js.jsp").indexOf('?')>0? '&': '?') + org.apache.jasper.runtime.JspRuntimeLibrary.URLEncode("rmClsName", request.getCharacterEncoding())+ "=" + org.apache.jasper.runtime.JspRuntimeLibrary.URLEncode(String.valueOf(rmClsName), request.getCharacterEncoding()), out, false);
      out.write("\r\n");
      out.write("<script type=\"text/javascript\" src=\"");
      out.print(GlobalContext.WEB_CONTEXT_ROOT );
      out.write("/scripts/instanceList.js\"></script>\r\n");
      out.write("\r\n");
      out.write("<script type=\"text/javascript\">\r\n");
      out.write("$(document).ready(function() {\r\n");
      out.write("\tcheckItem();\r\n");
      out.write("\tsetCalender(\"");
      out.print(loggedUserLocale);
      out.write("\", {buttonImage:\"");
      out.print(GlobalContext.WEB_CONTEXT_ROOT);
      out.write("/processmanager/images/calendar.gif\"});\r\n");
      out.write("});\r\n");
      out.write("\r\n");
      out.write("function checkItem() {\r\n");
      out.write("\tvar options = document.getElementById(\"status\").options;\r\n");
      out.write("\tfor (var i = 0; i < options.length; i++) {\r\n");
      out.write("\t\toption = options[i];\r\n");
      out.write("\t\tif (option.value == \"");
      out.print(_status);
      out.write("\") {\r\n");
      out.write("\t\t\toption.selected = true;\r\n");
      out.write("\t\t}\r\n");
      out.write("\t}\r\n");
      out.write("}\r\n");
      out.write("\r\n");
      out.write("function resetSubmit() {\r\n");
      out.write("\tvar inputs = document.refreshForm.elements;\r\n");
      out.write("\tfor (var i = 0; i < inputs.length; i++) {\r\n");
      out.write("\t\tinputs[i].value = \"\";\r\n");
      out.write("\t}\r\n");
      out.write("\r\n");
      out.write("\tdocument.refreshForm.submit();\r\n");
      out.write("}\r\n");
      out.write("\r\n");
      out.write("function searchDetail() {\r\n");
      out.write("\tvar mainForm = document.refreshForm;\r\n");
      out.write("\r\n");
      out.write("\tmainForm.Nowperson_display.value = $(\"#Nowperson_display\").val();\r\n");
      out.write("\tmainForm.Nowperson.value = $(\"#Nowperson\").val();\r\n");
      out.write("\tmainForm.Initiator.value = $(\"#Initiator\").val();\r\n");
      out.write("\tmainForm.Initiator_display.value = $(\"#Initiator_display\").val();\r\n");
      out.write("\tmainForm.Instance.value = $(\"#Instance\").val();\r\n");
      out.write("\tmainForm.docTitle.value = $(\"#docTitle\").val();\r\n");
      out.write("\tmainForm.init_start_date.value = $(\"#init_start_date\").val();\r\n");
      out.write("\tmainForm.init_end_date.value = $(\"#init_end_date\").val();\r\n");
      out.write("\tmainForm.complete_start_date.value = $(\"#complete_start_date\").val();\r\n");
      out.write("\tmainForm.complete_end_date.value = $(\"#complete_end_date\").val();\r\n");
      out.write("\r\n");
      out.write("\tmainForm.simpleKeyWord.value = \"\";\r\n");
      out.write("\tmainForm.submit();\r\n");
      out.write("}\r\n");
      out.write("\r\n");
      out.write("</script>\r\n");
      out.write("\r\n");
      out.write("<title>");
      out.print(instanceListMessage);
      out.write("</title>\r\n");
      out.write("<style type=\"text/css\">\r\n");
      out.write("\thtml body {\r\n");
      out.write("\t\tmargin: 10px;\r\n");
      out.write("\t}\r\n");
      out.write("</style>\r\n");
      out.write("</head>\r\n");
      out.write("<body>\r\n");
      out.write("\r\n");
      out.write("<!-- Start Detail Search Layer -->\r\n");
      out.write("<div id=\"divSubSearch\" style=\"display: none; title=\"");
      out.print(GlobalContext.getMessageForWeb("Advenced Search", loggedUserLocale) );
      out.write("\">\r\n");
      out.write("\t<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" >\r\n");
      out.write("\t<colgroup>\r\n");
      out.write("\t    <col span=\"1\" width=\"150\">\r\n");
      out.write("\t    <col span=\"1\" width=\"50\"  align=\"right\">\r\n");
      out.write("\t    <col span=\"1\" width=\"170\" align=\"left\">\r\n");
      out.write("\t    <col span=\"1\" width=\"50\"  align=\"right\">\r\n");
      out.write("\t    <col span=\"1\" width=\"170\"   align=\"left\">\r\n");
      out.write("\t</colgroup>\r\n");
      out.write("\t    <tr>\r\n");
      out.write("\t        <td class=\"formtitle\">");
      out.print(instanceMessage);
      out.write("</td>\r\n");
      out.write("\t        <td class=\"formcon\">");
      out.print(nameMessage);
      out.write(" :&nbsp;</td>\r\n");
      out.write("\t        <td><input type=\"text\" id=\"docTitle\" value=\"");
      out.print(docTitle);
      out.write("\" /></td>\r\n");
      out.write("\t        <!-- 2009-08-05 update start -->\r\n");
      out.write("\t        <td>");
      out.print(idMessage );
      out.write(" :&nbsp;</td>\r\n");
      out.write("\t        <td><input type=\"text\" id=\"Instance\" value=\"");
      out.print(_Instance);
      out.write("\" onBlur=\"validate_Number(this);\"/></td>\r\n");
      out.write("\t        <!-- 2009-08-05 update end -->\r\n");
      out.write("\t    </tr>\r\n");
      out.write("\t    <!-- 2009-08-05 start -->\r\n");
      out.write("\t    <tr bgcolor=\"#b9cae3\">\r\n");
      out.write("\t        <td colspan=\"5\"  height=\"1\"></td>\r\n");
      out.write("\t    </tr>\r\n");
      out.write("\t    <tr>\r\n");
      out.write("\t        <td class=\"formtitle\">");
      out.print(initiatorMessage );
      out.write("</td>\r\n");
      out.write("\t        <td class=\"formcon\">");
      out.print(nameMessage );
      out.write(" :&nbsp;</td>\r\n");
      out.write("\t        <td>\r\n");
      out.write("\t            <input type=\"text\" name=\"Initiator_display\" id=\"Initiator_display\" size='20' value=\"");
      out.print(_Initiator_display);
      out.write("\" readonly=\"readonly\"/>\r\n");
      out.write("\t            <img name=\"Initiator\" align=\"middle\" onclick='searchPeopleObj(this,true)' \tsrc='");
      out.print(GlobalContext.WEB_CONTEXT_ROOT);
      out.write("/processmanager/images/Toolbar-toblock.gif' /></td>\r\n");
      out.write("\t        <td>");
      out.print(idMessage );
      out.write(" :&nbsp;</td>\r\n");
      out.write("\t        <td><input type=\"text\" name=\"Initiator\"  id=\"Initiator\" size='20' value=\"");
      out.print(_Initiator);
      out.write("\" readonly=\"readonly\" /></td>\r\n");
      out.write("\t    </tr>\r\n");
      out.write("\t    <tr bgcolor=\"#b9cae3\">\r\n");
      out.write("\t        <td colspan=\"5\"  height=\"1\"></td>\r\n");
      out.write("\t    </tr>\r\n");
      out.write("\t    <tr>\r\n");
      out.write("\t        <td class=\"formtitle\">");
      out.print(currentParticipantMessage );
      out.write("</td>\r\n");
      out.write("\t        <td class=\"formcon\">");
      out.print(nameMessage );
      out.write(" :&nbsp;</td>\r\n");
      out.write("\t        <td>\r\n");
      out.write("\t            <input type=\"text\" name=\"Nowperson_display\" id=\"Nowperson_display\" size='20' value=\"");
      out.print(_Nowperson_display);
      out.write("\" readonly=\"readonly\"/>\r\n");
      out.write("\t            <img name=\"Nowperson\" align=\"middle\" onclick='searchPeopleObj(this,true)' src='");
      out.print(GlobalContext.WEB_CONTEXT_ROOT);
      out.write("/processmanager/images/Toolbar-toblock.gif' /></td>\r\n");
      out.write("\t        <td>");
      out.print(idMessage );
      out.write(" :&nbsp;</td>\r\n");
      out.write("\t        <td><input type=\"text\" name=\"Nowperson\" id=\"Nowperson\" size='20' value=\"");
      out.print(_Nowperson);
      out.write("\" readonly=\"readonly\"/></td>\r\n");
      out.write("\t    </tr>\r\n");
      out.write("\t    <tr bgcolor=\"#b9cae3\">\r\n");
      out.write("\t        <td colspan=\"5\"  height=\"1\"></td>\r\n");
      out.write("\t    </tr>\r\n");
      out.write("\t    <!-- 2009-08-05 end -->\r\n");
      out.write("\t    <tr>\r\n");
      out.write("\t        <td class=\"formtitle\">");
      out.print(startedDateMessage);
      out.write("</td>\r\n");
      out.write("\t        <td class=\"formcon\">From :&nbsp;</td>\r\n");
      out.write("\t        <td>\r\n");
      out.write("\t        \t<input type=\"text\" id=\"init_start_date\" value=\"");
      out.print(init_start_date);
      out.write("\" class='j_calendar' />\r\n");
      out.write("\t            <!-- img src=\"../images/icon_dayselect.gif\" style=\"cursor: hand\" name=\"init_start_date\" onclick=\"showFullcalendar('month', this.name);\" /-->\r\n");
      out.write("\t        </td>\r\n");
      out.write("\t        <td>To :&nbsp;</td>\r\n");
      out.write("\t        <td>\r\n");
      out.write("\t        \t<input type=\"text\" id=\"init_end_date\" value=\"");
      out.print(init_end_date);
      out.write("\" class='j_calendar' />\r\n");
      out.write("\t            <!--img src=\"../images/icon_dayselect.gif\" style=\"cursor: hand\" name=\"init_end_date\" onclick=\"showFullcalendar('month', this.name);\" /-->\r\n");
      out.write("\t        </td>\r\n");
      out.write("\t    </tr>\r\n");
      out.write("\t    <tr bgcolor=\"#b9cae3\">\r\n");
      out.write("\t        <td colspan=\"5\"  height=\"1\"></td>\r\n");
      out.write("\t    </tr>\r\n");
      out.write("\t    <tr>\r\n");
      out.write("\t        <td class=\"formtitle\">");
      out.print(finishedDateMessage);
      out.write("</td>\r\n");
      out.write("\t        <td class=\"formcon\">From :&nbsp;</td>\r\n");
      out.write("\t        <td>\r\n");
      out.write("\t        \t<input type=\"text\" id=\"complete_start_date\" value=\"");
      out.print(complete_start_date);
      out.write("\" class='j_calendar' />\r\n");
      out.write("\t            <!-- img src=\"../images/icon_dayselect.gif\" style=\"cursor: hand\" name=\"complete_start_date\" onclick=\"showFullcalendar('month', this.name);\" /-->\r\n");
      out.write("\t        </td>\r\n");
      out.write("\t        <td>To :&nbsp;</td>\r\n");
      out.write("\t        <td>\r\n");
      out.write("\t        \t<input type=\"text\" id=\"complete_end_date\" value=\"");
      out.print(complete_end_date);
      out.write("\" class='j_calendar' />\r\n");
      out.write("\t            <!-- img src=\"../images/icon_dayselect.gif\" style=\"cursor: hand\" name=\"complete_end_date\" onclick=\"showFullcalendar('month', this.name);\" /-->\r\n");
      out.write("\t        </td>\r\n");
      out.write("\t    </tr>\r\n");
      out.write("\t</table>\r\n");
      out.write("</div>\r\n");
      out.write("<!-- End Detail Search Layer -->\r\n");
      out.write("\r\n");
      out.write("<form name=\"refreshForm\" method=\"post\" action=\"processInstanceList.jsp\" onSubmit=\"document.refreshForm.currentPage.value=1;\">\r\n");
      out.write("<fieldset class='block-labels' >\r\n");
      out.write("<legend>");
      out.print(GlobalContext.getMessageForWeb("WorkItem Search", loggedUserLocale) );
      out.write("</legend>\r\n");
      out.write("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n");
      out.write("    <tr>\r\n");
      out.write("        <td align=\"right\" style=\"padding:0 0 10px 0;\">\r\n");
      out.write("        \t<table width=\"*\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n");
      out.write("                <tr height=\"25\" valign=\"middle\">\r\n");
      out.write("                    <td><img src=\"");
      out.print(GlobalContext.WEB_CONTEXT_ROOT);
      out.write("/images/Common/searchTitle.gif\" width=\"70\" height=\"25\"></td>\r\n");
      out.write("\t                <td background=\"");
      out.print(GlobalContext.WEB_CONTEXT_ROOT);
      out.write("/images/Common/searchTitleCenter.gif\" valign=\"middle\">\r\n");
      out.write("                    \t<select name=\"status\" id=\"status\" style=\"width: 120px\">\r\n");
      out.write("                            <option value=\"All\">");
      out.print(statusMessage);
      out.write(' ');
      out.write(':');
      out.write(' ');
      out.print(allMessage);
      out.write("</option>\r\n");
      out.write("                            <option value=\"Running\">");
      out.print(statusMessage);
      out.write(' ');
      out.write(':');
      out.write(' ');
      out.print(runningMessage);
      out.write("</option>\r\n");
      out.write("                            <option value=\"Completed\">");
      out.print(statusMessage);
      out.write(' ');
      out.write(':');
      out.write(' ');
      out.print(completedMessage);
      out.write("</option>\r\n");
      out.write("                            <option value=\"Stopped\">");
      out.print(statusMessage);
      out.write(' ');
      out.write(':');
      out.write(' ');
      out.print(stoppedMessage);
      out.write("</option>\r\n");
      out.write("                            <option value=\"Failed\">");
      out.print(statusMessage);
      out.write(' ');
      out.write(':');
      out.write(' ');
      out.print(failedMessage);
      out.write("</option>\r\n");
      out.write("                        </select>\r\n");
      out.write("\t                    <input type=\"text\" name=\"simpleKeyWord\" value=\"");
      out.print(simpleKeyWord);
      out.write("\" size='15'  style=\"background:#FFF;\"/>\r\n");
      out.write("\t                </td>\r\n");
      out.write("\t                <td width=\"5\" background=\"");
      out.print(GlobalContext.WEB_CONTEXT_ROOT);
      out.write("/images/Common/searchTitleCenter.gif\"></td>\r\n");
      out.write("\t                <td width=\"*\" background=\"");
      out.print(GlobalContext.WEB_CONTEXT_ROOT);
      out.write("/images/Common/searchTitleCenter.gif\" valign=\"middle\">\r\n");
      out.write("\t                    <img src=\"");
      out.print(GlobalContext.WEB_CONTEXT_ROOT);
      out.write("/images/Common/searchGo.gif\" \r\n");
      out.write("\t                    alt=\"Search\" align=\"middle\" onclick=\"searchSimple();\" style=\"cursor: pointer;\" />\r\n");
      out.write("\t                    <a href=\"processInstanceListDetail.jsp\"><img src=\"");
      out.print(GlobalContext.WEB_CONTEXT_ROOT);
      out.write("/images/Common/searchRefresh.gif\" \r\n");
      out.write("\t                    alt=\"reset\" align=\"middle\" /></a>\r\n");
      out.write("\t                </td>\r\n");
      out.write("\t                <td width=\"5\" background=\"");
      out.print(GlobalContext.WEB_CONTEXT_ROOT);
      out.write("/images/Common/searchTitleCenter.gif\"></td>\r\n");
      out.write("\t                <td background=\"");
      out.print(GlobalContext.WEB_CONTEXT_ROOT);
      out.write("/images/Common/searchTitleCenter.gif\">\r\n");
      out.write("\t                    <a href=\"javascript: showDetailSearch('ProcessManager',750,250);\" style=\"text-decoration:underline;\">");
      out.print(GlobalContext.getMessageForWeb("Advenced Search", loggedUserLocale) );
      out.write("</a></td>\r\n");
      out.write("\t                <td><img src=\"");
      out.print(GlobalContext.WEB_CONTEXT_ROOT);
      out.write("/images/Common/searchTitleRight.gif\"></td>\r\n");
      out.write("                </tr>\r\n");
      out.write("            </table>\r\n");
      out.write("        </td>\r\n");
      out.write("    </tr>\r\n");
      out.write("</table>\r\n");
      out.write("\r\n");
      out.write("<input type=\"hidden\" name=\"currentPage\" value=\"");
      out.print(currentPage);
      out.write("\">\r\n");
      out.write("<!-- Sort -->\r\n");
      out.write("<input type=\"hidden\" name=\"sort_column\" value=\"");
      out.print(strSortColumn);
      out.write("\">\r\n");
      out.write("<input type=\"hidden\" name=\"sort_cond\" value=\"");
      out.print(strSortCond);
      out.write("\">\r\n");
      out.write("<!-- Search -->\r\n");
      out.write("<input type=\"hidden\" name=\"TARGETCOND\" value=\"");
      out.print(strTarget);
      out.write("\">\r\n");
      out.write("<input type=\"hidden\" name=\"defId\" value=\"");
      out.print(_defId);
      out.write("\">\r\n");
      out.write("\r\n");
      out.write("<input type=\"hidden\" name=\"Nowperson\" value=\"");
      out.print(_Nowperson);
      out.write("\">\r\n");
      out.write("<input type=\"hidden\" name=\"Nowperson_display\" value=\"");
      out.print(_Nowperson_display);
      out.write("\">\r\n");
      out.write("<input type=\"hidden\" name=\"Initiator\" value=\"");
      out.print(_Initiator);
      out.write("\">\r\n");
      out.write("<input type=\"hidden\" name=\"Initiator_display\" value=\"");
      out.print(_Initiator_display);
      out.write("\">\r\n");
      out.write("<input type=\"hidden\" name=\"Instance\" value=\"");
      out.print(_Instance);
      out.write("\">\r\n");
      out.write("<input type=\"hidden\" name=\"docTitle\" value=\"");
      out.print(docTitle);
      out.write("\">\r\n");
      out.write("<input type=\"hidden\" name=\"init_start_date\" value=\"");
      out.print(init_start_date);
      out.write("\">\r\n");
      out.write("<input type=\"hidden\" name=\"init_end_date\" value=\"");
      out.print(init_end_date);
      out.write("\">\r\n");
      out.write("<input type=\"hidden\" name=\"complete_start_date\" value=\"");
      out.print(complete_start_date);
      out.write("\">\r\n");
      out.write("<input type=\"hidden\" name=\"complete_end_date\" value=\"");
      out.print(complete_end_date);
      out.write("\">\r\n");
      out.write("\r\n");
      out.write("<input type='hidden' name='Nowperson__which_is_xml_value' id=\"Nowperson__which_is_xml_value\" value=\"");
      out.print(_Nowperson__which_is_xml_value);
      out.write("\" />\r\n");
      out.write("<input type='hidden' name='Initiator__which_is_xml_value' id=\"Initiator__which_is_xml_value\" value=\"");
      out.print(_Initiator__which_is_xml_value);
      out.write("\" />\r\n");
      out.write("\r\n");
      out.write("</fieldset>\r\n");
      out.write("\r\n");

  if (UEngineUtil.isNotEmpty(_defId)) {

      out.write("\r\n");
      out.write("\tSearch for process definition : ");
      out.print(_defId );
      out.write('\r');
      out.write('\n');

  }

      out.write("\t\r\n");
      out.write("\t\r\n");
      out.write("    <table width=\"100%\">\r\n");
      out.write("        <tr>\r\n");
      out.write("            <td><table border=\"0\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\"\r\n");
      out.write("\t\t\tclass=\"tableborder\">\r\n");
      out.write("                    <col width=\"50px\" height=\"27px\">\r\n");
      out.write("                    <col width=\"2px\">\r\n");
      out.write("                    <col width=\"50px\">\r\n");
      out.write("                    <col width=\"2px\">\r\n");
      out.write("                    <col width=\"*\" align=\"left\">\r\n");
      out.write("                    <col width=\"2px\">\r\n");
      out.write("                    <col width=\"155px\" align=\"left\">\r\n");
      out.write("                    <col width=\"2px\">\r\n");
      out.write("                    <col width=\"50px\">\r\n");
      out.write("                    <col width=\"2px\">\r\n");
      out.write("                    <col width=\"50px\">\r\n");
      out.write("                    <col width=\"2px\">\r\n");
      out.write("                    <col width=\"130px\">\r\n");
      out.write("                    <col width=\"2px\">\r\n");
      out.write("                    <col width=\"130px\">\r\n");
      out.write("                    <col width=\"2px\">\r\n");
      out.write("                    <col width=\"50px\">\r\n");
      out.write("                    <col width=\"2px\">\r\n");
      out.write("                    <col width=\"30px\">\r\n");
      out.write("                    <tr class=\"tabletitle\" align=\"center\" height=\"26\">\r\n");
      out.write("                    \t<th>");
      out.print(statusMessage);
      out.write("</th>\r\n");
      out.write("                        <th><img src=\"../images/Common/tabletitleline.gif\" width=\"2\"></th>\r\n");
      out.write("                        <th>");
      out.print(idMessage);
      out.write("</th>\r\n");
      out.write("                        <th><img src=\"../images/Common/tabletitleline.gif\" width=\"2\"></th>\r\n");
      out.write("                        <th>");
      out.print(instanceNameMessage);
      out.write("</th>\r\n");
      out.write("                        <th><img src=\"../images/Common/tabletitleline.gif\" width=\"2\"></th>\r\n");
      out.write("                        <th>");
      out.print(definitionNameMessage);
      out.write("</th>\r\n");
      out.write("                        <th><img src=\"../images/Common/tabletitleline.gif\" width=\"2\"></th>\r\n");
      out.write("                        <!-- --------------------------add view column---------------------- -->\r\n");
      out.write("                        <th>");
      out.print(GlobalContext.getMessageForWeb("Initiator", loggedUserLocale));
      out.write("</th>\r\n");
      out.write("                        <th><img src=\"../images/Common/tabletitleline.gif\" width=\"2\"></th>\r\n");
      out.write("                        <th>");
      out.print(GlobalContext.getMessageForWeb("Current Participant", loggedUserLocale));
      out.write("</th>\r\n");
      out.write("                        <th><img src=\"../images/Common/tabletitleline.gif\" width=\"2\"></th>\r\n");
      out.write("                        <!-- --------------------------------------------------------------- -->\r\n");
      out.write("                        <th>");
      out.print(GlobalContext.getMessageForWeb("Info", loggedUserLocale));
      out.write("</th>\r\n");
      out.write("                        <th><img src=\"../images/Common/tabletitleline.gif\" width=\"2\"></th>\r\n");
      out.write("                        <th>");
      out.print(GlobalContext.getMessageForWeb("Started Date", loggedUserLocale));
      out.write("</th>\r\n");
      out.write("                        <th><img src=\"../images/Common/tabletitleline.gif\" width=\"2\"></th>\r\n");
      out.write("                        <th>");
      out.print(GlobalContext.getMessageForWeb("Finished Date", loggedUserLocale));
      out.write("</th>\r\n");
      out.write("                        <th><img src=\"../images/Common/tabletitleline.gif\" width=\"2\"></th>\r\n");
      out.write("                        <th>");
      out.print(GlobalContext.getMessageForWeb("Ext1", loggedUserLocale));
      out.write("</th>\r\n");
      out.write("                        <th><img src=\"../images/Common/tabletitleline.gif\" width=\"2\"></th>\r\n");
      out.write("                        <th>");
      out.print(removeMessage);
      out.write("</th>\r\n");
      out.write("                    </tr>\r\n");

        //  ProcessInstanceDAO procInst = (ProcessInstanceDAO)GenericDAO.createDAOImpl("java:/uEngineDS", sql, ProcessInstanceDAO.class);
        //  procInst.select();
        java.sql.Connection con = DefaultConnectionFactory.create().getConnection();
        try {
          dl = DAOListCursorUtil.executeList(sql, condition, new ArrayList(), con);
          totalCount = (int) dl.getTotalCount();
          totalPageCount = dl.getTotalPageNo();
        } catch (Exception e) {
          throw e;
        } finally {
          if (con != null) {
            con.close();
          }
        }
        //int aclTotalCount = 0;
        //  while(procInst.next()){
        if (totalCount > 0) {
          boolean isGray = false;
          String bgcolor = " onmouseover=\"this.style.backgroundColor='#e7effa';\" onmouseout=\"this.style.backgroundColor = '';\" ";

          String strGrayStyle = " bgcolor=\"#F2F2F2\" ";

          String strNotGrayStyle = " bgcolor=\"#FFFFFF\" ";
         
          AclManager acl = AclManager.getInstance();
         
          for (int i = 0; i < dl.size(); i++) {
            DataMap tmpMap = (DataMap) dl.get(i);
            String pid = tmpMap.getString("instid", "");
            String status = tmpMap.getString("status", "");
            String instName = tmpMap.getString("name", "");
            String initrsnm = tmpMap.getString("initrsnm", "");
            String currrsnm = tmpMap.getString("currrsnm", "");
View Full Code Here


    condition.setOnePageCount(pageCount);
    condition.setPageNo(currentPage);

    int totalCount = 0;

    DataList dl = null;
    Connection con = null;
    ArrayList al = new ArrayList();

    String sqlStmt = " select inst.name as procinstnm, inst.info,inst.defname ,wl.* from bpm_procinst inst, bpm_worklist wl" + " where (wl.endpoint='" + endpoint + "'"
             + " or (select count(1) from bpm_roleMapping rm where rm.instId=wl.instId" + " and (rm.roleName=wl.roleName or rm.roleName=wl.refRoleName) " + " and rm.endpoint='" + endpoint
             + "') > 0 )" + " and " + statusType + " and inst.isdeleted=0 and inst.instid = wl.instid order by wl.startdate desc";
   
    try {
      con = DefaultConnectionFactory.create().getConnection();
      dl = DAOListCursorUtil.executeList(sqlStmt, condition, new ArrayList(), con);
      totalCount = (int) dl.getTotalCount();
      al.add((String) String.valueOf(totalCount));
    } catch (UEngineException e) {
      e.printStackTrace();
    } catch (Exception e) {
      e.printStackTrace();
    } finally {
      if (con != null)
        try {
          con.close();
        } catch (SQLException e) {
        }
    }

    if (totalCount > 0) {
      for (int i = 0; i < dl.size(); i++) {
        DataMap tmpMap = (DataMap) dl.get(i);

        WorkList wl = new WorkList();

        wl.setEndpoint(endpoint);
        wl.setInstanceId("" + tmpMap.getInt("INSTID", 0));
View Full Code Here

    }
   
    public static DataList executeDetailInfoList(String sql, QueryCondition condition,
            String[] keys, Connection con, Logger logger)
      throws UEngineException {
    DataList dl = new DataList();
    DataMap dm = DAOListOracleUtil.executeDetailInfo(sql, condition, keys, con, logger);
    dl.add(dm);
    return dl;
    }
View Full Code Here

            rs = pstmt.executeQuery();

            int onePageCount = condition.getOnePageCount();
            int viewPage = condition.getPageNo();

            DataList dataList = new DataList();

            if(!DAOListOracleUtil.setPositionCusor(rs, onePageCount, viewPage)) {
                return dataList;
            }

            int dataCnt = 1;
            ResultSetMetaData rsMd = rs.getMetaData();
            int colCnt = rsMd.getColumnCount();

            if(rs != null) {
                do {
                    DataMap data = new DataMap(colCnt);
                    for(int i = 1; i<=colCnt; i++){
                        data.put(rsMd.getColumnName(i), rs.getString(i));
                    }

                    // RowNum ��d.
                    data.setRownum(rs.getRow());

                    dataList.add(data);

                    dataCnt++;
                    if(dataCnt > onePageCount)
                        break;
View Full Code Here

            int onePageCount = condition.getOnePageCount();
            int viewPage = condition.getPageNo();
            long rowCount = DAOListOracleUtil.getRowCount(rs);
            int totalPage = DAOListOracleUtil.getPageCount(rowCount, onePageCount);

            DataList dataList = new DataList();

            dataList.setTotalPageNo(totalPage);
            dataList.setTotalCount(rowCount);

            if(!DAOListOracleUtil.setPositionCusor(rs, onePageCount, viewPage)) {
                return dataList;
            }

            int dataCnt = 1;
            ResultSetMetaData rsMd = rs.getMetaData();
            int colCnt = rsMd.getColumnCount();

            if(rs != null) {
                do {
                    DataMap data = new DataMap(colCnt);
                    for(int i = 1; i<=colCnt; i++){
                        data.put(rsMd.getColumnName(i), rs.getString(i));
                    }

                    // RowNum ��d.
                    data.setRownum(rs.getRow());

                    dataList.add(data);

                    dataCnt++;
                    if(dataCnt > onePageCount)
                        break;
View Full Code Here

              }
            }
           
            rs = pstmt.executeQuery();

            DataList dataList = new DataList();

            boolean isStartRow = true;
            ResultSetMetaData rsMd = rs.getMetaData();
            int colCnt = rsMd.getColumnCount();

            while(rs.next()) {
              if(isStartRow){
                    rowCount = rs.getLong(TOTCNT_KEY);
                isStartRow = false;
              }
                DataMap data = new DataMap(colCnt);
                for(int i = 1; i<=colCnt; i++){
                    int type = rsMd.getColumnType(i);
                    switch (type) {
                        case java.sql.Types.VARCHAR:
                            data.put(rsMd.getColumnName(i), rs.getString(i));
                            break;
                        case java.sql.Types.DATE:
                            data.put(rsMd.getColumnName(i), rs.getTimestamp(i));
                            break;
                        case java.sql.Types.TIME:
                        case java.sql.Types.TIMESTAMP:
                            data.put(rsMd.getColumnName(i), rs.getTimestamp(i));
                            break;
                        default:
                            data.put(rsMd.getColumnName(i), rs.getString(i));
                            break;
                    }
                }
                // RowNum ��d.
                data.setRownum(rs.getInt(ROWNUM_KEY));
               
                dataList.add(data);
            }
           
            totalPage = getPageCount(rowCount, onePageCount);
            dataList.setTotalPageNo(totalPage);
            dataList.setTotalCount(rowCount);
           
            return dataList;
        }catch(NullPointerException e){
      logger
          .error(
View Full Code Here

          if ( startPosition > 1 )
            rs.absolute((int)startPosition);
           
//            pstmt.execute

            DataList dataList = new DataList();

            boolean isStartRow = true;
            ResultSetMetaData rsMd = rs.getMetaData();
            int colCnt = rsMd.getColumnCount();

            for(int j=(int)startPosition; rs.next(); j++) {
              if ( j == (int)endPosition ) {
                break;
              }
              if(isStartRow){
                    //rowCount = rs.getLong(TOTCNT_KEY);
                rowCount = 500;
                isStartRow = false;
              }
                DataMap data = new DataMap(colCnt);
                for(int i = 1; i<=colCnt; i++){
                    int type = rsMd.getColumnType(i);
                    switch (type) {
                        case java.sql.Types.VARCHAR:
                            data.put(rsMd.getColumnName(i), rs.getString(i));
                            break;
                        case java.sql.Types.DATE:
                            data.put(rsMd.getColumnName(i), rs.getTimestamp(i));
                            break;
                        case java.sql.Types.TIME:
                        case java.sql.Types.TIMESTAMP:
                            data.put(rsMd.getColumnName(i), rs.getTimestamp(i));
                            break;
                        default:
                            data.put(rsMd.getColumnName(i), rs.getString(i));
                            break;
                    }
                }
                // RowNum ��d.
                data.setRownum(rs.getInt(ROWNUM_KEY));
               
                dataList.add(data);
            }
           
            totalPage = getPageCount(rowCount, onePageCount);
            dataList.setTotalPageNo(totalPage);
            dataList.setTotalCount(rowCount);
           
            return dataList;
        }catch(NullPointerException e){
      logger
          .error(
View Full Code Here

            int onePageCount = condition.getOnePageCount();
            int viewPage = condition.getPageNo();
            long rowCount = DAOListCursorUtil.getRowCount(rs);
            int totalPage = DAOListCursorUtil.getPageCount(rowCount, onePageCount);

            DataList dataList = new DataList();

            dataList.setTotalPageNo(totalPage);
            dataList.setTotalCount(rowCount);

            if(!DAOListCursorUtil.setPositionCusor(rs, onePageCount, viewPage)) {
                return dataList;
            }

            int dataCnt = 1;
            ResultSetMetaData rsMd = rs.getMetaData();
            int colCnt = rsMd.getColumnCount();

            if(rs != null) {
                do {
                    DataMap data = new DataMap(colCnt);
                    for(int i = 1; i<=colCnt; i++){
                        int type = rsMd.getColumnType(i);
                        switch (type) {
                            case java.sql.Types.VARCHAR:
                                data.put(rsMd.getColumnName(i).toUpperCase(), rs.getString(i));
                                break;
                            case java.sql.Types.DATE:
                            case java.sql.Types.TIME:
                            case java.sql.Types.TIMESTAMP:
                                data.put(rsMd.getColumnName(i).toUpperCase(), rs.getTimestamp(i));
                                break;
                            default:
                                data.put(rsMd.getColumnName(i).toUpperCase(), rs.getString(i));
                                break;
                        }
                    }

                    // RowNum ��d.
                    data.setRownum(rs.getRow());

                    dataList.add(data);

                    dataCnt++;
                    if(dataCnt > onePageCount)
                        break;
View Full Code Here

    }
   
    public static DataList executeDetailInfoList(String sql, QueryCondition condition,
            String[] keys, Connection con)
      throws UEngineException {
    DataList dl = new DataList();
    DataMap dm = executeDetailInfo(sql, condition, keys, con);
    dl.add(dm);
    return dl;
    }
View Full Code Here

TOP

Related Classes of org.uengine.ui.list.datamodel.DataList

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.