Fixed documentation generation

This commit is contained in:
Luca Frosini 2023-02-27 15:05:52 +01:00
parent 09828e8047
commit 9cc8d11196
2 changed files with 166 additions and 17 deletions

View File

@ -2,23 +2,19 @@
Property
========
Encrypted
---------
This type is used to properly manage encrypted values across contexts.
This is the base type for any Property
.. table:: **Encrypted** ``extends`` **Property**
.. table:: **Property**
+-------+--------+--------------------------------------------------------+----------------------------------------+
| Name | Type | Attributes | Description |
+=======+========+========================================================+========================================+
| value | String | ``Mandatory:true`` ``ReadOnly:false`` ``NotNull:true`` | The value to store encrypted in the IS |
+-------+--------+--------------------------------------------------------+----------------------------------------+
+------------------------------------------------------+------+------------+-------------+
| Name | Type | Attributes | Description |
+======================================================+======+============+=============+
| This type does not define any additional attributes. |
+------------------------------------------------------+------+------------+-------------+
The **Encrypted** current version is 1.0.0.
The **Property** current version is 1.0.0.
Changelog:
@ -82,6 +78,28 @@ Changelog:
* **1.0.0**: First Version;
Vault
-----
This type is used to properly manage values must be stored safely (e.g. encrypted) in the IS.
.. table:: **Vault** ``extends`` **Property**
+-------+--------+--------------------------------------------------------+-------------------------------------+
| Name | Type | Attributes | Description |
+=======+========+========================================================+=====================================+
| value | String | ``Mandatory:true`` ``ReadOnly:false`` ``NotNull:true`` | The value to store safely in the IS |
+-------+--------+--------------------------------------------------------+-------------------------------------+
The **Vault** current version is 1.0.0.
Changelog:
* **1.0.0**: First Version.
Entity
======
@ -107,11 +125,61 @@ Changelog:
Resource
========
--------
This is the base type for any Resource
.. table:: **Resource** ``extends`` **Entity**
+-------------------------------------------------------+----------+--------------+--------+-------------+
| Source | Relation | Multiplicity | Target | Description |
+=======================================================+==========+==============+========+=============+
| **Facets** |
+-------------------------------------------------------+----------+--------------+--------+-------------+
| No specific facets usage defined for this type. |
+-------------------------------------------------------+----------+--------------+--------+-------------+
| **Resource Relations** |
+-------------------------------------------------------+----------+--------------+--------+-------------+
| No specific Resource relations defined for this type. |
+-------------------------------------------------------+----------+--------------+--------+-------------+
The **Resource** current version is 1.0.0.
Changelog:
* **1.0.0**: First Version.
Facet
=====
-----
This is the base type for any Facet
.. table:: **Facet** ``extends`` **Entity**
+------------------------------------------------------+--------------+------------------+-----------------+-----------------+
| Properties |
+======================================================+==============+==================+=================+=================+
| **Name** | **Type** | **Attributes** | **Description** |
+------------------------------------------------------+--------------+------------------+-----------------+-----------------+
| This type does not define any additional attributes. |
+------------------------------------------------------+--------------+------------------+-----------------+-----------------+
| **Known Usage** |
+------------------------------------------------------+--------------+------------------+-----------------+-----------------+
| **Source** | **Relation** | **Multiplicity** | **Target** | **Description** |
+------------------------------------------------------+--------------+------------------+-----------------+-----------------+
| No specific known usage for this type. |
+------------------------------------------------------+--------------+------------------+-----------------+-----------------+
The **Facet** current version is 1.0.0.
Changelog:
* **1.0.0**: First Version.
Relation
@ -145,9 +213,73 @@ Changelog:
IsRelatedTo
===========
-----------
This is the base type for any IsRelatedTo relation
.. table:: **IsRelatedTo** ``extends`` **Relation**
+------------------------------------------------------+--------------+------------------+-----------------+----------------------------------------------------+
| **Definition** |
+======================================================+==============+==================+=================+====================================================+
| **Source** | **Relation** | **Multiplicity** | **Target** | **Description** |
+------------------------------------------------------+--------------+------------------+-----------------+----------------------------------------------------+
| Resource | IsRelatedTo | 0..n | Resource | This is the base type for any IsRelatedTo relation |
+------------------------------------------------------+--------------+------------------+-----------------+----------------------------------------------------+
| **Properties** |
+------------------------------------------------------+--------------+------------------+-----------------+----------------------------------------------------+
| **Name** | **Type** | **Attributes** | **Description** |
+------------------------------------------------------+--------------+------------------+-----------------+----------------------------------------------------+
| This type does not define any additional attributes. |
+------------------------------------------------------+--------------+------------------+-----------------+----------------------------------------------------+
| **Known Usage** |
+------------------------------------------------------+--------------+------------------+-----------------+----------------------------------------------------+
| **Source** | **Relation** | **Multiplicity** | **Target** | **Description** |
+------------------------------------------------------+--------------+------------------+-----------------+----------------------------------------------------+
| No specific known usage for this type. |
+------------------------------------------------------+--------------+------------------+-----------------+----------------------------------------------------+
The **IsRelatedTo** current version is 1.0.0.
Changelog:
* **1.0.0**: First Version.
ConsistsOf
==========
----------
This is the base type for any ConsistsOf relation
.. table:: **ConsistsOf** ``extends`` **Relation**
+------------------------------------------------------+--------------+------------------+-----------------+---------------------------------------------------+
| **Definition** |
+======================================================+==============+==================+=================+===================================================+
| **Source** | **Relation** | **Multiplicity** | **Target** | **Description** |
+------------------------------------------------------+--------------+------------------+-----------------+---------------------------------------------------+
| Resource | ConsistsOf | 0..n | Facet | This is the base type for any ConsistsOf relation |
+------------------------------------------------------+--------------+------------------+-----------------+---------------------------------------------------+
| **Properties** |
+------------------------------------------------------+--------------+------------------+-----------------+---------------------------------------------------+
| **Name** | **Type** | **Attributes** | **Description** |
+------------------------------------------------------+--------------+------------------+-----------------+---------------------------------------------------+
| This type does not define any additional attributes. |
+------------------------------------------------------+--------------+------------------+-----------------+---------------------------------------------------+
| **Known Usage** |
+------------------------------------------------------+--------------+------------------+-----------------+---------------------------------------------------+
| **Source** | **Relation** | **Multiplicity** | **Target** | **Description** |
+------------------------------------------------------+--------------+------------------+-----------------+---------------------------------------------------+
| No specific known usage for this type. |
+------------------------------------------------------+--------------+------------------+-----------------+---------------------------------------------------+
The **ConsistsOf** current version is 1.0.0.
Changelog:
* **1.0.0**: First Version.

View File

@ -8,6 +8,10 @@ import org.gcube.informationsystem.base.reference.Element;
import org.gcube.informationsystem.discovery.ISModelRegistrationProvider;
import org.gcube.informationsystem.discovery.RegistrationProvider;
import org.gcube.informationsystem.discovery.knowledge.Knowledge;
import org.gcube.informationsystem.model.reference.entities.Facet;
import org.gcube.informationsystem.model.reference.entities.Resource;
import org.gcube.informationsystem.model.reference.relations.ConsistsOf;
import org.gcube.informationsystem.model.reference.relations.IsRelatedTo;
import org.gcube.informationsystem.tree.Node;
import org.gcube.informationsystem.tree.NodeElaborator;
import org.gcube.informationsystem.tree.Tree;
@ -67,13 +71,26 @@ public class ModelKnowledgeGenerator extends DocumentationGenerator {
return;
}
Type type = TypeMapper.createTypeDefinition(clz);
if(level==0) {
if(level==0 && !(rp instanceof ISModelRegistrationProvider)) {
/*
* Root node has been already documented in IS_MODEL_FILENAME
* Going to skip it
*/
writeSectionOnly(type, file, level);
} else {
if(rp instanceof ISModelRegistrationProvider) {
switch (type.getName()) {
case Resource.NAME:
case Facet.NAME:
case IsRelatedTo.NAME:
case ConsistsOf.NAME:
level++;
break;
default:
break;
}
}
writeTypeToFile(type, file, level);
}