external_system_integration.md: update diagrams

This commit is contained in:
Karol Lewandowski 2022-08-08 10:50:29 +02:00
parent ce6472c3b7
commit 929bae3d97
8 changed files with 254 additions and 9 deletions

View File

@ -0,0 +1,25 @@
@startuml
hide empty members
hide circle
class "parent DataNode" as parent
class DataNode
together {
class "child n DataNode" as child3
class "..." as child2
class "child 1 DataNode" as child1
class Key
class ExternalEntityData
}
' Define the class relationships
parent -- DataNode
ExternalEntityData --o DataNode
Key --o DataNode
DataNode -- child1
DataNode -- child2
DataNode -- child3
@enduml

View File

@ -0,0 +1,17 @@
@startuml
rectangle "DataNode<ProjectData>" as root
rectangle "DataNode<ModuleData>" as child1
rectangle "DataNode<LibraryData>\n(JUnit)" as child2
rectangle "DataNode<ContentRootData>" as child11
rectangle "DataNode<LibraryDependencyData>\n(JUnit)" as child12
' Define the class relationships
root -- child1
root -- child2
child1 -- child11
child1 -- child12
@enduml

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

View File

@ -0,0 +1,106 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentStyleType="text/css" height="219px" preserveAspectRatio="none" style="width:555px;height:219px;background:#FFFFFF;" version="1.1" viewBox="0 0 555 219" width="555px" zoomAndPan="magnify">
<style>@import url('https://fonts.googleapis.com/css?family=Roboto|Roboto+Mono&amp;display=swap');</style>
<defs>
<filter height="300%" id="f1reakk33qyecd" width="300%" x="-1" y="-1"><feGaussianBlur result="blurOut" stdDeviation="2.0"/><feColorMatrix in="blurOut" result="blurOut2" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .4 0"/><feOffset dx="4.0" dy="4.0" in="blurOut2" result="blurOut3"/><feBlend in="SourceGraphic" in2="blurOut3" mode="normal"/></filter></defs><g><!--MD5=[20281f4ff4cf8314bac235a1b18d3554]
class child3--><g id="elem_child3"><rect codeLine="25" fill="#F1F1F1" filter="url(#f1reakk33qyecd)" height="26.7999" id="child3" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="113" x="430.5" y="181"/><text fill="#000000" font-family="Roboto,sans-serif" font-size="14" lengthAdjust="spacing" textLength="107" x="433.5" y="199.9999">child n DataNode</text></g><!--MD5=[46fc6f69eac59e78e2f3a9ee2b61ddb4]
class child2--><g id="elem_child2"><rect codeLine="26" fill="#F1F1F1" filter="url(#f1reakk33qyecd)" height="26.7999" id="child2" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="18" x="377" y="181"/><text fill="#000000" font-family="Roboto,sans-serif" font-size="14" lengthAdjust="spacing" textLength="12" x="380" y="199.9999">...</text></g><!--MD5=[0de898fe6e62f2649c11379ac1939bff]
class child1--><g id="elem_child1"><rect codeLine="27" fill="#F1F1F1" filter="url(#f1reakk33qyecd)" height="26.7999" id="child1" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="113" x="228.5" y="181"/><text fill="#000000" font-family="Roboto,sans-serif" font-size="14" lengthAdjust="spacing" textLength="107" x="231.5" y="199.9999">child 1 DataNode</text></g><!--MD5=[2086e18d236f9616263f91fe5276f8cf]
class Key--><g id="elem_Key"><rect codeLine="28" fill="#F1F1F1" filter="url(#f1reakk33qyecd)" height="26.7999" id="Key" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="29" x="164.5" y="181"/><text fill="#000000" font-family="Roboto,sans-serif" font-size="14" lengthAdjust="spacing" textLength="23" x="167.5" y="199.9999">Key</text></g><!--MD5=[9897386af1ed058ef323e991bacee085]
class ExternalEntityData--><g id="elem_ExternalEntityData"><rect codeLine="29" fill="#F1F1F1" filter="url(#f1reakk33qyecd)" height="26.7999" id="ExternalEntityData" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="122" x="7" y="181"/><text fill="#000000" font-family="Roboto,sans-serif" font-size="14" lengthAdjust="spacing" textLength="116" x="10" y="199.9999">ExternalEntityData</text></g><!--MD5=[2c987cbfcba91e56c1bc3dde7ea5e5d7]
class parent--><g id="elem_parent"><rect codeLine="22" fill="#F1F1F1" filter="url(#f1reakk33qyecd)" height="26.7999" id="parent" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="112" x="229" y="7"/><text fill="#000000" font-family="Roboto,sans-serif" font-size="14" lengthAdjust="spacing" textLength="106" x="232" y="25.9999">parent DataNode</text></g><!--MD5=[1be1ed30a99d2917b9277309d78aa8b6]
class DataNode--><g id="elem_DataNode"><rect codeLine="23" fill="#F1F1F1" filter="url(#f1reakk33qyecd)" height="26.7999" id="DataNode" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="68" x="251" y="94"/><text fill="#000000" font-family="Roboto,sans-serif" font-size="14" lengthAdjust="spacing" textLength="62" x="254" y="112.9999">DataNode</text></g><!--MD5=[e9d289148971afe54d9804cdf9aa0349]
link parent to DataNode--><g id="link_parent_DataNode"><path codeLine="33" d="M285,34.04 C285,50.11 285,77.81 285,93.91 " fill="none" id="parent-DataNode" style="stroke:#181818;stroke-width:1.0;"/></g><!--MD5=[09c8c8e79535da871b4995663c58175a]
link ExternalEntityData to DataNode--><g id="link_ExternalEntityData_DataNode"><path codeLine="35" d="M93.7,180.87 C109.02,173.54 128.94,164.33 147,157 C177.03,144.82 211.41,132.73 238.35,123.67 " fill="none" id="ExternalEntityData-to-DataNode" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="none" points="250.92,119.47,243.9623,117.5751,239.5371,123.2687,246.4948,125.1636,250.92,119.47" style="stroke:#181818;stroke-width:1.0;"/></g><!--MD5=[06a573aea8f804b67df62ca7c6895970]
link Key to DataNode--><g id="link_Key_DataNode"><path codeLine="36" d="M188.62,180.9 C194.61,173.49 202.73,164.19 211,157 C223.25,146.35 237.99,136.23 251.08,128.02 " fill="none" id="Key-to-DataNode" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="none" points="262.52,121.05,255.3147,120.7599,252.2757,127.2994,259.481,127.5895,262.52,121.05" style="stroke:#181818;stroke-width:1.0;"/></g><!--MD5=[f563d54bf1c03184d3f0399078057fa3]
link DataNode to child1--><g id="link_DataNode_child1"><path codeLine="37" d="M285,121.04 C285,137.11 285,164.81 285,180.91 " fill="none" id="DataNode-child1" style="stroke:#181818;stroke-width:1.0;"/></g><!--MD5=[35b66e17162c177771cf80d95f61b1c0]
link DataNode to child2--><g id="link_DataNode_child2"><path codeLine="38" d="M308.53,121.02 C323.88,129.86 343.82,142.65 359,157 C366.45,164.04 373.29,173.34 378.23,180.79 " fill="none" id="DataNode-child2" style="stroke:#181818;stroke-width:1.0;"/></g><!--MD5=[7e5eb2378c1f2596212150ee70baa567]
link DataNode to child3--><g id="link_DataNode_child3"><path codeLine="39" d="M319.04,120.39 C345.04,129.71 381.62,143.35 413,157 C429.95,164.37 448.6,173.58 462.95,180.91 " fill="none" id="DataNode-child3" style="stroke:#181818;stroke-width:1.0;"/></g><!--MD5=[d7fcb4a48415f31e4950d39bdb50a6f7]
@startuml
' https://plantuml-documentation.readthedocs.io/en/latest/formatting/all-skin-params.html
skinparam monochrome true
skinparam shadowing true
skinparam DefaultFontName "Roboto,sans-serif"
skinparam DefaultMonospacedFontName "Roboto Mono,monospace"
' https://material.io/design/typography/the-type-system.html
' Body 2
skinparam DefaultFontSize 14
skinparam DefaultTextAlignment center
skinparam NoteTextAlignment left
' default 1.5
skinparam ActivityBorderThickness 1
' default 2
skinparam PartitionBorderThickness 1.5
hide empty members
hide circle
class "parent DataNode" as parent
class DataNode
together {
class "child n DataNode" as child3
class "..." as child2
class "child 1 DataNode" as child1
class Key
class ExternalEntityData
}
' Define the class relationships
parent - - DataNode
ExternalEntityData - -o DataNode
Key - -o DataNode
DataNode - - child1
DataNode - - child2
DataNode - - child3
@enduml
@startuml
hide empty members
hide circle
skinparam monochrome true
skinparam shadowing true
skinparam DefaultFontName "Roboto,sans-serif"
skinparam DefaultMonospacedFontName "Roboto Mono,monospace"
skinparam DefaultFontSize 14
skinparam DefaultTextAlignment center
skinparam NoteTextAlignment left
skinparam ActivityBorderThickness 1
skinparam PartitionBorderThickness 1.5
class "parent DataNode" as parent
class DataNode
together {
class "child n DataNode" as child3
class "..." as child2
class "child 1 DataNode" as child1
class Key
class ExternalEntityData
}
parent - - DataNode
ExternalEntityData - -o DataNode
Key - -o DataNode
DataNode - - child1
DataNode - - child2
DataNode - - child3
@enduml
PlantUML version 1.2022.5(Sat Apr 30 10:55:52 GMT 2022)
(GPL source distribution)
Java Runtime: OpenJDK Runtime Environment
JVM: OpenJDK 64-Bit Server VM
Default Encoding: UTF-8
Language: en
Country: US
--></g></svg>

After

Width:  |  Height:  |  Size: 7.6 KiB

View File

@ -0,0 +1,94 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentStyleType="text/css" height="283px" preserveAspectRatio="none" style="width:546px;height:283px;background:#FFFFFF;" version="1.1" viewBox="0 0 546 283" width="546px" zoomAndPan="magnify"><defs><filter height="300%" id="fsdhu5i4soq0i" width="300%" x="-1" y="-1"><feGaussianBlur result="blurOut" stdDeviation="2.0"/><feColorMatrix in="blurOut" result="blurOut2" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .4 0"/><feOffset dx="4.0" dy="4.0" in="blurOut2" result="blurOut3"/><feBlend in="SourceGraphic" in2="blurOut3" mode="normal"/></filter></defs><g><!--MD5=[eab4eb7d0ef44c19c3b4c8ba4c3c2b5b]
entity root--><g id="elem_root"><rect fill="#F1F1F1" filter="url(#fsdhu5i4soq0i)" height="36.7999" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="170" x="259" y="7"/><text fill="#000000" font-family="Roboto,sans-serif" font-size="14" lengthAdjust="spacing" textLength="150" x="269" y="30.9999">DataNode&lt;ProjectData&gt;</text></g><!--MD5=[f32a4b6a4d1d5c806d2577c2ad48a88e]
entity child1--><g id="elem_child1"><rect fill="#F1F1F1" filter="url(#fsdhu5i4soq0i)" height="36.7999" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="173" x="153.5" y="112.5"/><text fill="#000000" font-family="Roboto,sans-serif" font-size="14" lengthAdjust="spacing" textLength="153" x="163.5" y="136.4999">DataNode&lt;ModuleData&gt;</text></g><!--MD5=[02fd969630d4b64c191f6d0a7ed5a485]
entity child2--><g id="elem_child2"><rect fill="#F1F1F1" filter="url(#fsdhu5i4soq0i)" height="53.5999" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="172" x="362" y="104"/><text fill="#000000" font-family="Roboto,sans-serif" font-size="14" lengthAdjust="spacing" textLength="152" x="372" y="127.9999">DataNode&lt;LibraryData&gt;</text><text fill="#000000" font-family="Roboto,sans-serif" font-size="14" lengthAdjust="spacing" textLength="42" x="427" y="144.7999">(JUnit)</text></g><!--MD5=[54c46b283c7ca20ea3c249028a9b3f95]
entity child11--><g id="elem_child11"><rect fill="#F1F1F1" filter="url(#fsdhu5i4soq0i)" height="36.7999" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="204" x="7" y="226.5"/><text fill="#000000" font-family="Roboto,sans-serif" font-size="14" lengthAdjust="spacing" textLength="184" x="17" y="250.4999">DataNode&lt;ContentRootData&gt;</text></g><!--MD5=[0dfbb752575ab26f937634ee3148eb9e]
entity child12--><g id="elem_child12"><rect fill="#F1F1F1" filter="url(#fsdhu5i4soq0i)" height="53.5999" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="249" x="246.5" y="218"/><text fill="#000000" font-family="Roboto,sans-serif" font-size="14" lengthAdjust="spacing" textLength="229" x="256.5" y="241.9999">DataNode&lt;LibraryDependencyData&gt;</text><text fill="#000000" font-family="Roboto,sans-serif" font-size="14" lengthAdjust="spacing" textLength="42" x="350" y="258.7999">(JUnit)</text></g><!--MD5=[5894e04d7cc0064eb788526fae14705a]
link root to child1--><g id="link_root_child1"><path d="M326.36,44.06 C307.23,63.09 276.89,93.29 257.73,112.36 " fill="none" id="root-child1" style="stroke:#181818;stroke-width:1.0;"/></g><!--MD5=[f9bbf2572ec6961009bd9430f880bc86]
link root to child2--><g id="link_root_child2"><path d="M361.64,44.06 C378.1,60.44 402.87,85.09 421.67,103.79 " fill="none" id="root-child2" style="stroke:#181818;stroke-width:1.0;"/></g><!--MD5=[258b65d2fddd9c03ec1a2ec6ad67758f]
link child1 to child11--><g id="link_child1_child11"><path d="M219.24,149.75 C194.71,170.72 154.15,205.4 129.66,226.34 " fill="none" id="child1-child11" style="stroke:#181818;stroke-width:1.0;"/></g><!--MD5=[de3a2a2fac82bc1e93dbf12e56c391fd]
link child1 to child12--><g id="link_child1_child12"><path d="M260.76,149.75 C282.11,168 315.62,196.65 340.09,217.58 " fill="none" id="child1-child12" style="stroke:#181818;stroke-width:1.0;"/></g><!--MD5=[20f64962a505128427966189411259b6]
@startuml
hide empty members
hide circle
' https://plantuml-documentation.readthedocs.io/en/latest/formatting/all-skin-params.html
skinparam monochrome true
skinparam shadowing true
skinparam DefaultFontName Roboto,sans-serif
skinparam DefaultMonospacedFontName "Roboto Mono,monospace"
' https://material.io/design/typography/the-type-system.html
' Body 2
skinparam DefaultFontSize 14
skinparam DefaultTextAlignment center
skinparam NoteTextAlignment left
' default 1.5
skinparam ActivityBorderThickness 1
' default 2
skinparam PartitionBorderThickness 1.5
rectangle "DataNode<ProjectData>" as root
rectangle "DataNode<ModuleData>" as child1
rectangle "DataNode<LibraryData>\n(JUnit)" as child2
rectangle "DataNode<ContentRootData>" as child11
rectangle "DataNode<LibraryDependencyData>\n(JUnit)" as child12
' Define the class relationships
root - - child1
root - - child2
child1 - - child11
child1 - - child12
@enduml
@startuml
hide empty members
hide circle
skinparam monochrome true
skinparam shadowing true
skinparam DefaultFontName Roboto,sans-serif
skinparam DefaultMonospacedFontName "Roboto Mono,monospace"
skinparam DefaultFontSize 14
skinparam DefaultTextAlignment center
skinparam NoteTextAlignment left
skinparam ActivityBorderThickness 1
skinparam PartitionBorderThickness 1.5
rectangle "DataNode<ProjectData>" as root
rectangle "DataNode<ModuleData>" as child1
rectangle "DataNode<LibraryData>\n(JUnit)" as child2
rectangle "DataNode<ContentRootData>" as child11
rectangle "DataNode<LibraryDependencyData>\n(JUnit)" as child12
root - - child1
root - - child2
child1 - - child11
child1 - - child12
@enduml
PlantUML version 1.2022.5(Sat Apr 30 10:55:52 GMT 2022)
(GPL source distribution)
Java Runtime: OpenJDK Runtime Environment
JVM: OpenJDK 64-Bit Server VM
Default Encoding: UTF-8
Language: en
Country: US
--></g></svg>

After

Width:  |  Height:  |  Size: 5.8 KiB

View File

@ -24,14 +24,14 @@ That information is built with the following base classes:
* [`Key`](upsource:///platform/external-system-api/src/com/intellij/openapi/externalSystem/model/Key.java)
* [`ExternalEntityData`](upsource:///platform/external-system-api/src/com/intellij/openapi/externalSystem/model/project/ExternalEntityData.java)
![DataNode](data-node.png)
![DataNode](data_node.svg)
The `DataNode` class is just a holder for the target data (a data type is defined by the `Key`).
Multiple `DataNode` objects might be organized in directed graph where every edge identifies parent-child relation.
For example, a simple one-module project might look as below:
![DataNode Example](data-node-example.png)
![DataNode Example](data_node_example.svg)
The IDE provides a set of built-in `Key` and `ExternalEntityData` classes but any external system integration or third-party plugin developer might enhance project data by defining custom `Key` and `ExternalEntityData` and store them at a child of appropriate `DataNode`.
@ -101,17 +101,20 @@ Alternatively, set `reloadIcon` field external system implements `ExternalSystem
## Settings
The general idea is that all external system settings controls are represented by implementations of [`ExternalSystemSettingsControl`](upsource:///platform/external-system-impl/src/com/intellij/openapi/externalSystem/util/ExternalSystemSettingsControl.java) interface.
There are also external system project-local settings and global external system settings.
So, basically particular external system settings UI looks as below:
All external system settings controls are represented by implementations of [`ExternalSystemSettingsControl`](upsource:///platform/external-system-impl/src/com/intellij/openapi/externalSystem/util/ExternalSystemSettingsControl.java).
There are general and linked project-level external system settings.
A particular external system settings UI contains the following items:
![Configurable](configurable.png)
* General system settings
* Linked external projects list
* Project-level settings for the selected project
It's recommended to extend from [`AbstractExternalProjectSettingsControl`](upsource:///platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/settings/AbstractExternalProjectSettingsControl.java) for implementing project-level settings control as it already handles some of them.
Similar approach is used for providing _Import from External System_ UI - implementation is expected to extend [`AbstractImportFromExternalSystemControl`](upsource:///java/idea-ui/src/com/intellij/openapi/externalSystem/service/settings/AbstractImportFromExternalSystemControl.java) and it has not linked external projects list, but target external project path control:
![Import from external system](import.png)
A similar approach is used for providing settings in importing external project UI.
Implementation is expected to extend [`AbstractImportFromExternalSystemControl`](upsource:///java/idea-ui/src/com/intellij/openapi/externalSystem/service/settings/AbstractImportFromExternalSystemControl.java) and instead of linked external projects list it contains target external project path control.
## Testing
@ -121,5 +124,5 @@ Use `com.jetbrains.intellij.platform:external-system-test-framework` from [](int
Relevant base classes:
- [`ExternalSystemImportingTestCase`](upsource:///platform/external-system-api/testFramework/src/com/intellij/platform/externalSystem/testFramework/ExternalSystemImportingTestCase.java)
- [`ExternalSystemTestCase`](upsource:///platform/external-system-api/testFramework/src/com/intellij/platform/externalSystem/testFramework/ExternalSystemTestCase.java)
* [`ExternalSystemImportingTestCase`](upsource:///platform/external-system-api/testFramework/src/com/intellij/platform/externalSystem/testFramework/ExternalSystemImportingTestCase.java)
* [`ExternalSystemTestCase`](upsource:///platform/external-system-api/testFramework/src/com/intellij/platform/externalSystem/testFramework/ExternalSystemTestCase.java)