Esempio n. 1
0
  public void doRun() {
    try {
      log.info("Export started");

      openDocument(writer);

      // -----------------------------------------------------------------
      // XML
      // -----------------------------------------------------------------

      beforeXML(writer);

      for (XMLHrConverter converter : xmlConverters) {
        converter.write(writer, params);
      }

      afterXML(writer);

      closeDocument(writer);

      StreamUtils.closeZipEntry(zipOutputStream);

      log.info("Export done");
    } catch (Exception ex) {
      ex.printStackTrace();

      throw new RuntimeException("Writing failed" + ex);
    } finally {
      writer.closeWriter();

      StreamUtils.closeOutputStream(zipOutputStream);

      NameMappingUtil.clearMapping();
    }
  }
  public void handleRow(Object object) {
    OrganisationUnit unit = (OrganisationUnit) object;

    NameMappingUtil.addOrganisationUnitMapping(unit.getId(), unit.getName());

    unit.setUuid(UUIdUtils.getUUId());

    if (unit.getOrganisationUnitCode() != null
        && unit.getOrganisationUnitCode().trim().length() == 0) {
      unit.setOrganisationUnitCode(null);
    }

    read(unit, OrganisationUnit.class, GroupMemberType.NONE, params);
  }
  public void importAll() {
    importObjectManager.importCategoryOptions();
    importObjectManager.importCategories();
    importObjectManager.importCategoryCombos();
    importObjectManager.importCategoryOptionCombos();
    importObjectManager.importCategoryCategoryOptionAssociations();
    importObjectManager.importCategoryComboCategoryAssociations();
    importObjectManager.importDataElements();
    importObjectManager.importDataElementGroups();
    importObjectManager.importDataElementGroupMembers();
    importObjectManager.importDataElementGroupSets();
    importObjectManager.importDataElementGroupSetMembers();
    importObjectManager.importIndicatorTypes();
    importObjectManager.importIndicators();
    importObjectManager.importIndicatorGroups();
    importObjectManager.importIndicatorGroupMembers();
    importObjectManager.importIndicatorGroupSets();
    importObjectManager.importIndicatorGroupSetMembers();
    importObjectManager.importDataDictionaries();
    importObjectManager.importDataDictionaryDataElements();
    importObjectManager.importDataDictionaryIndicators();
    importObjectManager.importDataSets();
    importObjectManager.importDataSetMembers();
    importObjectManager.importOrganisationUnits();
    importObjectManager.importOrganisationUnitRelationships();
    importObjectManager.importOrganisationUnitGroups();
    importObjectManager.importOrganisationUnitGroupMembers();
    importObjectManager.importOrganisationUnitGroupSets();
    importObjectManager.importOrganisationUnitGroupSetMembers();
    importObjectManager.importOrganisationUnitLevels();
    importObjectManager.importDataSetSourceAssociations();
    importObjectManager.importValidationRules();
    importObjectManager.importPeriods();
    importObjectManager.importReports();
    importObjectManager.importReportTables();
    importObjectManager.importCharts();
    importObjectManager.importCompleteDataSetRegistrations();
    importObjectManager.importDataValues();

    NameMappingUtil.clearMapping();

    cacheManager.clearCache();
  }
  @Override
  public void importObject(OrganisationUnitGroupSet object, ImportParams params) {
    NameMappingUtil.addGroupSetMapping(object.getId(), object.getName());

    read(object, GroupMemberType.NONE, params);
  }
Esempio n. 5
0
  @Override
  public void importObject(IndicatorGroup object, ImportParams params) {
    NameMappingUtil.addIndicatorGroupMapping(object.getId(), object.getName());

    read(object, GroupMemberType.NONE, params);
  }
  @Override
  public void importObject(DataElementCategoryOption object, ImportParams params) {
    NameMappingUtil.addCategoryOptionMapping(object.getId(), object.getName());

    read(object, GroupMemberType.NONE, params);
  }