changeset 999:3b62529bfe91

added java plugin
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 19 Dec 2023 13:36:11 +0100
parents bd7fbe3042f7
children 56da617938f0
files Sphinx/source/contributing.rst Sphinx/source/developers/creating-plugins.rst Sphinx/source/faq/licensing.rst Sphinx/source/faq/scalability.rst Sphinx/source/plugins.rst Sphinx/source/plugins/java.rst Sphinx/source/plugins/stone-webviewer.rst Sphinx/source/users/cookbook.rst Sphinx/source/users/lua.rst
diffstat 9 files changed, 90 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/Sphinx/source/contributing.rst	Mon Dec 18 09:47:49 2023 +0100
+++ b/Sphinx/source/contributing.rst	Tue Dec 19 13:36:11 2023 +0100
@@ -132,7 +132,7 @@
       <https://twitter.com/sjodogne/status/1299632772915625984>`__ to
       import/export such STL files from/to Orthanc.
     + Create a plugin to edit DICOM files (add, update or remove DICOM tags).
-    + Create samples of :ref:`Python plugins <python-plugin>` to take
+    + Create samples of :ref:`Python plugins <python-plugin>` or :ref:`Java plugins <java-plugin>` to take
       care of HL7 messages, especially for :ref:`merging patients
       <split-merge>` (which is a `typical HL7 event
       <https://twitter.com/ZeClint/status/1192086039160086529?s=20>`__
@@ -147,7 +147,7 @@
       clients/viewers), or a `DICOMweb proxy
       <https://groups.google.com/g/orthanc-users/c/AQ6qs0TgO6I/m/WxdOVEeKBAAJ>`__
       (to turn a DICOM-only PACS into a DICOMweb server). This could
-      be done as a :ref:`Python plugin <python-plugin>` by wrapping
+      be done as a :ref:`Python plugin <python-plugin>` or as a :ref:`Java plugin <java-plugin>` by wrapping
       the C-FIND and C-MOVE callbacks in the Python API.
     + Get involved in the call for ideas by Salim Kanoun about a
       `DICOM router built on the top of Orthanc
--- a/Sphinx/source/developers/creating-plugins.rst	Mon Dec 18 09:47:49 2023 +0100
+++ b/Sphinx/source/developers/creating-plugins.rst	Tue Dec 19 13:36:11 2023 +0100
@@ -23,9 +23,10 @@
 <https://en.wikipedia.org/wiki/Foreign_function_interface>`__ (such as
 Rust or Objective-C).
 
-For developers who are more familiar with Python, it is also possible
-to create plugins using this simpler language. Check out the
-:ref:`dedicated Python plugin <python-plugin>`.
+For developers who are more familiar with Python or Java, it is also
+possible to create plugins using either of those simpler
+languages. Check out the :ref:`dedicated Python plugin
+<python-plugin>` or the :ref:`dedicated Java plugin <java-plugin>`.
 
 Because the C header providing the Orthanc SDK interface is licensed
 using the GPLv3 license, any Orthanc plugin must be licensed either
--- a/Sphinx/source/faq/licensing.rst	Mon Dec 18 09:47:49 2023 +0100
+++ b/Sphinx/source/faq/licensing.rst	Tue Dec 19 13:36:11 2023 +0100
@@ -85,8 +85,9 @@
 | AGPL-licensed plugin is installed                   |               |       |        |              |                        |                   |
 +-----------------------------------------------------+---------------+-------+--------+--------------+------------------------+-------------------+
 | Creating a :ref:`C/C++ plugin <plugins>`,           |               |       |        |              |                        |                   |
-| creating a :ref:`Lua script <lua>`, or              |               |       |        |              |                        |                   |
-| creating a :ref:`Python plugin <python-plugin>`.    |               |       |        |              |                        |                   |
+| creating a :ref:`Lua script <lua>`,                 |               |       |        |              |                        |                   |
+| creating a :ref:`Python plugin <python-plugin>`, or |               |       |        |              |                        |                   |
+| creating a :ref:`Java plugin <java-plugin>`.        |               |       |        |              |                        |                   |
 | 2 possible cases:                                   |               |       |        |              |                        |                   |
 +----+------------------------------------------------+---------------+-------+--------+--------------+------------------------+-------------------+
 |    | Case 1: No AGPL-licensed plugin is in use      | No            | Yes   | Yes    | Yes          | Dual license           | Yes               |
--- a/Sphinx/source/faq/scalability.rst	Mon Dec 18 09:47:49 2023 +0100
+++ b/Sphinx/source/faq/scalability.rst	Tue Dec 19 13:36:11 2023 +0100
@@ -346,9 +346,10 @@
   three possibilities: (1) Introduce a distinguished Orthanc server
   that is responsible to take care of all the jobs (including
   modalities and peers), (2) create an :ref:`Orthanc plugin <plugins>`
-  (e.g. using :ref:`Python <python-plugin>`) that queries all the
-  Orthanc in the cluster and that aggregates all of their answers,
-  or (3) do the same using a higher-level framework (such as Node.js).
+  (e.g. using :ref:`Python <python-plugin>` or :ref:`Java
+  <java-plugin>`) that queries all the Orthanc in the cluster and that
+  aggregates all of their answers, or (3) do the same using a
+  higher-level framework (such as Node.js).
     
 
 Latency
--- a/Sphinx/source/plugins.rst	Mon Dec 18 09:47:49 2023 +0100
+++ b/Sphinx/source/plugins.rst	Tue Dec 19 13:36:11 2023 +0100
@@ -88,6 +88,7 @@
    plugins/indexer.rst
    plugins/neuro.rst
    plugins/multitenant-dicom.rst
+   plugins/java.rst
 
 .. _plugins-contributed:
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Sphinx/source/plugins/java.rst	Tue Dec 19 13:36:11 2023 +0100
@@ -0,0 +1,67 @@
+.. _java-plugin:
+
+
+Java plugin for Orthanc
+=======================
+
+.. contents::
+
+
+Overview
+--------
+
+This plugin can be used to write :ref:`Orthanc plugins
+<creating-plugins>` using the `Java programming language
+<https://en.wikipedia.org/wiki/Java_(programming_language)>`__ instead
+of the more complex C/C++ programming languages.
+
+Java plugins have access to more features and a more consistent SDK
+than :ref:`Lua scripts <lua>`. The largest part of the Java API is
+automatically generated from the `Orthanc plugin SDK in C
+<https://orthanc.uclouvain.be/hg/orthanc/file/Orthanc-1.12.2/OrthancServer/Plugins/Include/orthanc/OrthancCPlugin.h>`__
+using the `Clang <https://en.wikipedia.org/wiki/Clang>`__ compiler
+front-end.
+
+As of release 1.0 of the plugin, the coverage of the C SDK is about
+76% (122 functions are automatically wrapped in Java out of a total of
+160 functions from the Orthanc SDK 1.10.0).
+
+
+Source code
+-----------
+
+* Link to the `official releases of this plugin
+  <https://orthanc.uclouvain.be/downloads/sources/orthanc-java/index.html>`__.
+
+* Link to the `code repository
+  <https://orthanc.uclouvain.be/hg/orthanc-java/>`__.
+
+
+Licensing
+---------
+
+This plugin is licensed under the terms of the `GPLv3+ license
+<https://en.wikipedia.org/wiki/GNU_Affero_General_Public_License>`__,
+which is the same as the core of Orthanc.
+
+This has an important consequence: If you distribute Orthanc to
+clients together with one Java plugin, you **must** disclose the
+source code of your Java script to the Orthanc community under the
+terms of the GPL or AGPL licenses.
+
+We suggest you to put the source code of your Java scripts on the
+dedicated `"OrthancContributed" repository on GitHub
+<https://github.com/jodogne/OrthancContributed/tree/master/Plugins>`__,
+and/or to send it to the `Orthanc Users discussion forum
+<https://discourse.orthanc-server.org>`__.
+
+Check out the :ref:`FAQ about licensing <licensing>` for more context.
+
+
+Usage
+-----
+
+
+FHIR server
+-----------
+
--- a/Sphinx/source/plugins/stone-webviewer.rst	Mon Dec 18 09:47:49 2023 +0100
+++ b/Sphinx/source/plugins/stone-webviewer.rst	Tue Dec 19 13:36:11 2023 +0100
@@ -166,7 +166,7 @@
   API of Orthanc
   <https://orthanc.uclouvain.be/api/index.html#tag/System/paths/~1tools~1create-dicom/post>`__.
   It would be easy to automate this workflow using a :ref:`Python
-  plugin <python-plugin>`.
+  plugin <python-plugin>` or a :ref:`Java plugin <java-plugin>`.
 
   If you have an interest in DICOM-SR, the Orthanc community would
   love to have access to sample DICOM files that could be used to
--- a/Sphinx/source/users/cookbook.rst	Mon Dec 18 09:47:49 2023 +0100
+++ b/Sphinx/source/users/cookbook.rst	Tue Dec 19 13:36:11 2023 +0100
@@ -56,11 +56,12 @@
   $ /etc/init.d/orthanc start
 
 Note that this standalone Debian repository **does not** contain the
-:ref:`Python plugin <python-plugin>`, as this plugin must be
-dynamically linked against the system-wide version of your Python
-runtime. You should install the ``orthanc-python`` package from your
-native Debian/Ubuntu distribution if available, or compile the plugin
-from sources.
+:ref:`Python plugin <python-plugin>` and the :ref:`Java plugin
+<java-plugin>`, because these plugins must be dynamically linked
+against the system-wide version of your Python or Java runtime
+environment. You should install the ``orthanc-python`` or
+``orthanc-java`` package from your native Debian/Ubuntu distribution
+if available, or compile the plugin from sources.
 
 
 .. _orthanc-explorer:
--- a/Sphinx/source/users/lua.rst	Mon Dec 18 09:47:49 2023 +0100
+++ b/Sphinx/source/users/lua.rst	Tue Dec 19 13:36:11 2023 +0100
@@ -16,7 +16,8 @@
 <https://orthanc.uclouvain.be/hg/orthanc/file/default/OrthancServer/Resources/Samples/Lua/>`__.
 
 A more expressive alternative to Lua scripts is provided by
-:ref:`Python plugins <python-plugin>`.
+:ref:`Python plugins <python-plugin>` and :ref:`Java plugins
+<java-plugin>`.
 
 
 Installing a Lua script