Martini Data Model Editor
Overview
The Martini Data Model Editor provides a visual interface for creating, modifying, and managing data model properties within your Martini packages. This visual approach helps you build complex data structures efficiently while maintaining clear visibility of property relationships and configurations.
What You Will Learn
- How to open, navigate, and configure the Data Model Editor
- How to create, modify, organize, and manage data model properties
- How to add comments and search properties within a model
- How to preview models in JSON, XML, and YAML formats
When To Use This
Use the Data Model Editor to:
- Build and organize the structure of data models
- Define and manage model properties
- Visually inspect and validate models
Prerequisites
- Martini Designer installed and running
- A Martini Package in the active workspace
- A Data Model in the package
Data Model Editor Interface
The Data Model Editor interface consists of two primary components that work together to provide model editing capabilities. The editor toolbar contains the tools you need for manipulating properties, while the canvas displays your model structure in an interactive tree view.
Opening the Data Model Editor
To open the Data Model Editor:
- Open the Navigator view
- Locate your target Data Model
- Double-click the data model, or right-click and select Open
Expected result: The Data Model Editor opens displaying the model structure in the canvas with the editor toolbar visible above.
Data Model Editor Toolbar Functions
The editor toolbar provides functions for managing your data model properties:
| Icon | Function | Description |
|---|---|---|
| Add | Opens dropdown menu of available property types for selection | |
| Delete | Removes selected properties from the model | |
| Show Configuration | Opens the model's meta-properties in the Configuration view | |
| / | Move Up/Down | Reorders selected properties within their hierarchy level |
| / | Move Left/Right | Modifies nesting levels of selected properties |
| / | Collapse/Expand All | Controls visibility of all nested properties in the model |
| Find | Searches properties by text matching against names and comments | |
| More Options | Provides additional viewing options |
Data Model Editor Canvas
The canvas displays your data model as an interactive tree structure where you can directly manipulate properties. Key features include:
- Visual Property Display: Properties are shown with icons indicating their data types
- Hierarchical Structure: Nested properties appear indented under their parent model properties
- Direct Interaction: Canvas supports clicking, drag-and-drop operations, and context menu access
Adding Data Model Properties
The Data Model Editor offers multiple methods for adding properties to accommodate different working styles and efficiency preferences. Property placement follows specific rules based on your current selection state and the type of property selected.
Property Placement Rules
Understanding where new properties will be added helps you build your model structure efficiently:
- No Property Selected: New properties are added at the root level at the very bottom of the model
- Property Selected (Non-Model): New properties are added directly below the selected property at the same hierarchy level
- Model Property Selected: New properties are added at the bottom inside the selected model as child properties
Methods for Adding Properties
You can add properties using any of the following methods:
Editor Toolbar Method:
- Click Add in the editor toolbar
- Select your desired property type from the dropdown menu
Context Menu Method:
- Right-click in the desired location on the canvas
- Hover over Add in the context menu
- Select the property type from the submenu
Content Assist Method:
- Press the key to trigger content assist
- Type the property type name in the search bar or scroll through options
- Select the desired property type to add it
Keyboard Shortcuts for Property Types:
| Property Type | Keyboard Shortcut |
|---|---|
| Big Decimal | + + |
| Big Integer | + + |
| Boolean | + |
| Byte | + |
| Byte Array | + + |
| Character | + |
| Date | + |
| Double | + |
| Float | + |
| Integer | + |
| Long | + |
| Model | + |
| Object | + + |
| Short | + |
| String | + |
Expected result: The new property appears in the model tree at the appropriate location based on your selection context, ready for configuration.
Property Configuration Management
Property configuration through the Configuration view allows you to set meta-properties that control behavior, validation, and metadata. This integration between the editor and Configuration view provides comprehensive property customization capabilities.
Accessing Data Model Configuration
Open the data model configuration to set root-level meta-properties:
- Click Show the model Configuration in the editor toolbar, or
- Right-click on empty canvas space and select Show Configuration
Expected result: The Configuration view opens displaying root-level meta-properties for editing.
Accessing Individual Property Configuration
Configure specific property meta-properties through multiple access methods:
Hover Method:
- Hover over the target property in the model tree
- Click the Configure button that appears
Context Menu Method:
- Right-click on the target property in the model tree
- Select Show Configuration from the context menu
Selection Method (when Configuration view is open):
- Click on the target property in the model tree
- The Configuration view automatically updates to show the property's meta-properties
Expected result: The Configuration view displays the selected property's meta-properties for modification.
Configuration View Integration
The Configuration view works seamlessly with the Data Model Editor to provide real-time property management. Changes made in the Configuration view are immediately reflected in the model tree, and vice versa. This bidirectional synchronization ensures your model structure and property settings remain consistent throughout the editing process.
Property Editing Operations
Property editing encompasses renaming, type conversion, array management, and structural modifications. These operations allow you to refine your data model as requirements evolve without rebuilding the entire structure.
Renaming Properties
Change property names using your preferred editing method:
Direct Editing Method:
- Double-click on the target property name in the model tree
- Enter the new name
Context Menu Method:
- Right-click on the property
- Select Rename
- Enter the new name
Keyboard Shortcut Method:
- Select the property
- Press
- Enter the new name
Configuration View Method:
- Open the Configuration view for the property.
- Modify the Name field
Expected result: The property displays the new name in the model tree and Configuration view.
Converting Property Data Types
Transform property types without losing structural position:
- Right-click on the target property
- Hover over Convert To in the context menu
- Select the desired data type from the submenu
Expected result: The property icon changes to reflect the new type, and the Type field updates in the Configuration view. Any meta-properties shared by both the original and new type retain their values.
Important Consideration for Model Properties: Converting a model property that contains nested properties will remove all its child properties.
Managing Property Arrays
Convert properties to arrays or remove array designation using multiple methods:
Context Menu Method:
- Right-click on the target property
- Hover over Convert To
- Select Toggle Array
Keyboard Shortcut Method:
- Select the target property
- Press + +
Configuration View Method:
- Open the Configuration view for the property.
- Check or uncheck the Array field to enable or disable array status
Expected result: Array properties display the overlay icon, indicating their array status.
Property Organization and Structure
Effective property organization ensures your data models remain maintainable and logical as they grow in complexity. The editor provides multiple methods for reordering and restructuring properties to match your data requirements.
Reordering Properties Within Hierarchy Levels
Move properties up or down within their current nesting level:
Toolbar Method:
- Select one or more properties
- Click Move Up or Move Down
Drag-and-Drop Method:
- Click and hold the property you want to move
- Drag to the desired position in the model tree
- Release to place the property
Keyboard Shortcuts:
- Move Up: +
- Move Down: +
Expected result: Properties change position while maintaining their nesting level.
Modifying Property Nesting Levels
Adjust property hierarchy by moving properties into or out of model properties:
Toolbar Method:
- Select the target properties
- Click Move Left or Move Right
Drag-and-Drop Method:
- Select and hold the property you wish to move
- Drag it to the target location in the model tree
- Release to drop it into place
Keyboard Shortcuts:
- Move Left: +
- Move Right: +
Nesting Behavior:
- Moving Left: Nested properties move out of their parent model and position below it
- Moving Right: Properties nest within the nearest model property above them
Expected result: Property hierarchy adjusts according to your structural requirements.
Property Documentation
Comments provide documentation for your data model properties, clarifying their purpose and usage requirements. They help both your team and external developers who may use your models, whether in a Martini package that is imported from another project or published to the Lonti Marketplace, or as part of a REST API that relies on the models, such as an OpenAPI schema.
The editor supports simple text comments as well as rich markdown formatting, making it easy to create clear and readable documentation.
Adding Simple Property Comments
Add quick, single-line comments directly in the model tree:
Context Menu Method:
- Right-click on the target property
- Select Edit Comments
- Type your comment directly in the canvas
Keyboard Shortcut Method:
- Select the target property
- Press +
- Enter your comment text
Expected result: Comments appear beside the property's name in the model tree for immediate reference.
Managing Rich Markdown Comments
Create detailed documentation with markdown formatting through the Configuration view:
- Open the Configuration view for the property.
- Enter markdown-formatted text either in the Comments field or on the Comments tab.
- Use the viewing options to control display format:
- Show source only : Display raw markdown text
- Show source and preview : Split view with both formats
- Show preview only : Rendered markdown output
Expected result: Markdown comments are saved and displayed beside the property's name in the model tree as plain text, with longer comments truncated as needed.
Full formatting remains visible in the Comments field or tab when the preview is enabled.
Comment Visibility
Toggle comment display throughout your model:
- Click More Options in the editor toolbar
- Select Toggle Comments from the dropdown menu
Keyboard Shortcut: + +
Expected result: All property comments show or hide based on your preference, helping you focus on structure or documentation as needed.
Data Model Search and Navigation
The search functionality helps you quickly locate specific properties within complex data models, supporting text matching across property names, reference model names, and visible comment content.
Searching for Properties in Large Models
Use the built-in search to find properties efficiently:
Toolbar Search Method:
- Click Find in the editor toolbar
- Enter your search term in the search field
- View highlighted matches in the model tree
Keyboard Shortcut Method:
- Press +
- Type your search query
- Navigate through highlighted results
Expected result: Matching properties are highlighted in the model tree, making them easy to identify and navigate to.
Search Scope and Matching Behavior
The search function covers multiple aspects of your data model:
- Property Names: Direct text matching against all property names in the model
- Reference Model Names: Searches referenced model names displayed in parentheses
- Visible Comments: Matches text in comments as displayed in the model tree (truncated content is not searched)
- Case Sensitivity: All searches are case-insensitive for broader matching
Model Visualization and Preview Formats
The Data Model Editor supports multiple visualization formats to help you understand your data structure from different perspectives and validate how your model will appear in various contexts.
Accessing Alternative Format Previews
Switch between different representation formats for your data model:
- Click More Options in the editor toolbar
- Select your desired preview format:
- Show JSON Preview: Display properties in JSON structure format
- Show XML Preview: Display properties in XML schema format
- Show YAML Preview: Display properties in YAML structure format
Expected result: The canvas switches to show your model in the selected format, providing a different preview of your data structure.
Returning to Model Tree View
Switch back to the interactive editing view from any preview format:
- Click the Back to Model Tree button (appears when in preview mode)
Expected result: The editor returns to the standard model tree interface where you can continue editing properties and structure.
Format Preview Benefits
Each preview format serves specific validation and understanding purposes:
- JSON Preview: Validates how your model will serialize for REST APIs and web services
- XML Preview: Shows XML schema structure for SOAP services and XML-based integrations
- YAML Preview: Displays structure for configuration files and YAML-based data exchange
These previews help ensure your data model design will work correctly in your implementations.
Property Deletion and Cleanup
Property deletion operations help you maintain clean, accurate data models by removing unnecessary or incorrect properties. Understanding deletion behavior prevents accidental data loss and maintains model integrity.
Deleting Model Properties
Remove model properties using your preferred method:
Toolbar Method:
- Select the target properties
- Click Delete in the editor toolbar
Keyboard Method:
- Select the target properties
- Press the key
Context Menu Method:
- Right-click on the selected target properties
- Select Delete from the context menu
Expected result: The properties are removed from the model structure immediately.
Understanding Cascading Deletion
When deleting model properties with nested structures, be aware of cascading effects:
- Model Properties: Deleting a model property removes all its nested child properties
- Reference Impact: Deleting properties that reference other models only removes the reference, not the source model
This behavior ensures model consistency but requires careful consideration when working with complex nested structures.
Troubleshooting Data Model Editor Issues
| Problem | Detection | Cause | Fix |
|---|---|---|---|
| Drag-and-drop fails when nesting properties | Property returns to original position | Target property name matches an existing property name within the target hierarchy level | Rename duplicate properties before attempting drag-and-drop operation |
| Model preview formats show errors | "Model not found" error appears | Referenced model is missing from current package, package dependencies are not configured, or referenced model was deleted | Add required package dependency or correct the Reference meta-property |
Helpful Resources
- Creating Data Models - Guide to creating data models
- Data Model References - Learn about referencing data models
- Data Model Property Types - Understanding available property types and their configurations
- Community Q&A: Martini Community
Have a Question? Post or search it here.