Package it.eng.spago.base

Examples of it.eng.spago.base.SessionContainer


                }
              }
            }

            IParameterUseDAO paruseDAO = DAOFactory.getParameterUseDAO();
            SessionContainer permSess = getRequestContainer().getSessionContainer().getPermanentContainer();
            IEngUserProfile profile = (IEngUserProfile)permSess.getAttribute(IEngUserProfile.ENG_USER_PROFILE)
            paruseDAO.setUserProfile(profile);
            if (paruseIdInt.intValue() == -1) {
              // it is requested to insert a new ParameterUse
              paruseDAO.insertParameterUse(paruse);
            } else {
              // it is requested to modify a ParameterUse.
              paruseDAO.modifyParameterUse(paruse);
            }
            prepareParameterDetailPage(response, parameter, null, selectedParuseIdStr,
                ObjectsTreeConstants.DETAIL_MOD, false, true);
            return;
          } else {
            prepareParameterDetailPage(response, parameter, null, selectedParuseIdStr,
                ObjectsTreeConstants.DETAIL_MOD, false, true);
              return;
          }
         
        } else if (deleteParameterUse != null) {
          // it is requested to delete the visible ParameterUse
          int paruseId = findParuseId(deleteParameterUse);
          checkForDependancies(new Integer(paruseId));
          // if there are some errors into the errorHandler does not write into DB
          Collection errors = errorHandler.getErrors();
          if (errors != null && errors.size() > 0) {
            Iterator iterator = errors.iterator();
            while (iterator.hasNext()) {
              Object error = iterator.next();
              if (error instanceof EMFValidationError) {
                  prepareParameterDetailPage(response, parameter, paruse, paruseIdStr,
                      ObjectsTreeConstants.DETAIL_MOD, false, false);
                return;
              }
            }
          }

          IParameterUseDAO paruseDAO = DAOFactory.getParameterUseDAO();
          paruse = paruseDAO.loadByUseID(new Integer(paruseId));
          paruseDAO.eraseParameterUse(paruse);
          selectedParuseIdStr = "";
          prepareParameterDetailPage(response, parameter, null, selectedParuseIdStr,
              ObjectsTreeConstants.DETAIL_MOD, false, true);
          return;
         
        } else {
          // It is request to save the Parameter with also the visible ParameterUse
          // If a new ParameterUse was visualized and no fields were inserted, the ParameterUse is not validated and saved
          boolean paruseToBeSaved = true;
          if (GenericValidator.isBlankOrNull(paruse.getLabel())
              && GenericValidator.isBlankOrNull(paruse.getName())
              && paruse.getUseID().intValue() == -1
              && paruse.getIdLov().intValue() == -1
              && paruse.getAssociatedChecks().size() == 0
              && paruse.getAssociatedRoles().size() == 0)
            paruseToBeSaved = false;
          if (paruseToBeSaved) {
            ValidationCoordinator.validate("PAGE", "ParameterUseValidation", this);
            parameterUseLabelControl(paruse, mod);
            verifyForDependencies(paruse);
          }

          ValidationCoordinator.validate("PAGE", "ParameterValidation", this);
          parameterLabelControl(parameter, mod);
           
          // if there are some validation errors into the errorHandler does not write into DB
          Collection errors = errorHandler.getErrors();
          if (errors != null && errors.size() > 0) {
            Iterator iterator = errors.iterator();
            while (iterator.hasNext()) {
              Object error = iterator.next();
              if (error instanceof EMFValidationError) {
                prepareParameterDetailPage(response, parameter, paruse, paruseIdInt.toString(),
                    ObjectsTreeConstants.DETAIL_MOD, false, false);
                return;
              }
            }
          }

          // it is requested to modify the Parameter
          DAOFactory.getParameterDAO().modifyParameter(parameter);
           
            if (paruseToBeSaved) {
            IParameterUseDAO paruseDAO = DAOFactory.getParameterUseDAO();
            SessionContainer permSess = getRequestContainer().getSessionContainer().getPermanentContainer();
            IEngUserProfile profile = (IEngUserProfile)permSess.getAttribute(IEngUserProfile.ENG_USER_PROFILE)
            paruseDAO.setUserProfile(profile);
            if (paruseIdInt.intValue() == -1) {
              // it is requested to insert a new ParameterUse
              paruseDAO.insertParameterUse(paruse);
              // reload the paruse with the given label
              paruse = reloadParuse(parameter.getId(), paruse.getLabel());
            } else {
              // it is requested to modify a ParameterUse
              paruseDAO.modifyParameterUse(paruse);
            }
            selectedParuseIdStr = paruse.getUseID().toString();
            } else selectedParuseIdStr = "-1";
        }

        } else {
          ValidationCoordinator.validate("PAGE", "ParameterValidation", this);
          parameterLabelControl(parameter, mod);
          // if there are some errors, exits without writing into DB
          selectedParuseIdStr = "-1";
         
        // if there are some validation errors into the errorHandler does not write into DB
        Collection errors = errorHandler.getErrors();
        if (errors != null && errors.size() > 0) {
          Iterator iterator = errors.iterator();
          while (iterator.hasNext()) {
            Object error = iterator.next();
            if (error instanceof EMFValidationError) {
              prepareParameterDetailPage(response, parameter, null, selectedParuseIdStr,
                  ObjectsTreeConstants.DETAIL_INS, false, false);
              return;
            }
          }
        }

          // inserts into DB the new Parameter
        SessionContainer permSess = getRequestContainer().getSessionContainer().getPermanentContainer();
        IEngUserProfile profile = (IEngUserProfile)permSess.getAttribute(IEngUserProfile.ENG_USER_PROFILE)
        IParameterDAO dao=DAOFactory.getParameterDAO();
        dao.setUserProfile(profile);
          dao.insertParameter(parameter);
          // reload the Parameter with the correct id
          parameter = reloadParameter(parameter.getLabel());
View Full Code Here


  }
 
  private void lookupLoadHandler(SourceBean request, String modality, SourceBean response) throws EMFUserError, SourceBeanException{
   
    RequestContainer requestContainer = this.getRequestContainer();
    SessionContainer session = requestContainer.getSessionContainer();
    Parameter parameter = recoverParameterDetails(request, modality);
    String paruseIdStr = (String)request.getAttribute("useId");
    ParameterUse paruse = recoverParameterUseDetails(request, parameter.getId(), new Integer(paruseIdStr));
    session.setAttribute("LookupParameter", parameter);
    session.setAttribute("LookupParuse", paruse);
    session.setAttribute("modality", modality);
    response.setAttribute("lookupLoopback", "true");
   
  }
View Full Code Here

   
  }
 
  private void lookupReturnHandler (SourceBean request, SourceBean response) throws SourceBeanException, EMFUserError {
    RequestContainer requestContainer = this.getRequestContainer();
    SessionContainer session = requestContainer.getSessionContainer();
    Parameter parameter = (Parameter) session.getAttribute("LookupParameter");
    ParameterUse paruse = (ParameterUse) session.getAttribute("LookupParuse");
    String modality = (String) session.getAttribute("modality");
    String selectedLovId = (String) request.getAttribute("ID");
    paruse.setIdLov(Integer.valueOf(selectedLovId));
    prepareParameterDetailPage(response, parameter, paruse, paruse.getUseID().toString(), modality, false, false)
    session.delAttribute("LookupParameter");
    session.delAttribute("LookupParUse");
    session.delAttribute("modality");
    session.setAttribute("SelectedLov", "true");
    response.setAttribute("SelectedLov", "true");
  }
View Full Code Here

    response.setAttribute("SelectedLov", "true");
  }
 
  private void lookupReturnBackHandler (SourceBean request, SourceBean response) throws SourceBeanException, EMFUserError {
    RequestContainer requestContainer = this.getRequestContainer();
    SessionContainer session = requestContainer.getSessionContainer();
    Parameter parameter = (Parameter) session.getAttribute("LookupParameter");
    ParameterUse paruse = (ParameterUse) session.getAttribute("LookupParuse");
    String modality = (String) session.getAttribute("modality");
    prepareParameterDetailPage(response, parameter, paruse, paruse.getUseID().toString(), modality, false, false);
    session.delAttribute("LookupParameter");
    session.delAttribute("LookupParUse");
    session.delAttribute("modality");
  }
View Full Code Here

      //getting default folder (root)
      LowFunctionality rootFunct = DAOFactory.getLowFunctionalityDAO().loadRootLowFunctionality(false);
      if (folderID == null || folderID.equalsIgnoreCase(ROOT_NODE_ID))
        folderID = String.valueOf(rootFunct.getId());
           
      SessionContainer sessCont = getSessionContainer();
      SessionContainer permCont = sessCont.getPermanentContainer();
      IEngUserProfile profile = (IEngUserProfile)permCont.getAttribute(IEngUserProfile.ENG_USER_PROFILE);
     
     
      //getting  documents
      List tmpObjects = DAOFactory.getBIObjectDAO().searchBIObjects(valueFilter, typeFilter, columnFilter, scope, Integer.valueOf(folderID), profile);
      objects = new ArrayList();
View Full Code Here

   * @return A string representing the name of the correct publisher, which will
   * call the correct jsp reference.
   */

  public String getPublisherName(RequestContainer requestContainer, ResponseContainer responseContainer) {
    SessionContainer session = requestContainer.getSessionContainer();
    EMFErrorHandler errorHandler = responseContainer.getErrorHandler();
   
    // get the module response
    SourceBean moduleResponse = (SourceBean)responseContainer.getServiceResponse().getAttribute("DetailParameterModule");
   
View Full Code Here

  private void modDetailMenu(SourceBean request, String mod, SourceBean response)
  throws EMFUserError, SourceBeanException {

    //**********************************************************************
    RequestContainer reqCont = getRequestContainer();
    SessionContainer sessCont = reqCont.getSessionContainer();
    SessionContainer permSess = sessCont.getPermanentContainer();
    IEngUserProfile profile = (IEngUserProfile)permSess.getAttribute(IEngUserProfile.ENG_USER_PROFILE);

   
    Menu menu = recoverMenuDetails(request, mod);
    response.setAttribute(MENU, menu);
    response.setAttribute(AdmintoolsConstants.MODALITY, mod);
View Full Code Here

  throws EMFUserError, SourceBeanException {
    try {
      String id = (String)request.getAttribute(MENU_ID);
      IMenuDAO menudao = DAOFactory.getMenuDAO();
      Menu menu = menudao.loadMenuByID(Integer.valueOf(id));
      SessionContainer permSess = getRequestContainer().getSessionContainer().getPermanentContainer();
      menudao.eraseMenu(menu);

    } catch (EMFUserError eex) {
      throw new EMFUserError(EMFErrorSeverity.ERROR, "10002", messageBundle);
    } catch (Exception ex) {
View Full Code Here


  private void lookupLoadHandler(SourceBean request, String modality, SourceBean response) throws EMFUserError, SourceBeanException{

    RequestContainer requestContainer = this.getRequestContainer();
    SessionContainer session = requestContainer.getSessionContainer();
    session.setAttribute("modality", modality);
    response.setAttribute(DetailMenuModule.LOOKUP, "true");

  }
View Full Code Here

      if(!errorHandler.isOKBySeverity(EMFErrorSeverity.ERROR)) {
        response.setAttribute("checkObj", aCheck);
        response.setAttribute("modality", mod);
        return;
      }
      SessionContainer permSess = getRequestContainer().getSessionContainer().getPermanentContainer();
      IEngUserProfile profile = (IEngUserProfile)permSess.getAttribute(IEngUserProfile.ENG_USER_PROFILE);   
      ICheckDAO dao=DAOFactory.getChecksDAO();
      dao.setUserProfile(profile);
      if (mod.equalsIgnoreCase(AdmintoolsConstants.DETAIL_INS)) {
        dao.insertCheck(aCheck);
      } else {
View Full Code Here

TOP

Related Classes of it.eng.spago.base.SessionContainer

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.