Examples of DistributionList


Examples of it.eng.spagobi.tools.distributionlist.bo.DistributionList

   */
  public DistributionList loadDistributionListById(Integer Id)
      throws EMFUserError {

    logger.debug("IN");
    DistributionList toReturn = null;
    Session aSession = null;
    Transaction tx = null;

    try {
      aSession = getSession();
View Full Code Here

Examples of it.eng.spagobi.tools.distributionlist.bo.DistributionList

  /* (non-Javadoc)
   * @see it.eng.spagobi.tools.distributionlist.dao.IDistributionListDAO#loadDistributionListByName(java.lang.String)
   */
  public DistributionList loadDistributionListByName(String name) throws EMFUserError {
    logger.debug("IN");
    DistributionList biDL = null;
    Session tmpSession = null;
    Transaction tx = null;
    try {
      tmpSession = getSession();
      tx = tmpSession.beginTransaction();
View Full Code Here

Examples of it.eng.spagobi.tools.distributionlist.bo.DistributionList

   * @param hibDistributionList the hib distribution list
   *
   * @return the distribution list
   */
  public DistributionList toDistributionList(SbiDistributionList hibDistributionList){
    DistributionList dl = new DistributionList();
   
    dl.setId((hibDistributionList.getDlId()).intValue());
    dl.setName(hibDistributionList.getName());
    dl.setDescr(hibDistributionList.getDescr())
   
    //Gets all userids and respective emails and puts them into a list of Emails
    List emails = new ArrayList();
    Set s = hibDistributionList.getSbiDistributionListUsers();
    Iterator i = s.iterator();
    while(i.hasNext()){
      SbiDistributionListUser dls =(SbiDistributionListUser) i.next();
      String userId = dls.getUserId();
      String e_mail = dls.getEMail();
      Email email = new Email();
      email.setUserId(userId);
      email.setEmail(e_mail);
      emails.add(email);     
    }

    dl.setEmails(emails);
   
    //Gets all documents related to the distribution list and puts them into a list of documents
    List documents = new ArrayList();
    Set d = hibDistributionList.getSbiDistributionListsObjectses();
    Iterator it = d.iterator();
    while(it.hasNext()){
      SbiDistributionListsObjects dlo =(SbiDistributionListsObjects) it.next();
      SbiObjects so = dlo.getSbiObjects();
      BIObjectDAOHibImpl objDAO=null;
      try {
        objDAO = (BIObjectDAOHibImpl)DAOFactory.getBIObjectDAO();
        BIObject obj = objDAO.toBIObject(so);
        documents.add(obj);
      } catch (EMFUserError e) {

      }

     
    }

    dl.setDocuments(documents);
 
    return dl;
  }
View Full Code Here

Examples of it.eng.spagobi.tools.distributionlist.bo.DistributionList

   * @throws EMFUserError If an exception occurs
   */  
  private void getDistributionList(SourceBean request, SourceBean response) throws EMFUserError
    logger.debug("IN");
    try {                      
      DistributionList dl = DAOFactory.getDistributionListDAO().loadDistributionListById(new Integer((String)request.getAttribute("DL_ID")));   
      this.modalita = SpagoBIConstants.DETAIL_MOD;
      if (request.getAttribute("SUBMESSAGEDET") != null &&
        ((String)request.getAttribute("SUBMESSAGEDET")).equalsIgnoreCase(MOD_SAVEBACK))
      {
        response.setAttribute("loopback", "true");
View Full Code Here

Examples of it.eng.spagobi.tools.distributionlist.bo.DistributionList

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

Examples of it.eng.spagobi.tools.distributionlist.bo.DistributionList

    logger.debug("IN");
    try {
      String id = (String) request.getAttribute("DL_ID");
     
      //deletes the dl
      DistributionList dl = DAOFactory.getDistributionListDAO().loadDistributionListById(new Integer(id));
      DAOFactory.getDistributionListDAO().eraseDistributionList(dl);
    }
    catch (EMFUserError e){
        logger.error("Cannot fill response container" + e.getLocalizedMessage());
        HashMap params = new HashMap();     
View Full Code Here

Examples of it.eng.spagobi.tools.distributionlist.bo.DistributionList

  private void newDistributionList(SourceBean response) throws EMFUserError {
    logger.debug("IN");
    try {
     
      DistributionList dl = null;
      this.modalita = SpagoBIConstants.DETAIL_INS;
      response.setAttribute("modality", modalita);
      dl = new DistributionList();
      dl.setId(-1);
      dl.setDescr("");
      dl.setName("");
      response.setAttribute("dlObj", dl);
      IDomainDAO domaindao = DAOFactory.getDomainDAO();
      List dialects = domaindao.loadListDomainsByType("DIALECT_HIB");
      response.setAttribute(NAME_ATTR_LIST_DIALECTS, dialects);
    } catch (Exception ex) {
View Full Code Here

Examples of it.eng.spagobi.tools.distributionlist.bo.DistributionList

  }


  private DistributionList recoverDistributionListDetails (SourceBean serviceRequest) throws EMFUserError, SourceBeanException, IOException  {
    logger.debug("IN");
    DistributionList dl  = new DistributionList();
   
    String id = (String)serviceRequest.getAttribute("id");
    String name = (String)serviceRequest.getAttribute("NAME");
    String description = (String)serviceRequest.getAttribute("DESCR")
   
    dl.setId((new Integer(id)).intValue());
    dl.setName(name);
    dl.setDescr(description);
    logger.debug("OUT");   
    return dl;
  }
View Full Code Here

Examples of it.eng.spagobi.tools.distributionlist.bo.DistributionList

           
            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

Examples of it.eng.spagobi.tools.distributionlist.bo.DistributionList

                String triggername = jobExecutionContext.getTrigger().getName();
                List dlIds = saveInfo.getDlIds();
                it = dlIds.iterator();
                while(it.hasNext()){
                  Integer dlId = (Integer)it.next();
                  DistributionList dl = DAOFactory.getDistributionListDAO().loadDistributionListById(dlId);
                  DAOFactory.getDistributionListDAO().eraseDistributionListObjects(dl, (biobj.getId()).intValue(), triggername);
                }
              }
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.