Skip to content

Commit

Permalink
wire encoding dbtool options for xls tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
rkrenn committed Apr 6, 2024
1 parent 63ec822 commit ac2e0f7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions core/src/exec/java/org/phoenixctms/ctsms/executable/DBTool.java
Original file line number Diff line number Diff line change
Expand Up @@ -827,13 +827,15 @@ public static void main(String[] args) {
job = DBToolOptions.getTaskAndLockProcess(DBToolOptions.IMPORT_INPUT_FIELDS_OPT);
dbTool.initJob(line).printPrelude(job);
if (dbTool.testForced(line, "DB will be modified - input fields and selection set values will be updated!")) {
sendEmail = dbTool.getXlsImporter().loadInputFields(line.getOptionValue(DBToolOptions.IMPORT_INPUT_FIELDS_OPT), getAuthenticationOptionValue(line)) > 0l;
sendEmail = dbTool.getXlsImporter().loadInputFields(line.getOptionValue(DBToolOptions.IMPORT_INPUT_FIELDS_OPT),
line.getOptionValue(DBToolOptions.ENCODING_OPT), getAuthenticationOptionValue(line)) > 0l;
}
} else if (line.hasOption(DBToolOptions.IMPORT_ECRFS_OPT)) {
job = DBToolOptions.getTaskAndLockProcess(DBToolOptions.IMPORT_ECRFS_OPT);
dbTool.initJob(line).printPrelude(job);
if (dbTool.testForced(line, "DB will be modified - eCRFs, eCRF fields, input fields and selection set values will be updated!")) {
sendEmail = dbTool.getXlsImporter().loadEcrfs(line.getOptionValue(DBToolOptions.IMPORT_ECRFS_OPT), getAuthenticationOptionValue(line),
sendEmail = dbTool.getXlsImporter().loadEcrfs(line.getOptionValue(DBToolOptions.IMPORT_ECRFS_OPT), line.getOptionValue(DBToolOptions.ENCODING_OPT),
getAuthenticationOptionValue(line),
getIdOptionValue(line, true)) > 0l;
}
} else if (line.hasOption(DBToolOptions.EXPORT_INPUT_FIELD_OPT)) {
Expand All @@ -843,6 +845,7 @@ public static void main(String[] args) {
|| dbTool.testOverwriteFile(line, line.getOptionValue(DBToolOptions.EXPORT_INPUT_FIELD_OPT))) {
sendEmail = dbTool.getXlsExporter().exportInputField(
line.getOptionValue(DBToolOptions.EXPORT_INPUT_FIELD_OPT),
line.getOptionValue(DBToolOptions.ENCODING_OPT),
getAuthenticationOptionValue(line), getIdOptionValue(line, true)) > 0l;
}
} else if (line.hasOption(DBToolOptions.EXPORT_ECRFS_OPT)) {
Expand All @@ -852,19 +855,21 @@ public static void main(String[] args) {
|| dbTool.testOverwriteFile(line, line.getOptionValue(DBToolOptions.EXPORT_ECRFS_OPT))) {
sendEmail = dbTool.getXlsExporter().exportEcrfs(
line.getOptionValue(DBToolOptions.EXPORT_ECRFS_OPT),
line.getOptionValue(DBToolOptions.ENCODING_OPT),
getAuthenticationOptionValue(line), getIdOptionValue(line, true)) > 0l;
}
} else if (line.hasOption(DBToolOptions.IMPORT_RANDOMIZATION_LISTS_OPT)) {
job = DBToolOptions.getTaskAndLockProcess(DBToolOptions.IMPORT_RANDOMIZATION_LISTS_OPT);
dbTool.initJob(line).printPrelude(job);
if (dbTool.testForced(line, "DB will be modified - randomization lists will be updated!")) {
sendEmail = dbTool.getXlsImporter().loadRandomizationLists(line.getOptionValue(DBToolOptions.IMPORT_RANDOMIZATION_LISTS_OPT),
line.getOptionValue(DBToolOptions.ENCODING_OPT),
getAuthenticationOptionValue(line), getIdOptionValue(line, true), true) > 0l;
}
} else if (line.hasOption(DBToolOptions.IMPORT_ASPS_OPT)) {
job = DBToolOptions.getTaskAndLockProcess(DBToolOptions.IMPORT_ASPS_OPT);
dbTool.getJobOutput().printPrelude(job);
sendEmail = dbTool.getXlsImporter().loadAsps(line.getOptionValue(DBToolOptions.IMPORT_ASPS_OPT),
sendEmail = dbTool.getXlsImporter().loadAsps(line.getOptionValue(DBToolOptions.IMPORT_ASPS_OPT), line.getOptionValue(DBToolOptions.ENCODING_OPT),
line.hasOption(DBToolOptions.FLUSH_REVISION_OPT), line.getOptionValue(DBToolOptions.ASP_REVISION_OPT)) > 0l;
} else if (line.hasOption(DBToolOptions.EXPORT_ECRF_PDFS_OPT)) {
job = DBToolOptions.getTaskAndLockProcess(DBToolOptions.EXPORT_ECRF_PDFS_OPT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ public String toString() {
options.addOption(registerOptionalOption(LIMIT_OPT, "limit", "limit for number of (processed) records", 1));
options.addOption(registerOptionalOption(FLUSH_REVISION_OPT, "flush_revision", "flush alpha id, ops code, asp, asp, icd or ops systematics records prior to import",
0));
options.addOption(registerOptionalOption(ENCODING_OPT, "encoding", "encoding of csv/text file to import", 1));
options.addOption(registerOptionalOption(ENCODING_OPT, "encoding", "encoding of file to import/export", 1));
options.addOption(registerOptionalOption(USERNAME_OPT, "username", "username", 1));
options.addOption(registerOptionalOption(PASSWORD_OPT, "password", "user password", 1));
options.addOption(registerOptionalOption(AUTH_OPT, "auth", "base64 encoded username and password", 1));
Expand Down

0 comments on commit ac2e0f7

Please sign in to comment.