Package it.eng.spagobi.commons.dao

Examples of it.eng.spagobi.commons.dao.IDomainDAO


        ((String)request.getAttribute("SUBMESSAGEDET")).equalsIgnoreCase(MOD_SAVEBACK))
      {
        response.setAttribute("loopback", "true");
        return;
      }
      IDomainDAO domaindao = DAOFactory.getDomainDAO();
      List dataTypes = domaindao.loadListDomainsByType("OBJMETA_DATA_TYPE");
      response.setAttribute(OBJMETA_DATA_TYPE, dataTypes);
      response.setAttribute("modality", modalita);
      response.setAttribute("metaObj", meta);
    } catch (Exception ex) {
      logger.error("Cannot fill response container" + ex.getLocalizedMessage())
View Full Code Here


        mod = SpagoBIConstants.DETAIL_MOD;
      } else {       
        //update metadata
        dao.modifyObjMetadata(metaNew);     
     
      IDomainDAO domaindao = DAOFactory.getDomainDAO();
      List dataTypes = domaindao.loadListDomainsByType("OBJMETA_DATA_TYPE");
      serviceResponse.setAttribute(OBJMETA_DATA_TYPE, dataTypes);
     
      if (serviceRequest.getAttribute("SUBMESSAGEDET") != null &&
        ((String)serviceRequest.getAttribute("SUBMESSAGEDET")).equalsIgnoreCase(MOD_SAVE)) { 
        serviceResponse.setAttribute("modality", mod);
View Full Code Here

      meta.setDataType(new Integer("-1"));
      meta.setName("");
      meta.setCreationDate(null);
      response.setAttribute("metaObj", meta);
     
      IDomainDAO domaindao = DAOFactory.getDomainDAO();
      List dataTypes = domaindao.loadListDomainsByType("OBJMETA_DATA_TYPE");
      response.setAttribute(OBJMETA_DATA_TYPE, dataTypes);
     
    } catch (Exception ex) {
      logger.error("Cannot prepare page for the insertion" , ex);   
      throw new EMFUserError(EMFErrorSeverity.ERROR, 100);
View Full Code Here

//      sbds.setHibDialectClass(dialectHB.getValueDescription());
      sbds.setHibDialectClass(dialectHB.getValueCd());
      logger.info("read DS: Label="+sbds.getLabel()+" Jndi="+sbds.getJndiName()+" HIB="+sbds.getHibDialectClass());
     
      //gets dialect informations
      IDomainDAO domaindao = DAOFactory.getDomainDAO();
      Domain doDialect = domaindao.loadDomainById(ds.getDialectId());
      sbds.setHibDialectClass(doDialect.getValueCd());
      sbds.setHibDialectName(doDialect.getValueName());
      sbds.setMultiSchema(ds.getMultiSchema());
      sbds.setSchemaAttribute(ds.getSchemaAttribute());
View Full Code Here

      sbds.setDriver(ds.getDriver());
      sbds.setMultiSchema(ds.getMultiSchema());
      sbds.setSchemaAttribute(ds.getSchemaAttribute());
     
    //gets dialect informations
      IDomainDAO domaindao = DAOFactory.getDomainDAO();
      Domain doDialect = domaindao.loadDomainById(ds.getDialectId());
      sbds.setHibDialectClass(doDialect.getValueCd());
      sbds.setHibDialectName(doDialect.getValueName());
     
  } catch (Exception e) {
      logger.error("The data source is not correctly returned", e);
View Full Code Here

 
  @Override
  public void doService() {
    logger.debug("IN");
    IUdpDAO udpDao=null;
    IDomainDAO daoDomain=null;
    try {
      udpDao = DAOFactory.getUdpDAO();
      udpDao.setUserProfile(getUserProfile());
      daoDomain=DAOFactory.getDomainDAO();
      udpDao.setUserProfile(getUserProfile());
    } catch (EMFUserError e1) {
      logger.error(e1.getMessage(), e1);
      throw new SpagoBIServiceException(SERVICE_NAME,  "Error occurred");
    }
    HttpServletRequest httpRequest = getHttpRequest();
    MessageBuilder m = new MessageBuilder();
    Locale locale = m.getLocale(httpRequest);
   
    String serviceType = this.getAttributeAsString(MESSAGE_DET)
    logger.debug("Service type "+serviceType);
   
    if(serviceType != null && serviceType.equals(UDP_LIST)){
      try {
        Integer start = getAttributeAsInteger( START );
        Integer limit = getAttributeAsInteger( LIMIT );
       
        if(start==null){
          start = START_DEFAULT;
        }
        if(limit==null){
          limit = LIMIT_DEFAULT;
        }

        Integer totalNum = udpDao.countUdp();
       
        List<SbiUdp> udpList = udpDao.loadPagedUdpList(start,limit);
        logger.debug("Loaded udp list");
        JSONArray udpJSON = (JSONArray) SerializerFactory.getSerializer("application/json").serialize(udpList,locale);
        JSONObject udpResponseJSON = createJSONResponseUdp(udpJSON, totalNum);

        writeBackToClient(new JSONSuccess(udpResponseJSON));

      } catch (Throwable e) {
        logger.error(e.getMessage(), e);
        try {
          writeBackToClient("Exception occurred while retrieving user defined properties");
        } catch (IOException e1) {
          logger.error(e1.getMessage(), e1);
        }
        throw new SpagoBIServiceException(SERVICE_NAME,
            "Exception occurred while retrieving user defined properties", e);
      }
     
    }else if(serviceType != null && serviceType.equals(UDP_DETAIL)){
      try {
        String name = getAttributeAsString(NAME);
        String label = getAttributeAsString(LABEL);
        String description = getAttributeAsString(DESCRIPTION);
        String typeStr = getAttributeAsString(TYPE);     
        Domain tmpDomain = daoDomain.loadDomainByCodeAndValue(UDP_TYPES, typeStr);
        Integer type = tmpDomain.getValueId();
        String familyStr = getAttributeAsString(FAMILY);
        tmpDomain = daoDomain.loadDomainByCodeAndValue(UDP_FAMILIES, familyStr);
        Integer family = tmpDomain.getValueId();
        Boolean isMultivalue = Boolean.valueOf(getAttributeAsBoolean(IS_MULTIVALUE));
       
        String id = getAttributeAsString(ID);
       
        SbiUdp udp = new SbiUdp();
        udp.setName(name);
        udp.setLabel(label);
        udp.setDescription(description);
        udp.setTypeId(type);
        udp.setFamilyId(family);
        udp.setIsMultivalue(isMultivalue);
     
        if(id != null && !id.equals("") && !id.equals("0")){             
          udp.setUdpId(Integer.valueOf(id));
          udpDao.update(udp);
          logger.debug("User attribute "+id+" updated");
          JSONObject attributesResponseSuccessJSON = new JSONObject()
          attributesResponseSuccessJSON.put("success", true)
          attributesResponseSuccessJSON.put("responseText", "Operation succeded");
          writeBackToClient( new JSONSuccess(attributesResponseSuccessJSON) );
        }else{
          Integer udpID = udpDao.insert(udp);
          logger.debug("New User Attribute inserted");
          JSONObject attributesResponseSuccessJSON = new JSONObject();
          attributesResponseSuccessJSON.put("success", true);
          attributesResponseSuccessJSON.put("responseText", "Operation succeded");
          attributesResponseSuccessJSON.put("id", udpID);
          writeBackToClient( new JSONSuccess(attributesResponseSuccessJSON) );
        }
      } catch (JSONException e) {
        logger.error(e.getMessage(), e);
        throw new SpagoBIServiceException(SERVICE_NAME,
            "Exception occurred while saving new user attribute",
            e);
      } catch (IOException e) {
        logger.error(e.getMessage(), e);
        throw new SpagoBIServiceException(SERVICE_NAME,
            "Exception occurred while saving new user attribute",
            e);
      } catch (Exception e){
        logger.error(e.getMessage(), e);
        throw new SpagoBIServiceException(SERVICE_NAME,
            "Exception occurred while saving new user attribute",
            e);
      }
     
    } else if (serviceType != null  && serviceType.equalsIgnoreCase(UDP_DELETE)) {
      Integer id = getAttributeAsInteger(ID);
      try {
        udpDao.delete(id);
        logger.debug("User Attribute deleted");
        writeBackToClient( new JSONAcknowledge("Operation succeded") );

      } catch (Throwable e) {
        logger.error("Exception occurred while deleting role", e);
        throw new SpagoBIServiceException(SERVICE_NAME,
            "Exception occurred while deleting user attribute",
            e);
      }
    }else if(serviceType == null){
      try {
        List types = daoDomain.loadListDomainsByType(UDP_TYPES);
        getSessionContainer().setAttribute("TYPE_LIST", types);
        List families = daoDomain.loadListDomainsByType(UDP_FAMILIES);
        getSessionContainer().setAttribute("FAMILY_LIST", families);
       
      } catch (EMFUserError e) {
        logger.error(e.getMessage(), e);
        throw new SpagoBIServiceException(SERVICE_NAME,
View Full Code Here

      SQLCommand cmd = null;
    DataResult dr = null;
    DataConnection dataConnection = null;
    Integer returnValue = null;
    try {
      IDomainDAO domdao = DAOFactory.getDomainDAO();
      Domain dom = domdao.loadDomainByCodeAndValue(domainCode, valueCode);
      returnValue = dom.getValueId();
    catch (Exception ex) {
      SpagoBITracer.major(SpagoBIConstants.NAME_MODULE,this.getClass().toString(),
      "findSBIDomainValueID", " An exception has occurred ", ex);
    } finally {
View Full Code Here

    toReturn.setReferenceId(sbiUdpValue.getReferenceId());
    toReturn.setLabel(sbiUdpValue.getSbiUdp().getLabel()); //denormilized
    toReturn.setName(sbiUdpValue.getSbiUdp().getName())//denormilized   

    try{
      IDomainDAO aDomainDAO = DAOFactory.getDomainDAO();
      Domain familyDomain = aDomainDAO.loadDomainById(sbiUdpValue.getSbiUdp().getFamilyId());
      toReturn.setFamily(familyDomain.getValueCd()); //denormilized
    } catch (Exception he) {
      logger.error(he);
    }

    Integer typeId = sbiUdpValue.getSbiUdp().getTypeId();
    if(typeId != null){
      try{
        IDomainDAO aDomainDAO = DAOFactory.getDomainDAO();
        Domain typeDomain = aDomainDAO.loadDomainById(typeId);
        toReturn.setTypeLabel(typeDomain.getValueCd()); //denormilized
      } catch (Exception he) {
        logger.error(he);
      }
    }
View Full Code Here

   */  
  private void getDistributionList(SourceBean request, SourceBean response) throws EMFUserError {   
    try {                      
      DistributionList dl = DAOFactory.getDistributionListDAO().loadDistributionListById(new Integer((String)request.getAttribute("DL_ID")));   
      this.modalita = SpagoBIConstants.DETAIL_SELECT;
      IDomainDAO domaindao = DAOFactory.getDomainDAO();
      List dialects = domaindao.loadListDomainsByType("DIALECT_HIB");
      response.setAttribute(NAME_ATTR_LIST_DIALECTS, dialects);
      response.setAttribute("modality", modalita);
      response.setAttribute("dlObj", dl);
    } catch (Exception ex) {
      logger.error("Cannot fill response container" + ex.getLocalizedMessage())
View Full Code Here

    sbds.setUrl(ds.getUrlConnection());
    sbds.setUser(ds.getUser());
    sbds.setPassword(ds.getPwd());
    sbds.setDriver(ds.getDriver());
    //gets dialect informations
      IDomainDAO domaindao = DAOFactory.getDomainDAO();
      Domain doDialect = domaindao.loadDomainById(ds.getDialectId());
      sbds.setHibDialectClass(doDialect.getValueCd());
      sbds.setHibDialectName(doDialect.getValueName());
      sbds.setMultiSchema(ds.getMultiSchema());
      sbds.setSchemaAttribute(ds.getSchemaAttribute());
     
View Full Code Here

TOP

Related Classes of it.eng.spagobi.commons.dao.IDomainDAO

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.