예제 #1
0
  /**
   * Saves a GROUPValueObject through the business facade using information in the
   * HttpServletRequest.
   *
   * @return String as result
   * @exception ProcessingException
   */
  public String saveGROUP() throws ProcessingException {
    String sReturnValue = null;

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

    try {
      GROUPProxy proxy = new GROUPProxy(this.m_GROUPValueObject);
      proxy.saveGROUP();
    } catch (Exception exc) {
      throw new ProcessingException("GROUPWorkerBean:saveGROUP() - " + exc, exc);
    }

    return (sReturnValue);
  }
예제 #2
0
  /**
   * Loads all GROUPValueObjects through the business facade using information in the
   * HttpServletRequest.
   *
   * @return String as result
   * @exception ProcessingException
   */
  public String loadAllGROUPs() throws ProcessingException {
    String sReturnValue = null;

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

    try {
      // load the GROUPValueObject
      Collection coll = GROUPProxy.getGROUPs();

      if (coll != null) {
        logMessage(
            FrameworkLogEventType.DEBUG_LOG_EVENT_TYPE,
            "GROUPWorkerBean:loadAllGROUPs() - successfully loaded all GROUPValueObjects - "
                + coll.toString());

        // assign the GROUPValueObject to the ApplicationUSOM
        ApplicationUSOM objectManager = (ApplicationUSOM) getUSOM();
        objectManager.setGROUPs(coll);
      }
    } catch (Exception exc) {
      throw new ProcessingException(
          "GROUPWorkerBean:loadAllGROUPs() - successfully loaded all GROUPValueObjects - " + exc,
          exc);
    }

    return (sReturnValue);
  }
예제 #3
0
  /**
   * Loads a GROUPValueObject through the business facade using information in the
   * HttpServletRequest.
   *
   * @return String as result
   * @exception ProcessingException
   */
  public String loadGROUP() throws ProcessingException {
    String sReturnValue = null;

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

    try {
      // load the GROUPValueObject
      GROUPPrimaryKey primaryKey = getPrimaryKeyFromServletRequest();
      IGROUPValueObject valueObject = GROUPProxy.getGROUP(primaryKey);

      if (valueObject != null) {
        logMessage(
            FrameworkLogEventType.DEBUG_LOG_EVENT_TYPE,
            "GROUPWorkerBean:loadGROUP() - successfully loaded - " + valueObject.toString());

        // assign the GROUPValueObject to the ApplicationUSOM
        ApplicationUSOM objectManager = (ApplicationUSOM) getUSOM();
        objectManager.setCurrentGROUP(valueObject);
      }
    } catch (Exception exc) {
      throw new ProcessingException("GROUPWorkerBean:loadGROUP() - " + exc, exc);
    }

    return (sReturnValue);
  }
예제 #4
0
  /**
   * Deletes a GROUPValueObject through the business facade using information in the
   * HttpServletRequest.
   *
   * @return String as result
   * @exception ProcessingException
   */
  public String deleteGROUP() throws ProcessingException {
    String sReturnValue = null;

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

    try {
      GROUPPrimaryKey primaryKey = getPrimaryKeyFromServletRequest();
      IGROUPValueObject valueObject = GROUPProxy.getGROUP(primaryKey);

      // delete the GROUPValueObject
      if (valueObject != null) {
        new GROUPProxy(valueObject).delete();
        logMessage(
            FrameworkLogEventType.DEBUG_LOG_EVENT_TYPE,
            "GROUPWorkerBean:deleteGROUP() - successfully delete GROUPValueObject with key field(s) - "
                + primaryKey.toString());

        // update the cached list
        sReturnValue = loadAllGROUPs();
      }
    } catch (Exception exc) {
      throw new ProcessingException("GROUPWorkerBean:deleteGROUP() - " + exc, exc);
    }

    return (sReturnValue);
  }
예제 #5
0
  /**
   * Creates a GROUPValueObject through the business facade using information in the
   * HttpServletRequest.
   *
   * @return String as result
   * @exception ProcessingException
   */
  public String createGROUP() throws ProcessingException {
    String sReturnValue = null;

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

    try {
      // Create the GROUPValueObject by calling the
      // static createGROUP method on GROUPProxy
      IGROUPValueObject valueObject = GROUPProxy.createGROUP(this.m_GROUPValueObject);

      if (valueObject != null) {
        // logMessage( FrameworkLogEventType.DEBUG_LOG_EVENT_TYPE,  "GROUPWorkerBean:createGROUP() -
        // successfully created GROUPValueObject - " + valueObject.toString() );
        ApplicationUSOM objectManager = (ApplicationUSOM) getUSOM();
        objectManager.setCurrentGROUP(valueObject);
      }
      String[] users = this.getHttpServletRequest().getParameterValues("selectItems");
      if (users != null && users.length > 0) {
        for (int i = 0; i < users.length; i++) {
          GROUPUSERProxy.createGROUPUSER(
              new GROUPUSERValueObject(
                  new GROUPUSERPrimaryKey(users[i], valueObject.getGroupid())));
        }
      }
    } catch (Exception exc) {
      throw new ProcessingException("GROUPWorkerBean:createGROUP() - " + exc, exc);
    }

    return (sReturnValue);
  }
예제 #6
0
  /**
   * 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;
  }
예제 #7
0
  public String saveGROUPXML() throws ProcessingException {
    String sReturnValue = null;

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

    try {
      String groupid = this.getServletRequestParameter("groupid");
      IGROUPValueObject valueObject = GROUPProxy.getGROUP(new GROUPPrimaryKey(groupid));
      String fileName = "security/EditGROUP.xml";
      DocumentMaker dm = new DocumentMaker(fileName);
      HashMap map = new HashMap();
      Document doc = dm.createDocument(map, (FrameworkValueObject) valueObject);
      this.getHttpServletRequest().setAttribute("dom", doc);
    } catch (Exception exc) {
      throw new ProcessingException("GROUPWorkerBean:saveGROUPXML() - " + exc, exc);
    }

    return (sReturnValue);
  }