# HG changeset patch # User Sebastien Jodogne # Date 1423647134 -3600 # Node ID f7966e9950e473ce3aed15b5d2478e591d5da1c2 # Parent 178de5edc0a8c63d528e78f002ce05f5a862a068# Parent f796207e3df1eccbf7917d16e5b15b56f876e962 integration mainline->db-changes diff -r 178de5edc0a8 -r f7966e9950e4 .travis.yml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.travis.yml Wed Feb 11 10:32:14 2015 +0100 @@ -0,0 +1,68 @@ +language: cpp + +env: + - TRAVIS_MINGW=OFF + - TRAVIS_MINGW=ON + +compiler: + - gcc + - clang + +os: + - osx + - linux + +osx_image: xcode61 + +matrix: + exclude: + # This excludes OSX builds from the build matrix for gcc + - os: osx + compiler: gcc + + # Do not compile for OS X or clang when MinGW is enabled + - os: osx + env: TRAVIS_MINGW=ON + - compiler: clang + env: TRAVIS_MINGW=ON + +before_install: + - if [ $TRAVIS_OS_NAME == linux ]; then sudo apt-get update -qq && sudo apt-get install + -qq build-essential unzip cmake mercurial uuid-dev libcurl4-openssl-dev liblua5.1-0-dev + libgtest-dev libpng-dev libsqlite3-dev libssl-dev zlib1g-dev libdcmtk2-dev libwrap0-dev + libcharls-dev; fi + - if [ $TRAVIS_OS_NAME == linux -a $TRAVIS_MINGW == ON ]; then sudo apt-get install mingw32; fi + + +before_script: + - mkdir Build + - cd Build + - if [ $TRAVIS_OS_NAME == linux -a $TRAVIS_MINGW == OFF ]; then cmake + -DCMAKE_BUILD_TYPE=Debug "-DDCMTK_LIBRARIES=CharLS;dcmjpls;wrap;oflog" + -DALLOW_DOWNLOADS=ON -DUSE_SYSTEM_BOOST=OFF -DUSE_SYSTEM_MONGOOSE=OFF -DUSE_SYSTEM_JSONCPP=OFF + -DUSE_SYSTEM_GOOGLE_LOG=OFF -DUSE_SYSTEM_PUGIXML=OFF -DUSE_GTEST_DEBIAN_SOURCE_PACKAGE=ON + ..; fi + - if [ $TRAVIS_OS_NAME == linux -a $TRAVIS_MINGW == ON ]; then cmake + -DCMAKE_BUILD_TYPE=Debug -DSTATIC_BUILD=ON -DSTANDALONE_BUILD=ON -DALLOW_DOWNLOADS=ON + -DCMAKE_TOOLCHAIN_FILE=Resources/MinGWToolchain.cmake + ..; fi + - if [ $TRAVIS_OS_NAME == osx ]; then cmake + -DCMAKE_BUILD_TYPE=Debug -DSTATIC_BUILD=ON -DSTANDALONE_BUILD=ON -DALLOW_DOWNLOADS=ON + ..; fi + +script: make && if [ $TRAVIS_MINGW == OFF ]; then ./UnitTests; fi + +#script: cp ../README Orthanc +#deploy: +# provider: releases +# api_key: +# secure: WU+niKLAKMoJHST5EK23BayK4qXSrXELKlJYc8wRjMO4ay1KSgvzlY2UGKeW1EPClBfZZ0Uh5VKF8l34exsfirFuwCX2qceozduZproUszZ4Z88X8wt8Ctu8tBuuKLZYFc9iNH4zw+QZyRuPyXK9iWpS0L9O20pqy5upTsagM3o= +# file_glob: true +# file: +# - 'Build/Orthanc' +# - 'Build/UnitTests' +# - 'BuildMinGW32/Orthanc.exe' +# - 'BuildMinGW32/UnitTests.exe' +# skip_cleanup: true +# on: +# all_branches: true diff -r 178de5edc0a8 -r f7966e9950e4 AUTHORS --- a/AUTHORS Tue Nov 04 13:56:17 2014 +0100 +++ b/AUTHORS Wed Feb 11 10:32:14 2015 +0100 @@ -6,7 +6,9 @@ ------------------ * Sebastien Jodogne - Department of Medical Physics, CHU of Liege, Belgium + Department of Medical Physics + University Hospital of Liege + Belgium Overall design and lead developer. diff -r 178de5edc0a8 -r f7966e9950e4 CMakeLists.txt --- a/CMakeLists.txt Tue Nov 04 13:56:17 2014 +0100 +++ b/CMakeLists.txt Wed Feb 11 10:32:14 2015 +0100 @@ -37,9 +37,7 @@ SET(USE_SYSTEM_PUGIXML ON CACHE BOOL "Use the system version of Pugixml)") # Experimental options -SET(USE_PLUSTACHE OFF CACHE BOOL "Use the Plustache templating engine (experimental)") SET(USE_PUGIXML ON CACHE BOOL "Use the Pugixml parser (turn off only for debug)") -SET(USE_SYSTEM_PLUSTACHE OFF CACHE BOOL "Use the system version of Plustache (experimental)") # Distribution-specific settings SET(USE_GTEST_DEBIAN_SOURCE_PACKAGE OFF CACHE BOOL "Use the sources of Google Test shipped with libgtest-dev (Debian only)") @@ -166,6 +164,7 @@ OrthancServer/ServerToolbox.cpp OrthancServer/OrthancFindRequestHandler.cpp OrthancServer/OrthancMoveRequestHandler.cpp + OrthancServer/ExportedResource.cpp # From "lua-scripting" branch OrthancServer/DicomInstanceToStore.cpp @@ -198,7 +197,16 @@ UnitTestsSources/ImageProcessingTests.cpp UnitTestsSources/JpegLosslessTests.cpp UnitTestsSources/PluginsTests.cpp - UnitTestsSources/PlustacheTests.cpp + ) + + +set(ORTHANC_EMBEDDED_FILES + PREPARE_DATABASE ${CMAKE_CURRENT_SOURCE_DIR}/OrthancServer/PrepareDatabase.sql + UPGRADE_DATABASE_3_TO_4 ${CMAKE_CURRENT_SOURCE_DIR}/OrthancServer/Upgrade3To4.sql + UPGRADE_DATABASE_4_TO_5 ${CMAKE_CURRENT_SOURCE_DIR}/OrthancServer/Upgrade4To5.sql + CONFIGURATION_SAMPLE ${CMAKE_CURRENT_SOURCE_DIR}/Resources/Configuration.json + DICOM_CONFORMANCE_STATEMENT ${CMAKE_CURRENT_SOURCE_DIR}/Resources/DicomConformanceStatement.txt + LUA_TOOLBOX ${CMAKE_CURRENT_SOURCE_DIR}/Resources/Toolbox.lua ) @@ -229,7 +237,6 @@ include(${CMAKE_SOURCE_DIR}/Resources/CMake/LibPngConfiguration.cmake) include(${CMAKE_SOURCE_DIR}/Resources/CMake/LuaConfiguration.cmake) include(${CMAKE_SOURCE_DIR}/Resources/CMake/LibCurlConfiguration.cmake) -include(${CMAKE_SOURCE_DIR}/Resources/CMake/PlustacheConfiguration.cmake) include(${CMAKE_SOURCE_DIR}/Resources/CMake/PugixmlConfiguration.cmake) @@ -260,21 +267,11 @@ ## Autogeneration of files ##################################################################### -# Prepare the embedded files -set(EMBEDDED_FILES - PREPARE_DATABASE ${CMAKE_CURRENT_SOURCE_DIR}/OrthancServer/PrepareDatabase.sql - UPGRADE_DATABASE_3_TO_4 ${CMAKE_CURRENT_SOURCE_DIR}/OrthancServer/Upgrade3To4.sql - UPGRADE_DATABASE_4_TO_5 ${CMAKE_CURRENT_SOURCE_DIR}/OrthancServer/Upgrade4To5.sql - CONFIGURATION_SAMPLE ${CMAKE_CURRENT_SOURCE_DIR}/Resources/Configuration.json - DICOM_CONFORMANCE_STATEMENT ${CMAKE_CURRENT_SOURCE_DIR}/Resources/DicomConformanceStatement.txt - LUA_TOOLBOX ${CMAKE_CURRENT_SOURCE_DIR}/Resources/Toolbox.lua - ) - if (${STANDALONE_BUILD}) # We embed all the resources in the binaries for standalone builds add_definitions(-DORTHANC_STANDALONE=1) EmbedResources( - ${EMBEDDED_FILES} + ${ORTHANC_EMBEDDED_FILES} ORTHANC_EXPLORER ${CMAKE_CURRENT_SOURCE_DIR}/OrthancExplorer ${DCMTK_DICTIONARIES} ) @@ -284,7 +281,7 @@ -DORTHANC_PATH=\"${CMAKE_SOURCE_DIR}\" ) EmbedResources( - ${EMBEDDED_FILES} + ${ORTHANC_EMBEDDED_FILES} ) endif() @@ -479,7 +476,7 @@ install( FILES ${ORTHANC_ROOT}/OrthancCppClient/SharedLibrary/AUTOGENERATED/OrthancCppClient.h - ${ORTHANC_ROOT}/Plugins/OrthancCPlugin/OrthancCPlugin.h + ${ORTHANC_ROOT}/Plugins/Include/OrthancCPlugin.h DESTINATION include/orthanc ) endif() diff -r 178de5edc0a8 -r f7966e9950e4 Core/Cache/ICachePageProvider.h --- a/Core/Cache/ICachePageProvider.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/Cache/ICachePageProvider.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/Cache/LeastRecentlyUsedIndex.h --- a/Core/Cache/LeastRecentlyUsedIndex.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/Cache/LeastRecentlyUsedIndex.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/Cache/MemoryCache.cpp --- a/Core/Cache/MemoryCache.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/Cache/MemoryCache.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/Cache/MemoryCache.h --- a/Core/Cache/MemoryCache.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/Cache/MemoryCache.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/ChunkedBuffer.cpp --- a/Core/ChunkedBuffer.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/ChunkedBuffer.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/ChunkedBuffer.h --- a/Core/ChunkedBuffer.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/ChunkedBuffer.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/Compression/BufferCompressor.cpp --- a/Core/Compression/BufferCompressor.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/Compression/BufferCompressor.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/Compression/BufferCompressor.h --- a/Core/Compression/BufferCompressor.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/Compression/BufferCompressor.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/Compression/HierarchicalZipWriter.cpp --- a/Core/Compression/HierarchicalZipWriter.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/Compression/HierarchicalZipWriter.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/Compression/HierarchicalZipWriter.h --- a/Core/Compression/HierarchicalZipWriter.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/Compression/HierarchicalZipWriter.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -114,6 +114,16 @@ return writer_.GetCompressionLevel(); } + void SetAppendToExisting(bool append) + { + writer_.SetAppendToExisting(append); + } + + bool IsAppendToExisting() const + { + return writer_.IsAppendToExisting(); + } + void OpenFile(const char* name); void OpenDirectory(const char* name); diff -r 178de5edc0a8 -r f7966e9950e4 Core/Compression/ZipWriter.cpp --- a/Core/Compression/ZipWriter.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/Compression/ZipWriter.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -38,10 +38,11 @@ #include "ZipWriter.h" -#include "../../Resources/ThirdParty/minizip/zip.h" +#include +#include #include -#include +#include "../../Resources/ThirdParty/minizip/zip.h" #include "../OrthancException.h" @@ -77,15 +78,19 @@ struct ZipWriter::PImpl { zipFile file_; + + PImpl() : file_(NULL) + { + } }; - ZipWriter::ZipWriter() : pimpl_(new PImpl) + ZipWriter::ZipWriter() : + pimpl_(new PImpl), + isZip64_(false), + hasFileInZip_(false), + append_(false), + compressionLevel_(6) { - compressionLevel_ = 6; - hasFileInZip_ = false; - isZip64_ = false; - - pimpl_->file_ = NULL; } ZipWriter::~ZipWriter() @@ -122,13 +127,20 @@ hasFileInZip_ = false; + int mode = APPEND_STATUS_CREATE; + if (append_ && + boost::filesystem::exists(path_)) + { + mode = APPEND_STATUS_ADDINZIP; + } + if (isZip64_) { - pimpl_->file_ = zipOpen64(path_.c_str(), APPEND_STATUS_CREATE); + pimpl_->file_ = zipOpen64(path_.c_str(), mode); } else { - pimpl_->file_ = zipOpen(path_.c_str(), APPEND_STATUS_CREATE); + pimpl_->file_ = zipOpen(path_.c_str(), mode); } if (!pimpl_->file_) @@ -230,4 +242,13 @@ length -= bytes; } } + + + void ZipWriter::SetAppendToExisting(bool append) + { + Close(); + append_ = append; + } + + } diff -r 178de5edc0a8 -r f7966e9950e4 Core/Compression/ZipWriter.h --- a/Core/Compression/ZipWriter.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/Compression/ZipWriter.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -50,6 +50,7 @@ bool isZip64_; bool hasFileInZip_; + bool append_; uint8_t compressionLevel_; std::string path_; @@ -71,6 +72,13 @@ { return compressionLevel_; } + + void SetAppendToExisting(bool append); + + bool IsAppendToExisting() const + { + return append_; + } void Open(); diff -r 178de5edc0a8 -r f7966e9950e4 Core/Compression/ZlibCompressor.cpp --- a/Core/Compression/ZlibCompressor.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/Compression/ZlibCompressor.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/Compression/ZlibCompressor.h --- a/Core/Compression/ZlibCompressor.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/Compression/ZlibCompressor.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/DicomFormat/DicomArray.cpp --- a/Core/DicomFormat/DicomArray.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/DicomFormat/DicomArray.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/DicomFormat/DicomArray.h --- a/Core/DicomFormat/DicomArray.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/DicomFormat/DicomArray.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/DicomFormat/DicomElement.h --- a/Core/DicomFormat/DicomElement.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/DicomFormat/DicomElement.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/DicomFormat/DicomImageInformation.cpp --- a/Core/DicomFormat/DicomImageInformation.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/DicomFormat/DicomImageInformation.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/DicomFormat/DicomImageInformation.h --- a/Core/DicomFormat/DicomImageInformation.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/DicomFormat/DicomImageInformation.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/DicomFormat/DicomInstanceHasher.cpp --- a/Core/DicomFormat/DicomInstanceHasher.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/DicomFormat/DicomInstanceHasher.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -48,8 +48,7 @@ seriesUid_ = seriesUid; instanceUid_ = instanceUid; - if (patientId_.size() == 0 || - studyUid_.size() == 0 || + if (studyUid_.size() == 0 || seriesUid_.size() == 0 || instanceUid_.size() == 0) { @@ -59,7 +58,9 @@ DicomInstanceHasher::DicomInstanceHasher(const DicomMap& instance) { - Setup(instance.GetValue(DICOM_TAG_PATIENT_ID).AsString(), + const DicomValue* patientId = instance.TestAndGetValue(DICOM_TAG_PATIENT_ID); + + Setup(patientId == NULL ? "" : patientId->AsString(), instance.GetValue(DICOM_TAG_STUDY_INSTANCE_UID).AsString(), instance.GetValue(DICOM_TAG_SERIES_INSTANCE_UID).AsString(), instance.GetValue(DICOM_TAG_SOP_INSTANCE_UID).AsString()); diff -r 178de5edc0a8 -r f7966e9950e4 Core/DicomFormat/DicomInstanceHasher.h --- a/Core/DicomFormat/DicomInstanceHasher.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/DicomFormat/DicomInstanceHasher.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/DicomFormat/DicomIntegerPixelAccessor.cpp --- a/Core/DicomFormat/DicomIntegerPixelAccessor.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/DicomFormat/DicomIntegerPixelAccessor.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/DicomFormat/DicomIntegerPixelAccessor.h --- a/Core/DicomFormat/DicomIntegerPixelAccessor.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/DicomFormat/DicomIntegerPixelAccessor.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/DicomFormat/DicomMap.cpp --- a/Core/DicomFormat/DicomMap.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/DicomFormat/DicomMap.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/DicomFormat/DicomMap.h --- a/Core/DicomFormat/DicomMap.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/DicomFormat/DicomMap.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -125,11 +125,13 @@ const DicomValue& GetValue(const DicomTag& tag) const; + // DO NOT delete the returned value! const DicomValue* TestAndGetValue(uint16_t group, uint16_t element) const { return TestAndGetValue(DicomTag(group, element)); } + // DO NOT delete the returned value! const DicomValue* TestAndGetValue(const DicomTag& tag) const; void Remove(const DicomTag& tag); diff -r 178de5edc0a8 -r f7966e9950e4 Core/DicomFormat/DicomNullValue.h --- a/Core/DicomFormat/DicomNullValue.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/DicomFormat/DicomNullValue.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/DicomFormat/DicomString.h --- a/Core/DicomFormat/DicomString.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/DicomFormat/DicomString.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/DicomFormat/DicomTag.cpp --- a/Core/DicomFormat/DicomTag.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/DicomFormat/DicomTag.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -119,14 +119,14 @@ void DicomTag::GetTagsForModule(std::set& target, - ResourceType module) + DicomModule module) { // REFERENCE: 11_03pu.pdf, DICOM PS 3.3 2011 - Information Object Definitions target.clear(); switch (module) { - case ResourceType_Patient: + case DicomModule_Patient: // This is Table C.7-1 "Patient Module Attributes" (p. 373) target.insert(DicomTag(0x0010, 0x0010)); // Patient's name target.insert(DicomTag(0x0010, 0x0020)); // Patient ID @@ -156,7 +156,7 @@ target.insert(DicomTag(0x0010, 0x0024)); // Issuer of Patient ID qualifiers sequence break; - case ResourceType_Study: + case DicomModule_Study: // This is Table C.7-3 "General Study Module Attributes" (p. 378) target.insert(DicomTag(0x0020, 0x000d)); // Study instance UID target.insert(DicomTag(0x0008, 0x0020)); // Study date @@ -177,7 +177,7 @@ target.insert(DicomTag(0x0040, 0x1012)); // Reason for performed procedure code sequence break; - case ResourceType_Series: + case DicomModule_Series: // This is Table C.7-5 "General Series Module Attributes" (p. 385) target.insert(DicomTag(0x0008, 0x0060)); // Modality target.insert(DicomTag(0x0020, 0x000e)); // Series Instance UID @@ -210,7 +210,7 @@ target.insert(DicomTag(0x0040, 0x0280)); // Comments on the Performed Procedure Step break; - case ResourceType_Instance: + case DicomModule_Instance: // This is Table C.12-1 "SOP Common Module Attributes" (p. 1207) target.insert(DicomTag(0x0008, 0x0016)); // SOP Class UID target.insert(DicomTag(0x0008, 0x0018)); // SOP Instance UID diff -r 178de5edc0a8 -r f7966e9950e4 Core/DicomFormat/DicomTag.h --- a/Core/DicomFormat/DicomTag.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/DicomFormat/DicomTag.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -85,7 +85,7 @@ friend std::ostream& operator<< (std::ostream& o, const DicomTag& tag); static void GetTagsForModule(std::set& target, - ResourceType module); + DicomModule module); bool IsIdentifier() const; }; @@ -109,10 +109,11 @@ static const DicomTag DICOM_TAG_PATIENT_NAME(0x0010, 0x0010); - // The following is used for "modify" operations + // The following is used for "modify/anonymize" operations static const DicomTag DICOM_TAG_SOP_CLASS_UID(0x0008, 0x0016); static const DicomTag DICOM_TAG_MEDIA_STORAGE_SOP_CLASS_UID(0x0002, 0x0002); static const DicomTag DICOM_TAG_MEDIA_STORAGE_SOP_INSTANCE_UID(0x0002, 0x0003); + static const DicomTag DICOM_TAG_DEIDENTIFICATION_METHOD(0x0012, 0x0063); // DICOM tags used for fMRI (thanks to Will Ryder) static const DicomTag DICOM_TAG_NUMBER_OF_TEMPORAL_POSITIONS(0x0020, 0x0105); diff -r 178de5edc0a8 -r f7966e9950e4 Core/DicomFormat/DicomValue.h --- a/Core/DicomFormat/DicomValue.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/DicomFormat/DicomValue.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/EnumerationDictionary.h --- a/Core/EnumerationDictionary.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/EnumerationDictionary.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/Enumerations.cpp --- a/Core/Enumerations.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/Enumerations.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/Enumerations.h --- a/Core/Enumerations.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/Enumerations.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -58,6 +58,7 @@ ErrorCode_BadRequest, ErrorCode_NetworkProtocol, ErrorCode_SystemCommand, + ErrorCode_Database, // Specific error codes ErrorCode_UriSyntax, @@ -273,6 +274,15 @@ PhotometricInterpretation_Unknown }; + enum DicomModule + { + DicomModule_Patient, + DicomModule_Study, + DicomModule_Series, + DicomModule_Instance, + DicomModule_Image + }; + /** * WARNING: Do not change the explicit values in the enumerations diff -r 178de5edc0a8 -r f7966e9950e4 Core/FileStorage/CompressedFileStorageAccessor.cpp --- a/Core/FileStorage/CompressedFileStorageAccessor.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/FileStorage/CompressedFileStorageAccessor.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/FileStorage/CompressedFileStorageAccessor.h --- a/Core/FileStorage/CompressedFileStorageAccessor.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/FileStorage/CompressedFileStorageAccessor.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/FileStorage/FileInfo.h --- a/Core/FileStorage/FileInfo.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/FileStorage/FileInfo.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/FileStorage/FileStorageAccessor.cpp --- a/Core/FileStorage/FileStorageAccessor.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/FileStorage/FileStorageAccessor.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/FileStorage/FileStorageAccessor.h --- a/Core/FileStorage/FileStorageAccessor.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/FileStorage/FileStorageAccessor.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/FileStorage/FilesystemStorage.cpp --- a/Core/FileStorage/FilesystemStorage.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/FileStorage/FilesystemStorage.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -139,7 +139,7 @@ void FilesystemStorage::Read(std::string& content, const std::string& uuid, - FileContentType /*type*/) const + FileContentType /*type*/) { content.clear(); Toolbox::ReadFile(content, GetPath(uuid).string()); diff -r 178de5edc0a8 -r f7966e9950e4 Core/FileStorage/FilesystemStorage.h --- a/Core/FileStorage/FilesystemStorage.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/FileStorage/FilesystemStorage.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -60,7 +60,7 @@ virtual void Read(std::string& content, const std::string& uuid, - FileContentType type) const; + FileContentType type); virtual void Remove(const std::string& uuid, FileContentType type); diff -r 178de5edc0a8 -r f7966e9950e4 Core/FileStorage/IStorageArea.h --- a/Core/FileStorage/IStorageArea.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/FileStorage/IStorageArea.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -52,7 +52,7 @@ virtual void Read(std::string& content, const std::string& uuid, - FileContentType type) const = 0; + FileContentType type) = 0; virtual void Remove(const std::string& uuid, FileContentType type) = 0; diff -r 178de5edc0a8 -r f7966e9950e4 Core/FileStorage/StorageAccessor.cpp --- a/Core/FileStorage/StorageAccessor.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/FileStorage/StorageAccessor.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/FileStorage/StorageAccessor.h --- a/Core/FileStorage/StorageAccessor.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/FileStorage/StorageAccessor.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/HttpClient.cpp --- a/Core/HttpClient.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/HttpClient.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -171,6 +171,7 @@ CheckCode(curl_easy_setopt(pimpl_->curl_, CURLOPT_CUSTOMREQUEST, NULL)); CheckCode(curl_easy_setopt(pimpl_->curl_, CURLOPT_POSTFIELDS, NULL)); CheckCode(curl_easy_setopt(pimpl_->curl_, CURLOPT_POSTFIELDSIZE, 0)); + CheckCode(curl_easy_setopt(pimpl_->curl_, CURLOPT_PROXY, NULL)); // Set timeouts if (timeout_ <= 0) @@ -189,6 +190,11 @@ CheckCode(curl_easy_setopt(pimpl_->curl_, CURLOPT_USERPWD, credentials_.c_str())); } + if (proxy_.size() != 0) + { + CheckCode(curl_easy_setopt(pimpl_->curl_, CURLOPT_PROXY, proxy_.c_str())); + } + switch (method_) { case HttpMethod_Get: diff -r 178de5edc0a8 -r f7966e9950e4 Core/HttpClient.h --- a/Core/HttpClient.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/HttpClient.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -53,6 +53,7 @@ std::string postData_; bool isVerbose_; long timeout_; + std::string proxy_; void Setup(); @@ -134,6 +135,11 @@ void SetCredentials(const char* username, const char* password); + void SetProxy(const std::string& proxy) + { + proxy_ = proxy; + } + static void GlobalInitialize(); static void GlobalFinalize(); diff -r 178de5edc0a8 -r f7966e9950e4 Core/HttpServer/BufferHttpSender.h --- a/Core/HttpServer/BufferHttpSender.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/HttpServer/BufferHttpSender.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/HttpServer/EmbeddedResourceHttpHandler.cpp --- a/Core/HttpServer/EmbeddedResourceHttpHandler.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/HttpServer/EmbeddedResourceHttpHandler.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/HttpServer/EmbeddedResourceHttpHandler.h --- a/Core/HttpServer/EmbeddedResourceHttpHandler.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/HttpServer/EmbeddedResourceHttpHandler.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/HttpServer/FilesystemHttpHandler.cpp --- a/Core/HttpServer/FilesystemHttpHandler.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/HttpServer/FilesystemHttpHandler.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/HttpServer/FilesystemHttpHandler.h --- a/Core/HttpServer/FilesystemHttpHandler.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/HttpServer/FilesystemHttpHandler.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/HttpServer/FilesystemHttpSender.cpp --- a/Core/HttpServer/FilesystemHttpSender.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/HttpServer/FilesystemHttpSender.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/HttpServer/FilesystemHttpSender.h --- a/Core/HttpServer/FilesystemHttpSender.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/HttpServer/FilesystemHttpSender.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/HttpServer/HttpFileSender.cpp --- a/Core/HttpServer/HttpFileSender.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/HttpServer/HttpFileSender.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/HttpServer/HttpFileSender.h --- a/Core/HttpServer/HttpFileSender.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/HttpServer/HttpFileSender.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/HttpServer/HttpHandler.cpp --- a/Core/HttpServer/HttpHandler.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/HttpServer/HttpHandler.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/HttpServer/HttpHandler.h --- a/Core/HttpServer/HttpHandler.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/HttpServer/HttpHandler.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/HttpServer/HttpOutput.cpp --- a/Core/HttpServer/HttpOutput.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/HttpServer/HttpOutput.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/HttpServer/HttpOutput.h --- a/Core/HttpServer/HttpOutput.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/HttpServer/HttpOutput.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/HttpServer/IHttpOutputStream.h --- a/Core/HttpServer/IHttpOutputStream.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/HttpServer/IHttpOutputStream.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/HttpServer/MongooseServer.cpp --- a/Core/HttpServer/MongooseServer.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/HttpServer/MongooseServer.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -418,7 +418,8 @@ if (auth != headers.end()) { std::string s = auth->second; - if (s.substr(0, 6) == "Basic ") + if (s.size() > 6 && + s.substr(0, 6) == "Basic ") { std::string b64 = s.substr(6); granted = that.IsValidBasicHttpAuthentication(b64); @@ -439,7 +440,8 @@ } std::string s = auth->second; - if (s.substr(0, 6) != "Basic ") + if (s.size() <= 6 || + s.substr(0, 6) != "Basic ") { return ""; } diff -r 178de5edc0a8 -r f7966e9950e4 Core/HttpServer/MongooseServer.h --- a/Core/HttpServer/MongooseServer.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/HttpServer/MongooseServer.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/ICommand.h --- a/Core/ICommand.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/ICommand.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/IDynamicObject.h --- a/Core/IDynamicObject.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/IDynamicObject.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/ImageFormats/ImageAccessor.cpp --- a/Core/ImageFormats/ImageAccessor.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/ImageFormats/ImageAccessor.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/ImageFormats/ImageAccessor.h --- a/Core/ImageFormats/ImageAccessor.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/ImageFormats/ImageAccessor.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/ImageFormats/ImageBuffer.cpp --- a/Core/ImageFormats/ImageBuffer.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/ImageFormats/ImageBuffer.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/ImageFormats/ImageBuffer.h --- a/Core/ImageFormats/ImageBuffer.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/ImageFormats/ImageBuffer.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/ImageFormats/ImageProcessing.cpp --- a/Core/ImageFormats/ImageProcessing.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/ImageFormats/ImageProcessing.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/ImageFormats/ImageProcessing.h --- a/Core/ImageFormats/ImageProcessing.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/ImageFormats/ImageProcessing.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/ImageFormats/PngReader.cpp --- a/Core/ImageFormats/PngReader.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/ImageFormats/PngReader.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/ImageFormats/PngReader.h --- a/Core/ImageFormats/PngReader.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/ImageFormats/PngReader.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/ImageFormats/PngWriter.cpp --- a/Core/ImageFormats/PngWriter.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/ImageFormats/PngWriter.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/ImageFormats/PngWriter.h --- a/Core/ImageFormats/PngWriter.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/ImageFormats/PngWriter.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/Lua/LuaContext.cpp --- a/Core/Lua/LuaContext.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/Lua/LuaContext.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/Lua/LuaContext.h --- a/Core/Lua/LuaContext.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/Lua/LuaContext.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -102,5 +102,10 @@ { httpClient_.SetCredentials(username, password); } + + void SetHttpProxy(const std::string& proxy) + { + httpClient_.SetProxy(proxy); + } }; } diff -r 178de5edc0a8 -r f7966e9950e4 Core/Lua/LuaException.h --- a/Core/Lua/LuaException.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/Lua/LuaException.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/Lua/LuaFunctionCall.cpp --- a/Core/Lua/LuaFunctionCall.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/Lua/LuaFunctionCall.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/Lua/LuaFunctionCall.h --- a/Core/Lua/LuaFunctionCall.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/Lua/LuaFunctionCall.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/MultiThreading/ArrayFilledByThreads.cpp --- a/Core/MultiThreading/ArrayFilledByThreads.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/MultiThreading/ArrayFilledByThreads.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/MultiThreading/BagOfRunnablesBySteps.cpp --- a/Core/MultiThreading/BagOfRunnablesBySteps.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/MultiThreading/BagOfRunnablesBySteps.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/MultiThreading/BagOfRunnablesBySteps.h --- a/Core/MultiThreading/BagOfRunnablesBySteps.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/MultiThreading/BagOfRunnablesBySteps.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/MultiThreading/ILockable.h --- a/Core/MultiThreading/ILockable.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/MultiThreading/ILockable.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/MultiThreading/IRunnableBySteps.h --- a/Core/MultiThreading/IRunnableBySteps.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/MultiThreading/IRunnableBySteps.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/MultiThreading/Locker.h --- a/Core/MultiThreading/Locker.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/MultiThreading/Locker.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/MultiThreading/Mutex.cpp --- a/Core/MultiThreading/Mutex.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/MultiThreading/Mutex.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/MultiThreading/Mutex.h --- a/Core/MultiThreading/Mutex.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/MultiThreading/Mutex.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/MultiThreading/ReaderWriterLock.cpp --- a/Core/MultiThreading/ReaderWriterLock.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/MultiThreading/ReaderWriterLock.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/MultiThreading/ReaderWriterLock.h --- a/Core/MultiThreading/ReaderWriterLock.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/MultiThreading/ReaderWriterLock.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/MultiThreading/Semaphore.cpp --- a/Core/MultiThreading/Semaphore.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/MultiThreading/Semaphore.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/MultiThreading/Semaphore.h --- a/Core/MultiThreading/Semaphore.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/MultiThreading/Semaphore.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/MultiThreading/SharedMessageQueue.cpp --- a/Core/MultiThreading/SharedMessageQueue.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/MultiThreading/SharedMessageQueue.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -33,11 +33,40 @@ #include "../PrecompiledHeaders.h" #include "SharedMessageQueue.h" + + +/** + * FIFO (queue): + * + * back front + * +--+--+--+--+--+--+--+--+--+--+--+ + * Enqueue -> | | | | | | | | | | | | + * | | | | | | | | | | | | -> Dequeue + * +--+--+--+--+--+--+--+--+--+--+--+ + * ^ + * | + * Make room here + * + * + * LIFO (stack): + * + * back front + * +--+--+--+--+--+--+--+--+--+--+--+ + * | | | | | | | | | | | | <- Enqueue + * | | | | | | | | | | | | -> Dequeue + * +--+--+--+--+--+--+--+--+--+--+--+ + * ^ + * | + * Make room here + **/ + + namespace Orthanc { - SharedMessageQueue::SharedMessageQueue(unsigned int maxSize) + SharedMessageQueue::SharedMessageQueue(unsigned int maxSize) : + isFifo_(true), + maxSize_(maxSize) { - maxSize_ = maxSize; } @@ -56,12 +85,31 @@ if (maxSize_ != 0 && queue_.size() > maxSize_) { - // Too many elements in the queue: First remove the oldest - delete queue_.front(); - queue_.pop_front(); + if (isFifo_) + { + // Too many elements in the queue: Make room + delete queue_.front(); + queue_.pop_front(); + } + else + { + // Too many elements in the stack: Make room + delete queue_.back(); + queue_.pop_back(); + } } - queue_.push_back(message); + if (isFifo_) + { + // Queue policy (FIFO) + queue_.push_back(message); + } + else + { + // Stack policy (LIFO) + queue_.push_front(message); + } + elementAvailable_.notify_one(); } @@ -124,4 +172,17 @@ return true; } + + + void SharedMessageQueue::SetFifoPolicy() + { + boost::mutex::scoped_lock lock(mutex_); + isFifo_ = true; + } + + void SharedMessageQueue::SetLifoPolicy() + { + boost::mutex::scoped_lock lock(mutex_); + isFifo_ = false; + } } diff -r 178de5edc0a8 -r f7966e9950e4 Core/MultiThreading/SharedMessageQueue.h --- a/Core/MultiThreading/SharedMessageQueue.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/MultiThreading/SharedMessageQueue.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -45,6 +45,7 @@ private: typedef std::list Queue; + bool isFifo_; unsigned int maxSize_; Queue queue_; boost::mutex mutex_; @@ -63,5 +64,19 @@ IDynamicObject* Dequeue(int32_t millisecondsTimeout); bool WaitEmpty(int32_t millisecondsTimeout); + + bool IsFifoPolicy() const + { + return isFifo_; + } + + bool IsLifoPolicy() const + { + return !isFifo_; + } + + void SetFifoPolicy(); + + void SetLifoPolicy(); }; } diff -r 178de5edc0a8 -r f7966e9950e4 Core/MultiThreading/ThreadedCommandProcessor.cpp --- a/Core/MultiThreading/ThreadedCommandProcessor.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/MultiThreading/ThreadedCommandProcessor.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/MultiThreading/ThreadedCommandProcessor.h --- a/Core/MultiThreading/ThreadedCommandProcessor.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/MultiThreading/ThreadedCommandProcessor.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/OrthancException.cpp --- a/Core/OrthancException.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/OrthancException.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -130,6 +130,9 @@ case ErrorCode_Plugin: return "Error encountered inside a plugin"; + case ErrorCode_Database: + return "Error with the database engine"; + case ErrorCode_Custom: default: return "???"; diff -r 178de5edc0a8 -r f7966e9950e4 Core/OrthancException.h --- a/Core/OrthancException.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/OrthancException.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/PrecompiledHeaders.cpp --- a/Core/PrecompiledHeaders.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/PrecompiledHeaders.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/PrecompiledHeaders.h --- a/Core/PrecompiledHeaders.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/PrecompiledHeaders.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/RestApi/RestApi.cpp --- a/Core/RestApi/RestApi.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/RestApi/RestApi.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/RestApi/RestApi.h --- a/Core/RestApi/RestApi.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/RestApi/RestApi.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/RestApi/RestApiCall.cpp --- a/Core/RestApi/RestApiCall.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/RestApi/RestApiCall.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/RestApi/RestApiCall.h --- a/Core/RestApi/RestApiCall.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/RestApi/RestApiCall.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/RestApi/RestApiDeleteCall.h --- a/Core/RestApi/RestApiDeleteCall.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/RestApi/RestApiDeleteCall.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/RestApi/RestApiGetCall.cpp --- a/Core/RestApi/RestApiGetCall.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/RestApi/RestApiGetCall.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/RestApi/RestApiGetCall.h --- a/Core/RestApi/RestApiGetCall.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/RestApi/RestApiGetCall.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/RestApi/RestApiHierarchy.cpp --- a/Core/RestApi/RestApiHierarchy.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/RestApi/RestApiHierarchy.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -159,7 +159,7 @@ void RestApiHierarchy::DeleteChildren(Children& children) { for (Children::iterator it = children.begin(); - it != children.end(); it++) + it != children.end(); ++it) { delete it->second; } @@ -238,7 +238,7 @@ // Try and go down in the hierarchy, using wildcard rules for children for (child = wildcardChildren_.begin(); - child != wildcardChildren_.end(); child++) + child != wildcardChildren_.end(); ++child) { HttpHandler::Arguments subComponents = components; subComponents[child->first] = uri[level]; @@ -276,7 +276,7 @@ bool RestApiHierarchy::CanGenerateDirectory() const { return (universalHandlers_.IsEmpty() && - wildcardChildren_.size() == 0); + wildcardChildren_.empty()); } @@ -291,7 +291,7 @@ result = Json::arrayValue; for (Children::const_iterator it = children_.begin(); - it != children_.end(); it++) + it != children_.end(); ++it) { result.append(it->first); } @@ -314,7 +314,7 @@ } for (child = wildcardChildren_.begin(); - child != wildcardChildren_.end(); child++) + child != wildcardChildren_.end(); ++child) { if (child->second->GetDirectory(result, uri, level + 1)) { @@ -388,13 +388,13 @@ target = s;*/ for (Children::const_iterator it = children_.begin(); - it != children_.end(); it++) + it != children_.end(); ++it) { it->second->CreateSiteMap(target[it->first]); } for (Children::const_iterator it = wildcardChildren_.begin(); - it != wildcardChildren_.end(); it++) + it != wildcardChildren_.end(); ++it) { it->second->CreateSiteMap(target["<" + it->first + ">"]); } diff -r 178de5edc0a8 -r f7966e9950e4 Core/RestApi/RestApiHierarchy.h --- a/Core/RestApi/RestApiHierarchy.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/RestApi/RestApiHierarchy.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/RestApi/RestApiOutput.cpp --- a/Core/RestApi/RestApiOutput.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/RestApi/RestApiOutput.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/RestApi/RestApiOutput.h --- a/Core/RestApi/RestApiOutput.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/RestApi/RestApiOutput.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/RestApi/RestApiPath.cpp --- a/Core/RestApi/RestApiPath.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/RestApi/RestApiPath.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/RestApi/RestApiPath.h --- a/Core/RestApi/RestApiPath.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/RestApi/RestApiPath.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/RestApi/RestApiPostCall.h --- a/Core/RestApi/RestApiPostCall.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/RestApi/RestApiPostCall.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/RestApi/RestApiPutCall.h --- a/Core/RestApi/RestApiPutCall.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/RestApi/RestApiPutCall.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/SQLite/Connection.cpp --- a/Core/SQLite/Connection.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/SQLite/Connection.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,8 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * + * Copyright (C) 2012-2015 Sebastien Jodogne , + * Medical Physics Department, CHU of Liege, Belgium * * Copyright (c) 2012 The Chromium Authors. All rights reserved. * @@ -34,15 +35,21 @@ **/ +#if ORTHANC_SQLITE_STANDALONE != 1 #include "../PrecompiledHeaders.h" +#endif + #include "Connection.h" +#include "OrthancSQLiteException.h" #include #include #include #include +#if ORTHANC_SQLITE_STANDALONE != 1 #include +#endif namespace Orthanc @@ -67,7 +74,7 @@ { if (!db_) { - throw OrthancException("SQLite: The database is not opened"); + throw OrthancSQLiteException("SQLite: The database is not opened"); } } @@ -75,7 +82,7 @@ { if (db_) { - throw OrthancException("SQLite: Connection is already open"); + throw OrthancSQLiteException("SQLite: Connection is already open"); } int err = sqlite3_open(path.c_str(), &db_); @@ -83,7 +90,7 @@ { Close(); db_ = NULL; - throw OrthancException("SQLite: Unable to open the database"); + throw OrthancSQLiteException("SQLite: Unable to open the database"); } // Execute PRAGMAs at this point @@ -129,7 +136,7 @@ { if (i->second->GetReferenceCount() >= 1) { - throw OrthancException("SQLite: This cached statement is already being referred to"); + throw OrthancSQLiteException("SQLite: This cached statement is already being referred to"); } return *i->second; @@ -145,13 +152,16 @@ bool Connection::Execute(const char* sql) { +#if ORTHANC_SQLITE_STANDALONE != 1 VLOG(1) << "SQLite::Connection::Execute " << sql; +#endif + CheckIsOpen(); int error = sqlite3_exec(db_, sql, NULL, NULL, NULL); if (error == SQLITE_ERROR) { - throw OrthancException("SQLite Execute error: " + std::string(sqlite3_errmsg(db_))); + throw OrthancSQLiteException("SQLite Execute error: " + std::string(sqlite3_errmsg(db_))); } else { @@ -272,7 +282,7 @@ { if (!transactionNesting_) { - throw OrthancException("Rolling back a nonexistent transaction"); + throw OrthancSQLiteException("Rolling back a nonexistent transaction"); } transactionNesting_--; @@ -291,7 +301,7 @@ { if (!transactionNesting_) { - throw OrthancException("Committing a nonexistent transaction"); + throw OrthancSQLiteException("Committing a nonexistent transaction"); } transactionNesting_--; @@ -359,7 +369,7 @@ if (err != SQLITE_OK) { delete func; - throw OrthancException("SQLite: Unable to register a function"); + throw OrthancSQLiteException("SQLite: Unable to register a function"); } return func; @@ -368,12 +378,15 @@ void Connection::FlushToDisk() { +#if ORTHANC_SQLITE_STANDALONE != 1 VLOG(1) << "SQLite::Connection::FlushToDisk"; +#endif + int err = sqlite3_wal_checkpoint(db_, NULL); if (err != SQLITE_OK) { - throw OrthancException("SQLite: Unable to flush the database"); + throw OrthancSQLiteException("SQLite: Unable to flush the database"); } } } diff -r 178de5edc0a8 -r f7966e9950e4 Core/SQLite/Connection.h --- a/Core/SQLite/Connection.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/SQLite/Connection.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,8 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * + * Copyright (C) 2012-2015 Sebastien Jodogne , + * Medical Physics Department, CHU of Liege, Belgium * * Copyright (c) 2012 The Chromium Authors. All rights reserved. * @@ -40,7 +41,6 @@ #include "IScalarFunction.h" #include -#include #include struct sqlite3; @@ -52,7 +52,7 @@ { namespace SQLite { - class Connection : boost::noncopyable + class Connection : NonCopyable { friend class Statement; friend class Transaction; diff -r 178de5edc0a8 -r f7966e9950e4 Core/SQLite/FunctionContext.cpp --- a/Core/SQLite/FunctionContext.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/SQLite/FunctionContext.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,8 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * + * Copyright (C) 2012-2015 Sebastien Jodogne , + * Medical Physics Department, CHU of Liege, Belgium * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -31,8 +32,12 @@ **/ +#if ORTHANC_SQLITE_STANDALONE != 1 #include "../PrecompiledHeaders.h" +#endif + #include "FunctionContext.h" +#include "OrthancSQLiteException.h" #include @@ -57,7 +62,7 @@ { if (index >= argc_) { - throw OrthancException(ErrorCode_ParameterOutOfRange); + throw OrthancSQLiteException("Parameter out of range"); } } diff -r 178de5edc0a8 -r f7966e9950e4 Core/SQLite/FunctionContext.h --- a/Core/SQLite/FunctionContext.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/SQLite/FunctionContext.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,8 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * + * Copyright (C) 2012-2015 Sebastien Jodogne , + * Medical Physics Department, CHU of Liege, Belgium * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -33,8 +34,6 @@ #pragma once -#include - #include "Statement.h" struct sqlite3_context; @@ -44,7 +43,7 @@ { namespace SQLite { - class FunctionContext : public boost::noncopyable + class FunctionContext : public NonCopyable { friend class Connection; diff -r 178de5edc0a8 -r f7966e9950e4 Core/SQLite/IScalarFunction.h --- a/Core/SQLite/IScalarFunction.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/SQLite/IScalarFunction.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,8 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * + * Copyright (C) 2012-2015 Sebastien Jodogne , + * Medical Physics Department, CHU of Liege, Belgium * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -33,13 +34,14 @@ #pragma once +#include "NonCopyable.h" #include "FunctionContext.h" namespace Orthanc { namespace SQLite { - class IScalarFunction : public boost::noncopyable + class IScalarFunction : public NonCopyable { public: virtual ~IScalarFunction() diff -r 178de5edc0a8 -r f7966e9950e4 Core/SQLite/ITransaction.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Core/SQLite/ITransaction.h Wed Feb 11 10:32:14 2015 +0100 @@ -0,0 +1,66 @@ +/** + * Orthanc - A Lightweight, RESTful DICOM Store + * + * Copyright (C) 2012-2015 Sebastien Jodogne , + * Medical Physics Department, CHU of Liege, Belgium + * + * Copyright (c) 2012 The Chromium Authors. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc., the name of the CHU of Liege, + * nor the names of its contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + **/ + + +#pragma once + +#include "NonCopyable.h" + +namespace Orthanc +{ + namespace SQLite + { + class ITransaction : public NonCopyable + { + public: + virtual ~ITransaction() + { + } + + // Begins the transaction. This uses the default sqlite "deferred" transaction + // type, which means that the DB lock is lazily acquired the next time the + // database is accessed, not in the begin transaction command. + virtual void Begin() = 0; + + // Rolls back the transaction. This will happen automatically if you do + // nothing when the transaction goes out of scope. + virtual void Rollback() = 0; + + // Commits the transaction, returning true on success. + virtual void Commit() = 0; + }; + } +} diff -r 178de5edc0a8 -r f7966e9950e4 Core/SQLite/NonCopyable.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Core/SQLite/NonCopyable.h Wed Feb 11 10:32:14 2015 +0100 @@ -0,0 +1,60 @@ +/** + * Orthanc - A Lightweight, RESTful DICOM Store + * + * Copyright (C) 2012-2015 Sebastien Jodogne , + * Medical Physics Department, CHU of Liege, Belgium + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc., the name of the CHU of Liege, + * nor the names of its contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + **/ + + +#pragma once + +namespace Orthanc +{ + namespace SQLite + { + // This class mimics "boost::noncopyable" + class NonCopyable + { + private: + NonCopyable(const NonCopyable&); + + NonCopyable& operator= (const NonCopyable&); + + protected: + NonCopyable() + { + } + + ~NonCopyable() + { + } + }; + } +} diff -r 178de5edc0a8 -r f7966e9950e4 Core/SQLite/OrthancSQLiteException.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Core/SQLite/OrthancSQLiteException.h Wed Feb 11 10:32:14 2015 +0100 @@ -0,0 +1,67 @@ +/** + * Orthanc - A Lightweight, RESTful DICOM Store + * + * Copyright (C) 2012-2015 Sebastien Jodogne , + * Medical Physics Department, CHU of Liege, Belgium + * + * Copyright (c) 2012 The Chromium Authors. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc., the name of the CHU of Liege, + * nor the names of its contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + **/ + + +#pragma once + + +#if ORTHANC_SQLITE_STANDALONE == 1 +#include + +namespace Orthanc +{ + namespace SQLite + { + class OrthancSQLiteException : public ::std::runtime_error + { + public: + OrthancSQLiteException(const std::string& what) : + ::std::runtime_error(what) + { + } + + OrthancSQLiteException(const char* what) : + ::std::runtime_error(what) + { + } + }; + } +} + +#else +# include "../OrthancException.h" +# define OrthancSQLiteException ::Orthanc::OrthancException +#endif diff -r 178de5edc0a8 -r f7966e9950e4 Core/SQLite/README.txt --- a/Core/SQLite/README.txt Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/SQLite/README.txt Wed Feb 11 10:32:14 2015 +0100 @@ -19,6 +19,17 @@ coding conventions. +Reuse in another software +========================= + +To use the Orthanc SQLite wrapper in another project than Orthanc, you +just have to define the "ORTHANC_SQLITE_STANDALONE" macro. + +All the C++ exceptions generated by the wrapper will be objects of the +class "::Orthanc::SQLite::OrthancSQLiteException", that derives from +the standard exception class "::std::runtime_error". + + Licensing ========= @@ -26,4 +37,4 @@ order to respect the original license of the code. It is pretty straightforward to extract the code from this folder and -to include it in another project. +to include it in another project. diff -r 178de5edc0a8 -r f7966e9950e4 Core/SQLite/Statement.cpp --- a/Core/SQLite/Statement.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/SQLite/Statement.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,8 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * + * Copyright (C) 2012-2015 Sebastien Jodogne , + * Medical Physics Department, CHU of Liege, Belgium * * Copyright (c) 2012 The Chromium Authors. All rights reserved. * @@ -34,16 +35,25 @@ **/ +#if ORTHANC_SQLITE_STANDALONE != 1 #include "../PrecompiledHeaders.h" +#endif + #include "Statement.h" - #include "Connection.h" -#include "../Toolbox.h" -#include #include #include +#include +#include + +#if ORTHANC_SQLITE_STANDALONE != 1 #include +#endif + +#if defined(_MSC_VER) +#define snprintf _snprintf +#endif namespace Orthanc { @@ -54,7 +64,9 @@ bool succeeded = (err == SQLITE_OK || err == SQLITE_ROW || err == SQLITE_DONE); if (!succeeded) { - throw OrthancException("SQLite error code " + boost::lexical_cast(err)); + char buffer[128]; + snprintf(buffer, sizeof(buffer) - 1, "SQLite error code %d", err); + throw OrthancSQLiteException(buffer); } return err; @@ -65,11 +77,13 @@ if (err == SQLITE_RANGE) { // Binding to a non-existent variable is evidence of a serious error. - throw OrthancException("Bind value out of range"); + throw OrthancSQLiteException("Bind value out of range"); } else if (err != SQLITE_OK) { - throw OrthancException("SQLite error code " + boost::lexical_cast(err)); + char buffer[128]; + snprintf(buffer, sizeof(buffer) - 1, "SQLite error code %d", err); + throw OrthancSQLiteException(buffer); } } @@ -108,13 +122,19 @@ bool Statement::Run() { +#if ORTHANC_SQLITE_STANDALONE != 1 VLOG(1) << "SQLite::Statement::Run " << sqlite3_sql(GetStatement()); +#endif + return CheckError(sqlite3_step(GetStatement())) == SQLITE_DONE; } bool Statement::Step() { +#if ORTHANC_SQLITE_STANDALONE != 1 VLOG(1) << "SQLite::Statement::Step " << sqlite3_sql(GetStatement()); +#endif + return CheckError(sqlite3_step(GetStatement())) == SQLITE_ROW; } @@ -206,7 +226,7 @@ ColumnType Statement::GetDeclaredColumnType(int col) const { std::string column_type(sqlite3_column_decltype(GetStatement(), col)); - Toolbox::ToLowerCase(column_type); + std::transform(column_type.begin(), column_type.end(), column_type.begin(), tolower); if (column_type == "integer") return COLUMN_TYPE_INTEGER; diff -r 178de5edc0a8 -r f7966e9950e4 Core/SQLite/Statement.h --- a/Core/SQLite/Statement.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/SQLite/Statement.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,8 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * + * Copyright (C) 2012-2015 Sebastien Jodogne , + * Medical Physics Department, CHU of Liege, Belgium * * Copyright (c) 2012 The Chromium Authors. All rights reserved. * @@ -36,13 +37,13 @@ #pragma once -#include "../OrthancException.h" +#include "NonCopyable.h" +#include "OrthancSQLiteException.h" #include "StatementId.h" #include "StatementReference.h" #include #include -#include #if ORTHANC_BUILD_UNIT_TESTS == 1 #include @@ -68,7 +69,7 @@ COLUMN_TYPE_NULL = 5 }; - class Statement : public boost::noncopyable + class Statement : public NonCopyable { friend class Connection; diff -r 178de5edc0a8 -r f7966e9950e4 Core/SQLite/StatementId.cpp --- a/Core/SQLite/StatementId.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/SQLite/StatementId.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,8 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * + * Copyright (C) 2012-2015 Sebastien Jodogne , + * Medical Physics Department, CHU of Liege, Belgium * * Copyright (c) 2012 The Chromium Authors. All rights reserved. * @@ -34,7 +35,10 @@ **/ +#if ORTHANC_SQLITE_STANDALONE != 1 #include "../PrecompiledHeaders.h" +#endif + #include "StatementId.h" #include diff -r 178de5edc0a8 -r f7966e9950e4 Core/SQLite/StatementId.h --- a/Core/SQLite/StatementId.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/SQLite/StatementId.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,8 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * + * Copyright (C) 2012-2015 Sebastien Jodogne , + * Medical Physics Department, CHU of Liege, Belgium * * Copyright (c) 2012 The Chromium Authors. All rights reserved. * diff -r 178de5edc0a8 -r f7966e9950e4 Core/SQLite/StatementReference.cpp --- a/Core/SQLite/StatementReference.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/SQLite/StatementReference.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,8 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * + * Copyright (C) 2012-2015 Sebastien Jodogne , + * Medical Physics Department, CHU of Liege, Belgium * * Copyright (c) 2012 The Chromium Authors. All rights reserved. * @@ -34,13 +35,18 @@ **/ +#if ORTHANC_SQLITE_STANDALONE != 1 #include "../PrecompiledHeaders.h" +#endif + #include "StatementReference.h" +#include "OrthancSQLiteException.h" -#include "../OrthancException.h" +#if ORTHANC_SQLITE_STANDALONE != 1 +#include +#endif #include -#include #include "sqlite3.h" namespace Orthanc @@ -65,7 +71,7 @@ { if (database == NULL || sql == NULL) { - throw OrthancException(ErrorCode_ParameterOutOfRange); + throw OrthancSQLiteException("Parameter out of range"); } root_ = NULL; @@ -74,7 +80,7 @@ int error = sqlite3_prepare_v2(database, sql, -1, &statement_, NULL); if (error != SQLITE_OK) { - throw OrthancException("SQLite: " + std::string(sqlite3_errmsg(database))); + throw OrthancSQLiteException("SQLite: " + std::string(sqlite3_errmsg(database))); } assert(IsRoot()); @@ -109,7 +115,9 @@ // an exception because: // http://www.parashift.com/c++-faq/dtors-shouldnt-throw.html +#if ORTHANC_SQLITE_STANDALONE != 1 LOG(ERROR) << "Bad value of the reference counter"; +#endif } else if (statement_ != NULL) { @@ -124,7 +132,9 @@ // an exception because: // http://www.parashift.com/c++-faq/dtors-shouldnt-throw.html +#if ORTHANC_SQLITE_STANDALONE != 1 LOG(ERROR) << "Bad value of the reference counter"; +#endif } else { diff -r 178de5edc0a8 -r f7966e9950e4 Core/SQLite/StatementReference.h --- a/Core/SQLite/StatementReference.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/SQLite/StatementReference.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,8 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * + * Copyright (C) 2012-2015 Sebastien Jodogne , + * Medical Physics Department, CHU of Liege, Belgium * * Copyright (c) 2012 The Chromium Authors. All rights reserved. * @@ -36,7 +37,8 @@ #pragma once -#include +#include "NonCopyable.h" + #include #include #include @@ -48,7 +50,7 @@ { namespace SQLite { - class StatementReference : boost::noncopyable + class StatementReference : NonCopyable { private: StatementReference* root_; // Only used for non-root nodes diff -r 178de5edc0a8 -r f7966e9950e4 Core/SQLite/Transaction.cpp --- a/Core/SQLite/Transaction.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/SQLite/Transaction.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,8 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * + * Copyright (C) 2012-2015 Sebastien Jodogne , + * Medical Physics Department, CHU of Liege, Belgium * * Copyright (c) 2012 The Chromium Authors. All rights reserved. * @@ -34,8 +35,12 @@ **/ +#if ORTHANC_SQLITE_STANDALONE != 1 #include "../PrecompiledHeaders.h" +#endif + #include "Transaction.h" +#include "OrthancSQLiteException.h" namespace Orthanc { @@ -59,13 +64,13 @@ { if (isOpen_) { - throw OrthancException("SQLite: Beginning a transaction twice!"); + throw OrthancSQLiteException("SQLite: Beginning a transaction twice!"); } isOpen_ = connection_.BeginTransaction(); if (!isOpen_) { - throw OrthancException("SQLite: Unable to create a transaction"); + throw OrthancSQLiteException("SQLite: Unable to create a transaction"); } } @@ -73,8 +78,8 @@ { if (!isOpen_) { - throw OrthancException("SQLite: Attempting to roll back a nonexistent transaction. " - "Did you remember to call Begin()?"); + throw OrthancSQLiteException("SQLite: Attempting to roll back a nonexistent transaction. " + "Did you remember to call Begin()?"); } isOpen_ = false; @@ -86,15 +91,15 @@ { if (!isOpen_) { - throw OrthancException("SQLite: Attempting to roll back a nonexistent transaction. " - "Did you remember to call Begin()?"); + throw OrthancSQLiteException("SQLite: Attempting to roll back a nonexistent transaction. " + "Did you remember to call Begin()?"); } isOpen_ = false; if (!connection_.CommitTransaction()) { - throw OrthancException("SQLite: Failure when committing the transaction"); + throw OrthancSQLiteException("SQLite: Failure when committing the transaction"); } } } diff -r 178de5edc0a8 -r f7966e9950e4 Core/SQLite/Transaction.h --- a/Core/SQLite/Transaction.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/SQLite/Transaction.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,8 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * + * Copyright (C) 2012-2015 Sebastien Jodogne , + * Medical Physics Department, CHU of Liege, Belgium * * Copyright (c) 2012 The Chromium Authors. All rights reserved. * @@ -37,12 +38,13 @@ #pragma once #include "Connection.h" +#include "ITransaction.h" namespace Orthanc { namespace SQLite { - class Transaction : public boost::noncopyable + class Transaction : public ITransaction { private: Connection& connection_; @@ -53,22 +55,17 @@ public: explicit Transaction(Connection& connection); - ~Transaction(); + + virtual ~Transaction(); // Returns true when there is a transaction that has been successfully begun. bool IsOpen() const { return isOpen_; } - // Begins the transaction. This uses the default sqlite "deferred" transaction - // type, which means that the DB lock is lazily acquired the next time the - // database is accessed, not in the begin transaction command. - void Begin(); + virtual void Begin(); - // Rolls back the transaction. This will happen automatically if you do - // nothing when the transaction goes out of scope. - void Rollback(); + virtual void Rollback(); - // Commits the transaction, returning true on success. - void Commit(); + virtual void Commit(); }; } } diff -r 178de5edc0a8 -r f7966e9950e4 Core/Toolbox.cpp --- a/Core/Toolbox.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/Toolbox.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/Toolbox.h --- a/Core/Toolbox.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/Toolbox.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/Uuid.cpp --- a/Core/Uuid.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/Uuid.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 Core/Uuid.h --- a/Core/Uuid.h Tue Nov 04 13:56:17 2014 +0100 +++ b/Core/Uuid.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 LinuxCompilation.txt --- a/LinuxCompilation.txt Tue Nov 04 13:56:17 2014 +0100 +++ b/LinuxCompilation.txt Wed Feb 11 10:32:14 2015 +0100 @@ -44,6 +44,8 @@ directory ("rm -rf ~/OrthancBuild") after installing this package, then run cmake again. +Note 3- To build the documentation, you will have to install doxyen. + Use system-wide libraries under Linux ===================================== @@ -58,6 +60,7 @@ # cmake -DCMAKE_BUILD_TYPE=Debug ~/Orthanc # make +Note that to build the documentation, you will have to install doxyen. However, on some Linux distributions, it is still required to download and static link against some third-party dependencies, e.g. when the diff -r 178de5edc0a8 -r f7966e9950e4 NEWS --- a/NEWS Tue Nov 04 13:56:17 2014 +0100 +++ b/NEWS Wed Feb 11 10:32:14 2015 +0100 @@ -1,10 +1,53 @@ Pending changes in the mainline =============================== +Major +----- + +* URIs to get all the parents of a given resource in a single REST call +* Instances without PatientID are now allowed +* Support of HTTP proxy to access Orthanc peers + +Minor +----- + +* Support of Tudor DICOM in Query/Retrieve +* More flexible "/modify" and "/anonymize" for single instance +* Access to called AET and remote AET from Lua scripts ("OnStoredInstance") +* Option "DicomAssociationCloseDelay" to set delay before closing DICOM association + +Plugins +------- + +* Introspection of plugins (cf. the "/plugins" URI) +* Plugins can access the command-line arguments used to launch Orthanc +* Plugins can extend Orthanc Explorer with custom JavaScript +* Plugins can get/set global properties to save their configuration +* Plugins can do REST calls to other plugins (cf. "xxxAfterPlugins()") +* Scan of folders for plugins + +Fixes +----- + +* Code refactorings +* Fix issue 25 (AET with underscore not allowed) +* Fix replacement and insertion of private DICOM tags + + +Version 0.8.5 (2014/11/04) +========================== + +General +------- + * Major speed-up thanks to a new database schema +* Plugins can monitor changes through callbacks * Download ZIP + DICOMDIR from Orthanc Explorer -* Plugins can monitor changes through callbacks -* Sample plugin framework to serve static resources +* Sample plugin framework to serve static resources (./Plugins/Samples/WebSkeleton/) + +Fixes +----- + * Fix issue 19 (YBR_FULL are decoded incorrectly) * Fix issue 21 (Microsoft Visual Studio precompiled headers) * Fix issue 22 (Error decoding multi-frame instances) diff -r 178de5edc0a8 -r f7966e9950e4 OrthancCppClient/Instance.cpp --- a/OrthancCppClient/Instance.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/OrthancCppClient/Instance.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 OrthancCppClient/Instance.h --- a/OrthancCppClient/Instance.h Tue Nov 04 13:56:17 2014 +0100 +++ b/OrthancCppClient/Instance.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 OrthancCppClient/OrthancClientException.h --- a/OrthancCppClient/OrthancClientException.h Tue Nov 04 13:56:17 2014 +0100 +++ b/OrthancCppClient/OrthancClientException.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 OrthancCppClient/OrthancConnection.cpp --- a/OrthancCppClient/OrthancConnection.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/OrthancCppClient/OrthancConnection.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 OrthancCppClient/OrthancConnection.h --- a/OrthancCppClient/OrthancConnection.h Tue Nov 04 13:56:17 2014 +0100 +++ b/OrthancCppClient/OrthancConnection.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 OrthancCppClient/OrthancCppClient.cpp --- a/OrthancCppClient/OrthancCppClient.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/OrthancCppClient/OrthancCppClient.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 OrthancCppClient/Patient.cpp --- a/OrthancCppClient/Patient.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/OrthancCppClient/Patient.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 OrthancCppClient/Patient.h --- a/OrthancCppClient/Patient.h Tue Nov 04 13:56:17 2014 +0100 +++ b/OrthancCppClient/Patient.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 OrthancCppClient/Series.cpp --- a/OrthancCppClient/Series.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/OrthancCppClient/Series.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 OrthancCppClient/Series.h --- a/OrthancCppClient/Series.h Tue Nov 04 13:56:17 2014 +0100 +++ b/OrthancCppClient/Series.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 OrthancCppClient/SharedLibrary/AUTOGENERATED/ExternC.cpp --- a/OrthancCppClient/SharedLibrary/AUTOGENERATED/ExternC.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/OrthancCppClient/SharedLibrary/AUTOGENERATED/ExternC.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1489,7 +1489,7 @@ LAAW_EXPORT_DLL_API const char* LAAW_CALL_CONVENTION LAAW_EXTERNC_GetCompany() { - return "CHU of Liege"; + return "University Hospital of Liege"; } LAAW_EXPORT_DLL_API const char* LAAW_CALL_CONVENTION LAAW_EXTERNC_GetProduct() @@ -1499,7 +1499,7 @@ LAAW_EXPORT_DLL_API const char* LAAW_CALL_CONVENTION LAAW_EXTERNC_GetCopyright() { - return "(c) 2012-2014, Sebastien Jodogne, University Hospital of Liege"; + return "(c) 2012-2015, Sebastien Jodogne, University Hospital of Liege"; } LAAW_EXPORT_DLL_API const char* LAAW_CALL_CONVENTION LAAW_EXTERNC_GetVersion() @@ -1509,12 +1509,12 @@ LAAW_EXPORT_DLL_API const char* LAAW_CALL_CONVENTION LAAW_EXTERNC_GetFileVersion() { - return "0.8.0.4"; + return "0.8.0.5"; } LAAW_EXPORT_DLL_API const char* LAAW_CALL_CONVENTION LAAW_EXTERNC_GetFullVersion() { - return "0.8.4"; + return "0.8.5"; } LAAW_EXPORT_DLL_API void LAAW_CALL_CONVENTION LAAW_EXTERNC_FreeString(char* str) diff -r 178de5edc0a8 -r f7966e9950e4 OrthancCppClient/SharedLibrary/AUTOGENERATED/Windows32.rc --- a/OrthancCppClient/SharedLibrary/AUTOGENERATED/Windows32.rc Tue Nov 04 13:56:17 2014 +0100 +++ b/OrthancCppClient/SharedLibrary/AUTOGENERATED/Windows32.rc Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ #include VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,8,0,4 + FILEVERSION 0,8,0,5 PRODUCTVERSION 0,8,0,0 FILEOS VOS_NT_WINDOWS32 FILETYPE VFT_DLL @@ -10,13 +10,13 @@ BEGIN BLOCK "040904E4" BEGIN - VALUE "Comments", "Release 0.8.4" - VALUE "CompanyName", "CHU of Liege" + VALUE "Comments", "Release 0.8.5" + VALUE "CompanyName", "University Hospital of Liege" VALUE "FileDescription", "Native client to the REST API of Orthanc" - VALUE "FileVersion", "0.8.0.4" + VALUE "FileVersion", "0.8.0.5" VALUE "InternalName", "OrthancClient" - VALUE "LegalCopyright", "(c) 2012-2014, Sebastien Jodogne, University Hospital of Liege" - VALUE "LegalTrademarks", "Licensing information is available on https://code.google.com/p/orthanc/" + VALUE "LegalCopyright", "(c) 2012-2015, Sebastien Jodogne, University Hospital of Liege" + VALUE "LegalTrademarks", "Licensing information is available on http://www.orthanc-server.com/" VALUE "OriginalFilename", "OrthancClient_Windows32.dll" VALUE "ProductName", "OrthancClient" VALUE "ProductVersion", "0.8" diff -r 178de5edc0a8 -r f7966e9950e4 OrthancCppClient/SharedLibrary/AUTOGENERATED/Windows64.rc --- a/OrthancCppClient/SharedLibrary/AUTOGENERATED/Windows64.rc Tue Nov 04 13:56:17 2014 +0100 +++ b/OrthancCppClient/SharedLibrary/AUTOGENERATED/Windows64.rc Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ #include VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,8,0,4 + FILEVERSION 0,8,0,5 PRODUCTVERSION 0,8,0,0 FILEOS VOS_NT_WINDOWS32 FILETYPE VFT_DLL @@ -10,13 +10,13 @@ BEGIN BLOCK "040904E4" BEGIN - VALUE "Comments", "Release 0.8.4" - VALUE "CompanyName", "CHU of Liege" + VALUE "Comments", "Release 0.8.5" + VALUE "CompanyName", "University Hospital of Liege" VALUE "FileDescription", "Native client to the REST API of Orthanc" - VALUE "FileVersion", "0.8.0.4" + VALUE "FileVersion", "0.8.0.5" VALUE "InternalName", "OrthancClient" - VALUE "LegalCopyright", "(c) 2012-2014, Sebastien Jodogne, University Hospital of Liege" - VALUE "LegalTrademarks", "Licensing information is available on https://code.google.com/p/orthanc/" + VALUE "LegalCopyright", "(c) 2012-2015, Sebastien Jodogne, University Hospital of Liege" + VALUE "LegalTrademarks", "Licensing information is available on http://www.orthanc-server.com/" VALUE "OriginalFilename", "OrthancClient_Windows64.dll" VALUE "ProductName", "OrthancClient" VALUE "ProductVersion", "0.8" diff -r 178de5edc0a8 -r f7966e9950e4 OrthancCppClient/SharedLibrary/Product.json --- a/OrthancCppClient/SharedLibrary/Product.json Tue Nov 04 13:56:17 2014 +0100 +++ b/OrthancCppClient/SharedLibrary/Product.json Wed Feb 11 10:32:14 2015 +0100 @@ -1,8 +1,8 @@ { "Product" : "OrthancClient", "Description" : "Native client to the REST API of Orthanc", - "Company" : "CHU of Liege", - "Copyright" : "(c) 2012-2014, Sebastien Jodogne, University Hospital of Liege", - "Legal" : "Licensing information is available on https://code.google.com/p/orthanc/", - "Version" : "0.8.4" + "Company" : "University Hospital of Liege", + "Copyright" : "(c) 2012-2015, Sebastien Jodogne, University Hospital of Liege", + "Legal" : "Licensing information is available on http://www.orthanc-server.com/", + "Version" : "0.8.5" } diff -r 178de5edc0a8 -r f7966e9950e4 OrthancCppClient/SharedLibrary/SharedLibrary.cpp --- a/OrthancCppClient/SharedLibrary/SharedLibrary.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/OrthancCppClient/SharedLibrary/SharedLibrary.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 OrthancCppClient/Study.cpp --- a/OrthancCppClient/Study.cpp Tue Nov 04 13:56:17 2014 +0100 +++ b/OrthancCppClient/Study.cpp Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 OrthancCppClient/Study.h --- a/OrthancCppClient/Study.h Tue Nov 04 13:56:17 2014 +0100 +++ b/OrthancCppClient/Study.h Wed Feb 11 10:32:14 2015 +0100 @@ -1,7 +1,7 @@ /** * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, - * Belgium + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r 178de5edc0a8 -r f7966e9950e4 OrthancExplorer/explorer.html --- a/OrthancExplorer/explorer.html Tue Nov 04 13:56:17 2014 +0100 +++ b/OrthancExplorer/explorer.html Wed Feb 11 10:32:14 2015 +0100 @@ -30,11 +30,13 @@ +

Find a patient

+ Plugins Upload DICOM
@@ -46,7 +48,7 @@

Upload DICOM files

- Find patient + Patients
@@ -72,7 +74,7 @@
@@ -126,7 +128,7 @@ Patient » Study - Find patient + Patients Upload DICOM
@@ -175,7 +177,7 @@ Series - Find patient + Patients Upload DICOM
@@ -225,7 +227,7 @@ Series » Instance - Find patient + Patients Upload DICOM
@@ -271,6 +273,18 @@
+
+
+

Plugins

+ Patients +
+
+
    +
+
+
+ +