Package it.eng.spagobi.analiticalmodel.document.dao

Examples of it.eng.spagobi.analiticalmodel.document.dao.IBIObjectDAO


    /**
     * Add subreport informations
     */
    private Map addBISubreports(BIObject reportBObject, Map pars) {
    ISubreportDAO subreportDAO;
    IBIObjectDAO bobjectDAO;
    IObjTemplateDAO templateDAO;
   
    List<Subreport> subreports;
    Subreport subreport;
    BIObject subreportBObject; 
    ObjTemplate subreportTemplate;
   
    String prefixName;
    String tempName;
    String flgTemplateStandard;
    Integer id;
   
    try {
     
           
      subreportDAO = DAOFactory.getSubreportDAO();
        bobjectDAO = DAOFactory.getBIObjectDAO();
        templateDAO = DAOFactory.getObjTemplateDAO();
 
        subreports = subreportDAO.loadSubreportsByMasterRptId( reportBObject.getId() );
        for (int i = 0; i < subreports.size(); i++) {
          subreport = subreports.get(i);
        subreportBObject = bobjectDAO.loadBIObjectForDetail(subreport.getSub_rpt_id());
        subreportTemplate = templateDAO.getBIObjectActiveTemplate(subreportBObject.getId());
       
        prefixName = subreportBObject.getId()  + "_" + subreportTemplate.getBinId();
        pars.put("sr." + (i + 1) + ".ids", prefixName);
        logger.debug("ids: " + prefixName);
View Full Code Here


      // get document container information
      DocumentContainer documentContainer=documentsMap.get(label);

      // Recover BIObject     
      IBIObjectDAO dao=DAOFactory.getBIObjectDAO();
      BIObject objectID=dao.loadBIObjectByLabel(label);
      BIObject object=null;

      // get roles
      Collection roles = null;
      roles = ((UserProfile)profile).getRolesForUse();


      for (Iterator iterator2 = roles.iterator(); iterator2.hasNext();) {
        Object role = (Object) iterator2.next();
        try{
          object=dao.loadBIObjectForExecutionByIdAndRole(objectID.getId(), role.toString());
        }
        catch (Exception e) {
          logger.error("error in recovering the role");
        }
        if(object!=null) break;
View Full Code Here

      jobInfo.setJobDescription(jobDescriptionRecovered);
      jobInfo.setJobGroupName(jobGroupNameRecovered);
      // set all documents and parameters
      SourceBean jobParSB = (SourceBean)jobDetSB.getAttribute("JOB_PARAMETERS");
      if(jobParSB!=null) {
        IBIObjectDAO biobjdao = DAOFactory.getBIObjectDAO();
        IBIObjectParameterDAO biobjpardao = DAOFactory.getBIObjectParameterDAO();
        SourceBean docLblSB = (SourceBean)jobParSB.getFilteredSourceBeanAttribute("JOB_PARAMETER", "name", "documentLabels");
        String docLblStr = (String)docLblSB.getAttribute("value");
        String[] docLbls = docLblStr.split(",");
        for(int i=0; i<docLbls.length; i++) {
          //BIObject biobj = biobjdao.loadBIObjectByLabel(docLbls[i]);
          BIObject biobj = biobjdao.loadBIObjectByLabel(docLbls[i].substring(0, docLbls[i].indexOf("__")));
          List biobjpars = biobjpardao.loadBIObjectParametersById(biobj.getId());
          biobj.setBiObjectParameters(biobjpars);
          String biobjlbl = biobj.getLabel() + "__" + (i+1);
          SourceBean queryStringSB = (SourceBean)jobParSB.getFilteredSourceBeanAttribute("JOB_PARAMETER", "name", biobjlbl);
          SourceBean iterativeSB = (SourceBean)jobParSB.getFilteredSourceBeanAttribute("JOB_PARAMETER", "name", biobjlbl + "_iterative");
View Full Code Here

    String documentLabel;
   
    // par1=val1&par2=val2... for parameters already set in scheduled activity's configuration
    String inputParametersQueryString;
   
    IBIObjectDAO biobjdao;
    BIObject biobj;
    ExecutionController executionController;
    ExecutionProxy executionProxy;
    EventsManager eventManager;
   
    logger.debug("IN");
   
    try {
      profile = UserProfile.createSchedulerUserProfile();
      jobDataMap = jobExecutionContext.getMergedJobDataMap();
      biobjdao = DAOFactory.getBIObjectDAO();
     
      String doclabelsConcat = jobDataMap.getString("documentLabels");
      String[] docLabels = doclabelsConcat.split(",");
      Iterator itr = jobDataMap.keySet().iterator();
      while(itr.hasNext()) {
        Object key = itr.next();
        Object value = jobDataMap.get(key);
        logger.debug("jobDataMap parameter [" + key + "] is equal to [" + value + "]");
      }
     
      long startSchedule = System.currentTimeMillis();
      logger.debug("Scheduled activity contains [" + docLabels.length + "] documnt(s)");

      for(int ind = 0; ind < docLabels.length; ind++) {
        documentInstanceName = docLabels[ind];
        documentLabel = documentInstanceName.substring(0, documentInstanceName.lastIndexOf("__"));
        logger.debug("Processing document [" + (ind+1) + "] with label [" + documentLabel + "] ...");
       
        inputParametersQueryString = jobDataMap.getString(documentInstanceName);
        logger.debug("Input parameters query string for documet [" + documentLabel + "] is equal to [" + inputParametersQueryString + "]");
       
        // load bidocument
        biobj = biobjdao.loadBIObjectByLabel(documentLabel);
       
        // get the save options
        String saveOptString = jobDataMap.getString("biobject_id_" + biobj.getId() + "__"+ (ind+1));
        SaveInfo saveInfo = SchedulerUtilities.fromSaveInfoString(saveOptString);
       
View Full Code Here

      newbiobj.setBiObjectTypeID(officeDocDom.getValueId());
      newbiobj.setStateCode(relDom.getValueCd());
      newbiobj.setStateID(relDom.getValueId());
      newbiobj.setVisible(new Integer(1));
      newbiobj.setFunctionalities(storeInFunctionalities);
      IBIObjectDAO objectDAO = DAOFactory.getBIObjectDAO();
       Timestamp aoModRecDate;
      BIObject biobjexist = objectDAO.loadBIObjectByLabel(label);
      if(biobjexist==null){
        objectDAO.insertBIObject(newbiobj, objTemp);
      } else {
        newbiobj.setId(biobjexist.getId());
        objectDAO.modifyBIObject(newbiobj, objTemp);
      }
    } catch (Throwable t) {
      logger.error("Error while saving schedule result as new document", t );
    }finally{
      logger.debug("OUT");
View Full Code Here

      response.setAttribute("operation-result", result);
    } else {
      // it's an end process event, nothing more to do
    }
   
    IBIObjectDAO biObjectDAO = DAOFactory.getBIObjectDAO();
    String biobjectIdStr = (String) eventParams.get("biobjectId");
    Integer biObjectId = new Integer(biobjectIdStr);
    BIObject biObject = biObjectDAO.loadBIObjectById(biObjectId);

    response.setAttribute("biobject", biObject);
    SubreportDAOHibImpl subreportDAOHibImpl = new SubreportDAOHibImpl();
    List list = subreportDAOHibImpl.loadSubreportsByMasterRptId(biObject.getId());
    List biObjectList = new ArrayList();
    for(int i = 0; i < list.size(); i++) {
      Subreport subreport = (Subreport)list.get(i);
      BIObject biobj = biObjectDAO.loadBIObjectForDetail(subreport.getSub_rpt_id());
      biObjectList.add(biobj);
    }
    response.setAttribute("linkedBIObjects", biObjectList);
    response.setAttribute("PUBLISHER_NAME", "TalendExecutionEventLogDetailPublisher");
  }
View Full Code Here

      String result = (String) eventParams.get("operation-result");
      response.setAttribute("operation-result", result);
    } else {
      // it's an end process event, nothing more to do
    }
    IBIObjectDAO biObjectDAO = DAOFactory.getBIObjectDAO();
    String biobjectIdStr = (String) eventParams.get("biobjectId");
    Integer biObjectId = new Integer(biobjectIdStr);
    BIObject biObject = biObjectDAO.loadBIObjectById(biObjectId);

    response.setAttribute("biobject", biObject);
    SubreportDAOHibImpl subreportDAOHibImpl = new SubreportDAOHibImpl();
    List list = subreportDAOHibImpl.loadSubreportsByMasterRptId(biObject.getId());
    List biObjectList = new ArrayList();
    for(int i = 0; i < list.size(); i++) {
      Subreport subreport = (Subreport)list.get(i);
      BIObject biobj = biObjectDAO.loadBIObjectForDetail(subreport.getSub_rpt_id());
      biObjectList.add(biobj);
    }
    response.setAttribute("linkedBIObjects", biObjectList);
    response.setAttribute("PUBLISHER_NAME", "CommonjExecutionEventLogDetailPublisher");
  }
View Full Code Here

    }
   
  }
 
  protected BIObject getDocument(String documentId) throws EMFUserError {
    IBIObjectDAO biObjectDAO;
    Integer biObjectId;
    BIObject biObject;
   
    biObject = null;
    try {
      Assert.assertNotNull(documentId, "Parameter [documentId] cannot be null");
     
     
      biObjectDAO = DAOFactory.getBIObjectDAO();
      biObjectId = new Integer(documentId);
      biObject = biObjectDAO.loadBIObjectById(biObjectId);
    } catch(Throwable t) {
      logger.error("Impossible to load document with id equals to [" + documentId + "]", t);
      if(t instanceof EMFUserError) throw (EMFUserError)t;         
    }
   
View Full Code Here

   
    return biObject;
  }
 
  protected List<BIObject> getLinkedObject(BIObject document) throws EMFUserError {
    IBIObjectDAO biObjectDAO;
    SubreportDAOHibImpl subreportDAOHibImpl;
    List list;
    List biObjectList;
   
    biObjectList = new ArrayList();
   
    try {
      Assert.assertNotNull(document, "Parameter [document] cannot be null");
     
      biObjectDAO = DAOFactory.getBIObjectDAO();
     
      subreportDAOHibImpl = new SubreportDAOHibImpl();
      list = subreportDAOHibImpl.loadSubreportsByMasterRptId(document.getId());
     
      for(int i = 0; i < list.size(); i++) {
        Subreport subreport = (Subreport)list.get(i);
        BIObject biobj = biObjectDAO.loadBIObjectForDetail(subreport.getSub_rpt_id());
        biObjectList.add(biobj);
      }
    } catch(Throwable t) {
      logger.error("Impossible to load linked documents", t);
      if(t instanceof EMFUserError) throw (EMFUserError)t;     
View Full Code Here

    }
   
    private String saveObjectTemplate(String user,String documentiId,String templateName,String content){
  logger.debug("IN");
  try {
      IBIObjectDAO objdao = DAOFactory.getBIObjectDAO();
      objdao.setUserID(user);
      Integer docId = new Integer(documentiId);
      BIObject biobj = objdao.loadBIObjectById(docId);
      ObjTemplate objTemp = new ObjTemplate();
      objTemp.setBiobjId(biobj.getId());
      objTemp.setActive(new Boolean(true));
      objTemp.setContent(content.getBytes());
      objTemp.setName(templateName);
      objdao.modifyBIObject(biobj, objTemp);
  } catch (NumberFormatException e) {
      logger.error("NumberFormatException",e);
      return "KO";
  } catch (EMFUserError e) {
      logger.error("EMFUserError",e);
View Full Code Here

TOP

Related Classes of it.eng.spagobi.analiticalmodel.document.dao.IBIObjectDAO

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.