Пример #1
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);
  }
Пример #2
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);
  }
Пример #3
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;
  }
Пример #4
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);
  }