Skip to content

Commit

Permalink
changed editfactory logic
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonioG70 committed Oct 31, 2024
1 parent 81e75fc commit 71db067
Showing 1 changed file with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import java.util.Map;
import java.util.Set;

import com.databasepreservation.modules.siard.SIARDDKEditFactory;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
Expand Down Expand Up @@ -83,9 +84,7 @@
import com.databasepreservation.modules.config.ImportConfigurationModuleFactory;
import com.databasepreservation.modules.jdbc.in.JDBCImportModule;
import com.databasepreservation.modules.siard.SIARD2ModuleFactory;
import com.databasepreservation.modules.siard.SIARDDK1007EditFactory;
import com.databasepreservation.modules.siard.SIARDDK1007ModuleFactory;
import com.databasepreservation.modules.siard.SIARDDK128EditFactory;
import com.databasepreservation.modules.siard.SIARDDK128ModuleFactory;
import com.databasepreservation.modules.siard.SIARDEditFactory;
import com.databasepreservation.modules.siard.SIARDValidateFactory;
Expand Down Expand Up @@ -610,13 +609,8 @@ private static void convertSIARDMetadataToSolr(Path siardPath, String databaseUU
Reporter reporter = new NoOpReporter();
SIARDEdition siardEdition = SIARDEdition.newInstance();
if (siardVersion.equals(ViewerConstants.SIARD_DK)) {
if (Files.exists(Paths.get(siardPath + ViewerConstants.SIARDDK_RESEARCH_INDEX_PATH))) {
siardEdition.editModule(new SIARDDK128EditFactory()).editModuleParameter(
SIARDDK128EditFactory.PARAMETER_FOLDER, Collections.singletonList(siardPath.toAbsolutePath().toString()));
} else {
siardEdition.editModule(new SIARDDK1007EditFactory()).editModuleParameter(
SIARDDK1007EditFactory.PARAMETER_FOLDER, Collections.singletonList(siardPath.toAbsolutePath().toString()));
}
siardEdition.editModule(new SIARDDKEditFactory()).editModuleParameter(
SIARDDKEditFactory.PARAMETER_FOLDER, Collections.singletonList(siardPath.toAbsolutePath().toString()));
} else if (siardVersion.equals(ViewerConstants.SIARD_V21)) {
siardEdition.editModule(new SIARDEditFactory()).editModuleParameter(SIARDEditFactory.PARAMETER_FILE,
Collections.singletonList(siardPath.toAbsolutePath().toString()));
Expand Down

0 comments on commit 71db067

Please sign in to comment.