Package it.eng.spagobi.behaviouralmodel.lov.bo

Examples of it.eng.spagobi.behaviouralmodel.lov.bo.ModalitiesValue


   * @param response The response SourceBean
   * @throws EMFUserError If an Exception occurred
   */
  private void newDetailModValue(SourceBean response) throws EMFUserError {
    try {
      ModalitiesValue modVal = new ModalitiesValue();
      modVal.setId(new Integer(0));
      modVal.setName("");
      modVal.setDescription("");
      modVal.setLabel("");
      modVal.setLovProvider("");
      modVal.setITypeCd("QUERY");
      prepareDetailModalitiesValuePage(modVal, AdmintoolsConstants.DETAIL_INS, response);
      session.setAttribute(SpagoBIConstants.LOV_MODIFIED, "false");
      session.setAttribute(SpagoBIConstants.MODALITY_VALUE_OBJECT, modVal);
    } catch (Exception ex) {
      logger.error("Cannot prepare page for the insertion", ex);
View Full Code Here


    List allModVal = DAOFactory.getModalitiesValueDAO()
        .loadAllModalitiesValue();
    if (AdmintoolsConstants.DETAIL_INS.equalsIgnoreCase(mod)) {
      Iterator i = allModVal.iterator();
      while (i.hasNext()) {
        ModalitiesValue value = (ModalitiesValue) i.next();
        String valueLabel = value.getLabel();
        if (valueLabel.equals(label)) {
          HashMap params = new HashMap();
          params.put(AdmintoolsConstants.PAGE,
              ListLovsModule.MODULE_PAGE);
          EMFValidationError error = new EMFValidationError(EMFErrorSeverity.ERROR, "label", "1024",
              new Vector(), params);
          errorHandler.addError(error);
        }
      }
    } else {
      String currentId = (String) request.getAttribute("id");
      Iterator i = allModVal.iterator();
      while (i.hasNext()) {
        ModalitiesValue value = (ModalitiesValue) i.next();
        String valueLabel = value.getLabel();
        String valueId = value.getId().toString();
        if (valueLabel.equals(label)
            && (!currentId.equalsIgnoreCase(valueId))) {
          HashMap params = new HashMap();
          params.put(AdmintoolsConstants.PAGE,
              ListLovsModule.MODULE_PAGE);
View Full Code Here

    while (iterUses.hasNext()) {
      ParameterUse paruse = (ParameterUse) iterUses.next();
      Integer idLov = paruse.getIdLov();
      if (idLov != null) {
        IModalitiesValueDAO lovDAO = DAOFactory.getModalitiesValueDAO();
        ModalitiesValue lov = lovDAO.loadModalitiesValueByID(idLov);
        checkDataSource(lov);
        exporter.insertLov(lov, session);
      }
      exporter.insertParUse(paruse, session);
      List checks = paruse.getAssociatedChecks();
View Full Code Here

        //if modval is null, then the parameter always has a man_in modality
        //force the man_in modality to the parameter
        Integer man_in = hibParuse.getManualInput();
        //Integer sbiLovId = sbiLov.getLovId();
        if(man_in.intValue() == 1){
          ModalitiesValue manInModVal = new ModalitiesValue();
          manInModVal.setITypeCd("MAN_IN");
          manInModVal.setITypeId("37");
          parameter.setModalityValue(manInModVal);
         
        }else{
        ModalitiesValue modVal  = DAOFactory.getModalitiesValueDAO().loadModalitiesValueByID(hibParuse.getSbiLov().getLovId());
        modVal.setSelectionType(hibParuse.getSelectionType());
        modVal.setMultivalue(hibParuse.getMultivalue() != null && hibParuse.getMultivalue().intValue() > 0);
        parameter.setModalityValue(modVal);
        }
        ParameterUse aParameterUse = DAOFactory.getParameterUseDAO().loadByUseID(hibParuse.getUseId());
        parameter.setChecks(aParameterUse.getAssociatedChecks())
      } else {
View Full Code Here

    private String getValueFromLov(BIObjectParameter biObjectParameter, SourceBean lovSB) {
      String value = null;
      ILovDetail lovProvDet = null;
      try {
        Parameter par = biObjectParameter.getParameter();
        ModalitiesValue lov = par.getModalityValue();
        // build the ILovDetail object associated to the lov
        String lovProv = lov.getLovProvider();
        lovProvDet = LovDetailFactory.getLovFromXML(lovProv);
       
        value = (String) lovSB.getAttribute( lovProvDet.getValueColumnName() );
      } catch (Exception e) {
        throw new SpagoBIServiceException(SERVICE_NAME, "Impossible to get parameter's value", e);
View Full Code Here

        logger.error("The BIParameter with id = "
            + getLookedUpParameterId(request).toString()
            + " does not exist.");
        throw new EMFUserError(EMFErrorSeverity.ERROR, 1041);
      }
      ModalitiesValue modVal = lookupBIParameter.getParameter()
      .getModalityValue();

      String lookupType = (String) request.getAttribute("LOOKUP_TYPE");
      if (lookupType == null)
        lookupType = "LIST";

      if (lookupType.equalsIgnoreCase("CHECK_LIST")) {
        response.setAttribute("CHECKLIST", "true");
        response.setAttribute(SpagoBIConstants.PUBLISHER_NAME,
        "ChecklistLookupPublisher");
      } else if (lookupType.equalsIgnoreCase("LIST")) {
        response.setAttribute("LIST", "true");
        response.setAttribute(SpagoBIConstants.PUBLISHER_NAME,
        "LookupPublisher");
      } else {
        response.setAttribute("LIST", "true");
        response.setAttribute(SpagoBIConstants.PUBLISHER_NAME,
        "LookupPublisher");
      }

      response.setAttribute("mod_val_id", modVal.getId().toString());
      response.setAttribute("LOOKUP_PARAMETER_NAME", lookupBIParameter
          .getParameterUrlName());
      response.setAttribute("LOOKUP_PARAMETER_ID", lookupBIParameter
          .getId().toString());
      String correlatedParuseId = (String) request
View Full Code Here

      aBIObjectParameter = (BIObjectParameter) it.next();
      logger.debug("Parameter Label:"+aBIObjectParameter.getLabel());
      // check if the script return an unique value and preload it
      Parameter par = aBIObjectParameter.getParameter();
      if(par != null) {
        ModalitiesValue paruse = par.getModalityValue();
        if (!paruse.getITypeCd().equals("MAN_IN") && paruse.getSelectionType().equals("COMBOBOX")) {  // load values only if not a lookup           
          try {
            String lovProv = paruse.getLovProvider();
            ILovDetail lovProvDet = LovDetailFactory.getLovFromXML(lovProv);
            LovResultCacheManager executionCacheManager = new LovResultCacheManager();
            String lovResult = executionCacheManager.getLovResult(this.userProfile, aBIObjectParameter, this, true);

            LovResultHandler lovResultHandler = new LovResultHandler(lovResult);
View Full Code Here

      logger.debug("Parameter is outputType parameter, it is not validated");
      return new ArrayList();
    }

    // manual inputs are not validated
    ModalitiesValue lov = biparam.getParameter().getModalityValue();
    if (lov.getITypeCd().equals("MAN_IN")) {
      logger.debug("Modality in use for biparameter [" + biparamLabel + "] is manual input");
      return new ArrayList();
    }
   
    // get the lov provider detail
    String lovProv = lov.getLovProvider();
    ILovDetail lovProvDet = LovDetailFactory.getLovFromXML(lovProv);
    // get lov result
    String lovResult = null;
    List toReturn = null;
    if (lovProvDet instanceof QueryDetail) {
View Full Code Here

    logger.debug("OUT");
  }

  public ILovDetail getLovDetail(BIObjectParameter parameter) {
    Parameter par = parameter.getParameter();
    ModalitiesValue lov = par.getModalityValue();
    // build the ILovDetail object associated to the lov
    String lovProv = lov.getLovProvider();
    ILovDetail lovProvDet = null;
    try {
      lovProvDet = LovDetailFactory.getLovFromXML(lovProv);
    } catch (Exception e) {
      throw new SpagoBIRuntimeException("Impossible to get lov detail associated to input BIObjectParameter", e);
View Full Code Here

    while (iterParams.hasNext()) {
      // if the param is a Fixed Lov, Make the profile attribute
      // substitution at runtime
      BIObjectParameter biparam = (BIObjectParameter) iterParams.next();
      Parameter param = biparam.getParameter();
      ModalitiesValue modVal = param.getModalityValue();
      if (modVal.getITypeCd().equals(SpagoBIConstants.INPUT_TYPE_FIX_LOV_CODE)) {
        String value = modVal.getLovProvider();
        int profileAttributeStartIndex = value.indexOf("${");
        if (profileAttributeStartIndex != -1) {
          IEngUserProfile profile = (IEngUserProfile) session.getPermanentContainer().getAttribute(
              IEngUserProfile.ENG_USER_PROFILE);
          value = StringUtilities.substituteProfileAttributesInString(value, profile,
View Full Code Here

TOP

Related Classes of it.eng.spagobi.behaviouralmodel.lov.bo.ModalitiesValue

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.