Class PlantUmlDiagramEngine

java.lang.Object
io.jmix.datatools.datamodel.engine.plantuml.impl.PlantUmlDiagramEngine
All Implemented Interfaces:
DiagramEngine

public class PlantUmlDiagramEngine extends Object implements DiagramEngine
  • Field Details

    • PUBLIC_PLANTUML_SERVER

      protected static final String PUBLIC_PLANTUML_SERVER
      See Also:
    • datatoolsProperties

      protected final DatatoolsProperties datatoolsProperties
    • plantUmlEncoder

      protected final PlantUmlEncoder plantUmlEncoder
    • template

      protected final String template
    • entityTemplate

      protected final String entityTemplate
    • attributeTemplate

      protected final String attributeTemplate
    • relationTemplate

      protected final String relationTemplate
    • urlTemplate

      protected final String urlTemplate
    • restClient

      protected final org.springframework.web.client.RestClient restClient
    • dataStoresCount

      protected final int dataStoresCount
    • available

      protected final boolean available
  • Constructor Details

  • Method Details

    • resolveAvailable

      protected boolean resolveAvailable(CoreProperties coreProperties)
    • getDataStoresCount

      protected int getDataStoresCount(Metadata metadata)
    • createBaseURL

      protected String createBaseURL()
    • createEncoder

      protected PlantUmlEncoder createEncoder()
    • createTemplate

      protected String createTemplate()
    • createURLTemplate

      protected String createURLTemplate()
    • createEntityTemplate

      protected String createEntityTemplate()
    • createAttributeTemplate

      protected String createAttributeTemplate()
    • createRelationTemplate

      protected String createRelationTemplate()
    • configureClient

      protected org.springframework.web.client.RestClient configureClient(String baseUrl)
    • receiveDiagramFile

      protected byte[] receiveDiagramFile(String diagramDescription)
    • constructEntityDescription

      public String constructEntityDescription(String entityName, String dataStoreName, List<AttributeModel> attributeModelList)
      Description copied from interface: DiagramEngine
      Constructs a description of an entity in the format required by the selected diagramming library.
      Specified by:
      constructEntityDescription in interface DiagramEngine
      Parameters:
      entityName - the name of the entity to be described
      dataStoreName - the name of the data store where the entity resides
      attributeModelList - 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: DiagramEngine
      Constructs a string representation of a relationship between two entities in a specific format for use with a diagramming library.
      Specified by:
      constructRelationDescription in interface DiagramEngine
      Parameters:
      currentEntityType - the type of the current entity involved in the relationship
      refEntityType - the type of the referenced entity involved in the relationship
      relationType - 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: DiagramEngine
      Checks the availability of the remote diagramming service.
      Specified by:
      pingService in interface DiagramEngine
      Returns:
      true if the service is accessible, otherwise false.
    • isAvailable

      public boolean isAvailable()
      Description copied from interface: DiagramEngine
      Indicates whether diagram generation is permitted under the current configuration. Unlike DiagramEngine.pingService(), which checks network reachability, this reflects configuration and security policy. For example, generating diagrams via the public PlantUML server may be disabled when no private server is configured.
      Specified by:
      isAvailable in interface DiagramEngine
      Returns:
      true if diagram generation is allowed, otherwise false.
    • generateDiagram

      public byte[] generateDiagram(String entitiesDescription, String relationsDescriptions)
      Description copied from interface: DiagramEngine
      Generates a diagram in a binary format based on the provided descriptions of entities and their relationships.
      Specified by:
      generateDiagram in interface DiagramEngine
      Parameters:
      entitiesDescription - a string containing the descriptions of entities to be included in the diagram
      relationsDescriptions - a string containing the descriptions of relationships between entities
      Returns:
      a byte array representing the generated diagram