Skip to content

Commit

Permalink
New UI to access the ontouml2gufo service (#49)
Browse files Browse the repository at this point in the history
* WIP - checkbox tree for diagrams and model

* added dynamic icons to the tree

* improved icon setting.

* wip - added option to choose between trees

* Save user config when exporting to GUFO

* wip - selection tree - retrieving nodes

* fixed window control

* created new constructors.

* fix bug when calling class constructor

* added comments and removed others.

* Moved icons

* wip - package tree explorer

* now models and packages have priority in the package tree.

* added new model elements to package tree

* added option to check class without checking attributes

* fix attribute selection

* check all same objects in the tree

* fixed identation

* fixed multiple selection when have commom objects in the selection.

* fixed selection for classes

* now the tree is saving in the configurations

* fixed attributes when selecting classes

* fixed model snapshot when selecting generalization sets

* consider IDiagramUIModel as its parent element

* now nodes of the tree are being inserted sorted.

* now tree is organized per type AND alphabetically

* added associations and generalizations to the package tree

* select classes of the same type of the attribute selected.

* check types for subtree

* request improved

* improved tree cell renderer

* 1st version export view

* new export to gufo window finished

* fixed diagram saving element

* added new icons

* new icons

* icon for package changed

* fixed model building

* improved selection for similar node

* improved threads

* changed icon for association end

* name for association end

* changed name root element for diagram tree

* fixed nullpointer

* add labels for combos

* resize window false

* prevent window export to be opened twice

* prevent config window to be opened twice

* changed UI export

* removed unused component

* adjust in UI

* adjust in UI

* improved layout

* fixed label

* layout improvement

* adjust

* new layout for export - wip

* layout improvement - wip

* added table

* added packages tab

* Changed labels

* Added default language option

* layout adjust

* update

* ui updated

* adjust ui

* Adjusted labels

* Set Base IRI default value

* UI fixes

* changed default behavior for tables

* get json string from tables

* generating json to send transformation to server

* Bugfix on allowed nature serialization

* Updates export file format and datatype serialization

* Minor refactoring

* Bugfix tag removal on apply meta-properties

* Updates meta-property serialization

* Minor presentation issue

* Bugfix on suggested stereotypes

* Bugifx on gufo options export

* fixed model building for tree and package

* added port number to the default server

* code improved

* adjusted images

* select generalizations when g_set is selected

* fixed tree for diagram and package views

* fixed serialization

* fixed name of the generalizations in the tree

* Fixed element and package mapping serialization

Removed duplicate code

* General code improvements

* Smart painting based on restrictedTo meta-property

* Fixed bugs related to tagged values

* Updates listeners for restrictedTo inference

* Updates inference criteria

* Updates ApplyProperties

* Improving manipulation of tagged values

* Updates interaction with tagged values

* BugFix

 - Add listeners in projects that were "not created" (when the tool open without opening an existing project)

- Binds tagged value definitions to to stereotypes instead of simply adding them to the stereotype's tagged value definition container

* Bugfix and cleanup

* Bugfix

Updates color when adding existing model element to diagram

* Updates smart modeling of historical roles

* BugFixes and updates menu ordering, menu access, and color scheme

* Bugfix historicalRole rule

* Updates «historicalRoleMixin»

* Updates applicable stereotype based on generalization

* Updates association constraints JSON file

* Updates association constraints JSON file

* Updates ReportErrorAction

* Updates guides and bug report

* Updates README

* Updates images size

* Updates report error URL

* Updates README

* Updates plugin update feature

* Updates README

* Bugfix default cardinalities

* Updates situations support

* Updates README

Co-authored-by: Tiago Prince Sales <tiago.princesales@unibz.it>
Co-authored-by: Claudenir M. Fonseca <claudenirmf@gmail.com>
  • Loading branch information
3 people authored Aug 4, 2020
1 parent 0247b4d commit 2367a82
Show file tree
Hide file tree
Showing 68 changed files with 6,749 additions and 3,167 deletions.
181 changes: 160 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,103 @@ This project contains a [Visual Paradigm](https://www.visual-paradigm.com/) plug
This project is defined under the umbrella of the [OntoUML Server](https://github.com/OntoUML/ontouml-server) project and is currently a proof of concept.

If you are interested to know more, feel free to open an issue to provide feedback on the project or reach our team members for more specific cases:

* [Claudenir M. Fonseca](https://github.com/claudenirmf)
* [Tiago Prince Sales](https://github.com/tgoprince)
* [Lucas Bassetti](https://github.com/LucasBassetti)
* [Victor Viola](https://github.com/victorviola)

## Contents

* [Overview](#overview)
* [User Instructions](#user-instructions)
* [Developer Instructions](#developer-instructions)
* [Report Errors](#report-errors)
* [FAQ](#faq)

___

## Overview

The **OntoUML Plugin for Visual Paradigm** adds to any version of Visual Paradigm features designed for OntoUML modelers. These features range from enabling OntoUML stereotypes in class diagrams to model verification and transformation.

WARNING: some more advanced features are based on web services that process your model remotely. The software processing these models is also [openly available](https://github.com/OntoUML/ontouml-server) and if you prefer to have your models processed in your own server, you are able to set it up and change the server URL in the plugin's settings.

### Features

#### OntoUML Enhanced Modeling

Stereotypes and meta-properties that are essential to OntoUML modeling are easily available to classes, associations and attributes with a simple right-click.

Notice that beyond the full list of stereotypes, a dynamic list of stereotypes is also available. This dynamic list is usually preferred during modeling as it filters wrong stereotypes for your class or association based on, respectively, their super/sub classes and their associated classes. The full list, however, tends to provide a faster and more flexible option during model fixing and refactoring.

![GIF showing a OntoUML model being edited](./resources/feature-modeling.gif)

![A screenshot of a suggested list of stereotypes in a context menu](./resources/feature-suggested-stereotypes.png)

![A screenshot of meta-properties editing in context menu](./resources/feature-meta-properties.png)

![A screenshot of restricted instances menu selection](./resources/feature-restricte-to.png)

Try selecting multiple elements to fast update your models!

#### Smart Paint

Automatic diagram painting based on the possible instances of classes with highlighted ultimate sortals (i.e., «kind», «collective», «quantity», «relator», «mode», and «quality») for improved model readability.

![A screenshot of an automatically painted diagram](./resources/feature-smart-paint.png)

#### Smart Modeling

Smart modeling allows the plugin to set default values to OntoUML model elements based on their stereotypes that are different from the defaults of UML speeding up modeling.

Since the Smart Paint feature depends on the "restrictedTo" meta-property, it is directly affected by Smart Modeling (responsible for assigning this meta-property).

#### Model Verification and Diagram Verification

Automatic verification of OntoUML syntactical rules which are reported to the user to manage. At the moment the list of constraints is being re-developed and users may find that new checks were introduced during the period they work on their products.

The Diagram Verification feature performs the verification of the whole model but only displays issues about elements present in the currently open diagram, facilitating the user's task of fixing models.

![A gif exemplifying the model verification feature](./resources/feature-verification.gif)

#### Model Transformation to OWL with gUFO

Model transformation into OWL with support of the [Lightweight Implementation of the Unified Foundational Ontology (UFO) - gUFO](https://nemo-ufes.github.io/gufo/).

Users must select the elements that shall be exported to gUFO either selecting from the model or from the desired diagrams. A number of options may also be set by the user for the transformation.

**WARNING**: the transformation feature require the presence of no verification errors among the exported entities. In addition, partial transformations of the model should be executed with care as they may introduce violations of some syntactical constraint.

![A screenshot showing the "transformation to gUFO" window](./resources/feature-gufo.png)

#### Continuos Updates

The remote features are constantly updated and any fixes to them you not require you to update your Visual Paradigm plugin.

And last, but not least, this project is supported by the [OntoUML.org](https://ontouml.org/) community and its set of features will only grow, incorporating new and updated OntoUML technologies.

![A screenshot showing the toolbar of the OntoUML plugin](./resources/feature-toolbar.png)

In order to update to a new version of the plugin, please download the latest [release](https://github.com/OntoUML/ontouml-vp-plugin/releases) as a ZIP file and select it through the "Update Plugin" button in the plugin (available from version 0.3.0).

Back to [top](#ontouml-plugin-for-visual-paradigm).

___

## User Instructions

To install the **OntoUML Plugin for Visual Paradigm**, please go to our [releases page](https://github.com/OntoUML/ontouml-vp-plugin/releases).
To **install** or **update** the **OntoUML Plugin for Visual Paradigm**, please go to our [releases page](https://github.com/OntoUML/ontouml-vp-plugin/releases) and download the ZIP file `ontouml-vp-plugin` in the latest release. Then go to `Help > Install Plugin` in the top of your window and, after clicking `Install from a zip of plugin` and `Next`, select the download release.

![Install plugin window](./resources/toolbar-help-install.png)

![Install plugin window](./resources/install-plugin-dialog.png)

For more details, check out this [guide](https://knowhow.visual-paradigm.com/openapi/how-to-deploy-plugins-to-vp-application/).

Back to [top](#ontouml-plugin-for-visual-paradigm).

___

## Developer Instructions

Expand All @@ -26,39 +115,38 @@ To install the **OntoUML Plugin for Visual Paradigm**, please go to our [release

#### Setting up

1. Clone the project

`git clone https://github.com/OntoUML/ontouml-vp-plugin.git`
1. Clone the project

`git clone https://github.com/OntoUML/ontouml-vp-plugin.git`

2. Open `pom.xml` and set the value of the variables listed below:

2.1. Set the path to the folder in which the Visual Paradigm application is located:

```xml
<visualparadigm.app.dir>
/Applications/Visual Paradigm.app/Contents/Resources/app
</visualparadigm.app.dir>
```

This path is typically:
- On Windows: `C:\Program Files\Visual Paradigm CE 16.1`
- On macOS: `/Applications/Visual Paradigm.app/Contents/Resources/app/`

* On Windows: `C:\Program Files\Visual Paradigm CE 16.1`
* On macOS: `/Applications/Visual Paradigm.app/Contents/Resources/app/`

2.2. Set the path to Visual Paradigm's plugin folder

```xml
<visualparadigm.plugin.dir>
/Users/<YOUR_USERNAME>/Library/Application Support/VisualParadigm/plugins
</visualparadigm.plugin.dir>
```

This path is typically:
- On Linux: `~/.config/VisualParadigm/plugins/`
- On Windows: `C:\Users\<YOUR_USER_NAME>\AppData\Roaming\VisualParadigm\plugins\`
- On macOS: `/Users/<YOUR_USERNAME>/Library/Application Support/VisualParadigm/plugins/`

* On Linux: `~/.config/VisualParadigm/plugins/`
* On Windows: `C:\Users\<YOUR_USER_NAME>\AppData\Roaming\VisualParadigm\plugins\`
* On macOS: `/Users/<YOUR_USERNAME>/Library/Application Support/VisualParadigm/plugins/`

#### Maven Commands

Expand All @@ -67,8 +155,8 @@ On Windows, replace `./mvnw` for `./mvnw.cmd`

In any OS, to invoke your local Maven installation instead of the wrapper, replace `./mvnw` with `mvn`.

* To **compile** the plugin, run:
* To **compile** the plugin, run:

```shell script
$ ./mvnw compile
```
Expand Down Expand Up @@ -98,10 +186,10 @@ In any OS, to invoke your local Maven installation instead of the wrapper, repla
```

Note that before running this command, you should install the plugin. That can be achieved by running:

```shell script
$ ./mvnw install exec:exec
```
```

* To **clean** the built files, run:

Expand All @@ -111,3 +199,54 @@ In any OS, to invoke your local Maven installation instead of the wrapper, repla

This does not remove the installed files, just the `target` folder and its contents.

Back to [top](#ontouml-plugin-for-visual-paradigm).

___

## Report Errors

In case you are reading this, thank you for interesting on contributing to our efforts by submitting your questions/suggestions or reporting errors in our tool.

If you have a GitHub account, head over to our [issues section](https://github.com/OntoUML/ontouml-vp-plugin/issues) and submit bugs, suggestions, or questions.

If you don't have a GitHub account but still would like to contribute by reporting an error in our plugin, please fill in this [form](https://forms.gle/btx7CDSy9kn5yb3WA) sharing as many details as you wish. We will be creating a issue to discuss and solve any problems and improve our tool.

Before submitting issues, however, search for [previous issues](https://github.com/OntoUML/ontouml-vp-plugin/issues) or questions in our [FAQ](#faq) as there may already be a solution to your problem.

Also, the more detailed your issue the better. Therefore, we encourage you to share with us details on what happened, screenshot, project files (either `.vpp` files or [exported XML projects](https://www.visual-paradigm.com/support/documents/vpuserguide/124/218/6848_exportingxml.html)), and Visual Paradigm logs (see [how to retrieve Visual Paradigm's log](https://knowhow.visual-paradigm.com/technical-support/vp-log/)). Remember that the issues you post (differently from the [form](https://forms.gle/btx7CDSy9kn5yb3WA)) are public.

Back to [top](#ontouml-plugin-for-visual-paradigm).

___

## FAQ

* [Why do I get the error message "The ID [...] is already in use"?](#why-do-i-get-the-error-message-"the-id-[...]-is-already-in-use")

* [Why Protégé gives me an error message when I try to open my ontology exported to gUFO?](#why-protégé-gives-me-an-error-message-when-i-try-to-open-my-ontology-exported-to-gufo)

* [I had an error while updating the plugin through the "Update Plugin" button and now it does not work](#I-had-an-error-while-updating-the-plugin-through-the-"Update-Plugin"-button-and-now-it-does-not-work)

### Why do I get the error message "The ID [...] is already in use"?

![Error message: ID already in use](./resources/faq-id-in-use.png)

Each Visual Paradigm plugin must (i) have an ID, and (ii) be installed in a specific folder. If you are updating to a new version of the plugin, it may occur that the name of the folder has changed. In this case, Visual Paradigm will think that you are trying to install a new plugin with an ID already in use instead of updating it.

![Install plugin window](./resources/install-plugin-dialog-folder-path.png)

To solve this issue, go to the `plugins` folder listed in the "Install Plugin" window (see above) and delete your old plugin folder before installing the new version. You may be required to re-open the application for that to take effect.

### Why Protégé gives me an error message when I try to open my ontology exported to gUFO?

Some users reported issues when trying to open their ontologies on [Protégé](https://protege.stanford.edu/) after using the ["Export to gUFO"](#Model-Transformation-to-OWL-with-gUFO) feature. In order to avoid this problem, we recommend you to use stable releases of Protégé (the desktop version) and avoid beta releases. You can find the latest release on their [official website]((https://protege.stanford.edu/)) and their complete list of releases in this [link](https://protegewiki.stanford.edu/wiki/Protege_Desktop_Old_Versions).

Also, make sure that your machine is connected to the internet so Protégé can load the [gUFO](https://nemo-ufes.github.io/gufo/) ontology which is used but not included in the exported file.

If you still have problems opening your ontology, please [report it](#Report-Errors) so we can improve our solutions.

### I had an error while updating the plugin through the "Update Plugin" button and now it does not work

In that case, the error may have corrupted the previous installation. Please access the plugins folder of Visual Paradigm (instructions [here](#why-do-i-get-the-error-message-"the-id-[...]-is-already-in-use")) and manually remove old plugins' folders. After this, extract the new version you tried to update to into this (now empty) folder. If you have other Visual Paradigm plugins in these folder, there is no need to delete does, only the OntoUML one.

Back to [top](#ontouml-plugin-for-visual-paradigm).
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>it.unibz.inf.ontouml</groupId>
<artifactId>ontouml-vp-plugin</artifactId>
<version>0.0.2-SNAPSHOT</version>
<version>0.3.0-SNAPSHOT</version>

<name>OntoUML 2 Plugin for Visual Paradigm</name>

Expand Down
Binary file added resources/faq-id-in-use.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/feature-gufo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/feature-meta-properties.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/feature-modeling.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/feature-restricte-to.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/feature-smart-paint.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/feature-suggested-stereotypes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/feature-toolbar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/feature-verification.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/install-plugin-dialog-folder-path.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/install-plugin-dialog.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/toolbar-help-install.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
125 changes: 69 additions & 56 deletions src/main/java/it/unibz/inf/ontouml/vp/OntoUMLPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,74 +8,87 @@
import com.vp.plugin.model.IProject;
import com.vp.plugin.model.factory.IModelElementFactory;

import it.unibz.inf.ontouml.vp.listeners.DiagramListener;
import it.unibz.inf.ontouml.vp.listeners.ModelListener;
import it.unibz.inf.ontouml.vp.listeners.ProjectDiagramListener;
import it.unibz.inf.ontouml.vp.listeners.ProjectListener;
import it.unibz.inf.ontouml.vp.listeners.ProjectModelListener;
import it.unibz.inf.ontouml.vp.utils.ViewUtils;

/**
*
* Implementation of VPPlugin responsible for configuring OntoUML Plugin's
* behaviour when loading and unload.
*
*
* @author Victor Viola
* @author Claudenir Fonseca
*
*/
public class OntoUMLPlugin implements VPPlugin {

public static final String PLUGIN_VERSION_RELEASE = "0.2.0";
public static final String PLUGIN_ID = "it.unibz.inf.ontouml.vp";
public static final String PLUGIN_NAME = "OntoUML Plugin";

public static IModelElement[] allModelElements;
public static boolean isPluginActive;

public static ModelListener MODEL_LISTENER = new ModelListener();
public static DiagramListener DIAGRAM_LISTENER = new DiagramListener();
public static ProjectModelListener PROJECT_MODEL_LISTENER = new ProjectModelListener();
public static ProjectDiagramListener PROJECT_DIAGRAM_LISTENER = new ProjectDiagramListener();

/**
*
* OntoUMLPlugin constructor. Declared to make explicit Open API requirements.
*
*/
public OntoUMLPlugin() {
// The constructor of a VPPlugin MUST NOT have parameters.
}
public static final String PLUGIN_VERSION_RELEASE = "0.3.0";
public static final String PLUGIN_ID = "it.unibz.inf.ontouml.vp";
public static final String PLUGIN_NAME = "OntoUML Plugin";
public static final String PLUGIN_REPO = "https://github.com/OntoUML/ontouml-vp-plugin/";

/**
*
* Called by Visual Paradigm when the plugin is loaded.
*
* @param pluginInfo
*
*/
@Override
public void loaded(VPPluginInfo pluginInfo) {

ProjectManager pm = ApplicationManager.instance().getProjectManager();
ProjectListener projectListener = new ProjectListener();
IProject p = pm.getProject();
p.addProjectListener(projectListener);
p.addProjectDiagramListener(OntoUMLPlugin.PROJECT_DIAGRAM_LISTENER);
p.addProjectModelListener(OntoUMLPlugin.PROJECT_MODEL_LISTENER);

OntoUMLPlugin.allModelElements = pm.getSelectableStereotypesForModelType(IModelElementFactory.MODEL_TYPE_CLASS,
p, true);

}
public static IModelElement[] allModelElements;
public static boolean isPluginActive;

private static boolean isExportToGUFOWindowOpen;
private static boolean isConfigWindowOpen;
private static ProjectListener projectListener;

/**
* OntoUMLPlugin constructor. Declared to make explicit Open API requirements.
*/
public OntoUMLPlugin() {
// The constructor of a VPPlugin MUST NOT have parameters.
isExportToGUFOWindowOpen = false;
isConfigWindowOpen = false;
System.out.println("OntoUML Plugin (v" + PLUGIN_VERSION_RELEASE +") loaded successfully.");
}

/**
* Called by Visual Paradigm when the plugin is loaded.
*
* @param pluginInfo
*/
@Override
public void loaded(VPPluginInfo pluginInfo) {
final ProjectManager pm = ApplicationManager.instance().getProjectManager();
final IProject p = pm.getProject();

projectListener = new ProjectListener();
p.addProjectListener(projectListener);

OntoUMLPlugin.allModelElements =
pm.getSelectableStereotypesForModelType(IModelElementFactory.MODEL_TYPE_CLASS, p, true);
}

/**
* Called by Visual Paradigm when the plugin is unloaded (i.e., Visual Paradigm
* will be exited). This method is not called when the plugin is reloaded.
*/
@Override
public void unloaded() {
}

public static void setExportToGUFOWindowOpen(boolean open) {
isExportToGUFOWindowOpen = open;

}

public static boolean getExportToGUFOWindowOpen() {
return isExportToGUFOWindowOpen;
}

public static void setConfigWindowOpen(boolean open) {
isConfigWindowOpen = open;

}

public static boolean getConfigWindowOpen() {
return isConfigWindowOpen;
}

/**
*
* Called by Visual Paradigm when the plugin is unloaded (i.e., Visual Paradigm
* will be exited). This method is not called when the plugin is reloaded.
*
*/
@Override
public void unloaded() {
public static void reload() {
ViewUtils.log("Reloading plugin: "+PLUGIN_ID);
ApplicationManager.instance().reloadPluginClasses(PLUGIN_ID);
// TODO: try to integrate listener to the reload process
}

}
Loading

0 comments on commit 2367a82

Please sign in to comment.