-
Notifications
You must be signed in to change notification settings - Fork 0
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
Make case name independent of file name #17
Conversation
Signed-off-by: EL-MHARI Charaf <charaf.elmhari@rte-france.com>
src/main/java/org/gridsuite/caseimport/server/CaseImportController.java
Outdated
Show resolved
Hide resolved
When not given or empty, use filename as case name Signed-off-by: EL-MHARI Charaf <charaf.elmhari@rte-france.com>
src/main/java/org/gridsuite/caseimport/server/CaseImportController.java
Outdated
Show resolved
Hide resolved
Signed-off-by: EL-MHARI Charaf <charaf.elmhari@rte-france.com>
src/main/java/org/gridsuite/caseimport/server/CaseImportService.java
Outdated
Show resolved
Hide resolved
src/main/java/org/gridsuite/caseimport/server/CaseImportService.java
Outdated
Show resolved
Hide resolved
String targetDirectory = getTargetDirectory(caseOrigin); | ||
UUID caseUuid = caseService.importCase(caseFile); | ||
var caseElementAttributes = new ElementAttributes(caseUuid, caseFile.getOriginalFilename(), CASE, new AccessRightsAttributes(false), userId, 0L, null); | ||
String caseName = caseNameParam == null || caseNameParam.trim().isEmpty() ? caseFile.getOriginalFilename() : caseNameParam; |
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 caseName = caseNameParam == null || caseNameParam.trim().isEmpty() ? caseFile.getOriginalFilename() : caseNameParam; | |
String caseName = caseNameParam == null || caseNameParam.trim().isEmpty() ? DataSourceUtil.getBaseName(Paths.get(caseFile.getOriginalFilename())) : caseNameParam; |
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.
This would avoid to have this extensions in the name in gridexplore for example. But maybe it rather should be done in case-server
Signed-off-by: EL-MHARI Charaf <charaf.elmhari@rte-france.com>
|
Currently, the case import server uses the filename as the case name. This leads to extensions in case names.
For example: import caseFile.xml.gz will lead to case name caseFile.xml.gz.
The goal is to allow the client to choose a case name different that the file name.