Package it.eng.spagobi.analiticalmodel.document.metadata

Examples of it.eng.spagobi.analiticalmodel.document.metadata.SbiSubreports


   *
   * @throws EMFUserError
   */
  private void importBIObjectLinks() throws EMFUserError {
    logger.debug("IN");
    SbiSubreports objlink = null;
    try {
      List exportedBIObjectsLinks = importer.getAllExportedSbiObjects(sessionExpDB, "SbiSubreports", null);
      Iterator iterSbiObjLinks = exportedBIObjectsLinks.iterator();
      while (iterSbiObjLinks.hasNext()) {
        objlink = (SbiSubreports) iterSbiObjLinks.next();

        // get biobjects
        SbiObjects masterBIObj = objlink.getId().getMasterReport();
        SbiObjects subBIObj = objlink.getId().getSubReport();
        Integer masterid = masterBIObj.getBiobjId();
        Integer subid = subBIObj.getBiobjId();
        // get association of object
        Map biobjIdAss = metaAss.getBIobjIDAssociation();
        // try to get from association the id associate to the exported
        // metadata
        Integer newMasterId = (Integer) biobjIdAss.get(masterid);
        Integer newSubId = (Integer) biobjIdAss.get(subid);

        // build a new SbiSubreport
        // build a new id for the SbiSubreport
        SbiSubreportsId sbiSubReportsId = objlink.getId();
        SbiSubreportsId newSubReportsId = new SbiSubreportsId();
        if (sbiSubReportsId != null) {
          SbiObjects master = sbiSubReportsId.getMasterReport();
          SbiObjects sub = sbiSubReportsId.getMasterReport();
          SbiObjects newMaster = ImportUtilities.makeNewSbiObject(master, newMasterId);
          SbiObjects newSub = ImportUtilities.makeNewSbiObject(sub, newSubId);
          newSubReportsId.setMasterReport(newMaster);
          newSubReportsId.setSubReport(newSub);
        }
        SbiSubreports newSubReport = new SbiSubreports();
        newSubReport.setId(newSubReportsId);
        // check if the association between metadata already exist
        Map unique = new HashMap();
        unique.put("masterid", newMasterId);
        unique.put("subid", newSubId);
        Object existObj = importer.checkExistence(unique, sessionCurrDB, new SbiSubreports());
        if (existObj == null) {
          sessionCurrDB.save(newSubReport);
          metaLog.log("Inserted new link between master object " + masterBIObj.getLabel()
              + " and sub object " + subBIObj.getLabel());
        }
View Full Code Here


      SbiSubreportsId hibSubreportid = new SbiSubreportsId();
      SbiObjects masterReport = (SbiObjects) session.load(SbiObjects.class, sub.getMaster_rpt_id());
      SbiObjects subReport = (SbiObjects) session.load(SbiObjects.class, sub.getSub_rpt_id());
      hibSubreportid.setMasterReport(masterReport);
      hibSubreportid.setSubReport(subReport);
      SbiSubreports hibSubreport = new SbiSubreports(hibSubreportid);
      session.save(hibSubreport);
      tx.commit();
    } catch (Exception e) {
      logger.error("Error while inserting subreport " , e);
      throw new EMFUserError(EMFErrorSeverity.ERROR, "8005", "component_impexp_messages");
View Full Code Here

      Integer masterid = (Integer) uniqueMap.get("masterid");
      Integer subid = (Integer) uniqueMap.get("subid");
      hql = "from SbiSubreports subreport where subreport.id.masterReport.biobjId = " + masterid
      + " and subreport.id.subReport.biobjId = " + subid;
      hqlQuery = sessionCurrDB.createQuery(hql);
      SbiSubreports hibSubRep = (SbiSubreports) hqlQuery.uniqueResult();
      return hibSubRep;
    } else if (hibObj instanceof SbiObjParuse) {
      Map uniqueMap = (Map) unique;
      Integer objparid = (Integer) uniqueMap.get("objparid");
      Integer paruseid = (Integer) uniqueMap.get("paruseid");
View Full Code Here

    SbiSubreportsId hibSubreportid = new SbiSubreportsId();
    SbiObjects masterReport = (SbiObjects) aSession.load(SbiObjects.class, aSubreport.getMaster_rpt_id());
    SbiObjects subReport = (SbiObjects) aSession.load(SbiObjects.class, aSubreport.getSub_rpt_id());
    hibSubreportid.setMasterReport(masterReport);
    hibSubreportid.setSubReport(subReport);
    SbiSubreports hibSubreport = new SbiSubreports(hibSubreportid);
    updateSbiCommonInfo4Insert(hibSubreport);
    aSession.save(hibSubreport)
    tx.commit();
  }
View Full Code Here

TOP

Related Classes of it.eng.spagobi.analiticalmodel.document.metadata.SbiSubreports

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.