Package it.eng.spagobi.tools.distributionlist.dao

Examples of it.eng.spagobi.tools.distributionlist.dao.IDistributionListDAO


      //load the user
      Email user = new Email();
      user.setEmail(email);
      user.setUserId(userId);
      //subscribe to the dl
      IDistributionListDAO dao=DAOFactory.getDistributionListDAO();
      dao.setUserProfile(profile);
      dao.subscribeToDistributionList(dl,user);
    }
    catch (EMFUserError e){
        logger.error("Cannot fill response container" + e.getLocalizedMessage());
        HashMap params = new HashMap();     
        params.put(AdmintoolsConstants.PAGE, ListDistributionListUserModule.MODULE_PAGE);
View Full Code Here


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

      IDistributionListDAO dao=DAOFactory.getDistributionListDAO();
      dao.setUserProfile(profile);
      DistributionList dlNew = recoverDistributionListDetails(serviceRequest);
     
      EMFErrorHandler errorHandler = getErrorHandler();
      
      // if there are some validation errors into the errorHandler it 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) {
            serviceResponse.setAttribute("dlObj", dlNew);
            serviceResponse.setAttribute("modality", mod);
            return;
          }
        }
      }
     
      if (mod.equalsIgnoreCase(SpagoBIConstants.DETAIL_INS)) {     
        //if a dl with the same name does not exist in the db ok, else error
        if (dao.loadDistributionListByName(dlNew.getName()) != null){
          HashMap params = new HashMap();
          params.put(AdmintoolsConstants.PAGE, ListDistributionListModule.MODULE_PAGE);
          EMFUserError error = new EMFUserError(EMFErrorSeverity.ERROR, 9100, new Vector(), params );
          getErrorHandler().addError(error);
          return;
        }      
        
        dao.insertDistributionList(dlNew);
       
        //gets the new setted Id from the DL just inserted and puts it into dlNew
        DistributionList tmpDL = dao.loadDistributionListByName(dlNew.getName());
        dlNew.setId(tmpDL.getId());
        mod = SpagoBIConstants.DETAIL_MOD;
      } else {       
        //updates dl
        dao.modifyDistributionList(dlNew);     
     
      IDomainDAO domaindao = DAOFactory.getDomainDAO();
      List dialects = domaindao.loadListDomainsByType("DIALECT_HIB");
      serviceResponse.setAttribute(NAME_ATTR_LIST_DIALECTS, dialects);
     
View Full Code Here

          Iterator iter = l.iterator();
          while (iter.hasNext()){
           
            Integer dlId = (Integer)iter.next();
            try {if(!runImmediately){
              IDistributionListDAO dao=DAOFactory.getDistributionListDAO();
              dao.setUserProfile(profile);
              DistributionList dl = dao.loadDistributionListById(dlId);
              dao.insertDLforDocument(dl, objId, xml);
            }
            } catch (Exception ex) {
              logger.error("Cannot fill response container" + ex.getLocalizedMessage())
              throw new EMFUserError(EMFErrorSeverity.ERROR, 100);     
            }
View Full Code Here

TOP

Related Classes of it.eng.spagobi.tools.distributionlist.dao.IDistributionListDAO

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.