Skip to content

Commit

Permalink
Release 0.4.0 (#73)
Browse files Browse the repository at this point in the history
* Serialization of Enumeration Literals (#11)

* Included complete OntoUML stereotype list and improved JSON serialization (#9)

* All Steryotypes removed and OntoUML steryotypes added

on plugin start, remove all UML steryotypes both type class and association and install  OntoUML stereotypes.

* Fixed package name.

* buttons for load/unload ontoUML stereotypes

* improve the activation of the default stereotypes

when activate the default stereotype, removed the stereotypes that are  already in the classes.

* [WIP] print json schema for all elements in project. Still missing some features.

added testModel.vpp to the vpp projects folder

* added support for association and other types

* Testing commit

* [wip] added uri to the elements

* Ongoing integration

* Functional remote verification

Non-blocking, logged, remote verification.
Requires refactoring.

* Minor improvements

Bug-fixes and refactoring

* Minor fixes

* Improved generation and error display on LOG 

Transformation shall be updated to workaround limitations of GSON's serialization and improvements on OntoUML Schema.

* Changing Stereotypes with Right Click

* Experimenting with default color profiles

* Fixing GSON issue and ClassCastException

* Updating stereotypes

* Setting up configurations menu

* Configurations Menu

* General improvements

* General refactoring and bugfix

* General refactoring and bugfix #2

* Major Refactoring and Documentation

Classes yet to be refactored/documented:
 - ActivateOntoUMLPlugin
 - ActivateDefaultStereotypes
 - StereotypeUtils
 - CollectionAdapter
 - Most classes within package it.unibz.inf.ontouml.vp.model

* Model Export feature and refactoring

* Auto-coloring feature and icons update

* Minor improvements to auto-coloring

It now affects all views of the selected model element.

* Maven project (#7)

* maven project

* removed readme

* openapi.jar was added to the project folder in order to be executed out of the box using maven compile.

* changed folder name lib to repo / changed compiler to java 11 in pom.xml

* gitignore updated

* solved identation in git ignore file

* Revert "Merge branch 'development' into maven-project"

This reverts commit a72c78c, reversing
changes made to 1cd30e4.

* Update .gitignore

* Delete openapi.jar

* Update .gitignore

* Removed unused imports

* Update .gitignore

* Including debug dependencies

* Cleaning POM file

* added generation of zip file of the plugin

* Update README and .gitignore

Co-authored-by: Tiago Prince Sales <tgoprince@users.noreply.github.com>
Co-authored-by: Claudenir Morais Fonseca <claudenirmf@gmail.com>

* removed toolbar buttons and removed some options in configurations panel.

* cardinality updated

* removed comment

* Removed XML Export Window.

* removed if to test if model verification is enabled

* fixed url server verification

* Fixed string regex in AssociationEnd

* set timeout for 60s in request verification

* added some logs in verification and also added behavior to check if custom server is enabled before mounting the URL.

* Added all stereotypes

* Stereotype order

* Update stereotype serialization

* Removed unused import

* Coloring enabled by default

* Update Stereotypes.java

* updated associationEnd and Attribute cardinalities

* change aggregationkind when applying stereotypes and set abstract to true when aplying mixin stereotype to classes

* [WIP] - implementing new schema

* wip - corrections in model creation to adapt to the new schema

* remove propertyAssignment class.

* created reference class

* fixes

* fix

* Some updates

Ongoing changes

* added propertyAssignment build

* wip - added property assignment to reflect better tagged values, add DataType class as well.

* isDerived logic

* Removed <<historical>> stereotype.

<<historicalDependence>> should be used instead.

* Update .gitignore

* Removed Stereotypes.java

This class only responsibility was to add the prefix ontouml/2 or vp/custom to stereotypes on the serialization. We decided not to have this prefixes on the exchanged models anymore.

* Update ModelExportAction.java

* Removed Reload plugin button

* Bugfix null pointer on Association and Property constructors

* removed datatype class and included datatype constructor in class class. Removed AssociationEnd and Attribute classes because it will be handled by Property class.

* fixed associationclass

* propertyAssignments in all elements

* fixed setName and isDerived

* fixed property assignments for association end

* added some comments

* id was not being set in Package Element

* added description field to the elements

* if description is empty set attribut to null

* fixed Reference in Generalization constructor

* fixed reference in GeneralizationSet

* fixed tagged values when model element is not specified

* ready to be merged

* Improvements from code review

* Removed duplicated code and fixed transformation of missing propertyType

* Missing refactoring from tagged value extraction

* Update Class.java

Co-authored-by: Claudenir Morais Fonseca <claudenirmf@gmail.com>
Co-authored-by: Tiago Prince Sales <tgoprince@users.noreply.github.com>

* added Literal class for enumeration serialization

Co-authored-by: Viola <victorviola86@gmail.com>
Co-authored-by: Claudenir Morais Fonseca <claudenirmf@gmail.com>

* Hotfix: Null pointer exception on Class constructor (#13)

* fixed constructor - checked this.stereotypes for null before using.

* Update Class.java

Co-authored-by: Tiago Prince Sales <tgoprince@users.noreply.github.com>

* Serialization improvements on propertyAssignments and Generalization and GUI improvement on Model Export (#12)

* Included complete OntoUML stereotype list and improved JSON serialization (#9)

* All Steryotypes removed and OntoUML steryotypes added

on plugin start, remove all UML steryotypes both type class and association and install  OntoUML stereotypes.

* Fixed package name.

* buttons for load/unload ontoUML stereotypes

* improve the activation of the default stereotypes

when activate the default stereotype, removed the stereotypes that are  already in the classes.

* [WIP] print json schema for all elements in project. Still missing some features.

added testModel.vpp to the vpp projects folder

* added support for association and other types

* Testing commit

* [wip] added uri to the elements

* Ongoing integration

* Functional remote verification

Non-blocking, logged, remote verification.
Requires refactoring.

* Minor improvements

Bug-fixes and refactoring

* Minor fixes

* Improved generation and error display on LOG 

Transformation shall be updated to workaround limitations of GSON's serialization and improvements on OntoUML Schema.

* Changing Stereotypes with Right Click

* Experimenting with default color profiles

* Fixing GSON issue and ClassCastException

* Updating stereotypes

* Setting up configurations menu

* Configurations Menu

* General improvements

* General refactoring and bugfix

* General refactoring and bugfix #2

* Major Refactoring and Documentation

Classes yet to be refactored/documented:
 - ActivateOntoUMLPlugin
 - ActivateDefaultStereotypes
 - StereotypeUtils
 - CollectionAdapter
 - Most classes within package it.unibz.inf.ontouml.vp.model

* Model Export feature and refactoring

* Auto-coloring feature and icons update

* Minor improvements to auto-coloring

It now affects all views of the selected model element.

* Maven project (#7)

* maven project

* removed readme

* openapi.jar was added to the project folder in order to be executed out of the box using maven compile.

* changed folder name lib to repo / changed compiler to java 11 in pom.xml

* gitignore updated

* solved identation in git ignore file

* Revert "Merge branch 'development' into maven-project"

This reverts commit a72c78c, reversing
changes made to 1cd30e4.

* Update .gitignore

* Delete openapi.jar

* Update .gitignore

* Removed unused imports

* Update .gitignore

* Including debug dependencies

* Cleaning POM file

* added generation of zip file of the plugin

* Update README and .gitignore

Co-authored-by: Tiago Prince Sales <tgoprince@users.noreply.github.com>
Co-authored-by: Claudenir Morais Fonseca <claudenirmf@gmail.com>

* removed toolbar buttons and removed some options in configurations panel.

* cardinality updated

* removed comment

* Removed XML Export Window.

* removed if to test if model verification is enabled

* fixed url server verification

* Fixed string regex in AssociationEnd

* set timeout for 60s in request verification

* added some logs in verification and also added behavior to check if custom server is enabled before mounting the URL.

* Added all stereotypes

* Stereotype order

* Update stereotype serialization

* Removed unused import

* Coloring enabled by default

* Update Stereotypes.java

* updated associationEnd and Attribute cardinalities

* change aggregationkind when applying stereotypes and set abstract to true when aplying mixin stereotype to classes

* [WIP] - implementing new schema

* wip - corrections in model creation to adapt to the new schema

* remove propertyAssignment class.

* created reference class

* fixes

* fix

* Some updates

Ongoing changes

* added propertyAssignment build

* wip - added property assignment to reflect better tagged values, add DataType class as well.

* isDerived logic

* Removed <<historical>> stereotype.

<<historicalDependence>> should be used instead.

* Update .gitignore

* Removed Stereotypes.java

This class only responsibility was to add the prefix ontouml/2 or vp/custom to stereotypes on the serialization. We decided not to have this prefixes on the exchanged models anymore.

* Update ModelExportAction.java

* Removed Reload plugin button

* Bugfix null pointer on Association and Property constructors

* removed datatype class and included datatype constructor in class class. Removed AssociationEnd and Attribute classes because it will be handled by Property class.

* fixed associationclass

* propertyAssignments in all elements

* fixed setName and isDerived

* fixed property assignments for association end

* added some comments

* id was not being set in Package Element

* added description field to the elements

* if description is empty set attribut to null

* fixed Reference in Generalization constructor

* fixed reference in GeneralizationSet

* fixed tagged values when model element is not specified

* ready to be merged

* Improvements from code review

* Removed duplicated code and fixed transformation of missing propertyType

* Missing refactoring from tagged value extraction

* Update Class.java

Co-authored-by: Claudenir Morais Fonseca <claudenirmf@gmail.com>
Co-authored-by: Tiago Prince Sales <tgoprince@users.noreply.github.com>

* added new file dialog to export model. Also suggets filename.

* if no property assignment added - return null

* if a Generalization has stereotypes in both ends does not add this generalization to the model.

* export json

Changed view to File Dialog
Now suggests the same name of the last save

* Quick fix on name suggestion

* Removed unused semicolon

* Only serializes generalizations between classes or associations

* Update ModelElement.java

Co-authored-by: Claudenir Morais Fonseca <claudenirmf@gmail.com>
Co-authored-by: Tiago Prince Sales <tgoprince@users.noreply.github.com>

* Hotfix: Null pointer exception when reading outdate config file (#14)

* Bugfix

* Remove unnecessary sysout call

Co-authored-by: Claudenir Morais Fonseca <claudenirmf@gmail.com>

* Feature to disable associations dynamically (#15)

* added feature to disable associations dynamically

* Bugfix when applying <<mode>>, <<quality>>, <<relator>> and <<manifestation>>

* added missing source stereotype (Quality)

* Update ApplyStereotype.java

* Fixed category case when setting the possible relations

* changed types do HashMap

* removed powertype from the association stereotypes list and also removed some unused imports

* implementation changed to use a single map with all constraints.

* removed unused imports

* Update AssociationConstraints.java

* Minor improvements

Co-authored-by: Tiago Prince Sales <tgoprince@users.noreply.github.com>
Co-authored-by: Claudenir Morais Fonseca <claudenirmf@gmail.com>

* [WIP] Listeners and basic coloring.

* [WIP] coloring all model

* [WIP] Smart Coloring fixes

* fix in smart paint

* fixed unused code

* paint diagram button improved listeners

* if auto coloring disabled do not paint

* WIP added listeners when load the plugin. Still need to evaluate where the listeners should be.

* fixed mixins coloring

* fixed coloring to match mixin pattern

* fixed subkinds in a row

* Small fixes

* Avoids repeating code

* Renamed COLOR_NON_SORTAL to  COLOR_UNKNOWN

* fixes and removed unused code

* added smartpaint in applystereotype

It is been hard to deal with stereotype listener

* removed unused listeners

* Removed println() that I commited by mistake

* Update SmartColoring.java

* Menubar Icon update

* working for generalization changes

* Update OntoUML server URL

* removed unused imports

* Added a warning when the user clicks on smart paint and the auto coloring is set to false.

* fixed null pointer exception when removing generalization.

* Fixed NullPointerException when serializing generalizations

* Bugfix on my previous fix ;)

* added dialog box when user clicks in smart paint

* Updates Smart Paint actions and removes unused imports

* Updates listeners, improves readability and prevents exceptions

* todo's removed.

* Quick systout fix

* Syntax verification (#17)

* verification response warning dialog and messages in log panel

* improved log messages and created function to get icon path.

* Minor fixes

* Adds verification dialog method

* some http response handled and added some try/catch

* Updates dialogs in case of failure

Co-authored-by: Claudenir Morais Fonseca <claudenirmf@gmail.com>

* Connects plugin to the server for model transformation to gUFO (#18)

* Initial commit

* Connects to the server

* Minor issues

* addded verification for custom server in transformation to gufo also adapted verification function url building.

* added option to retry export to gUFO using the default server.

* added option to retry in verification service if service custom has problems

* Adds protection to Server Not Found

Co-authored-by: Viola <victorviola86@gmail.com>

* Smart meta properties feature (#27)

* set meta-properties whole model

* bug fixed when applying stereotypes for associations.

* set cardinalities if null or unspecified.

* update smartproperties.java to avoid duplicated code.

* set readonly only where it is true.

* fixed bug in cardinality setting.

* Fixed cardinality value on <<termination>>

* renamed smartProperties to SmartModelling. Moved functions from ApplyStereotype to SmartModelling class. Removed set meta properties from listeners and added to the class ApplyStereotype.

* Bugfix: HistoricalDependence

* Group all "smart modeling" features together

Plus: 
1. Material relations are 1..* by defaul only when relating roles.
2. subQuantityOf is, by default, readOnly=true on the part end

* Removed unused imports

* Created function to set default meta properties also for classes

* Cleaned up SmartModeling.java

Co-authored-by: Victor Viola <victor.viola@farfetch.com>
Co-authored-by: Tiago Prince Sales <tiago.princesales@unibz.it>

* Disable stereotypes as you model (#28)

Implement the features described in issues #23 and #26 

* disabling stereotypes as you model.

* removed unecessary comments

* added option in configurations to enable/disable smart modelling

* Fixed allowed supertypes of Subkind

* Subkinds cannot specialize Types

* fix in setting allowed stereotypes in generalizations

* fixed layout for configurations panel.

* Fixed null pointer when subtype or super type did not have stereotypes

* Enabling/disabling smart modeling applies to associations and classes

* Toggling smart modeling also impacts association default metaproperties

Co-authored-by: Victor Viola <victor.viola@farfetch.com>
Co-authored-by: Tiago Prince Sales <tiago.princesales@unibz.it>

* diagram verification

* added user logs to distinct between diagram/model verification. Also added protection to runs the diagram verification only if there is a class diagram opened.

* Adjusted messages display in dialogs displayed after verification is called

* Small improvements to the message log

* New Log Panel and highlight elements after verification.

* improved textArea in log panel. Now user cannot edit the text.

* open specification option in context menu / disable take me there if class is not in any diagram

* border between results in log panel

* Updates ViewUtils

* Updates ViewUtils

* changed log panel to use JList.

* Updates ViewUtils

* Apply stereotype feature works when multiple classes are selected (#39)

* apply multiple sterotypes at same time. Only works if all elements in the selection are the same.

* if selection has classes and associations selected at the same time validate rule for only the object that had the click.

* apply same stereotype for all elements selected

* fix update stereotype when selection multiple objects.

* when user selects more than one object do not apply constraints

* added new Fixed menu - now suggests stereotypes only when 1 class is selected or all selected classes have the same super class.

* fixed action behavior in context menu of the model explorer

* fixed context menu when selecting stereotypes from model explorer

Co-authored-by: Victor Viola <victor.viola@farfetch.com>

* Issue31 add progress bar (#44)

* apply multiple sterotypes at same time. Only works if all elements in the selection are the same.

* if selection has classes and associations selected at the same time validate rule for only the object that had the click.

* apply same stereotype for all elements selected

* fix update stereotype when selection multiple objects.

* when user selects more than one object do not apply constraints

* added new Fixed menu - now suggests stereotypes only when 1 class is selected or all selected classes have the same super class.

* fixed action behavior in context menu of the model explorer

* fixed context menu when selecting stereotypes from model explorer

* progressBar first version

* progress bar when calling diagram verification

* progresspanel - WIP

* fixes - wip

* progresbar with threads. Now user can cancel the request.

* fixed bug in case of exception or response null

* added message when user cancel the request.

* added progress bar to export to json after user selects the filename and file directory

* first close the progess bar then show the dialog

* added progress bar when exporting to gufo

* removed duplcated code.

* bug fixed when selecting an invalid endpoint

* bug fixed when handling model verification response

* added progress dialog to the functions that connects to the server. Improved the way the progress dialog works.

* improved in how the loading box closes.

* Fixed null pointer when canceling the model export

Co-authored-by: Victor Viola <victor.viola@farfetch.com>
Co-authored-by: Tiago Prince Sales <tiago.princesales@unibz.it>

* Made project compliant to Maven's  default folder structure

* Fixes on pom.xml

* Executing VP with plugin through Maven

* Added maven wrapper

* Skip installation of plugin on local maven directory

* Updates scripts

* Improved README.md

* Cleaned up run.sh

* Added build profiles to distinguish exec scripts

* added .bat script to mvn exec in windows

* Fixed unix run-vp script

* improved bat script

* Update README.md

* added version label in settings panel (#48)

* Added support for OntoUML tagged values(#37)

* Adds proper generation of stereotypes

* Updates apply stereotypes and serialization

* Working on tagged value overwrite

* Bug fix

* Updates class serialization

* Fix tagged value update

* Refactor methods

* Bugfix apply fixed menu

* Updates context menus for properties

* Updates properties menus

* Updated set order dialog

* Includes abstract nature

* Updates JSON serialization

* Bugfix

* BugFix

* Additional options added to the contextual menus

* Removes local maven variables from repo

* Updates Meta-Properties context menu

* Updates enabling of meta-properties context menu

Co-authored-by: Tiago Prince Sales <tiago.princesales@unibz.it>

* Bugfix duplicated tagged values

* New UI to access the ontouml2gufo service (#49)

* 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>

* Plugin Update Automation (#61)

* Retrieve releases from GitHub

* Updates release download

* Updates interfaces and download

* Updates periodic lookup for new releases

* Update plugin.xml and general bugfix

* Bugfix

* Improved plugin toolbar

* Extracted nested classes from ViewUtils

* General refactoring and update of releases serialization

* Refactoring

* Refactoring

* Refactoring

* BugFix

Replaces ZonedDateTime serialization to strings

* Refactoring

* Refactoring

* Fixed null pointer bug

Co-authored-by: Tiago Prince Sales <tiago.princesales@unibz.it>

* Language Updates (#64)

* Small fixes in the plugin

* Updated restrictedTo dialog

* Plugin version increased

* Minor change to color defaults

* Code refactoring

* Renamed method

* Added association constraints involving datatypes

* Enable isExtensional based on restriction

* Updates stereotypes to include isExtensional

Know bugs:
 - Suggested «characterization» from «quality» to «event»
 - Sortals keep restrictions after generalizations are deleted
 - Changing the stereotype while isExtensional = true does not return the value to false.

* Fixes smart paint for empty restrictedTo

* Fix updates to isExtensional

 - Changes isExtensional to false when "collective" is not the unique
value of restrictedTo
 - Prevents manual changes to isExtensional when prohibited

* Fixed behavior on enabling/desabling menu options on the class contextual menu

* Set navigability when applying a relation stereotype

* Update navigability

* Updates invert association

* Updates meta-property menu: isAbstract and isDerived

* Updates context menu for attributes

* Adds source and target meta-property menus

* Updates suggested stereotypes on both directions

* Updates association inversion warning dialog

* Added allowed associations by ontological nature

* Applies association constraints based on nature restrictions

* Code clean-up

* Added Maven plugin for automatic code formatting

* Add Github Action for styling the code in the Google Java Format

* Google Java Format

* BugFix invert association and reorganizes code

* Google Java Format

* Bugfixes

* Updates labels and stereotype suggestion for multiple selected elements

* Updates invertAssociation() and refactors code

* Google Java Format

* Bugfixes

Co-authored-by: Tiago Prince Sales <tiago.princesales@unibz.it>
Co-authored-by: Claudenir Fonseca <claudenirmf@gmail.com>
Co-authored-by: github-actions <>

* Disables UI elements

Disables duplicated "Invert Association" button

* 0.4.0

Co-authored-by: Tiago Prince Sales <tgoprince@users.noreply.github.com>
Co-authored-by: Viola <victorviola86@gmail.com>
Co-authored-by: Victor Viola <victor.viola@farfetch.com>
Co-authored-by: Tiago Prince Sales <tgoprince@gmail.com>
Co-authored-by: Tiago Prince Sales <tiago.princesales@unibz.it>
  • Loading branch information
6 people authored Oct 2, 2020
1 parent ca75123 commit a2f9e34
Show file tree
Hide file tree
Showing 112 changed files with 12,230 additions and 10,542 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Google Java Format

on: [push]

jobs:

formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2 # v2 minimum required
- uses: actions/setup-java@v1
with:
java-version: 11
- uses: axel-op/googlejavaformat-action@v3
with:
args: "--replace"
169 changes: 85 additions & 84 deletions .mvn/wrapper/MavenWrapperDownloader.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,105 +13,106 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.net.*;
import java.io.*;
import java.net.*;
import java.nio.channels.*;
import java.util.Properties;

public class MavenWrapperDownloader {

private static final String WRAPPER_VERSION = "0.5.6";
/**
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
*/
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";

/**
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
* use instead of the default one.
*/
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
".mvn/wrapper/maven-wrapper.properties";
private static final String WRAPPER_VERSION = "0.5.6";
/** Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided. */
private static final String DEFAULT_DOWNLOAD_URL =
"https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
+ WRAPPER_VERSION
+ "/maven-wrapper-"
+ WRAPPER_VERSION
+ ".jar";

/**
* Path where the maven-wrapper.jar will be saved to.
*/
private static final String MAVEN_WRAPPER_JAR_PATH =
".mvn/wrapper/maven-wrapper.jar";
/**
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to use
* instead of the default one.
*/
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
".mvn/wrapper/maven-wrapper.properties";

/**
* Name of the property which should be used to override the default download url for the wrapper.
*/
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
/** Path where the maven-wrapper.jar will be saved to. */
private static final String MAVEN_WRAPPER_JAR_PATH = ".mvn/wrapper/maven-wrapper.jar";

public static void main(String args[]) {
System.out.println("- Downloader started");
File baseDirectory = new File(args[0]);
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
/**
* Name of the property which should be used to override the default download url for the wrapper.
*/
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";

// If the maven-wrapper.properties exists, read it and check if it contains a custom
// wrapperUrl parameter.
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
String url = DEFAULT_DOWNLOAD_URL;
if(mavenWrapperPropertyFile.exists()) {
FileInputStream mavenWrapperPropertyFileInputStream = null;
try {
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
Properties mavenWrapperProperties = new Properties();
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
} catch (IOException e) {
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
} finally {
try {
if(mavenWrapperPropertyFileInputStream != null) {
mavenWrapperPropertyFileInputStream.close();
}
} catch (IOException e) {
// Ignore ...
}
}
}
System.out.println("- Downloading from: " + url);
public static void main(String args[]) {
System.out.println("- Downloader started");
File baseDirectory = new File(args[0]);
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());

File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
if(!outputFile.getParentFile().exists()) {
if(!outputFile.getParentFile().mkdirs()) {
System.out.println(
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
}
}
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
// If the maven-wrapper.properties exists, read it and check if it contains a custom
// wrapperUrl parameter.
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
String url = DEFAULT_DOWNLOAD_URL;
if (mavenWrapperPropertyFile.exists()) {
FileInputStream mavenWrapperPropertyFileInputStream = null;
try {
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
Properties mavenWrapperProperties = new Properties();
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
} catch (IOException e) {
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
} finally {
try {
downloadFileFromURL(url, outputFile);
System.out.println("Done");
System.exit(0);
} catch (Throwable e) {
System.out.println("- Error downloading");
e.printStackTrace();
System.exit(1);
if (mavenWrapperPropertyFileInputStream != null) {
mavenWrapperPropertyFileInputStream.close();
}
} catch (IOException e) {
// Ignore ...
}
}
}
System.out.println("- Downloading from: " + url);

private static void downloadFileFromURL(String urlString, File destination) throws Exception {
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
String username = System.getenv("MVNW_USERNAME");
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
Authenticator.setDefault(new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password);
}
});
}
URL website = new URL(urlString);
ReadableByteChannel rbc;
rbc = Channels.newChannel(website.openStream());
FileOutputStream fos = new FileOutputStream(destination);
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
fos.close();
rbc.close();
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
if (!outputFile.getParentFile().exists()) {
if (!outputFile.getParentFile().mkdirs()) {
System.out.println(
"- ERROR creating output directory '"
+ outputFile.getParentFile().getAbsolutePath()
+ "'");
}
}
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
try {
downloadFileFromURL(url, outputFile);
System.out.println("Done");
System.exit(0);
} catch (Throwable e) {
System.out.println("- Error downloading");
e.printStackTrace();
System.exit(1);
}
}

private static void downloadFileFromURL(String urlString, File destination) throws Exception {
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
String username = System.getenv("MVNW_USERNAME");
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
Authenticator.setDefault(
new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password);
}
});
}
URL website = new URL(urlString);
ReadableByteChannel rbc;
rbc = Channels.newChannel(website.openStream());
FileOutputStream fos = new FileOutputStream(destination);
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
fos.close();
rbc.close();
}
}
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,21 @@ Stereotypes and meta-properties that are essential to OntoUML modeling are easil

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)
![GIF showing a OntoUML model being edited](./docs/feature-modeling.gif)

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

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

![A screenshot of restricted instances menu selection](./resources/feature-restricte-to.png)
![A screenshot of restricted instances menu selection](./docs/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)
![A screenshot of an automatically painted diagram](./docs/feature-smart-paint.png)

#### Smart Modeling

Expand All @@ -63,7 +63,7 @@ Automatic verification of OntoUML syntactical rules which are reported to the us

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)
![A gif exemplifying the model verification feature](./docs/feature-verification.gif)

#### Model Transformation to OWL with gUFO

Expand All @@ -73,15 +73,15 @@ Users must select the elements that shall be exported to gUFO either selecting f

**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)
![A screenshot showing the "transformation to gUFO" window](./docs/feature-gufo.png)

#### Continuous Updates

The cloud-based features offered in the plugin are periodically updated. Updates in these features usually do not require updates in the 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)
![A screenshot showing the toolbar of the OntoUML plugin](./docs/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).

Expand All @@ -93,9 +93,9 @@ ___

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](./docs/toolbar-help-install.png)

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

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

Expand Down Expand Up @@ -229,11 +229,11 @@ ___

### 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)
![Error message: ID already in use](./docs/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)
![Install plugin window](./docs/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.

Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
24 changes: 21 additions & 3 deletions 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.3.1-SNAPSHOT</version>
<version>0.4.0</version>

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

Expand Down Expand Up @@ -178,8 +178,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<source>11</source>
<target>11</target>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -253,6 +253,24 @@
</arguments>
</configuration>
</plugin>
<plugin>
<groupId>com.coveo</groupId>
<artifactId>fmt-maven-plugin</artifactId>
<version>2.10</version>
<configuration>
<verbose>true</verbose>
<skip>false</skip>
<style>google</style>
</configuration>
<executions>
<execution>
<phase>process-sources</phase>
<goals>
<goal>format</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>

</build>
Expand Down
Loading

0 comments on commit a2f9e34

Please sign in to comment.