Skip to content

Commit

Permalink
Project Update
Browse files Browse the repository at this point in the history
- Numerous improvements and bug fixes.
- Start of code-mining implementation (https://www.eclipse.org/eclipse/news/4.8/platform_isv.php)
  • Loading branch information
JonnathanRiquelmo committed Dec 6, 2021
1 parent 22eee33 commit b365fdc
Show file tree
Hide file tree
Showing 110 changed files with 2,872 additions and 1,286 deletions.
73 changes: 39 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,79 +4,83 @@


<h3 align="center">
Domain-Specific Language Implementation for Conceptual Modelling of Relational Databases
Domain-Specific Language (DSL) Implementation for Conceptual Modelling of Relational Databases

<h4 align="center">

![](https://img.shields.io/github/last-commit/ProjetoDSL/ERDSL?style=for-the-badge)
![](https://img.shields.io/github/last-commit/ProjetoDSL/ERDSL?style=flat-square)
![](https://img.shields.io/badge/Eclipse%20IDE->=2020‑03-blue?style=flat-square)
![](https://img.shields.io/badge/Xtext->=2.17.0-blue?style=flat-square)
![GitHub language count](https://img.shields.io/github/languages/count/ProjetoDSL/ERDSL?color=blue&style=flat-square)
![GitHub top language](https://img.shields.io/github/languages/top/ProjetoDSL/ERDSL?color=blue&style=flat-square)
![Lines of code](https://img.shields.io/tokei/lines/github.com/ProjetoDSL/ERDSL?color=blue&style=flat-square)
![License](https://img.shields.io/github/license/ProjetoDSL/ERDSL?color=blue&style=flat-square)

![](https://img.shields.io/badge/Eclipse%20IDE-2020‑06-yellow) ![](https://img.shields.io/badge/Xtext-2.21.0-blue)
---


<a href=""><img src="https://github.com/ProjetoDSL/ERDSL/blob/master/ToolOverview.png" alt="ToolOverview" border="0" /></a>

---

<a href="https://imgbb.com/"><img src="https://i.ibb.co/xgzx9XQ/gif1.gif" alt="gif1" border="0" /></a>

<a href="https://imgbb.com/"><img src="https://i.ibb.co/yVB30nV/gif2.gif" alt="gif2" border="0" /></a>

## Requirements (for development and/or use) ##

+ Openjdk version "11.0.7" 2020-04-14

+ OpenJDK Runtime Environment (build 11.0.7+10-post-Ubuntu-3ubuntu1)
---

+ OpenJDK 64-Bit Server VM (build 11.0.7+10-post-Ubuntu-3ubuntu1, mixed mode, sharing)

+ Eclipse IDE 2020-03 or newer.
### Recommended Requirements (for development and/or use) ##

+ Xtext 2.17.0 or newer.
+ Openjdk "11.0.7" version or newer;
+ Eclipse IDE 2020-03 version or newer;
+ Xtext 2.17.0 version or newer.

---

## Project Building
### Project Building



1. You can fork the repository, creating your local copy. Forking a repository allows you to freely experiment changes without affecting the original project.

2. Alternatively, you can clone this project directly with a simple command:
1. Alternatively, you can clone this project directly with a simple command:

```bash
```zsh
$ git clone https://github.com/ProjetoDSL/ERDSL.git
```
3. To build the project, you need to start the Eclipse IDE and open the directory containing the project.

4. There will be 5 more subprojects, the majority of the implementation manually made being contained in the subdirectories.
1. To build the project, you need to start the Eclipse IDE and open the directory containing the project.

> /org.xtext.unipampa.erdsl/src/org/xtext/unipampa/erdsl
1. This project is composed of 5 related subprojects. Most of the DSL implementation is in the **org.xtext.unipampa.erdsl** project. This one contains the implementation of grammar, generators and scoping/validations.

> /org.xtext.unipampa.erdsl/src/org/xtext/unipampa/erdsl/generator

> /org.xtext.unipampa.erdsl/src/org/xtext/unipampa/erdsl/scoping
1. The other subprojects are related to testing, UI and IDE modifications.

> /org.xtext.unipampa.erdsl/src/org/xtext/unipampa/erdsl/validation

5. If you want to change some aspect of the grammar of the language, go to:
1. If you want to change any aspect of the language's grammar, go to:

> /org.xtext.unipampa.erdsl/src/org/xtext/unipampa/erdsl/ErDsl.xtext


5.1.After changes or additions, rigth click *ErDsl.xtext* file.
5.1.After changes, rigth click *ErDsl.xtext* file.

5.2. In the context menu select *Run As* **>>** *Generate Xtext Artifacts*.

6. If you want to change any aspect of the generator responsible for the transformation between the models, go to:
1. If you want to change any aspect of the generators responsible for the transformation between the models, go to:

> /org.xtext.unipampa.erdsl/src/org/xtext/unipampa/erdsl/generator/ErDslGenerator.xtend
> /org.xtext.unipampa.erdsl/src/org/xtext/unipampa/erdsl/generator/

1. There are currently 5 implemented generators: A main generator that dispatches the described models to subgenerators. These subgenerators are responsible for creating the supported files (conceptual diagram, textual logical model and SQL for PostgreSQL and MySQL DBMS).

7. To generate the language plugin go to the top bar menu:
1. To generate the language plugin go to the top bar menu:

7.1. Click in *File* **>>** *Export* .
1. Click in *File* **>>** *Export* .

7.2. Type "plugin" in the wizard.
1. Type "plugin" in the wizard.

7.3. Select *Deployable plugins and fragments*.
1. Select *Deployable plugins and fragments*.

7.4. For the options that appear, generate at least the plug-in for:
1. For the options that appear, generate at least the plug-in for:

> org.xtext.unipampa.erdsl

Expand All @@ -87,23 +91,24 @@
---


## Using the Generated Plugin

### Using the Tool

1. Move the set of generated plugins in your Eclipse's plugin folder (/eclipse/plugins).

2. Open the Eclipse IDE with a new workspace.

3. Start a empty java project.
3. Start a ERtext project.

4. Create a file with the .erdsl extension in *src* directory
4. You can create more than one file with the .erdsl extension in the *src* directory. Anyway, the project wizard automatically creates an empty template file.

5. If asked by IDE if you want to change the view mode to the xtext context, accept.

6. Start building your model.

7. When you finish your model, see if the IDE validates it and then save.

8. Look at the *src-gen* directory and see the generated .html file, the result of transforming the conceptual model into a logical model.
8. Look in the * src-gen * directory to see the generated files: it is possible to generate a .png diagram representing the conceptual model made (and a .puml file with the description using PlantUML's DSL), a .html file as a logical description , and two SQL files for different DBMSs

---

Expand Down
Binary file added ToolOverview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions org.xtext.unipampa.erdsl.ide/.project
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,15 @@
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
</natures>
<filteredResources>
<filter>
<id>1636089992886</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* generated by Xtext 2.25.0
*/
package org.xtext.unipampa.erdsl.ide


/**
* Use this class to register ide components.
*/
class ErDslIdeModule extends AbstractErDslIdeModule {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* generated by Xtext 2.25.0
*/
package org.xtext.unipampa.erdsl.ide

import com.google.inject.Guice
import org.eclipse.xtext.util.Modules2
import org.xtext.unipampa.erdsl.ErDslRuntimeModule
import org.xtext.unipampa.erdsl.ErDslStandaloneSetup

/**
* Initialization support for running Xtext languages as language servers.
*/
class ErDslIdeSetup extends ErDslStandaloneSetup {

override createInjector() {
Guice.createInjector(Modules2.mixin(new ErDslRuntimeModule, new ErDslIdeModule))
}

}
Binary file not shown.
Binary file not shown.
11 changes: 11 additions & 0 deletions org.xtext.unipampa.erdsl.tests/.project
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,15 @@
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
</natures>
<filteredResources>
<filter>
<id>1636089992892</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
Binary file not shown.
Binary file not shown.
11 changes: 11 additions & 0 deletions org.xtext.unipampa.erdsl.ui.tests/.project
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,15 @@
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
</natures>
<filteredResources>
<filter>
<id>1636089992903</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
Binary file not shown.
11 changes: 11 additions & 0 deletions org.xtext.unipampa.erdsl.ui/.project
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,15 @@
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
</natures>
<filteredResources>
<filter>
<id>1636089992898</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
3 changes: 2 additions & 1 deletion org.xtext.unipampa.erdsl.ui/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ Require-Bundle: org.xtext.unipampa.erdsl,
org.eclipse.core.resources,
org.eclipse.pde.core,
org.eclipse.ui.forms
Import-Package: org.apache.log4j
Import-Package: org.apache.log4j,
org.eclipse.xtext.ui.codemining;resolution:=optional
Bundle-RequiredExecutionEnvironment: JavaSE-11
Export-Package: org.xtext.unipampa.erdsl.ui.contentassist,
org.xtext.unipampa.erdsl.ui.internal,
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package org.xtext.unipampa.erdsl.ui.codemining

import org.eclipse.jface.text.BadLocationException
import org.eclipse.jface.text.IDocument
import org.eclipse.jface.text.codemining.ICodeMining
import org.eclipse.xtext.resource.XtextResource
import org.eclipse.xtext.ui.codemining.AbstractXtextCodeMiningProvider
import org.eclipse.xtext.util.CancelIndicator
import org.eclipse.xtext.util.IAcceptor
import org.xtext.unipampa.erdsl.erDsl.Entity
import org.xtext.unipampa.erdsl.erDsl.ERModel

class ErDslCodeMiningProvider extends AbstractXtextCodeMiningProvider {
override void createCodeMinings(IDocument document, XtextResource resource, CancelIndicator indicator,
IAcceptor<? super ICodeMining> acceptor) throws BadLocationException {

// TODO: implement me
// use acceptor.accept(super.createNewLineHeaderCodeMining(...)) to add a new code mining to the final list


// val modeloER = resource.contents.get(0) as ERModel
// var ent = 0
// var rel = 0
//
// for (e : modeloER.entities) {
// ent = ent + 1
// }
//
// for (e : modeloER.relations) {
// rel = rel + 1
// }
//
// acceptor.accept(createNewLineHeaderCodeMining(0, document, " There are ["+ ent.toString +"] modeled entity(ies) and ["+ rel.toString +"] relationship(s) "))
//
// ent = 0
// rel = 0
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit b365fdc

Please sign in to comment.