Mercurial > hg > orthanc-databases
comparison Framework/Plugins/DatabaseBackendAdapterV3.cpp @ 261:34e2b93a7ac1
implementing interface for revisions in attachments
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 19 Apr 2021 18:47:50 +0200 |
parents | 793bbbe11287 |
children | b0c65094b299 |
comparison
equal
deleted
inserted
replaced
260:793bbbe11287 | 261:34e2b93a7ac1 |
---|---|
1116 } | 1116 } |
1117 | 1117 |
1118 | 1118 |
1119 static OrthancPluginErrorCode AddAttachment(OrthancPluginDatabaseTransaction* transaction, | 1119 static OrthancPluginErrorCode AddAttachment(OrthancPluginDatabaseTransaction* transaction, |
1120 int64_t id, | 1120 int64_t id, |
1121 const OrthancPluginAttachment* attachment) | 1121 const OrthancPluginAttachment* attachment, |
1122 { | 1122 int64_t revision) |
1123 DatabaseBackendAdapterV3::Transaction* t = reinterpret_cast<DatabaseBackendAdapterV3::Transaction*>(transaction); | 1123 { |
1124 | 1124 DatabaseBackendAdapterV3::Transaction* t = reinterpret_cast<DatabaseBackendAdapterV3::Transaction*>(transaction); |
1125 try | 1125 |
1126 { | 1126 try |
1127 t->GetOutput().Clear(); | 1127 { |
1128 t->GetBackend().AddAttachment(t->GetManager(), id, *attachment); | 1128 t->GetOutput().Clear(); |
1129 t->GetBackend().AddAttachment(t->GetManager(), id, *attachment, revision); | |
1129 return OrthancPluginErrorCode_Success; | 1130 return OrthancPluginErrorCode_Success; |
1130 } | 1131 } |
1131 ORTHANC_PLUGINS_DATABASE_CATCH(t->GetBackend().GetContext()); | 1132 ORTHANC_PLUGINS_DATABASE_CATCH(t->GetBackend().GetContext()); |
1132 } | 1133 } |
1133 | 1134 |
1667 ORTHANC_PLUGINS_DATABASE_CATCH(t->GetBackend().GetContext()); | 1668 ORTHANC_PLUGINS_DATABASE_CATCH(t->GetBackend().GetContext()); |
1668 } | 1669 } |
1669 | 1670 |
1670 | 1671 |
1671 static OrthancPluginErrorCode LookupAttachment(OrthancPluginDatabaseTransaction* transaction, | 1672 static OrthancPluginErrorCode LookupAttachment(OrthancPluginDatabaseTransaction* transaction, |
1673 int64_t* revision /* out */, | |
1672 int64_t resourceId, | 1674 int64_t resourceId, |
1673 int32_t contentType) | 1675 int32_t contentType) |
1674 { | 1676 { |
1675 DatabaseBackendAdapterV3::Transaction* t = reinterpret_cast<DatabaseBackendAdapterV3::Transaction*>(transaction); | 1677 DatabaseBackendAdapterV3::Transaction* t = reinterpret_cast<DatabaseBackendAdapterV3::Transaction*>(transaction); |
1676 | 1678 |
1677 try | 1679 try |
1678 { | 1680 { |
1679 t->GetOutput().Clear(); | 1681 t->GetOutput().Clear(); |
1680 t->GetBackend().LookupAttachment(t->GetOutput(), t->GetManager(), resourceId, contentType); | 1682 t->GetBackend().LookupAttachment(t->GetOutput(), *revision, t->GetManager(), resourceId, contentType); |
1681 return OrthancPluginErrorCode_Success; | 1683 return OrthancPluginErrorCode_Success; |
1682 } | 1684 } |
1683 ORTHANC_PLUGINS_DATABASE_CATCH(t->GetBackend().GetContext()); | 1685 ORTHANC_PLUGINS_DATABASE_CATCH(t->GetBackend().GetContext()); |
1684 } | 1686 } |
1685 | 1687 |
2005 params.startTransaction = StartTransaction; | 2007 params.startTransaction = StartTransaction; |
2006 params.destructTransaction = DestructTransaction; | 2008 params.destructTransaction = DestructTransaction; |
2007 params.rollback = Rollback; | 2009 params.rollback = Rollback; |
2008 params.commit = Commit; | 2010 params.commit = Commit; |
2009 | 2011 |
2010 params.addAttachment = AddAttachment; | |
2011 params.clearChanges = ClearChanges; | 2012 params.clearChanges = ClearChanges; |
2012 params.clearExportedResources = ClearExportedResources; | 2013 params.clearExportedResources = ClearExportedResources; |
2013 params.clearMainDicomTags = ClearMainDicomTags; | 2014 params.clearMainDicomTags = ClearMainDicomTags; |
2014 params.createInstance = CreateInstance; | 2015 params.createInstance = CreateInstance; |
2015 params.deleteAttachment = DeleteAttachment; | 2016 params.deleteAttachment = DeleteAttachment; |
2026 params.getLastChange = GetLastChange; | 2027 params.getLastChange = GetLastChange; |
2027 params.getLastChangeIndex = GetLastChangeIndex; | 2028 params.getLastChangeIndex = GetLastChangeIndex; |
2028 params.getLastExportedResource = GetLastExportedResource; | 2029 params.getLastExportedResource = GetLastExportedResource; |
2029 params.getMainDicomTags = GetMainDicomTags; | 2030 params.getMainDicomTags = GetMainDicomTags; |
2030 params.getPublicId = GetPublicId; | 2031 params.getPublicId = GetPublicId; |
2032 params.getResourceType = GetResourceType; | |
2031 params.getResourcesCount = GetResourcesCount; | 2033 params.getResourcesCount = GetResourcesCount; |
2032 params.getResourceType = GetResourceType; | |
2033 params.getTotalCompressedSize = GetTotalCompressedSize; | 2034 params.getTotalCompressedSize = GetTotalCompressedSize; |
2034 params.getTotalUncompressedSize = GetTotalUncompressedSize; | 2035 params.getTotalUncompressedSize = GetTotalUncompressedSize; |
2035 params.isDiskSizeAbove = IsDiskSizeAbove; | 2036 params.isDiskSizeAbove = IsDiskSizeAbove; |
2036 params.isExistingResource = IsExistingResource; | 2037 params.isExistingResource = IsExistingResource; |
2037 params.isProtectedPatient = IsProtectedPatient; | 2038 params.isProtectedPatient = IsProtectedPatient; |
2041 params.lookupAttachment = LookupAttachment; | 2042 params.lookupAttachment = LookupAttachment; |
2042 params.lookupGlobalProperty = LookupGlobalProperty; | 2043 params.lookupGlobalProperty = LookupGlobalProperty; |
2043 params.lookupMetadata = LookupMetadata; | 2044 params.lookupMetadata = LookupMetadata; |
2044 params.lookupParent = LookupParent; | 2045 params.lookupParent = LookupParent; |
2045 params.lookupResource = LookupResource; | 2046 params.lookupResource = LookupResource; |
2047 params.lookupResourceAndParent = LookupResourceAndParent; | |
2046 params.lookupResources = LookupResources; | 2048 params.lookupResources = LookupResources; |
2047 params.lookupResourceAndParent = LookupResourceAndParent; | |
2048 params.selectPatientToRecycle = SelectPatientToRecycle; | 2049 params.selectPatientToRecycle = SelectPatientToRecycle; |
2049 params.selectPatientToRecycle2 = SelectPatientToRecycle2; | 2050 params.selectPatientToRecycle2 = SelectPatientToRecycle2; |
2051 params.setAttachment = AddAttachment; | |
2050 params.setGlobalProperty = SetGlobalProperty; | 2052 params.setGlobalProperty = SetGlobalProperty; |
2051 params.setMetadata = SetMetadata; | 2053 params.setMetadata = SetMetadata; |
2052 params.setProtectedPatient = SetProtectedPatient; | 2054 params.setProtectedPatient = SetProtectedPatient; |
2053 params.setResourcesContent = SetResourcesContent; | 2055 params.setResourcesContent = SetResourcesContent; |
2054 | 2056 |