Package it.eng.spagobi.commons.bo

Examples of it.eng.spagobi.commons.bo.Domain


  int t = -1;
  try {
      List biobjTypes = DAOFactory.getDomainDAO().loadListDomainsByType("BIOBJ_TYPE");
      for (int i = 0; i < biobjTypes.size(); i++) {
    Domain domain = (Domain) biobjTypes.get(i);
    if (domain.getValueCd().equals(type))
        t = domain.getValueId().intValue();
      }
  } catch (EMFUserError e2) {
      logger.error("Error while retive object type", e2);
  }

  Integer typeIdInt = new Integer(t);

  Engine engine = null;
  List engines = null;
  try {
      engines = DAOFactory.getEngineDAO().loadAllEngines();
  } catch (EMFUserError e) {
      logger.error("Error while retrive engine", e);
  }
  for (int i = 0; i < engines.size(); i++) {
      engine = (Engine) engines.get(i);
      if (engine.getBiobjTypeId().intValue() == typeIdInt.intValue())
    break;
  }

  obj.setName(name);
  obj.setDescription(description);

  obj.setEncrypt(encrypt);
  obj.setVisible(visible);

  obj.setEngine(engine);

  String template = (String) mapPar.get("TEMPLATE");
  //ObjTemplate objTemp = obj.getActiveTemplate();
  ObjTemplate objTemp = new ObjTemplate();
  objTemp.setName("etlTemplate.xml");
  objTemp.setContent(template.getBytes());

  Domain domain = null;
  try {
      DAOFactory.getBIObjectDAO().modifyBIObject(obj, objTemp);
      domain = DAOFactory.getDomainDAO().loadDomainById(engine.getBiobjTypeId());
  } catch (EMFUserError e1) {
      logger.error("Error while retrive doomain", e1);
  }
  obj.setBiObjectTypeCode(domain.getValueCd());

  obj.setBiObjectTypeID(typeIdInt);
 
  logger.debug("OUT");
  return obj;
View Full Code Here


  int t = -1;
  try {
      List biobjTypes = DAOFactory.getDomainDAO().loadListDomainsByType("BIOBJ_TYPE");
      for (int i = 0; i < biobjTypes.size(); i++) {
    Domain domain = (Domain) biobjTypes.get(i);
    if (domain.getValueCd().equals(type))
        t = domain.getValueId().intValue();
      }
  } catch (EMFUserError e2) {
      logger.error("Error while retrive object type from domain", e2);
  }

  Integer typeIdInt = new Integer(t);

  Engine engine = null;
  List engines = null;
  try {
      engines = DAOFactory.getEngineDAO().loadAllEngines();
  } catch (EMFUserError e) {
      logger.error("Error while retrive engines", e);
  }
  for (int i = 0; i < engines.size(); i++) {
      engine = (Engine) engines.get(i);
      if (engine.getBiobjTypeId().intValue() == typeIdInt.intValue())
    break;
  }
  logger.info(engine.getName());

  obj.setLabel(label);
  obj.setName(name);
  obj.setDescription(description);

  obj.setEncrypt(encrypt);
  obj.setVisible(visible);

  obj.setEngine(engine);
  obj.setCreationUser(user);

  String template = (String) mapPar.get("TEMPLATE");
  //ObjTemplate objTemp = obj.getActiveTemplate();
  ObjTemplate objTemp = new ObjTemplate();
  objTemp.setName("etlTemplate.xml");
  objTemp.setContent(template.getBytes());
 
  obj.setBiObjectTypeID(typeIdInt);
  obj.setBiObjectTypeCode(type);

  obj.setStateCode(state);
  Integer valueId = null;
  List l = (List)DAOFactory.getDomainDAO().loadListDomainsByType("STATE");
  if (!l.isEmpty()){
    Iterator it = l.iterator();
    while(it.hasNext()){
      Domain dtemp = (Domain)it.next();
      if (dtemp.getValueCd().equals(state)){
        valueId = dtemp.getValueId();
        break;
      }
    }
  }
  obj.setStateID(valueId);

  Domain domain = null;
  try {
      domain = DAOFactory.getDomainDAO().loadDomainById(engine.getBiobjTypeId());
  } catch (EMFUserError e1) {
      logger.error("Error while reading domain by type");
  }
  obj.setBiObjectTypeCode(domain.getValueCd())

  List functionalities = new ArrayList();
  try {
      functionalities = DAOFactory.getLowFunctionalityDAO().loadAllLowFunctionalities(false);
  } catch (EMFUserError e) {
View Full Code Here

            udpValue.setValue(value);
            udpValue.setReferenceId(kpiId);

            // get the UDP to get ID (otherwise could be taken in js page)
            Udp udp = DAOFactory.getUdpDAO().loadByLabelAndFamily(label, "KPI");
            Domain familyDomain = DAOFactory.getDomainDAO().loadDomainById(udp.getFamilyId());

            Integer idUdp = udp.getUdpId();

            udpValue.setLabel(udp.getLabel());
            udpValue.setName(udp.getName());
            udpValue.setFamily(familyDomain != null ? familyDomain.getValueCd() : null);
            udpValue.setUdpId(udp.getUdpId());

            udpValues.add(udpValue);
          }
View Full Code Here

      docName += toBeAppendedToName;
      String docDesc = sInfo.getDocumentDescription() + toBeAppendedToDescription;

      // recover office document sbidomains
      IDomainDAO domainDAO = DAOFactory.getDomainDAO();
      Domain officeDocDom = domainDAO.loadDomainByCodeAndValue("BIOBJ_TYPE", "OFFICE_DOC");
      // recover development sbidomains
      Domain relDom = domainDAO.loadDomainByCodeAndValue("STATE", "REL");
      // recover engine
      IEngineDAO engineDAO = DAOFactory.getEngineDAO();
      List engines = engineDAO.loadAllEnginesForBIObjectType(officeDocDom.getValueCd());
      if(engines.isEmpty()) {
        throw new Exception(" No suitable engines for the new document");
      }
      Engine engine = (Engine)engines.get(0);   
      // load the template
      ObjTemplate objTemp = new ObjTemplate();
      objTemp.setActive(new Boolean(true));
      objTemp.setContent(response);
      objTemp.setName(docName + fileExt);
      // load all functionality
      /*orig
      List storeInFunctionalities = new ArrayList();
      String functIdsConcat = sInfo.getFunctionalityIds();
      String[] functIds =  functIdsConcat.split(",");
      for(int i=0; i<functIds.length; i++) {
        String functIdStr = functIds[i];
        if(functIdStr.trim().equals(""))
          continue;
        Integer functId = Integer.valueOf(functIdStr);
        storeInFunctionalities.add(functId);
      }*/
      List storeInFunctionalities = findFolders(sInfo, biobj, dataStore);
      if(storeInFunctionalities.isEmpty()) {
        throw new Exception(" No functionality specified where store the new document");
      }
      // create biobject

      String jobName = jex.getJobDetail().getName();
      String completeLabel = "scheduler_" + jobName + "_" + docName;
      String label = "sched_" + String.valueOf(Math.abs(completeLabel.hashCode()));

      BIObject newbiobj = new BIObject();
      newbiobj.setDescription(docDesc);
      newbiobj.setCreationUser("scheduler");
      newbiobj.setLabel(label);
      newbiobj.setName(docName);
      newbiobj.setEncrypt(new Integer(0));
      newbiobj.setEngine(engine);
      newbiobj.setDataSourceId(biobj.getDataSourceId());
      newbiobj.setRelName("");
      newbiobj.setBiObjectTypeCode(officeDocDom.getValueCd());
      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);
View Full Code Here

    Integer thresholdId = null;
    if (sThresholdId != null && !(sThresholdId.trim().equals(""))) {
      thresholdId = Integer.parseInt(sThresholdId);
      try {
        Threshold threshold = DAOFactory.getThresholdDAO().loadThresholdById(thresholdId);
        Domain threshodlType = DAOFactory.getDomainDAO().loadDomainById(threshold.getThresholdTypeId());
        sThresholdType = threshodlType.getValueCd();
      } catch (EMFUserError e) {
      }
     
    }
View Full Code Here

    try {
      //**********************************************************************
     
      String engineTypeIdStr = (String) request.getAttribute("engineTypeId");
      Integer engineTypeId = new Integer(engineTypeIdStr);
      Domain engineType = DAOFactory.getDomainDAO().loadDomainById(engineTypeId);           

      if ("EXT".equalsIgnoreCase(engineType.getValueCd())) ValidationCoordinator.validate("PAGE", "ExternalEngineDetailPage", this);
      else ValidationCoordinator.validate("PAGE", "InternalEngineDetailPage", this);
     
      Engine engine = recoverEngineDetails(request);
      EMFErrorHandler errorHandler = getErrorHandler();
     
View Full Code Here

    String label = (String)request.getAttribute("label");
    String name = (String)request.getAttribute("name");
   
    String engineTypeIdStr = (String) request.getAttribute("engineTypeId");
    Integer engineTypeId = new Integer(engineTypeIdStr);
    Domain engineType = DAOFactory.getDomainDAO().loadDomainById(engineTypeId);
   
    String engineDefaultDS = (String) request.getAttribute("engineDefaultDS")
    Integer engineDSId = null;
    if (engineDefaultDS != null && !engineDefaultDS.trim().equals("")) {
      engineDSId = new Integer(engineDefaultDS);
    }
   
      String url = "";
    String driverName = "";
    String className = "";
    if ("EXT".equalsIgnoreCase(engineType.getValueCd())) {
      // in case of external engine url and driverName are considered
      url = (String) request.getAttribute("url");
      driverName = (String)request.getAttribute("driverName");
    } else {
      // in case of internal engine only className is considered
View Full Code Here

    logger.debug("IN");
    try {
      List domains = DAOFactory.getDomainDAO().loadListDomains();
      Iterator itDom = domains.iterator();
      while (itDom.hasNext()) {
        Domain dom = (Domain) itDom.next();
        exporter.insertDomain(dom, session);
      }
    } catch (Exception e) {
      logger.error("Error while exporting domains ", e);
      throw new EMFUserError(EMFErrorSeverity.ERROR, "8005", "component_impexp_messages");
View Full Code Here

    logger.debug("IN");
    try {
      List udpFamilies = DAOFactory.getDomainDAO().loadListDomainsByType("UDP_FAMILY");
      if(udpFamilies != null){
        for(int i=0; i< udpFamilies.size(); i++){
          Domain type = (Domain)udpFamilies.get(i);
          //kpi udp/model udp
          List<Udp> udpList = DAOFactory.getUdpDAO().loadAllByFamily(type.getValueCd());
          if(udpList != null && !udpList.isEmpty()){
            for (Iterator iterator = udpList.iterator(); iterator.hasNext();) {
              Udp udp = (Udp) iterator.next();
              exporter.insertUdp(udp, session);         
            }
View Full Code Here

      List hibList = hibQuery.list();
      if(!hibList.isEmpty()) {
        return;
      }
      IDomainDAO domDAO = DAOFactory.getDomainDAO();
      Domain functTypeDom = domDAO.loadDomainByCodeAndValue("FUNCT_TYPE", funct.getCodType());
      SbiDomains hibFunctType = (SbiDomains)session.load(SbiDomains.class, functTypeDom.getValueId());
      SbiFunctions hibFunct = new SbiFunctions(funct.getId());
      hibFunct.setCode(funct.getCode());
      hibFunct.setDescr(funct.getDescription());
      hibFunct.setFunctTypeCd(funct.getCodType());
      hibFunct.setFunctType(hibFunctType);
      hibFunct.setName(funct.getName());
      hibFunct.setPath(funct.getPath());
      hibFunct.setProg(funct.getProg());
      session.save(hibFunct);
      tx.commit();
      Role[] devRoles = funct.getDevRoles();
      Domain devDom = domDAO.loadDomainByCodeAndValue(SpagoBIConstants.PERMISSION_ON_FOLDER,
          SpagoBIConstants.PERMISSION_ON_FOLDER_TO_DEVELOP);
      for(int i=0; i<devRoles.length; i++) {
        Role devRole = devRoles[i];
        insertRole(devRole, session);
        insertFunctRole(devRole, funct, devDom.getValueId(), devDom.getValueCd(), session);
      }
      Role[] testRoles = funct.getTestRoles();
      Domain testDom = domDAO.loadDomainByCodeAndValue(SpagoBIConstants.PERMISSION_ON_FOLDER,
          SpagoBIConstants.PERMISSION_ON_FOLDER_TO_TEST);
      for(int i=0; i<testRoles.length; i++) {
        Role testRole = testRoles[i];
        insertRole(testRole, session);
        insertFunctRole(testRole, funct, testDom.getValueId(), testDom.getValueCd(), session);
      }
      Role[] execRoles = funct.getExecRoles();
      Domain execDom = domDAO.loadDomainByCodeAndValue(SpagoBIConstants.PERMISSION_ON_FOLDER,
          SpagoBIConstants.PERMISSION_ON_FOLDER_TO_EXECUTE);
      for(int i=0; i<execRoles.length; i++) {
        Role execRole = execRoles[i];
        insertRole(execRole, session);
        insertFunctRole(execRole, funct, execDom.getValueId(), execDom.getValueCd(), session);
      }
      Role[] createRoles = funct.getCreateRoles();
      Domain createDom = domDAO.loadDomainByCodeAndValue(SpagoBIConstants.PERMISSION_ON_FOLDER,
          SpagoBIConstants.PERMISSION_ON_FOLDER_TO_CREATE);
      for(int i=0; i<createRoles.length; i++) {
        Role createRole = createRoles[i];
        insertRole(createRole, session);
        insertFunctRole(createRole, funct, createDom.getValueId(), createDom.getValueCd(), session);
      }

    } catch (Exception e) {
      logger.error("Error while inserting Functionality into export database " , e);
      throw new EMFUserError(EMFErrorSeverity.ERROR, "8005", "component_impexp_messages");
View Full Code Here

TOP

Related Classes of it.eng.spagobi.commons.bo.Domain

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.