Examples of SbiKpiPeriodicity


Examples of it.eng.spagobi.kpi.config.metadata.SbiKpiPeriodicity

      if (value.getKpiInstance().getPeriodicityId() != null) {
        // AGGIUNTA O AGGIORNAMENTO RIGA
        // TODO

        SbiKpiPeriodicity sbiKpiPeriodicity = (SbiKpiPeriodicity) aSession
        .load(SbiKpiPeriodicity.class, value.getKpiInstance()
            .getPeriodicityId());

        Criteria critt = aSession.createCriteria(SbiKpiInstPeriod.class);
        critt.add(Expression.eq("sbiKpiInstance", sbiKpiInstance));
View Full Code Here

Examples of it.eng.spagobi.kpi.config.metadata.SbiKpiPeriodicity

            sbiKpiInstance.setTarget(kpiInst.getTarget());           

            //if periodicity exists then set it
            if(kpiInst.getPeriodicityId() != null){
              Set periods = new HashSet<SbiKpiInstPeriod>();
              SbiKpiPeriodicity sbiPeriodicity =  (SbiKpiPeriodicity) aSession.load(SbiKpiPeriodicity.class, kpiInst.getPeriodicityId())
              if(sbiPeriodicity != null){
                periods.add(sbiPeriodicity);
                sbiKpiInstance.setSbiKpiInstPeriods(periods);
              }
            }
View Full Code Here

Examples of it.eng.spagobi.kpi.config.metadata.SbiKpiPeriodicity

      if (kpiInstPeriod.getPeriodicityId() != null) {
        Integer periodicityId=kpiInstPeriod.getPeriodicityId();
        IPeriodicityDAO periodicityDAO=DAOFactory.getPeriodicityDAO();
        Periodicity period=periodicityDAO.loadPeriodicityById(periodicityId);
        insertPeriodicity(period, session);
        SbiKpiPeriodicity sbiKpiPeriodicity= (SbiKpiPeriodicity) session.load(SbiKpiPeriodicity.class, period.getIdKpiPeriodicity());
        if(sbiKpiPeriodicity!=null){
          hibKpiInstPeriod.setSbiKpiPeriodicity(sbiKpiPeriodicity);
        }
      }
View Full Code Here

Examples of it.eng.spagobi.kpi.config.metadata.SbiKpiPeriodicity

      if(!hibList.isEmpty()) {
        return;
      }

      // main attributes     
      SbiKpiPeriodicity hibPer = new SbiKpiPeriodicity();
      hibPer.setIdKpiPeriodicity(per.getIdKpiPeriodicity());
      hibPer.setName(per.getName());
      hibPer.setChronString(per.getCronString());
      hibPer.setDays(per.getDays());
      hibPer.setHours(per.getHours());
      hibPer.setMinutes(per.getMinutes());
      hibPer.setMonths(per.getMonths());
      hibPer.setStartDate(null);
      Transaction tx = session.beginTransaction();     
      session.save(hibPer);
      tx.commit();
    } catch (Exception e) {
      logger.error("Error while inserting Periodicity into export database " , e);
View Full Code Here

Examples of it.eng.spagobi.kpi.config.metadata.SbiKpiPeriodicity

      return hibDs;
    }   else if (hibObj instanceof SbiKpiPeriodicity) {
      String label = (String) unique;
      hql = "from SbiKpiPeriodicity ds where ds.name = '" + label + "'";
      hqlQuery = sessionCurrDB.createQuery(hql);
      SbiKpiPeriodicity hibDs = null;
      try{
        hibDs=(SbiKpiPeriodicity) hqlQuery.uniqueResult();
      }
      catch (Exception e) {
        throw new EMFUserError(EMFErrorSeverity.ERROR, "9006", "component_impexp_messages");
View Full Code Here

Examples of it.eng.spagobi.kpi.config.metadata.SbiKpiPeriodicity

    // get Periodicity
    Integer idPeriodicity=null;
    hql = "from SbiKpiPeriodicity where name = '" + periodicityLabel + "'";
    hqlQuery = sessionCurrDB.createQuery(hql);
    SbiKpiPeriodicity hibPer = (SbiKpiPeriodicity) hqlQuery.uniqueResult();
    if(hibPer==null) return null;
    idPeriodicity=hibPer.getIdKpiPeriodicity();

    // check now if association exists
    hql = "from SbiKpiInstPeriod where sbiKpiInstance = '" + newIdKpiInstance + "' AND sbiKpiPeriodicity ='"+ idPeriodicity +"'";
    hqlQuery = sessionCurrDB.createQuery(hql);
    SbiKpiInstPeriod hibKInstPer = (SbiKpiInstPeriod) hqlQuery.uniqueResult();
View Full Code Here

Examples of it.eng.spagobi.kpi.config.metadata.SbiKpiPeriodicity

      throw new Exception("No predefined periodicities found!!!");
    }
    Iterator it = periodicitiesList.iterator();
    while (it.hasNext()) {
      SourceBean aPeriodicitySB = (SourceBean) it.next();
      SbiKpiPeriodicity periodicity = new SbiKpiPeriodicity();
      periodicity.setName((String) aPeriodicitySB.getAttribute("name"));
      periodicity.setMonths(new Integer((String) aPeriodicitySB.getAttribute("months")));
      periodicity.setDays(new Integer((String) aPeriodicitySB.getAttribute("days")));
      periodicity.setHours(new Integer((String) aPeriodicitySB.getAttribute("hours")));
      periodicity.setMinutes(new Integer((String) aPeriodicitySB.getAttribute("minutes")));
      logger.debug("Inserting Periodicity with name = [" + aPeriodicitySB.getAttribute("name") + "]");
      aSession.save(periodicity);
    }
    logger.debug("OUT");
  }
View Full Code Here

Examples of it.eng.spagobi.kpi.config.metadata.SbiKpiPeriodicity

   *
   * @return the new hibernate parameter object
   */
  public static SbiKpiPeriodicity makeNewSbiPeriodicity(SbiKpiPeriodicity periodicity,Session sessionCurrDB, MetadataAssociations metaAss, ImporterMetadata importer){
    logger.debug("IN");
    SbiKpiPeriodicity newPer = new SbiKpiPeriodicity();
    try{
      newPer.setDays(periodicity.getDays());
      newPer.setChronString(periodicity.getChronString());
      newPer.setHours(periodicity.getHours());
      newPer.setMinutes(periodicity.getMinutes());
      newPer.setMonths(periodicity.getMonths());
      newPer.setName(periodicity.getName());

      // associations
      entitiesAssociationsSbiPeriodicity(periodicity, newPer, sessionCurrDB, metaAss, importer);

      logger.debug("OUT");
View Full Code Here

Examples of it.eng.spagobi.kpi.config.metadata.SbiKpiPeriodicity

   * @throws EMFUserError the EMF user error
   */
  public static SbiKpiPeriodicity modifyExistingSbiPeriodicity(SbiKpiPeriodicity exportedPer, Session sessionCurrDB,
      Integer existingId, MetadataAssociations metaAss, ImporterMetadata importer) throws EMFUserError {
    logger.debug("IN");
    SbiKpiPeriodicity existingPer = null;
    try {
      // update th Value
      existingPer = (SbiKpiPeriodicity) sessionCurrDB.load(SbiKpiPeriodicity.class, existingId);
      existingPer.setName(exportedPer.getName());
      existingPer.setChronString(exportedPer.getChronString());
      existingPer.setDays(exportedPer.getDays());
      existingPer.setHours(exportedPer.getHours());
      existingPer.setMonths(exportedPer.getMonths());
      existingPer.setMinutes(exportedPer.getMinutes());

      // associations
      entitiesAssociationsSbiPeriodicity(exportedPer, existingPer, sessionCurrDB, metaAss, importer);
    }

View Full Code Here

Examples of it.eng.spagobi.kpi.config.metadata.SbiKpiPeriodicity

      if(newPerId==null) {
        logger.error("could not find periodicity associated to kpiInstPeriod: "+exportedKpiInstPeriod.getSbiKpiPeriodicity().getIdKpiPeriodicity());
      }
      else{
        // I must get the new SbiDomains object
        SbiKpiPeriodicity newSbiPeriodicity= (SbiKpiPeriodicity) sessionCurrDB.load(SbiKpiPeriodicity.class, newPerId);
        existingKpiInstPeriod.setSbiKpiPeriodicity(newSbiPeriodicity);
      }
    }

    // Kpi Instance
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.