-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extensions to the SOP classes and Transfer Syntaxes hardcoded lists. (#…
…516) * New datastructs to support schema upcoming change * New attributes and functions to support confs/server.xml schema upcoming change * Planned #498 course of action (TODOs) * Implemented support for extended SOP classes and Transfer Syntaxes * Tweaks in comments * Tweaks in comments * Added licence to new files * Fixed licence header on new datastructures * Fixed* uninitialized server settings problems. *shadowed TransfersStorage's changes in this branch temporarily Signed-off-by: Almeida-a <[email protected]> * Implemented the recently added signatures in LegacyServerSettings's interfaces Signed-off-by: Almeida-a <[email protected]> * Parser from AdditionalTransferSyntax to TransferSyntax from dcm4che; Code rearrangement for readability Signed-off-by: Almeida-a <[email protected]> * TransfersStorage refactor, tweaks and tests * Everything working, with the only task missing being the new configs appearing in the dicoogle's GUI Signed-off-by: Almeida-a <[email protected]> * New SOP classes now appear on transfer options; New transfer syntaxes appear now only on new SOP Classes; * Problem on new SOP classes not showing on the list was because I forgot to add them to SOP array (SOPList.updateList) * The new transfer syntaxes don't appear on the hardcoded SOP list because it is static. To be solved asap Signed-off-by: Almeida-a <[email protected]> * Fixed problem of hardcoded SOP list not containing added transfer syntaxes Signed-off-by: Almeida-a <[email protected]> * Set default TSs for new SOP classes Signed-off-by: Almeida-a <[email protected]> * Minor tweaks/cleanup and optimization. * Optimized the use of TransfersStorage.namesUidMapping (updated to static variable) * TODO#498 in ServerSettingsManager was marked with feedback keyword, as the issue is a mere conceptual one, and doesn't affect any functional operations in dicoogle. Signed-off-by: Almeida-a <[email protected]> * "Additionals" related functions are now a no-op Signed-off-by: Almeida-a <[email protected]> * Refactored additional datastructs following the first feedback from #516 pull request. * Format was switched to more verbose parameters, like explicitVR, encapsulated, etc.; * Invalid, and therefore, suppressed additionals leave a logger warning indicating the problem in concrete; * ServerSettingsTest.testAdditionals cover the referenced additions. Signed-off-by: Almeida-a <[email protected]> * #516 pull request's 2nd review changes. * Changed defaults * Removed Additional datastructs' id and thus refactored isValid logs * Changed JacksonXmlProperty notations to JsonProperty (and fixed typo on attribute' name reference) * Other suggested minor changes Signed-off-by: Almeida-a <[email protected]> * Minor changes in code for readability Signed-off-by: Almeida-a <[email protected]> * #498 #516 Reference fix Signed-off-by: Almeida-a <[email protected]> * #516 Moved from JsonProperty to JacksonXmlProperty Also, removed unused imports * #516 Suppressed logs in ServerSettingsTest$testAdditionals --------- Signed-off-by: Almeida-a <[email protected]>
- Loading branch information
Showing
13 changed files
with
666 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,15 +25,20 @@ | |
import org.slf4j.LoggerFactory; | ||
import org.xml.sax.SAXException; | ||
import pt.ua.dicoogle.core.XMLSupport; | ||
import pt.ua.dicoogle.utils.Platform; | ||
import pt.ua.dicoogle.sdk.datastructs.AdditionalSOPClass; | ||
import pt.ua.dicoogle.sdk.datastructs.AdditionalTransferSyntax; | ||
import pt.ua.dicoogle.sdk.settings.server.ServerSettings; | ||
import pt.ua.dicoogle.server.SOPList; | ||
import pt.ua.dicoogle.server.TransfersStorage; | ||
import pt.ua.dicoogle.utils.Platform; | ||
|
||
import java.io.*; | ||
import java.net.URL; | ||
import java.nio.file.Files; | ||
import java.nio.file.Path; | ||
import java.nio.file.Paths; | ||
import java.util.Objects; | ||
import java.util.stream.Collectors; | ||
|
||
/** | ||
* @author Eduardo Pinho <[email protected]> | ||
|
@@ -98,6 +103,21 @@ public static void init() throws IOException { | |
} else { | ||
// use main configuration file | ||
inner = loadSettingsAt(MAIN_CONFIG_PATH); | ||
/* | ||
TODO#498 (feedback needed) export this following block of code to somewhere more fitting | ||
Check which new UIDs from "additional*" tags are valid (SOP Class UIDs can skip this if | ||
they are already present in the transfer options: e.g. in SOPList) and filter them | ||
Validate and filter Transfer Syntaxes; | ||
*/ | ||
inner.getDicomServicesSettings() | ||
.setAdditionalTransferSyntaxes(inner.getDicomServicesSettings().getAdditionalTransferSyntaxes() | ||
.stream().filter(AdditionalTransferSyntax::isValid).collect(Collectors.toList())); | ||
TransfersStorage.completeList(); | ||
// Validate and filter SOP Classes; add them to SOPList | ||
inner.getDicomServicesSettings() | ||
.setAdditionalSOPClasses(inner.getDicomServicesSettings().getAdditionalSOPClasses().stream() | ||
.filter(AdditionalSOPClass::isValid).collect(Collectors.toList())); | ||
SOPList.getInstance().updateList(); | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.