Class PlantUmlDiagramEngine
java.lang.Object
io.jmix.datatools.datamodel.engine.plantuml.impl.PlantUmlDiagramEngine
- All Implemented Interfaces:
DiagramEngine
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Stringprotected final intprotected final DatatoolsPropertiesprotected final Stringprotected final PlantUmlEncoderprotected final Stringprotected final org.springframework.web.client.RestClientprotected final Stringprotected final String -
Constructor Summary
ConstructorsConstructorDescriptionPlantUmlDiagramEngine(DatatoolsProperties datatoolsProperties, Metadata metadata) -
Method Summary
Modifier and TypeMethodDescriptionprotected org.springframework.web.client.RestClientconfigureClient(String baseUrl) constructEntityDescription(String entityName, String dataStoreName, List<AttributeModel> attributeModelList) Constructs a description of an entity in the format required by the selected diagramming library.constructRelationDescription(String currentEntityType, String refEntityType, RelationType relationType, String dataStoreName) Constructs a string representation of a relationship between two entities in a specific format for use with a diagramming library.protected Stringprotected Stringprotected PlantUmlEncoderprotected Stringprotected Stringprotected Stringprotected Stringbyte[]generateDiagram(String entitiesDescription, String relationsDescriptions) Generates a diagram in a binary format based on the provided descriptions of entities and their relationships.protected intgetDataStoresCount(Metadata metadata) booleanChecks the availability of the remote diagramming service.protected byte[]receiveDiagramFile(String diagramDescription)
-
Field Details
-
datatoolsProperties
-
plantUmlEncoder
-
template
-
entityTemplate
-
attributeTemplate
-
relationTemplate
-
urlTemplate
-
restClient
protected final org.springframework.web.client.RestClient restClient -
dataStoresCount
protected final int dataStoresCount
-
-
Constructor Details
-
PlantUmlDiagramEngine
-
-
Method Details
-
getDataStoresCount
-
createBaseURL
-
createEncoder
-
createTemplate
-
createURLTemplate
-
createEntityTemplate
-
createAttributeTemplate
-
createRelationTemplate
-
configureClient
-
receiveDiagramFile
-
constructEntityDescription
public String constructEntityDescription(String entityName, String dataStoreName, List<AttributeModel> attributeModelList) Description copied from interface:DiagramEngineConstructs a description of an entity in the format required by the selected diagramming library.- Specified by:
constructEntityDescriptionin interfaceDiagramEngine- Parameters:
entityName- the name of the entity to be describeddataStoreName- the name of the data store where the entity residesattributeModelList- a list of attributes that define the structure of the entity- Returns:
- a string representing the description of the entity in the required format
-
constructRelationDescription
public String constructRelationDescription(String currentEntityType, String refEntityType, RelationType relationType, String dataStoreName) Description copied from interface:DiagramEngineConstructs a string representation of a relationship between two entities in a specific format for use with a diagramming library.- Specified by:
constructRelationDescriptionin interfaceDiagramEngine- Parameters:
currentEntityType- the type of the current entity involved in the relationshiprefEntityType- the type of the referenced entity involved in the relationshiprelationType- the type of the relationship (e.g., MANY_TO_ONE, ONE_TO_MANY)dataStoreName- the name of the data store where the entities reside- Returns:
- a string describing the relationship between the specified entities in the required format
-
pingService
public boolean pingService()Description copied from interface:DiagramEngineChecks the availability of the remote diagramming service.- Specified by:
pingServicein interfaceDiagramEngine- Returns:
trueif the service is accessible, otherwisefalse.
-
generateDiagram
Description copied from interface:DiagramEngineGenerates a diagram in a binary format based on the provided descriptions of entities and their relationships.- Specified by:
generateDiagramin interfaceDiagramEngine- Parameters:
entitiesDescription- a string containing the descriptions of entities to be included in the diagramrelationsDescriptions- a string containing the descriptions of relationships between entities- Returns:
- a byte array representing the generated diagram
-