Package it.eng.spagobi.behaviouralmodel.analyticaldriver.dao

Examples of it.eng.spagobi.behaviouralmodel.analyticaldriver.dao.IParameterUseDAO


  @Override
  public List<String> retrieveValues(BIObjectParameter parameter) throws Exception {
    logger.debug("IN");
    List<String> toReturn = new ArrayList<String>();
    IParameterUseDAO parusedao;
    try {
      parusedao = DAOFactory.getParameterUseDAO();
      ParameterUse paruse = parusedao.loadByParameterIdandRole(parameter.getParID(), roleToBeUsed);
      Integer manInp = paruse.getManualInput();
      if(manInp.intValue()==1) {
        // modality is manual input, no values can be retrieved
        return toReturn;
      } else {
View Full Code Here


    logger.debug("roleName="+roleName);
    logger.debug("parameterId="+parIdStr);
   
    Integer parId = new Integer(parIdStr);
    // check if the parameter use is manual input
    IParameterUseDAO parusedao = DAOFactory.getParameterUseDAO();
    ParameterUse paruse = parusedao.loadByParameterIdandRole(parId, roleName);
    Integer manInp = paruse.getManualInput();
    if(manInp.intValue()==1) {
      String message = "";
      try{
        message = PortletUtilities.getMessage("scheduler.fillparmanually", "component_scheduler_messages");
View Full Code Here

      } else {
        // looks for dependencies associated to the previous lov
        Integer lovId = modVal.getId();
        ModalitiesValue initialLov = DAOFactory.getModalitiesValueDAO().loadModalitiesValueByID(lovId);
        IObjParuseDAO objParuseDAO = DAOFactory.getObjParuseDAO();
        IParameterUseDAO paruseDAO = DAOFactory.getParameterUseDAO();
        List paruses = paruseDAO.getParameterUsesAssociatedToLov(lovId);
        Iterator parusesIt = paruses.iterator();
        List documents = new ArrayList();
        List correlations = new ArrayList();
        while (parusesIt.hasNext()) {
          ParameterUse aParuse = (ParameterUse) parusesIt.next();
View Full Code Here

      BIObjectParameter biparam = (BIObjectParameter) iterBIParams.next();
      IParameterDAO parDAO = DAOFactory.getParameterDAO();
      Parameter param = parDAO.loadForDetailByParameterID(biparam.getParameter().getId());
      exporter.insertParameter(param, session);
      exporter.insertBIObjectParameter(biparam, session);
      IParameterUseDAO paruseDAO = DAOFactory.getParameterUseDAO();
      List paruses = paruseDAO.loadParametersUseByParId(param.getId());
      exportParUses(paruses);
    }
    logger.debug("OUT");
  }
View Full Code Here

 
  private void delDetailParameter(SourceBean request)
                      throws EMFUserError, SourceBeanException {
    try {
      IParameterDAO parDAO = DAOFactory.getParameterDAO();
      IParameterUseDAO parUseDAO = DAOFactory.getParameterUseDAO();
      String id = (String) request.getAttribute("PAR_ID");
      //controls if the parameter has any object associated
      List objectsLabels = DAOFactory.getBIObjectParameterDAO().getDocumentLabelsListUsingParameter(new Integer(id));
      if (objectsLabels != null && objectsLabels.size() > 0){
        HashMap params = new HashMap();
        params.put(AdmintoolsConstants.PAGE, MODULE_PAGE);
        Vector v = new Vector();
        v.add(objectsLabels.toString());
        EMFUserError error = new EMFUserError(EMFErrorSeverity.ERROR, 1017, v, params);
        errorHandler.addError(error);
        return;
      }
     
      //controls if the parameter has any use associated
      boolean hasUse = DAOFactory.getParameterUseDAO().hasParUseModes(id);
      if (hasUse){
          parUseDAO.eraseParameterUseByParId(Integer.valueOf(id));
      }
      //end of control
     
      Parameter parameter =  parDAO.loadForDetailByParameterID(new Integer(id));
      parDAO.eraseParameter(parameter);
View Full Code Here

                  return;
                }
              }
            }

            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";
        }
View Full Code Here

    if (paruseIdInt == null || paruseIdInt.intValue() == -1) {
      // it means that the ParameterUse in input must be inserted, not modified
      return;
    }
    IObjParuseDAO objParuseDAO = DAOFactory.getObjParuseDAO();
    IParameterUseDAO paruseDAO = DAOFactory.getParameterUseDAO();
    ParameterUse initialParuse = paruseDAO.loadByUseID(paruseIdInt);
    List documents = objParuseDAO.getDocumentLabelsListWithAssociatedDependencies(paruseIdInt);
    if (documents.size() > 0) {
      // there are some correlations
      if (paruse.getManualInput().intValue() == 1 ||
          paruse.getIdLov().intValue() != initialParuse.getIdLov().intValue()) {
View Full Code Here

  private ParameterUse reloadParuse (Integer parIdInt, String label) throws EMFInternalError {
    if (parIdInt == null || parIdInt.intValue() < 0 || label == null || label.trim().equals(""))
      throw new EMFInternalError(EMFErrorSeverity.ERROR, "Invalid input data for method relaodParuse in DetailParameterModule");
    ParameterUse paruse = null;
    try {
      IParameterUseDAO paruseDAO = DAOFactory.getParameterUseDAO();
      List paruses = paruseDAO.loadParametersUseByParId(parIdInt);
      Iterator it = paruses.iterator();
      while (it.hasNext()) {
        ParameterUse aParameterUse = (ParameterUse) it.next();
        if (aParameterUse.getLabel().equals(label)) {
          paruse = aParameterUse;
View Full Code Here

 
  private void delDetailParameter(SourceBean request, String mod, SourceBean response)
    throws EMFUserError, SourceBeanException {
    try {
      IParameterDAO parDAO = DAOFactory.getParameterDAO();
      IParameterUseDAO parUseDAO = DAOFactory.getParameterUseDAO();
      String id = (String) request.getAttribute("id");
      //controls if the parameter has any object associated
      List objectsLabels = DAOFactory.getBIObjectParameterDAO().getDocumentLabelsListUsingParameter(new Integer(id));
      if (objectsLabels != null && objectsLabels.size() > 0){
        HashMap params = new HashMap();
        params.put(AdmintoolsConstants.PAGE, ListParametersModule.MODULE_PAGE);
        Vector v = new Vector();
        v.add(objectsLabels.toString());
        EMFUserError error = new EMFUserError(EMFErrorSeverity.ERROR, 1017, v, params);
        errorHandler.addError(error);
        return;
      }
     
      //controls if the parameter has any use associated
      boolean hasUse = DAOFactory.getParameterUseDAO().hasParUseModes(id);
      if (hasUse){
          parUseDAO.eraseParameterUseByParId(Integer.valueOf(id));
      }
      //end of control
     
      Parameter parameter =  parDAO.loadForDetailByParameterID(new Integer(id));
      parDAO.eraseParameter(parameter);
View Full Code Here

      ExecutionInstance executionInstance =  getContext().getExecutionInstance( ExecutionInstance.class.getName() );
     
      ParameterUse biParameterExecModality;
      try {
        // load parameter use ...
        IParameterUseDAO parusedao = DAOFactory.getParameterUseDAO();
        biParameterExecModality = parusedao.loadByParameterIdandRole(biparam.getParID(), executionInstance.getExecutionRole());
      } catch (Exception e) {
        throw new SpagoBIServiceException(SERVICE_NAME, "Impossible to find any valid execution modality for parameter [" + id + "] and role [" + executionInstance.getExecutionRole() + "]", e);
      }
     
      Assert.assertNotNull(biParameterExecModality, "Impossible to find any valid execution modality for parameter [" + id + "] and role [" + executionInstance.getExecutionRole() + "]" );
View Full Code Here

TOP

Related Classes of it.eng.spagobi.behaviouralmodel.analyticaldriver.dao.IParameterUseDAO

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.