Mercurial > hg > orthanc
comparison OrthancServer/Sources/OrthancRestApi/OrthancRestResources.cpp @ 4661:b1d87d41874e
typo: replaced "CheckRevision" by "CheckRevisions"
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 10 May 2021 12:31:17 +0200 |
parents | e8967149d87a |
children | da1edb7d6332 |
comparison
equal
deleted
inserted
replaced
4660:4e81412ead0a | 4661:b1d87d41874e |
---|---|
1588 .SetDescription("Delete some metadata associated with the given DICOM " + r + | 1588 .SetDescription("Delete some metadata associated with the given DICOM " + r + |
1589 ". This call will fail if trying to delete a system metadata (i.e. whose index is < 1024).") | 1589 ". This call will fail if trying to delete a system metadata (i.e. whose index is < 1024).") |
1590 .SetUriArgument("id", "Orthanc identifier of the " + r + " of interest") | 1590 .SetUriArgument("id", "Orthanc identifier of the " + r + " of interest") |
1591 .SetUriArgument("name", "The name of the metadata, or its index (cf. `UserMetadata` configuration option)") | 1591 .SetUriArgument("name", "The name of the metadata, or its index (cf. `UserMetadata` configuration option)") |
1592 .SetHttpHeader("If-Match", "Revision of the metadata, to check if its content has not changed and can " | 1592 .SetHttpHeader("If-Match", "Revision of the metadata, to check if its content has not changed and can " |
1593 "be deleted. This header is mandatory if `CheckRevision` option is `true`."); | 1593 "be deleted. This header is mandatory if `CheckRevisions` option is `true`."); |
1594 return; | 1594 return; |
1595 } | 1595 } |
1596 | 1596 |
1597 CheckValidResourceType(call); | 1597 CheckValidResourceType(call); |
1598 const std::string publicId = call.GetUriComponent("id", ""); | 1598 const std::string publicId = call.GetUriComponent("id", ""); |
1613 { | 1613 { |
1614 OrthancConfiguration::ReaderLock lock; | 1614 OrthancConfiguration::ReaderLock lock; |
1615 if (lock.GetConfiguration().GetBooleanParameter(CHECK_REVISIONS, false)) | 1615 if (lock.GetConfiguration().GetBooleanParameter(CHECK_REVISIONS, false)) |
1616 { | 1616 { |
1617 throw OrthancException(ErrorCode_Revision, | 1617 throw OrthancException(ErrorCode_Revision, |
1618 "HTTP header \"If-Match\" is missing, as \"CheckRevision\" is \"true\""); | 1618 "HTTP header \"If-Match\" is missing, as \"CheckRevisions\" is \"true\""); |
1619 } | 1619 } |
1620 else | 1620 else |
1621 { | 1621 { |
1622 found = OrthancRestApi::GetIndex(call).DeleteMetadata(publicId, metadata, false, -1 /* dummy value */, ""); | 1622 found = OrthancRestApi::GetIndex(call).DeleteMetadata(publicId, metadata, false, -1 /* dummy value */, ""); |
1623 } | 1623 } |
2133 .SetDescription("Delete an attachment associated with the given DICOM " + r + | 2133 .SetDescription("Delete an attachment associated with the given DICOM " + r + |
2134 ". This call will fail if trying to delete a system attachment (i.e. whose index is < 1024).") | 2134 ". This call will fail if trying to delete a system attachment (i.e. whose index is < 1024).") |
2135 .SetUriArgument("id", "Orthanc identifier of the " + r + " of interest") | 2135 .SetUriArgument("id", "Orthanc identifier of the " + r + " of interest") |
2136 .SetUriArgument("name", "The name of the attachment, or its index (cf. `UserContentType` configuration option)") | 2136 .SetUriArgument("name", "The name of the attachment, or its index (cf. `UserContentType` configuration option)") |
2137 .SetHttpHeader("If-Match", "Revision of the attachment, to check if its content has not changed and can " | 2137 .SetHttpHeader("If-Match", "Revision of the attachment, to check if its content has not changed and can " |
2138 "be deleted. This header is mandatory if `CheckRevision` option is `true`."); | 2138 "be deleted. This header is mandatory if `CheckRevisions` option is `true`."); |
2139 return; | 2139 return; |
2140 } | 2140 } |
2141 | 2141 |
2142 CheckValidResourceType(call); | 2142 CheckValidResourceType(call); |
2143 | 2143 |
2181 { | 2181 { |
2182 OrthancConfiguration::ReaderLock lock; | 2182 OrthancConfiguration::ReaderLock lock; |
2183 if (lock.GetConfiguration().GetBooleanParameter(CHECK_REVISIONS, false)) | 2183 if (lock.GetConfiguration().GetBooleanParameter(CHECK_REVISIONS, false)) |
2184 { | 2184 { |
2185 throw OrthancException(ErrorCode_Revision, | 2185 throw OrthancException(ErrorCode_Revision, |
2186 "HTTP header \"If-Match\" is missing, as \"CheckRevision\" is \"true\""); | 2186 "HTTP header \"If-Match\" is missing, as \"CheckRevisions\" is \"true\""); |
2187 } | 2187 } |
2188 else | 2188 else |
2189 { | 2189 { |
2190 found = OrthancRestApi::GetIndex(call).DeleteAttachment(publicId, contentType, | 2190 found = OrthancRestApi::GetIndex(call).DeleteAttachment(publicId, contentType, |
2191 false, -1 /* dummy value */, "" /* dummy value */); | 2191 false, -1 /* dummy value */, "" /* dummy value */); |