Mercurial > hg > orthanc-webviewer
diff Orthanc/Core/Enumerations.cpp @ 90:a54260a7fe59
sync
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 27 Nov 2015 13:54:33 +0100 |
parents | bc05500ea317 |
children | 3809121c3290 |
line wrap: on
line diff
--- a/Orthanc/Core/Enumerations.cpp Mon Nov 09 09:34:49 2015 +0100 +++ b/Orthanc/Core/Enumerations.cpp Fri Nov 27 13:54:33 2015 +0100 @@ -151,6 +151,9 @@ case ErrorCode_EmptyRequest: return "The request is empty"; + case ErrorCode_NotAcceptable: + return "Cannot send a response which is acceptable according to the Accept HTTP header"; + case ErrorCode_SQLiteNotOpened: return "SQLite: The database is not opened"; @@ -322,6 +325,9 @@ case ErrorCode_CannotOrderSlices: return "Unable to order the slices of the series"; + case ErrorCode_NoWorklistHandler: + return "No request handler factory for DICOM C-Find Modality SCP"; + default: if (error >= ErrorCode_START_PLUGINS) { @@ -675,8 +681,8 @@ case RequestOrigin_DicomProtocol: return "DicomProtocol"; - case RequestOrigin_Http: - return "Http"; + case RequestOrigin_RestApi: + return "RestApi"; case RequestOrigin_Plugins: return "Plugins"; @@ -980,39 +986,6 @@ } - const char* GetMimeType(FileContentType type) - { - switch (type) - { - case FileContentType_Dicom: - return "application/dicom"; - - case FileContentType_DicomAsJson: - return "application/json"; - - default: - return "application/octet-stream"; - } - } - - - const char* GetFileExtension(FileContentType type) - { - switch (type) - { - case FileContentType_Dicom: - return ".dcm"; - - case FileContentType_DicomAsJson: - return ".json"; - - default: - // Unknown file type - return ""; - } - } - - ResourceType GetChildResourceType(ResourceType type) { switch (type) @@ -1164,8 +1137,18 @@ case ErrorCode_Unauthorized: return HttpStatus_401_Unauthorized; + case ErrorCode_NotAcceptable: + return HttpStatus_406_NotAcceptable; + default: return HttpStatus_500_InternalServerError; } } + + + bool IsUserContentType(FileContentType type) + { + return (type >= FileContentType_StartUser && + type <= FileContentType_EndUser); + } }