-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Link between Genesis and Kraftwerk #35
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Petit code smell mais OK sinon
data.getQuestionnaires().add(questionnaire); | ||
} | ||
|
||
// /* Step 2.2 : Get paradata for the survey */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indiquer pourquoi c'est commenté ou supprimer (Sonar aime pas trop les blocs de code commenté)
vtlExecute.convertToVtlDataset(data, dataMode, vtlBindings); | ||
} | ||
|
||
// private void parseParadata(ModeInputs modeInputs, SurveyRawData data) throws NullException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idem
La PR affecte la branche main, on envoie pas sur la develop avant ? |
return response.getBody() != null ? Arrays.asList(response.getBody()) : null; | ||
} | ||
|
||
public List<SurveyUnitUpdateLatest> getUEsLatestState(String idQuestionnaire, List<SurveyUnitId> idUEs) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change name to be coherent with "POST"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we are getting a list of SurveyUnit, we decided to keep the get at the beginning of the method name.
@@ -84,6 +95,18 @@ public ResponseEntity<String> mainLunaticOnly( | |||
return ResponseEntity.ok(inDirectoryParam); | |||
} | |||
|
|||
@PutMapping(value = "/main/genesis") | |||
@Operation(operationId = "mainGenesis", summary = "${summary.mainGenesis}", description = "${description.mainGenesis}") | |||
public ResponseEntity<String> mainGenesis(@RequestParam("idQuestionnaire") String idQuestionnaire) throws KraftwerkException, IOException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kraftwerk exception is catched
} | ||
|
||
public static Mode getEnumFromModeName(String modeName) { | ||
for (Mode mode : Mode.values()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
private String idQuest; | ||
private String idCampaign; | ||
private String idUE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
String idUE or SurveyUnitId ?
} | ||
|
||
public static Mode getEnumFromModeName(String modeName) { | ||
for (Mode mode : Mode.values()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private Path convertToUserPath(String userField) { | ||
if (userField != null && !"null".equals(userField) && !"".equals(userField)) { | ||
return Paths.get(userField); | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment
try { | ||
if (userField.startsWith("http")) { | ||
return new URL(userField); | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment
return null; | ||
} | ||
|
||
private Path convertToPath(String userField) throws KraftwerkException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
convertToPath, convertToUrl in the other class = maybe a class utils
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved the two methods in FileUtils
try { | ||
variables = DDIReader.getVariablesFromDDI(modeInputsGenesis.getDdiUrl()); | ||
} catch (KraftwerkException e) { | ||
log.error(e.getMessage()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe throw exception if no DDI ?
} | ||
|
||
public Path getInDirectory(String inDirectoryParam) { | ||
Path inDirectory = Paths.get(defaultDirectory, "in", inDirectoryParam); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"in" can be a constant
No description provided.