/**
   * Validates whether the the form values are valid.
   *
   * @param String sAction
   * @return boolean
   */
  private boolean isFormValid(String sAction) {
    boolean bReturn = true;
    ApplicationUSOM objectManager = (ApplicationUSOM) getUSOM();
    IUSERBValueObject currentUser = objectManager.getCurrentUSERB();
    if (sAction.equalsIgnoreCase(SAVE_GROUP) || sAction.equalsIgnoreCase(CREATE_GROUP)) {
      /////////////////////////////////////////////////////
      // To Do:  Post Submit Form Validation
      /////////////////////////////////////////////////////

      try {
        // if creating, create an empty one first
        if (sAction.equalsIgnoreCase(CREATE_GROUP)) {
          String systemid = SequenceBaseProxy.getSystemID(currentUser.getDept());
          m_GROUPValueObject = new GROUPValueObject(new GROUPPrimaryKey(systemid));
          m_GROUPValueObject.setGroupname(getServletRequestParameter("groupname"));
          m_GROUPValueObject.setDept(getServletRequestParameter("dept"));
        } else // must be saving an existing one, so get it from the cache
        {

          // m_GROUPValueObject = objectManager.getCurrentGROUP();
          String groupid = this.getServletRequestParameter("groupid");
          m_GROUPValueObject = GROUPProxy.getGROUP(new GROUPPrimaryKey(groupid));

          if (m_GROUPValueObject == null) {
            logMessage(
                FrameworkLogEventType.DEBUG_LOG_EVENT_TYPE,
                "GROUPWorkerBean:isFormValid() - failed to acquire the Current GROUP from the Application USOM. ");
            return (false);
          }
          m_GROUPValueObject.setGroupname(getServletRequestParameter("groupname"));
          m_GROUPValueObject.setDept(getServletRequestParameter("dept"));
        }
        // AIB Generated Section - Do Not Modify Within

        /*
        m_GROUPValueObject.setSys_reserver1( getServletRequestParameter( "sys_reserver1" )  );
        m_GROUPValueObject.setSys_reserver2( getServletRequestParameter( "sys_reserver2" )  );
        m_GROUPValueObject.setSys_reserver3( getServletRequestParameter( "sys_reserver3" )  );
        m_GROUPValueObject.setSys_reserver4( getServletRequestParameter( "sys_reserver4" )  );
        m_GROUPValueObject.setSys_reserver5( getServletRequestParameter( "sys_reserver5" )  );
        */
        // ~AIB Generated

      } catch (Exception exc) {
        logMessage(
            FrameworkLogEventType.DEBUG_LOG_EVENT_TYPE,
            "GROUPWorkerBean:isFormValid() - Exception caught - " + exc);
        bReturn = false;
      }
    }

    return bReturn;
  }
  public String createGROUPHTM() throws ProcessingException {
    String sReturnValue = null;

    logMessage(
        FrameworkLogEventType.DEBUG_LOG_EVENT_TYPE, "Inside GROUPWorkerBean::createGROUPHTM");

    try {
      ApplicationUSOM objectManager = (ApplicationUSOM) getUSOM();
      IUSERBValueObject currentUser = objectManager.getCurrentUSERB();
      Collection coll = USERBProxy.getOptionUser(currentUser.getUserid());
      objectManager.setUSERBs(coll);
    } catch (Exception exc) {
      throw new ProcessingException("GROUPWorkerBean:saveGROUP() - " + exc, exc);
    }

    return (sReturnValue);
  }
  public String saveGROUPHTM() throws ProcessingException {
    String sReturnValue = null;

    logMessage(FrameworkLogEventType.DEBUG_LOG_EVENT_TYPE, "Inside GROUPWorkerBean::saveGROUPHTM");

    try {
      String groupid = this.getServletRequestParameter("groupid");
      ApplicationUSOM objectManager = (ApplicationUSOM) getUSOM();
      IUSERBValueObject currentUser = objectManager.getCurrentUSERB();
      Collection colOption = USERBProxy.getOptionUser(currentUser.getUserid());
      Collection selecteduser = USERBProxy.getGroupUser(groupid);
      ArrayList optionArr = new ArrayList();
      if (colOption != null && selecteduser != null) {
        ArrayList tempA = new ArrayList(colOption);
        ArrayList tempB = new ArrayList(selecteduser);
        IUSERBValueObject optionuser = null;
        IUSERBValueObject selectuser = null;
        boolean flag = false;
        for (int i = 0; i < tempA.size(); i++) {
          flag = true;
          optionuser = (IUSERBValueObject) tempA.get(i);
          for (int j = 0; j < tempB.size(); j++) {
            selectuser = (IUSERBValueObject) tempB.get(j);
            if (optionuser.getUserid().equals(selectuser.getUserid())) {
              flag = false;
            }
          }
          if (flag) {
            optionArr.add(optionuser);
          }
        }
      }
      this.getHttpServletRequest().setAttribute("optionusers", optionArr);
      if (selecteduser != null) {
        this.getHttpServletRequest().setAttribute("selectedusers", new ArrayList(selecteduser));
      } else {
        this.getHttpServletRequest().setAttribute("selectedusers", new ArrayList());
      }

    } catch (Exception exc) {
      throw new ProcessingException("GROUPWorkerBean:saveGROUPHTM() - " + exc, exc);
    }

    return (sReturnValue);
  }