changeset 92:a3d3ff83024d

attachments doc + build with docker
author amazy
date Wed, 08 Feb 2017 20:22:42 +0100
parents 025744919357
children a1e55e1baf38
files Sphinx/Dockerfile Sphinx/buildWithDocker.sh Sphinx/source/faq/features.rst
diffstat 3 files changed, 59 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Sphinx/Dockerfile	Wed Feb 08 20:22:42 2017 +0100
@@ -0,0 +1,9 @@
+FROM python:2.7
+
+COPY requirements.txt /app/
+WORKDIR /app
+RUN pip install -r requirements.txt
+
+COPY . /app
+
+ENTRYPOINT make html
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Sphinx/buildWithDocker.sh	Wed Feb 08 20:22:42 2017 +0100
@@ -0,0 +1,2 @@
+docker build -t orthanc-book-builder .
+docker run --rm -v $(pwd):/app orthanc-book-builder
\ No newline at end of file
--- a/Sphinx/source/faq/features.rst	Fri Feb 03 10:43:16 2017 +0100
+++ b/Sphinx/source/faq/features.rst	Wed Feb 08 20:22:42 2017 +0100
@@ -77,8 +77,8 @@
 
 .. _metadata:
 
-Metadata
---------
+Metadata & attachments
+----------------------
 
 Metadata consists in an **associative key-value array** (mapping a
 integer key in the range [0,65535] to a string value) that is
@@ -145,7 +145,12 @@
 
 You can associate a symbolic name to user-defined metadata using the
 ``UserMetadata`` option inside the :ref:`configuration of Orthanc
-<configuration>`.
+<configuration>`::
+
+  "UserMetadata" : {
+    "SampleMetaData1" : 1024,
+    "SampleMetaData2" : 1025
+  }
 
 
 Accessing metadata
@@ -158,6 +163,7 @@
 
   $ curl http://localhost:8042/instances/cb855110-5f4da420-ec9dc9cb-2af6a9bb-dcbd180e/metadata
   $ curl http://localhost:8042/instances/cb855110-5f4da420-ec9dc9cb-2af6a9bb-dcbd180e/metadata/RemoteAet
+  $ curl http://localhost:8042/instances/cb855110-5f4da420-ec9dc9cb-2af6a9bb-dcbd180e/metadata/SampleMetaData1
 
 User-defined metadata can be modified by issuing a HTTP PUT against
 the REST API::
@@ -168,6 +174,45 @@
 
 
 
+.. _attachments:
+
+User-defined attachments
+^^^^^^^^^^^^^^^^^^^^^^^^
+
+Orthanc users are allowed to define their own **user-defined attachments**.
+Such attachments are associated with an integer key that is
+greater or equal to 1024 (whereas keys below 1023 are reserved for
+core attachments).
+
+You can associate a symbolic name to user-defined attachments using the
+``UserContentType`` option inside the :ref:`configuration of Orthanc
+<configuration>`.  Optionally, the user may specify a MIME content type
+for the attachment::
+
+  "UserContentType" : {
+    "samplePdf" : [1024, "application/pdf"],
+    "sampleJson" : [1025, "application/json"],
+    "sampleRaw" : 1026
+  }
+
+Accessing attachments
+^^^^^^^^^^^^^^^^^^^^^
+
+.. highlight:: bash
+
+Attachments associated with one DICOM resource can be accessed through
+the :ref:`REST API <rest>`, for instance::
+
+  $ curl http://localhost:8042/instances/cb855110-5f4da420-ec9dc9cb-2af6a9bb-dcbd180e/attachments/samplePdf/data
+  $ curl http://localhost:8042/instances/cb855110-5f4da420-ec9dc9cb-2af6a9bb-dcbd180e/attachments/sampleJson/data
+
+User-defined attachments can be modified by issuing a HTTP PUT against
+the REST API::
+
+  $ curl http://localhost:8042/instances/cb855110-5f4da420-ec9dc9cb-2af6a9bb-dcbd180e/attachments/samplePdf -X PUT --data-binary @sample.pdf
+  $ curl http://localhost:8042/instances/cb855110-5f4da420-ec9dc9cb-2af6a9bb-dcbd180e/attachments/sampleRaw -X PUT -d 'raw data'
+  
+
 .. _registry:
 
 Central registry of metadata and attachments