Skip to content

Data model visualization #4739#5004

Open
Ki10V01T wants to merge 9 commits intomasterfrom
4739-data-model-visualization
Open

Data model visualization #4739#5004
Ki10V01T wants to merge 9 commits intomasterfrom
4739-data-model-visualization

Conversation

@Ki10V01T
Copy link
Contributor

See: #4739

Dmitry Panov added 4 commits December 18, 2025 00:09
Unimplemented features:
1. Permissions for view
2. Download button
3. Mermaid
4. Separation by Data store
5. JavaDocs
6. Locales
2. Locales creation is completed (need to check)
3. DataStore verification has been completed, no edits are required.
2. Displaying system entities ability has been added
3. Is nullable, Is mandatory fields has been centered
4. Similar to Base64 algorithm encoding for PlantUML has been added
…ng filter filed input (need to discuss)

2. Search by like
3. RegExp support for search
4. Displaying intermediate tables for many-to-many relationships (LINKED_TABLE.LINKED_COLUMN)
5. Timeouts for ping diagram server
@Ki10V01T
Copy link
Contributor Author

Known issues:

  1. I had to implement details and hide the textField inside it to make the urlQueryParameter facet work correctly. This caused the markup to shift (this needs to be discussed).
  2. Flex-grow for the Is Nullable and Is Mandatory columns doesn't work. Because of this, they are slightly wider than necessary.


io.jmix.datatools.datamodel.app/EngineType=Engine type
io.jmix.datatools.datamodel.app/EngineType.MERMAID=Mermaid
io.jmix.datatools.datamodel.app/EngineType.PLANTUML=Plantuml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it's called PlantUML

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it?

io.jmix.datatools.datamodel.entity/AttributeModel=Модель атрибутов
io.jmix.datatools.datamodel.entity/AttributeModel.attributeName=Название атрибута
io.jmix.datatools.datamodel.entity/AttributeModel.columnName=Название колонки
io.jmix.datatools.datamodel.entity/AttributeModel.dbType=БД тип
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тип БД

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

io.jmix.datatools.datamodel.entity/AttributeModel.javaType=Java тип

io.jmix.datatools.datamodel.entity/EntityModel.attributes=Атрибуты
io.jmix.datatools.datamodel.entity/EntityModel.id=Идентификатор
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usually, ID doesn't require translation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

io.jmix.datatools.datamodel.entity/AttributeModel.dbType=БД тип
io.jmix.datatools.datamodel.entity/AttributeModel.id=Идентификатор
io.jmix.datatools.datamodel.entity/AttributeModel.isMandatory=Обязательный?
io.jmix.datatools.datamodel.entity/AttributeModel.isNullable=Нулевой?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any other options for translation?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

* limitations under the License.
*/

@NonNullApi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for entity package, because you can get/set nulls for any attribute.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

}

dataModelManager.setFilteredModels(entityModelsDl.getContainer().getItems());
UI.getCurrent().getPage().open("datatl/data-diagram");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Add a comment, that you use UI.getCurrent().getPage().open intentionally to open a new browser tab.
  2. May need some delegate here so that a TabbedMode can open a new application tab instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As for the DataTools add-on, everything is ready. All that remains is to implement mutual support from the private repository.

try {
pattern = Pattern.compile(userInput, Pattern.CASE_INSENSITIVE);
} catch (PatternSyntaxException pse) {
entityNameFilter.setErrorMessage("Regular expression syntax is invalid");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MUST be a localized message!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


protected void applyLoadContextWithFiltering(List<String> findedEntityNames) {
if (findedEntityNames.isEmpty()) {
entityNameFilter.setErrorMessage("Entities not found");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MUST be a localized message!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<view xmlns="http://jmix.io/schema/flowui/view"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something went wrong:

Image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

<layout alignItems="STRETCH"
expand="contentBox"
classNames="jmix-data-model-list-view-layout">
<hbox id="buttonsPanel" classNames="buttons-panel">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. I still think that the Search button is redundant.
Image
  1. <details> is unnecessary complication and breaks layout (see the screenshot above). A simple placeholder will do the trick + you have tooltip for detailed info.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


io.jmix.datatools.datamodel.app/EngineType=Engine type
io.jmix.datatools.datamodel.app/EngineType.MERMAID=Mermaid
io.jmix.datatools.datamodel.app/EngineType.PLANTUML=Plantuml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it?

* in a Base64-like format for further sending as a URL parameter
*/
public interface TransferProgressNotifier {
public interface PlantUMLEncoder {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PlantUmlEncoder


Registration addTransferProgressListener(TransferProgressListener listener);
/**
* Provides encoding in a base64-like format
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Format JavaDoc (everywhere).

  1. Missing blank line before params
  2. Missing dots

See: https://www.oracle.com/technical-resources/articles/java/javadoc-tool.html

* limitations under the License.
*/

@Internal
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Internal looks redundunt.


import java.nio.charset.StandardCharsets;

public class PlantUMLEncoderImpl implements PlantUMLEncoder {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PlantUmlEncoderImpl

}

@Subscribe("entityModelsDataGrid")
public void onEntityModelsDataGridItemClick(final ItemClickEvent<EntityModel> event) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DataGrid provides the Selection listener. You must use it instead. Currently removing selection doesn't clear attributes

}
}

private class EntityNameUrlQueryParametersBinder extends AbstractUrlQueryParametersBinder {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

System checkbox also must be included into URL query params

@Subscribe
public void onInit(final InitEvent event) {
entityNameFilterQueryParameters.registerBinder(new EntityNameUrlQueryParametersBinder());
setDataStoreNames();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dataStoreNames can be initialized in the load delegate, before they are used

}

@Subscribe("entityNameFilter")
public void onEntityNameFilterComponentValueChange(final AbstractField.ComponentValueChangeEvent<TypedTextField<String>, String> event) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. It's better to subscribe to `TypedValueChange``
  2. Strings.isNullOrEmpty(event.getValue())

protected void initEntityNameFilterTooltip() {
JmixButton helperButton = createHelperButton();
Tooltip tooltip = entityNameFilter.getTooltip();
helperButton.addClickListener(e -> tooltip.setOpened(!tooltip.isOpened()));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still unclear why we handle button clicks if tooltip is shown by hover

@Ki10V01T Ki10V01T removed their assignment Jan 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants